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,
&pPtfContaine...
[truncated message content] |