[pywin32-checkins] pywin32/win32/src/win32print win32print.cpp, 1.22, 1.23
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Roger U. <ru...@us...> - 2006-12-09 02:56:38
|
Update of /cvsroot/pywin32/pywin32/win32/src/win32print In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5879/win32/src/win32print Modified Files: win32print.cpp Log Message: Add GetDeviceCaps Index: win32print.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32print/win32print.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** win32print.cpp 8 Dec 2006 09:26:46 -0000 1.22 --- win32print.cpp 9 Dec 2006 02:56:36 -0000 1.23 *************** *** 2065,2068 **** --- 2065,2087 ---- } + // @pymethod int|win32print|GetDeviceCaps|Retrieves device-specific parameters and settings + // @comm Can also be used for Display DCs in addition to printer DCs + // @pyseeapi GetDeviceCaps + static PyObject *PyGetDeviceCaps(PyObject *self, PyObject *args) + { + PyObject *obdc; + DWORD index; + int ret; + HDC hdc; + if (!PyArg_ParseTuple(args, "Ok", + &obdc, // @pyparm <o PyHANDLE>|hdc||Handle to a printer or display device context + &index)) // @pyparm int|Index||The capability to return. See MSDN for valid values. + return NULL; + if (!PyWinObject_AsHANDLE(obdc, (HANDLE *)&hdc)) + return NULL; + ret=GetDeviceCaps(hdc, index); + return Py_BuildValue("i", ret); + } + // @pymethod (dict,...)|win32print|EnumMonitors|Lists installed printer port monitors static PyObject *PyEnumMonitors(PyObject *self, PyObject *args) *************** *** 2480,2483 **** --- 2499,2503 ---- {"ScheduleJob", PyScheduleJob, 1}, //@pymeth ScheduleJob|Schedules a spooled job to be printed {"DeviceCapabilities", PyDeviceCapabilities, 1}, //@pymeth DeviceCapabilities|Queries a printer for its capabilities + {"GetDeviceCaps", PyGetDeviceCaps, METH_VARARGS}, //@pymeth GetDeviceCaps|Retrieves device-specific parameters and settings {"EnumMonitors", PyEnumMonitors, 1}, //@pymeth EnumMonitors|Lists installed printer port monitors {"EnumPorts", PyEnumPorts, 1}, //@pymeth EnumPorts|Lists printer ports on a server |