pywin32-checkins Mailing List for Python for Windows Extensions (Page 60)
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
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/axcontrol/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17542/com/win32comext/axcontrol/src Modified Files: Tag: py3k AXControl.cpp PyIOleInPlaceSite.cpp PyIOleObject.cpp Added Files: Tag: py3k PyIOleControlSite.cpp PyIOleControlSite.h PyIOleInPlaceActiveObject.cpp PyIOleInPlaceActiveObject.h PyIOleInPlaceFrame.cpp PyIOleInPlaceFrame.h PyIOleInPlaceUIWindow.cpp PyIOleInPlaceUIWindow.h Log Message: win32com.axcontrol gets support for interfaces OleControlSite, OleInPlaceActiveObject, OleInPlaceFrame and OleInPlaceUIWindow interfaces and OleTranslateAccelerator function. --- NEW FILE: PyIOleInPlaceActiveObject.h --- // This file declares the IOleInPlaceActiveObject Interface and Gateway for Python. // Generated by makegw.py // --------------------------------------------------- // // Interface Declaration class PyIOleInPlaceActiveObject : public PyIOleWindow { public: MAKE_PYCOM_CTOR(PyIOleInPlaceActiveObject); static IOleInPlaceActiveObject *GetI(PyObject *self); static PyComTypeObject type; // The Python methods static PyObject *TranslateAccelerator(PyObject *self, PyObject *args); static PyObject *OnFrameWindowActivate(PyObject *self, PyObject *args); static PyObject *OnDocWindowActivate(PyObject *self, PyObject *args); static PyObject *ResizeBorder(PyObject *self, PyObject *args); static PyObject *EnableModeless(PyObject *self, PyObject *args); protected: PyIOleInPlaceActiveObject(IUnknown *pdisp); ~PyIOleInPlaceActiveObject(); }; // --------------------------------------------------- // // Gateway Declaration class PyGOleInPlaceActiveObject : public PyGOleWindow, public IOleInPlaceActiveObject { protected: PyGOleInPlaceActiveObject(PyObject *instance) : PyGOleWindow(instance) { ; } PYGATEWAY_MAKE_SUPPORT2(PyGOleInPlaceActiveObject, IOleInPlaceActiveObject, IID_IOleInPlaceActiveObject, PyGOleWindow) // IOleWindow STDMETHOD(GetWindow)( HWND __RPC_FAR * phwnd); STDMETHOD(ContextSensitiveHelp)( BOOL fEnterMode); // IOleInPlaceActiveObject STDMETHOD(TranslateAccelerator)( LPMSG lpmsg); STDMETHOD(OnFrameWindowActivate)( BOOL fActivate); STDMETHOD(OnDocWindowActivate)( BOOL fActivate); STDMETHOD(ResizeBorder)( LPCRECT prcBorder, IOleInPlaceUIWindow * pUIWindow, BOOL fFrameWindow); STDMETHOD(EnableModeless)( BOOL fEnable); }; --- NEW FILE: PyIOleControlSite.h --- // This file declares the IOleControlSite Interface and Gateway for Python. // Generated by makegw.py // --------------------------------------------------- // // Interface Declaration class PyIOleControlSite : public PyIUnknown { public: MAKE_PYCOM_CTOR(PyIOleControlSite); static IOleControlSite *GetI(PyObject *self); static PyComTypeObject type; // The Python methods static PyObject *OnControlInfoChanged(PyObject *self, PyObject *args); static PyObject *LockInPlaceActive(PyObject *self, PyObject *args); static PyObject *GetExtendedControl(PyObject *self, PyObject *args); static PyObject *TransformCoords(PyObject *self, PyObject *args); static PyObject *TranslateAccelerator(PyObject *self, PyObject *args); static PyObject *OnFocus(PyObject *self, PyObject *args); static PyObject *ShowPropertyFrame(PyObject *self, PyObject *args); protected: PyIOleControlSite(IUnknown *pdisp); ~PyIOleControlSite(); }; // --------------------------------------------------- // // Gateway Declaration class PyGOleControlSite : public PyGatewayBase, public IOleControlSite { protected: PyGOleControlSite(PyObject *instance) : PyGatewayBase(instance) { ; } PYGATEWAY_MAKE_SUPPORT2(PyGOleControlSite, IOleControlSite, IID_IOleControlSite, PyGatewayBase) // IOleControlSite STDMETHOD(OnControlInfoChanged)( void); STDMETHOD(LockInPlaceActive)( BOOL fLock); STDMETHOD(GetExtendedControl)( IDispatch ** ppDisp); STDMETHOD(TransformCoords)( POINTL * pPtlHimetric, POINTF * pPtfContainer, DWORD dwFlags); STDMETHOD(TranslateAccelerator)( MSG * pMsg, DWORD grfModifiers); STDMETHOD(OnFocus)( BOOL fGotFocus); STDMETHOD(ShowPropertyFrame)( void); }; --- NEW FILE: PyIOleInPlaceFrame.cpp --- // This file implements the IOleInPlaceFrame Interface and Gateway for Python. // Generated by makegw.py #include "axcontrol_pch.h" #include "PyIOleWindow.h" #include "PyIOleInPlaceUIWindow.h" #include "PyIOleInPlaceFrame.h" #include "PyComTypeObjects.h" // @doc - This file contains autoduck documentation // --------------------------------------------------- // // Interface Implementation PyIOleInPlaceFrame::PyIOleInPlaceFrame(IUnknown *pdisp): PyIOleInPlaceUIWindow(pdisp) { ob_type = &type; } PyIOleInPlaceFrame::~PyIOleInPlaceFrame() { } /* static */ IOleInPlaceFrame *PyIOleInPlaceFrame::GetI(PyObject *self) { return (IOleInPlaceFrame *)PyIOleInPlaceUIWindow::GetI(self); } // @pymethod |PyIOleInPlaceFrame|InsertMenus|Description of InsertMenus. PyObject *PyIOleInPlaceFrame::InsertMenus(PyObject *self, PyObject *args) { IOleInPlaceFrame *pIOIPF = GetI(self); if ( pIOIPF == NULL ) return NULL; // @pyparm int/long|hmenuShared||Description for hmenuShared // @pyparm <o PyOLEMENUGROUPWIDTHS>|menuWidths|| OLEMENUGROUPWIDTHS menuWidths; PyObject *oblpMenuWidths; PyObject *obhmenuShared; HMENU hmenuShared; if ( !PyArg_ParseTuple(args, "OO:InsertMenus", &obhmenuShared, &oblpMenuWidths) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyWinObject_AsHANDLE(obhmenuShared, (HANDLE *)&hmenuShared)) bPythonIsHappy = FALSE; if (bPythonIsHappy && !PyObject_AsOLEMENUGROUPWIDTHS( oblpMenuWidths, &menuWidths )) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOIPF->InsertMenus( hmenuShared, &menuWidths); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOIPF, IID_IOleInPlaceFrame); return PyObject_FromOLEMENUGROUPWIDTHS(&menuWidths); } // @pymethod |PyIOleInPlaceFrame|SetMenu|Description of SetMenu. PyObject *PyIOleInPlaceFrame::SetMenu(PyObject *self, PyObject *args) { IOleInPlaceFrame *pIOIPF = GetI(self); if ( pIOIPF == NULL ) return NULL; // @pyparm int/long|hmenuShared||Description for hmenuShared // @pyparm int/long|holemenu||Description for holemenu // @pyparm int/long|hwndActiveObject||Description for hwndActiveObject PyObject *obhmenuShared; PyObject *obholemenu; PyObject *obhwndActiveObject; HMENU hmenuShared; HOLEMENU holemenu; HWND hwndActiveObject; if ( !PyArg_ParseTuple(args, "OOO:SetMenu", &obhmenuShared, &obholemenu, &obhwndActiveObject) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyWinObject_AsHANDLE(obhmenuShared, (HANDLE *)&hmenuShared)) bPythonIsHappy = FALSE; if (bPythonIsHappy && !PyWinObject_AsHANDLE(obholemenu, (HANDLE *)&holemenu)) bPythonIsHappy = FALSE; if (bPythonIsHappy && !PyWinObject_AsHANDLE(obhwndActiveObject, (HANDLE *)&hwndActiveObject)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOIPF->SetMenu( hmenuShared, holemenu, hwndActiveObject ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOIPF, IID_IOleInPlaceFrame ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIOleInPlaceFrame|RemoveMenus|Description of RemoveMenus. PyObject *PyIOleInPlaceFrame::RemoveMenus(PyObject *self, PyObject *args) { IOleInPlaceFrame *pIOIPF = GetI(self); if ( pIOIPF == NULL ) return NULL; // @pyparm int/long|hmenuShared||Description for hmenuShared PyObject *obhmenuShared; HMENU hmenuShared; if ( !PyArg_ParseTuple(args, "O:RemoveMenus", &obhmenuShared) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyWinObject_AsHANDLE(obhmenuShared, (HANDLE *)&hmenuShared)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOIPF->RemoveMenus( hmenuShared ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOIPF, IID_IOleInPlaceFrame ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIOleInPlaceFrame|SetStatusText|Description of SetStatusText. PyObject *PyIOleInPlaceFrame::SetStatusText(PyObject *self, PyObject *args) { IOleInPlaceFrame *pIOIPF = GetI(self); if ( pIOIPF == NULL ) return NULL; // @pyparm <o unicode>|pszStatusText||Description for pszStatusText PyObject *obpszStatusText; LPOLESTR pszStatusText; if ( !PyArg_ParseTuple(args, "O:SetStatusText", &obpszStatusText) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyWinObject_AsBstr(obpszStatusText, &pszStatusText)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOIPF->SetStatusText( pszStatusText ); SysFreeString(pszStatusText); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOIPF, IID_IOleInPlaceFrame ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIOleInPlaceFrame|EnableModeless|Description of EnableModeless. PyObject *PyIOleInPlaceFrame::EnableModeless(PyObject *self, PyObject *args) { IOleInPlaceFrame *pIOIPF = GetI(self); if ( pIOIPF == NULL ) return NULL; // @pyparm int|fEnable||Description for fEnable BOOL fEnable; if ( !PyArg_ParseTuple(args, "i:EnableModeless", &fEnable) ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOIPF->EnableModeless( fEnable ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOIPF, IID_IOleInPlaceFrame ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIOleInPlaceFrame|TranslateAccelerator|Description of TranslateAccelerator. PyObject *PyIOleInPlaceFrame::TranslateAccelerator(PyObject *self, PyObject *args) { IOleInPlaceFrame *pIOIPF = GetI(self); if ( pIOIPF == NULL ) return NULL; PyObject *oblpmsg; // @pyparm <o PyMSG>|lpmsg||Description for lpmsg // @pyparm int|wID||Description for wID WORD wID; if ( !PyArg_ParseTuple(args, "Oh:TranslateAccelerator", &oblpmsg, &wID) ) return NULL; MSG msg; if (!PyWinObject_AsMSG(oblpmsg, &msg)) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOIPF->TranslateAccelerator(&msg, wID); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOIPF, IID_IOleInPlaceFrame ); Py_INCREF(Py_None); return Py_None; } // @object PyIOleInPlaceFrame|Description of the interface static struct PyMethodDef PyIOleInPlaceFrame_methods[] = { { "InsertMenus", PyIOleInPlaceFrame::InsertMenus, 1 }, // @pymeth InsertMenus|Description of InsertMenus { "SetMenu", PyIOleInPlaceFrame::SetMenu, 1 }, // @pymeth SetMenu|Description of SetMenu { "RemoveMenus", PyIOleInPlaceFrame::RemoveMenus, 1 }, // @pymeth RemoveMenus|Description of RemoveMenus { "SetStatusText", PyIOleInPlaceFrame::SetStatusText, 1 }, // @pymeth SetStatusText|Description of SetStatusText { "EnableModeless", PyIOleInPlaceFrame::EnableModeless, 1 }, // @pymeth EnableModeless|Description of EnableModeless { "TranslateAccelerator", PyIOleInPlaceFrame::TranslateAccelerator, 1 }, // @pymeth TranslateAccelerator|Description of TranslateAccelerator { NULL } }; PyComTypeObject PyIOleInPlaceFrame::type("PyIOleInPlaceFrame", &PyIOleInPlaceUIWindow::type, sizeof(PyIOleInPlaceFrame), PyIOleInPlaceFrame_methods, GET_PYCOM_CTOR(PyIOleInPlaceFrame)); // --------------------------------------------------- // // Gateway Implementation // IOleWindow STDMETHODIMP PyGOleInPlaceFrame::GetWindow(HWND __RPC_FAR * phwnd) {return PyGOleWindow::GetWindow(phwnd);} STDMETHODIMP PyGOleInPlaceFrame::ContextSensitiveHelp(BOOL fEnterMode) {return PyGOleWindow::ContextSensitiveHelp(fEnterMode);} // IOleInPlaceUIWindow STDMETHODIMP PyGOleInPlaceFrame::GetBorder(LPRECT lpr) {return PyGOleInPlaceUIWindow::GetBorder(lpr);} STDMETHODIMP PyGOleInPlaceFrame::RequestBorderSpace(LPCBORDERWIDTHS pbw) {return PyGOleInPlaceUIWindow::RequestBorderSpace(pbw);} STDMETHODIMP PyGOleInPlaceFrame::SetBorderSpace(LPCBORDERWIDTHS pbw) {return PyGOleInPlaceUIWindow::SetBorderSpace(pbw);} STDMETHODIMP PyGOleInPlaceFrame::SetActiveObject(IOleInPlaceActiveObject * pActiveObject, LPCOLESTR pszObjName) {return PyGOleInPlaceUIWindow::SetActiveObject(pActiveObject, pszObjName);} // IOleInPlaceFrame STDMETHODIMP PyGOleInPlaceFrame::InsertMenus( /* [in] */ HMENU hmenuShared, /* [out][in] */ LPOLEMENUGROUPWIDTHS lpMenuWidths) { PY_GATEWAY_METHOD; PyObject *result; HRESULT hr=InvokeViaPolicy("InsertMenus", &result, "NN", PyWinLong_FromHANDLE(hmenuShared), PyObject_FromOLEMENUGROUPWIDTHS(lpMenuWidths)); if (FAILED(hr)) return hr; PyObject_AsOLEMENUGROUPWIDTHS(result, lpMenuWidths); Py_DECREF(result); return MAKE_PYCOM_GATEWAY_FAILURE_CODE("InsertMenus"); } STDMETHODIMP PyGOleInPlaceFrame::SetMenu( /* [in] */ HMENU hmenuShared, /* [in] */ HOLEMENU holemenu, /* [in] */ HWND hwndActiveObject) { PY_GATEWAY_METHOD; return InvokeViaPolicy("SetMenu", NULL, "NNN", PyWinLong_FromHANDLE(hmenuShared), PyWinLong_FromHANDLE(holemenu), PyWinLong_FromHANDLE(hwndActiveObject)); } STDMETHODIMP PyGOleInPlaceFrame::RemoveMenus( /* [in] */ HMENU hmenuShared) { PY_GATEWAY_METHOD; return InvokeViaPolicy("RemoveMenus", NULL, "N", PyWinLong_FromHANDLE(hmenuShared)); } STDMETHODIMP PyGOleInPlaceFrame::SetStatusText( /* [unique][in] */ LPCOLESTR pszStatusText) { PY_GATEWAY_METHOD; return InvokeViaPolicy("SetStatusText", NULL, "N", MakeOLECHARToObj(pszStatusText)); } STDMETHODIMP PyGOleInPlaceFrame::EnableModeless( /* [in] */ BOOL fEnable) { PY_GATEWAY_METHOD; return InvokeViaPolicy("EnableModeless", NULL, "i", fEnable); } STDMETHODIMP PyGOleInPlaceFrame::TranslateAccelerator( /* [in] */ LPMSG lpmsg, /* [in] */ WORD wID) { PY_GATEWAY_METHOD; return InvokeViaPolicy("TranslateAccelerator", NULL, "Nh", PyWinObject_FromMSG(lpmsg), &wID); } --- NEW FILE: PyIOleInPlaceUIWindow.cpp --- // This file implements the IOleInPlaceUIWindow Interface and Gateway for Python. // Generated by makegw.py #include "axcontrol_pch.h" #include "PyIOleWindow.h" #include "PyIOleInPlaceUIWindow.h" // @doc - This file contains autoduck documentation // --------------------------------------------------- // // Interface Implementation PyIOleInPlaceUIWindow::PyIOleInPlaceUIWindow(IUnknown *pdisp): PyIOleWindow(pdisp) { ob_type = &type; } PyIOleInPlaceUIWindow::~PyIOleInPlaceUIWindow() { } /* static */ IOleInPlaceUIWindow *PyIOleInPlaceUIWindow::GetI(PyObject *self) { return (IOleInPlaceUIWindow *)PyIOleWindow::GetI(self); } // @pymethod |PyIOleInPlaceUIWindow|GetBorder|Description of GetBorder. PyObject *PyIOleInPlaceUIWindow::GetBorder(PyObject *self, PyObject *args) { IOleInPlaceUIWindow *pIOIPUIW = GetI(self); if ( pIOIPUIW == NULL ) return NULL; if (!PyArg_ParseTuple(args, ":GetBorder")) return NULL; HRESULT hr; RECT r; PY_INTERFACE_PRECALL; hr = pIOIPUIW->GetBorder(&r); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOIPUIW, IID_IOleInPlaceUIWindow ); return Py_BuildValue("(iiii)", r.left, r.top, r.right, r.bottom); } // @pymethod |PyIOleInPlaceUIWindow|RequestBorderSpace|Description of RequestBorderSpace. PyObject *PyIOleInPlaceUIWindow::RequestBorderSpace(PyObject *self, PyObject *args) { IOleInPlaceUIWindow *pIOIPUIW = GetI(self); if ( pIOIPUIW == NULL ) return NULL; BORDERWIDTHS bw; // @pyparm (int, int, int, int)|borderwidths||Description for pborderwidths if ( !PyArg_ParseTuple(args, "(iiii):RequestBorderSpace", &bw.left, &bw.top, &bw.right, &bw.bottom)) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOIPUIW->RequestBorderSpace(&bw); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOIPUIW, IID_IOleInPlaceUIWindow ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIOleInPlaceUIWindow|SetBorderSpace|Description of SetBorderSpace. PyObject *PyIOleInPlaceUIWindow::SetBorderSpace(PyObject *self, PyObject *args) { IOleInPlaceUIWindow *pIOIPUIW = GetI(self); if ( pIOIPUIW == NULL ) return NULL; BORDERWIDTHS bw; // @pyparm (int, int, int, int)|borderwidths||Description for pborderwidths if ( !PyArg_ParseTuple(args, "(iiii):SetBorderSpace", &bw.left, &bw.top, &bw.right, &bw.bottom)) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOIPUIW->SetBorderSpace(&bw); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOIPUIW, IID_IOleInPlaceUIWindow ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIOleInPlaceUIWindow|SetActiveObject|Description of SetActiveObject. PyObject *PyIOleInPlaceUIWindow::SetActiveObject(PyObject *self, PyObject *args) { IOleInPlaceUIWindow *pIOIPUIW = GetI(self); if ( pIOIPUIW == NULL ) return NULL; // @pyparm <o PyIOleInPlaceActiveObject>|pActiveObject||Description for pActiveObject // @pyparm <o unicode>|pszObjName||Description for pszObjName PyObject *obpActiveObject; PyObject *obpszObjName; IOleInPlaceActiveObject * pActiveObject; LPOLESTR pszObjName; if ( !PyArg_ParseTuple(args, "OO:SetActiveObject", &obpActiveObject, &obpszObjName) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obpActiveObject, IID_IOleInPlaceActiveObject, (void **)&pActiveObject, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; if (bPythonIsHappy && !PyWinObject_AsBstr(obpszObjName, &pszObjName)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOIPUIW->SetActiveObject( pActiveObject, pszObjName ); if (pActiveObject) pActiveObject->Release(); SysFreeString(pszObjName); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOIPUIW, IID_IOleInPlaceUIWindow ); Py_INCREF(Py_None); return Py_None; } // @object PyIOleInPlaceUIWindow|Description of the interface static struct PyMethodDef PyIOleInPlaceUIWindow_methods[] = { { "GetBorder", PyIOleInPlaceUIWindow::GetBorder, 1 }, // @pymeth GetBorder|Description of GetBorder { "RequestBorderSpace", PyIOleInPlaceUIWindow::RequestBorderSpace, 1 }, // @pymeth RequestBorderSpace|Description of RequestBorderSpace { "SetBorderSpace", PyIOleInPlaceUIWindow::SetBorderSpace, 1 }, // @pymeth SetBorderSpace|Description of SetBorderSpace { "SetActiveObject", PyIOleInPlaceUIWindow::SetActiveObject, 1 }, // @pymeth SetActiveObject|Description of SetActiveObject { NULL } }; PyComTypeObject PyIOleInPlaceUIWindow::type("PyIOleInPlaceUIWindow", &PyIOleWindow::type, sizeof(PyIOleInPlaceUIWindow), PyIOleInPlaceUIWindow_methods, GET_PYCOM_CTOR(PyIOleInPlaceUIWindow)); // --------------------------------------------------- // // Gateway Implementation // IOleWindow STDMETHODIMP PyGOleInPlaceUIWindow::GetWindow(HWND __RPC_FAR * phwnd) {return PyGOleWindow::GetWindow(phwnd);} STDMETHODIMP PyGOleInPlaceUIWindow::ContextSensitiveHelp(BOOL fEnterMode) {return PyGOleWindow::ContextSensitiveHelp(fEnterMode);} // IOleInPlaceUIWindow STDMETHODIMP PyGOleInPlaceUIWindow::GetBorder( /* [out] */ LPRECT lpr) { PY_GATEWAY_METHOD; PyObject *result; HRESULT hr=InvokeViaPolicy("GetBorder", &result); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params if (!PyArg_ParseTuple(result, "(iiii)", &lpr->left, &lpr->top, &lpr->bottom, &lpr->right)) hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE("GetBorder"); Py_DECREF(result); return hr; } STDMETHODIMP PyGOleInPlaceUIWindow::RequestBorderSpace( /* [unique][in] */ LPCBORDERWIDTHS pbw) { PY_GATEWAY_METHOD; return InvokeViaPolicy("RequestBorderSpace", NULL, "(iiii)", pbw->left, pbw->top, pbw->right, pbw->bottom); } STDMETHODIMP PyGOleInPlaceUIWindow::SetBorderSpace( /* [unique][in] */ LPCBORDERWIDTHS pbw) { PY_GATEWAY_METHOD; return InvokeViaPolicy("SetBorderSpace", NULL, "(iiii)", pbw->left, pbw->top, pbw->right, pbw->bottom); } STDMETHODIMP PyGOleInPlaceUIWindow::SetActiveObject( /* [unique][in] */ IOleInPlaceActiveObject * pActiveObject, /* [unique][string][in] */ LPCOLESTR pszObjName) { PY_GATEWAY_METHOD; return InvokeViaPolicy("SetActiveObject", NULL, "NN", PyCom_PyObjectFromIUnknown(pActiveObject, IID_IOleInPlaceActiveObject, TRUE), MakeOLECHARToObj(pszObjName)); } --- NEW FILE: PyIOleInPlaceActiveObject.cpp --- // This file implements the IOleInPlaceActiveObject Interface and Gateway for Python. // Generated by makegw.py #include "axcontrol_pch.h" #include "PyIOleWindow.h" #include "PyIOleInPlaceActiveObject.h" // @doc - This file contains autoduck documentation // --------------------------------------------------- // // Interface Implementation PyIOleInPlaceActiveObject::PyIOleInPlaceActiveObject(IUnknown *pdisp): PyIOleWindow(pdisp) { ob_type = &type; } PyIOleInPlaceActiveObject::~PyIOleInPlaceActiveObject() { } /* static */ IOleInPlaceActiveObject *PyIOleInPlaceActiveObject::GetI(PyObject *self) { return (IOleInPlaceActiveObject *)PyIOleWindow::GetI(self); } // @pymethod |PyIOleInPlaceActiveObject|TranslateAccelerator|Description of TranslateAccelerator. PyObject *PyIOleInPlaceActiveObject::TranslateAccelerator(PyObject *self, PyObject *args) { IOleInPlaceActiveObject *pIOIPAO = GetI(self); if ( pIOIPAO == NULL ) return NULL; MSG msg; PyObject *obmsg; // @pyparm <o PyMSG>|lpmsg||Description for lpmsg if ( !PyArg_ParseTuple(args, "O:TranslateAccelerator", &obmsg) ) return NULL; if (!PyWinObject_AsMSG(obmsg, &msg)) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOIPAO->TranslateAccelerator(&msg); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOIPAO, IID_IOleInPlaceActiveObject ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIOleInPlaceActiveObject|OnFrameWindowActivate|Description of OnFrameWindowActivate. PyObject *PyIOleInPlaceActiveObject::OnFrameWindowActivate(PyObject *self, PyObject *args) { IOleInPlaceActiveObject *pIOIPAO = GetI(self); if ( pIOIPAO == NULL ) return NULL; // @pyparm int|fActivate||Description for fActivate BOOL fActivate; if ( !PyArg_ParseTuple(args, "i:OnFrameWindowActivate", &fActivate) ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOIPAO->OnFrameWindowActivate( fActivate ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOIPAO, IID_IOleInPlaceActiveObject ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIOleInPlaceActiveObject|OnDocWindowActivate|Description of OnDocWindowActivate. PyObject *PyIOleInPlaceActiveObject::OnDocWindowActivate(PyObject *self, PyObject *args) { IOleInPlaceActiveObject *pIOIPAO = GetI(self); if ( pIOIPAO == NULL ) return NULL; // @pyparm int|fActivate||Description for fActivate BOOL fActivate; if ( !PyArg_ParseTuple(args, "i:OnDocWindowActivate", &fActivate) ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOIPAO->OnDocWindowActivate( fActivate ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOIPAO, IID_IOleInPlaceActiveObject ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIOleInPlaceActiveObject|ResizeBorder|Description of ResizeBorder. PyObject *PyIOleInPlaceActiveObject::ResizeBorder(PyObject *self, PyObject *args) { IOleInPlaceActiveObject *pIOIPAO = GetI(self); if ( pIOIPAO == NULL ) return NULL; RECT rcb; // @pyparm (int, int, int, int)|rcBorder||Description for prcBorder // @pyparm <o PyIOleInPlaceUIWindow>|pUIWindow||Description for pUIWindow // @pyparm int|fFrameWindow||Description for fFrameWindow PyObject *obpUIWindow; IOleInPlaceUIWindow * pUIWindow; BOOL fFrameWindow; if ( !PyArg_ParseTuple(args, "(iiii)Oi:ResizeBorder", &rcb.left, &rcb.top, &rcb.right, &rcb.bottom, &obpUIWindow, &fFrameWindow) ) return NULL; if (!PyCom_InterfaceFromPyInstanceOrObject(obpUIWindow, IID_IOleInPlaceUIWindow, (void **)&pUIWindow, TRUE /* bNoneOK */)) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOIPAO->ResizeBorder( &rcb, pUIWindow, fFrameWindow ); if (pUIWindow) pUIWindow->Release(); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOIPAO, IID_IOleInPlaceActiveObject ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIOleInPlaceActiveObject|EnableModeless|Description of EnableModeless. PyObject *PyIOleInPlaceActiveObject::EnableModeless(PyObject *self, PyObject *args) { IOleInPlaceActiveObject *pIOIPAO = GetI(self); if ( pIOIPAO == NULL ) return NULL; // @pyparm int|fEnable||Description for fEnable BOOL fEnable; if ( !PyArg_ParseTuple(args, "i:EnableModeless", &fEnable) ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOIPAO->EnableModeless( fEnable ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOIPAO, IID_IOleInPlaceActiveObject ); Py_INCREF(Py_None); return Py_None; } // @object PyIOleInPlaceActiveObject|Description of the interface static struct PyMethodDef PyIOleInPlaceActiveObject_methods[] = { { "TranslateAccelerator", PyIOleInPlaceActiveObject::TranslateAccelerator, 1 }, // @pymeth TranslateAccelerator|Description of TranslateAccelerator { "OnFrameWindowActivate", PyIOleInPlaceActiveObject::OnFrameWindowActivate, 1 }, // @pymeth OnFrameWindowActivate|Description of OnFrameWindowActivate { "OnDocWindowActivate", PyIOleInPlaceActiveObject::OnDocWindowActivate, 1 }, // @pymeth OnDocWindowActivate|Description of OnDocWindowActivate { "ResizeBorder", PyIOleInPlaceActiveObject::ResizeBorder, 1 }, // @pymeth ResizeBorder|Description of ResizeBorder { "EnableModeless", PyIOleInPlaceActiveObject::EnableModeless, 1 }, // @pymeth EnableModeless|Description of EnableModeless { NULL } }; PyComTypeObject PyIOleInPlaceActiveObject::type("PyIOleInPlaceActiveObject", &PyIOleWindow::type, sizeof(PyIOleInPlaceActiveObject), PyIOleInPlaceActiveObject_methods, GET_PYCOM_CTOR(PyIOleInPlaceActiveObject)); // --------------------------------------------------- // // Gateway Implementation // IOleWindow STDMETHODIMP PyGOleInPlaceActiveObject::GetWindow(HWND __RPC_FAR * phwnd) {return PyGOleWindow::GetWindow(phwnd);} STDMETHODIMP PyGOleInPlaceActiveObject::ContextSensitiveHelp(BOOL fEnterMode) {return PyGOleWindow::ContextSensitiveHelp(fEnterMode);} // IOleInPlaceActiveObject STDMETHODIMP PyGOleInPlaceActiveObject::TranslateAccelerator( /* [in] */ LPMSG lpmsg) { PY_GATEWAY_METHOD; return InvokeViaPolicy("TranslateAccelerator", NULL, "N", PyWinObject_FromMSG(lpmsg)); } STDMETHODIMP PyGOleInPlaceActiveObject::OnFrameWindowActivate( /* [in] */ BOOL fActivate) { PY_GATEWAY_METHOD; return InvokeViaPolicy("OnFrameWindowActivate", NULL, "i", fActivate); } STDMETHODIMP PyGOleInPlaceActiveObject::OnDocWindowActivate( /* [in] */ BOOL fActivate) { PY_GATEWAY_METHOD; return InvokeViaPolicy("OnDocWindowActivate", NULL, "i", fActivate); } STDMETHODIMP PyGOleInPlaceActiveObject::ResizeBorder( /* [in] */ LPCRECT prc, /* [unique][in] */ IOleInPlaceUIWindow * pUIWindow, /* [in] */ BOOL fFrameWindow) { PY_GATEWAY_METHOD; return InvokeViaPolicy("ResizeBorder", NULL, "(iiii)Oi", prc->left, prc->top, prc->right, prc->bottom, PyCom_PyObjectFromIUnknown(pUIWindow, IID_IOleInPlaceUIWindow, TRUE), fFrameWindow); } STDMETHODIMP PyGOleInPlaceActiveObject::EnableModeless( /* [in] */ BOOL fEnable) { PY_GATEWAY_METHOD; return InvokeViaPolicy("EnableModeless", NULL, "i", fEnable); } --- NEW FILE: PyIOleControlSite.cpp --- // This file implements the IOleControlSite Interface and Gateway for Python. // Generated by makegw.py #include "axcontrol_pch.h" #include "PyIOleControlSite.h" // @doc - This file contains autoduck documentation // --------------------------------------------------- // // Interface Implementation PyIOleControlSite::PyIOleControlSite(IUnknown *pdisp): PyIUnknown(pdisp) { ob_type = &type; } PyIOleControlSite::~PyIOleControlSite() { } /* static */ IOleControlSite *PyIOleControlSite::GetI(PyObject *self) { return (IOleControlSite *)PyIUnknown::GetI(self); } // @pymethod |PyIOleControlSite|OnControlInfoChanged|Description of OnControlInfoChanged. PyObject *PyIOleControlSite::OnControlInfoChanged(PyObject *self, PyObject *args) { IOleControlSite *pIOCS = GetI(self); if ( pIOCS == NULL ) return NULL; if ( !PyArg_ParseTuple(args, ":OnControlInfoChanged") ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOCS->OnControlInfoChanged(); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOCS, IID_IOleControlSite ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIOleControlSite|LockInPlaceActive|Description of LockInPlaceActive. PyObject *PyIOleControlSite::LockInPlaceActive(PyObject *self, PyObject *args) { IOleControlSite *pIOCS = GetI(self); if ( pIOCS == NULL ) return NULL; // @pyparm int|fLock||Description for fLock BOOL fLock; if ( !PyArg_ParseTuple(args, "i:LockInPlaceActive", &fLock) ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOCS->LockInPlaceActive(fLock); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOCS, IID_IOleControlSite ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIOleControlSite|GetExtendedControl|Description of GetExtendedControl. PyObject *PyIOleControlSite::GetExtendedControl(PyObject *self, PyObject *args) { IOleControlSite *pIOCS = GetI(self); if ( pIOCS == NULL ) return NULL; IDispatch * ppDisp; if ( !PyArg_ParseTuple(args, ":GetExtendedControl") ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOCS->GetExtendedControl(&ppDisp); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOCS, IID_IOleControlSite ); return PyCom_PyObjectFromIUnknown(ppDisp, IID_IDispatch, FALSE); } // @pymethod |PyIOleControlSite|TransformCoords|Description of TransformCoords. PyObject *PyIOleControlSite::TransformCoords(PyObject *self, PyObject *args) { IOleControlSite *pIOCS = GetI(self); if ( pIOCS == NULL ) return NULL; POINTL pPtlHimetric; // @pyparm (int, int)|PtlHimetric||Description for pPtlHimetric POINTF pPtfContainer; // @pyparm (float, float))|pPtfContainer||Description for pPtfContainer // @pyparm int|dwFlags||Description for dwFlags DWORD dwFlags; if (!PyArg_ParseTuple(args, "(ll)(ff)l:TransformCoords", &pPtlHimetric.x, &pPtlHimetric.y, &pPtfContainer.x, &pPtfContainer.y, &dwFlags)) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOCS->TransformCoords( &pPtlHimetric, &pPtfContainer, dwFlags ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOCS, IID_IOleControlSite ); // @rdesc The result is a tuple of the transformed input points - ie, // a tuple of ((int, int), (float, float)) return Py_BuildValue("(ll)(ff)", pPtlHimetric.x, pPtlHimetric.y, pPtfContainer.x, pPtfContainer.y); } // @pymethod |PyIOleControlSite|TranslateAccelerator|Description of TranslateAccelerator. PyObject *PyIOleControlSite::TranslateAccelerator(PyObject *self, PyObject *args) { IOleControlSite *pIOCS = GetI(self); if ( pIOCS == NULL ) return NULL; MSG msg; PyObject *obpMsg; // @pyparm <o PyMSG>|pMsg||Description for pMsg // @pyparm int|grfModifiers||Description for grfModifiers DWORD grfModifiers; if ( !PyArg_ParseTuple(args, "Ol:TranslateAccelerator", &obpMsg, &grfModifiers) ) return NULL; if (!PyWinObject_AsMSG(obpMsg, &msg)) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOCS->TranslateAccelerator(&msg, grfModifiers); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOCS, IID_IOleControlSite ); return PyInt_FromLong(hr); } // @pymethod |PyIOleControlSite|OnFocus|Description of OnFocus. PyObject *PyIOleControlSite::OnFocus(PyObject *self, PyObject *args) { IOleControlSite *pIOCS = GetI(self); if ( pIOCS == NULL ) return NULL; // @pyparm int|fGotFocus||Description for fGotFocus BOOL fGotFocus; if ( !PyArg_ParseTuple(args, "i:OnFocus", &fGotFocus) ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOCS->OnFocus(fGotFocus); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOCS, IID_IOleControlSite ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIOleControlSite|ShowPropertyFrame|Description of ShowPropertyFrame. PyObject *PyIOleControlSite::ShowPropertyFrame(PyObject *self, PyObject *args) { IOleControlSite *pIOCS = GetI(self); if ( pIOCS == NULL ) return NULL; if ( !PyArg_ParseTuple(args, ":ShowPropertyFrame") ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOCS->ShowPropertyFrame(); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOCS, IID_IOleControlSite ); Py_INCREF(Py_None); return Py_None; } // @object PyIOleControlSite|Description of the interface static struct PyMethodDef PyIOleControlSite_methods[] = { { "OnControlInfoChanged", PyIOleControlSite::OnControlInfoChanged, 1 }, // @pymeth OnControlInfoChanged|Description of OnControlInfoChanged { "LockInPlaceActive", PyIOleControlSite::LockInPlaceActive, 1 }, // @pymeth LockInPlaceActive|Description of LockInPlaceActive { "GetExtendedControl", PyIOleControlSite::GetExtendedControl, 1 }, // @pymeth GetExtendedControl|Description of GetExtendedControl { "TransformCoords", PyIOleControlSite::TransformCoords, 1 }, // @pymeth TransformCoords|Description of TransformCoords { "TranslateAccelerator", PyIOleControlSite::TranslateAccelerator, 1 }, // @pymeth TranslateAccelerator|Description of TranslateAccelerator { "OnFocus", PyIOleControlSite::OnFocus, 1 }, // @pymeth OnFocus|Description of OnFocus { "ShowPropertyFrame", PyIOleControlSite::ShowPropertyFrame, 1 }, // @pymeth ShowPropertyFrame|Description of ShowPropertyFrame { NULL } }; PyComTypeObject PyIOleControlSite::type("PyIOleControlSite", &PyIUnknown::type, sizeof(PyIOleControlSite), PyIOleControlSite_methods, GET_PYCOM_CTOR(PyIOleControlSite)); // --------------------------------------------------- // // Gateway Implementation STDMETHODIMP PyGOleControlSite::OnControlInfoChanged( void) { PY_GATEWAY_METHOD; HRESULT hr=InvokeViaPolicy("OnControlInfoChanged", NULL); return hr; } STDMETHODIMP PyGOleControlSite::LockInPlaceActive( /* [in] */ BOOL fLock) { PY_GATEWAY_METHOD; return InvokeViaPolicy("LockInPlaceActive", NULL, "i", fLock); } STDMETHODIMP PyGOleControlSite::GetExtendedControl( /* [out] */ IDispatch ** ppDisp) { PY_GATEWAY_METHOD; if (ppDisp==NULL) return E_POINTER; PyObject *result; HRESULT hr=InvokeViaPolicy("GetExtendedControl", &result); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params PyObject *obppDisp; if (!PyArg_Parse(result, "O" , &obppDisp)) hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE("GetExtendedControl"); else if (!PyCom_InterfaceFromPyInstanceOrObject(obppDisp, IID_IDispatch, (void **)ppDisp, TRUE /* bNoneOK */)) hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE("GetExtendedControl"); Py_DECREF(result); return hr; } STDMETHODIMP PyGOleControlSite::TransformCoords( /* [out][in] */ POINTL * pPtlHimetric, /* [out][in] */ POINTF * pPtfContainer, /* [in] */ DWORD dwFlags) { PY_GATEWAY_METHOD; PyObject *result; HRESULT hr=InvokeViaPolicy("TransformCoords", &result, "(ll)(ff)l", pPtlHimetric->x, pPtlHimetric->y, pPtfContainer->x, pPtfContainer->y, dwFlags); if (FAILED(hr)) return hr; if (!PyArg_ParseTuple(result, "(ll)(ff)", &pPtlHimetric->x, &pPtlHimetric->y, &pPtfContainer->x, &pPtfContainer->y)) hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE("GetExtendedControl"); Py_DECREF(result); return hr; } STDMETHODIMP PyGOleControlSite::TranslateAccelerator( /* [in] */ MSG * pMsg, /* [in] */ DWORD grfModifiers) { PY_GATEWAY_METHOD; return InvokeViaPolicy("TranslateAccelerator", NULL, "Nl", PyWinObject_FromMSG(pMsg), grfModifiers); } STDMETHODIMP PyGOleControlSite::OnFocus( /* [in] */ BOOL fGotFocus) { PY_GATEWAY_METHOD; return InvokeViaPolicy("OnFocus", NULL, "i", fGotFocus); } STDMETHODIMP PyGOleControlSite::ShowPropertyFrame( void) { PY_GATEWAY_METHOD; return InvokeViaPolicy("ShowPropertyFrame", NULL); } --- NEW FILE: PyIOleInPlaceFrame.h --- // This file declares the IOleInPlaceFrame Interface and Gateway for Python. // Generated by makegw.py // --------------------------------------------------- // // Interface Declaration class PyIOleInPlaceFrame : public PyIOleInPlaceUIWindow { public: MAKE_PYCOM_CTOR(PyIOleInPlaceFrame); static IOleInPlaceFrame *GetI(PyObject *self); static PyComTypeObject type; // The Python methods static PyObject *InsertMenus(PyObject *self, PyObject *args); static PyObject *SetMenu(PyObject *self, PyObject *args); static PyObject *RemoveMenus(PyObject *self, PyObject *args); static PyObject *SetStatusText(PyObject *self, PyObject *args); static PyObject *EnableModeless(PyObject *self, PyObject *args); static PyObject *TranslateAccelerator(PyObject *self, PyObject *args); protected: PyIOleInPlaceFrame(IUnknown *pdisp); ~PyIOleInPlaceFrame(); }; // --------------------------------------------------- // // Gateway Declaration class PyGOleInPlaceFrame : public PyGOleInPlaceUIWindow, public IOleInPlaceFrame { protected: PyGOleInPlaceFrame(PyObject *instance) : PyGOleInPlaceUIWindow(instance) { ; } PYGATEWAY_MAKE_SUPPORT2(PyGOleInPlaceFrame, IOleInPlaceFrame, IID_IOleInPlaceFrame, PyGOleInPlaceUIWindow) // IOleWindow STDMETHOD(GetWindow)( HWND __RPC_FAR * phwnd); STDMETHOD(ContextSensitiveHelp)( BOOL fEnterMode); // IOleInPlaceUIWindow STDMETHOD(GetBorder)( LPRECT lprectBorder); STDMETHOD(RequestBorderSpace)( LPCBORDERWIDTHS pborderwidths); STDMETHOD(SetBorderSpace)( LPCBORDERWIDTHS pborderwidths); STDMETHOD(SetActiveObject)( IOleInPlaceActiveObject * pActiveObject, LPCOLESTR pszObjName); // IOleInPlaceFrame STDMETHOD(InsertMenus)( HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths); STDMETHOD(SetMenu)( HMENU hmenuShared, HOLEMENU holemenu, HWND hwndActiveObject); STDMETHOD(RemoveMenus)( HMENU hmenuShared); STDMETHOD(SetStatusText)( LPCOLESTR pszStatusText); STDMETHOD(EnableModeless)( BOOL fEnable); STDMETHOD(TranslateAccelerator)( LPMSG lpmsg, WORD wID); }; --- NEW FILE: PyIOleInPlaceUIWindow.h --- // This file declares the IOleInPlaceUIWindow Interface and Gateway for Python. // Generated by makegw.py // --------------------------------------------------- // // Interface Declaration class PyIOleInPlaceUIWindow : public PyIOleWindow { public: MAKE_PYCOM_CTOR(PyIOleInPlaceUIWindow); static IOleInPlaceUIWindow *GetI(PyObject *self); static PyComTypeObject type; // The Python methods static PyObject *GetBorder(PyObject *self, PyObject *args); static PyObject *RequestBorderSpace(PyObject *self, PyObject *args); static PyObject *SetBorderSpace(PyObject *self, PyObject *args); static PyObject *SetActiveObject(PyObject *self, PyObject *args); protected: PyIOleInPlaceUIWindow(IUnknown *pdisp); ~PyIOleInPlaceUIWindow(); }; // --------------------------------------------------- // // Gateway Declaration class PyGOleInPlaceUIWindow : public PyGOleWindow, public IOleInPlaceUIWindow { protected: PyGOleInPlaceUIWindow(PyObject *instance) : PyGOleWindow(instance) { ; } PYGATEWAY_MAKE_SUPPORT2(PyGOleInPlaceUIWindow, IOleInPlaceUIWindow, IID_IOleInPlaceUIWindow, PyGOleWindow) // IOleWindow STDMETHOD(GetWindow)( HWND __RPC_FAR * phwnd); STDMETHOD(ContextSensitiveHelp)( BOOL fEnterMode); // IOleInPlaceUIWindow STDMETHOD(GetBorder)( LPRECT lprectBorder); STDMETHOD(RequestBorderSpace)( LPCBORDERWIDTHS pborderwidths); STDMETHOD(SetBorderSpace)( LPCBORDERWIDTHS pborderwidths); STDMETHOD(SetActiveObject)( IOleInPlaceActiveObject * pActiveObject, LPCOLESTR pszObjName); }; Index: PyIOleObject.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axcontrol/src/PyIOleObject.cpp,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -d -r1.5 -r1.5.2.1 *** PyIOleObject.cpp 17 Oct 2007 03:50:24 -0000 1.5 --- PyIOleObject.cpp 2 Nov 2008 11:52:02 -0000 1.5.2.1 *************** *** 755,774 **** { PY_GATEWAY_METHOD; ! // *** The input argument lpmsg of type "LPMSG" was not processed *** ! // - None will always be passed to the Python function as a placeholder ! // - The type 'LPMSG' (lpmsg) is unknown. ! // *** The input argument lprcPosRect of type "LPCRECT" was not processed *** ! // - None will always be passed to the Python function as a placeholder ! // - The type 'LPCRECT' (lprcPosRect) is unknown. ! ! // TODO: ! ! PyObject *obpActiveSite; ! obpActiveSite = PyCom_PyObjectFromIUnknown(pActiveSite, IID_IOleClientSite, TRUE); ! ! HRESULT hr=InvokeViaPolicy("DoVerb", NULL, "izOiiz", iVerb, NULL, obpActiveSite, lindex, hwndParent, NULL); ! ! Py_XDECREF(obpActiveSite); ! return hr; } --- 755,764 ---- { PY_GATEWAY_METHOD; ! return InvokeViaPolicy("DoVerb", NULL, "iNNii(iiii)", ! iVerb, ! PyWinObject_FromMSG(lpmsg), ! PyCom_PyObjectFromIUnknown(pActiveSite, IID_IOleClientSite, TRUE), ! lindex, hwndParent, ! lprcPosRect->left, lprcPosRect->top, lprcPosRect->right, lprcPosRect->bottom); } Index: AXControl.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axcontrol/src/AXControl.cpp,v retrieving revision 1.8.2.1 retrieving revision 1.8.2.2 diff -C2 -d -r1.8.2.1 -r1.8.2.2 *** AXControl.cpp 13 Sep 2008 17:42:33 -0000 1.8.2.1 --- AXControl.cpp 2 Nov 2008 11:52:02 -0000 1.8.2.2 *************** *** 27,30 **** --- 27,32 ---- #include "PyIViewObject2.h" #include "PyIOleControl.h" + #include "PyIOleControlSite.h" + #include "PyIOleInPlaceActiveObject.h" #include "PyIOleInPlaceSite.h" #include "PyIOleInPlaceSiteEx.h" *************** *** 33,36 **** --- 35,65 ---- #include "PyIObjectWithSite.h" #include "PyIOleCommandTarget.h" + #include "PyIOleInPlaceUIWindow.h" + #include "PyIOleInPlaceFrame.h" + + BOOL PyObject_AsOLEINPLACEFRAMEINFO(PyObject *ob, OLEINPLACEFRAMEINFO *pfi) + { + PyObject *obFrame, *obAccel; + if (!PyArg_ParseTuple(ob, "iOOi:OLEINPLACEFRAMEINFO tuple", + &pfi->fMDIApp, + &obFrame, + &obAccel, + &pfi->cAccelEntries)) + return FALSE; + if (!PyWinObject_AsHANDLE(obFrame, (HANDLE *)&pfi->hwndFrame)) + return FALSE; + if (!PyWinObject_AsHANDLE(obAccel, (HANDLE *)&pfi->haccel)) + return FALSE; + return TRUE; + } + + PyObject *PyObject_FromOLEINPLACEFRAMEINFO(const OLEINPLACEFRAMEINFO *pfi) + { + return Py_BuildValue("iNNi", + pfi->fMDIApp, + PyWinLong_FromHANDLE(pfi->hwndFrame), + PyWinLong_FromHANDLE(pfi->haccel), + pfi->cAccelEntries); + } BOOL PyObject_AsLOGPALETTE(PyObject *pbLogPal, LOGPALETTE **ppLogPal) *************** *** 88,92 **** DVTARGETDEVICE *pTD = *ppTD; BOOL ok = FALSE; ! if (!PyArg_ParseTuple(ob, "OOOO", &obDriverName, &obDeviceName, &obPortName, &obExtDevmodeOffset)) return NULL; if (!PyWinObject_AsBstr(obDriverName, &bstrDriverName)) --- 117,121 ---- DVTARGETDEVICE *pTD = *ppTD; BOOL ok = FALSE; ! if (!PyArg_ParseTuple(ob, "OOOO:DVTARGETDEVICE tuple", &obDriverName, &obDeviceName, &obPortName, &obExtDevmodeOffset)) return NULL; if (!PyWinObject_AsBstr(obDriverName, &bstrDriverName)) *************** *** 318,324 **** --- 347,389 ---- Py_INCREF(Py_None); done: + if (punk) + punk->Release(); return ret; } + // @pymethod |axcontrol|OleTranslateAccelerator|Called by the object application, allows an object's container to translate accelerators according to the container's accelerator table. + static PyObject *axcontrol_OleTranslateAccelerator(PyObject *, PyObject *args) + { + PyObject *ret = NULL; + PyObject *obframe, *obinfo, *obmsg; + if (!PyArg_ParseTuple(args, "OOO:OleTranslateAccelerator", + &obframe, // @pyparm <o PyIOleInPlaceFrame>|frame||frame to send keystrokes to. + &obinfo, // @pyparm <o PyOLEINPLACEFRAMEINFO>|frame_info|| + &obmsg)) // @pyparm <o PyMSG>|msg|| + return NULL; + + IOleInPlaceFrame *pframe; + HRESULT hr; + if (!PyCom_InterfaceFromPyInstanceOrObject(obframe, IID_IOleInPlaceFrame, (void **)&pframe, FALSE)) + goto done; + OLEINPLACEFRAMEINFO info; + if (!PyObject_AsOLEINPLACEFRAMEINFO(obinfo, &info)) + goto done; + MSG msg; + if (!PyWinObject_AsMSG(obmsg, &msg)) + goto done; + Py_BEGIN_ALLOW_THREADS + hr = ::OleTranslateAccelerator(pframe, &info, &msg); + Py_END_ALLOW_THREADS + if (FAILED(hr)) { + PyCom_BuildPyException(hr); + goto done; + } + ret = PyInt_FromLong(hr); + done: + if (pframe) + pframe->Release(); + return ret; + } /* List of module functions */ *************** *** 330,333 **** --- 395,399 ---- { "OleLoadPicturePath", axcontrol_OleLoadPicturePath, 1}, // @pymeth OleLoadPicturePath|Creates a new picture object and initializes it from the contents of a stream. { "OleSetContainedObject", axcontrol_OleSetContainedObject, 1}, // @pymeth OleSetContainedObject|Notifies an object embedded in an OLE container to ensure correct reference. + { "OleTranslateAccelerator", axcontrol_OleTranslateAccelerator, 1}, // @pymeth OleTranslateAccelerator|Called by the object application, allows an object's container to translate accelerators according to the container's accelerator table. *************** *** 341,344 **** --- 407,411 ---- { PYCOM_INTERFACE_FULL (OleControl), + PYCOM_INTERFACE_FULL (OleControlSite), PYCOM_INTERFACE_FULL (OleClientSite), PYCOM_INTERFACE_FULL (OleObject), *************** *** 347,353 **** --- 414,423 ---- PYCOM_INTERFACE_FULL (ViewObject), PYCOM_INTERFACE_FULL (ViewObject2), + PYCOM_INTERFACE_FULL (OleInPlaceActiveObject), + PYCOM_INTERFACE_FULL (OleInPlaceFrame), PYCOM_INTERFACE_FULL (OleInPlaceSite), PYCOM_INTERFACE_FULL (OleInPlaceSiteEx), PYCOM_INTERFACE_FULL (OleInPlaceSiteWindowless), + PYCOM_INTERFACE_FULL (OleInPlaceUIWindow), PYCOM_INTERFACE_FULL (SpecifyPropertyPages), PYCOM_INTERFACE_FULL (ObjectWithSite), Index: PyIOleInPlaceSite.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axcontrol/src/PyIOleInPlaceSite.cpp,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** PyIOleInPlaceSite.cpp 12 Oct 2007 00:36:12 -0000 1.2 --- PyIOleInPlaceSite.cpp 2 Nov 2008 11:52:02 -0000 1.2.2.1 *************** *** 11,14 **** --- 11,18 ---- // Interface Implementation + extern BOOL PyObject_AsOLEINPLACEFRAMEINFO(PyObject *ob, OLEINPLACEFRAMEINFO *pfi); + extern PyObject *PyObject_FromOLEINPLACEFRAMEINFO(const OLEINPLACEFRAMEINFO *pfi); + + PyIOleInPlaceSite::PyIOleInPlaceSite(IUnknown *pdisp): PyIOleWindow(pdisp) *************** *** 107,112 **** return OleSetOleError(hr); - // *** The output argument lpFrameInfo of type "LPOLEINPLACEFRAMEINFO" was not processed *** - // The type 'LPOLEINPLACEFRAMEINFO' (lpFrameInfo) is unknown. PyObject *obppFrame; PyObject *obppDoc; --- 111,114 ---- *************** *** 114,121 **** obppFrame = PyCom_PyObjectFromIUnknown(ppFrame, IID_IOleInPlaceFrame, FALSE); obppDoc = PyCom_PyObjectFromIUnknown(ppDoc, IID_IOleInPlaceUIWindow, FALSE); ! PyObject *pyretval = Py_BuildValue("OO(llll)(llll)O", obppFrame, obppDoc, posRect.left, posRect.top, posRect.right, posRect.bottom, clipRect.left, clipRect.top, clipRect.right, clipRect.bottom, ! Py_None); Py_XDECREF(obppFrame); Py_XDECREF(obppDoc); --- 116,123 ---- obppFrame = PyCom_PyObjectFromIUnknown(ppFrame, IID_IOleInPlaceFrame, FALSE); obppDoc = PyCom_PyObjectFromIUnknown(ppDoc, IID_IOleInPlaceUIWindow, FALSE); ! PyObject *pyretval = Py_BuildValue("OO(llll)(llll)N", obppFrame, obppDoc, posRect.left, posRect.top, posRect.right, posRect.bottom, clipRect.left, clipRect.top, clipRect.right, clipRect.bottom, ! PyObject_FromOLEINPLACEFRAMEINFO(&fi)); Py_XDECREF(obppFrame); Py_XDECREF(obppDoc); *************** *** 317,326 **** PyObject *obppFrame; PyObject *obppDoc; ! PyObject *obFrame; ! PyObject *obAccel; ! if (!PyArg_ParseTuple(result, "OO(llll)(llll)(iOOi)" , &obppFrame, &obppDoc, &lprcPosRect->left, &lprcPosRect->top, &lprcPosRect->right, &lprcPosRect->bottom, &lprcClipRect->left, &lprcClipRect->top, &lprcClipRect->right, &lprcClipRect->bottom, ! &lpFrameInfo->fMDIApp, &obFrame, &obAccel, &lpFrameInfo->cAccelEntries)) return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/); BOOL bPythonIsHappy = TRUE; --- 319,327 ---- PyObject *obppFrame; PyObject *obppDoc; ! PyObject *obfi; ! if (!PyArg_ParseTuple(result, "OO(llll)(llll)O" , &obppFrame, &obppDoc, &lprcPosRect->left, &lprcPosRect->top, &lprcPosRect->right, &lprcPosRect->bottom, &lprcClipRect->left, &lprcClipRect->top, &lprcClipRect->right, &lprcClipRect->bottom, ! &obfi)) return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/); BOOL bPythonIsHappy = TRUE; *************** *** 329,335 **** if (!PyCom_InterfaceFromPyInstanceOrObject(obppDoc, IID_IOleInPlaceUIWindow, (void **)ppDoc, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; ! if (bPythonIsHappy && !PyWinObject_AsHANDLE(obFrame, (HANDLE *)&lpFrameInfo->hwndFrame)) ! bPythonIsHappy = FALSE; ! if (bPythonIsHappy && !PyWinObject_AsHANDLE(obAccel, (HANDLE *)&lpFrameInfo->haccel)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) hr = PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/); --- 330,334 ---- if (!PyCom_InterfaceFromPyInstanceOrObject(obppDoc, IID_IOleInPlaceUIWindow, (void **)ppDoc, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; ! if (bPythonIsHappy && !PyObject_AsOLEINPLACEFRAMEINFO(obfi, lpFrameInfo)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) hr = PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/); |
From: Mark H. <mha...@us...> - 2008-11-02 11:47:54
|
Update of /cvsroot/pywin32/pywin32 In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17019 Modified Files: setup.py CHANGES.txt Log Message: win32com.axcontrol gets support for interfaces OleControlSite, OleInPlaceActiveObject, OleInPlaceFrame and OleInPlaceUIWindow interfaces and OleTranslateAccelerator function. Index: setup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup.py,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -d -r1.83 -r1.84 *** setup.py 6 Oct 2008 00:45:17 -0000 1.83 --- setup.py 2 Nov 2008 11:47:47 -0000 1.84 *************** *** 1441,1446 **** WinExt_win32com('axcontrol', pch_header="axcontrol_pch.h", sources=(""" ! %(axcontrol)s/AXControl.cpp %(axcontrol)s/PyIOleControl.cpp %(axcontrol)s/PyIOleInPlaceSiteEx.cpp %(axcontrol)s/PyISpecifyPropertyPages.cpp %(axcontrol)s/PyIObjectWithSite.cpp %(axcontrol)s/PyIOleInPlaceObject.cpp %(axcontrol)s/PyIOleInPlaceSiteWindowless.cpp %(axcontrol)s/PyIViewObject.cpp --- 1441,1449 ---- WinExt_win32com('axcontrol', pch_header="axcontrol_pch.h", sources=(""" ! %(axcontrol)s/AXControl.cpp ! %(axcontrol)s/PyIOleControl.cpp %(axcontrol)s/PyIOleControlSite.cpp ! %(axcontrol)s/PyIOleInPlaceActiveObject.cpp %(axcontrol)s/PyIOleInPlaceSiteEx.cpp %(axcontrol)s/PyISpecifyPropertyPages.cpp + %(axcontrol)s/PyIOleInPlaceUIWindow.cpp %(axcontrol)s/PyIOleInPlaceFrame.cpp %(axcontrol)s/PyIObjectWithSite.cpp %(axcontrol)s/PyIOleInPlaceObject.cpp %(axcontrol)s/PyIOleInPlaceSiteWindowless.cpp %(axcontrol)s/PyIViewObject.cpp Index: CHANGES.txt =================================================================== RCS file: /cvsroot/pywin32/pywin32/CHANGES.txt,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** CHANGES.txt 2 Oct 2008 10:16:11 -0000 1.29 --- CHANGES.txt 2 Nov 2008 11:47:47 -0000 1.30 *************** *** 9,12 **** --- 9,16 ---- ---------------- + * win32com.axcontrol gets support for interfaces OleControlSite, + OleInPlaceActiveObject, OleInPlaceFrame and OleInPlaceUIWindow interfaces + and OleTranslateAccelerator function. + * MsgWaitForMultipleObjectsEx() would crash in all cases. Fix from Ziga Seilnacht via [2141368]. |
From: Mark H. <mha...@us...> - 2008-11-02 11:47:53
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/axcontrol/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17019/com/win32comext/axcontrol/src Modified Files: AXControl.cpp PyIOleInPlaceSite.cpp PyIOleObject.cpp Added Files: PyIOleControlSite.cpp PyIOleControlSite.h PyIOleInPlaceActiveObject.cpp PyIOleInPlaceActiveObject.h PyIOleInPlaceFrame.cpp PyIOleInPlaceFrame.h PyIOleInPlaceUIWindow.cpp PyIOleInPlaceUIWindow.h Log Message: win32com.axcontrol gets support for interfaces OleControlSite, OleInPlaceActiveObject, OleInPlaceFrame and OleInPlaceUIWindow interfaces and OleTranslateAccelerator function. --- NEW FILE: PyIOleInPlaceActiveObject.h --- // This file declares the IOleInPlaceActiveObject Interface and Gateway for Python. // Generated by makegw.py // --------------------------------------------------- // // Interface Declaration class PyIOleInPlaceActiveObject : public PyIOleWindow { public: MAKE_PYCOM_CTOR(PyIOleInPlaceActiveObject); static IOleInPlaceActiveObject *GetI(PyObject *self); static PyComTypeObject type; // The Python methods static PyObject *TranslateAccelerator(PyObject *self, PyObject *args); static PyObject *OnFrameWindowActivate(PyObject *self, PyObject *args); static PyObject *OnDocWindowActivate(PyObject *self, PyObject *args); static PyObject *ResizeBorder(PyObject *self, PyObject *args); static PyObject *EnableModeless(PyObject *self, PyObject *args); protected: PyIOleInPlaceActiveObject(IUnknown *pdisp); ~PyIOleInPlaceActiveObject(); }; // --------------------------------------------------- // // Gateway Declaration class PyGOleInPlaceActiveObject : public PyGOleWindow, public IOleInPlaceActiveObject { protected: PyGOleInPlaceActiveObject(PyObject *instance) : PyGOleWindow(instance) { ; } PYGATEWAY_MAKE_SUPPORT2(PyGOleInPlaceActiveObject, IOleInPlaceActiveObject, IID_IOleInPlaceActiveObject, PyGOleWindow) // IOleWindow STDMETHOD(GetWindow)( HWND __RPC_FAR * phwnd); STDMETHOD(ContextSensitiveHelp)( BOOL fEnterMode); // IOleInPlaceActiveObject STDMETHOD(TranslateAccelerator)( LPMSG lpmsg); STDMETHOD(OnFrameWindowActivate)( BOOL fActivate); STDMETHOD(OnDocWindowActivate)( BOOL fActivate); STDMETHOD(ResizeBorder)( LPCRECT prcBorder, IOleInPlaceUIWindow * pUIWindow, BOOL fFrameWindow); STDMETHOD(EnableModeless)( BOOL fEnable); }; --- NEW FILE: PyIOleControlSite.h --- // This file declares the IOleControlSite Interface and Gateway for Python. // Generated by makegw.py // --------------------------------------------------- // // Interface Declaration class PyIOleControlSite : public PyIUnknown { public: MAKE_PYCOM_CTOR(PyIOleControlSite); static IOleControlSite *GetI(PyObject *self); static PyComTypeObject type; // The Python methods static PyObject *OnControlInfoChanged(PyObject *self, PyObject *args); static PyObject *LockInPlaceActive(PyObject *self, PyObject *args); static PyObject *GetExtendedControl(PyObject *self, PyObject *args); static PyObject *TransformCoords(PyObject *self, PyObject *args); static PyObject *TranslateAccelerator(PyObject *self, PyObject *args); static PyObject *OnFocus(PyObject *self, PyObject *args); static PyObject *ShowPropertyFrame(PyObject *self, PyObject *args); protected: PyIOleControlSite(IUnknown *pdisp); ~PyIOleControlSite(); }; // --------------------------------------------------- // // Gateway Declaration class PyGOleControlSite : public PyGatewayBase, public IOleControlSite { protected: PyGOleControlSite(PyObject *instance) : PyGatewayBase(instance) { ; } PYGATEWAY_MAKE_SUPPORT2(PyGOleControlSite, IOleControlSite, IID_IOleControlSite, PyGatewayBase) // IOleControlSite STDMETHOD(OnControlInfoChanged)( void); STDMETHOD(LockInPlaceActive)( BOOL fLock); STDMETHOD(GetExtendedControl)( IDispatch ** ppDisp); STDMETHOD(TransformCoords)( POINTL * pPtlHimetric, POINTF * pPtfContainer, DWORD dwFlags); STDMETHOD(TranslateAccelerator)( MSG * pMsg, DWORD grfModifiers); STDMETHOD(OnFocus)( BOOL fGotFocus); STDMETHOD(ShowPropertyFrame)( void); }; --- NEW FILE: PyIOleInPlaceFrame.cpp --- // This file implements the IOleInPlaceFrame Interface and Gateway for Python. // Generated by makegw.py #include "axcontrol_pch.h" #include "PyIOleWindow.h" #include "PyIOleInPlaceUIWindow.h" #include "PyIOleInPlaceFrame.h" #include "PyComTypeObjects.h" // @doc - This file contains autoduck documentation // --------------------------------------------------- // // Interface Implementation PyIOleInPlaceFrame::PyIOleInPlaceFrame(IUnknown *pdisp): PyIOleInPlaceUIWindow(pdisp) { ob_type = &type; } PyIOleInPlaceFrame::~PyIOleInPlaceFrame() { } /* static */ IOleInPlaceFrame *PyIOleInPlaceFrame::GetI(PyObject *self) { return (IOleInPlaceFrame *)PyIOleInPlaceUIWindow::GetI(self); } // @pymethod |PyIOleInPlaceFrame|InsertMenus|Description of InsertMenus. PyObject *PyIOleInPlaceFrame::InsertMenus(PyObject *self, PyObject *args) { IOleInPlaceFrame *pIOIPF = GetI(self); if ( pIOIPF == NULL ) return NULL; // @pyparm int/long|hmenuShared||Description for hmenuShared // @pyparm <o PyOLEMENUGROUPWIDTHS>|menuWidths|| OLEMENUGROUPWIDTHS menuWidths; PyObject *oblpMenuWidths; PyObject *obhmenuShared; HMENU hmenuShared; if ( !PyArg_ParseTuple(args, "OO:InsertMenus", &obhmenuShared, &oblpMenuWidths) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyWinObject_AsHANDLE(obhmenuShared, (HANDLE *)&hmenuShared)) bPythonIsHappy = FALSE; if (bPythonIsHappy && !PyObject_AsOLEMENUGROUPWIDTHS( oblpMenuWidths, &menuWidths )) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOIPF->InsertMenus( hmenuShared, &menuWidths); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOIPF, IID_IOleInPlaceFrame); return PyObject_FromOLEMENUGROUPWIDTHS(&menuWidths); } // @pymethod |PyIOleInPlaceFrame|SetMenu|Description of SetMenu. PyObject *PyIOleInPlaceFrame::SetMenu(PyObject *self, PyObject *args) { IOleInPlaceFrame *pIOIPF = GetI(self); if ( pIOIPF == NULL ) return NULL; // @pyparm int/long|hmenuShared||Description for hmenuShared // @pyparm int/long|holemenu||Description for holemenu // @pyparm int/long|hwndActiveObject||Description for hwndActiveObject PyObject *obhmenuShared; PyObject *obholemenu; PyObject *obhwndActiveObject; HMENU hmenuShared; HOLEMENU holemenu; HWND hwndActiveObject; if ( !PyArg_ParseTuple(args, "OOO:SetMenu", &obhmenuShared, &obholemenu, &obhwndActiveObject) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyWinObject_AsHANDLE(obhmenuShared, (HANDLE *)&hmenuShared)) bPythonIsHappy = FALSE; if (bPythonIsHappy && !PyWinObject_AsHANDLE(obholemenu, (HANDLE *)&holemenu)) bPythonIsHappy = FALSE; if (bPythonIsHappy && !PyWinObject_AsHANDLE(obhwndActiveObject, (HANDLE *)&hwndActiveObject)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOIPF->SetMenu( hmenuShared, holemenu, hwndActiveObject ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOIPF, IID_IOleInPlaceFrame ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIOleInPlaceFrame|RemoveMenus|Description of RemoveMenus. PyObject *PyIOleInPlaceFrame::RemoveMenus(PyObject *self, PyObject *args) { IOleInPlaceFrame *pIOIPF = GetI(self); if ( pIOIPF == NULL ) return NULL; // @pyparm int/long|hmenuShared||Description for hmenuShared PyObject *obhmenuShared; HMENU hmenuShared; if ( !PyArg_ParseTuple(args, "O:RemoveMenus", &obhmenuShared) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyWinObject_AsHANDLE(obhmenuShared, (HANDLE *)&hmenuShared)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOIPF->RemoveMenus( hmenuShared ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOIPF, IID_IOleInPlaceFrame ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIOleInPlaceFrame|SetStatusText|Description of SetStatusText. PyObject *PyIOleInPlaceFrame::SetStatusText(PyObject *self, PyObject *args) { IOleInPlaceFrame *pIOIPF = GetI(self); if ( pIOIPF == NULL ) return NULL; // @pyparm <o unicode>|pszStatusText||Description for pszStatusText PyObject *obpszStatusText; LPOLESTR pszStatusText; if ( !PyArg_ParseTuple(args, "O:SetStatusText", &obpszStatusText) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyWinObject_AsBstr(obpszStatusText, &pszStatusText)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOIPF->SetStatusText( pszStatusText ); SysFreeString(pszStatusText); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOIPF, IID_IOleInPlaceFrame ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIOleInPlaceFrame|EnableModeless|Description of EnableModeless. PyObject *PyIOleInPlaceFrame::EnableModeless(PyObject *self, PyObject *args) { IOleInPlaceFrame *pIOIPF = GetI(self); if ( pIOIPF == NULL ) return NULL; // @pyparm int|fEnable||Description for fEnable BOOL fEnable; if ( !PyArg_ParseTuple(args, "i:EnableModeless", &fEnable) ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOIPF->EnableModeless( fEnable ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOIPF, IID_IOleInPlaceFrame ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIOleInPlaceFrame|TranslateAccelerator|Description of TranslateAccelerator. PyObject *PyIOleInPlaceFrame::TranslateAccelerator(PyObject *self, PyObject *args) { IOleInPlaceFrame *pIOIPF = GetI(self); if ( pIOIPF == NULL ) return NULL; PyObject *oblpmsg; // @pyparm <o PyMSG>|lpmsg||Description for lpmsg // @pyparm int|wID||Description for wID WORD wID; if ( !PyArg_ParseTuple(args, "Oh:TranslateAccelerator", &oblpmsg, &wID) ) return NULL; MSG msg; if (!PyWinObject_AsMSG(oblpmsg, &msg)) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOIPF->TranslateAccelerator(&msg, wID); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOIPF, IID_IOleInPlaceFrame ); Py_INCREF(Py_None); return Py_None; } // @object PyIOleInPlaceFrame|Description of the interface static struct PyMethodDef PyIOleInPlaceFrame_methods[] = { { "InsertMenus", PyIOleInPlaceFrame::InsertMenus, 1 }, // @pymeth InsertMenus|Description of InsertMenus { "SetMenu", PyIOleInPlaceFrame::SetMenu, 1 }, // @pymeth SetMenu|Description of SetMenu { "RemoveMenus", PyIOleInPlaceFrame::RemoveMenus, 1 }, // @pymeth RemoveMenus|Description of RemoveMenus { "SetStatusText", PyIOleInPlaceFrame::SetStatusText, 1 }, // @pymeth SetStatusText|Description of SetStatusText { "EnableModeless", PyIOleInPlaceFrame::EnableModeless, 1 }, // @pymeth EnableModeless|Description of EnableModeless { "TranslateAccelerator", PyIOleInPlaceFrame::TranslateAccelerator, 1 }, // @pymeth TranslateAccelerator|Description of TranslateAccelerator { NULL } }; PyComTypeObject PyIOleInPlaceFrame::type("PyIOleInPlaceFrame", &PyIOleInPlaceUIWindow::type, sizeof(PyIOleInPlaceFrame), PyIOleInPlaceFrame_methods, GET_PYCOM_CTOR(PyIOleInPlaceFrame)); // --------------------------------------------------- // // Gateway Implementation // IOleWindow STDMETHODIMP PyGOleInPlaceFrame::GetWindow(HWND __RPC_FAR * phwnd) {return PyGOleWindow::GetWindow(phwnd);} STDMETHODIMP PyGOleInPlaceFrame::ContextSensitiveHelp(BOOL fEnterMode) {return PyGOleWindow::ContextSensitiveHelp(fEnterMode);} // IOleInPlaceUIWindow STDMETHODIMP PyGOleInPlaceFrame::GetBorder(LPRECT lpr) {return PyGOleInPlaceUIWindow::GetBorder(lpr);} STDMETHODIMP PyGOleInPlaceFrame::RequestBorderSpace(LPCBORDERWIDTHS pbw) {return PyGOleInPlaceUIWindow::RequestBorderSpace(pbw);} STDMETHODIMP PyGOleInPlaceFrame::SetBorderSpace(LPCBORDERWIDTHS pbw) {return PyGOleInPlaceUIWindow::SetBorderSpace(pbw);} STDMETHODIMP PyGOleInPlaceFrame::SetActiveObject(IOleInPlaceActiveObject * pActiveObject, LPCOLESTR pszObjName) {return PyGOleInPlaceUIWindow::SetActiveObject(pActiveObject, pszObjName);} // IOleInPlaceFrame STDMETHODIMP PyGOleInPlaceFrame::InsertMenus( /* [in] */ HMENU hmenuShared, /* [out][in] */ LPOLEMENUGROUPWIDTHS lpMenuWidths) { PY_GATEWAY_METHOD; PyObject *result; HRESULT hr=InvokeViaPolicy("InsertMenus", &result, "NN", PyWinLong_FromHANDLE(hmenuShared), PyObject_FromOLEMENUGROUPWIDTHS(lpMenuWidths)); if (FAILED(hr)) return hr; PyObject_AsOLEMENUGROUPWIDTHS(result, lpMenuWidths); Py_DECREF(result); return MAKE_PYCOM_GATEWAY_FAILURE_CODE("InsertMenus"); } STDMETHODIMP PyGOleInPlaceFrame::SetMenu( /* [in] */ HMENU hmenuShared, /* [in] */ HOLEMENU holemenu, /* [in] */ HWND hwndActiveObject) { PY_GATEWAY_METHOD; return InvokeViaPolicy("SetMenu", NULL, "NNN", PyWinLong_FromHANDLE(hmenuShared), PyWinLong_FromHANDLE(holemenu), PyWinLong_FromHANDLE(hwndActiveObject)); } STDMETHODIMP PyGOleInPlaceFrame::RemoveMenus( /* [in] */ HMENU hmenuShared) { PY_GATEWAY_METHOD; return InvokeViaPolicy("RemoveMenus", NULL, "N", PyWinLong_FromHANDLE(hmenuShared)); } STDMETHODIMP PyGOleInPlaceFrame::SetStatusText( /* [unique][in] */ LPCOLESTR pszStatusText) { PY_GATEWAY_METHOD; return InvokeViaPolicy("SetStatusText", NULL, "N", MakeOLECHARToObj(pszStatusText)); } STDMETHODIMP PyGOleInPlaceFrame::EnableModeless( /* [in] */ BOOL fEnable) { PY_GATEWAY_METHOD; return InvokeViaPolicy("EnableModeless", NULL, "i", fEnable); } STDMETHODIMP PyGOleInPlaceFrame::TranslateAccelerator( /* [in] */ LPMSG lpmsg, /* [in] */ WORD wID) { PY_GATEWAY_METHOD; return InvokeViaPolicy("TranslateAccelerator", NULL, "Nh", PyWinObject_FromMSG(lpmsg), &wID); } --- NEW FILE: PyIOleInPlaceUIWindow.cpp --- // This file implements the IOleInPlaceUIWindow Interface and Gateway for Python. // Generated by makegw.py #include "axcontrol_pch.h" #include "PyIOleWindow.h" #include "PyIOleInPlaceUIWindow.h" // @doc - This file contains autoduck documentation // --------------------------------------------------- // // Interface Implementation PyIOleInPlaceUIWindow::PyIOleInPlaceUIWindow(IUnknown *pdisp): PyIOleWindow(pdisp) { ob_type = &type; } PyIOleInPlaceUIWindow::~PyIOleInPlaceUIWindow() { } /* static */ IOleInPlaceUIWindow *PyIOleInPlaceUIWindow::GetI(PyObject *self) { return (IOleInPlaceUIWindow *)PyIOleWindow::GetI(self); } // @pymethod |PyIOleInPlaceUIWindow|GetBorder|Description of GetBorder. PyObject *PyIOleInPlaceUIWindow::GetBorder(PyObject *self, PyObject *args) { IOleInPlaceUIWindow *pIOIPUIW = GetI(self); if ( pIOIPUIW == NULL ) return NULL; if (!PyArg_ParseTuple(args, ":GetBorder")) return NULL; HRESULT hr; RECT r; PY_INTERFACE_PRECALL; hr = pIOIPUIW->GetBorder(&r); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOIPUIW, IID_IOleInPlaceUIWindow ); return Py_BuildValue("(iiii)", r.left, r.top, r.right, r.bottom); } // @pymethod |PyIOleInPlaceUIWindow|RequestBorderSpace|Description of RequestBorderSpace. PyObject *PyIOleInPlaceUIWindow::RequestBorderSpace(PyObject *self, PyObject *args) { IOleInPlaceUIWindow *pIOIPUIW = GetI(self); if ( pIOIPUIW == NULL ) return NULL; BORDERWIDTHS bw; // @pyparm (int, int, int, int)|borderwidths||Description for pborderwidths if ( !PyArg_ParseTuple(args, "(iiii):RequestBorderSpace", &bw.left, &bw.top, &bw.right, &bw.bottom)) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOIPUIW->RequestBorderSpace(&bw); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOIPUIW, IID_IOleInPlaceUIWindow ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIOleInPlaceUIWindow|SetBorderSpace|Description of SetBorderSpace. PyObject *PyIOleInPlaceUIWindow::SetBorderSpace(PyObject *self, PyObject *args) { IOleInPlaceUIWindow *pIOIPUIW = GetI(self); if ( pIOIPUIW == NULL ) return NULL; BORDERWIDTHS bw; // @pyparm (int, int, int, int)|borderwidths||Description for pborderwidths if ( !PyArg_ParseTuple(args, "(iiii):SetBorderSpace", &bw.left, &bw.top, &bw.right, &bw.bottom)) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOIPUIW->SetBorderSpace(&bw); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOIPUIW, IID_IOleInPlaceUIWindow ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIOleInPlaceUIWindow|SetActiveObject|Description of SetActiveObject. PyObject *PyIOleInPlaceUIWindow::SetActiveObject(PyObject *self, PyObject *args) { IOleInPlaceUIWindow *pIOIPUIW = GetI(self); if ( pIOIPUIW == NULL ) return NULL; // @pyparm <o PyIOleInPlaceActiveObject>|pActiveObject||Description for pActiveObject // @pyparm <o unicode>|pszObjName||Description for pszObjName PyObject *obpActiveObject; PyObject *obpszObjName; IOleInPlaceActiveObject * pActiveObject; LPOLESTR pszObjName; if ( !PyArg_ParseTuple(args, "OO:SetActiveObject", &obpActiveObject, &obpszObjName) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obpActiveObject, IID_IOleInPlaceActiveObject, (void **)&pActiveObject, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; if (bPythonIsHappy && !PyWinObject_AsBstr(obpszObjName, &pszObjName)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOIPUIW->SetActiveObject( pActiveObject, pszObjName ); if (pActiveObject) pActiveObject->Release(); SysFreeString(pszObjName); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOIPUIW, IID_IOleInPlaceUIWindow ); Py_INCREF(Py_None); return Py_None; } // @object PyIOleInPlaceUIWindow|Description of the interface static struct PyMethodDef PyIOleInPlaceUIWindow_methods[] = { { "GetBorder", PyIOleInPlaceUIWindow::GetBorder, 1 }, // @pymeth GetBorder|Description of GetBorder { "RequestBorderSpace", PyIOleInPlaceUIWindow::RequestBorderSpace, 1 }, // @pymeth RequestBorderSpace|Description of RequestBorderSpace { "SetBorderSpace", PyIOleInPlaceUIWindow::SetBorderSpace, 1 }, // @pymeth SetBorderSpace|Description of SetBorderSpace { "SetActiveObject", PyIOleInPlaceUIWindow::SetActiveObject, 1 }, // @pymeth SetActiveObject|Description of SetActiveObject { NULL } }; PyComTypeObject PyIOleInPlaceUIWindow::type("PyIOleInPlaceUIWindow", &PyIOleWindow::type, sizeof(PyIOleInPlaceUIWindow), PyIOleInPlaceUIWindow_methods, GET_PYCOM_CTOR(PyIOleInPlaceUIWindow)); // --------------------------------------------------- // // Gateway Implementation // IOleWindow STDMETHODIMP PyGOleInPlaceUIWindow::GetWindow(HWND __RPC_FAR * phwnd) {return PyGOleWindow::GetWindow(phwnd);} STDMETHODIMP PyGOleInPlaceUIWindow::ContextSensitiveHelp(BOOL fEnterMode) {return PyGOleWindow::ContextSensitiveHelp(fEnterMode);} // IOleInPlaceUIWindow STDMETHODIMP PyGOleInPlaceUIWindow::GetBorder( /* [out] */ LPRECT lpr) { PY_GATEWAY_METHOD; PyObject *result; HRESULT hr=InvokeViaPolicy("GetBorder", &result); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params if (!PyArg_ParseTuple(result, "(iiii)", &lpr->left, &lpr->top, &lpr->bottom, &lpr->right)) hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE("GetBorder"); Py_DECREF(result); return hr; } STDMETHODIMP PyGOleInPlaceUIWindow::RequestBorderSpace( /* [unique][in] */ LPCBORDERWIDTHS pbw) { PY_GATEWAY_METHOD; return InvokeViaPolicy("RequestBorderSpace", NULL, "(iiii)", pbw->left, pbw->top, pbw->right, pbw->bottom); } STDMETHODIMP PyGOleInPlaceUIWindow::SetBorderSpace( /* [unique][in] */ LPCBORDERWIDTHS pbw) { PY_GATEWAY_METHOD; return InvokeViaPolicy("SetBorderSpace", NULL, "(iiii)", pbw->left, pbw->top, pbw->right, pbw->bottom); } STDMETHODIMP PyGOleInPlaceUIWindow::SetActiveObject( /* [unique][in] */ IOleInPlaceActiveObject * pActiveObject, /* [unique][string][in] */ LPCOLESTR pszObjName) { PY_GATEWAY_METHOD; return InvokeViaPolicy("SetActiveObject", NULL, "NN", PyCom_PyObjectFromIUnknown(pActiveObject, IID_IOleInPlaceActiveObject, TRUE), MakeOLECHARToObj(pszObjName)); } --- NEW FILE: PyIOleInPlaceActiveObject.cpp --- // This file implements the IOleInPlaceActiveObject Interface and Gateway for Python. // Generated by makegw.py #include "axcontrol_pch.h" #include "PyIOleWindow.h" #include "PyIOleInPlaceActiveObject.h" // @doc - This file contains autoduck documentation // --------------------------------------------------- // // Interface Implementation PyIOleInPlaceActiveObject::PyIOleInPlaceActiveObject(IUnknown *pdisp): PyIOleWindow(pdisp) { ob_type = &type; } PyIOleInPlaceActiveObject::~PyIOleInPlaceActiveObject() { } /* static */ IOleInPlaceActiveObject *PyIOleInPlaceActiveObject::GetI(PyObject *self) { return (IOleInPlaceActiveObject *)PyIOleWindow::GetI(self); } // @pymethod |PyIOleInPlaceActiveObject|TranslateAccelerator|Description of TranslateAccelerator. PyObject *PyIOleInPlaceActiveObject::TranslateAccelerator(PyObject *self, PyObject *args) { IOleInPlaceActiveObject *pIOIPAO = GetI(self); if ( pIOIPAO == NULL ) return NULL; MSG msg; PyObject *obmsg; // @pyparm <o PyMSG>|lpmsg||Description for lpmsg if ( !PyArg_ParseTuple(args, "O:TranslateAccelerator", &obmsg) ) return NULL; if (!PyWinObject_AsMSG(obmsg, &msg)) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOIPAO->TranslateAccelerator(&msg); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOIPAO, IID_IOleInPlaceActiveObject ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIOleInPlaceActiveObject|OnFrameWindowActivate|Description of OnFrameWindowActivate. PyObject *PyIOleInPlaceActiveObject::OnFrameWindowActivate(PyObject *self, PyObject *args) { IOleInPlaceActiveObject *pIOIPAO = GetI(self); if ( pIOIPAO == NULL ) return NULL; // @pyparm int|fActivate||Description for fActivate BOOL fActivate; if ( !PyArg_ParseTuple(args, "i:OnFrameWindowActivate", &fActivate) ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOIPAO->OnFrameWindowActivate( fActivate ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOIPAO, IID_IOleInPlaceActiveObject ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIOleInPlaceActiveObject|OnDocWindowActivate|Description of OnDocWindowActivate. PyObject *PyIOleInPlaceActiveObject::OnDocWindowActivate(PyObject *self, PyObject *args) { IOleInPlaceActiveObject *pIOIPAO = GetI(self); if ( pIOIPAO == NULL ) return NULL; // @pyparm int|fActivate||Description for fActivate BOOL fActivate; if ( !PyArg_ParseTuple(args, "i:OnDocWindowActivate", &fActivate) ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOIPAO->OnDocWindowActivate( fActivate ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOIPAO, IID_IOleInPlaceActiveObject ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIOleInPlaceActiveObject|ResizeBorder|Description of ResizeBorder. PyObject *PyIOleInPlaceActiveObject::ResizeBorder(PyObject *self, PyObject *args) { IOleInPlaceActiveObject *pIOIPAO = GetI(self); if ( pIOIPAO == NULL ) return NULL; RECT rcb; // @pyparm (int, int, int, int)|rcBorder||Description for prcBorder // @pyparm <o PyIOleInPlaceUIWindow>|pUIWindow||Description for pUIWindow // @pyparm int|fFrameWindow||Description for fFrameWindow PyObject *obpUIWindow; IOleInPlaceUIWindow * pUIWindow; BOOL fFrameWindow; if ( !PyArg_ParseTuple(args, "(iiii)Oi:ResizeBorder", &rcb.left, &rcb.top, &rcb.right, &rcb.bottom, &obpUIWindow, &fFrameWindow) ) return NULL; if (!PyCom_InterfaceFromPyInstanceOrObject(obpUIWindow, IID_IOleInPlaceUIWindow, (void **)&pUIWindow, TRUE /* bNoneOK */)) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOIPAO->ResizeBorder( &rcb, pUIWindow, fFrameWindow ); if (pUIWindow) pUIWindow->Release(); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOIPAO, IID_IOleInPlaceActiveObject ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIOleInPlaceActiveObject|EnableModeless|Description of EnableModeless. PyObject *PyIOleInPlaceActiveObject::EnableModeless(PyObject *self, PyObject *args) { IOleInPlaceActiveObject *pIOIPAO = GetI(self); if ( pIOIPAO == NULL ) return NULL; // @pyparm int|fEnable||Description for fEnable BOOL fEnable; if ( !PyArg_ParseTuple(args, "i:EnableModeless", &fEnable) ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOIPAO->EnableModeless( fEnable ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOIPAO, IID_IOleInPlaceActiveObject ); Py_INCREF(Py_None); return Py_None; } // @object PyIOleInPlaceActiveObject|Description of the interface static struct PyMethodDef PyIOleInPlaceActiveObject_methods[] = { { "TranslateAccelerator", PyIOleInPlaceActiveObject::TranslateAccelerator, 1 }, // @pymeth TranslateAccelerator|Description of TranslateAccelerator { "OnFrameWindowActivate", PyIOleInPlaceActiveObject::OnFrameWindowActivate, 1 }, // @pymeth OnFrameWindowActivate|Description of OnFrameWindowActivate { "OnDocWindowActivate", PyIOleInPlaceActiveObject::OnDocWindowActivate, 1 }, // @pymeth OnDocWindowActivate|Description of OnDocWindowActivate { "ResizeBorder", PyIOleInPlaceActiveObject::ResizeBorder, 1 }, // @pymeth ResizeBorder|Description of ResizeBorder { "EnableModeless", PyIOleInPlaceActiveObject::EnableModeless, 1 }, // @pymeth EnableModeless|Description of EnableModeless { NULL } }; PyComTypeObject PyIOleInPlaceActiveObject::type("PyIOleInPlaceActiveObject", &PyIOleWindow::type, sizeof(PyIOleInPlaceActiveObject), PyIOleInPlaceActiveObject_methods, GET_PYCOM_CTOR(PyIOleInPlaceActiveObject)); // --------------------------------------------------- // // Gateway Implementation // IOleWindow STDMETHODIMP PyGOleInPlaceActiveObject::GetWindow(HWND __RPC_FAR * phwnd) {return PyGOleWindow::GetWindow(phwnd);} STDMETHODIMP PyGOleInPlaceActiveObject::ContextSensitiveHelp(BOOL fEnterMode) {return PyGOleWindow::ContextSensitiveHelp(fEnterMode);} // IOleInPlaceActiveObject STDMETHODIMP PyGOleInPlaceActiveObject::TranslateAccelerator( /* [in] */ LPMSG lpmsg) { PY_GATEWAY_METHOD; return InvokeViaPolicy("TranslateAccelerator", NULL, "N", PyWinObject_FromMSG(lpmsg)); } STDMETHODIMP PyGOleInPlaceActiveObject::OnFrameWindowActivate( /* [in] */ BOOL fActivate) { PY_GATEWAY_METHOD; return InvokeViaPolicy("OnFrameWindowActivate", NULL, "i", fActivate); } STDMETHODIMP PyGOleInPlaceActiveObject::OnDocWindowActivate( /* [in] */ BOOL fActivate) { PY_GATEWAY_METHOD; return InvokeViaPolicy("OnDocWindowActivate", NULL, "i", fActivate); } STDMETHODIMP PyGOleInPlaceActiveObject::ResizeBorder( /* [in] */ LPCRECT prc, /* [unique][in] */ IOleInPlaceUIWindow * pUIWindow, /* [in] */ BOOL fFrameWindow) { PY_GATEWAY_METHOD; return InvokeViaPolicy("ResizeBorder", NULL, "(iiii)Oi", prc->left, prc->top, prc->right, prc->bottom, PyCom_PyObjectFromIUnknown(pUIWindow, IID_IOleInPlaceUIWindow, TRUE), fFrameWindow); } STDMETHODIMP PyGOleInPlaceActiveObject::EnableModeless( /* [in] */ BOOL fEnable) { PY_GATEWAY_METHOD; return InvokeViaPolicy("EnableModeless", NULL, "i", fEnable); } --- NEW FILE: PyIOleControlSite.cpp --- // This file implements the IOleControlSite Interface and Gateway for Python. // Generated by makegw.py #include "axcontrol_pch.h" #include "PyIOleControlSite.h" // @doc - This file contains autoduck documentation // --------------------------------------------------- // // Interface Implementation PyIOleControlSite::PyIOleControlSite(IUnknown *pdisp): PyIUnknown(pdisp) { ob_type = &type; } PyIOleControlSite::~PyIOleControlSite() { } /* static */ IOleControlSite *PyIOleControlSite::GetI(PyObject *self) { return (IOleControlSite *)PyIUnknown::GetI(self); } // @pymethod |PyIOleControlSite|OnControlInfoChanged|Description of OnControlInfoChanged. PyObject *PyIOleControlSite::OnControlInfoChanged(PyObject *self, PyObject *args) { IOleControlSite *pIOCS = GetI(self); if ( pIOCS == NULL ) return NULL; if ( !PyArg_ParseTuple(args, ":OnControlInfoChanged") ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOCS->OnControlInfoChanged(); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOCS, IID_IOleControlSite ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIOleControlSite|LockInPlaceActive|Description of LockInPlaceActive. PyObject *PyIOleControlSite::LockInPlaceActive(PyObject *self, PyObject *args) { IOleControlSite *pIOCS = GetI(self); if ( pIOCS == NULL ) return NULL; // @pyparm int|fLock||Description for fLock BOOL fLock; if ( !PyArg_ParseTuple(args, "i:LockInPlaceActive", &fLock) ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOCS->LockInPlaceActive(fLock); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOCS, IID_IOleControlSite ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIOleControlSite|GetExtendedControl|Description of GetExtendedControl. PyObject *PyIOleControlSite::GetExtendedControl(PyObject *self, PyObject *args) { IOleControlSite *pIOCS = GetI(self); if ( pIOCS == NULL ) return NULL; IDispatch * ppDisp; if ( !PyArg_ParseTuple(args, ":GetExtendedControl") ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOCS->GetExtendedControl(&ppDisp); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOCS, IID_IOleControlSite ); return PyCom_PyObjectFromIUnknown(ppDisp, IID_IDispatch, FALSE); } // @pymethod |PyIOleControlSite|TransformCoords|Description of TransformCoords. PyObject *PyIOleControlSite::TransformCoords(PyObject *self, PyObject *args) { IOleControlSite *pIOCS = GetI(self); if ( pIOCS == NULL ) return NULL; POINTL pPtlHimetric; // @pyparm (int, int)|PtlHimetric||Description for pPtlHimetric POINTF pPtfContainer; // @pyparm (float, float))|pPtfContainer||Description for pPtfContainer // @pyparm int|dwFlags||Description for dwFlags DWORD dwFlags; if (!PyArg_ParseTuple(args, "(ll)(ff)l:TransformCoords", &pPtlHimetric.x, &pPtlHimetric.y, &pPtfContainer.x, &pPtfContainer.y, &dwFlags)) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOCS->TransformCoords( &pPtlHimetric, &pPtfContainer, dwFlags ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOCS, IID_IOleControlSite ); // @rdesc The result is a tuple of the transformed input points - ie, // a tuple of ((int, int), (float, float)) return Py_BuildValue("(ll)(ff)", pPtlHimetric.x, pPtlHimetric.y, pPtfContainer.x, pPtfContainer.y); } // @pymethod |PyIOleControlSite|TranslateAccelerator|Description of TranslateAccelerator. PyObject *PyIOleControlSite::TranslateAccelerator(PyObject *self, PyObject *args) { IOleControlSite *pIOCS = GetI(self); if ( pIOCS == NULL ) return NULL; MSG msg; PyObject *obpMsg; // @pyparm <o PyMSG>|pMsg||Description for pMsg // @pyparm int|grfModifiers||Description for grfModifiers DWORD grfModifiers; if ( !PyArg_ParseTuple(args, "Ol:TranslateAccelerator", &obpMsg, &grfModifiers) ) return NULL; if (!PyWinObject_AsMSG(obpMsg, &msg)) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOCS->TranslateAccelerator(&msg, grfModifiers); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOCS, IID_IOleControlSite ); return PyInt_FromLong(hr); } // @pymethod |PyIOleControlSite|OnFocus|Description of OnFocus. PyObject *PyIOleControlSite::OnFocus(PyObject *self, PyObject *args) { IOleControlSite *pIOCS = GetI(self); if ( pIOCS == NULL ) return NULL; // @pyparm int|fGotFocus||Description for fGotFocus BOOL fGotFocus; if ( !PyArg_ParseTuple(args, "i:OnFocus", &fGotFocus) ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOCS->OnFocus(fGotFocus); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOCS, IID_IOleControlSite ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIOleControlSite|ShowPropertyFrame|Description of ShowPropertyFrame. PyObject *PyIOleControlSite::ShowPropertyFrame(PyObject *self, PyObject *args) { IOleControlSite *pIOCS = GetI(self); if ( pIOCS == NULL ) return NULL; if ( !PyArg_ParseTuple(args, ":ShowPropertyFrame") ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOCS->ShowPropertyFrame(); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOCS, IID_IOleControlSite ); Py_INCREF(Py_None); return Py_None; } // @object PyIOleControlSite|Description of the interface static struct PyMethodDef PyIOleControlSite_methods[] = { { "OnControlInfoChanged", PyIOleControlSite::OnControlInfoChanged, 1 }, // @pymeth OnControlInfoChanged|Description of OnControlInfoChanged { "LockInPlaceActive", PyIOleControlSite::LockInPlaceActive, 1 }, // @pymeth LockInPlaceActive|Description of LockInPlaceActive { "GetExtendedControl", PyIOleControlSite::GetExtendedControl, 1 }, // @pymeth GetExtendedControl|Description of GetExtendedControl { "TransformCoords", PyIOleControlSite::TransformCoords, 1 }, // @pymeth TransformCoords|Description of TransformCoords { "TranslateAccelerator", PyIOleControlSite::TranslateAccelerator, 1 }, // @pymeth TranslateAccelerator|Description of TranslateAccelerator { "OnFocus", PyIOleControlSite::OnFocus, 1 }, // @pymeth OnFocus|Description of OnFocus { "ShowPropertyFrame", PyIOleControlSite::ShowPropertyFrame, 1 }, // @pymeth ShowPropertyFrame|Description of ShowPropertyFrame { NULL } }; PyComTypeObject PyIOleControlSite::type("PyIOleControlSite", &PyIUnknown::type, sizeof(PyIOleControlSite), PyIOleControlSite_methods, GET_PYCOM_CTOR(PyIOleControlSite)); // --------------------------------------------------- // // Gateway Implementation STDMETHODIMP PyGOleControlSite::OnControlInfoChanged( void) { PY_GATEWAY_METHOD; HRESULT hr=InvokeViaPolicy("OnControlInfoChanged", NULL); return hr; } STDMETHODIMP PyGOleControlSite::LockInPlaceActive( /* [in] */ BOOL fLock) { PY_GATEWAY_METHOD; return InvokeViaPolicy("LockInPlaceActive", NULL, "i", fLock); } STDMETHODIMP PyGOleControlSite::GetExtendedControl( /* [out] */ IDispatch ** ppDisp) { PY_GATEWAY_METHOD; if (ppDisp==NULL) return E_POINTER; PyObject *result; HRESULT hr=InvokeViaPolicy("GetExtendedControl", &result); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params PyObject *obppDisp; if (!PyArg_Parse(result, "O" , &obppDisp)) hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE("GetExtendedControl"); else if (!PyCom_InterfaceFromPyInstanceOrObject(obppDisp, IID_IDispatch, (void **)ppDisp, TRUE /* bNoneOK */)) hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE("GetExtendedControl"); Py_DECREF(result); return hr; } STDMETHODIMP PyGOleControlSite::TransformCoords( /* [out][in] */ POINTL * pPtlHimetric, /* [out][in] */ POINTF * pPtfContainer, /* [in] */ DWORD dwFlags) { PY_GATEWAY_METHOD; PyObject *result; HRESULT hr=InvokeViaPolicy("TransformCoords", &result, "(ll)(ff)l", pPtlHimetric->x, pPtlHimetric->y, pPtfContainer->x, pPtfContainer->y, dwFlags); if (FAILED(hr)) return hr; if (!PyArg_ParseTuple(result, "(ll)(ff)", &pPtlHimetric->x, &pPtlHimetric->y, &pPtfContainer->x, &pPtfContainer->y)) hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE("GetExtendedControl"); Py_DECREF(result); return hr; } STDMETHODIMP PyGOleControlSite::TranslateAccelerator( /* [in] */ MSG * pMsg, /* [in] */ DWORD grfModifiers) { PY_GATEWAY_METHOD; return InvokeViaPolicy("TranslateAccelerator", NULL, "Nl", PyWinObject_FromMSG(pMsg), grfModifiers); } STDMETHODIMP PyGOleControlSite::OnFocus( /* [in] */ BOOL fGotFocus) { PY_GATEWAY_METHOD; return InvokeViaPolicy("OnFocus", NULL, "i", fGotFocus); } STDMETHODIMP PyGOleControlSite::ShowPropertyFrame( void) { PY_GATEWAY_METHOD; return InvokeViaPolicy("ShowPropertyFrame", NULL); } --- NEW FILE: PyIOleInPlaceFrame.h --- // This file declares the IOleInPlaceFrame Interface and Gateway for Python. // Generated by makegw.py // --------------------------------------------------- // // Interface Declaration class PyIOleInPlaceFrame : public PyIOleInPlaceUIWindow { public: MAKE_PYCOM_CTOR(PyIOleInPlaceFrame); static IOleInPlaceFrame *GetI(PyObject *self); static PyComTypeObject type; // The Python methods static PyObject *InsertMenus(PyObject *self, PyObject *args); static PyObject *SetMenu(PyObject *self, PyObject *args); static PyObject *RemoveMenus(PyObject *self, PyObject *args); static PyObject *SetStatusText(PyObject *self, PyObject *args); static PyObject *EnableModeless(PyObject *self, PyObject *args); static PyObject *TranslateAccelerator(PyObject *self, PyObject *args); protected: PyIOleInPlaceFrame(IUnknown *pdisp); ~PyIOleInPlaceFrame(); }; // --------------------------------------------------- // // Gateway Declaration class PyGOleInPlaceFrame : public PyGOleInPlaceUIWindow, public IOleInPlaceFrame { protected: PyGOleInPlaceFrame(PyObject *instance) : PyGOleInPlaceUIWindow(instance) { ; } PYGATEWAY_MAKE_SUPPORT2(PyGOleInPlaceFrame, IOleInPlaceFrame, IID_IOleInPlaceFrame, PyGOleInPlaceUIWindow) // IOleWindow STDMETHOD(GetWindow)( HWND __RPC_FAR * phwnd); STDMETHOD(ContextSensitiveHelp)( BOOL fEnterMode); // IOleInPlaceUIWindow STDMETHOD(GetBorder)( LPRECT lprectBorder); STDMETHOD(RequestBorderSpace)( LPCBORDERWIDTHS pborderwidths); STDMETHOD(SetBorderSpace)( LPCBORDERWIDTHS pborderwidths); STDMETHOD(SetActiveObject)( IOleInPlaceActiveObject * pActiveObject, LPCOLESTR pszObjName); // IOleInPlaceFrame STDMETHOD(InsertMenus)( HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths); STDMETHOD(SetMenu)( HMENU hmenuShared, HOLEMENU holemenu, HWND hwndActiveObject); STDMETHOD(RemoveMenus)( HMENU hmenuShared); STDMETHOD(SetStatusText)( LPCOLESTR pszStatusText); STDMETHOD(EnableModeless)( BOOL fEnable); STDMETHOD(TranslateAccelerator)( LPMSG lpmsg, WORD wID); }; --- NEW FILE: PyIOleInPlaceUIWindow.h --- // This file declares the IOleInPlaceUIWindow Interface and Gateway for Python. // Generated by makegw.py // --------------------------------------------------- // // Interface Declaration class PyIOleInPlaceUIWindow : public PyIOleWindow { public: MAKE_PYCOM_CTOR(PyIOleInPlaceUIWindow); static IOleInPlaceUIWindow *GetI(PyObject *self); static PyComTypeObject type; // The Python methods static PyObject *GetBorder(PyObject *self, PyObject *args); static PyObject *RequestBorderSpace(PyObject *self, PyObject *args); static PyObject *SetBorderSpace(PyObject *self, PyObject *args); static PyObject *SetActiveObject(PyObject *self, PyObject *args); protected: PyIOleInPlaceUIWindow(IUnknown *pdisp); ~PyIOleInPlaceUIWindow(); }; // --------------------------------------------------- // // Gateway Declaration class PyGOleInPlaceUIWindow : public PyGOleWindow, public IOleInPlaceUIWindow { protected: PyGOleInPlaceUIWindow(PyObject *instance) : PyGOleWindow(instance) { ; } PYGATEWAY_MAKE_SUPPORT2(PyGOleInPlaceUIWindow, IOleInPlaceUIWindow, IID_IOleInPlaceUIWindow, PyGOleWindow) // IOleWindow STDMETHOD(GetWindow)( HWND __RPC_FAR * phwnd); STDMETHOD(ContextSensitiveHelp)( BOOL fEnterMode); // IOleInPlaceUIWindow STDMETHOD(GetBorder)( LPRECT lprectBorder); STDMETHOD(RequestBorderSpace)( LPCBORDERWIDTHS pborderwidths); STDMETHOD(SetBorderSpace)( LPCBORDERWIDTHS pborderwidths); STDMETHOD(SetActiveObject)( IOleInPlaceActiveObject * pActiveObject, LPCOLESTR pszObjName); }; Index: PyIOleObject.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axcontrol/src/PyIOleObject.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PyIOleObject.cpp 17 Oct 2007 03:50:24 -0000 1.5 --- PyIOleObject.cpp 2 Nov 2008 11:47:47 -0000 1.6 *************** *** 755,774 **** { PY_GATEWAY_METHOD; ! // *** The input argument lpmsg of type "LPMSG" was not processed *** ! // - None will always be passed to the Python function as a placeholder ! // - The type 'LPMSG' (lpmsg) is unknown. ! // *** The input argument lprcPosRect of type "LPCRECT" was not processed *** ! // - None will always be passed to the Python function as a placeholder ! // - The type 'LPCRECT' (lprcPosRect) is unknown. ! ! // TODO: ! ! PyObject *obpActiveSite; ! obpActiveSite = PyCom_PyObjectFromIUnknown(pActiveSite, IID_IOleClientSite, TRUE); ! ! HRESULT hr=InvokeViaPolicy("DoVerb", NULL, "izOiiz", iVerb, NULL, obpActiveSite, lindex, hwndParent, NULL); ! ! Py_XDECREF(obpActiveSite); ! return hr; } --- 755,764 ---- { PY_GATEWAY_METHOD; ! return InvokeViaPolicy("DoVerb", NULL, "iNNii(iiii)", ! iVerb, ! PyWinObject_FromMSG(lpmsg), ! PyCom_PyObjectFromIUnknown(pActiveSite, IID_IOleClientSite, TRUE), ! lindex, hwndParent, ! lprcPosRect->left, lprcPosRect->top, lprcPosRect->right, lprcPosRect->bottom); } Index: AXControl.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axcontrol/src/AXControl.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** AXControl.cpp 15 Oct 2007 05:20:44 -0000 1.8 --- AXControl.cpp 2 Nov 2008 11:47:47 -0000 1.9 *************** *** 27,30 **** --- 27,32 ---- #include "PyIViewObject2.h" #include "PyIOleControl.h" + #include "PyIOleControlSite.h" + #include "PyIOleInPlaceActiveObject.h" #include "PyIOleInPlaceSite.h" #include "PyIOleInPlaceSiteEx.h" *************** *** 33,36 **** --- 35,65 ---- #include "PyIObjectWithSite.h" #include "PyIOleCommandTarget.h" + #include "PyIOleInPlaceUIWindow.h" + #include "PyIOleInPlaceFrame.h" + + BOOL PyObject_AsOLEINPLACEFRAMEINFO(PyObject *ob, OLEINPLACEFRAMEINFO *pfi) + { + PyObject *obFrame, *obAccel; + if (!PyArg_ParseTuple(ob, "iOOi:OLEINPLACEFRAMEINFO tuple", + &pfi->fMDIApp, + &obFrame, + &obAccel, + &pfi->cAccelEntries)) + return FALSE; + if (!PyWinObject_AsHANDLE(obFrame, (HANDLE *)&pfi->hwndFrame)) + return FALSE; + if (!PyWinObject_AsHANDLE(obAccel, (HANDLE *)&pfi->haccel)) + return FALSE; + return TRUE; + } + + PyObject *PyObject_FromOLEINPLACEFRAMEINFO(const OLEINPLACEFRAMEINFO *pfi) + { + return Py_BuildValue("iNNi", + pfi->fMDIApp, + PyWinLong_FromHANDLE(pfi->hwndFrame), + PyWinLong_FromHANDLE(pfi->haccel), + pfi->cAccelEntries); + } BOOL PyObject_AsLOGPALETTE(PyObject *pbLogPal, LOGPALETTE **ppLogPal) *************** *** 88,92 **** DVTARGETDEVICE *pTD = *ppTD; BOOL ok = FALSE; ! if (!PyArg_ParseTuple(ob, "OOOO", &obDriverName, &obDeviceName, &obPortName, &obExtDevmodeOffset)) return NULL; if (!PyWinObject_AsBstr(obDriverName, &bstrDriverName)) --- 117,121 ---- DVTARGETDEVICE *pTD = *ppTD; BOOL ok = FALSE; ! if (!PyArg_ParseTuple(ob, "OOOO:DVTARGETDEVICE tuple", &obDriverName, &obDeviceName, &obPortName, &obExtDevmodeOffset)) return NULL; if (!PyWinObject_AsBstr(obDriverName, &bstrDriverName)) *************** *** 318,324 **** --- 347,389 ---- Py_INCREF(Py_None); done: + if (punk) + punk->Release(); return ret; } + // @pymethod |axcontrol|OleTranslateAccelerator|Called by the object application, allows an object's container to translate accelerators according to the container's accelerator table. + static PyObject *axcontrol_OleTranslateAccelerator(PyObject *, PyObject *args) + { + PyObject *ret = NULL; + PyObject *obframe, *obinfo, *obmsg; + if (!PyArg_ParseTuple(args, "OOO:OleTranslateAccelerator", + &obframe, // @pyparm <o PyIOleInPlaceFrame>|frame||frame to send keystrokes to. + &obinfo, // @pyparm <o PyOLEINPLACEFRAMEINFO>|frame_info|| + &obmsg)) // @pyparm <o PyMSG>|msg|| + return NULL; + + IOleInPlaceFrame *pframe; + HRESULT hr; + if (!PyCom_InterfaceFromPyInstanceOrObject(obframe, IID_IOleInPlaceFrame, (void **)&pframe, FALSE)) + goto done; + OLEINPLACEFRAMEINFO info; + if (!PyObject_AsOLEINPLACEFRAMEINFO(obinfo, &info)) + goto done; + MSG msg; + if (!PyWinObject_AsMSG(obmsg, &msg)) + goto done; + Py_BEGIN_ALLOW_THREADS + hr = ::OleTranslateAccelerator(pframe, &info, &msg); + Py_END_ALLOW_THREADS + if (FAILED(hr)) { + PyCom_BuildPyException(hr); + goto done; + } + ret = PyInt_FromLong(hr); + done: + if (pframe) + pframe->Release(); + return ret; + } /* List of module functions */ *************** *** 330,333 **** --- 395,399 ---- { "OleLoadPicturePath", axcontrol_OleLoadPicturePath, 1}, // @pymeth OleLoadPicturePath|Creates a new picture object and initializes it from the contents of a stream. { "OleSetContainedObject", axcontrol_OleSetContainedObject, 1}, // @pymeth OleSetContainedObject|Notifies an object embedded in an OLE container to ensure correct reference. + { "OleTranslateAccelerator", axcontrol_OleTranslateAccelerator, 1}, // @pymeth OleTranslateAccelerator|Called by the object application, allows an object's container to translate accelerators according to the container's accelerator table. *************** *** 352,355 **** --- 418,422 ---- { PYCOM_INTERFACE_FULL (OleControl), + PYCOM_INTERFACE_FULL (OleControlSite), PYCOM_INTERFACE_FULL (OleClientSite), PYCOM_INTERFACE_FULL (OleObject), *************** *** 358,364 **** --- 425,434 ---- PYCOM_INTERFACE_FULL (ViewObject), PYCOM_INTERFACE_FULL (ViewObject2), + PYCOM_INTERFACE_FULL (OleInPlaceActiveObject), + PYCOM_INTERFACE_FULL (OleInPlaceFrame), PYCOM_INTERFACE_FULL (OleInPlaceSite), PYCOM_INTERFACE_FULL (OleInPlaceSiteEx), PYCOM_INTERFACE_FULL (OleInPlaceSiteWindowless), + PYCOM_INTERFACE_FULL (OleInPlaceUIWindow), PYCOM_INTERFACE_FULL (SpecifyPropertyPages), PYCOM_INTERFACE_FULL (ObjectWithSite), Index: PyIOleInPlaceSite.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axcontrol/src/PyIOleInPlaceSite.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyIOleInPlaceSite.cpp 12 Oct 2007 00:36:12 -0000 1.2 --- PyIOleInPlaceSite.cpp 2 Nov 2008 11:47:47 -0000 1.3 *************** *** 11,14 **** --- 11,18 ---- // Interface Implementation + extern BOOL PyObject_AsOLEINPLACEFRAMEINFO(PyObject *ob, OLEINPLACEFRAMEINFO *pfi); + extern PyObject *PyObject_FromOLEINPLACEFRAMEINFO(const OLEINPLACEFRAMEINFO *pfi); + + PyIOleInPlaceSite::PyIOleInPlaceSite(IUnknown *pdisp): PyIOleWindow(pdisp) *************** *** 107,112 **** return OleSetOleError(hr); - // *** The output argument lpFrameInfo of type "LPOLEINPLACEFRAMEINFO" was not processed *** - // The type 'LPOLEINPLACEFRAMEINFO' (lpFrameInfo) is unknown. PyObject *obppFrame; PyObject *obppDoc; --- 111,114 ---- *************** *** 114,121 **** obppFrame = PyCom_PyObjectFromIUnknown(ppFrame, IID_IOleInPlaceFrame, FALSE); obppDoc = PyCom_PyObjectFromIUnknown(ppDoc, IID_IOleInPlaceUIWindow, FALSE); ! PyObject *pyretval = Py_BuildValue("OO(llll)(llll)O", obppFrame, obppDoc, posRect.left, posRect.top, posRect.right, posRect.bottom, clipRect.left, clipRect.top, clipRect.right, clipRect.bottom, ! Py_None); Py_XDECREF(obppFrame); Py_XDECREF(obppDoc); --- 116,123 ---- obppFrame = PyCom_PyObjectFromIUnknown(ppFrame, IID_IOleInPlaceFrame, FALSE); obppDoc = PyCom_PyObjectFromIUnknown(ppDoc, IID_IOleInPlaceUIWindow, FALSE); ! PyObject *pyretval = Py_BuildValue("OO(llll)(llll)N", obppFrame, obppDoc, posRect.left, posRect.top, posRect.right, posRect.bottom, clipRect.left, clipRect.top, clipRect.right, clipRect.bottom, ! PyObject_FromOLEINPLACEFRAMEINFO(&fi)); Py_XDECREF(obppFrame); Py_XDECREF(obppDoc); *************** *** 317,326 **** PyObject *obppFrame; PyObject *obppDoc; ! PyObject *obFrame; ! PyObject *obAccel; ! if (!PyArg_ParseTuple(result, "OO(llll)(llll)(iOOi)" , &obppFrame, &obppDoc, &lprcPosRect->left, &lprcPosRect->top, &lprcPosRect->right, &lprcPosRect->bottom, &lprcClipRect->left, &lprcClipRect->top, &lprcClipRect->right, &lprcClipRect->bottom, ! &lpFrameInfo->fMDIApp, &obFrame, &obAccel, &lpFrameInfo->cAccelEntries)) return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/); BOOL bPythonIsHappy = TRUE; --- 319,327 ---- PyObject *obppFrame; PyObject *obppDoc; ! PyObject *obfi; ! if (!PyArg_ParseTuple(result, "OO(llll)(llll)O" , &obppFrame, &obppDoc, &lprcPosRect->left, &lprcPosRect->top, &lprcPosRect->right, &lprcPosRect->bottom, &lprcClipRect->left, &lprcClipRect->top, &lprcClipRect->right, &lprcClipRect->bottom, ! &obfi)) return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/); BOOL bPythonIsHappy = TRUE; *************** *** 329,335 **** if (!PyCom_InterfaceFromPyInstanceOrObject(obppDoc, IID_IOleInPlaceUIWindow, (void **)ppDoc, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; ! if (bPythonIsHappy && !PyWinObject_AsHANDLE(obFrame, (HANDLE *)&lpFrameInfo->hwndFrame)) ! bPythonIsHappy = FALSE; ! if (bPythonIsHappy && !PyWinObject_AsHANDLE(obAccel, (HANDLE *)&lpFrameInfo->haccel)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) hr = PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/); --- 330,334 ---- if (!PyCom_InterfaceFromPyInstanceOrObject(obppDoc, IID_IOleInPlaceUIWindow, (void **)ppDoc, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; ! if (bPythonIsHappy && !PyObject_AsOLEINPLACEFRAMEINFO(obfi, lpFrameInfo)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) hr = PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/); |
From: Mark H. <mha...@us...> - 2008-10-30 02:41:46
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13332 Modified Files: Tag: py3k win32trace.cpp Log Message: merge from trunk: 32 and 64bit versions can interoperate. Index: win32trace.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32trace.cpp,v retrieving revision 1.14.2.1 retrieving revision 1.14.2.2 diff -C2 -d -r1.14.2.1 -r1.14.2.2 *** win32trace.cpp 29 Aug 2008 04:59:28 -0000 1.14.2.1 --- win32trace.cpp 30 Oct 2008 02:41:41 -0000 1.14.2.2 *************** *** 40,44 **** ! const size_t BUFFER_SIZE = 0x20000; // Includes size integer. const TCHAR *MAP_OBJECT_NAME = _T("Global\\PythonTraceOutputMapping"); const TCHAR *MUTEX_OBJECT_NAME = _T("Global\\PythonTraceOutputMutex"); --- 40,44 ---- ! const unsigned long BUFFER_SIZE = 0x20000; // Includes size integer. const TCHAR *MAP_OBJECT_NAME = _T("Global\\PythonTraceOutputMapping"); const TCHAR *MUTEX_OBJECT_NAME = _T("Global\\PythonTraceOutputMutex"); *************** *** 336,341 **** BOOL ok = GetMyMutex(); if (ok) { ! size_t *pLen = (size_t *)pMapBaseWrite; ! size_t sizeLeft = (BUFFER_SIZE-sizeof(size_t)) - *pLen; // If less than double we need left, wait for it to empty, or .1 sec. if (sizeLeft < len_this * 2) { --- 336,342 ---- BOOL ok = GetMyMutex(); if (ok) { ! // must use types with identical size on win32 and win64 ! unsigned long *pLen = (unsigned long *)pMapBaseWrite; ! unsigned long sizeLeft = (BUFFER_SIZE-sizeof(unsigned long)) - *pLen; // If less than double we need left, wait for it to empty, or .1 sec. if (sizeLeft < len_this * 2) { *************** *** 347,354 **** } if (ok) { ! size_t *pLen = (size_t *)pMapBaseWrite; ! char *buffer = (char *)(((size_t *)pMapBaseWrite)+1); ! size_t sizeLeft = (BUFFER_SIZE-sizeof(size_t)) - *pLen; if (sizeLeft<len_this) *pLen = 0; --- 348,355 ---- } if (ok) { ! unsigned long *pLen = (unsigned long *)pMapBaseWrite; ! char *buffer = (char *)(((unsigned long *)pMapBaseWrite)+1); ! unsigned long sizeLeft = (BUFFER_SIZE-sizeof(unsigned long)) - *pLen; if (sizeLeft<len_this) *pLen = 0; *************** *** 385,391 **** Py_BEGIN_ALLOW_THREADS if (GetMyMutex()) { ! ! size_t *pLen = (size_t *)pMapBaseRead; ! char *buffer = (char *)(((size_t *)pMapBaseRead)+1); result = (char *)malloc(*pLen + 1); --- 386,392 ---- Py_BEGIN_ALLOW_THREADS if (GetMyMutex()) { ! // must use sizes that are identical on win32 and win64 ! unsigned long*pLen = (unsigned long *)pMapBaseRead; ! char *buffer = (char *)(((unsigned long *)pMapBaseRead)+1); result = (char *)malloc(*pLen + 1); |
From: Mark H. <mha...@us...> - 2008-10-30 02:39:01
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13188 Modified Files: win32trace.cpp Log Message: Have 32 and 64bit builds use the same sizes so they interoperate. Index: win32trace.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32trace.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** win32trace.cpp 18 May 2007 11:22:17 -0000 1.14 --- win32trace.cpp 30 Oct 2008 02:38:55 -0000 1.15 *************** *** 40,44 **** ! const size_t BUFFER_SIZE = 0x20000; // Includes size integer. const char *MAP_OBJECT_NAME = "Global\\PythonTraceOutputMapping"; const char *MUTEX_OBJECT_NAME = "Global\\PythonTraceOutputMutex"; --- 40,44 ---- ! const unsigned long BUFFER_SIZE = 0x20000; // Includes size integer. const char *MAP_OBJECT_NAME = "Global\\PythonTraceOutputMapping"; const char *MUTEX_OBJECT_NAME = "Global\\PythonTraceOutputMutex"; *************** *** 337,342 **** BOOL ok = GetMyMutex(); if (ok) { ! size_t *pLen = (size_t *)pMapBaseWrite; ! size_t sizeLeft = (BUFFER_SIZE-sizeof(size_t)) - *pLen; // If less than double we need left, wait for it to empty, or .1 sec. if (sizeLeft < len_this * 2) { --- 337,343 ---- BOOL ok = GetMyMutex(); if (ok) { ! // must use types with identical size on win32 and win64 ! unsigned long *pLen = (unsigned long *)pMapBaseWrite; ! unsigned long sizeLeft = (BUFFER_SIZE-sizeof(unsigned long)) - *pLen; // If less than double we need left, wait for it to empty, or .1 sec. if (sizeLeft < len_this * 2) { *************** *** 348,355 **** } if (ok) { ! size_t *pLen = (size_t *)pMapBaseWrite; ! char *buffer = (char *)(((size_t *)pMapBaseWrite)+1); ! size_t sizeLeft = (BUFFER_SIZE-sizeof(size_t)) - *pLen; if (sizeLeft<len_this) *pLen = 0; --- 349,356 ---- } if (ok) { ! unsigned long *pLen = (unsigned long *)pMapBaseWrite; ! char *buffer = (char *)(((unsigned long *)pMapBaseWrite)+1); ! unsigned long sizeLeft = (BUFFER_SIZE-sizeof(unsigned long)) - *pLen; if (sizeLeft<len_this) *pLen = 0; *************** *** 386,392 **** Py_BEGIN_ALLOW_THREADS if (GetMyMutex()) { ! ! size_t *pLen = (size_t *)pMapBaseRead; ! char *buffer = (char *)(((size_t *)pMapBaseRead)+1); result = (char *)malloc(*pLen + 1); --- 387,393 ---- Py_BEGIN_ALLOW_THREADS if (GetMyMutex()) { ! // must use sizes that are identical on win32 and win64 ! unsigned long*pLen = (unsigned long *)pMapBaseRead; ! char *buffer = (char *)(((unsigned long *)pMapBaseRead)+1); result = (char *)malloc(*pLen + 1); |
From: Mark H. <mha...@us...> - 2008-10-25 00:19:19
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv5707/win32/src Modified Files: Tag: py3k win32tsmodule.cpp Log Message: Merge from trunk; WTSGetActiveConsoleSessionId always raised NotImplementedError; it's in kernel32 Index: win32tsmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32tsmodule.cpp,v retrieving revision 1.4.2.1 retrieving revision 1.4.2.2 diff -C2 -d -r1.4.2.1 -r1.4.2.2 *** win32tsmodule.cpp 29 Aug 2008 04:59:28 -0000 1.4.2.1 --- win32tsmodule.cpp 25 Oct 2008 00:19:13 -0000 1.4.2.2 *************** *** 817,821 **** h=LoadLibrary(L"wtsapi32.dll"); if (h){ - pfnWTSGetActiveConsoleSessionId=(WTSGetActiveConsoleSessionIdfunc)GetProcAddress(h, "WTSGetActiveConsoleSessionId"); pfnWTSQueryUserToken=(WTSQueryUserTokenfunc)GetProcAddress(h, "WTSQueryUserToken"); pfnWTSRegisterSessionNotification=(WTSRegisterSessionNotificationfunc)GetProcAddress(h, "WTSRegisterSessionNotification"); --- 817,820 ---- *************** *** 826,831 **** if (h==NULL) h=LoadLibrary(L"kernel32.dll"); ! if (h) pfnProcessIdToSessionId=(ProcessIdToSessionIdfunc)GetProcAddress(h, "ProcessIdToSessionId"); #if (PY_VERSION_HEX >= 0x03000000) --- 825,832 ---- if (h==NULL) h=LoadLibrary(L"kernel32.dll"); ! if (h) { pfnProcessIdToSessionId=(ProcessIdToSessionIdfunc)GetProcAddress(h, "ProcessIdToSessionId"); + pfnWTSGetActiveConsoleSessionId=(WTSGetActiveConsoleSessionIdfunc)GetProcAddress(h, "WTSGetActiveConsoleSessionId"); + } #if (PY_VERSION_HEX >= 0x03000000) |
From: Mark H. <mha...@us...> - 2008-10-25 00:17:24
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv5623/win32/src Modified Files: win32tsmodule.cpp Log Message: WTSGetActiveConsoleSessionId always raised NotImplementedError; it's in kernel32 Index: win32tsmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32tsmodule.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** win32tsmodule.cpp 18 Jul 2007 19:03:00 -0000 1.4 --- win32tsmodule.cpp 25 Oct 2008 00:17:19 -0000 1.5 *************** *** 792,796 **** h=LoadLibrary(L"wtsapi32.dll"); if (h){ - pfnWTSGetActiveConsoleSessionId=(WTSGetActiveConsoleSessionIdfunc)GetProcAddress(h, "WTSGetActiveConsoleSessionId"); pfnWTSQueryUserToken=(WTSQueryUserTokenfunc)GetProcAddress(h, "WTSQueryUserToken"); pfnWTSRegisterSessionNotification=(WTSRegisterSessionNotificationfunc)GetProcAddress(h, "WTSRegisterSessionNotification"); --- 792,795 ---- *************** *** 801,805 **** if (h==NULL) h=LoadLibrary(L"kernel32.dll"); ! if (h) pfnProcessIdToSessionId=(ProcessIdToSessionIdfunc)GetProcAddress(h, "ProcessIdToSessionId"); } --- 800,806 ---- if (h==NULL) h=LoadLibrary(L"kernel32.dll"); ! if (h) { pfnProcessIdToSessionId=(ProcessIdToSessionIdfunc)GetProcAddress(h, "ProcessIdToSessionId"); + pfnWTSGetActiveConsoleSessionId=(WTSGetActiveConsoleSessionIdfunc)GetProcAddress(h, "WTSGetActiveConsoleSessionId"); + } } |
From: Mark H. <mha...@us...> - 2008-10-23 11:17:39
|
Update of /cvsroot/pywin32/pywin32/com/win32com/client In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8245/com/win32com/client Modified Files: Tag: py3k CLSIDToClass.py Log Message: merge various py3k friendly changes from the trunk. Index: CLSIDToClass.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/CLSIDToClass.py,v retrieving revision 1.1.4.1 retrieving revision 1.1.4.2 diff -C2 -d -r1.1.4.1 -r1.1.4.2 *** CLSIDToClass.py 29 Aug 2008 08:58:52 -0000 1.1.4.1 --- CLSIDToClass.py 23 Oct 2008 09:45:16 -0000 1.1.4.2 *************** *** 37,46 **** Typically called by makepy generated modules at import time. """ ! try: ! mapCLSIDToClass.update(dict) ! except AttributeError: # Python 1.4? ! for clsid, pythonClass in list(dict.items()): ! mapCLSIDToClass[clsid] = pythonClass ! def GetClass(clsid): """Given a CLSID, return the globally associated class. --- 37,42 ---- Typically called by makepy generated modules at import time. """ ! mapCLSIDToClass.update(dict) ! def GetClass(clsid): """Given a CLSID, return the globally associated class. |
From: Mark H. <mha...@us...> - 2008-10-23 10:24:04
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8245/Pythonwin/pywin/framework/editor Modified Files: Tag: py3k ModuleBrowser.py __init__.py Log Message: merge various py3k friendly changes from the trunk. Index: __init__.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor/__init__.py,v retrieving revision 1.2.4.1 retrieving revision 1.2.4.2 diff -C2 -d -r1.2.4.1 -r1.2.4.2 *** __init__.py 29 Aug 2008 06:17:09 -0000 1.2.4.1 --- __init__.py 23 Oct 2008 09:45:16 -0000 1.2.4.2 *************** *** 88,90 **** SetEditorOption(option, str(newValue)) ! from pywin.framework.editor.color.coloreditor import * --- 88,90 ---- SetEditorOption(option, str(newValue)) ! from pywin.framework.editor.color.coloreditor import editorTemplate Index: ModuleBrowser.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor/ModuleBrowser.py,v retrieving revision 1.8.4.2 retrieving revision 1.8.4.3 diff -C2 -d -r1.8.4.2 -r1.8.4.3 *** ModuleBrowser.py 24 Sep 2008 22:47:32 -0000 1.8.4.2 --- ModuleBrowser.py 23 Oct 2008 09:45:16 -0000 1.8.4.3 *************** *** 19,23 **** def GetSubList(self): ret = [] ! for item in list(self.clbrdata.values()): if item.__class__ != pyclbr.Class: # ie, it is a pyclbr Function instance (only introduced post 1.5.2) ret.append(HierListCLBRFunction( item ) ) --- 19,23 ---- def GetSubList(self): ret = [] ! for item in self.clbrdata.itervalues(): if item.__class__ != pyclbr.Class: # ie, it is a pyclbr Function instance (only introduced post 1.5.2) ret.append(HierListCLBRFunction( item ) ) *************** *** 77,81 **** r1.sort() r2=[] ! for meth, lineno in list(self.methods.items()): r2.append(HierListCLBRMethod(meth, self.file, lineno)) r2.sort(key=lambda m:m.GetText()) --- 77,81 ---- r1.sort() r2=[] ! for meth, lineno in self.methods.iteritems(): r2.append(HierListCLBRMethod(meth, self.file, lineno)) r2.sort(key=lambda m:m.GetText()) |
From: Mark H. <mha...@us...> - 2008-10-23 09:49:49
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/mapi In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8245/com/win32comext/mapi Modified Files: Tag: py3k mapiutil.py Log Message: merge various py3k friendly changes from the trunk. Index: mapiutil.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/mapi/mapiutil.py,v retrieving revision 1.5 retrieving revision 1.5.4.1 diff -C2 -d -r1.5 -r1.5.4.1 *** mapiutil.py 20 Jan 2004 01:24:08 -0000 1.5 --- mapiutil.py 23 Oct 2008 09:45:16 -0000 1.5.4.1 *************** *** 1,12 **** # General utilities for MAPI and MAPI objects. ! from types import TupleType, ListType, IntType, StringType from pywintypes import UnicodeType, TimeType import pythoncom import mapi, mapitags - # Pre 2.2.1 compat. - try: True, False - except NameError: True = 1==1; False = 1==0 - prTable = {} def GetPropTagName(pt): --- 1,12 ---- # General utilities for MAPI and MAPI objects. ! # We used to use these old names from the 'types' module... ! TupleType=tuple ! ListType=list ! IntType=int ! StringType=str from pywintypes import UnicodeType, TimeType import pythoncom import mapi, mapitags prTable = {} def GetPropTagName(pt): |
From: Mark H. <mha...@us...> - 2008-10-23 09:49:39
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8245/Pythonwin/pywin/framework Modified Files: Tag: py3k mdi_pychecker.py Log Message: merge various py3k friendly changes from the trunk. Index: mdi_pychecker.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/mdi_pychecker.py,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -C2 -d -r1.2.2.1 -r1.2.2.2 *** mdi_pychecker.py 29 Aug 2008 06:16:42 -0000 1.2.2.1 --- mdi_pychecker.py 23 Oct 2008 09:45:16 -0000 1.2.2.2 *************** *** 99,103 **** dirs[sd] = None self.dirs = [] ! for d in list(dirs.keys()): self.dirs.append(d) --- 99,103 ---- dirs[sd] = None self.dirs = [] ! for d in dirs.iterkeys(): self.dirs.append(d) |
From: Mark H. <mha...@us...> - 2008-10-23 09:49:38
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/Demos In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8245/Pythonwin/pywin/Demos Modified Files: Tag: py3k dlgtest.py objdoc.py Log Message: merge various py3k friendly changes from the trunk. Index: dlgtest.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/Demos/dlgtest.py,v retrieving revision 1.1.4.1 retrieving revision 1.1.4.2 diff -C2 -d -r1.1.4.1 -r1.1.4.2 *** dlgtest.py 29 Aug 2008 06:16:06 -0000 1.1.4.1 --- dlgtest.py 23 Oct 2008 09:45:16 -0000 1.1.4.2 *************** *** 22,26 **** def __init__(self, modal=1): dialog.Dialog.__init__(self, IDD_SET_TABSTOPS) - self.counter=0 if modal: --- 22,25 ---- *************** *** 28,32 **** else: self.CreateWindow() ! def OnInitDialog(self): # Set the caption of the dialog itself. --- 27,31 ---- else: self.CreateWindow() ! def OnInitDialog(self): # Set the caption of the dialog itself. Index: objdoc.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/Demos/objdoc.py,v retrieving revision 1.1.4.1 retrieving revision 1.1.4.2 diff -C2 -d -r1.1.4.1 -r1.1.4.2 *** objdoc.py 29 Aug 2008 06:16:06 -0000 1.1.4.1 --- objdoc.py 23 Oct 2008 09:45:16 -0000 1.1.4.2 *************** *** 32,36 **** self.object = object def OnOpenDocument (self, name): ! raise error("Should not be called if template strings set up correctly") return 0 --- 32,36 ---- self.object = object def OnOpenDocument (self, name): ! raise RuntimeError("Should not be called if template strings set up correctly") return 0 |
From: Mark H. <mha...@us...> - 2008-10-23 09:49:38
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/Demos/app In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8245/Pythonwin/pywin/Demos/app Modified Files: Tag: py3k helloapp.py Log Message: merge various py3k friendly changes from the trunk. Index: helloapp.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/Demos/app/helloapp.py,v retrieving revision 1.1.4.1 retrieving revision 1.1.4.2 diff -C2 -d -r1.1.4.1 -r1.1.4.2 *** helloapp.py 29 Aug 2008 06:16:05 -0000 1.1.4.1 --- helloapp.py 23 Oct 2008 09:45:16 -0000 1.1.4.2 *************** *** 15,19 **** import win32con import win32ui ! from pywin.mfc import window, dialog, thread, afxres # The main frame. --- 15,20 ---- import win32con import win32ui ! from pywin.mfc import window, dialog, afxres ! from pywin.mfc.thread import WinApp # The main frame. *************** *** 33,37 **** # The application object itself. ! class HelloApp(_thread.WinApp): def InitInstance(self): --- 34,38 ---- # The application object itself. ! class HelloApp(WinApp): def InitInstance(self): |
From: Mark H. <mha...@us...> - 2008-10-23 09:47:59
|
Update of /cvsroot/pywin32/pywin32/win32/Demos/win32wnet In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8245/win32/Demos/win32wnet Modified Files: Tag: py3k testwnet.py Log Message: merge various py3k friendly changes from the trunk. Index: testwnet.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/win32wnet/testwnet.py,v retrieving revision 1.2.4.1 retrieving revision 1.2.4.2 diff -C2 -d -r1.2.4.1 -r1.2.4.2 *** testwnet.py 29 Aug 2008 04:59:25 -0000 1.2.4.1 --- testwnet.py 23 Oct 2008 09:45:16 -0000 1.2.4.2 *************** *** 27,31 **** win32wnet.WNetCloseEnum(k) # could do k.Close(), but this is a good test! except win32wnet.error as details: ! print(indent + "Couldn't enumerate this resource: " + details[2]) def TestOpenEnum(): --- 27,31 ---- win32wnet.WNetCloseEnum(k) # could do k.Close(), but this is a good test! except win32wnet.error as details: ! print(indent + "Couldn't enumerate this resource: " + details.strerror) def TestOpenEnum(): *************** *** 49,53 **** win32wnet.WNetAddConnection2(share.dwType, localName, share.lpRemoteName) except win32wnet.error as details: ! print("Couldn't connect: " + details[2]) continue # Have a connection. --- 49,53 ---- win32wnet.WNetAddConnection2(share.dwType, localName, share.lpRemoteName) except win32wnet.error as details: ! print("Couldn't connect: " + details.strerror) continue # Have a connection. *************** *** 57,61 **** print("Universal name of '%s' is '%s'" % (fname, win32wnet.WNetGetUniversalName(fname))) except win32wnet.error as details: ! print("Couldn't get universal name of '%s': %s" % (fname, details[2])) print("User name for this connection is", win32wnet.WNetGetUser(localName)) finally: --- 57,61 ---- print("Universal name of '%s' is '%s'" % (fname, win32wnet.WNetGetUniversalName(fname))) except win32wnet.error as details: ! print("Couldn't get universal name of '%s': %s" % (fname, details.strerror)) print("User name for this connection is", win32wnet.WNetGetUser(localName)) finally: |
From: Mark H. <mha...@us...> - 2008-10-23 09:47:59
|
Update of /cvsroot/pywin32/pywin32/win32/Demos/service In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8245/win32/Demos/service Modified Files: Tag: py3k pipeTestServiceClient.py Log Message: merge various py3k friendly changes from the trunk. Index: pipeTestServiceClient.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/service/pipeTestServiceClient.py,v retrieving revision 1.3.4.1 retrieving revision 1.3.4.2 diff -C2 -d -r1.3.4.1 -r1.3.4.2 *** pipeTestServiceClient.py 29 Aug 2008 04:59:25 -0000 1.3.4.1 --- pipeTestServiceClient.py 23 Oct 2008 09:45:16 -0000 1.3.4.2 *************** *** 38,48 **** try: return fn(*args) ! except win32api.error as xxx_todo_changeme: ! (rc, fnerr, msg) = xxx_todo_changeme.args ! if rc==winerror.ERROR_PIPE_BUSY: win32api.Sleep(5000) continue else: ! raise win32api.error(rc, fnerr, msg) raise RuntimeError("Could not make a connection to the server") --- 38,47 ---- try: return fn(*args) ! except win32api.error as exc: ! if exc.winerror==winerror.ERROR_PIPE_BUSY: win32api.Sleep(5000) continue else: ! raise raise RuntimeError("Could not make a connection to the server") *************** *** 67,71 **** try: try: ! for i in range(numMessages): r = CallPipe(CallNamedPipe, ("\\\\%s\\pipe\\PyPipeTest" % server, "#" * 512, 1024, NMPWAIT_WAIT_FOREVER)) except: --- 66,70 ---- try: try: ! for i in xrange(numMessages): r = CallPipe(CallNamedPipe, ("\\\\%s\\pipe\\PyPipeTest" % server, "#" * 512, 1024, NMPWAIT_WAIT_FOREVER)) except: *************** *** 78,82 **** import _thread thread_waits = [] ! for t_num in range(numThreads): # Note I could just wait on thread handles (after calling DuplicateHandle) # See the service itself for an example of waiting for the clients... --- 77,81 ---- import _thread thread_waits = [] ! for t_num in xrange(numThreads): # Note I could just wait on thread handles (after calling DuplicateHandle) # See the service itself for an example of waiting for the clients... |
From: Mark H. <mha...@us...> - 2008-10-23 09:47:59
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/debugger In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8245/Pythonwin/pywin/debugger Modified Files: Tag: py3k __init__.py dbgcon.py Log Message: merge various py3k friendly changes from the trunk. Index: dbgcon.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/debugger/dbgcon.py,v retrieving revision 1.1.4.1 retrieving revision 1.1.4.2 diff -C2 -d -r1.1.4.1 -r1.1.4.2 *** dbgcon.py 29 Aug 2008 06:16:41 -0000 1.1.4.1 --- dbgcon.py 23 Oct 2008 09:45:16 -0000 1.1.4.2 *************** *** 25,28 **** def SaveDebuggerOptions(opts): ! for key, val in list(opts.items()): win32ui.WriteProfileVal("Debugger Options", key, val) --- 25,28 ---- def SaveDebuggerOptions(opts): ! for key, val in opts.iteritems(): win32ui.WriteProfileVal("Debugger Options", key, val) Index: __init__.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/debugger/__init__.py,v retrieving revision 1.5.4.1 retrieving revision 1.5.4.2 diff -C2 -d -r1.5.4.1 -r1.5.4.2 *** __init__.py 29 Aug 2008 06:16:41 -0000 1.5.4.1 --- __init__.py 23 Oct 2008 09:45:16 -0000 1.5.4.2 *************** *** 13,17 **** if isInprocApp: # MAY Need it - may already have one ! need = ("pywin.debugger.dbgpyapp" in sys.modules)==0 else: need = 0 --- 13,17 ---- if isInprocApp: # MAY Need it - may already have one ! need = "pywin.debugger.dbgpyapp" not in sys.modules else: need = 0 |
From: Mark H. <mha...@us...> - 2008-10-23 09:46:19
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8245/win32/test Modified Files: Tag: py3k test_win32file.py Log Message: merge various py3k friendly changes from the trunk. Index: test_win32file.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_win32file.py,v retrieving revision 1.13.2.2 retrieving revision 1.13.2.3 diff -C2 -d -r1.13.2.2 -r1.13.2.3 *** test_win32file.py 3 Oct 2008 01:09:55 -0000 1.13.2.2 --- test_win32file.py 23 Oct 2008 09:45:16 -0000 1.13.2.3 *************** *** 231,236 **** win32file.CreateIoCompletionPort(handle, port, 1, 0) ! thread = threading.Thread(target=self._IOCPServerThread, args=(handle,port, test_overlapped_death)) ! thread.start() try: time.sleep(0.1) # let thread do its thing. --- 231,236 ---- win32file.CreateIoCompletionPort(handle, port, 1, 0) ! t = threading.Thread(target=self._IOCPServerThread, args=(handle,port, test_overlapped_death)) ! t.start() try: time.sleep(0.1) # let thread do its thing. *************** *** 243,247 **** finally: handle.Close() ! thread.join() def testCompletionPortsNonQueuedBadReference(self): --- 243,247 ---- finally: handle.Close() ! t.join() def testCompletionPortsNonQueuedBadReference(self): |
From: Mark H. <mha...@us...> - 2008-10-23 09:46:19
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8245/win32/Lib Modified Files: Tag: py3k regcheck.py regutil.py Log Message: merge various py3k friendly changes from the trunk. Index: regutil.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/regutil.py,v retrieving revision 1.3.4.1 retrieving revision 1.3.4.2 diff -C2 -d -r1.3.4.1 -r1.3.4.2 *** regutil.py 29 Aug 2008 04:59:25 -0000 1.3.4.1 --- regutil.py 23 Oct 2008 09:45:16 -0000 1.3.4.2 *************** *** 90,98 **** try: win32api.RegDeleteKey(GetRootKey(), GetAppPathsKey() + "\\" + exeAlias) ! except win32api.error as xxx_todo_changeme: ! (code, fn, details) = xxx_todo_changeme.args from . import winerror ! if code!=winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error(code, fn, desc) return --- 90,97 ---- try: win32api.RegDeleteKey(GetRootKey(), GetAppPathsKey() + "\\" + exeAlias) ! except win32api.error as exc: from . import winerror ! if exc.winerror!=winerror.ERROR_FILE_NOT_FOUND: ! raise return *************** *** 110,118 **** try: win32api.RegDeleteKey(GetRootKey(), keyStr) ! except win32api.error as xxx_todo_changeme1: ! (code, fn, details) = xxx_todo_changeme1.args from . import winerror ! if code!=winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error(code, fn, desc) return --- 109,116 ---- try: win32api.RegDeleteKey(GetRootKey(), keyStr) ! except win32api.error as exc: from . import winerror ! if exc.winerror!=winerror.ERROR_FILE_NOT_FOUND: ! raise return *************** *** 124,132 **** try: return win32api.RegQueryValue(GetRootKey(), keyStr) ! except win32api.error as xxx_todo_changeme2: ! (code, fn, details) = xxx_todo_changeme2.args from . import winerror ! if code!=winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error(code, fn, details) return None --- 122,129 ---- try: return win32api.RegQueryValue(GetRootKey(), keyStr) ! except win32api.error as exc: from . import winerror ! if exc.winerror!=winerror.ERROR_FILE_NOT_FOUND: ! raise return None *************** *** 157,165 **** win32api.RegDeleteKey(GetRootKey(), BuildDefaultPythonKey() + "\\Modules\\%s" % modName) ! except win32api.error as xxx_todo_changeme3: ! (code, fn, desc) = xxx_todo_changeme3.args from . import winerror ! if code!=winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error(code, fn, desc) def GetRegisteredHelpFile(helpDesc): --- 154,161 ---- win32api.RegDeleteKey(GetRootKey(), BuildDefaultPythonKey() + "\\Modules\\%s" % modName) ! except win32api.error as exc: from . import winerror ! if exc.winerror!=winerror.ERROR_FILE_NOT_FOUND: ! raise def GetRegisteredHelpFile(helpDesc): *************** *** 206,214 **** try: win32api.RegDeleteValue(key, helpFile) ! except win32api.error as xxx_todo_changeme4: ! (code, fn, desc) = xxx_todo_changeme4.args from . import winerror ! if code!=winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error(code, fn, desc) finally: win32api.RegCloseKey(key) --- 202,209 ---- try: win32api.RegDeleteValue(key, helpFile) ! except win32api.error as exc: from . import winerror ! if exc.winerror!=winerror.ERROR_FILE_NOT_FOUND: ! raise finally: win32api.RegCloseKey(key) *************** *** 219,227 **** win32api.RegDeleteKey(GetRootKey(), BuildDefaultPythonKey() + "\\Help\\%s" % helpDesc) ! except win32api.error as xxx_todo_changeme5: ! (code, fn, desc) = xxx_todo_changeme5.args from . import winerror ! if code!=winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error(code, fn, desc) def RegisterCoreDLL(coredllName = None): --- 214,221 ---- win32api.RegDeleteKey(GetRootKey(), BuildDefaultPythonKey() + "\\Help\\%s" % helpDesc) ! except win32api.error as exc: from . import winerror ! if exc.winerror!=winerror.ERROR_FILE_NOT_FOUND: ! raise def RegisterCoreDLL(coredllName = None): Index: regcheck.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/regcheck.py,v retrieving revision 1.6.2.1 retrieving revision 1.6.2.2 diff -C2 -d -r1.6.2.1 -r1.6.2.2 *** regcheck.py 29 Aug 2008 04:59:25 -0000 1.6.2.1 --- regcheck.py 23 Oct 2008 09:45:16 -0000 1.6.2.2 *************** *** 32,38 **** try: appPath = win32api.RegQueryValue(regutil.GetRootKey(), regutil.BuildDefaultPythonKey() + "\\PythonPath") ! except win32api.error as xxx_todo_changeme: ! (code, fn, desc) = xxx_todo_changeme.args ! print("** does not exist - ", desc) problem = CheckPathString(appPath) if problem: --- 32,37 ---- try: appPath = win32api.RegQueryValue(regutil.GetRootKey(), regutil.BuildDefaultPythonKey() + "\\PythonPath") ! except win32api.error as exc: ! print("** does not exist - ", exc.strerror) problem = CheckPathString(appPath) if problem: *************** *** 67,75 **** try: key = win32api.RegOpenKey(regutil.GetRootKey(), regutil.BuildDefaultPythonKey() + "\\Help", 0, win32con.KEY_READ) ! except win32api.error as xxx_todo_changeme1: ! (code, fn, details) = xxx_todo_changeme1.args from . import winerror ! if code!=winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error(code, fn, details) return --- 66,73 ---- try: key = win32api.RegOpenKey(regutil.GetRootKey(), regutil.BuildDefaultPythonKey() + "\\Help", 0, win32con.KEY_READ) ! except win32api.error as exc: from . import winerror ! if exc.winerror!=winerror.ERROR_FILE_NOT_FOUND: ! raise return *************** *** 88,96 **** print("** Help file %s does not exist" % helpFile) keyNo = keyNo + 1 ! except win32api.error as xxx_todo_changeme2: ! (code, fn, desc) = xxx_todo_changeme2.args from . import winerror ! if code!=winerror.ERROR_NO_MORE_ITEMS: ! raise win32api.error(code, fn, desc) break finally: --- 86,93 ---- print("** Help file %s does not exist" % helpFile) keyNo = keyNo + 1 ! except win32api.error as exc: from . import winerror ! if exc.winerror!=winerror.ERROR_NO_MORE_ITEMS: ! raise break finally: *************** *** 103,111 **** keyhandle = win32api.RegOpenKey(regutil.GetRootKey(), k) print("WARNING: 'Modules' registry entry is deprectated and evil!") ! except win32api.error as xxx_todo_changeme3: ! (code, fn, details) = xxx_todo_changeme3.args from . import winerror ! if code!=winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error(code, fn, details) return --- 100,107 ---- keyhandle = win32api.RegOpenKey(regutil.GetRootKey(), k) print("WARNING: 'Modules' registry entry is deprectated and evil!") ! except win32api.error as exc: from . import winerror ! if exc.strerror!=winerror.ERROR_FILE_NOT_FOUND: ! raise return |
From: Mark H. <mha...@us...> - 2008-10-23 07:39:23
|
Update of /cvsroot/pywin32/pywin32/win32/Demos/service In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv305/win32/Demos/service Modified Files: pipeTestServiceClient.py Log Message: various improvements and modernizations from py3k branch. Index: pipeTestServiceClient.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/service/pipeTestServiceClient.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** pipeTestServiceClient.py 1 Oct 2008 14:44:53 -0000 1.4 --- pipeTestServiceClient.py 23 Oct 2008 07:39:12 -0000 1.5 *************** *** 37,47 **** retryCount = retryCount + 1 try: ! return apply(fn, args) ! except win32api.error, (rc, fnerr, msg): ! if rc==winerror.ERROR_PIPE_BUSY: win32api.Sleep(5000) continue else: ! raise win32api.error(rc, fnerr, msg) raise RuntimeError("Could not make a connection to the server") --- 37,47 ---- retryCount = retryCount + 1 try: ! return fn(*args) ! except win32api.error, exc: ! if exc.winerror==winerror.ERROR_PIPE_BUSY: win32api.Sleep(5000) continue else: ! raise raise RuntimeError("Could not make a connection to the server") |
From: Mark H. <mha...@us...> - 2008-10-23 07:39:23
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv305/Pythonwin/pywin/framework Modified Files: mdi_pychecker.py Log Message: various improvements and modernizations from py3k branch. Index: mdi_pychecker.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/mdi_pychecker.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** mdi_pychecker.py 9 Aug 2008 16:47:07 -0000 1.2 --- mdi_pychecker.py 23 Oct 2008 07:39:12 -0000 1.3 *************** *** 99,103 **** dirs[sd] = None self.dirs = [] ! for d in dirs.keys(): self.dirs.append(d) --- 99,103 ---- dirs[sd] = None self.dirs = [] ! for d in dirs.iterkeys(): self.dirs.append(d) *************** *** 248,252 **** self.GetFirstView().Append('#Pychecker Run in '+self.dirpattern+' %s\n'%time.asctime()) if self.verbose: ! self.GetFirstView().Append('# ='+`self.dp.dirs`+'\n') self.GetFirstView().Append('# Files '+self.filpattern+'\n') self.GetFirstView().Append('# Options '+self.greppattern+'\n') --- 248,252 ---- self.GetFirstView().Append('#Pychecker Run in '+self.dirpattern+' %s\n'%time.asctime()) if self.verbose: ! self.GetFirstView().Append('# ='+repr(self.dp.dirs)+'\n') self.GetFirstView().Append('# Files '+self.filpattern+'\n') self.GetFirstView().Append('# Options '+self.greppattern+'\n') *************** *** 262,266 **** ##self.flist = glob.glob(self.dp[0]+'\\'+self.fplist[0]) import operator ! self.flist = reduce(operator.add, map(glob.glob,self.fplist) ) #import pywin.debugger;pywin.debugger.set_trace() self.startPycheckerRun() --- 262,266 ---- ##self.flist = glob.glob(self.dp[0]+'\\'+self.fplist[0]) import operator ! self.flist = reduce(operator.add, list(map(glob.glob,self.fplist)) ) #import pywin.debugger;pywin.debugger.set_trace() self.startPycheckerRun() *************** *** 327,331 **** line = lines[i] if self.pat.search(line) != None: ! self.GetFirstView().Append(f+'('+`i+1` + ') '+line) else: self.fndx = -1 --- 327,331 ---- line = lines[i] if self.pat.search(line) != None: ! self.GetFirstView().Append(f+'('+repr(i+1) + ') '+line) else: self.fndx = -1 *************** *** 349,353 **** def GetParams(self): ! return self.dirpattern+'\t'+self.filpattern+'\t'+self.greppattern+'\t'+`self.casesensitive`+'\t'+`self.recurse`+'\t'+`self.verbose` def OnSaveDocument(self, filename): --- 349,353 ---- def GetParams(self): ! return self.dirpattern+'\t'+self.filpattern+'\t'+self.greppattern+'\t'+repr(self.casesensitive)+'\t'+repr(self.recurse)+'\t'+repr(self.verbose) def OnSaveDocument(self, filename): *************** *** 557,561 **** items = items + newitems for item in items: ! win32api.WriteProfileVal(section, `i`, item, ini) i = i + 1 self.UpdateData(0) --- 557,561 ---- items = items + newitems for item in items: ! win32api.WriteProfileVal(section, repr(i), item, ini) i = i + 1 self.UpdateData(0) |
From: Mark H. <mha...@us...> - 2008-10-23 07:39:19
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv305/Pythonwin/pywin/framework/editor Modified Files: ModuleBrowser.py __init__.py Log Message: various improvements and modernizations from py3k branch. Index: __init__.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor/__init__.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** __init__.py 11 Mar 2000 00:52:46 -0000 1.2 --- __init__.py 23 Oct 2008 07:39:12 -0000 1.3 *************** *** 88,90 **** SetEditorOption(option, str(newValue)) ! from pywin.framework.editor.color.coloreditor import * --- 88,90 ---- SetEditorOption(option, str(newValue)) ! from pywin.framework.editor.color.coloreditor import editorTemplate Index: ModuleBrowser.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor/ModuleBrowser.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ModuleBrowser.py 3 Nov 2003 07:34:24 -0000 1.8 --- ModuleBrowser.py 23 Oct 2008 07:39:12 -0000 1.9 *************** *** 19,23 **** def GetSubList(self): ret = [] ! for item in self.clbrdata.values(): if item.__class__ != pyclbr.Class: # ie, it is a pyclbr Function instance (only introduced post 1.5.2) ret.append(HierListCLBRFunction( item ) ) --- 19,23 ---- def GetSubList(self): ret = [] ! for item in self.clbrdata.itervalues(): if item.__class__ != pyclbr.Class: # ie, it is a pyclbr Function instance (only introduced post 1.5.2) ret.append(HierListCLBRFunction( item ) ) *************** *** 77,81 **** r1.sort() r2=[] ! for meth, lineno in self.methods.items(): r2.append(HierListCLBRMethod(meth, self.file, lineno)) r2.sort() --- 77,81 ---- r1.sort() r2=[] ! for meth, lineno in self.methods.iteritems(): r2.append(HierListCLBRMethod(meth, self.file, lineno)) r2.sort() |
From: Mark H. <mha...@us...> - 2008-10-23 07:39:19
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv305/win32/Lib Modified Files: regcheck.py regutil.py Log Message: various improvements and modernizations from py3k branch. Index: regutil.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/regutil.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** regutil.py 1 Oct 2008 14:44:53 -0000 1.4 --- regutil.py 23 Oct 2008 07:39:12 -0000 1.5 *************** *** 88,95 **** try: win32api.RegDeleteKey(GetRootKey(), GetAppPathsKey() + "\\" + exeAlias) ! except win32api.error, (code, fn, details): import winerror ! if code!=winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error(code, fn, desc) return --- 88,95 ---- try: win32api.RegDeleteKey(GetRootKey(), GetAppPathsKey() + "\\" + exeAlias) ! except win32api.error, exc: import winerror ! if exc.winerror!=winerror.ERROR_FILE_NOT_FOUND: ! raise return *************** *** 107,114 **** try: win32api.RegDeleteKey(GetRootKey(), keyStr) ! except win32api.error, (code, fn, details): import winerror ! if code!=winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error(code, fn, desc) return --- 107,114 ---- try: win32api.RegDeleteKey(GetRootKey(), keyStr) ! except win32api.error, exc: import winerror ! if exc.winerror!=winerror.ERROR_FILE_NOT_FOUND: ! raise return *************** *** 120,127 **** try: return win32api.RegQueryValue(GetRootKey(), keyStr) ! except win32api.error, (code, fn, details): import winerror ! if code!=winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error(code, fn, details) return None --- 120,127 ---- try: return win32api.RegQueryValue(GetRootKey(), keyStr) ! except win32api.error, exc: import winerror ! if exc.winerror!=winerror.ERROR_FILE_NOT_FOUND: ! raise return None *************** *** 152,159 **** win32api.RegDeleteKey(GetRootKey(), BuildDefaultPythonKey() + "\\Modules\\%s" % modName) ! except win32api.error, (code, fn, desc): import winerror ! if code!=winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error(code, fn, desc) def GetRegisteredHelpFile(helpDesc): --- 152,159 ---- win32api.RegDeleteKey(GetRootKey(), BuildDefaultPythonKey() + "\\Modules\\%s" % modName) ! except win32api.error, exc: import winerror ! if exc.winerror!=winerror.ERROR_FILE_NOT_FOUND: ! raise def GetRegisteredHelpFile(helpDesc): *************** *** 200,207 **** try: win32api.RegDeleteValue(key, helpFile) ! except win32api.error, (code, fn, desc): import winerror ! if code!=winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error(code, fn, desc) finally: win32api.RegCloseKey(key) --- 200,207 ---- try: win32api.RegDeleteValue(key, helpFile) ! except win32api.error, exc: import winerror ! if exc.winerror!=winerror.ERROR_FILE_NOT_FOUND: ! raise finally: win32api.RegCloseKey(key) *************** *** 212,219 **** win32api.RegDeleteKey(GetRootKey(), BuildDefaultPythonKey() + "\\Help\\%s" % helpDesc) ! except win32api.error, (code, fn, desc): import winerror ! if code!=winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error(code, fn, desc) def RegisterCoreDLL(coredllName = None): --- 212,219 ---- win32api.RegDeleteKey(GetRootKey(), BuildDefaultPythonKey() + "\\Help\\%s" % helpDesc) ! except win32api.error, exc: import winerror ! if exc.winerror!=winerror.ERROR_FILE_NOT_FOUND: ! raise def RegisterCoreDLL(coredllName = None): Index: regcheck.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/regcheck.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** regcheck.py 1 Oct 2008 14:44:53 -0000 1.7 --- regcheck.py 23 Oct 2008 07:39:12 -0000 1.8 *************** *** 33,38 **** try: appPath = win32api.RegQueryValue(regutil.GetRootKey(), regutil.BuildDefaultPythonKey() + "\\PythonPath") ! except win32api.error, (code, fn, desc): ! print "** does not exist - ", desc problem = CheckPathString(appPath) if problem: --- 33,38 ---- try: appPath = win32api.RegQueryValue(regutil.GetRootKey(), regutil.BuildDefaultPythonKey() + "\\PythonPath") ! except win32api.error, exc: ! print "** does not exist - ", exc.strerror problem = CheckPathString(appPath) if problem: *************** *** 67,74 **** try: key = win32api.RegOpenKey(regutil.GetRootKey(), regutil.BuildDefaultPythonKey() + "\\Help", 0, win32con.KEY_READ) ! except win32api.error, (code, fn, details): import winerror ! if code!=winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error(code, fn, details) return --- 67,74 ---- try: key = win32api.RegOpenKey(regutil.GetRootKey(), regutil.BuildDefaultPythonKey() + "\\Help", 0, win32con.KEY_READ) ! except win32api.error, exc: import winerror ! if exc.winerror!=winerror.ERROR_FILE_NOT_FOUND: ! raise return *************** *** 87,94 **** print "** Help file %s does not exist" % helpFile keyNo = keyNo + 1 ! except win32api.error, (code, fn, desc): import winerror ! if code!=winerror.ERROR_NO_MORE_ITEMS: ! raise win32api.error(code, fn, desc) break finally: --- 87,94 ---- print "** Help file %s does not exist" % helpFile keyNo = keyNo + 1 ! except win32api.error, exc: import winerror ! if exc.winerror!=winerror.ERROR_NO_MORE_ITEMS: ! raise break finally: *************** *** 101,113 **** keyhandle = win32api.RegOpenKey(regutil.GetRootKey(), k) print "WARNING: 'Modules' registry entry is deprectated and evil!" ! except win32api.error, (code, fn, details): import winerror ! if code!=winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error(code, fn, details) return def CheckRegistry(verbose=0): # check the registered modules ! if verbose and os.environ.has_key('pythonpath'): print "Warning - PythonPath in environment - please check it!" # Check out all paths on sys.path --- 101,113 ---- keyhandle = win32api.RegOpenKey(regutil.GetRootKey(), k) print "WARNING: 'Modules' registry entry is deprectated and evil!" ! except win32api.error, exc: import winerror ! if exc.winerror!=winerror.ERROR_FILE_NOT_FOUND: ! raise return def CheckRegistry(verbose=0): # check the registered modules ! if verbose and 'pythonpath' in os.environ: print "Warning - PythonPath in environment - please check it!" # Check out all paths on sys.path |
From: Mark H. <mha...@us...> - 2008-10-23 07:39:19
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv305/win32/test Modified Files: test_win32file.py Log Message: various improvements and modernizations from py3k branch. Index: test_win32file.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_win32file.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** test_win32file.py 3 Oct 2008 01:03:56 -0000 1.14 --- test_win32file.py 23 Oct 2008 07:39:12 -0000 1.15 *************** *** 175,179 **** try: win32file.CloseHandle(hv) ! raise RuntimeError, "Expected close to fail!" except win32file.error, details: self.failUnlessEqual(details.winerror, winerror.ERROR_INVALID_HANDLE) --- 175,179 ---- try: win32file.CloseHandle(hv) ! raise RuntimeError("Expected close to fail!") except win32file.error, details: self.failUnlessEqual(details.winerror, winerror.ERROR_INVALID_HANDLE) |
From: Mark H. <mha...@us...> - 2008-10-23 07:39:19
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/Demos In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv305/Pythonwin/pywin/Demos Modified Files: dlgtest.py objdoc.py Log Message: various improvements and modernizations from py3k branch. Index: dlgtest.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/Demos/dlgtest.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dlgtest.py 1 Sep 1999 23:33:35 -0000 1.1 --- dlgtest.py 23 Oct 2008 07:39:11 -0000 1.2 *************** *** 82,86 **** # In this case, we are interested in BN_CLICKED messages. self.HookNotify(self.OnNotify, win32con.BN_CLICKED) - def OnNotify(self, std, extra): print "OnNotify", std, extra --- 82,85 ---- Index: objdoc.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/Demos/objdoc.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** objdoc.py 1 Oct 2008 14:44:52 -0000 1.2 --- objdoc.py 23 Oct 2008 07:39:11 -0000 1.3 *************** *** 32,36 **** self.object = object def OnOpenDocument (self, name): ! raise Runtime("Should not be called if template strings set up correctly") return 0 --- 32,36 ---- self.object = object def OnOpenDocument (self, name): ! raise RuntimeError("Should not be called if template strings set up correctly") return 0 |
From: Mark H. <mha...@us...> - 2008-10-23 07:39:19
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/Demos/app In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv305/Pythonwin/pywin/Demos/app Modified Files: helloapp.py Log Message: various improvements and modernizations from py3k branch. Index: helloapp.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/Demos/app/helloapp.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** helloapp.py 1 Sep 1999 23:33:39 -0000 1.1 --- helloapp.py 23 Oct 2008 07:39:11 -0000 1.2 *************** *** 15,19 **** import win32con import win32ui ! from pywin.mfc import window, dialog, thread, afxres # The main frame. --- 15,20 ---- import win32con import win32ui ! from pywin.mfc import window, dialog, afxres ! from pywin.mfc.thread import WinApp # The main frame. *************** *** 33,37 **** # The application object itself. ! class HelloApp(thread.WinApp): def InitInstance(self): --- 34,38 ---- # The application object itself. ! class HelloApp(WinApp): def InitInstance(self): |