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*/);
|