pywin32-checkins Mailing List for Python for Windows Extensions (Page 98)
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(1) |
Jun
(6) |
Jul
(50) |
Aug
(11) |
Sep
(24) |
Oct
(184) |
Nov
(118) |
Dec
(22) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(31) |
Feb
(25) |
Mar
(34) |
Apr
(105) |
May
(49) |
Jun
(38) |
Jul
(39) |
Aug
(7) |
Sep
(98) |
Oct
(79) |
Nov
(20) |
Dec
(17) |
2005 |
Jan
(66) |
Feb
(32) |
Mar
(43) |
Apr
(30) |
May
(58) |
Jun
(30) |
Jul
(16) |
Aug
(4) |
Sep
(21) |
Oct
(42) |
Nov
(11) |
Dec
(14) |
2006 |
Jan
(42) |
Feb
(30) |
Mar
(22) |
Apr
(1) |
May
(9) |
Jun
(15) |
Jul
(20) |
Aug
(9) |
Sep
(8) |
Oct
(1) |
Nov
(9) |
Dec
(43) |
2007 |
Jan
(52) |
Feb
(45) |
Mar
(20) |
Apr
(12) |
May
(59) |
Jun
(39) |
Jul
(35) |
Aug
(31) |
Sep
(17) |
Oct
(20) |
Nov
(4) |
Dec
(4) |
2008 |
Jan
(28) |
Feb
(111) |
Mar
(4) |
Apr
(27) |
May
(40) |
Jun
(27) |
Jul
(32) |
Aug
(94) |
Sep
(87) |
Oct
(153) |
Nov
(336) |
Dec
(331) |
2009 |
Jan
(298) |
Feb
(127) |
Mar
(20) |
Apr
(8) |
May
|
Jun
(10) |
Jul
(6) |
Aug
|
Sep
(2) |
Oct
(2) |
Nov
|
Dec
(1) |
2010 |
Jan
(7) |
Feb
(1) |
Mar
|
Apr
|
May
(15) |
Jun
(4) |
Jul
(3) |
Aug
(28) |
Sep
(1) |
Oct
(19) |
Nov
(16) |
Dec
(6) |
2011 |
Jan
(2) |
Feb
(18) |
Mar
(17) |
Apr
(12) |
May
(5) |
Jun
(11) |
Jul
(7) |
Aug
(2) |
Sep
(2) |
Oct
(4) |
Nov
(4) |
Dec
|
2012 |
Jan
(6) |
Feb
(2) |
Mar
|
Apr
(8) |
May
(4) |
Jun
(3) |
Jul
(13) |
Aug
(27) |
Sep
(8) |
Oct
(9) |
Nov
(3) |
Dec
(2) |
2013 |
Jan
|
Feb
(1) |
Mar
(5) |
Apr
(10) |
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(9) |
2014 |
Jan
(2) |
Feb
(4) |
Mar
(4) |
Apr
(1) |
May
(4) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
(1) |
2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
(6) |
May
(2) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
(3) |
Feb
(2) |
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: Sidnei da S. <dre...@us...> - 2006-12-21 23:17:21
|
Update of /cvsroot/pywin32/pywin32/win32/src/win32print In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19745/win32/src/win32print Modified Files: Tag: AMD64 win32print.cpp Log Message: - Initial work on AMD64 support Index: win32print.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32print/win32print.cpp,v retrieving revision 1.23 retrieving revision 1.23.2.1 diff -C2 -d -r1.23 -r1.23.2.1 *** win32print.cpp 9 Dec 2006 02:56:36 -0000 1.23 --- win32print.cpp 21 Dec 2006 23:17:16 -0000 1.23.2.1 *************** *** 2451,2455 **** &sleep_ms)) // @pyparm int|Sleep||Number of milliseconds to suspend printer return NULL; ! if (PyString_AsStringAndSize(obbuf, (char **)&buf, (int *)&bufsize)==-1) return NULL; if (!(*pfnFlushPrinter)(hprinter, buf, bufsize, &bytes_written, sleep_ms)) --- 2451,2455 ---- &sleep_ms)) // @pyparm int|Sleep||Number of milliseconds to suspend printer return NULL; ! if (PyString_AsStringAndSize(obbuf, (char **)&buf, (Py_ssize_t *)&bufsize)==-1) return NULL; if (!(*pfnFlushPrinter)(hprinter, buf, bufsize, &bytes_written, sleep_ms)) |
From: Sidnei da S. <dre...@us...> - 2006-12-21 23:17:20
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/internet/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19745/com/win32comext/internet/src Modified Files: Tag: AMD64 PyIInternetProtocol.cpp PyIInternetProtocol.h PyIInternetProtocolRoot.cpp PyIInternetProtocolRoot.h Log Message: - Initial work on AMD64 support Index: PyIInternetProtocolRoot.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/internet/src/PyIInternetProtocolRoot.h,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** PyIInternetProtocolRoot.h 1 Sep 1999 23:15:28 -0000 1.1 --- PyIInternetProtocolRoot.h 21 Dec 2006 23:17:16 -0000 1.1.2.1 *************** *** 40,44 **** IInternetBindInfo __RPC_FAR * pOIBindInfo, DWORD grfPI, ! DWORD dwReserved); STDMETHOD(Continue)( --- 40,44 ---- IInternetBindInfo __RPC_FAR * pOIBindInfo, DWORD grfPI, ! HANDLE_PTR dwReserved); STDMETHOD(Continue)( Index: PyIInternetProtocolRoot.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/internet/src/PyIInternetProtocolRoot.cpp,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** PyIInternetProtocolRoot.cpp 26 Nov 1999 14:15:31 -0000 1.2 --- PyIInternetProtocolRoot.cpp 21 Dec 2006 23:17:16 -0000 1.2.2.1 *************** *** 206,210 **** /* [in] */ IInternetBindInfo __RPC_FAR * pOIBindInfo, /* [in] */ DWORD grfPI, ! /* [in] */ DWORD dwReserved) { PY_GATEWAY_METHOD; --- 206,210 ---- /* [in] */ IInternetBindInfo __RPC_FAR * pOIBindInfo, /* [in] */ DWORD grfPI, ! /* [in] */ HANDLE_PTR dwReserved) { PY_GATEWAY_METHOD; Index: PyIInternetProtocol.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/internet/src/PyIInternetProtocol.h,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** PyIInternetProtocol.h 1 Sep 1999 23:15:28 -0000 1.1 --- PyIInternetProtocol.h 21 Dec 2006 23:17:16 -0000 1.1.2.1 *************** *** 38,42 **** IInternetBindInfo __RPC_FAR * pOIBindInfo, DWORD grfPI, ! DWORD dwReserved); STDMETHOD(Continue)( --- 38,42 ---- IInternetBindInfo __RPC_FAR * pOIBindInfo, DWORD grfPI, ! HANDLE_PTR dwReserved); STDMETHOD(Continue)( Index: PyIInternetProtocol.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/internet/src/PyIInternetProtocol.cpp,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** PyIInternetProtocol.cpp 1 Sep 1999 23:15:28 -0000 1.1 --- PyIInternetProtocol.cpp 21 Dec 2006 23:17:16 -0000 1.1.2.1 *************** *** 147,151 **** // Std delegation ! STDMETHODIMP PyGInternetProtocol::Start(LPCWSTR szUrl, IInternetProtocolSink __RPC_FAR * pOIProtSink, IInternetBindInfo __RPC_FAR * pOIBindInfo, DWORD grfPI, DWORD dwReserved) { return PyGInternetProtocolRoot::Start(szUrl, pOIProtSink, pOIBindInfo, grfPI, dwReserved);} --- 147,151 ---- // Std delegation ! STDMETHODIMP PyGInternetProtocol::Start(LPCWSTR szUrl, IInternetProtocolSink __RPC_FAR * pOIProtSink, IInternetBindInfo __RPC_FAR * pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved) { return PyGInternetProtocolRoot::Start(szUrl, pOIProtSink, pOIBindInfo, grfPI, dwReserved);} |
From: Sidnei da S. <dre...@us...> - 2006-12-21 23:17:18
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19745/win32/src Modified Files: Tag: AMD64 PyDEVMODE.cpp PyIID.cpp PySECURITY_DESCRIPTOR.cpp PySID.cpp PyTime.cpp PyUnicode.cpp PyWinTypes.h dbi.cpp odbc.cpp win32api_display.cpp win32clipboardmodule.cpp win32credmodule.cpp win32security_sspi.cpp Log Message: - Initial work on AMD64 support Index: dbi.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/dbi.cpp,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -C2 -d -r1.8 -r1.8.2.1 *** dbi.cpp 7 Oct 2004 03:41:49 -0000 1.8 --- dbi.cpp 21 Dec 2006 23:17:16 -0000 1.8.2.1 *************** *** 92,96 **** { long l = PyInt_AsLong(dbiValue(o)); ! return PyString_FromStringAndSize(ctime(&l), 24); /* less \n */ } --- 92,96 ---- { long l = PyInt_AsLong(dbiValue(o)); ! return PyString_FromStringAndSize(ctime((const time_t *)&l), 24); /* less \n */ } Index: win32credmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32credmodule.cpp,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** win32credmodule.cpp 8 Sep 2006 06:49:55 -0000 1.2 --- win32credmodule.cpp 21 Dec 2006 23:17:16 -0000 1.2.2.1 *************** *** 46,50 **** PyObject *obKeyword, *obValue, *args; const void *value; ! int valuelen; BOOL ret; ZeroMemory(attr, sizeof(CREDENTIAL_ATTRIBUTE)); --- 46,50 ---- PyObject *obKeyword, *obValue, *args; const void *value; ! Py_ssize_t valuelen; BOOL ret; ZeroMemory(attr, sizeof(CREDENTIAL_ATTRIBUTE)); *************** *** 421,425 **** // @flag CertCredential|String containing the SHA1 hash of user's certificate case CertCredential:{ ! int hashlen; char *hash; if (PyString_AsStringAndSize(obcredential, &hash, &hashlen)==-1) --- 421,425 ---- // @flag CertCredential|String containing the SHA1 hash of user's certificate case CertCredential:{ ! Py_ssize_t hashlen; char *hash; if (PyString_AsStringAndSize(obcredential, &hash, &hashlen)==-1) Index: PyTime.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyTime.cpp,v retrieving revision 1.17 retrieving revision 1.17.2.1 diff -C2 -d -r1.17 -r1.17.2.1 *** PyTime.cpp 26 Aug 2006 08:26:37 -0000 1.17 --- PyTime.cpp 21 Dec 2006 23:17:16 -0000 1.17.2.1 *************** *** 410,414 **** /* "Normal" Win32 handling */ m_time = 0; ! struct tm *ptm = localtime(&t); if (ptm != NULL) { // otherwise an invalid integer --- 410,414 ---- /* "Normal" Win32 handling */ m_time = 0; ! struct tm *ptm = localtime((const time_t *)&t); if (ptm != NULL) { // otherwise an invalid integer Index: PyUnicode.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyUnicode.cpp,v retrieving revision 1.21 retrieving revision 1.21.2.1 diff -C2 -d -r1.21 -r1.21.2.1 *** PyUnicode.cpp 4 Jul 2005 05:39:03 -0000 1.21 --- PyUnicode.cpp 21 Dec 2006 23:17:16 -0000 1.21.2.1 *************** *** 27,31 **** BOOL rc = TRUE; if (PyString_Check(stringObject)) { ! int cch=PyString_Size(stringObject); const char *buf = PyString_AsString(stringObject); if (buf==NULL) return FALSE; --- 27,31 ---- BOOL rc = TRUE; if (PyString_Check(stringObject)) { ! Py_ssize_t cch=PyString_Size(stringObject); const char *buf = PyString_AsString(stringObject); if (buf==NULL) return FALSE; Index: odbc.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/odbc.cpp,v retrieving revision 1.17 retrieving revision 1.17.2.1 diff -C2 -d -r1.17 -r1.17.2.1 *** odbc.cpp 24 May 2006 08:40:41 -0000 1.17 --- odbc.cpp 21 Dec 2006 23:17:16 -0000 1.17.2.1 *************** *** 533,537 **** ob->bind_area, vsize, ! &ob->rcode))) { cursorError(cur, "BIND"); --- 533,537 ---- ob->bind_area, vsize, ! (SQLLEN *)&ob->rcode))) { cursorError(cur, "BIND"); *************** *** 682,686 **** ib->bind_area, len, ! &ib->len))) { cursorError(cur, "input-binding"); --- 682,686 ---- ib->bind_area, len, ! (SQLLEN *)&ib->len))) { cursorError(cur, "input-binding"); *************** *** 712,716 **** ib->bind_area, len, ! &ib->len))) { cursorError(cur, "input-binding"); --- 712,716 ---- ib->bind_area, len, ! (SQLLEN *)&ib->len))) { cursorError(cur, "input-binding"); *************** *** 742,746 **** 0, 0, ! &nl))) { cursorError(cur, "input-binding"); --- 742,746 ---- 0, 0, ! (SQLLEN *)&nl))) { cursorError(cur, "input-binding"); *************** *** 761,765 **** TIMESTAMP_STRUCT *dt = (TIMESTAMP_STRUCT*) ib->bind_area ; ! struct tm *gt = localtime(&val); dt->year = 1900 + gt->tm_year; --- 761,765 ---- TIMESTAMP_STRUCT *dt = (TIMESTAMP_STRUCT*) ib->bind_area ; ! struct tm *gt = localtime((const time_t *)&val); dt->year = 1900 + gt->tm_year; *************** *** 781,785 **** ib->bind_area, len, ! &ib->len))) { cursorError(cur, "input-binding"); --- 781,785 ---- ib->bind_area, len, ! (SQLLEN *)&ib->len))) { cursorError(cur, "input-binding"); *************** *** 814,818 **** ib->bind_area, len, ! &ib->len); if (unsuccessful(rc)) { --- 814,818 ---- ib->bind_area, len, ! (SQLLEN *)&ib->len); if (unsuccessful(rc)) { *************** *** 844,848 **** ib->bind_area, sizeof(double), ! &ib->len))) { cursorError(cur, "input-binding"); --- 844,848 ---- ib->bind_area, sizeof(double), ! (SQLLEN *)&ib->len))) { cursorError(cur, "input-binding"); *************** *** 886,890 **** ib->bind_area, len, ! &NTS); if (unsuccessful(rc)) { --- 886,890 ---- ib->bind_area, len, ! (SQLLEN *)&NTS); if (unsuccessful(rc)) { *************** *** 931,935 **** ib->bind_area, nbytes, ! &NTS); if (unsuccessful(rc)) { --- 931,935 ---- ib->bind_area, nbytes, ! (SQLLEN *)&NTS); if (unsuccessful(rc)) { *************** *** 1082,1086 **** &nsize, &vtype, ! &vsize, &scale, &nullok); --- 1082,1086 ---- &nsize, &vtype, ! (SQLULEN *)&vsize, &scale, &nullok); *************** *** 1359,1363 **** /* Note: multiple result sets aren't supported here, just bulk inserts... */ Py_BEGIN_ALLOW_THREADS ! SQLRowCount(cur->hstmt, &t); Py_END_ALLOW_THREADS n_rows += t; --- 1359,1363 ---- /* Note: multiple result sets aren't supported here, just bulk inserts... */ Py_BEGIN_ALLOW_THREADS ! SQLRowCount(cur->hstmt, (SQLLEN *)&t); Py_END_ALLOW_THREADS n_rows += t; *************** *** 1400,1404 **** { n_rows = 1; /* just in case it does not work */ ! SQLRowCount(cur->hstmt, &n_rows); } } --- 1400,1404 ---- { n_rows = 1; /* just in case it does not work */ ! SQLRowCount(cur->hstmt, (SQLLEN *)&n_rows); } } *************** *** 1465,1469 **** (char *)ob->bind_area + cbRead, ob->vsize - cbRead, ! &ob->rcode); Py_END_ALLOW_THREADS if (unsuccessful(rc)) --- 1465,1469 ---- (char *)ob->bind_area + cbRead, ob->vsize - cbRead, ! (SQLLEN *)&ob->rcode); Py_END_ALLOW_THREADS if (unsuccessful(rc)) Index: win32api_display.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32api_display.cpp,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** win32api_display.cpp 12 Jul 2006 11:30:01 -0000 1.3 --- win32api_display.cpp 21 Dec 2006 23:17:16 -0000 1.3.2.1 *************** *** 176,180 **** { char *name, *value; ! int valuelen; name=PyString_AsString(obname); if (name==NULL) --- 176,180 ---- { char *name, *value; ! Py_ssize_t valuelen; name=PyString_AsString(obname); if (name==NULL) Index: win32clipboardmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32clipboardmodule.cpp,v retrieving revision 1.15 retrieving revision 1.15.2.1 diff -C2 -d -r1.15 -r1.15.2.1 *** win32clipboardmodule.cpp 2 Dec 2005 07:50:47 -0000 1.15 --- win32clipboardmodule.cpp 21 Dec 2006 23:17:16 -0000 1.15.2.1 *************** *** 902,906 **** PyObject *obBuf; const void * buf = NULL; ! int bufSize = 0; if (!PyArg_ParseTuple(args, "iO:SetClipboardData", &format, &obBuf)) --- 902,906 ---- PyObject *obBuf; const void * buf = NULL; ! Py_ssize_t bufSize = 0; if (!PyArg_ParseTuple(args, "iO:SetClipboardData", &format, &obBuf)) Index: PyIID.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyIID.cpp,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -C2 -d -r1.7 -r1.7.2.1 *** PyIID.cpp 26 May 2004 08:31:44 -0000 1.7 --- PyIID.cpp 21 Dec 2006 23:17:16 -0000 1.7.2.1 *************** *** 22,26 **** if (isBytes) { const void *buf; ! int cb; if (!PyObject_CheckReadBuffer(obIID)) return PyErr_Format(PyExc_TypeError, "object must be a read-buffer to read the CLSID bytes"); --- 22,26 ---- if (isBytes) { const void *buf; ! Py_ssize_t cb; if (!PyObject_CheckReadBuffer(obIID)) return PyErr_Format(PyExc_TypeError, "object must be a read-buffer to read the CLSID bytes"); *************** *** 151,158 **** static PyBufferProcs PyIID_as_buffer = { ! (getreadbufferproc)getreadbuf, ! (getwritebufferproc)0, ! (getsegcountproc)getsegcount, ! (getcharbufferproc)0, }; --- 151,158 ---- static PyBufferProcs PyIID_as_buffer = { ! (readbufferproc)getreadbuf, ! (writebufferproc)0, ! (segcountproc)getsegcount, ! (charbufferproc)0, }; Index: PyDEVMODE.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyDEVMODE.cpp,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -d -r1.5 -r1.5.2.1 *** PyDEVMODE.cpp 13 May 2006 12:16:39 -0000 1.5 --- PyDEVMODE.cpp 21 Dec 2006 23:17:16 -0000 1.5.2.1 *************** *** 278,282 **** { char *name, *value; ! int valuelen; name=PyString_AsString(obname); if (name==NULL) --- 278,282 ---- { char *name, *value; ! Py_ssize_t valuelen; name=PyString_AsString(obname); if (name==NULL) Index: win32security_sspi.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32security_sspi.cpp,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -C2 -d -r1.6 -r1.6.2.1 *** win32security_sspi.cpp 13 Feb 2006 14:42:35 -0000 1.6 --- win32security_sspi.cpp 21 Dec 2006 23:17:16 -0000 1.6.2.1 *************** *** 18,22 **** // //////////////////////////////////////////////////////////////////////// ! int PySecBufferDesc_sq_length(PyObject *self) { PSecBufferDesc psecbufferdesc=((PySecBufferDesc *)self)->GetSecBufferDesc(); --- 18,22 ---- // //////////////////////////////////////////////////////////////////////// ! Py_ssize_t PySecBufferDesc_sq_length(PyObject *self) { PSecBufferDesc psecbufferdesc=((PySecBufferDesc *)self)->GetSecBufferDesc(); *************** *** 24,28 **** } ! PyObject *PySecBufferDesc_sq_item(PyObject *self, int i) { PySecBufferDesc *This=(PySecBufferDesc *)self; --- 24,28 ---- } ! PyObject *PySecBufferDesc_sq_item(PyObject *self, Py_ssize_t i) { PySecBufferDesc *This=(PySecBufferDesc *)self; *************** *** 36,40 **** } ! int PySecBufferDesc_sq_ass_item(PyObject *self, int i, PyObject *ob) { if (ob==NULL){ --- 36,40 ---- } ! int PySecBufferDesc_sq_ass_item(PyObject *self, Py_ssize_t i, PyObject *ob) { if (ob==NULL){ *************** *** 424,428 **** PySecBuffer *This=(PySecBuffer *)self; char *name, *value; ! int valuelen; name=PyString_AsString(obname); if (name==NULL) --- 424,428 ---- PySecBuffer *This=(PySecBuffer *)self; char *name, *value; ! Py_ssize_t valuelen; name=PyString_AsString(obname); if (name==NULL) Index: PySID.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PySID.cpp,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -C2 -d -r1.11 -r1.11.2.1 *** PySID.cpp 27 Oct 2005 12:26:00 -0000 1.11 --- PySID.cpp 21 Dec 2006 23:17:16 -0000 1.11.2.1 *************** *** 35,39 **** return NULL; } ! int numSubs = PySequence_Length(obSubs); if (numSubs>8) { PyErr_SetString(PyExc_TypeError, "sub authorities sequence size must be <= 8"); --- 35,39 ---- return NULL; } ! Py_ssize_t numSubs = PySequence_Length(obSubs); if (numSubs>8) { PyErr_SetString(PyExc_TypeError, "sub authorities sequence size must be <= 8"); *************** *** 191,198 **** static PyBufferProcs PySID_as_buffer = { ! (getreadbufferproc)PySID::getreadbuf, ! (getwritebufferproc)0, ! (getsegcountproc)PySID::getsegcount, ! (getcharbufferproc)0, }; --- 191,198 ---- static PyBufferProcs PySID_as_buffer = { ! (readbufferproc)PySID::getreadbuf, ! (writebufferproc)0, ! (segcountproc)PySID::getsegcount, ! (charbufferproc)0, }; Index: PyWinTypes.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinTypes.h,v retrieving revision 1.30 retrieving revision 1.30.2.1 diff -C2 -d -r1.30 -r1.30.2.1 *** PyWinTypes.h 3 Aug 2006 02:46:30 -0000 1.30 --- PyWinTypes.h 21 Dec 2006 23:17:16 -0000 1.30.2.1 *************** *** 29,32 **** --- 29,51 ---- #endif + // For backwards compatibility, see PEP 353 + #if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define readbufferproc getreadbufferproc + #define writebufferproc getwritebufferproc + #define segcountproc getsegcountproc + #define charbufferproc getcharbufferproc + #endif + + #ifdef _M_AMD64 + typedef DWORDLONG DWORD_EX; + #elif defined (_M_IX86) + typedef DWORD DWORD_EX; + #else + #error !!! Need to write code for this architecture + #endif + // *** NOTE *** FREEZE_PYWINTYPES is deprecated. It used to be used // by the 'freeze' tool, but now py2exe etc do a far better job, and Index: PySECURITY_DESCRIPTOR.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PySECURITY_DESCRIPTOR.cpp,v retrieving revision 1.18 retrieving revision 1.18.2.1 diff -C2 -d -r1.18 -r1.18.2.1 *** PySECURITY_DESCRIPTOR.cpp 4 Dec 2006 04:56:08 -0000 1.18 --- PySECURITY_DESCRIPTOR.cpp 21 Dec 2006 23:17:16 -0000 1.18.2.1 *************** *** 83,89 **** PyObject *PyWinMethod_NewSECURITY_DESCRIPTOR(PyObject *self, PyObject *args) { ! int descriptor_len = SECURITY_DESCRIPTOR_MIN_LENGTH; if (PyArg_ParseTuple(args, "|l:SECURITY_DESCRIPTOR", &descriptor_len)){ ! PyObject *ret=new PySECURITY_DESCRIPTOR(descriptor_len); if (((PySECURITY_DESCRIPTOR *)ret)->GetSD()==NULL){ if (!PyErr_Occurred()) --- 83,89 ---- PyObject *PyWinMethod_NewSECURITY_DESCRIPTOR(PyObject *self, PyObject *args) { ! Py_ssize_t descriptor_len = SECURITY_DESCRIPTOR_MIN_LENGTH; if (PyArg_ParseTuple(args, "|l:SECURITY_DESCRIPTOR", &descriptor_len)){ ! PyObject *ret=new PySECURITY_DESCRIPTOR(descriptor_len); if (((PySECURITY_DESCRIPTOR *)ret)->GetSD()==NULL){ if (!PyErr_Occurred()) *************** *** 699,706 **** static PyBufferProcs PySECURITY_DESCRIPTOR_as_buffer = { ! (getreadbufferproc)PySECURITY_DESCRIPTOR::getreadbuf, ! (getwritebufferproc)0, ! (getsegcountproc)PySECURITY_DESCRIPTOR::getsegcount, ! (getcharbufferproc)0, }; --- 699,706 ---- static PyBufferProcs PySECURITY_DESCRIPTOR_as_buffer = { ! (readbufferproc)PySECURITY_DESCRIPTOR::getreadbuf, ! (writebufferproc)0, ! (segcountproc)PySECURITY_DESCRIPTOR::getsegcount, ! (charbufferproc)0, }; |
From: Sidnei da S. <dre...@us...> - 2006-12-21 23:17:18
|
Update of /cvsroot/pywin32/pywin32/win32/src/win32net In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19745/win32/src/win32net Modified Files: Tag: AMD64 win32netfile.cpp win32netgroup.cpp Log Message: - Initial work on AMD64 support Index: win32netgroup.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32net/win32netgroup.cpp,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -d -r1.5 -r1.5.2.1 *** win32netgroup.cpp 6 Mar 2004 23:55:59 -0000 1.5 --- win32netgroup.cpp 21 Dec 2006 23:17:16 -0000 1.5.2.1 *************** *** 284,288 **** // @pyparm int|prefLen|MAX_PREFERRED_LENGTH|The preferred length of the data buffer. // @pyseeapi NetGroupEnum ! return PyDoSimpleEnum(self, args, &NetGroupEnum, "NetGroupEnum", group_infos); } --- 284,288 ---- // @pyparm int|prefLen|MAX_PREFERRED_LENGTH|The preferred length of the data buffer. // @pyseeapi NetGroupEnum ! return PyDoSimpleEnum(self, args, (PFNSIMPLEENUM)&NetGroupEnum, "NetGroupEnum", group_infos); } *************** *** 304,308 **** // @pyparm int|prefLen|4096|The preferred length of the data buffer. // @pyseeapi NetGroupGetUsers ! return PyDoNamedEnum(self, args, &NetGroupGetUsers, "NetGroupGetUsers", group_users_infos); } --- 304,308 ---- // @pyparm int|prefLen|4096|The preferred length of the data buffer. // @pyseeapi NetGroupGetUsers ! return PyDoNamedEnum(self, args, (PFNNAMEDENUM)&NetGroupGetUsers, "NetGroupGetUsers", group_users_infos); } *************** *** 382,386 **** // @pyparm int|prefLen|MAX_PREFERRED_LENGTH|The preferred length of the data buffer. // @pyseeapi NetLocalGroupEnum ! return PyDoSimpleEnum(self, args, &NetLocalGroupEnum, "NetLocalGroupEnum", localgroup_infos); } --- 382,386 ---- // @pyparm int|prefLen|MAX_PREFERRED_LENGTH|The preferred length of the data buffer. // @pyseeapi NetLocalGroupEnum ! return PyDoSimpleEnum(self, args, (PFNSIMPLEENUM)&NetLocalGroupEnum, "NetLocalGroupEnum", localgroup_infos); } *************** *** 425,429 **** // @pyparm int|prefLen|4096|The preferred length of the data buffer. // @pyseeapi NetLocalGroupGetMembers ! return PyDoNamedEnum(self, args, &NetLocalGroupGetMembers, "NetLocalGroupGetMembers", localgroup_members_infos); } --- 425,429 ---- // @pyparm int|prefLen|4096|The preferred length of the data buffer. // @pyseeapi NetLocalGroupGetMembers ! return PyDoNamedEnum(self, args, (PFNNAMEDENUM)&NetLocalGroupGetMembers, "NetLocalGroupGetMembers", localgroup_members_infos); } Index: win32netfile.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32net/win32netfile.cpp,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -d -r1.5 -r1.5.2.1 *** win32netfile.cpp 29 Aug 2005 09:51:45 -0000 1.5 --- win32netfile.cpp 21 Dec 2006 23:17:16 -0000 1.5.2.1 *************** *** 65,69 **** Py_BEGIN_ALLOW_THREADS nStatus = NetFileEnum(server_name, base_path, user_name, info_lvl, ! (LPBYTE*)&pBuf2, buff_len, &dwEntriesRead, &dwTotalEntries, &dwResumeHandle); Py_END_ALLOW_THREADS --- 65,69 ---- Py_BEGIN_ALLOW_THREADS nStatus = NetFileEnum(server_name, base_path, user_name, info_lvl, ! (LPBYTE*)&pBuf2, buff_len, &dwEntriesRead, &dwTotalEntries, (PDWORD_PTR)&dwResumeHandle); Py_END_ALLOW_THREADS *************** *** 98,102 **** nStatus = NetFileEnum(server_name, base_path, user_name, info_lvl, (LPBYTE*)&pBuf3, buff_len, &dwEntriesRead, ! &dwTotalEntries, &dwResumeHandle); Py_END_ALLOW_THREADS --- 98,102 ---- nStatus = NetFileEnum(server_name, base_path, user_name, info_lvl, (LPBYTE*)&pBuf3, buff_len, &dwEntriesRead, ! &dwTotalEntries, (PDWORD_PTR)&dwResumeHandle); Py_END_ALLOW_THREADS |
From: Sidnei da S. <dre...@us...> - 2006-12-21 23:17:17
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19745/com/win32comext/shell/src Modified Files: Tag: AMD64 PyIContextMenu.cpp PyIContextMenu.h PyIShellFolder.cpp PyIShellFolder.h Log Message: - Initial work on AMD64 support Index: PyIContextMenu.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIContextMenu.h,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** PyIContextMenu.h 6 Oct 2003 12:47:57 -0000 1.1 --- PyIContextMenu.h 21 Dec 2006 23:17:16 -0000 1.1.2.1 *************** *** 45,49 **** STDMETHOD(GetCommandString)( ! UINT idCmd, UINT uType, UINT __RPC_FAR * pwReserved, --- 45,49 ---- STDMETHOD(GetCommandString)( ! UINT_PTR idCmd, UINT uType, UINT __RPC_FAR * pwReserved, Index: PyIContextMenu.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIContextMenu.cpp,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** PyIContextMenu.cpp 26 Jan 2005 22:31:09 -0000 1.3 --- PyIContextMenu.cpp 21 Dec 2006 23:17:16 -0000 1.3.2.1 *************** *** 91,95 **** // @pyparm int|uType||Description for uType // @pyparm int|cchMax|2048|Description for cchMax ! UINT idCmd; UINT uType; UINT cchMax = 2048; --- 91,95 ---- // @pyparm int|uType||Description for uType // @pyparm int|cchMax|2048|Description for cchMax ! UINT_PTR idCmd; UINT uType; UINT cchMax = 2048; *************** *** 160,164 **** STDMETHODIMP PyGContextMenu::GetCommandString( ! /* [unique][in] */ UINT idCmd, /* [unique][in] */ UINT uFlags, /* [unique][in] */ UINT * pwReserved, --- 160,164 ---- STDMETHODIMP PyGContextMenu::GetCommandString( ! /* [unique][in] */ UINT_PTR idCmd, /* [unique][in] */ UINT uFlags, /* [unique][in] */ UINT * pwReserved, Index: PyIShellFolder.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIShellFolder.h,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** PyIShellFolder.h 2 Nov 2003 09:58:32 -0000 1.3 --- PyIShellFolder.h 21 Dec 2006 23:17:16 -0000 1.3.2.1 *************** *** 67,73 **** STDMETHOD(CompareIDs)( ! long lparam, ! const ITEMIDLIST __RPC_FAR * pidl1, ! const ITEMIDLIST __RPC_FAR * pidl2); STDMETHOD(CreateViewObject)( --- 67,73 ---- STDMETHOD(CompareIDs)( ! LPARAM lparam, ! LPCITEMIDLIST pidl1, ! LPCITEMIDLIST pidl2); STDMETHOD(CreateViewObject)( *************** *** 90,94 **** STDMETHOD(GetDisplayNameOf)( ! const ITEMIDLIST __RPC_FAR * pidl, DWORD uFlags, STRRET __RPC_FAR * out); --- 90,94 ---- STDMETHOD(GetDisplayNameOf)( ! LPCITEMIDLIST pidl, DWORD uFlags, STRRET __RPC_FAR * out); Index: PyIShellFolder.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIShellFolder.cpp,v retrieving revision 1.12 retrieving revision 1.12.2.1 diff -C2 -d -r1.12 -r1.12.2.1 *** PyIShellFolder.cpp 26 Oct 2005 01:05:18 -0000 1.12 --- PyIShellFolder.cpp 21 Dec 2006 23:17:16 -0000 1.12.2.1 *************** *** 534,540 **** STDMETHODIMP PyGShellFolder::CompareIDs( ! /* [unique][in] */ long lparam, ! /* [unique][in] */ const ITEMIDLIST __RPC_FAR * pidl1, ! /* [unique][in] */ const ITEMIDLIST __RPC_FAR * pidl2) { PY_GATEWAY_METHOD; --- 534,540 ---- STDMETHODIMP PyGShellFolder::CompareIDs( ! /* [unique][in] */ LPARAM lparam, ! /* [unique][in] */ LPCITEMIDLIST pidl1, ! /* [unique][in] */ LPCITEMIDLIST pidl2) { PY_GATEWAY_METHOD; *************** *** 627,631 **** STDMETHODIMP PyGShellFolder::GetDisplayNameOf( ! /* [unique][in] */ const ITEMIDLIST __RPC_FAR * pidl, /* [unique][in] */ DWORD uFlags, /* [out] */ STRRET __RPC_FAR * out) --- 627,631 ---- STDMETHODIMP PyGShellFolder::GetDisplayNameOf( ! /* [unique][in] */ LPCITEMIDLIST pidl, /* [unique][in] */ DWORD uFlags, /* [out] */ STRRET __RPC_FAR * out) |
From: Sidnei da S. <dre...@us...> - 2006-12-21 23:17:17
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/axscript/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19745/com/win32comext/axscript/src Modified Files: Tag: AMD64 AXScript.h PyGActiveScriptParse.cpp PyIActiveScriptParseProcedure.cpp PyIActiveScriptParseProcedure.h Log Message: - Initial work on AMD64 support Index: PyIActiveScriptParseProcedure.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/src/PyIActiveScriptParseProcedure.cpp,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** PyIActiveScriptParseProcedure.cpp 25 Jan 2005 13:34:07 -0000 1.3 --- PyIActiveScriptParseProcedure.cpp 21 Dec 2006 23:17:16 -0000 1.3.2.1 *************** *** 107,111 **** /* [in] */ IUnknown __RPC_FAR * punkContext, /* [in] */ LPCOLESTR pstrDelimiter, ! /* [in] */ DWORD dwSourceContextCookie, /* [in] */ ULONG ulStartingLineNumber, /* [in] */ DWORD dwFlags, --- 107,111 ---- /* [in] */ IUnknown __RPC_FAR * punkContext, /* [in] */ LPCOLESTR pstrDelimiter, ! /* [in] */ DWORD_EX dwSourceContextCookie, /* [in] */ ULONG ulStartingLineNumber, /* [in] */ DWORD dwFlags, Index: AXScript.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/src/AXScript.h,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** AXScript.h 1 Sep 1999 23:12:45 -0000 1.1 --- AXScript.h 21 Dec 2006 23:17:16 -0000 1.1.2.1 *************** *** 197,201 **** /* [in] */ LPCOLESTR pstrEventName, /* [in] */ LPCOLESTR pstrDelimiter, ! /* [in] */ DWORD dwSourceContextCookie, /* [in] */ ULONG ulStartingLineNumber, /* [in] */ DWORD dwFlags, --- 197,201 ---- /* [in] */ LPCOLESTR pstrEventName, /* [in] */ LPCOLESTR pstrDelimiter, ! /* [in] */ DWORD_EX dwSourceContextCookie, /* [in] */ ULONG ulStartingLineNumber, /* [in] */ DWORD dwFlags, *************** *** 208,212 **** /* [in] */ IUnknown __RPC_FAR *punkContext, /* [in] */ LPCOLESTR pstrDelimiter, ! /* [in] */ DWORD dwSourceContextCookie, /* [in] */ ULONG ulStartingLineNumber, /* [in] */ DWORD dwFlags, --- 208,212 ---- /* [in] */ IUnknown __RPC_FAR *punkContext, /* [in] */ LPCOLESTR pstrDelimiter, ! /* [in] */ DWORD_EX dwSourceContextCookie, /* [in] */ ULONG ulStartingLineNumber, /* [in] */ DWORD dwFlags, Index: PyIActiveScriptParseProcedure.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/src/PyIActiveScriptParseProcedure.h,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** PyIActiveScriptParseProcedure.h 1 Sep 1999 23:12:46 -0000 1.1 --- PyIActiveScriptParseProcedure.h 21 Dec 2006 23:17:16 -0000 1.1.2.1 *************** *** 37,41 **** IUnknown __RPC_FAR * punkContext, LPCOLESTR pstrDelimiter, ! DWORD dwSourceContextCookie, ULONG ulStartingLineNumber, DWORD dwFlags, --- 37,41 ---- IUnknown __RPC_FAR * punkContext, LPCOLESTR pstrDelimiter, ! DWORD_EX dwSourceContextCookie, ULONG ulStartingLineNumber, DWORD dwFlags, Index: PyGActiveScriptParse.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/src/PyGActiveScriptParse.cpp,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** PyGActiveScriptParse.cpp 5 Nov 2003 22:05:25 -0000 1.4 --- PyGActiveScriptParse.cpp 21 Dec 2006 23:17:16 -0000 1.4.2.1 *************** *** 25,29 **** --- 25,35 ---- /* [in] */ LPCOLESTR pstrEventName, /* [in] */ LPCOLESTR pstrDelimiter, + #ifdef _M_AMD64 + /* [in] */ DWORDLONG dwSourceContextCookie, + #elif defined (_M_IX86) /* [in] */ DWORD dwSourceContextCookie, + #else + #error !!! Need to write code for this architecture + #endif /* [in] */ ULONG ulStartingLineNumber, /* [in] */ DWORD dwFlags, *************** *** 60,64 **** --- 66,76 ---- /* [in] */ IUnknown __RPC_FAR *punkContext, /* [in] */ LPCOLESTR pstrDelimiter, + #ifdef _M_AMD64 + /* [in] */ DWORDLONG dwSourceContextCookie, + #elif defined (_M_IX86) /* [in] */ DWORD dwSourceContextCookie, + #else + #error !!! Need to write code for this architecture + #endif /* [in] */ ULONG ulStartingLineNumber, /* [in] */ DWORD dwFlags, |
From: Sidnei da S. <dre...@us...> - 2006-12-21 23:17:17
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/axdebug/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19745/com/win32comext/axdebug/src Modified Files: Tag: AMD64 PyIActiveScriptDebug.h PyIActiveScriptSiteDebug.h PyIDebugApplication.h PyIDebugStackFrameSnifferEx.h Log Message: - Initial work on AMD64 support Index: PyIDebugApplication.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/src/PyIDebugApplication.h,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** PyIDebugApplication.h 1 Sep 1999 23:09:04 -0000 1.1 --- PyIDebugApplication.h 21 Dec 2006 23:17:16 -0000 1.1.2.1 *************** *** 130,136 **** STDMETHOD(SynchronousCallInDebuggerThread)( IDebugThreadCall __RPC_FAR * pptc, ! DWORD dwParam1, ! DWORD dwParam2, ! DWORD dwParam3); STDMETHOD(CreateApplicationNode)( --- 130,136 ---- STDMETHOD(SynchronousCallInDebuggerThread)( IDebugThreadCall __RPC_FAR * pptc, ! DWORD_EX dwParam1, ! DWORD_EX dwParam2, ! DWORD_EX dwParam3); STDMETHOD(CreateApplicationNode)( *************** *** 156,163 **** STDMETHOD(AddGlobalExpressionContextProvider)( IProvideExpressionContexts __RPC_FAR * pdsfs, ! DWORD __RPC_FAR * pdwCookie); STDMETHOD(RemoveGlobalExpressionContextProvider)( ! DWORD dwCookie); }; --- 156,163 ---- STDMETHOD(AddGlobalExpressionContextProvider)( IProvideExpressionContexts __RPC_FAR * pdsfs, ! DWORD_EX __RPC_FAR * pdwCookie); STDMETHOD(RemoveGlobalExpressionContextProvider)( ! DWORD_EX dwCookie); }; Index: PyIDebugStackFrameSnifferEx.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/src/PyIDebugStackFrameSnifferEx.h,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** PyIDebugStackFrameSnifferEx.h 1 Sep 1999 23:09:04 -0000 1.1 --- PyIDebugStackFrameSnifferEx.h 21 Dec 2006 23:17:16 -0000 1.1.2.1 *************** *** 32,36 **** // IDebugStackFrameSnifferEx STDMETHOD(EnumStackFramesEx)( ! DWORD dwSpMin, IEnumDebugStackFrames __RPC_FAR *__RPC_FAR * ppedsf); }; --- 32,37 ---- // IDebugStackFrameSnifferEx STDMETHOD(EnumStackFramesEx)( ! DWORD_EX dwSpMin, IEnumDebugStackFrames __RPC_FAR *__RPC_FAR * ppedsf); + }; Index: PyIActiveScriptDebug.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/src/PyIActiveScriptDebug.h,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** PyIActiveScriptDebug.h 1 Sep 1999 23:09:03 -0000 1.1 --- PyIActiveScriptDebug.h 21 Dec 2006 23:17:15 -0000 1.1.2.1 *************** *** 47,51 **** STDMETHOD(EnumCodeContextsOfPosition)( ! DWORD dwSourceContext, ULONG uCharacterOffset, ULONG uNumChars, --- 47,51 ---- STDMETHOD(EnumCodeContextsOfPosition)( ! DWORD_EX dwSourceContext, ULONG uCharacterOffset, ULONG uNumChars, Index: PyIActiveScriptSiteDebug.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/src/PyIActiveScriptSiteDebug.h,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** PyIActiveScriptSiteDebug.h 1 Sep 1999 23:09:03 -0000 1.1 --- PyIActiveScriptSiteDebug.h 21 Dec 2006 23:17:15 -0000 1.1.2.1 *************** *** 34,38 **** // IActiveScriptSiteDebug STDMETHOD(GetDocumentContextFromPosition)( ! DWORD dwSourceContext, ULONG uCharacterOffset, ULONG uNumChars, --- 34,38 ---- // IActiveScriptSiteDebug STDMETHOD(GetDocumentContextFromPosition)( ! DWORD_EX dwSourceContext, ULONG uCharacterOffset, ULONG uNumChars, |
From: Sidnei da S. <dre...@us...> - 2006-12-21 23:17:17
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src/extensions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19745/com/win32com/src/extensions Modified Files: Tag: AMD64 PyFUNCDESC.cpp PySTGMEDIUM.cpp PyTYPEATTR.cpp PyVARDESC.cpp Log Message: - Initial work on AMD64 support Index: PyTYPEATTR.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyTYPEATTR.cpp,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** PyTYPEATTR.cpp 1 Sep 1999 23:03:33 -0000 1.1 --- PyTYPEATTR.cpp 21 Dec 2006 23:17:15 -0000 1.1.2.1 *************** *** 178,182 **** // Sequence stuff to provide compatibility with tuples. ! /* static */ int PyTYPEATTR::getlength(PyObject *self) { // NEVER CHANGE THIS - you will break all the old --- 178,182 ---- // Sequence stuff to provide compatibility with tuples. ! /* static */ Py_ssize_t PyTYPEATTR::getlength(PyObject *self) { // NEVER CHANGE THIS - you will break all the old *************** *** 185,189 **** } ! /* static */ PyObject *PyTYPEATTR::getitem(PyObject *self, int index) { PyTYPEATTR *p = (PyTYPEATTR *)self; --- 185,189 ---- } ! /* static */ PyObject *PyTYPEATTR::getitem(PyObject *self, Py_ssize_t index) { PyTYPEATTR *p = (PyTYPEATTR *)self; Index: PySTGMEDIUM.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PySTGMEDIUM.cpp,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -C2 -d -r1.6 -r1.6.2.1 *** PySTGMEDIUM.cpp 20 May 2005 23:25:49 -0000 1.6 --- PySTGMEDIUM.cpp 21 Dec 2006 23:17:15 -0000 1.6.2.1 *************** *** 48,52 **** case TYMED_HGLOBAL: { const void * buf = NULL; ! int cb = 0; if (PyObject_AsReadBuffer(ob,&buf,&cb)==-1) return PyErr_Format(PyExc_TypeError, "tymed value of %d requires a string/unicode/buffer", tymed); --- 48,52 ---- case TYMED_HGLOBAL: { const void * buf = NULL; ! Py_ssize_t cb = 0; if (PyObject_AsReadBuffer(ob,&buf,&cb)==-1) return PyErr_Format(PyExc_TypeError, "tymed value of %d requires a string/unicode/buffer", tymed); Index: PyVARDESC.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyVARDESC.cpp,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** PyVARDESC.cpp 1 Sep 1999 23:03:33 -0000 1.1 --- PyVARDESC.cpp 21 Dec 2006 23:17:15 -0000 1.1.2.1 *************** *** 185,189 **** // Sequence stuff to provide compatibility with tuples. ! /* static */ int PyVARDESC::getlength(PyObject *self) { // NEVER CHANGE THIS - you will break all the old --- 185,189 ---- // Sequence stuff to provide compatibility with tuples. ! /* static */ Py_ssize_t PyVARDESC::getlength(PyObject *self) { // NEVER CHANGE THIS - you will break all the old *************** *** 192,196 **** } ! /* static */ PyObject *PyVARDESC::getitem(PyObject *self, int index) { PyVARDESC *p = (PyVARDESC *)self; --- 192,196 ---- } ! /* static */ PyObject *PyVARDESC::getitem(PyObject *self, Py_ssize_t index) { PyVARDESC *p = (PyVARDESC *)self; Index: PyFUNCDESC.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyFUNCDESC.cpp,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** PyFUNCDESC.cpp 1 Sep 1999 23:03:32 -0000 1.1 --- PyFUNCDESC.cpp 21 Dec 2006 23:17:15 -0000 1.1.2.1 *************** *** 220,224 **** // Sequence stuff to provide compatibility with tuples. ! /* static */ int PyFUNCDESC::getlength(PyObject *self) { // NEVER CHANGE THIS - you will break all the old --- 220,224 ---- // Sequence stuff to provide compatibility with tuples. ! /* static */ Py_ssize_t PyFUNCDESC::getlength(PyObject *self) { // NEVER CHANGE THIS - you will break all the old *************** *** 227,231 **** } ! /* static */ PyObject *PyFUNCDESC::getitem(PyObject *self, int index) { PyFUNCDESC *p = (PyFUNCDESC *)self; --- 227,231 ---- } ! /* static */ PyObject *PyFUNCDESC::getitem(PyObject *self, Py_ssize_t index) { PyFUNCDESC *p = (PyFUNCDESC *)self; |
From: Sidnei da S. <dre...@us...> - 2006-12-21 23:17:17
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/axcontrol/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19745/com/win32comext/axcontrol/src Modified Files: Tag: AMD64 PyIViewObject.cpp PyIViewObject.h PyIViewObject2.cpp PyIViewObject2.h Log Message: - Initial work on AMD64 support Index: PyIViewObject.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axcontrol/src/PyIViewObject.h,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** PyIViewObject.h 1 Sep 1999 23:05:45 -0000 1.1 --- PyIViewObject.h 21 Dec 2006 23:17:15 -0000 1.1.2.1 *************** *** 46,51 **** LPCRECTL lprcBounds, LPCRECTL lprcWBounds, ! BOOL ( STDMETHODCALLTYPE __RPC_FAR *pfnContinue )( DWORD ), ! DWORD dwContinue); STDMETHOD(GetColorSet)( --- 46,51 ---- LPCRECTL lprcBounds, LPCRECTL lprcWBounds, ! BOOL ( STDMETHODCALLTYPE __RPC_FAR *pfnContinue )( ULONG_PTR ), ! ULONG_PTR dwContinue); STDMETHOD(GetColorSet)( Index: PyIViewObject2.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axcontrol/src/PyIViewObject2.h,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** PyIViewObject2.h 1 Sep 1999 23:05:45 -0000 1.1 --- PyIViewObject2.h 21 Dec 2006 23:17:15 -0000 1.1.2.1 *************** *** 39,44 **** LPCRECTL lprcBounds, LPCRECTL lprcWBounds, ! BOOL ( STDMETHODCALLTYPE __RPC_FAR *pfnContinue )( DWORD ), ! DWORD dwContinue); STDMETHOD(GetColorSet)( --- 39,44 ---- LPCRECTL lprcBounds, LPCRECTL lprcWBounds, ! BOOL ( STDMETHODCALLTYPE __RPC_FAR *pfnContinue )( ULONG_PTR ), ! ULONG_PTR dwContinue); STDMETHOD(GetColorSet)( Index: PyIViewObject2.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axcontrol/src/PyIViewObject2.cpp,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** PyIViewObject2.cpp 1 Sep 1999 23:05:45 -0000 1.1 --- PyIViewObject2.cpp 21 Dec 2006 23:17:15 -0000 1.1.2.1 *************** *** 81,86 **** LPCRECTL lprcBounds, LPCRECTL lprcWBounds, ! BOOL ( STDMETHODCALLTYPE __RPC_FAR *pfnContinue )( DWORD ), ! DWORD dwContinue) { return PyGViewObject::Draw(dwDrawAspect, lindex, pvAspect, ptd, hdcTargetDev, hdcDraw, lprcBounds, lprcWBounds, pfnContinue, dwContinue); } --- 81,86 ---- LPCRECTL lprcBounds, LPCRECTL lprcWBounds, ! BOOL ( STDMETHODCALLTYPE __RPC_FAR *pfnContinue )( ULONG_PTR ), ! ULONG_PTR dwContinue) { return PyGViewObject::Draw(dwDrawAspect, lindex, pvAspect, ptd, hdcTargetDev, hdcDraw, lprcBounds, lprcWBounds, pfnContinue, dwContinue); } Index: PyIViewObject.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axcontrol/src/PyIViewObject.cpp,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** PyIViewObject.cpp 26 Nov 1999 14:15:06 -0000 1.2 --- PyIViewObject.cpp 21 Dec 2006 23:17:15 -0000 1.2.2.1 *************** *** 255,260 **** /* [in] */ LPCRECTL lprcBounds, /* [unique][in] */ LPCRECTL lprcWBounds, ! /* [in] */ BOOL ( STDMETHODCALLTYPE __RPC_FAR *pfnContinue )( DWORD dwContinueArg ), ! /* [in] */ DWORD dwContinue) { PY_GATEWAY_METHOD; --- 255,260 ---- /* [in] */ LPCRECTL lprcBounds, /* [unique][in] */ LPCRECTL lprcWBounds, ! /* [in] */ BOOL ( STDMETHODCALLTYPE __RPC_FAR *pfnContinue )( ULONG_PTR dwContinueArg ), ! /* [in] */ ULONG_PTR dwContinue) { PY_GATEWAY_METHOD; |
From: Sidnei da S. <dre...@us...> - 2006-12-21 23:17:16
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/adsi/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19745/com/win32comext/adsi/src Modified Files: Tag: AMD64 PyDSOPObjects.cpp Log Message: - Initial work on AMD64 support Index: PyDSOPObjects.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/adsi/src/PyDSOPObjects.cpp,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** PyDSOPObjects.cpp 26 May 2005 11:39:30 -0000 1.1 --- PyDSOPObjects.cpp 21 Dec 2006 23:17:15 -0000 1.1.2.1 *************** *** 116,120 **** // object has no other (interesting) methods or attributes. // <nl>These objects are created via <om adsi.DSOP_SCOPE_INIT_INFOs>(size) ! int PyDSOP_SCOPE_INIT_INFOs_sq_length(PyObject *self) { PyDSOP_SCOPE_INIT_INFOs *p = (PyDSOP_SCOPE_INIT_INFOs *)self; --- 116,120 ---- // object has no other (interesting) methods or attributes. // <nl>These objects are created via <om adsi.DSOP_SCOPE_INIT_INFOs>(size) ! Py_ssize_t PyDSOP_SCOPE_INIT_INFOs_sq_length(PyObject *self) { PyDSOP_SCOPE_INIT_INFOs *p = (PyDSOP_SCOPE_INIT_INFOs *)self; *************** *** 122,126 **** } ! PyObject *PyDSOP_SCOPE_INIT_INFOs_sq_item(PyObject *self, int i) { PyDSOP_SCOPE_INIT_INFOs *p =(PyDSOP_SCOPE_INIT_INFOs *)self; --- 122,126 ---- } ! PyObject *PyDSOP_SCOPE_INIT_INFOs_sq_item(PyObject *self, Py_ssize_t i) { PyDSOP_SCOPE_INIT_INFOs *p =(PyDSOP_SCOPE_INIT_INFOs *)self; |
From: Sidnei da S. <dre...@us...> - 2006-12-21 23:17:16
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19745/com/win32com/src/include Modified Files: Tag: AMD64 PyComTypeObjects.h Log Message: - Initial work on AMD64 support Index: PyComTypeObjects.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/include/PyComTypeObjects.h,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** PyComTypeObjects.h 12 Jun 2004 13:31:51 -0000 1.4 --- PyComTypeObjects.h 21 Dec 2006 23:17:15 -0000 1.4.2.1 *************** *** 33,38 **** static void deallocFunc(PyObject *ob); ! static PyObject *getitem(PyObject *self, int index); ! static int getlength(PyObject *self); static PyObject *getattr(PyObject *self, char *name); static int setattr(PyObject *self, char *name, PyObject *v); --- 33,38 ---- static void deallocFunc(PyObject *ob); ! static PyObject *getitem(PyObject *self, Py_ssize_t index); ! static Py_ssize_t getlength(PyObject *self); static PyObject *getattr(PyObject *self, char *name); static int setattr(PyObject *self, char *name, PyObject *v); *************** *** 64,69 **** static void deallocFunc(PyObject *ob); ! static PyObject *getitem(PyObject *self, int index); ! static int getlength(PyObject *self); static PyObject *getattr(PyObject *self, char *name); static int setattr(PyObject *self, char *name, PyObject *v); --- 64,69 ---- static void deallocFunc(PyObject *ob); ! static PyObject *getitem(PyObject *self, Py_ssize_t index); ! static Py_ssize_t getlength(PyObject *self); static PyObject *getattr(PyObject *self, char *name); static int setattr(PyObject *self, char *name, PyObject *v); *************** *** 103,108 **** static void deallocFunc(PyObject *ob); ! static PyObject *getitem(PyObject *self, int index); ! static int getlength(PyObject *self); static PyObject *getattr(PyObject *self, char *name); static int setattr(PyObject *self, char *name, PyObject *v); --- 103,108 ---- static void deallocFunc(PyObject *ob); ! static PyObject *getitem(PyObject *self, Py_ssize_t index); ! static Py_ssize_t getlength(PyObject *self); static PyObject *getattr(PyObject *self, char *name); static int setattr(PyObject *self, char *name, PyObject *v); |
From: Sidnei da S. <dre...@us...> - 2006-12-21 23:17:16
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19745 Modified Files: Tag: AMD64 setup.py Log Message: - Initial work on AMD64 support Index: setup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup.py,v retrieving revision 1.52 retrieving revision 1.52.2.1 diff -C2 -d -r1.52 -r1.52.2.1 *** setup.py 23 Sep 2006 00:31:53 -0000 1.52 --- setup.py 21 Dec 2006 23:17:15 -0000 1.52.2.1 *************** *** 215,219 **** sources.extend(self.get_source_files(dsp_file)) extra_link_args = extra_link_args or [] ! extra_link_args.append("/MACHINE:ix86") # Some of our swigged files behave differently in distutils vs # MSVC based builds. Always define DISTUTILS_BUILD so they can tell. --- 215,222 ---- sources.extend(self.get_source_files(dsp_file)) extra_link_args = extra_link_args or [] ! if get_build_architecture() in ('AMD64',): ! extra_link_args.append("/MACHINE:AMD64") ! else: ! extra_link_args.append("/MACHINE:ix86") # Some of our swigged files behave differently in distutils vs # MSVC based builds. Always define DISTUTILS_BUILD so they can tell. *************** *** 388,391 **** --- 391,396 ---- self.include_dirs.insert(0, extra) extra = os.path.join(sdk_dir, 'lib') + if get_build_architecture() in ('AMD64',): + extra = os.path.join(extra, 'AMD64') if extra not in self.library_dirs and os.path.isdir(extra): self.library_dirs.insert(0, extra) *************** *** 435,439 **** # module method in early Python versions get_msvc_paths = msvccompiler.get_msvc_paths ! look_dirs = self.include_dirs + get_msvc_paths("include") for h in ext.optional_headers: for d in look_dirs: --- 440,444 ---- # module method in early Python versions get_msvc_paths = msvccompiler.get_msvc_paths ! look_dirs = self.include_dirs # + get_msvc_paths("include") for h in ext.optional_headers: for d in look_dirs: *************** *** 457,460 **** --- 462,466 ---- patched_libs.append(os.path.splitext(os.path.basename(found))[0]) # axdebug struggles under debug builds - worry about that when I care :) + if ext.name == 'axdebug': return 'aye' if sys.hexversion < 0x2040000 and ext.name == 'axdebug' and self.debug: return "axdebug doesn't build in VC6 debug builds (irony!)" *************** *** 682,685 **** --- 688,695 ---- self.current_extension = ext + # Enable 64-bit porting warnings + if get_build_architecture() in ('AMD64',): + ext.extra_compile_args.append("/Wp64") + if not self.mingw32 and ext.pch_header: ext.extra_compile_args = ext.extra_compile_args or [] *************** *** 872,875 **** --- 882,890 ---- orig_new_compiler = ccompiler.new_compiler ccompiler.new_compiler = my_new_compiler + try: + get_build_architecture = msvccompiler.get_build_architecture + except AttributeError: + def get_build_architecture(): + return "Intel" class my_compiler(msvccompiler.MSVCCompiler): |
From: Roger U. <ru...@us...> - 2006-12-20 16:57:25
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20487/win32/src Modified Files: win32gui.i Log Message: Add coordinate space transformation functions Index: win32gui.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32gui.i,v retrieving revision 1.91 retrieving revision 1.92 diff -C2 -d -r1.91 -r1.92 *** win32gui.i 17 Dec 2006 21:31:24 -0000 1.91 --- win32gui.i 20 Dec 2006 16:57:08 -0000 1.92 *************** *** 46,49 **** --- 46,57 ---- typedef BOOL (WINAPI *PlgBltfunc)(HDC,CONST POINT *,HDC,int,int,int,int,HBITMAP,int,int); static PlgBltfunc pfnPlgBlt=NULL; + typedef BOOL (WINAPI *GetWorldTransformfunc)(HDC,XFORM *); + static GetWorldTransformfunc pfnGetWorldTransform=NULL; + typedef BOOL (WINAPI *SetWorldTransformfunc)(HDC,XFORM *); + static SetWorldTransformfunc pfnSetWorldTransform=NULL; + typedef BOOL (WINAPI *ModifyWorldTransformfunc)(HDC,XFORM *,DWORD); + static ModifyWorldTransformfunc pfnModifyWorldTransform=NULL; + typedef BOOL (WINAPI *CombineTransformfunc)(LPXFORM,CONST XFORM *,CONST XFORM *); + static CombineTransformfunc pfnCombineTransform=NULL; static PyObject *g_AtomMap = NULL; // Mapping class atoms to Python WNDPROC *************** *** 125,128 **** --- 133,140 ---- pfnAngleArc=(AngleArcfunc)GetProcAddress(hmodule,"AngleArc"); pfnPlgBlt=(PlgBltfunc)GetProcAddress(hmodule,"PlgBlt"); + pfnGetWorldTransform=(GetWorldTransformfunc)GetProcAddress(hmodule,"GetWorldTransform"); + pfnSetWorldTransform=(SetWorldTransformfunc)GetProcAddress(hmodule,"SetWorldTransform"); + pfnModifyWorldTransform=(ModifyWorldTransformfunc)GetProcAddress(hmodule,"ModifyWorldTransform"); + pfnCombineTransform=(CombineTransformfunc)GetProcAddress(hmodule,"CombineTransform"); } *************** *** 3368,3371 **** --- 3380,3387 ---- POINT *BOTH); // @pyparm (int,int)|Point||Client coordinates to be converted + // @pyswig |PaintDesktop|Fills a DC with the destop background + BOOLAPI PaintDesktop( + HDC hdc); // @pyparm <o PyHANDLE>|hdc||Handle to a device context + %{ // @pyswig cx, cy|GetTextExtentPoint32|Computes the width and height of the specified string of text. *************** *** 3560,3563 **** --- 3576,3616 ---- return PyInt_FromLong(prevmode); } + + // @pyswig int|GetGraphicsMode|Determines if advanced GDI features are enabled for a device context + // @rdesc Returns GM_COMPATIBLE or GM_ADVANCED + static PyObject *PyGetGraphicsMode(PyObject *self, PyObject *args) + { + HDC hdc; + PyObject *obdc; + int ret; + if (!PyArg_ParseTuple(args, "O:GetGraphicsMode", + &obdc)) // @pyparm <o PyHANDLE>|hdc||Handle to a device context + return NULL; + if (!PyWinObject_AsHANDLE(obdc, (HANDLE *)&hdc, FALSE)) + return NULL; + ret=GetGraphicsMode(hdc); + if (ret==0) + return PyWin_SetAPIError("GetGraphicsMode"); + return PyInt_FromLong(ret); + } + + // @pyswig int|SetGraphicsMode|Enables or disables advanced graphics features for a DC + // @rdesc Returns the previous mode, one of win32con.GM_COMPATIBLE or win32con.GM_ADVANCED + static PyObject *PySetGraphicsMode(PyObject *self, PyObject *args) + { + HDC hdc; + PyObject *obdc; + int newmode, prevmode; + if (!PyArg_ParseTuple(args, "Oi:SetGraphicsMode", + &obdc, // @pyparm <o PyHANDLE>|hdc||Handle to a device context + &newmode)) // @pyparm int|Mode||GM_COMPATIBLE or GM_ADVANCED (from win32con) + return NULL; + if (!PyWinObject_AsHANDLE(obdc, (HANDLE *)&hdc, FALSE)) + return NULL; + prevmode=SetGraphicsMode(hdc, newmode); + if (prevmode==0) + return PyWin_SetAPIError("SetGraphicsMode"); + return PyInt_FromLong(prevmode); + } %} *************** *** 3571,3574 **** --- 3624,3870 ---- %native (GetMapMode) PyGetMapMode; %native (SetMapMode) PySetMapMode; + %native (GetGraphicsMode) PyGetGraphicsMode; + %native (SetGraphicsMode) PySetGraphicsMode; + + %{ + // @object PyXFORM|Dict representing an XFORM struct used as a world transformation matrix + // All members are optional, defaulting to 0.0. + // @pyseeapi XFORM struct + BOOL PyWinObject_AsXFORM(PyObject *obxform, XFORM *pxform) + { + static char *keywords[]={"M11","M12","M21","M22","Dx","Dy", NULL}; + ZeroMemory(pxform, sizeof(XFORM)); + if (!PyDict_Check(obxform)){ + PyErr_SetString(PyExc_TypeError,"XFORM must be a dict"); + return FALSE; + } + PyObject *dummy_tuple=PyTuple_New(0); + if (dummy_tuple==NULL) + return FALSE; + BOOL ret=PyArg_ParseTupleAndKeywords(dummy_tuple, obxform, "|ffffff", keywords, + &pxform->eM11, // @prop float|M11|Usage is dependent on operation performed, see MSDN docs + &pxform->eM12, // @prop float|M12|Usage is dependent on operation performed, see MSDN docs + &pxform->eM21, // @prop float|M21|Usage is dependent on operation performed, see MSDN docs + &pxform->eM22, // @prop float|M22|Usage is dependent on operation performed, see MSDN docs + &pxform->eDx, // @prop float|Dx|Horizontal offset in logical units + &pxform->eDy); // @prop float|Dy|Vertical offset in logical units + Py_DECREF(dummy_tuple); + return ret; + } + + PyObject *PyWinObject_FromXFORM(XFORM *pxform) + { + return Py_BuildValue("{s:f,s:f,s:f,s:f,s:f,s:f}", + "M11", pxform->eM11, + "M12", pxform->eM12, + "M21", pxform->eM21, + "M22", pxform->eM22, + "Dx", pxform->eDx, + "Dy", pxform->eDy); + } + + // @pyswig <o PyXFORM>|GetWorldTransform|Retrieves a device context's coordinate space translation matrix + // @comm DC's mode must be set to GM_ADVANCED. See <om win32gui.SetGraphicsMode>. + static PyObject *PyGetWorldTransform(PyObject *self, PyObject *args) + { + CHECK_PFN(GetWorldTransform); + PyObject *obdc; + HDC hdc; + XFORM xform; + if (!PyArg_ParseTuple(args, "O:GetWorldTransform", + &obdc)) // @pyparm <o PyHANDLE>|hdc||Handle to a device context + return NULL; + if (!PyWinObject_AsHANDLE(obdc, (HANDLE *)&hdc, FALSE)) + return NULL; + if (!(*pfnGetWorldTransform)(hdc, &xform)) + return PyWin_SetAPIError("GetWorldTransform"); + return PyWinObject_FromXFORM(&xform); + } + + // @pyswig |SetWorldTransform|Transforms a device context's coordinate space + // @comm DC's mode must be set to GM_ADVANCED. See <om win32gui.SetGraphicsMode>. + static PyObject *PySetWorldTransform(PyObject *self, PyObject *args) + { + CHECK_PFN(SetWorldTransform); + PyObject *obdc, *obxform; + HDC hdc; + XFORM xform; + if (!PyArg_ParseTuple(args, "OO:SetWorldTransform", + &obdc, // @pyparm <o PyHANDLE>|hdc||Handle to a device context + &obxform)) // @pyparm <o PyXFORM>|Xform||Matrix defining the transformation + return NULL; + if (!PyWinObject_AsHANDLE(obdc, (HANDLE *)&hdc, FALSE)) + return NULL; + if (!PyWinObject_AsXFORM(obxform, &xform)) + return NULL; + if (!(*pfnSetWorldTransform)(hdc, &xform)) + return PyWin_SetAPIError("SetWorldTransform"); + Py_INCREF(Py_None); + return Py_None; + } + + // @pyswig |ModifyWorldTransform|Combines a coordinate tranformation with device context's current transformation + // @comm DC's mode must be set to GM_ADVANCED. See <om win32gui.SetGraphicsMode>. + static PyObject *PyModifyWorldTransform(PyObject *self, PyObject *args) + { + CHECK_PFN(ModifyWorldTransform); + PyObject *obdc, *obxform; + HDC hdc; + XFORM xform; + DWORD mode; + if (!PyArg_ParseTuple(args, "OOk:ModifyWorldTransform", + &obdc, // @pyparm <o PyHANDLE>|hdc||Handle to a device context + &obxform, // @pyparm <o PyXFORM>|Xform||Transformation to be applied. Ignored if Mode is MWT_IDENTITY. + &mode)) // @pyparm int|Mode||One of win32con.MWT_* values specifying how transformations will be combined + return NULL; + if (!PyWinObject_AsHANDLE(obdc, (HANDLE *)&hdc, FALSE)) + return NULL; + if (!PyWinObject_AsXFORM(obxform, &xform)) + return NULL; + if (!(*pfnModifyWorldTransform)(hdc, &xform, mode)) + return PyWin_SetAPIError("ModifyWorldTransform"); + Py_INCREF(Py_None); + return Py_None; + } + + // @pyswig <o PyXFORM>|CombineTransform|Combines two coordinate space transformations + static PyObject *PyCombineTransform(PyObject *self, PyObject *args) + { + CHECK_PFN(CombineTransform); + PyObject *obxform1, *obxform2; + XFORM xform1, xform2, ret_xform; + if (!PyArg_ParseTuple(args, "OO:CombineTransform", + &obxform1, // @pyparm <o PyXFORM>|xform1||First transformation + &obxform2)) // @pyparm <o PyXFORM>|xform2||Second transformation + return NULL; + if (!PyWinObject_AsXFORM(obxform1, &xform1)) + return NULL; + if (!PyWinObject_AsXFORM(obxform2, &xform2)) + return NULL; + + if (!(*pfnCombineTransform)(&ret_xform, &xform1, &xform2)) + return PyWin_SetAPIError("CombineTransform"); + return PyWinObject_FromXFORM(&ret_xform); + } + %} + %native (GetWorldTransform) PyGetWorldTransform; + %native (SetWorldTransform) PySetWorldTransform; + %native (ModifyWorldTransform) PyModifyWorldTransform; + %native (CombineTransform) PyCombineTransform; + + + // @pyswig (int,int)|GetWindowOrgEx|Retrievs the window origin for a DC + BOOLAPI GetWindowOrgEx( + HDC hdc, // @pyparm <o PyHANDLE>|hdc||Handle to a device context + POINT *OUTPUT); + + // @pyswig (int,int)|SetWindowOrgEx|Changes the window origin for a DC + // @rdesc Returns the previous origin + BOOLAPI SetWindowOrgEx( + HDC hdc, // @pyparm <o PyHANDLE>|hdc||Handle to a device context + int X, // @pyparm int|X||New X coord in logical units + int Y, // @pyparm int|Y||New Y coord in logical units + POINT *OUTPUT); + + // @pyswig (int,int)|GetViewportOrgEx|Retrievs the origin for a DC's viewport + BOOLAPI GetViewportOrgEx( + HDC hdc, // @pyparm <o PyHANDLE>|hdc||Handle to a device context + POINT *OUTPUT); + + // @pyswig (int,int)|SetViewportOrgEx|Changes the viewport origin for a DC + // @rdesc Returns the previous origin as (x,y) + BOOLAPI SetViewportOrgEx( + HDC hdc, // @pyparm <o PyHANDLE>|hdc||Handle to a device context + int X, // @pyparm int|X||New X coord in logical units + int Y, // @pyparm int|Y||New Y coord in logical units + POINT *OUTPUT); + + + + %{ + PyObject *PyWinObject_FromSIZE(PSIZE psize) + { + return Py_BuildValue("ll", psize->cx, psize->cy); + } + + // @pyswig (int,int)|GetWindowExtEx|Retrieves the window extents for a DC + // @rdesc Returns the extents as (x,y) in logical units + static PyObject *PyGetWindowExtEx(PyObject *self, PyObject *args) + { + PyObject *obdc; + HDC hdc; + SIZE sz; + if (!PyArg_ParseTuple(args, "O:GetWindowExtEx", + &obdc)) // @pyparm <o PyHANDLE>|hdc||Handle to a device context + return NULL; + if (!PyWinObject_AsHANDLE(obdc, (HANDLE *)&hdc, FALSE)) + return NULL; + if (!GetWindowExtEx(hdc, &sz)) + return PyWin_SetAPIError("GetWindowExtEx"); + return PyWinObject_FromSIZE(&sz); + } + + // @pyswig (int,int)|SetWindowExtEx|Changes the window extents for a DC + // @rdesc Returns the previous extents + static PyObject *PySetWindowExtEx(PyObject *self, PyObject *args) + { + PyObject *obdc; + HDC hdc; + SIZE sz; + int x,y; + if (!PyArg_ParseTuple(args, "Oii:SetWindowExtEx", + &obdc, // @pyparm <o PyHANDLE>|hdc||Handle to a device context + &x, // @pyparm int|XExtent||New X extent in logical units + &y)) // @pyparm int|YExtent||New Y extent in logical units + return NULL; + if (!PyWinObject_AsHANDLE(obdc, (HANDLE *)&hdc, FALSE)) + return NULL; + if (!SetWindowExtEx(hdc, x, y, &sz)) + return PyWin_SetAPIError("SetWindowExtEx"); + return PyWinObject_FromSIZE(&sz); + } + + // @pyswig (int,int)|GetViewportExtEx|Retrieves the viewport extents for a DC + // @rdesc Returns the extents as (x,y) in logical units + static PyObject *PyGetViewportExtEx(PyObject *self, PyObject *args) + { + PyObject *obdc; + HDC hdc; + SIZE sz; + if (!PyArg_ParseTuple(args, "O:GetViewportExtEx", + &obdc)) // @pyparm <o PyHANDLE>|hdc||Handle to a device context + return NULL; + if (!PyWinObject_AsHANDLE(obdc, (HANDLE *)&hdc, FALSE)) + return NULL; + if (!GetViewportExtEx(hdc, &sz)) + return PyWin_SetAPIError("GetViewportExtEx"); + return PyWinObject_FromSIZE(&sz); + } + + // @pyswig (int,int)|SetViewportExtEx|Changes the viewport extents for a DC + // @rdesc Returns the previous extents as (x,y) in logical units + static PyObject *PySetViewportExtEx(PyObject *self, PyObject *args) + { + PyObject *obdc; + HDC hdc; + SIZE sz; + int x,y; + if (!PyArg_ParseTuple(args, "Oii:SetViewportExtEx", + &obdc, // @pyparm <o PyHANDLE>|hdc||Handle to a device context + &x, // @pyparm int|XExtent||New X extent in logical units + &y)) // @pyparm int|YExtent||New Y extent in logical units + return NULL; + if (!PyWinObject_AsHANDLE(obdc, (HANDLE *)&hdc, FALSE)) + return NULL; + if (!SetViewportExtEx(hdc, x, y, &sz)) + return PyWin_SetAPIError("SetViewportExtEx"); + return PyWinObject_FromSIZE(&sz); + } + %} + %native (GetWindowExtEx) PyGetWindowExtEx; + %native (SetWindowExtEx) PySetWindowExtEx; + %native (GetViewportExtEx) PyGetViewportExtEx; + %native (SetViewportExtEx) PySetViewportExtEx; + // @pyswig int|GetOpenFileName|Creates an Open dialog box that lets the user specify the drive, directory, and the name of a file or set of files to open. |
From: Roger U. <ru...@us...> - 2006-12-19 13:51:24
|
Update of /cvsroot/pywin32/pywin32/win32/Demos In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15896/win32/Demos Modified Files: print_desktop.py Log Message: Add some more cleanup Index: print_desktop.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/print_desktop.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** print_desktop.py 9 Dec 2006 02:57:49 -0000 1.4 --- print_desktop.py 19 Dec 2006 13:51:22 -0000 1.5 *************** *** 57,60 **** --- 57,63 ---- win32print.ClosePrinter(p) + win32gui.DeleteObject(dcBM) + win32gui.DeleteObject(pcBM) + win32gui.DeleteObject(hf) win32gui.DeleteDC(dDC) win32gui.DeleteDC(dcDC) |
From: Roger U. <ru...@us...> - 2006-12-17 21:38:29
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13442/Pythonwin/pywin/scintilla Modified Files: view.py Log Message: Use signed long format for HDC's in struct.pack Index: view.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/view.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** view.py 10 Jan 2006 05:03:49 -0000 1.24 --- view.py 17 Dec 2006 21:38:27 -0000 1.25 *************** *** 639,643 **** hdcRender = dc.GetHandleOutput() hdcFormat = dc.GetHandleAttrib() ! fr = struct.pack('LLIIIIIIIIll', hdcRender, hdcFormat, rc[0], rc[1], rc[2], rc[3], rc[0], rc[1], rc[2], rc[3], pageStart, lengthDoc) frBuff = array.array('c', fr) addressFrBuff = frBuff.buffer_info()[0] --- 639,643 ---- hdcRender = dc.GetHandleOutput() hdcFormat = dc.GetHandleAttrib() ! fr = struct.pack('llIIIIIIIIll', hdcRender, hdcFormat, rc[0], rc[1], rc[2], rc[3], rc[0], rc[1], rc[2], rc[3], pageStart, lengthDoc) frBuff = array.array('c', fr) addressFrBuff = frBuff.buffer_info()[0] |
From: Roger U. <ru...@us...> - 2006-12-17 21:31:27
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10965/win32/src Modified Files: win32gui.i Log Message: Add more text and gdi functions Index: win32gui.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32gui.i,v retrieving revision 1.90 retrieving revision 1.91 diff -C2 -d -r1.90 -r1.91 *** win32gui.i 13 Dec 2006 17:00:36 -0000 1.90 --- win32gui.i 17 Dec 2006 21:31:24 -0000 1.91 *************** *** 3358,3366 **** #endif /* not MS_WINCE */ ! // @pyswig |ScreenToClient|Convert screen coordinates to client coords ! BOOLAPI ScreenToClient(HWND hWnd,POINT *BOTH); ! // @pyswig |ClientToScreen|Convert client coordinates to screen coords ! BOOLAPI ClientToScreen(HWND hWnd,POINT *BOTH); %{ --- 3358,3370 ---- #endif /* not MS_WINCE */ ! // @pyswig (int,int)|ScreenToClient|Convert screen coordinates to client coords ! BOOLAPI ScreenToClient( ! HWND hWnd, // @pyparm <o PyHANDLE>|hWnd||Handle to a window ! POINT *BOTH); // @pyparm (int,int)|Point||Screen coordinates to be converted ! // @pyswig (int,int)|ClientToScreen|Convert client coordinates to screen coords ! BOOLAPI ClientToScreen( ! HWND hWnd, // @pyparm <o PyHANDLE>|hWnd||Handle to a window ! POINT *BOTH); // @pyparm (int,int)|Point||Client coordinates to be converted %{ *************** *** 3368,3376 **** static PyObject *PyGetTextExtentPoint32(PyObject *self, PyObject *args) { ! // @pyparm int|dc||The device context // @pyparm string|str||The string to measure. ! int dc; ! PyObject *obString; ! if (!PyArg_ParseTuple(args, "iO:GetTextExtentPoint32", &dc, &obString)) return NULL; TCHAR *szString = NULL; --- 3372,3382 ---- static PyObject *PyGetTextExtentPoint32(PyObject *self, PyObject *args) { ! // @pyparm <o PyHANDLE>|hdc||The device context // @pyparm string|str||The string to measure. ! HDC hdc; ! PyObject *obString, *obdc; ! if (!PyArg_ParseTuple(args, "OO:GetTextExtentPoint32", &obdc, &obString)) ! return NULL; ! if (!PyWinObject_AsHANDLE(obdc, (HANDLE *)&hdc, FALSE)) return NULL; TCHAR *szString = NULL; *************** *** 3381,3385 **** BOOL rc; Py_BEGIN_ALLOW_THREADS ! rc = GetTextExtentPoint32( (HDC)dc, szString, nchars, &size); Py_END_ALLOW_THREADS PyWinObject_FreeTCHAR(szString); --- 3387,3391 ---- BOOL rc; Py_BEGIN_ALLOW_THREADS ! rc = GetTextExtentPoint32(hdc, szString, nchars, &size); Py_END_ALLOW_THREADS PyWinObject_FreeTCHAR(szString); *************** *** 3388,3394 **** --- 3394,3574 ---- return Py_BuildValue("ll", size.cx, size.cy); } + + // @pyswig dict|GetTextMetrics|Returns info for the font selected into a DC + static PyObject *PyGetTextMetrics(PyObject *self, PyObject *args) + { + HDC hdc; + PyObject *obdc; + TEXTMETRICW tm; + if (!PyArg_ParseTuple(args, "O:GetTextMetrics", + &obdc)) + return NULL; + if (!PyWinObject_AsHANDLE(obdc, (HANDLE *)&hdc, FALSE)) + return NULL; + if (!GetTextMetricsW(hdc, &tm)) + return PyWin_SetAPIError("GetTextMetrics"); + return Py_BuildValue("{s:l,s:l,s:l,s:l,s:l,s:l,s:l,s:l,s:l,s:l,s:l,s:N,s:N,s:N,s:N,s:B,s:B,s:B,s:B,s:B}", + "Height", tm.tmHeight, + "Ascent", tm.tmAscent, + "Descent", tm.tmDescent, + "InternalLeading", tm.tmInternalLeading, + "ExternalLeading", tm.tmExternalLeading, + "AveCharWidth", tm.tmAveCharWidth, + "MaxCharWidth", tm.tmMaxCharWidth, + "Weight", tm.tmWeight, + "Overhang", tm.tmOverhang, + "DigitizedAspectX", tm.tmDigitizedAspectX, + "DigitizedAspectY", tm.tmDigitizedAspectY, + "FirstChar", PyWinObject_FromWCHAR(&tm.tmFirstChar, 1), + "LastChar", PyWinObject_FromWCHAR(&tm.tmLastChar, 1), + "DefaultChar", PyWinObject_FromWCHAR(&tm.tmDefaultChar, 1), + "BreakChar", PyWinObject_FromWCHAR(&tm.tmBreakChar, 1), + "Italic", tm.tmItalic, + "Underlined", tm.tmUnderlined, + "StruckOut", tm.tmStruckOut, + "PitchAndFamily", tm.tmPitchAndFamily, + "CharSet", tm.tmCharSet); + } + + // @pyswig int|GetTextCharacterExtra|Returns the space between characters + static PyObject *PyGetTextCharacterExtra(PyObject *self, PyObject *args) + { + HDC hdc; + PyObject *obdc; + int ret; + if (!PyArg_ParseTuple(args, "O:GetTextCharacterExtra", + &obdc)) // @pyparm <o PyHANDLE>|hdc||Handle to a device context + return NULL; + if (!PyWinObject_AsHANDLE(obdc, (HANDLE *)&hdc, FALSE)) + return NULL; + ret=GetTextCharacterExtra(hdc); + if (ret==0x80000000) + return PyWin_SetAPIError("GetTextCharacterExtra"); + return PyInt_FromLong(ret); + } + + // @pyswig int|SetTextCharacterExtra|Sets the spacing between characters + // @rdesc Returns the previous spacing + static PyObject *PySetTextCharacterExtra(PyObject *self, PyObject *args) + { + HDC hdc; + PyObject *obdc; + int newspacing, prevspacing; + if (!PyArg_ParseTuple(args, "Oi:SetTextCharacterExtra", + &obdc, // @pyparm <o PyHANDLE>|hdc||Handle to a device context + &newspacing)) // @pyparm int|CharExtra||Space between adjacent chars, in logical units + return NULL; + if (!PyWinObject_AsHANDLE(obdc, (HANDLE *)&hdc, FALSE)) + return NULL; + prevspacing=SetTextCharacterExtra(hdc, newspacing); + if (prevspacing==0x80000000) + return PyWin_SetAPIError("SetTextCharacterExtra"); + return PyInt_FromLong(prevspacing); + } + + // @pyswig int|GetTextAlign|Returns horizontal and vertical alignment for text in a device context + // @rdesc Returns combination of win32con.TA_* flags + static PyObject *PyGetTextAlign(PyObject *self, PyObject *args) + { + HDC hdc; + PyObject *obdc; + int prevalign; + if (!PyArg_ParseTuple(args, "O:GetTextAlign", + &obdc)) // @pyparm <o PyHANDLE>|hdc||Handle to a device context + return NULL; + if (!PyWinObject_AsHANDLE(obdc, (HANDLE *)&hdc, FALSE)) + return NULL; + prevalign=GetTextAlign(hdc); + if (prevalign==GDI_ERROR) + return PyWin_SetAPIError("GetTextAlign"); + return PyInt_FromLong(prevalign); + } + + // @pyswig int|SetTextAlign|Sets horizontal and vertical alignment for text in a device context + // @rdesc Returns the previous alignment flags + static PyObject *PySetTextAlign(PyObject *self, PyObject *args) + { + HDC hdc; + PyObject *obdc; + int newalign, prevalign; + if (!PyArg_ParseTuple(args, "Oi:SetTextAlign", + &obdc, // @pyparm <o PyHANDLE>|hdc||Handle to a device context + &newalign)) // @pyparm int|Mode||Combination of win32con.TA_* constants + return NULL; + if (!PyWinObject_AsHANDLE(obdc, (HANDLE *)&hdc, FALSE)) + return NULL; + prevalign=SetTextAlign(hdc, newalign); + if (prevalign==GDI_ERROR) + return PyWin_SetAPIError("SetTextAlign"); + return PyInt_FromLong(prevalign); + } + + // @pyswig <o PyUnicode>|GetTextFace|Retrieves the name of the font currently selected in a DC + // @comm Calls unicode api function (GetTextFaceW) + static PyObject *PyGetTextFace(PyObject *self, PyObject *args) + { + HDC hdc; + PyObject *obdc; + WCHAR face[256]; + int returned_size; + if (!PyArg_ParseTuple(args, "O:GetTextFace", + &obdc)) // @pyparm <o PyHANDLE>|hdc||Handle to a device context + return NULL; + if (!PyWinObject_AsHANDLE(obdc, (HANDLE *)&hdc, FALSE)) + return NULL; + returned_size=GetTextFaceW(hdc, 256, face); + if (returned_size==0) + return PyWin_SetAPIError("GetTextFace"); + // Char count includes trailing null + return PyWinObject_FromWCHAR(face, returned_size-1); + } + + // @pyswig int|GetMapMode|Returns the method a device context uses to translate logical units to physical units + // @rdesc Returns one of win32con.MM_* values + static PyObject *PyGetMapMode(PyObject *self, PyObject *args) + { + HDC hdc; + PyObject *obdc; + int ret; + if (!PyArg_ParseTuple(args, "O:GetMapMode", + &obdc)) // @pyparm <o PyHANDLE>|hdc||Handle to a device context + return NULL; + if (!PyWinObject_AsHANDLE(obdc, (HANDLE *)&hdc, FALSE)) + return NULL; + ret=GetMapMode(hdc); + if (ret==0) + return PyWin_SetAPIError("GetMapMode"); + return PyInt_FromLong(ret); + } + + // @pyswig int|SetMapMode|Sets the method used for translating logical units to device units + // @rdesc Returns the previous mapping mode, one of win32con.MM_* constants + static PyObject *PySetMapMode(PyObject *self, PyObject *args) + { + HDC hdc; + PyObject *obdc; + int newmode, prevmode; + if (!PyArg_ParseTuple(args, "Oi:SetMapMode", + &obdc, // @pyparm <o PyHANDLE>|hdc||Handle to a device context + &newmode)) // @pyparm int|MapMode||The new mapping mode (win32con.MM_*) + return NULL; + if (!PyWinObject_AsHANDLE(obdc, (HANDLE *)&hdc, FALSE)) + return NULL; + prevmode=SetMapMode(hdc, newmode); + if (prevmode==0) + return PyWin_SetAPIError("SetMapMode"); + return PyInt_FromLong(prevmode); + } %} %native (GetTextExtentPoint32) PyGetTextExtentPoint32; + %native (GetTextMetrics) PyGetTextMetrics; + %native (GetTextCharacterExtra) PyGetTextCharacterExtra; + %native (SetTextCharacterExtra) PySetTextCharacterExtra; + %native (GetTextAlign) PyGetTextAlign; + %native (SetTextAlign) PySetTextAlign; + %native (GetTextFace) PyGetTextFace; + %native (GetMapMode) PyGetMapMode; + %native (SetMapMode) PySetMapMode; // @pyswig int|GetOpenFileName|Creates an Open dialog box that lets the user specify the drive, directory, and the name of a file or set of files to open. *************** *** 4052,4055 **** --- 4232,4240 ---- + // @pyswig int|GetTextColor|Returns the text color for a DC + // @rdesc Returns an RGB color. On error, returns CLR_INVALID + COLORREF GetTextColor( + HDC hdc); // @pyparm int|hdc||Handle to a device context + // @pyswig int|SetTextColor|Changes the text color for a device context // @rdesc Returns the previous color, or CLR_INVALID on failure *************** *** 4058,4061 **** --- 4243,4251 ---- COLORREF color); // @pyparm int|color||The RGB color value - see <om win32api.RGB> + // @pyswig int|GetBkMode|Returns the background mode for a device context + // @rdesc Returns OPAQUE, TRANSPARENT, or 0 on failure + int GetBkMode( + HDC hdc); // @pyparm <o PyHANDLE>|hdc||Handle to a device context + // @pyswig int|SetBkMode|Sets the background mode for a device context // @rdesc Returns the previous mode, or 0 on failure *************** *** 4064,4067 **** --- 4254,4262 ---- int mode); // @pyparm int|BkMode||OPAQUE or TRANSPARENT + // @pyswig int|GetBkColor|Returns the background color for a device context + // @rdesc Returns an RGB color value. On error, returns CLR_INVALID. + int GetBkColor( + HDC hdc); // @pyparm <o PyHANDLE>|hdc||Handle to a device context + // @pyswig int|SetBkColor|Sets the background color for a device context // @rdesc Returns the previous color, or CLR_INVALID on failure |
From: Roger U. <ru...@us...> - 2006-12-15 04:23:02
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3830/win32/src Modified Files: win32process.i Log Message: Add Get/SetThreadPriorityBoost, Get/SetProcessPriorityBoost Index: win32process.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32process.i,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** win32process.i 2 Sep 2006 09:42:59 -0000 1.21 --- win32process.i 15 Dec 2006 04:22:59 -0000 1.22 *************** *** 41,44 **** --- 41,56 ---- typedef DWORD (WINAPI *GetGuiResourcesfunc)(HANDLE,DWORD); static GetGuiResourcesfunc pfnGetGuiResources = NULL; + typedef BOOL (WINAPI *GetProcessPriorityBoostfunc)(HANDLE,PBOOL); + static GetProcessPriorityBoostfunc pfnGetProcessPriorityBoost = NULL; + typedef BOOL (WINAPI *SetProcessPriorityBoostfunc)(HANDLE,BOOL); + static SetProcessPriorityBoostfunc pfnSetProcessPriorityBoost = NULL; + typedef BOOL (WINAPI *GetThreadPriorityBoostfunc)(HANDLE,PBOOL); + static GetThreadPriorityBoostfunc pfnGetThreadPriorityBoost = NULL; + typedef BOOL (WINAPI *SetThreadPriorityBoostfunc)(HANDLE,BOOL); + static SetThreadPriorityBoostfunc pfnSetThreadPriorityBoost = NULL; + typedef BOOL (WINAPI *GetThreadIOPendingFlagfunc)(HANDLE,PBOOL); + static GetThreadIOPendingFlagfunc pfnGetThreadIOPendingFlag = NULL; + typedef BOOL (WINAPI *GetThreadTimesfunc)(HANDLE,LPFILETIME,LPFILETIME,LPFILETIME,LPFILETIME); + static GetThreadTimesfunc pfnGetThreadTimes = NULL; #endif *************** *** 811,814 **** --- 823,951 ---- ); + %{ + // @pyswig bool|GetProcessPriorityBoost|Determines if dynamic priority adjustment is enabled for a process + static PyObject *PyGetProcessPriorityBoost(PyObject *self, PyObject *args) + { + CHECK_PFN(GetProcessPriorityBoost); + PyObject *obth; + HANDLE th; + BOOL ret; + if (!PyArg_ParseTuple(args, "O:GetProcessPriorityBoost", + &obth)) // @pyparm <o PyHANDLE>|Process||Handle to a process + return NULL; + if (!PyWinObject_AsHANDLE(obth, &th, FALSE)) + return NULL; + if (!(*pfnGetProcessPriorityBoost)(th, &ret)) + return PyWin_SetAPIError("GetProcessPriorityBoost"); + return PyBool_FromLong(ret); + } + + // @pyswig |SetProcessPriorityBoost|Enables or disables dynamic priority adjustment for a process + static PyObject *PySetProcessPriorityBoost(PyObject *self, PyObject *args) + { + CHECK_PFN(SetProcessPriorityBoost); + PyObject *obth; + HANDLE th; + BOOL disable; + if (!PyArg_ParseTuple(args, "Ol:SetProcessPriorityBoost", + &obth, // @pyparm <o PyHANDLE>|Process||Handle to a process + &disable)) // @pyparm boolean|DisablePriorityBoost||True to disable or False to enable + return NULL; + if (!PyWinObject_AsHANDLE(obth, &th, FALSE)) + return NULL; + if (!(*pfnSetProcessPriorityBoost)(th, disable)) + return PyWin_SetAPIError("SetProcessPriorityBoost"); + Py_INCREF(Py_None); + return Py_None; + } + + // @pyswig bool|GetThreadPriorityBoost|Determines if dynamic priority adjustment is enabled for a thread + static PyObject *PyGetThreadPriorityBoost(PyObject *self, PyObject *args) + { + CHECK_PFN(GetThreadPriorityBoost); + PyObject *obth; + HANDLE th; + BOOL ret; + if (!PyArg_ParseTuple(args, "O:GetThreadPriorityBoost", + &obth)) // @pyparm <o PyHANDLE>|Thread||Handle to a thread + return NULL; + if (!PyWinObject_AsHANDLE(obth, &th, FALSE)) + return NULL; + if (!(*pfnGetThreadPriorityBoost)(th, &ret)) + return PyWin_SetAPIError("GetThreadPriorityBoost"); + return PyBool_FromLong(ret); + } + + // @pyswig |SetThreadPriorityBoost|Enables or disables dynamic priority adjustment for a thread + static PyObject *PySetThreadPriorityBoost(PyObject *self, PyObject *args) + { + CHECK_PFN(SetThreadPriorityBoost); + PyObject *obth; + HANDLE th; + BOOL disable; + if (!PyArg_ParseTuple(args, "Ol:SetThreadPriorityBoost", + &obth, // @pyparm <o PyHANDLE>|Thread||Handle to a thread + &disable)) // @pyparm boolean|DisablePriorityBoost||True to disable or False to enable + return NULL; + if (!PyWinObject_AsHANDLE(obth, &th, FALSE)) + return NULL; + if (!(*pfnSetThreadPriorityBoost)(th, disable)) + return PyWin_SetAPIError("SetThreadPriorityBoost"); + Py_INCREF(Py_None); + return Py_None; + } + + // @pyswig bool|GetThreadIOPendingFlag|Determines if thread has any outstanding IO requests + static PyObject *PyGetThreadIOPendingFlag(PyObject *self, PyObject *args) + { + CHECK_PFN(GetThreadIOPendingFlag); + PyObject *obth; + HANDLE th; + BOOL ret; + if (!PyArg_ParseTuple(args, "O:GetThreadIOPendingFlag", + &obth)) // @pyparm <o PyHANDLE>|Thread||Handle to a thread + return NULL; + if (!PyWinObject_AsHANDLE(obth, &th, FALSE)) + return NULL; + if (!(*pfnGetThreadPriorityBoost)(th, &ret)) + return PyWin_SetAPIError("GetThreadIOPendingFlag"); + return PyBool_FromLong(ret); + } + + // @pyswig dict|GetThreadTimes|Returns a thread's time statistics + static PyObject *PyGetThreadTimes(PyObject *self, PyObject *args) + { + CHECK_PFN(GetThreadTimes); + PyObject *obth; + HANDLE th; + FILETIME ft[4]; + if (!PyArg_ParseTuple(args, "O:GetThreadTimes", + &obth)) // @pyparm <o PyHANDLE>|Thread||Handle to a thread + return NULL; + if (!PyWinObject_AsHANDLE(obth, &th, FALSE)) + return NULL; + if (!(*pfnGetThreadTimes)(th, &ft[0], &ft[1], &ft[2], &ft[3])) + return PyWin_SetAPIError("GetThreadTimes"); + + // UserTime and KernelTime are elapsed times, return as ints + ULARGE_INTEGER usertime, kerneltime; + kerneltime.LowPart=ft[2].dwLowDateTime; + kerneltime.HighPart=ft[2].dwHighDateTime; + usertime.LowPart=ft[3].dwLowDateTime; + usertime.HighPart=ft[3].dwHighDateTime; + return Py_BuildValue("{s:N, s:N, s:N, s:N}", + "CreationTime", PyWinObject_FromFILETIME(ft[0]), + "ExitTime", PyWinObject_FromFILETIME(ft[1]), + "KernelTime", PyLong_FromUnsignedLongLong(kerneltime.QuadPart), + "UserTime", PyLong_FromUnsignedLongLong(usertime.QuadPart)); + } + %} + %native (GetProcessPriorityBoost) PyGetProcessPriorityBoost; + %native (SetProcessPriorityBoost) PySetProcessPriorityBoost; + %native (GetThreadPriorityBoost) PyGetThreadPriorityBoost; + %native (SetThreadPriorityBoost) PySetThreadPriorityBoost; + %native (GetThreadIOPendingFlag) PyGetThreadIOPendingFlag; + %native (GetThreadTimes) PyGetThreadTimes; + #ifndef MS_WINCE *************** *** 1367,1370 **** --- 1504,1513 ---- pfnGetProcessWorkingSetSize=(GetProcessWorkingSetSizefunc)GetProcAddress(hmodule,"GetProcessWorkingSetSize"); pfnSetProcessWorkingSetSize=(SetProcessWorkingSetSizefunc)GetProcAddress(hmodule,"SetProcessWorkingSetSize"); + pfnGetProcessPriorityBoost=(GetProcessPriorityBoostfunc)GetProcAddress(hmodule,"GetProcessPriorityBoost"); + pfnSetProcessPriorityBoost=(SetProcessPriorityBoostfunc)GetProcAddress(hmodule,"SetProcessPriorityBoost"); + pfnGetThreadPriorityBoost=(GetThreadPriorityBoostfunc)GetProcAddress(hmodule,"GetThreadPriorityBoost"); + pfnSetThreadPriorityBoost=(SetThreadPriorityBoostfunc)GetProcAddress(hmodule,"SetThreadPriorityBoost"); + pfnGetThreadIOPendingFlag=(GetThreadIOPendingFlagfunc)GetProcAddress(hmodule,"GetThreadIOPendingFlag"); + pfnGetThreadTimes=(GetThreadTimesfunc)GetProcAddress(hmodule,"GetThreadTimes"); } |
From: Mark H. <mha...@us...> - 2006-12-14 08:35:36
|
Update of /cvsroot/pywin32/pywin32/isapi/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1831/src Modified Files: PyExtensionObjects.cpp PyFilterObjects.cpp Log Message: Handle server variables > 8k in length and also handle IIS6 'UNICODE_' variables. Index: PyExtensionObjects.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/isapi/src/PyExtensionObjects.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PyExtensionObjects.cpp 12 Oct 2006 07:00:37 -0000 1.4 --- PyExtensionObjects.cpp 14 Dec 2006 08:35:34 -0000 1.5 *************** *** 344,354 **** char buf[8192] = ""; ! DWORD bufsize = sizeof(buf)/sizeof(buf[0]); if (pecb->m_pcb){ Py_BEGIN_ALLOW_THREADS bRes = pecb->m_pcb->GetServerVariable(variable, buf, &bufsize); Py_END_ALLOW_THREADS if (!bRes) { if (def) { Py_INCREF(def); --- 344,377 ---- char buf[8192] = ""; ! DWORD bufsize = sizeof(buf); ! char *bufUse = buf; if (pecb->m_pcb){ Py_BEGIN_ALLOW_THREADS bRes = pecb->m_pcb->GetServerVariable(variable, buf, &bufsize); + if (!bRes && GetLastError() == ERROR_INSUFFICIENT_BUFFER) { + // Although the IIS docs say it should be good, IIS5 + // returns -1 for 'bufsize' and MS samples show not + // to trust it too. Like the MS sample, we max out + // at some value - we choose 64k. We double each + // time, meaning we get 3 goes around the loop + bufUse = NULL; + bufsize = sizeof(buf); + for (int i=0;i<3;i++) { + bufsize *= 2; + bufUse = (char *)realloc(bufUse, bufsize); + if (!bufUse) + break; + bRes = pecb->m_pcb->GetServerVariable(variable, bufUse, &bufsize); + if (bRes || GetLastError() != ERROR_INSUFFICIENT_BUFFER) + break; + } + } Py_END_ALLOW_THREADS + if (!bufUse) + return PyErr_NoMemory(); if (!bRes) { + if (bufUse != buf) + free(bufUse); if (def) { Py_INCREF(def); *************** *** 358,362 **** } } ! return PyString_FromStringAndSize(buf, bufsize); } --- 381,390 ---- } } ! PyObject *ret = strncmp("UNICODE_", variable, 8) == 0 ? ! PyUnicode_FromWideChar((WCHAR *)bufUse, bufsize / sizeof(WCHAR)) : ! PyString_FromStringAndSize(bufUse, bufsize); ! if (bufUse != buf) ! free(bufUse); ! return ret; } Index: PyFilterObjects.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/isapi/src/PyFilterObjects.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PyFilterObjects.cpp 12 Oct 2006 01:44:57 -0000 1.7 --- PyFilterObjects.cpp 14 Dec 2006 08:35:34 -0000 1.8 *************** *** 229,237 **** --- 229,260 ---- char buf[8192] = ""; DWORD bufsize = sizeof(buf)/sizeof(buf[0]); + char *bufUse = buf; if (phfc->m_pfc){ Py_BEGIN_ALLOW_THREADS bRes = phfc->m_pfc->GetServerVariable(variable, buf, &bufsize); + if (!bRes && GetLastError() == ERROR_INSUFFICIENT_BUFFER) { + // Although the IIS docs say it should be good, IIS5 + // returns -1 for 'bufsize' and MS samples show not + // to trust it too. Like the MS sample, we max out + // at some value - we choose 64k. We double each + // time, meaning we get 3 goes around the loop + bufUse = NULL; + bufsize = sizeof(buf); + for (int i=0;i<3;i++) { + bufsize *= 2; + bufUse = (char *)realloc(bufUse, bufsize); + if (!bufUse) + break; + bRes = phfc->m_pfc->GetServerVariable(variable, bufUse, &bufsize); + if (bRes || GetLastError() != ERROR_INSUFFICIENT_BUFFER) + break; + } + } Py_END_ALLOW_THREADS + if (!bufUse) + return PyErr_NoMemory(); if (!bRes) { + if (bufUse != buf) + free(bufUse); if (def) { Py_INCREF(def); *************** *** 241,245 **** } } ! return PyString_FromStringAndSize(buf, bufsize); } --- 264,273 ---- } } ! PyObject *ret = strncmp("UNICODE_", variable, 8) == 0 ? ! PyUnicode_FromWideChar((WCHAR *)bufUse, bufsize / sizeof(WCHAR)) : ! PyString_FromStringAndSize(bufUse, bufsize); ! if (bufUse != buf) ! free(bufUse); ! return ret; } |
From: Mark H. <mha...@us...> - 2006-12-14 08:35:36
|
Update of /cvsroot/pywin32/pywin32/isapi/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1831/test Modified Files: extension_simple.py Log Message: Handle server variables > 8k in length and also handle IIS6 'UNICODE_' variables. Index: extension_simple.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/isapi/test/extension_simple.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** extension_simple.py 6 Oct 2004 05:11:55 -0000 1.1 --- extension_simple.py 14 Dec 2006 08:35:34 -0000 1.2 *************** *** 4,9 **** # Install this extension, then point your browser to: # "http://localhost/pyisapi_test/test1" ! # This will execute the method 'test1' below. You can specify any method name ! # at all, but currently there is only 1. from isapi import isapicon, threaded_extension, ExtensionError --- 4,9 ---- # Install this extension, then point your browser to: # "http://localhost/pyisapi_test/test1" ! # This will execute the method 'test1' below. See below for the list of ! # test methods that are acceptable. from isapi import isapicon, threaded_extension, ExtensionError *************** *** 34,44 **** raise AttributeError, "No test named '%s'" % (test_name,) result = meth(ecb) ecb.SendResponseHeaders("200 OK", "Content-type: text/html\r\n\r\n", False) ! print >> ecb, "<HTML><BODY>OK" ! if result: ! print >> ecb, "<pre>" ! print >> ecb, result ! print >> ecb, "</pre>" print >> ecb, "</BODY></HTML>" ecb.DoneWithSession() --- 34,46 ---- raise AttributeError, "No test named '%s'" % (test_name,) result = meth(ecb) + if result is None: + # This means the test finalized everything + return ecb.SendResponseHeaders("200 OK", "Content-type: text/html\r\n\r\n", False) ! print >> ecb, "<HTML><BODY>Finished running test <i>", test_name, "</i>" ! print >> ecb, "<pre>" ! print >> ecb, result ! print >> ecb, "</pre>" print >> ecb, "</BODY></HTML>" ecb.DoneWithSession() *************** *** 51,54 **** --- 53,91 ---- assert err.errno == winerror.ERROR_INVALID_INDEX, err return "worked!" + + def test_long_vars(self, ecb): + qs = ecb.GetServerVariable("QUERY_STRING") + # Our implementation has a default buffer size of 8k - so we test + # the code that handles an overflow by ensuring there are more + # than 8k worth of chars in the URL. + expected_query = ('x' * 8500) + if len(qs)==0: + # Just the URL with no query part - redirect to myself, but with + # a huge query portion. + me = ecb.GetServerVariable("URL") + headers = "Location: " + me + "?" + expected_query + "\r\n\r\n" + ecb.SendResponseHeaders("301 Moved", headers) + ecb.DoneWithSession() + return None + if qs == expected_query: + return "Total length of variable is %d - test worked!" % (len(qs),) + else: + return "Unexpected query portion! Got %d chars, expected %d" % \ + (len(qs), len(expected_query)) + + def test_unicode_vars(self, ecb): + # We need to check that we are running IIS6! This seems the only + # effective way from an extension. + ver = float(ecb.GetServerVariable("SERVER_SOFTWARE").split('/')[1]) + if ver < 6.0: + return "This is IIS version %g - unicode only works in IIS6 and later" % ver + + us = ecb.GetServerVariable("UNICODE_SERVER_NAME") + if not isinstance(us, unicode): + raise RuntimeError, "unexpected type!" + if us != unicode(ecb.GetServerVariable("SERVER_NAME")): + raise RuntimeError, "Unicode and non-unicode values were not the same" + return "worked!" + # The entry points for the ISAPI extension. def __ExtensionFactory__(): |
From: Mark H. <mha...@us...> - 2006-12-14 08:34:41
|
Update of /cvsroot/pywin32/pywin32/isapi/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1573/src Modified Files: pyISAPI.cpp Log Message: remove old comments Index: pyISAPI.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/isapi/src/pyISAPI.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** pyISAPI.cpp 12 Oct 2006 07:00:37 -0000 1.6 --- pyISAPI.cpp 14 Dec 2006 08:34:39 -0000 1.7 *************** *** 246,256 **** } ! /////////////////////////////////////////////////////////////////////// ! // If your extension will not use MFC, you'll need this code to make ! // sure the extension objects can find the resource handle for the ! // module. If you convert your extension to not be dependent on MFC, ! // remove the comments arounn the following AfxGetResourceHandle() ! // and DllMain() functions, as well as the g_hInstance global. ! HINSTANCE g_hInstance = 0; --- 246,250 ---- } ! // DLL entry point - store the handle to our module. HINSTANCE g_hInstance = 0; |
From: Roger U. <ru...@us...> - 2006-12-13 17:00:42
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12275/win32/src Modified Files: win32gui.i Log Message: Add PatBlt, SetROP2, GetROP2 Index: win32gui.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32gui.i,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** win32gui.i 13 Dec 2006 13:47:44 -0000 1.89 --- win32gui.i 13 Dec 2006 17:00:36 -0000 1.90 *************** *** 2426,2429 **** --- 2426,2438 ---- ); + // @pyswig |PatBlt|Paints a rectangle by combining the current brush with existing colors + BOOLAPI PatBlt( + HDC hdc, // @pyparm <o PyHANDLE>|hdc||Handle to a device context + int XLeft, // @pyparm int|XLeft||Horizontal pos + int YLeft, // @pyparm int|YLeft||Vertical pos + int Width, // @pyparm int|Width||Width of rectangular area + int Height, // @pyparm int|Height||Height of rectangular area + DWORD Rop); // @pyparm int|Rop||Raster operation, one of PATCOPY,PATINVERT,DSTINVERT,BLACKNESS,WHITENESS + #ifndef MS_WINCE // @pyswig int|SetStretchBltMode|Sets the stretching mode used by <om win32gui.StretchBlt> *************** *** 3679,3685 **** --- 3688,3733 ---- return PyLong_FromUnsignedLong(ret); } + + // @pyswig int|GetROP2|Returns the foreground mixing mode of a DC + // @rdesc Returns one of win32con.R2_* values + static PyObject *PyGetROP2(PyObject *self, PyObject *args) + { + PyObject *obdc; + HDC hdc; + int ret; + if (!PyArg_ParseTuple(args, "O:GetROP2", + &obdc)) // @pyparm <o PyHANDLE>|hdc||Handle to a device context + return NULL; + if (!PyWinObject_AsHANDLE(obdc, (HANDLE *)&hdc, FALSE)) + return NULL; + ret=GetROP2(hdc); + if (ret==0) + return PyWin_SetAPIError("GetROP2"); + return PyInt_FromLong(ret); + } + + // @pyswig int|SetROP2|Sets the foreground mixing mode of a DC + // @rdesc Returns previous mode + static PyObject *PySetROP2(PyObject *self, PyObject *args) + { + PyObject *obdc; + HDC hdc; + int newmode, oldmode; + if (!PyArg_ParseTuple(args, "Oi:SetROP2", + &obdc, // @pyparm <o PyHANDLE>|hdc||Handle to a device context + &newmode)) // @pyparm int|DrawMode||Mixing mode, one of win32con.R2_*. + return NULL; + if (!PyWinObject_AsHANDLE(obdc, (HANDLE *)&hdc, FALSE)) + return NULL; + oldmode=SetROP2(hdc, newmode); + if (oldmode==0) + return PyWin_SetAPIError("SetROP2"); + return PyInt_FromLong(oldmode); + } %} %native (SetPixel) PySetPixel; %native (GetPixel) PyGetPixel; + %native (GetROP2) PyGetROP2; + %native (SetROP2) PySetROP2; // @pyswig |SetPixelV|Sets the color of a single pixel to an approximation of specified color |
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 ---- |
From: Roger U. <ru...@us...> - 2006-12-13 12:49:37
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16790/win32/src Modified Files: win32gui.i Log Message: Add Path functions and some more drawing functions Index: win32gui.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32gui.i,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** win32gui.i 11 Dec 2006 05:27:34 -0000 1.87 --- win32gui.i 13 Dec 2006 12:48:51 -0000 1.88 *************** *** 42,45 **** --- 42,47 ---- typedef BOOL (WINAPI *GetLayeredWindowAttributesfunc)(HWND, COLORREF *, BYTE *, DWORD *); static GetLayeredWindowAttributesfunc pfnGetLayeredWindowAttributes=NULL; + typedef BOOL (WINAPI *AngleArcfunc)(HDC, int, int, DWORD, FLOAT, FLOAT); + static AngleArcfunc pfnAngleArc=NULL; static PyObject *g_AtomMap = NULL; // Mapping class atoms to Python WNDPROC *************** *** 115,118 **** --- 117,127 ---- } + hmodule=GetModuleHandle("gdi32.dll"); + if (hmodule==NULL) + hmodule=LoadLibrary("gdi32.dll"); + if (hmodule){ + pfnAngleArc=(AngleArcfunc)GetProcAddress(hmodule,"AngleArc"); + } + %} *************** *** 2415,2424 **** #ifndef MS_WINCE ! // @pyswig int|SetStretchBltMode| // @rdesc If the function succeeds, the return value is the previous stretching mode. // <nl>If the function fails, the return value is zero. ! int SetStretchBltMode(HDC dc, int mode); ! // @pyparm int|dc|| ! // @pyparm int|mode|| #endif /* not MS_WINCE */ --- 2424,2437 ---- #ifndef MS_WINCE ! // @pyswig int|SetStretchBltMode|Sets the stretching mode used by <om win32gui.StretchBlt> // @rdesc If the function succeeds, the return value is the previous stretching mode. // <nl>If the function fails, the return value is zero. ! int SetStretchBltMode( ! HDC hdc, // @pyparm <o PyHANDLE>|hdc||Handle to a device context ! int StretchMode); // @pyparm int|StretchMode||One of BLACKONWHITE,COLORONCOLOR,HALFTONE,STRETCH_ANDSCANS,STRETCH_DELETESCANS,STRETCH_HALFTONE,STRETCH_ORSCANS, or WHITEONBLACK (from win32con) ! ! // @pyswig int|GetStretchBltMode|Returns the stretching mode used by <om win32gui.StretchBlt> ! // @rdesc Returns one of BLACKONWHITE,COLORONCOLOR,HALFTONE,STRETCH_ANDSCANS,STRETCH_DELETESCANS,STRETCH_HALFTONE,STRETCH_ORSCANS,WHITEONBLACK, or 0 on error. ! int GetStretchBltMode(HDC hdc); // @pyparm <o PyHANDLE>|hdc||Handle to a device context #endif /* not MS_WINCE */ *************** *** 3572,3575 **** --- 3585,3617 ---- int YRadial2); // @pyparm int|YRadial2||Vertical pos of Radial2 endpoint + %{ + // @pyswig |AngleArc|Draws a line from current pos and a section of a circle's arc + static PyObject *PyAngleArc(PyObject *self, PyObject *args) + { + CHECK_PFN(AngleArc); + HDC hdc; + int x,y; + DWORD radius; + FLOAT startangle, sweepangle; + PyObject *obdc; + if (!PyArg_ParseTuple(args, "Oiikff", + &obdc, // @pyparm <o PyHANDLE>|hdc||Handle to a device context + &x, // @pyparm int|Y||x pos of circle + &y, // @pyparm int|Y||y pos of circle + &radius, // @pyparm int|Radius||Radius of circle + &startangle, // @pyparm float|StartAngle||Angle where arc starts, in degrees + &sweepangle)) // @pyparm float|SweepAngle||Angle that arc covers, in degrees + return NULL; + if (!PyWinObject_AsHANDLE(obdc, (HANDLE *)&hdc, FALSE)) + return NULL; + if (!(*pfnAngleArc)(hdc, x, y, radius, startangle, sweepangle)) + return PyWin_SetAPIError("AngleArc"); + Py_INCREF(Py_None); + return Py_None; + } + %} + %native (AngleArc) PyAngleArc; + + // @pyswig |Chord|Draws a chord defined by an ellipse and 2 radials BOOLAPI Chord( *************** *** 3584,3587 **** --- 3626,3691 ---- int YRadial2); // @pyparm int|YRadial2||Vertical pos of Radial2 endpoint + // @pyswig |ExtFloodFill|Fills an area with current brush + BOOLAPI ExtFloodFill( + HDC hdc, // @pyparm <o PyHANDLE>||hdc|Handle to a device context + int XStart, // @pyparm int|XStart||Horizontal starting pos + int YStart, // @pyparm int|YStart||Vertical starting pos + COLORREF Color, // @pyparm int|Color||RGB color value. See <om win32api.RGB>. + UINT FillType); // @pyparm int|FillType||One of win32con.FLOODFILL* values + + %{ + // @pyswig int|SetPixel|Set the color of a single pixel + // @rdesc Returns the RGB color actually set, which may be different from the one passed in + static PyObject *PySetPixel(PyObject *self, PyObject *args) + { + PyObject *obdc; + HDC hdc; + int x,y; + COLORREF color, ret; + if (!PyArg_ParseTuple(args, "Oiik:SetPixel", + &obdc, // @pyparm <o PyHANDLE>|hdc||Handle to a device context + &x, // @pyparm int|X||Horizontal pos + &y, // @pyparm int|Y||Vertical pos + &color)) // @pyparm int|Color||RGB color to be set. + return NULL; + if (!PyWinObject_AsHANDLE(obdc, (HANDLE *)&hdc, FALSE)) + return NULL; + ret=SetPixel(hdc, x, y, color); + if (ret==CLR_INVALID) + return PyWin_SetAPIError("SetPixel"); + return PyLong_FromUnsignedLong(ret); + } + + // @pyswig int|GetPixel|Returns the RGB color of a single pixel + static PyObject *PyGetPixel(PyObject *self, PyObject *args) + { + PyObject *obdc; + HDC hdc; + int x,y; + COLORREF ret; + if (!PyArg_ParseTuple(args, "Oii:GetPixel", + &obdc, // @pyparm <o PyHANDLE>|hdc||Handle to a device context + &x, // @pyparm int|XPos||Horizontal pos + &y)) // @pyparm int|YPos||Vertical pos + return NULL; + if (!PyWinObject_AsHANDLE(obdc, (HANDLE *)&hdc, FALSE)) + return NULL; + ret=GetPixel(hdc, x, y); + if (ret==CLR_INVALID) + return PyWin_SetAPIError("GetPixel"); + return PyLong_FromUnsignedLong(ret); + } + %} + %native (SetPixel) PySetPixel; + %native (GetPixel) PyGetPixel; + + // @pyswig |SetPixelV|Sets the color of a single pixel to an approximation of specified color + BOOLAPI SetPixelV( + HDC hdc, // @pyparm <o PyHANDLE>|hdc||Handle to a device context + int X, // @pyparm int|X||Horizontal pos + int Y, // @pyparm int|Y||Vertical pos + COLORREF Color); // @pyparm int|Color||RGB color to be set. + + // @pyswig (int, int)|MoveToEx|Changes the current drawing position // @rdesc Returns the previous position as (X, Y) *************** *** 3966,3969 **** --- 4070,4189 ---- BOOLAPI EndPaint(HWND hWnd, PAINTSTRUCT *INPUT); + // @pyswig |BeginPath|Initializes a path in a DC + BOOLAPI BeginPath(HDC hdc); // @pyparm <o PyHANDLE>|hdc||Handle to a device context + + // @pyswig |EndPath|Finalizes a path begun by <om win32gui.BeginPath> + BOOLAPI EndPath(HDC hdc); // @pyparm <o PyHANDLE>|hdc||Handle to a device context + + // @pyswig |AbortPath|Cancels a path begun by <om win32gui.BeginPath> + BOOLAPI AbortPath(HDC hdc); // @pyparm <o PyHANDLE>|hdc||Handle to a device context + + // @pyswig |CloseFigure|Closes a section of a path by connecting the beginning pos with the current pos + BOOLAPI CloseFigure(HDC hdc); // @pyparm <o PyHANDLE>|hdc||Handle to a device context that contains an open path. See <om win32gui.BeginPath>. + + // @pyswig |FlattenPath|Flattens any curves in current path into a series of lines + BOOLAPI FlattenPath(HDC hdc); // @pyparm <o PyHANDLE>|hdc||Handle to a device context that contains a closed path. See <om win32gui.EndPath>. + + // @pyswig |FillPath|Fills a path with currently selected brush + // @comm Any open figures are closed and path is deselected from the DC. + BOOLAPI FillPath(HDC hdc); // @pyparm <o PyHANDLE>|hdc||Handle to a device context that contains a finalized path. See <om win32gui.EndPath>. + + // @pyswig |WidenPath|Widens current path by amount it would increase by if drawn with currently selected pen + BOOLAPI WidenPath(HDC hdc); // @pyparm <o PyHANDLE>|hdc||Handle to a device context that contains a closed path. See <om win32gui.EndPath>. + + // @pyswig |StrokePath|Draws current path with currently selected pen + BOOLAPI StrokePath(HDC hdc); // @pyparm <o PyHANDLE>|hdc||Handle to a device context that contains a closed path. See <om win32gui.EndPath>. + + // @pyswig |StrokeAndFillPath|Combines operations of StrokePath and FillPath with no overlap + BOOLAPI StrokeAndFillPath(HDC hdc); // @pyparm <o PyHANDLE>|hdc||Handle to a device context that contains a closed path. See <om win32gui.EndPath>. + + // @pyswig float|GetMiterLimit|Retrieves the limit of miter joins for a DC + BOOLAPI GetMiterLimit( + HDC hdc, // @pyparm <o PyHANDLE>|hdc||Handle to a device context + float *OUTPUT); + + // @pyswig float|SetMiterLimit|Set the limit of miter joins for a DC + // @rdesc Returns the previous limit + BOOLAPI SetMiterLimit( + HDC hdc, // @pyparm <o PyHANDLE>|hdc||Handle to a device context + float NewLimit, // @pyparm float|NewLimit||New limit to be set + float *OUTPUT); + + // @pyswig <o PyHANDLE>|PathToRegion|Converts a closed path in a DC to a region + // @comm On success, the path is deselected from the DC + HRGN PathToRegion(HDC hdc); // @pyparm <o PyHANDLE>|hdc||Handle to a device context that contains a closed path. See <om win32gui.EndPath>. + + %{ + // @pyswig tuple,tuple|GetPath|Returns a sequence of points that describe the current path + // @rdesc Returns a sequence of POINT tuples, and a sequence of ints designating each point's function (combination of win32con.PT_* values) + static PyObject *PyGetPath(PyObject *self, PyObject *args) + { + HDC hdc; + POINT *points=NULL; + BYTE *types=NULL; + DWORD point_cnt=0, point_ind; + PyObject *obpoints=NULL, *obtypes=NULL, *obdc, *ret=NULL; + if (!PyArg_ParseTuple(args, "O:GetPath", + &obdc)) // @pyparm <o PyHANDLE>|hdc||Handle to a device context containing a finalized path. See <om win32gui.EndPath> + return NULL; + if (!PyWinObject_AsHANDLE(obdc, (HANDLE *)&hdc, FALSE)) + return NULL; + point_cnt=GetPath(hdc, points, types, point_cnt); + if (point_cnt==-1) + return PyWin_SetAPIError("GetPath"); + + points=(POINT *)malloc(point_cnt*sizeof(POINT)); + if (points==NULL){ + PyErr_Format(PyExc_MemoryError, "Unable to allocate %d bytes",point_cnt*sizeof(POINT)); + goto cleanup; + } + types=(BYTE *)malloc(point_cnt); + if (types==NULL){ + PyErr_Format(PyExc_MemoryError, "Unable to allocate %d bytes",point_cnt); + goto cleanup; + } + point_cnt=GetPath(hdc, points, types, point_cnt); + if (point_cnt==-1){ + PyWin_SetAPIError("GetPath"); + goto cleanup; + } + obpoints=PyTuple_New(point_cnt); + obtypes=PyTuple_New(point_cnt); + if ((obpoints==NULL) || (obtypes==NULL)) + goto cleanup; + for (point_ind=0; point_ind<point_cnt; point_ind++){ + PyObject *tuple_item=Py_BuildValue("ll", points[point_ind].x, points[point_ind].y); + if (tuple_item==NULL) + goto cleanup; + PyTuple_SET_ITEM(obpoints, point_ind, tuple_item); + tuple_item=PyInt_FromLong(types[point_ind]); + if (tuple_item==NULL) + goto cleanup; + PyTuple_SET_ITEM(obtypes, point_ind, tuple_item); + } + ret=Py_BuildValue("OO", obpoints, obtypes); + + cleanup: + Py_XDECREF(obpoints); + Py_XDECREF(obtypes); + if (points!=NULL) + free(points); + if (types!=NULL) + free(types); + return ret; + } + %} + %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( |
From: Roger U. <ru...@us...> - 2006-12-11 12:18:26
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13624/win32/src Modified Files: win32consolemodule.cpp Log Message: Duplicate handle when an existing handle is wrapped. Use PyHANDLE's error checking logic in tp_dealloc. Index: win32consolemodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32consolemodule.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** win32consolemodule.cpp 23 Oct 2005 11:33:52 -0000 1.8 --- win32consolemodule.cpp 11 Dec 2006 12:18:24 -0000 1.9 *************** *** 758,770 **** // Use PyConsoleScreenBufferType(Handle) to wrap a pre-existing handle as returned by <om win32api.GetStdHandle>. // Will also accept a handle created by <om win32file.CreateFile> for CONIN$ or CONOUT$. ! // Only handles created by CreateConsoleScreenBuffer will be closed when Python object is destroyed class PyConsoleScreenBuffer : public PyHANDLE { public: ! PyConsoleScreenBuffer(HANDLE hconsole, BOOL bautoclose); ~PyConsoleScreenBuffer(void); static void tp_dealloc(PyObject *ob); const char *GetTypeName() {return "PyConsoleScreenBuffer";} - BOOL bAutoClose; // static struct PyMemberDef members[]; static struct PyMethodDef methods[]; --- 758,770 ---- // Use PyConsoleScreenBufferType(Handle) to wrap a pre-existing handle as returned by <om win32api.GetStdHandle>. // Will also accept a handle created by <om win32file.CreateFile> for CONIN$ or CONOUT$. ! // When an existing handle is wrapped, a copy is made using DuplicateHandle, and caller is still responsible ! // for any cleanup of original handle. class PyConsoleScreenBuffer : public PyHANDLE { public: ! PyConsoleScreenBuffer(HANDLE hconsole); ~PyConsoleScreenBuffer(void); static void tp_dealloc(PyObject *ob); const char *GetTypeName() {return "PyConsoleScreenBuffer";} // static struct PyMemberDef members[]; static struct PyMethodDef methods[]; *************** *** 900,913 **** }; - /* - ?????? Class members can't be accessed thru normal means due to offsetof failing for derived classes - which have a base with virtual methods - Maybe expose AutoClose via Get/Set methods ??????? - struct PyMemberDef PyConsoleScreenBuffer::members[] = - { - {"AutoClose", T_INT, offsetof(PyConsoleScreenBuffer, bAutoClose), 0, "Indicates whether handle should be closed when python object is destroyed"}, - {NULL} - }; - */ // @pymethod |PyConsoleScreenBuffer|SetConsoleActiveScreenBuffer|Sets this handle as the currently displayed screen buffer --- 900,903 ---- *************** *** 1567,1596 **** #define PyConsoleScreenBuffer_Check(ob) ((ob)->ob_type == &PyConsoleScreenBufferType) PyObject *PyConsoleScreenBuffer::tp_new(PyTypeObject *tp, PyObject *args, PyObject *kwargs) { static char *keywords[]={"Handle", NULL}; HANDLE h; ! if (!PyArg_ParseTupleAndKeywords(args, kwargs, "l", keywords, &h)) return NULL; ! return new PyConsoleScreenBuffer(h, FALSE); } ! PyConsoleScreenBuffer::PyConsoleScreenBuffer(HANDLE hconsole, BOOL bautoclose) : PyHANDLE(hconsole) { ob_type = &PyConsoleScreenBufferType; - bAutoClose=bautoclose; } PyConsoleScreenBuffer::~PyConsoleScreenBuffer(void) { ! // Only close handles explicitely created by CreateConsoleScreenBuffer ! // Let PyHANDLE's exception catching logic take care of it ! if (this->bAutoClose) ! this->Close(); } void PyConsoleScreenBuffer::tp_dealloc(PyObject *ob) { delete (PyConsoleScreenBuffer *)ob; } --- 1557,1607 ---- #define PyConsoleScreenBuffer_Check(ob) ((ob)->ob_type == &PyConsoleScreenBufferType) + PyObject *PyWinObject_FromConsoleScreenBuffer(HANDLE h, BOOL bDuplicate) + { + HANDLE hdup; + if (!bDuplicate) + hdup=h; + else{ + HANDLE hprocess=GetCurrentProcess(); + if (!DuplicateHandle(hprocess, h, hprocess, &hdup, 0, FALSE, DUPLICATE_SAME_ACCESS)) + return PyWin_SetAPIError("DuplicateHandle"); + } + PyObject *ret=new PyConsoleScreenBuffer(hdup); + if (ret==NULL) + PyErr_NoMemory(); + return ret; + } + PyObject *PyConsoleScreenBuffer::tp_new(PyTypeObject *tp, PyObject *args, PyObject *kwargs) { static char *keywords[]={"Handle", NULL}; HANDLE h; ! PyObject *obh; ! if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O", keywords, &obh)) return NULL; ! if (!PyWinObject_AsHANDLE(obh, &h, FALSE)) ! return NULL; ! // Handle will be duplicated so caller is still responsible for original handle ! return PyWinObject_FromConsoleScreenBuffer(h, TRUE); } ! PyConsoleScreenBuffer::PyConsoleScreenBuffer(HANDLE hconsole) : PyHANDLE(hconsole) { ob_type = &PyConsoleScreenBufferType; } PyConsoleScreenBuffer::~PyConsoleScreenBuffer(void) { ! // Close happens in tp_dealloc below } void PyConsoleScreenBuffer::tp_dealloc(PyObject *ob) { + // use same error logic as in PyHANDLE::deallocFunc + PyObject *typ, *val, *tb; + PyErr_Fetch(&typ, &val, &tb); + ((PyConsoleScreenBuffer *)ob)->Close(); delete (PyConsoleScreenBuffer *)ob; + PyErr_Restore(typ, val, tb); } *************** *** 1620,1624 **** if (hconsole==INVALID_HANDLE_VALUE) return PyWin_SetAPIError("CreateConsoleScreenBuffer"); ! return new PyConsoleScreenBuffer(hconsole, TRUE); } --- 1631,1636 ---- if (hconsole==INVALID_HANDLE_VALUE) return PyWin_SetAPIError("CreateConsoleScreenBuffer"); ! // Newly created handle doesn't need to be duplicated ! return PyWinObject_FromConsoleScreenBuffer(hconsole, FALSE); } *************** *** 1986,1990 **** return Py_None; } ! return new PyConsoleScreenBuffer(h, FALSE); } --- 1998,2003 ---- return Py_None; } ! // Duplicate the handle so the processwide std handles aren't closed prematurely ! return PyWinObject_FromConsoleScreenBuffer(h, TRUE); } |
From: Roger U. <ru...@us...> - 2006-12-11 05:27:36
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24498/win32/src Modified Files: win32gui.i Log Message: Add some more drawing functions Index: win32gui.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32gui.i,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** win32gui.i 9 Dec 2006 08:31:28 -0000 1.86 --- win32gui.i 11 Dec 2006 05:27:34 -0000 1.87 *************** *** 2656,2659 **** --- 2656,2668 ---- HDC GetDC( HWND hWnd ); + // @pyswig int|SaveDC|Save the state of a device context + // @rdesc Returns a value identifying the state that can be passed to <om win32gui.RestoreDC>. On error, returns 0. + int SaveDC(HDC hdc); // @pyparm <o PyHANDLE>|hdc||Handle to device context + + // @pyswig |RestoreDC|Restores a device context state + BOOLAPI RestoreDC( + HDC hdc, // @pyparm <o PyHANDLE>|hdc||Handle to a device context + int SavedDC); // @pyparm int|SavedDC||Identifier of state to be restored, as returned by <om win32gui.SaveDC>. + // @pyswig |DeleteDC|Deletes a DC BOOLAPI DeleteDC( *************** *** 3578,3586 **** // @rdesc Returns the previous position as (X, Y) BOOLAPI MoveToEx( ! HDC hdc, // @pyparm <o PyHANDLE>|hcl||Device context handle int X, // @pyparm int|X||Horizontal pos in logical units int Y, // @pyparm int|Y||Vertical pos in logical units POINT *OUTPUT); %{ --- 3587,3784 ---- // @rdesc Returns the previous position as (X, Y) BOOLAPI MoveToEx( ! HDC hdc, // @pyparm <o PyHANDLE>|hdc||Device context handle int X, // @pyparm int|X||Horizontal pos in logical units int Y, // @pyparm int|Y||Vertical pos in logical units POINT *OUTPUT); + // @pyswig (int,int)|GetCurrentPositionEx|Returns a device context's current drawing position + BOOLAPI GetCurrentPositionEx( + HDC hdc, // @pyparm <o PyHANDLE>|hdc||Device context + POINT *OUTPUT); + + // @pyswig int|GetArcDirection|Returns the direction in which rectangles and arcs are drawn + // @rdesc Recturns one of win32con.AD_* values + int GetArcDirection( + HDC hdc); // @pyparm <o PyHANDLE>|hdc||Handle to a device context + + // @pyswig int|SetArcDirection|Sets the drawing direction for arcs and rectangles + // @rdesc Returns the previous direction, or 0 on error. + int SetArcDirection( + HDC hdc, // @pyparm <o PyHANDLE>|hdc||Handle to a device context + int ArcDirection); // @pyparm int|ArcDirection||One of win32con.AD_* constants + + %{ + BOOL PyWinObject_AsPOINTArray(PyObject *obpoints, POINT **ppoints, DWORD *item_cnt) + { + BOOL ret=TRUE; + DWORD bufsize, tuple_index; + PyObject *points_tuple=NULL, *tuple_item; + *ppoints=NULL; + *item_cnt=0; + + if ((points_tuple=PySequence_Tuple(obpoints))==NULL) + return FALSE; + *item_cnt=PyTuple_GET_SIZE(points_tuple); + bufsize=*item_cnt * sizeof(POINT); + *ppoints=(POINT *)malloc(bufsize); + if (*ppoints==NULL){ + PyErr_Format(PyExc_MemoryError, "Unable to allocate %d bytes", bufsize); + ret=FALSE; + } + else + for (tuple_index=0; tuple_index<*item_cnt; tuple_index++){ + tuple_item=PyTuple_GET_ITEM(points_tuple,tuple_index); + if (!PyWinObject_AsPOINT(tuple_item, &(*ppoints)[tuple_index])){ + ret=FALSE; + break; + } + } + if (!ret) + if (*ppoints!=NULL){ + free(*ppoints); + *ppoints=NULL; + *item_cnt=0; + } + Py_XDECREF(points_tuple); + return ret; + } + + // @pyswig |Polygon|Draws a closed filled polygon defined by a sequence of points + static PyObject *PyPolygon(PyObject *self, PyObject *args) + { + HDC hdc; + POINT *points=NULL; + DWORD point_cnt; + PyObject *obpoints, *obdc, *ret=NULL; + if (!PyArg_ParseTuple(args, "OO:PolyGon", + &obdc, // @pyparm <o PyHANDLE>|hdc||Handle to a device context + &obpoints)) // @pyparm [(int,int),...]|Points||Sequence of POINT tuples: ((x,y),...) + return NULL; + if (!PyWinObject_AsHANDLE(obdc, (HANDLE *)&hdc, FALSE)) + return NULL; + if (!PyWinObject_AsPOINTArray(obpoints, &points, &point_cnt)) + return NULL; + if (!Polygon(hdc, points, point_cnt)) + PyWin_SetAPIError("PolyGon"); + else{ + Py_INCREF(Py_None); + ret=Py_None; + } + if (points) + free(points); + return ret; + } + + // @pyswig |Polyline|Connects a sequence of points using currently selected pen + static PyObject *PyPolyline(PyObject *self, PyObject *args) + { + HDC hdc; + POINT *points=NULL; + DWORD point_cnt; + PyObject *obpoints, *obdc, *ret=NULL; + if (!PyArg_ParseTuple(args, "OO:Polyline", + &obdc, // @pyparm <o PyHANDLE>|hdc||Handle to a device context + &obpoints)) // @pyparm [(int,int),...]|Points||Sequence of POINT tuples: ((x,y),...) + return NULL; + if (!PyWinObject_AsHANDLE(obdc, (HANDLE *)&hdc, FALSE)) + return NULL; + if (!PyWinObject_AsPOINTArray(obpoints, &points, &point_cnt)) + return NULL; + if (!Polyline(hdc, points, point_cnt)) + PyWin_SetAPIError("Polyline"); + else{ + Py_INCREF(Py_None); + ret=Py_None; + } + if (points) + free(points); + return ret; + } + + // @pyswig |PolylineTo|Draws a series of lines starting from current position. Updates current position with end point. + static PyObject *PyPolylineTo(PyObject *self, PyObject *args) + { + HDC hdc; + POINT *points=NULL; + DWORD point_cnt; + PyObject *obpoints, *obdc, *ret=NULL; + if (!PyArg_ParseTuple(args, "OO:PolylineTo", + &obdc, // @pyparm <o PyHANDLE>|hdc||Handle to a device context + &obpoints)) // @pyparm [(int,int),...]|Points||Sequence of POINT tuples: ((x,y),...) + return NULL; + if (!PyWinObject_AsHANDLE(obdc, (HANDLE *)&hdc, FALSE)) + return NULL; + if (!PyWinObject_AsPOINTArray(obpoints, &points, &point_cnt)) + return NULL; + if (!PolylineTo(hdc, points, point_cnt)) + PyWin_SetAPIError("PolylineTo"); + else{ + Py_INCREF(Py_None); + ret=Py_None; + } + if (points) + free(points); + return ret; + } + + // @pyswig |PolyBezier|Draws a series of Bezier curves starting from first point specified. + // @comm Number of points must be a multiple of 3 plus 1. + static PyObject *PyPolyBezier(PyObject *self, PyObject *args) + { + HDC hdc; + POINT *points=NULL; + DWORD point_cnt; + PyObject *obpoints, *obdc, *ret=NULL; + if (!PyArg_ParseTuple(args, "OO:PolyBezier", + &obdc, // @pyparm <o PyHANDLE>|hdc||Handle to a device context + &obpoints)) // @pyparm [(int,int),...]|Points||Sequence of POINT tuples: ((x,y),...). + return NULL; + if (!PyWinObject_AsHANDLE(obdc, (HANDLE *)&hdc, FALSE)) + return NULL; + if (!PyWinObject_AsPOINTArray(obpoints, &points, &point_cnt)) + return NULL; + if (!PolyBezier(hdc, points, point_cnt)) + PyWin_SetAPIError("PolyBezier"); + else{ + Py_INCREF(Py_None); + ret=Py_None; + } + if (points) + free(points); + return ret; + } + + // @pyswig |PolyBezierTo|Draws a series of Bezier curves starting from current drawing position. + // @comm Points must contain 3 points for each curve. Current position is updated with last endpoint. + static PyObject *PyPolyBezierTo(PyObject *self, PyObject *args) + { + HDC hdc; + POINT *points=NULL; + DWORD point_cnt; + PyObject *obpoints, *obdc, *ret=NULL; + if (!PyArg_ParseTuple(args, "OO:PolyBezierTo", + &obdc, // @pyparm <o PyHANDLE>|hdc||Handle to a device context + &obpoints)) // @pyparm [(int,int),...]|Points||Sequence of POINT tuples: ((x,y),...). + return NULL; + if (!PyWinObject_AsHANDLE(obdc, (HANDLE *)&hdc, FALSE)) + return NULL; + if (!PyWinObject_AsPOINTArray(obpoints, &points, &point_cnt)) + return NULL; + if (!PolyBezierTo(hdc, points, point_cnt)) + PyWin_SetAPIError("PolyBezierTo"); + else{ + Py_INCREF(Py_None); + ret=Py_None; + } + if (points) + free(points); + return ret; + } + %} + %native (Polygon) PyPolygon; + %native (Polyline) PyPolyline; + %native (PolylineTo) PyPolylineTo; + %native (PolyBezier) PyPolyBezier; + %native (PolyBezierTo) PyPolyBezierTo; %{ *************** *** 3734,3737 **** --- 3932,3940 ---- #endif /* not MS_WINCE */ + // @pyswig |InvertRect|Inverts the colors in a regtangular region + BOOLAPI InvertRect( + HDC hDC, // @pyparm <o PyHANDLE>|hDC||Handle to a device context + RECT *INPUT); // @pyparm <o RECT>|rc||Coordinates of rectangle to invert + // @pyswig |GetUpdateRgn| int GetUpdateRgn(HWND hWnd, HRGN hRgn, BOOL bErase); *************** *** 3742,3748 **** int nLeftRect, // @pyparm int|LeftRect||Position of left edge of rectangle int nTopRect, // @pyparm int|TopRect||Position of top edge of rectangle ! int nRightRect, // @pyparm int|RightRect||Posistion of right edge of rectangle int nBottomRect); // @pyparm int|BottomRect||Position of bottom edge of rectangle // @pyswig hdc, paintstruct|BeginPaint| HDC BeginPaint(HWND hwnd, PAINTSTRUCT *OUTPUT); --- 3945,3961 ---- int nLeftRect, // @pyparm int|LeftRect||Position of left edge of rectangle int nTopRect, // @pyparm int|TopRect||Position of top edge of rectangle ! int nRightRect, // @pyparm int|RightRect||Position of right edge of rectangle int nBottomRect); // @pyparm int|BottomRect||Position of bottom edge of rectangle + // @pyswig |RoundRect|Draws a rectangle with elliptically rounded corners, filled using using current brush + BOOLAPI RoundRect( + HDC hdc, // @pyparm <o PyHANDLE>|hdc||Handle to device context + int nLeftRect, // @pyparm int|LeftRect||Position of left edge of rectangle + int nTopRect, // @pyparm int|TopRect||Position of top edge of rectangle + int nRightRect, // @pyparm int|RightRect||Position of right edge of rectangle + int nBottomRect, // @pyparm int|BottomRect||Position of bottom edge of rectangle + int Width, // @pyparm int|Width||Width of ellipse + int Height); // @pyparm int|Height||Height of ellipse + // @pyswig hdc, paintstruct|BeginPaint| HDC BeginPaint(HWND hwnd, PAINTSTRUCT *OUTPUT); |