[pywin32-checkins] pywin32/win32/src win32gui.i,1.51,1.52
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
|
From: Mark H. <mha...@us...> - 2004-10-09 00:37:07
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22346 Modified Files: win32gui.i Log Message: * Fix memory leak whenever a MSG structure was passed from Python to Win32. * Move AnimateWindow to winxpgui so we win32gui still works on Windows NT * Add SetLayeredWindowAttributes and UpdateLayeredWindow to winxpgui Index: win32gui.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32gui.i,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** win32gui.i 8 Oct 2004 21:56:48 -0000 1.51 --- win32gui.i 9 Oct 2004 00:36:57 -0000 1.52 *************** *** 15,18 **** --- 15,19 ---- #define _WIN32_IE 0x0501 // to enable balloon notifications in Shell_NotifyIcon #ifdef WINXPGUI + #define _WIN32_WINNT 0x0501 // This changes the entire world for XP! #define ISOLATION_AWARE_ENABLED 1 *************** *** 29,32 **** --- 30,34 ---- #include "commctrl.h" #include "windowsx.h" // For edit control hacks. + #include "malloc.h" #ifdef MS_WINCE *************** *** 172,176 **** %typemap(python,in) MSG *INPUT { ! $target = (MSG *)calloc(1, sizeof(MSG)); if (!PyArg_ParseTuple($source, "iiiii(ii):MSG param for $name", &$target->hwnd, --- 174,178 ---- %typemap(python,in) MSG *INPUT { ! $target = (MSG *)_alloca(sizeof(MSG)); if (!PyArg_ParseTuple($source, "iiiii(ii):MSG param for $name", &$target->hwnd, *************** *** 289,292 **** --- 291,306 ---- %typemap(python,argout) POINT *BOTH = POINT *OUTPUT; + %typemap(python,in) SIZE *INPUT { + SIZE s; + if (PyTuple_Check($source)) { + if (PyArg_ParseTuple($source, "ll", &s.cx, &s.cy) == 0) { + return PyErr_Format(PyExc_TypeError, "%s: a SIZE must be a tuple of integers", "$name"); + } + $target = &s; + } else { + return PyErr_Format(PyExc_TypeError, "%s: a SIZE must be a tuple of integers", "$name"); + } + } + %typemap(python,argout) ICONINFO *OUTPUT { PyObject *o; *************** *** 315,318 **** --- 329,346 ---- } + %typemap(python,in) BLENDFUNCTION *INPUT { + BLENDFUNCTION bf; + if (PyTuple_Check($source)) { + if (PyArg_ParseTuple($source, "bbbb:" "$name" " tuple", + &bf.BlendOp, &bf.BlendFlags, + &bf.SourceConstantAlpha, &bf.AlphaFormat) == 0) { + return NULL; + } + $target = &bf; + } else { + return PyErr_Format(PyExc_TypeError, "%s: This param must be a tuple of four integers", "$name"); + } + } + %typemap(python,except) LRESULT { Py_BEGIN_ALLOW_THREADS *************** *** 1142,1146 **** --- 1170,1179 ---- %native(FlashWindowEx) PyFlashWindowEx; + // To avoid LoadLibrary etc (ie, keep my life simple) for functions + // that don't exist on NT, only put them in winxpgui. + %ifdef WINXPGUI + // @pyswig |AnimateWindow|Enables you to produce special effects when showing or hiding windows. There are three types of animation: roll, slide, and alpha-blended fade. + // @comm To avoid complications with Windows NT, this function only exists in winxpgui (not win32gui) BOOLAPI AnimateWindow( HWND hwnd, // @pyparm int|hwnd||handle to window *************** *** 1149,1152 **** --- 1182,1210 ---- ); + // @pyswig |UpdateLayeredWindow|Updates the position, size, shape, content, and translucency of a layered window. + // @comm To avoid complications with Windows NT, this function only exists in winxpgui (not win32gui) + BOOLAPI UpdateLayeredWindow( + HWND hwnd, // @pyparm int|hwnd||handle to layered window + HDC hdcDst, // @pyparm int|hdcDst||handle to screen DC + POINT *INPUT, // @pyparm (x,y)|pointDest||new screen position + SIZE *INPUT, // @pyparm (cx, cy)|size||new size of the layered window + HDC hdcSrc, // @pyparm int|hdcSrc||handle to surface DC + POINT *INPUT, // @pyparm (x,y)|pointSrc||layer position + COLORREF crKey, // @pyparm int|colorKey||color key + BLENDFUNCTION *INPUT, // @pyparm (int, int, int, int)|blend||blend function + DWORD dwFlags // @pyparm int|flags||options + ); + + // @pyswig |SetLayeredWindowAttributes|Sets the opacity and transparency color key of a layered window. + // @comm To avoid complications with Windows NT, this function only exists in winxpgui (not win32gui) + BOOLAPI SetLayeredWindowAttributes( + HWND hwnd, // @pyparm int|hwnd||handle to the layered window + COLORREF crKey, // @pyparm int|colorKey||specifies the color key + int bAlpha, // @pyparm int|alpha||value for the blend function + DWORD dwFlags // @pyparm int|flags||action + ); + + %endif // End of winxpgui only functi0ons + // @pyswig int|GetWindowLong| // @pyparm int|hwnd|| |