[pywin32-checkins] pywin32/win32/src win32gui.i, 1.107, 1.108 win32helpmodule.cpp, 1.3, 1.4
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2007-05-27 13:25:44
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17551 Modified Files: win32gui.i win32helpmodule.cpp Log Message: Replace all uses of T_INT to deal with pointer/handle properties with explicit get/setattr code. Index: win32helpmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32helpmodule.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** win32helpmodule.cpp 1 Oct 2004 00:11:56 -0000 1.3 --- win32helpmodule.cpp 27 May 2007 13:25:42 -0000 1.4 *************** *** 1044,1051 **** {"showState", T_INT, OFF(m_HH_WINTYPE.nShowState)}, // HWND hwndHelp; // @prop int|hwndHelp|Specifies the handle of the window if the window has //been created. - {"hwndHelp", T_INT, OFF(m_HH_WINTYPE.hwndHelp)}, // HWND hwndCaller; --- 1044,1051 ---- {"showState", T_INT, OFF(m_HH_WINTYPE.nShowState)}, + // These params handled below... // HWND hwndHelp; // @prop int|hwndHelp|Specifies the handle of the window if the window has //been created. // HWND hwndCaller; *************** *** 1053,1070 **** //notification messages. Notification messages are sent via Windows //WM_NOTIFY messages. - {"hwndCaller", T_INT, OFF(m_HH_WINTYPE.hwndCaller)}, // HWND hwndToolBar; // @prop int|hwndToolBar|Specifies the handle of the toolbar. - {"hwndToolBar", T_INT, OFF(m_HH_WINTYPE.hwndToolBar)}, // HWND hwndNavigation; // @prop int|hwndNavigation|Specifies the handle of the Navigation pane. - {"hwndNavigation", T_INT, OFF(m_HH_WINTYPE.hwndNavigation)}, // HWND hwndHTML; // @prop int|hwndHTML|Specifies the handle of the Topic pane, which hosts //Shdocvw.dll. - {"hwndHTML", T_INT, OFF(m_HH_WINTYPE.hwndHTML)}, // int iNavWidth; --- 1053,1066 ---- *************** *** 1343,1346 **** --- 1339,1356 ---- } + if (strcmp("hwndHelp", name)==0) + return PyWinLong_FromVoidPtr(pO->m_HH_WINTYPE.hwndHelp); + + if (strcmp("hwndCaller", name)==0) + return PyWinLong_FromVoidPtr(pO->m_HH_WINTYPE.hwndCaller); + + if (strcmp("hwndToolBar", name)==0) + return PyWinLong_FromVoidPtr(pO->m_HH_WINTYPE.hwndToolBar); + + if (strcmp("hwndNavigation", name)==0) + return PyWinLong_FromVoidPtr(pO->m_HH_WINTYPE.hwndNavigation); + + if (strcmp("hwndHTML", name)==0) + return PyWinLong_FromVoidPtr(pO->m_HH_WINTYPE.hwndHTML); return PyMember_Get((char *)self, memberlist, name); } *************** *** 1476,1479 **** --- 1486,1504 ---- return -1; } + if (strcmp("hwndHelp", name)==0) + return PyWinLong_AsVoidPtr(v, (void **)&pO->m_HH_WINTYPE.hwndHelp) ? 0 : -1; + + if (strcmp("hwndCaller", name)==0) + return PyWinLong_AsVoidPtr(v, (void **)&pO->m_HH_WINTYPE.hwndCaller) ? 0 : -1; + + if (strcmp("hwndToolBar", name)==0) + return PyWinLong_AsVoidPtr(v, (void **)&pO->m_HH_WINTYPE.hwndToolBar) ? 0 : -1; + + if (strcmp("hwndNavigation", name)==0) + return PyWinLong_AsVoidPtr(v, (void **)&pO->m_HH_WINTYPE.hwndNavigation) ? 0 : -1; + + if (strcmp("hwndHTML", name)==0) + return PyWinLong_AsVoidPtr(v, (void **)&pO->m_HH_WINTYPE.hwndHTML) ? 0 : -1; + return PyMember_Set((char *)self, memberlist, name, v); } Index: win32gui.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32gui.i,v retrieving revision 1.107 retrieving revision 1.108 diff -C2 -d -r1.107 -r1.108 *** win32gui.i 24 May 2007 06:01:06 -0000 1.107 --- win32gui.i 27 May 2007 13:25:42 -0000 1.108 *************** *** 864,872 **** // {"cbClsExtra", T_INT, OFF(m_WNDCLASS.cbClsExtra)}, // @prop integer|cbClsExtra| {"cbWndExtra", T_INT, OFF(m_WNDCLASS.cbWndExtra)}, // @prop integer|cbWndExtra| ! {"hInstance", T_INT, OFF(m_WNDCLASS.hInstance)}, // @prop integer|hInstance| ! {"hIcon", T_INT, OFF(m_WNDCLASS.hIcon)}, // @prop integer|hIcon| ! {"hCursor", T_INT, OFF(m_WNDCLASS.hCursor)}, // @prop integer|hCursor| ! {"hbrBackground", T_INT, OFF(m_WNDCLASS.hbrBackground)}, // @prop integer|hbrBackground| ! {NULL} /* Sentinel */ // These 3 handled manually in PyWNDCLASS::getattr/setattr. The pymeth below is used as an // end tag, so these props will be lost if below it --- 864,875 ---- // {"cbClsExtra", T_INT, OFF(m_WNDCLASS.cbClsExtra)}, // @prop integer|cbClsExtra| {"cbWndExtra", T_INT, OFF(m_WNDCLASS.cbWndExtra)}, // @prop integer|cbWndExtra| ! {NULL} ! ! // ack - these are also handled now explicitly, as T_LONGLONG is too ! // stupid to handle ints :( ! // @prop integer|hInstance| ! // @prop integer|hIcon| ! // @prop integer|hCursor| ! // @prop integer|hbrBackground| // These 3 handled manually in PyWNDCLASS::getattr/setattr. The pymeth below is used as an // end tag, so these props will be lost if below it *************** *** 933,936 **** --- 936,951 ---- return ret; } + if (strcmp("hInstance", name)==0) + return PyWinLong_FromVoidPtr(pW->m_WNDCLASS.hInstance); + + if (strcmp("hIcon", name)==0) + return PyWinLong_FromVoidPtr(pW->m_WNDCLASS.hIcon); + + if (strcmp("hCursor", name)==0) + return PyWinLong_FromVoidPtr(pW->m_WNDCLASS.hCursor); + + if (strcmp("hbrBackground", name)==0) + return PyWinLong_FromVoidPtr(pW->m_WNDCLASS.hbrBackground); + return PyMember_Get((char *)self, memberlist, name); } *************** *** 983,986 **** --- 998,1013 ---- return 0; } + if (strcmp("hInstance", name)==0) + return PyWinLong_AsVoidPtr(v, (void **)&pW->m_WNDCLASS.hInstance) ? 0 : -1; + + if (strcmp("hIcon", name)==0) + return PyWinLong_AsVoidPtr(v, (void **)&pW->m_WNDCLASS.hIcon) ? 0 : -1; + + if (strcmp("hCursor", name)==0) + return PyWinLong_AsVoidPtr(v, (void **)&pW->m_WNDCLASS.hCursor) ? 0 : -1; + + if (strcmp("hbrBackground", name)==0) + return PyWinLong_AsVoidPtr(v, (void **)&pW->m_WNDCLASS.hbrBackground) ? 0 : -1; + return PyMember_Set((char *)self, memberlist, name, v); } |