PyTuple_GetPointer introduced
This commit is contained in:
@@ -82,12 +82,12 @@ PyObject* grpImageGenerateExpanded(PyObject* poSelf, PyObject* poArgs)
|
||||
|
||||
PyObject* grpImageGenerateFromHandle(PyObject * poSelf, PyObject* poArgs)
|
||||
{
|
||||
unsigned long long iHandle;
|
||||
if (!PyTuple_GetUnsignedLongLong(poArgs, 0, &iHandle))
|
||||
CGraphicImage* iHandle;
|
||||
if (!PyTuple_GetPointer(poArgs, 0, &iHandle))
|
||||
return Py_BadArgument();
|
||||
|
||||
CGraphicImageInstance * pImageInstance = CGraphicImageInstance::New();
|
||||
pImageInstance->SetImagePointer((CGraphicImage *)iHandle);
|
||||
pImageInstance->SetImagePointer(iHandle);
|
||||
|
||||
return Py_BuildValue("K", pImageInstance);
|
||||
}
|
||||
|
||||
@@ -48,11 +48,10 @@ PyObject* grpCreateBigTextBar(PyObject* poSelf, PyObject* poArgs)
|
||||
|
||||
PyObject* grpDestroyTextBar(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
unsigned long long iHandle;
|
||||
if (!PyTuple_GetUnsignedLongLong(poArgs, 0, &iHandle))
|
||||
CTextBar* pTextBar;
|
||||
if (!PyTuple_GetPointer(poArgs, 0, &pTextBar))
|
||||
return Py_BuildException();
|
||||
|
||||
CTextBar * pTextBar = (CTextBar *)iHandle;
|
||||
delete pTextBar;
|
||||
|
||||
return Py_BuildNone();
|
||||
@@ -60,8 +59,8 @@ PyObject* grpDestroyTextBar(PyObject* poSelf, PyObject* poArgs)
|
||||
|
||||
PyObject* grpRenderTextBar(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
unsigned long long iHandle;
|
||||
if (!PyTuple_GetUnsignedLongLong(poArgs, 0, &iHandle))
|
||||
CTextBar* pTextBar;
|
||||
if (!PyTuple_GetPointer(poArgs, 0, &pTextBar))
|
||||
return Py_BuildException();
|
||||
int ix;
|
||||
if (!PyTuple_GetInteger(poArgs, 1, &ix))
|
||||
@@ -70,7 +69,6 @@ PyObject* grpRenderTextBar(PyObject* poSelf, PyObject* poArgs)
|
||||
if (!PyTuple_GetInteger(poArgs, 2, &iy))
|
||||
return Py_BuildException();
|
||||
|
||||
CTextBar * pTextBar = (CTextBar *)iHandle;
|
||||
if (pTextBar)
|
||||
pTextBar->Render(ix, iy);
|
||||
|
||||
@@ -79,8 +77,8 @@ PyObject* grpRenderTextBar(PyObject* poSelf, PyObject* poArgs)
|
||||
|
||||
PyObject* grpTextBarSetTextColor(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
unsigned long long iHandle;
|
||||
if (!PyTuple_GetUnsignedLongLong(poArgs, 0, &iHandle))
|
||||
CTextBar* pTextBar;
|
||||
if (!PyTuple_GetPointer(poArgs, 0, &pTextBar))
|
||||
return Py_BuildException();
|
||||
int r;
|
||||
if (!PyTuple_GetInteger(poArgs, 1, &r))
|
||||
@@ -92,7 +90,6 @@ PyObject* grpTextBarSetTextColor(PyObject* poSelf, PyObject* poArgs)
|
||||
if (!PyTuple_GetInteger(poArgs, 3, &b))
|
||||
return Py_BuildException();
|
||||
|
||||
CTextBar * pTextBar = (CTextBar *)iHandle;
|
||||
if (pTextBar)
|
||||
pTextBar->SetTextColor(r, g, b);
|
||||
|
||||
@@ -101,15 +98,14 @@ PyObject* grpTextBarSetTextColor(PyObject* poSelf, PyObject* poArgs)
|
||||
|
||||
PyObject* grpTextBarGetTextExtent(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
unsigned long long iHandle;
|
||||
if (!PyTuple_GetUnsignedLongLong(poArgs, 0, &iHandle))
|
||||
CTextBar* pTextBar;
|
||||
if (!PyTuple_GetPointer(poArgs, 0, &pTextBar))
|
||||
return Py_BuildException();
|
||||
char * szText;
|
||||
if (!PyTuple_GetString(poArgs, 1, &szText))
|
||||
return Py_BuildException();
|
||||
|
||||
SIZE size = {0, 0};
|
||||
CTextBar * pTextBar = (CTextBar *)iHandle;
|
||||
if (pTextBar)
|
||||
pTextBar->GetTextExtent(szText, &size);
|
||||
|
||||
@@ -118,8 +114,8 @@ PyObject* grpTextBarGetTextExtent(PyObject* poSelf, PyObject* poArgs)
|
||||
|
||||
PyObject* grpTextBarTextOut(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
unsigned long long iHandle;
|
||||
if (!PyTuple_GetUnsignedLongLong(poArgs, 0, &iHandle))
|
||||
CTextBar* pTextBar;
|
||||
if (!PyTuple_GetPointer(poArgs, 0, &pTextBar))
|
||||
return Py_BuildException();
|
||||
int ix;
|
||||
if (!PyTuple_GetInteger(poArgs, 1, &ix))
|
||||
@@ -131,7 +127,6 @@ PyObject* grpTextBarTextOut(PyObject* poSelf, PyObject* poArgs)
|
||||
if (!PyTuple_GetString(poArgs, 3, &szText))
|
||||
return Py_BuildException();
|
||||
|
||||
CTextBar * pTextBar = (CTextBar *)iHandle;
|
||||
if (pTextBar)
|
||||
pTextBar->TextOut(ix, iy, szText);
|
||||
|
||||
@@ -140,11 +135,10 @@ PyObject* grpTextBarTextOut(PyObject* poSelf, PyObject* poArgs)
|
||||
|
||||
PyObject* grpClearTextBar(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
unsigned long long iHandle;
|
||||
if (!PyTuple_GetUnsignedLongLong(poArgs, 0, &iHandle))
|
||||
CTextBar* pTextBar;
|
||||
if (!PyTuple_GetPointer(poArgs, 0, &pTextBar))
|
||||
return Py_BuildException();
|
||||
|
||||
CTextBar * pTextBar = (CTextBar *)iHandle;
|
||||
if (pTextBar)
|
||||
pTextBar->ClearBar();
|
||||
|
||||
@@ -153,8 +147,8 @@ PyObject* grpClearTextBar(PyObject* poSelf, PyObject* poArgs)
|
||||
|
||||
PyObject* grpSetTextBarClipRect(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
unsigned long long iHandle;
|
||||
if (!PyTuple_GetUnsignedLongLong(poArgs, 0, &iHandle))
|
||||
CTextBar* pTextBar;
|
||||
if (!PyTuple_GetPointer(poArgs, 0, &pTextBar))
|
||||
return Py_BuildException();
|
||||
int isx;
|
||||
if (!PyTuple_GetInteger(poArgs, 1, &isx))
|
||||
@@ -169,7 +163,6 @@ PyObject* grpSetTextBarClipRect(PyObject* poSelf, PyObject* poArgs)
|
||||
if (!PyTuple_GetInteger(poArgs, 4, &iey))
|
||||
return Py_BuildException();
|
||||
|
||||
CTextBar * pTextBar = (CTextBar *)iHandle;
|
||||
if (pTextBar)
|
||||
{
|
||||
RECT rect;
|
||||
|
||||
@@ -5,14 +5,10 @@
|
||||
|
||||
bool PyTuple_GetWindow(PyObject* poArgs, int pos, UI::CWindow ** ppRetWindow)
|
||||
{
|
||||
unsigned long long iHandle;
|
||||
if (!PyTuple_GetUnsignedLongLong(poArgs, pos, &iHandle))
|
||||
return false;
|
||||
if (!iHandle)
|
||||
if (!PyTuple_GetPointer(poArgs, pos, ppRetWindow))
|
||||
return false;
|
||||
|
||||
*ppRetWindow = (UI::CWindow*)iHandle;
|
||||
return true;
|
||||
return *ppRetWindow != nullptr;
|
||||
}
|
||||
|
||||
PyObject * wndMgrGetAspect(PyObject * poSelf, PyObject * poArgs)
|
||||
|
||||
Reference in New Issue
Block a user