[pywin32-checkins] pywin32/win32/src win32gui.i,1.68,1.69
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Roger U. <ru...@us...> - 2005-09-30 04:12:59
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6203/win32/src Modified Files: win32gui.i Log Message: Document parameters to callback function used with EnumFontFamilies Add lfFaceName to PyLOGFONT's member list, check size on input Index: win32gui.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32gui.i,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** win32gui.i 17 Sep 2005 01:58:29 -0000 1.68 --- win32gui.i 30 Sep 2005 04:12:51 -0000 1.69 *************** *** 108,111 **** --- 108,112 ---- PyDict_SetItemString(d, "dllhandle", PyLong_FromVoidPtr(g_dllhandle)); PyDict_SetItemString(d, "error", PyWinExc_ApiError); + %} *************** *** 1023,1026 **** --- 1024,1028 ---- {"lfQuality", T_BYTE, OFF(m_LOGFONT.lfQuality)}, // @prop integer|lfQuality| {"lfPitchAndFamily", T_BYTE, OFF(m_LOGFONT.lfPitchAndFamily)}, // @prop integer|lfPitchAndFamily| + {"lfFaceName", T_LONG, 0}, // @prop string|lfFaceName|Name of the typeface, at most 31 characters {NULL} /* Sentinel */ }; *************** *** 1063,1069 **** PyLOGFONT *pL = (PyLOGFONT *)self; TCHAR *face; ! if (!PyWinObject_AsTCHAR(v, &face)) ! return NULL; _tcsncpy( pL->m_LOGFONT.lfFaceName, face, LF_FACESIZE ); return 0; } --- 1065,1078 ---- PyLOGFONT *pL = (PyLOGFONT *)self; TCHAR *face; ! DWORD facesize; ! if (!PyWinObject_AsTCHAR(v, &face, FALSE, &facesize)) ! return -1; ! if (facesize >= LF_FACESIZE){ // LF_FACESIZE includes the trailing NULL ! PyErr_Format(PyExc_ValueError, "lfFaceName must be less than %d characters", LF_FACESIZE); ! PyWinObject_FreeTCHAR(face); ! return -1; ! } _tcsncpy( pL->m_LOGFONT.lfFaceName, face, LF_FACESIZE ); + PyWinObject_FreeTCHAR(face); return 0; } *************** *** 1110,1117 **** PyObject *obExtra = Py_None; long hdc; ! // @pyparm int|hdc|| ! // @pyparm string/<o PyUnicode>|family|| ! // @pyparm function|proc||The Python function called with each font family. This function is called with 4 arguments. ! // @pyparm object|extra||An extra param passed to the enum procedure. if (!PyArg_ParseTuple(args, "lOO|O", &hdc, &obFamily, &obProc, &obExtra)) return NULL; --- 1119,1132 ---- PyObject *obExtra = Py_None; long hdc; ! // @pyparm int|hdc||Handle to a device context for which to enumerate available fonts ! // @pyparm string/<o PyUnicode>|Family||Family of fonts to enumerate. If none, first member of each font family will be returned. ! // @pyparm function|EnumFontFamProc||The Python function called with each font family. This function is called with 4 arguments. ! // @pyparm object|Param||An arbitrary object to be passed to the callback function ! // @comm The parameters that the callback function will receive are as follows:<nl> ! // <o PyLOGFONT> - contains the font parameters<nl> ! // None - Placeholder for a TEXTMETRIC structure, not supported yet<nl> ! // int - Font type, combination of DEVICE_FONTTYPE, RASTER_FONTTYPE, TRUETYPE_FONTTYPE<nl> ! // object - The Param originally passed in to EnumFontFamilies ! if (!PyArg_ParseTuple(args, "lOO|O", &hdc, &obFamily, &obProc, &obExtra)) return NULL; *************** *** 2315,2320 **** BOOLAPI DestroyWindow(HWND hwnd); ! // @pyswig int|EnableWindow| ! BOOL EnableWindow(HWND hwnd, BOOL bEnable); // @pyswig int|FindWindow|Retrieves a handle to the top-level window whose class name and window name match the specified strings. --- 2330,2338 ---- BOOLAPI DestroyWindow(HWND hwnd); ! // @pyswig int|EnableWindow|Enables and disables keyboard and mouse input to a window ! // @rdesc Returns True if window was already disabled when call was made, False otherwise ! BOOL EnableWindow( ! HWND hwnd, // @pyparm <o PyHANDLE>|hWnd||Handle to window ! BOOL bEnable); // @pyparm boolean|bEnable||True to enable input to the window, False to disable input // @pyswig int|FindWindow|Retrieves a handle to the top-level window whose class name and window name match the specified strings. *************** *** 3654,3655 **** --- 3672,3674 ---- } %} + |