Update of /cvsroot/pywin32/pywin32/win32/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8081
Modified Files:
win32gui.i
Log Message:
Add GetIconInfo, CreateBitmap and GetMenuDefaultItem
Index: win32gui.i
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/win32gui.i,v
retrieving revision 1.46
retrieving revision 1.47
diff -C2 -d -r1.46 -r1.47
*** win32gui.i 15 Aug 2004 07:35:37 -0000 1.46
--- win32gui.i 7 Sep 2004 02:04:28 -0000 1.47
***************
*** 288,291 ****
--- 288,317 ----
%typemap(python,argout) POINT *BOTH = POINT *OUTPUT;
+ %typemap(python,argout) ICONINFO *OUTPUT {
+ PyObject *o;
+ o = Py_BuildValue("lllll", $source->fIcon, $source->xHotspot,
+ $source->yHotspot, $source->hbmMask, $source->hbmColor);
+ if (!$target) {
+ $target = o;
+ } else if ($target == Py_None) {
+ Py_DECREF(Py_None);
+ $target = o;
+ } else {
+ if (!PyList_Check($target)) {
+ PyObject *o2 = $target;
+ $target = PyList_New(0);
+ PyList_Append($target,o2);
+ Py_XDECREF(o2);
+ }
+ PyList_Append($target,o);
+ Py_XDECREF(o);
+ }
+ }
+
+ %typemap(python,ignore) ICONINFO *OUTPUT(ICONINFO temp)
+ {
+ $target = &temp;
+ }
+
%typemap(python,except) LRESULT {
Py_BEGIN_ALLOW_THREADS
***************
*** 1945,1948 ****
--- 1971,1983 ----
);
+ // @pyswig HBITMAP|CreateBitmap|Creates a bitmap
+ HBITMAP CreateBitmap(
+ int nWidth, // @pyparm int|width||bitmap width, in pixels
+ int nHeight, // @pyparm int|height||bitmap height, in pixels
+ UINT cPlanes, // @pyparm int|cPlanes||number of color planes
+ UINT cBitsPerPel, // @pyparm int|cBitsPerPixel||number of bits to identify color
+ NULL_ONLY null // @pyparm None|bitmap bits||Must be None
+ );
+
// @pyswig HGDIOBJ|SelectObject|Selects an object into the specified device context (DC). The new object replaces the previous object of the same type.
HGDIOBJ SelectObject(
***************
*** 2468,2471 ****
--- 2503,2511 ----
BOOLAPI DestroyIcon( HICON hicon);
+ // @pyswig tuple|GetIconInfo|
+ // @pyparm int|hicon||The icon to query
+ // @rdesc The result is a tuple of (fIcon, xHotspot, yHotspot, hbmMask, hbmColor)
+ // The hbmMask and hbmColor items are bitmaps created for the caller, so must be freed.
+ BOOLAPI GetIconInfo( HICON hicon, ICONINFO *OUTPUT);
// @pyswig |ScreenToClient|Convert screen coordinates to client coords
***************
*** 2528,2531 ****
--- 2568,2574 ----
BOOLAPI SetMenuDefaultItem(HMENU hMenu, UINT flags, UINT fByPos);
+ // @pyswig |GetMenuDefaultItem|
+ int GetMenuDefaultItem(HMENU hMenu, UINT fByPos, UINT flags);
+
// @pyswig |AppendMenu|
BOOLAPI AppendMenu(HMENU hMenu, UINT uFlags, UINT uIDNewItem, TCHAR *lpNewItem);
|