small fixes regarding throwing pts around to python and back

This commit is contained in:
d1str4ught
2025-08-22 19:58:14 +02:00
parent 66bcca77c2
commit 5b71a1e352
20 changed files with 86 additions and 56 deletions

View File

@@ -17,10 +17,10 @@ PyObject* grpCreateTextBar(PyObject* poSelf, PyObject* poArgs)
if (!pTextBar->Create(NULL, iWidth, iHeight))
{
delete pTextBar;
return Py_BuildValue("i", NULL);
return Py_BuildValue("K", NULL);
}
return Py_BuildValue("i", pTextBar);
return Py_BuildValue("K", pTextBar);
}
PyObject* grpCreateBigTextBar(PyObject* poSelf, PyObject* poArgs)
@@ -40,16 +40,16 @@ PyObject* grpCreateBigTextBar(PyObject* poSelf, PyObject* poArgs)
if (!pTextBar->Create(NULL, iWidth, iHeight))
{
delete pTextBar;
return Py_BuildValue("i", NULL);
return Py_BuildValue("K", NULL);
}
return Py_BuildValue("i", pTextBar);
return Py_BuildValue("K", pTextBar);
}
PyObject* grpDestroyTextBar(PyObject* poSelf, PyObject* poArgs)
{
int iHandle;
if (!PyTuple_GetInteger(poArgs, 0, &iHandle))
unsigned long long iHandle;
if (!PyTuple_GetUnsignedLongLong(poArgs, 0, &iHandle))
return Py_BuildException();
CTextBar * pTextBar = (CTextBar *)iHandle;
@@ -60,8 +60,8 @@ PyObject* grpDestroyTextBar(PyObject* poSelf, PyObject* poArgs)
PyObject* grpRenderTextBar(PyObject* poSelf, PyObject* poArgs)
{
int iHandle;
if (!PyTuple_GetInteger(poArgs, 0, &iHandle))
unsigned long long iHandle;
if (!PyTuple_GetUnsignedLongLong(poArgs, 0, &iHandle))
return Py_BuildException();
int ix;
if (!PyTuple_GetInteger(poArgs, 1, &ix))
@@ -79,8 +79,8 @@ PyObject* grpRenderTextBar(PyObject* poSelf, PyObject* poArgs)
PyObject* grpTextBarSetTextColor(PyObject* poSelf, PyObject* poArgs)
{
int iHandle;
if (!PyTuple_GetInteger(poArgs, 0, &iHandle))
unsigned long long iHandle;
if (!PyTuple_GetUnsignedLongLong(poArgs, 0, &iHandle))
return Py_BuildException();
int r;
if (!PyTuple_GetInteger(poArgs, 1, &r))
@@ -101,8 +101,8 @@ PyObject* grpTextBarSetTextColor(PyObject* poSelf, PyObject* poArgs)
PyObject* grpTextBarGetTextExtent(PyObject* poSelf, PyObject* poArgs)
{
int iHandle;
if (!PyTuple_GetInteger(poArgs, 0, &iHandle))
unsigned long long iHandle;
if (!PyTuple_GetUnsignedLongLong(poArgs, 0, &iHandle))
return Py_BuildException();
char * szText;
if (!PyTuple_GetString(poArgs, 1, &szText))
@@ -118,8 +118,8 @@ PyObject* grpTextBarGetTextExtent(PyObject* poSelf, PyObject* poArgs)
PyObject* grpTextBarTextOut(PyObject* poSelf, PyObject* poArgs)
{
int iHandle;
if (!PyTuple_GetInteger(poArgs, 0, &iHandle))
unsigned long long iHandle;
if (!PyTuple_GetUnsignedLongLong(poArgs, 0, &iHandle))
return Py_BuildException();
int ix;
if (!PyTuple_GetInteger(poArgs, 1, &ix))
@@ -140,8 +140,8 @@ PyObject* grpTextBarTextOut(PyObject* poSelf, PyObject* poArgs)
PyObject* grpClearTextBar(PyObject* poSelf, PyObject* poArgs)
{
int iHandle;
if (!PyTuple_GetInteger(poArgs, 0, &iHandle))
unsigned long long iHandle;
if (!PyTuple_GetUnsignedLongLong(poArgs, 0, &iHandle))
return Py_BuildException();
CTextBar * pTextBar = (CTextBar *)iHandle;
@@ -153,8 +153,8 @@ PyObject* grpClearTextBar(PyObject* poSelf, PyObject* poArgs)
PyObject* grpSetTextBarClipRect(PyObject* poSelf, PyObject* poArgs)
{
int iHandle;
if (!PyTuple_GetInteger(poArgs, 0, &iHandle))
unsigned long long iHandle;
if (!PyTuple_GetUnsignedLongLong(poArgs, 0, &iHandle))
return Py_BuildException();
int isx;
if (!PyTuple_GetInteger(poArgs, 1, &isx))

View File

@@ -1147,8 +1147,8 @@ PyObject * wndMgrSetSlot(PyObject * poSelf, PyObject * poArgs)
if (!PyTuple_GetInteger(poArgs, 4, &iHeight))
return Py_BuildException();
int iImageHandle;
if (!PyTuple_GetInteger(poArgs, 5, &iImageHandle))
unsigned long long iImageHandle;
if (!PyTuple_GetUnsignedLongLong(poArgs, 5, &iImageHandle))
return Py_BuildException();
D3DXCOLOR diffuseColor;