[pywin32-checkins] pywin32/win32/src win32gui.i,1.88,1.89
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Roger U. <ru...@us...> - 2006-12-13 13:47:46
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5967/win32/src Modified Files: win32gui.i Log Message: Add PlgBlt Index: win32gui.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32gui.i,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -d -r1.88 -r1.89 *** win32gui.i 13 Dec 2006 12:48:51 -0000 1.88 --- win32gui.i 13 Dec 2006 13:47:44 -0000 1.89 *************** *** 44,47 **** --- 44,49 ---- typedef BOOL (WINAPI *AngleArcfunc)(HDC, int, int, DWORD, FLOAT, FLOAT); static AngleArcfunc pfnAngleArc=NULL; + typedef BOOL (WINAPI *PlgBltfunc)(HDC,CONST POINT *,HDC,int,int,int,int,HBITMAP,int,int); + static PlgBltfunc pfnPlgBlt=NULL; static PyObject *g_AtomMap = NULL; // Mapping class atoms to Python WNDPROC *************** *** 122,125 **** --- 124,128 ---- if (hmodule){ pfnAngleArc=(AngleArcfunc)GetProcAddress(hmodule,"AngleArc"); + pfnPlgBlt=(PlgBltfunc)GetProcAddress(hmodule,"PlgBlt"); } *************** *** 3879,3882 **** --- 3882,3927 ---- return ret; } + + // @pyswig |PlgBlt|Copies color from a rectangle into a parallelogram + static PyObject *PyPlgBlt(PyObject *self, PyObject *args) + { + CHECK_PFN(PlgBlt); + HDC srcdc, dstdc; + POINT *points=NULL; + int x, y, width, height, xmask=0, ymask=0; + DWORD point_cnt; + HBITMAP mask; + PyObject *obsrc, *obdst, *obmask=Py_None, *obpoints, *ret=NULL; + if (!PyArg_ParseTuple(args, "OOOiiii|Oii:PlgBlt", + &obdst, // @pyparm <o PyHANDLE>|Dest||Destination DC + &obpoints, // @pyparm tuple|Point||Sequence of 3 POINT tuples (x,y) describing a paralellogram + &obsrc, // @pyparm <o PyHANDLE>|Src||Source device context + &x, // @pyparm int|XSrc||Left edge of source rectangle + &y, // @pyparm int|YSrc||Top of source rectangle + &width, // @pyparm int|Width||Width of source rectangle + &height, // @pyparm int|Height||Height of source rectangle + &obmask, // @pyparm <o PyHANDLE>|Mask|None|Handle to monochrome bitmap to mask source + &xmask, // @pyparm int|xMask|0|x pos in mask + &ymask)) // @pyparm int|yMask|0|y pos in mask + return NULL; + if (!PyWinObject_AsHANDLE(obdst, (HANDLE *)&dstdc, FALSE)) + return NULL; + if (!PyWinObject_AsHANDLE(obsrc, (HANDLE *)&srcdc, FALSE)) + return NULL; + if (!PyWinObject_AsHANDLE(obmask, (HANDLE *)&mask, TRUE)) + return NULL; + if (!PyWinObject_AsPOINTArray(obpoints, &points, &point_cnt)) + return NULL; + if (point_cnt!=3) + PyErr_SetString(PyExc_ValueError, "Points must contain exactly 3 points."); + else if (!(*pfnPlgBlt)(dstdc, points, srcdc, x, y, width, height, mask, xmask, ymask)) + PyWin_SetAPIError("PlgBlt"); + else{ + Py_INCREF(Py_None); + ret=Py_None; + } + free(points); + return ret; + } %} %native (Polygon) PyPolygon; *************** *** 3885,3888 **** --- 3930,3934 ---- %native (PolyBezier) PyPolyBezier; %native (PolyBezierTo) PyPolyBezierTo; + %native (PlgBlt) PyPlgBlt; %{ *************** *** 4176,4189 **** %native (GetPath) PyGetPath; - /* - int GetPath( - HDC hdc, // handle to DC - LPPOINT lpPoints, // path vertices - LPBYTE lpTypes, // array of path vertex types - int nSize // count of points defining path - ); - */ - - // @pyswig int|CreateWindowEx|Creates a new window with Extended Style. HWND CreateWindowEx( --- 4222,4225 ---- |