[pywin32-checkins] pywin32/win32/src win32gui.i,1.93,1.94
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2007-01-02 00:53:04
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3600 Modified Files: win32gui.i Log Message: Don't have SWIG generate temp variables in their own scope - they will then only live as long as the scope. Index: win32gui.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32gui.i,v retrieving revision 1.93 retrieving revision 1.94 diff -C2 -d -r1.93 -r1.94 *** win32gui.i 24 Dec 2006 06:44:56 -0000 1.93 --- win32gui.i 2 Jan 2007 00:53:02 -0000 1.94 *************** *** 338,347 **** %typemap(python,in) RECT *INPUT { ! RECT r; if (PyTuple_Check($source)) { ! if (PyArg_ParseTuple($source, "llll", &r.left, &r.top, &r.right, &r.bottom) == 0) { return PyErr_Format(PyExc_TypeError, "%s: This param must be a tuple of four integers", "$name"); } ! $target = &r; } else { return PyErr_Format(PyExc_TypeError, "%s: This param must be a tuple of four integers", "$name"); --- 338,347 ---- %typemap(python,in) RECT *INPUT { ! RECT *r = (RECT *)_alloca(sizeof(RECT)); if (PyTuple_Check($source)) { ! if (PyArg_ParseTuple($source, "llll", &r->left, &r->top, &r->right, &r->bottom) == 0) { return PyErr_Format(PyExc_TypeError, "%s: This param must be a tuple of four integers", "$name"); } ! $target = r; } else { return PyErr_Format(PyExc_TypeError, "%s: This param must be a tuple of four integers", "$name"); *************** *** 350,359 **** %typemap(python,in) RECT *INPUT_NULLOK { ! RECT r; if (PyTuple_Check($source)) { ! if (PyArg_ParseTuple($source, "llll", &r.left, &r.top, &r.right, &r.bottom) == 0) { return PyErr_Format(PyExc_TypeError, "%s: This param must be a tuple of four integers or None", "$name"); } ! $target = &r; } else { if ($source == Py_None) { --- 350,359 ---- %typemap(python,in) RECT *INPUT_NULLOK { ! RECT *r = (RECT *)_alloca(sizeof(RECT)); if (PyTuple_Check($source)) { ! if (PyArg_ParseTuple($source, "llll", &r->left, &r->top, &r->right, &r->bottom) == 0) { return PyErr_Format(PyExc_TypeError, "%s: This param must be a tuple of four integers or None", "$name"); } ! $target = r; } else { if ($source == Py_None) { *************** *** 425,432 **** %typemap(python,in) POINT *INPUT { ! POINT pt; ! if (!PyWinObject_AsPOINT($source, &pt)) return NULL; ! $target = &pt; } --- 425,432 ---- %typemap(python,in) POINT *INPUT { ! POINT *pt = (POINT *)_alloca(sizeof(POINT)); ! if (!PyWinObject_AsPOINT($source, pt)) return NULL; ! $target = pt; } *************** *** 436,453 **** %typemap(python,in) SIZE *INPUT{ ! SIZE s; ! if (!PyWinObject_AsSIZE($source, &s)) return NULL; ! $target = &s; } %typemap(python,in) ICONINFO *INPUT { ! ICONINFO s; if (PyTuple_Check($source)) { ! if (PyArg_ParseTuple($source, "lllll", &s.fIcon, &s.xHotspot, &s.yHotspot, ! &s.hbmMask, &s.hbmColor) == 0) { return PyErr_Format(PyExc_TypeError, "%s: a ICONINFO must be a tuple of integers", "$name"); } ! $target = &s; } else { return PyErr_Format(PyExc_TypeError, "%s: a ICONINFO must be a tuple of integers", "$name"); --- 436,453 ---- %typemap(python,in) SIZE *INPUT{ ! SIZE *s = (SIZE *)_alloca(sizeof(SIZE)); ! if (!PyWinObject_AsSIZE($source, s)) return NULL; ! $target = s; } %typemap(python,in) ICONINFO *INPUT { ! ICONINFO *s = (ICONINFO *)_alloca(sizeof(ICONINFO)); if (PyTuple_Check($source)) { ! if (PyArg_ParseTuple($source, "lllll", &s->fIcon, &s->xHotspot, &s->yHotspot, ! &s->hbmMask, &s->hbmColor) == 0) { return PyErr_Format(PyExc_TypeError, "%s: a ICONINFO must be a tuple of integers", "$name"); } ! $target = s; } else { return PyErr_Format(PyExc_TypeError, "%s: a ICONINFO must be a tuple of integers", "$name"); *************** *** 482,489 **** %typemap(python,in) BLENDFUNCTION *INPUT { ! BLENDFUNCTION bf; ! if (!PyWinObject_AsBLENDFUNCTION($source, &bf)) return NULL; ! $target = &bf; } --- 482,489 ---- %typemap(python,in) BLENDFUNCTION *INPUT { ! BLENDFUNCTION *bf = (BLENDFUNCTION *)_alloca(sizeof(BLENDFUNCTION)); ! if (!PyWinObject_AsBLENDFUNCTION($source, bf)) return NULL; ! $target = bf; } *************** *** 521,525 **** %typemap(python,in) PAINTSTRUCT *INPUT { ! PAINTSTRUCT r; char *szReserved; int lenReserved; --- 521,525 ---- %typemap(python,in) PAINTSTRUCT *INPUT { ! PAINTSTRUCT *r = (PAINTSTRUCT *)_alloca(sizeof(PAINTSTRUCT)); char *szReserved; int lenReserved; *************** *** 527,544 **** if (!PyArg_ParseTuple($source, "ll(iiii)lls#", ! &r.hdc, ! &r.fErase, ! &r.rcPaint.left, &r.rcPaint.top, &r.rcPaint.right, &r.rcPaint.bottom, ! &r.fRestore, ! &r.fIncUpdate, &szReserved, &lenReserved)) { return NULL; } ! if (lenReserved != sizeof(r.rgbReserved)) return PyErr_Format(PyExc_ValueError, "%s: last element must be string of %d bytes", ! "$name", sizeof(r.rgbReserved)); ! memcpy(&r.rgbReserved, szReserved, sizeof(r.rgbReserved)); ! $target = &r; } else { return PyErr_Format(PyExc_TypeError, "%s: a PAINTSTRUCT must be a tuple", "$name"); --- 527,544 ---- if (!PyArg_ParseTuple($source, "ll(iiii)lls#", ! &r->hdc, ! &r->fErase, ! &r->rcPaint.left, &r->rcPaint.top, &r->rcPaint.right, &r->rcPaint.bottom, ! &r->fRestore, ! &r->fIncUpdate, &szReserved, &lenReserved)) { return NULL; } ! if (lenReserved != sizeof(r->rgbReserved)) return PyErr_Format(PyExc_ValueError, "%s: last element must be string of %d bytes", ! "$name", sizeof(r->rgbReserved)); ! memcpy(&r->rgbReserved, szReserved, sizeof(r->rgbReserved)); ! $target = r; } else { return PyErr_Format(PyExc_TypeError, "%s: a PAINTSTRUCT must be a tuple", "$name"); *************** *** 548,558 **** // @object TRACKMOUSEEVENT|A tuple of (dwFlags, hwndTrack, dwHoverTime) %typemap(python,in) TRACKMOUSEEVENT *INPUT { ! TRACKMOUSEEVENT e; ! e.cbSize = sizeof e; if (PyTuple_Check($source)) { ! if (PyArg_ParseTuple($source, "lll", &e.dwFlags, &e.hwndTrack, &e.dwHoverTime) == 0) { return PyErr_Format(PyExc_TypeError, "%s: a TRACKMOUSEEVENT must be a tuple of 3 integers", "$name"); } ! $target = &e; } else { return PyErr_Format(PyExc_TypeError, "%s: a TRACKMOUSEEVENT must be a tuple of 3 integers", "$name"); --- 548,558 ---- // @object TRACKMOUSEEVENT|A tuple of (dwFlags, hwndTrack, dwHoverTime) %typemap(python,in) TRACKMOUSEEVENT *INPUT { ! TRACKMOUSEEVENT *e = (TRACKMOUSEEVENT*)_alloca(sizeof(TRACKMOUSEEVENT)); ! e->cbSize = sizeof e; if (PyTuple_Check($source)) { ! if (PyArg_ParseTuple($source, "lll", &e->dwFlags, &e->hwndTrack, &e->dwHoverTime) == 0) { return PyErr_Format(PyExc_TypeError, "%s: a TRACKMOUSEEVENT must be a tuple of 3 integers", "$name"); } ! $target = e; } else { return PyErr_Format(PyExc_TypeError, "%s: a TRACKMOUSEEVENT must be a tuple of 3 integers", "$name"); |