Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src
In directory sc8-pr-cvs1:/tmp/cvs-serv23882
Modified Files:
PyIShellExtInit.cpp shell.cpp shell_pch.h
Added Files:
PyIBrowserFrameOptions.cpp PyIBrowserFrameOptions.h
PyIPersistFolder.cpp PyIPersistFolder.h PyIShellBrowser.cpp
PyIShellBrowser.h PyIShellView.cpp PyIShellView.h
Log Message:
Add ShellBrowser and ShellView interfaces
--- NEW FILE: PyIBrowserFrameOptions.cpp ---
// This file implements the IBrowserFrameOptions Interface and Gateway for Python.
// Generated by makegw.py
#include "shell_pch.h"
#include "PyIBrowserFrameOptions.h"
// @doc - This file contains autoduck documentation
// ---------------------------------------------------
//
// Interface Implementation
PyIBrowserFrameOptions::PyIBrowserFrameOptions(IUnknown *pdisp):
PyIUnknown(pdisp)
{
ob_type = &type;
}
PyIBrowserFrameOptions::~PyIBrowserFrameOptions()
{
}
/* static */ IBrowserFrameOptions *PyIBrowserFrameOptions::GetI(PyObject *self)
{
return (IBrowserFrameOptions *)PyIUnknown::GetI(self);
}
// @pymethod |PyIBrowserFrameOptions|GetFrameOptions|Description of GetFrameOptions.
PyObject *PyIBrowserFrameOptions::GetFrameOptions(PyObject *self, PyObject *args)
{
IBrowserFrameOptions *pIBFO = GetI(self);
if ( pIBFO == NULL )
return NULL;
int dwMask;
// @pyparm int|dwMask||Description for dwMask
if ( !PyArg_ParseTuple(args, "i:GetFrameOptions", &dwMask))
return NULL;
DWORD dwOptions;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pIBFO->GetFrameOptions( (BROWSERFRAMEOPTIONS )dwMask, &dwOptions );
PY_INTERFACE_POSTCALL;
return PyInt_FromLong(dwOptions);
}
// @object PyIBrowserFrameOptions|Description of the interface
static struct PyMethodDef PyIBrowserFrameOptions_methods[] =
{
{ "GetFrameOptions", PyIBrowserFrameOptions::GetFrameOptions, 1 }, // @pymeth GetFrameOptions|Description of GetFrameOptions
{ NULL }
};
PyComTypeObject PyIBrowserFrameOptions::type("PyIBrowserFrameOptions",
&PyIUnknown::type,
sizeof(PyIBrowserFrameOptions),
PyIBrowserFrameOptions_methods,
GET_PYCOM_CTOR(PyIBrowserFrameOptions));
// ---------------------------------------------------
//
// Gateway Implementation
STDMETHODIMP PyGBrowserFrameOptions::GetFrameOptions(
/* [in] */ BROWSERFRAMEOPTIONS dwMask,
/* [out] */ BROWSERFRAMEOPTIONS * pdwOptions)
{
PY_GATEWAY_METHOD;
PyObject *result;
HRESULT hr=InvokeViaPolicy("GetFrameOptions", &result, "i", dwMask);
if (FAILED(hr)) return hr;
if (PyInt_Check(result))
*pdwOptions = PyInt_AsLong(result);
Py_DECREF(result);
return hr;
}
--- NEW FILE: PyIBrowserFrameOptions.h ---
// This file declares the IBrowserFrameOptions Interface and Gateway for Python.
// Generated by makegw.py
// ---------------------------------------------------
//
// Interface Declaration
class PyIBrowserFrameOptions : public PyIUnknown
{
public:
MAKE_PYCOM_CTOR(PyIBrowserFrameOptions);
static IBrowserFrameOptions *GetI(PyObject *self);
static PyComTypeObject type;
// The Python methods
static PyObject *GetFrameOptions(PyObject *self, PyObject *args);
protected:
PyIBrowserFrameOptions(IUnknown *pdisp);
~PyIBrowserFrameOptions();
};
// ---------------------------------------------------
//
// Gateway Declaration
class PyGBrowserFrameOptions : public PyGatewayBase, public IBrowserFrameOptions
{
protected:
PyGBrowserFrameOptions(PyObject *instance) : PyGatewayBase(instance) { ; }
PYGATEWAY_MAKE_SUPPORT2(PyGBrowserFrameOptions, IBrowserFrameOptions, IID_IBrowserFrameOptions, PyGatewayBase)
// IBrowserFrameOptions
STDMETHOD(GetFrameOptions)(
BROWSERFRAMEOPTIONS dwMask,
BROWSERFRAMEOPTIONS * pdwOptions);
};
--- NEW FILE: PyIPersistFolder.cpp ---
// This file implements the IPersistFolder Interface and Gateway for Python.
// Generated by makegw.py
#include "shell_pch.h"
#include "PyIPersist.h"
#include "PyIPersistFolder.h"
// @doc - This file contains autoduck documentation
// ---------------------------------------------------
//
// Interface Implementation
PyIPersistFolder::PyIPersistFolder(IUnknown *pdisp):
PyIPersist(pdisp)
{
ob_type = &type;
}
PyIPersistFolder::~PyIPersistFolder()
{
}
/* static */ IPersistFolder *PyIPersistFolder::GetI(PyObject *self)
{
return (IPersistFolder *)PyIPersist::GetI(self);
}
// @pymethod |PyIPersistFolder|Initialize|Description of Initialize.
PyObject *PyIPersistFolder::Initialize(PyObject *self, PyObject *args)
{
IPersistFolder *pIPF = GetI(self);
if ( pIPF == NULL )
return NULL;
// @pyparm <o PyIDL>|pidl||Description for pidl
PyObject *obpidl;
LPITEMIDLIST pidl;
if ( !PyArg_ParseTuple(args, "O:Initialize", &obpidl) )
return NULL;
BOOL bPythonIsHappy = TRUE;
if (bPythonIsHappy && !PyObject_AsPIDL(obpidl, &pidl)) bPythonIsHappy = FALSE;
if (!bPythonIsHappy) return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pIPF->Initialize( pidl );
PyObject_FreePIDL(pidl);
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pIPF, IID_IPersistFolder );
Py_INCREF(Py_None);
return Py_None;
}
// @object PyIPersistFolder|Description of the interface
static struct PyMethodDef PyIPersistFolder_methods[] =
{
{ "Initialize", PyIPersistFolder::Initialize, 1 }, // @pymeth Initialize|Description of Initialize
{ NULL }
};
PyComTypeObject PyIPersistFolder::type("PyIPersistFolder",
&PyIPersist::type,
sizeof(PyIPersistFolder),
PyIPersistFolder_methods,
GET_PYCOM_CTOR(PyIPersistFolder));
// ---------------------------------------------------
//
// Gateway Implementation
STDMETHODIMP PyGPersistFolder::GetClassID(CLSID __RPC_FAR *pClassID) {return PyGPersist::GetClassID(pClassID);}
STDMETHODIMP PyGPersistFolder::Initialize(
/* [in] */ LPCITEMIDLIST pidl)
{
PY_GATEWAY_METHOD;
PyObject *obpidl;
obpidl = PyObject_FromPIDL(pidl, FALSE);
HRESULT hr=InvokeViaPolicy("Initialize", NULL, "O", obpidl);
Py_XDECREF(obpidl);
return hr;
}
--- NEW FILE: PyIPersistFolder.h ---
// This file declares the IPersistFolder Interface and Gateway for Python.
// Generated by makegw.py
// ---------------------------------------------------
//
// Interface Declaration
class PyIPersistFolder : public PyIPersist
{
public:
MAKE_PYCOM_CTOR(PyIPersistFolder);
static IPersistFolder *GetI(PyObject *self);
static PyComTypeObject type;
// The Python methods
static PyObject *Initialize(PyObject *self, PyObject *args);
protected:
PyIPersistFolder(IUnknown *pdisp);
~PyIPersistFolder();
};
// ---------------------------------------------------
//
// Gateway Declaration
class PyGPersistFolder : public PyGPersist, public IPersistFolder
{
protected:
PyGPersistFolder(PyObject *instance) : PyGPersist(instance) { ; }
PYGATEWAY_MAKE_SUPPORT2(PyGPersistFolder, IPersistFolder, IID_IPersistFolder, PyGPersist)
// IPersist
STDMETHOD(GetClassID)(
/* [out] */ CLSID __RPC_FAR *pClassID);
// IPersistFolder
STDMETHOD(Initialize)(
LPCITEMIDLIST pidl);
};
--- NEW FILE: PyIShellBrowser.cpp ---
// This file implements the IShellBrowser Interface and Gateway for Python.
// Generated by makegw.py
#include "shell_pch.h"
#include "PyIOleWindow.h"
#include "PyIShellBrowser.h"
// @doc - This file contains autoduck documentation
// ---------------------------------------------------
//
// Interface Implementation
PyIShellBrowser::PyIShellBrowser(IUnknown *pdisp):
PyIOleWindow(pdisp)
{
ob_type = &type;
}
PyIShellBrowser::~PyIShellBrowser()
{
}
/* static */ IShellBrowser *PyIShellBrowser::GetI(PyObject *self)
{
return (IShellBrowser *)PyIOleWindow::GetI(self);
}
/*
// @pymethod |PyIShellBrowser|InsertMenusSB|Description of InsertMenusSB.
PyObject *PyIShellBrowser::InsertMenusSB(PyObject *self, PyObject *args)
{
IShellBrowser *pISB = GetI(self);
if ( pISB == NULL )
return NULL;
// @pyparm int|hmenuShared||Description for hmenuShared
// *** The input argument lpMenuWidths of type "LPOLEMENUGROUPWIDTHS" was not processed ***
// Please check the conversion function is appropriate and exists!
LPOLEMENUGROUPWIDTHS lpMenuWidths;
PyObject *oblpMenuWidths;
// @pyparm <o PyLPOLEMENUGROUPWIDTHS>|lpMenuWidths||Description for lpMenuWidths
INT ihmenuShared;
HMENU hmenuShared;
if ( !PyArg_ParseTuple(args, "iO:InsertMenusSB", &ihmenuShared, &oblpMenuWidths) )
return NULL;
BOOL bPythonIsHappy = TRUE;
hmenuShared = ihmenuShared;
if (bPythonIsHappy && !PyObject_AsLPOLEMENUGROUPWIDTHS( oblpMenuWidths, &lpMenuWidths )) bPythonIsHappy = FALSE;
if (!bPythonIsHappy) return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pISB->InsertMenusSB( hmenuShared, lpMenuWidths );
PyObject_FreeLPOLEMENUGROUPWIDTHS(lpMenuWidths);
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pISB, IID_IShellBrowser );
// *** The output argument lpMenuWidths of type "LPOLEMENUGROUPWIDTHS" was not processed ***
// The type 'LPOLEMENUGROUPWIDTHS' (lpMenuWidths) is unknown.
Py_INCREF(Py_None);
return Py_None;
}
*/
// @pymethod |PyIShellBrowser|SetMenuSB|Description of SetMenuSB.
PyObject *PyIShellBrowser::SetMenuSB(PyObject *self, PyObject *args)
{
IShellBrowser *pISB = GetI(self);
if ( pISB == NULL )
return NULL;
// @pyparm int|hmenuShared||Description for hmenuShared
// @pyparm int|holemenuRes||Description for holemenuRes
// @pyparm HWND|hwndActiveObject||Description for hwndActiveObject
INT ihmenuShared;
INT iholemenuRes;
HMENU hmenuShared;
HOLEMENU holemenuRes;
HWND hwndActiveObject;
if ( !PyArg_ParseTuple(args, "iil:SetMenuSB", &ihmenuShared, &iholemenuRes, &hwndActiveObject) )
return NULL;
BOOL bPythonIsHappy = TRUE;
hmenuShared = (HMENU)ihmenuShared;
holemenuRes = (HOLEMENU)iholemenuRes;
if (!bPythonIsHappy) return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pISB->SetMenuSB( hmenuShared, holemenuRes, hwndActiveObject );
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pISB, IID_IShellBrowser );
Py_INCREF(Py_None);
return Py_None;
}
// @pymethod |PyIShellBrowser|RemoveMenusSB|Description of RemoveMenusSB.
PyObject *PyIShellBrowser::RemoveMenusSB(PyObject *self, PyObject *args)
{
IShellBrowser *pISB = GetI(self);
if ( pISB == NULL )
return NULL;
// @pyparm int|hmenuShared||Description for hmenuShared
INT ihmenuShared;
HMENU hmenuShared;
if ( !PyArg_ParseTuple(args, "i:RemoveMenusSB", &ihmenuShared) )
return NULL;
BOOL bPythonIsHappy = TRUE;
hmenuShared = (HMENU)ihmenuShared;
if (!bPythonIsHappy) return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pISB->RemoveMenusSB( hmenuShared );
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pISB, IID_IShellBrowser );
Py_INCREF(Py_None);
return Py_None;
}
// @pymethod |PyIShellBrowser|SetStatusTextSB|Description of SetStatusTextSB.
PyObject *PyIShellBrowser::SetStatusTextSB(PyObject *self, PyObject *args)
{
IShellBrowser *pISB = GetI(self);
if ( pISB == NULL )
return NULL;
// @pyparm <o unicode>|pszStatusText||Description for pszStatusText
PyObject *obpszStatusText;
LPOLESTR pszStatusText;
if ( !PyArg_ParseTuple(args, "O:SetStatusTextSB", &obpszStatusText) )
return NULL;
BOOL bPythonIsHappy = TRUE;
if (bPythonIsHappy && !PyWinObject_AsBstr(obpszStatusText, &pszStatusText)) bPythonIsHappy = FALSE;
if (!bPythonIsHappy) return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pISB->SetStatusTextSB( pszStatusText );
SysFreeString(pszStatusText);
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pISB, IID_IShellBrowser );
Py_INCREF(Py_None);
return Py_None;
}
// @pymethod |PyIShellBrowser|EnableModelessSB|Description of EnableModelessSB.
PyObject *PyIShellBrowser::EnableModelessSB(PyObject *self, PyObject *args)
{
IShellBrowser *pISB = GetI(self);
if ( pISB == NULL )
return NULL;
// @pyparm int|fEnable||Description for fEnable
BOOL fEnable;
if ( !PyArg_ParseTuple(args, "i:EnableModelessSB", &fEnable) )
return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pISB->EnableModelessSB( fEnable );
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pISB, IID_IShellBrowser );
Py_INCREF(Py_None);
return Py_None;
}
// @pymethod |PyIShellBrowser|TranslateAcceleratorSB|Description of TranslateAcceleratorSB.
PyObject *PyIShellBrowser::TranslateAcceleratorSB(PyObject *self, PyObject *args)
{
IShellBrowser *pISB = GetI(self);
if ( pISB == NULL )
return NULL;
// *** The input argument pmsg of type "MSG *" was not processed ***
// Please check the conversion function is appropriate and exists!
MSG msg;
PyObject *obpmsg;
// @pyparm <o PyMSG>|pmsg||Description for pmsg
// @pyparm int|wID||Description for wID
INT iwID;
WORD wID;
if ( !PyArg_ParseTuple(args, "Oi:TranslateAcceleratorSB", &obpmsg, &iwID) )
return NULL;
BOOL bPythonIsHappy = TRUE;
if (bPythonIsHappy && !PyObject_AsMSG( obpmsg, &msg )) bPythonIsHappy = FALSE;
wID = iwID;
if (!bPythonIsHappy) return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pISB->TranslateAcceleratorSB( &msg, wID );
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pISB, IID_IShellBrowser );
Py_INCREF(Py_None);
return Py_None;
}
// @pymethod |PyIShellBrowser|BrowseObject|Description of BrowseObject.
PyObject *PyIShellBrowser::BrowseObject(PyObject *self, PyObject *args)
{
IShellBrowser *pISB = GetI(self);
if ( pISB == NULL )
return NULL;
// @pyparm <o PyIDL>|pidl||Description for pidl
// @pyparm int|wFlags||Description for wFlags
PyObject *obpidl;
LPITEMIDLIST pidl;
UINT wFlags;
if ( !PyArg_ParseTuple(args, "Oi:BrowseObject", &obpidl, &wFlags) )
return NULL;
BOOL bPythonIsHappy = TRUE;
if (bPythonIsHappy && !PyObject_AsPIDL(obpidl, &pidl, FALSE)) bPythonIsHappy = FALSE;
if (!bPythonIsHappy) return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pISB->BrowseObject( pidl, wFlags );
PyObject_FreePIDL(pidl);
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pISB, IID_IShellBrowser );
Py_INCREF(Py_None);
return Py_None;
}
// @pymethod |PyIShellBrowser|GetViewStateStream|Description of GetViewStateStream.
PyObject *PyIShellBrowser::GetViewStateStream(PyObject *self, PyObject *args)
{
IShellBrowser *pISB = GetI(self);
if ( pISB == NULL )
return NULL;
// @pyparm int|grfMode||Description for grfMode
DWORD grfMode;
IStream * ppStrm;
if ( !PyArg_ParseTuple(args, "l:GetViewStateStream", &grfMode) )
return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pISB->GetViewStateStream( grfMode, &ppStrm );
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pISB, IID_IShellBrowser );
return PyCom_PyObjectFromIUnknown(ppStrm, IID_IStream, FALSE);
}
// @pymethod |PyIShellBrowser|GetControlWindow|Description of GetControlWindow.
PyObject *PyIShellBrowser::GetControlWindow(PyObject *self, PyObject *args)
{
IShellBrowser *pISB = GetI(self);
if ( pISB == NULL )
return NULL;
// @pyparm int|id||Description for id
UINT id;
if ( !PyArg_ParseTuple(args, "i:GetControlWindow", &id) )
return NULL;
HWND hwnd;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pISB->GetControlWindow( id, &hwnd );
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pISB, IID_IShellBrowser );
return PyLong_FromVoidPtr(hwnd);
}
// @pymethod |PyIShellBrowser|SendControlMsg|Description of SendControlMsg.
PyObject *PyIShellBrowser::SendControlMsg(PyObject *self, PyObject *args)
{
IShellBrowser *pISB = GetI(self);
if ( pISB == NULL )
return NULL;
// @pyparm int|id||Description for id
// @pyparm int|uMsg||Description for uMsg
// @pyparm int|wParam||Description for wParam
// @pyparm long|lParam||Description for lParam
UINT id;
UINT uMsg;
WPARAM wParam;
LPARAM lParam;
if ( !PyArg_ParseTuple(args, "iiil:SendControlMsg", &id, &uMsg, &wParam, &lParam) )
return NULL;
HRESULT hr;
LRESULT ret;
PY_INTERFACE_PRECALL;
hr = pISB->SendControlMsg( id, uMsg, wParam, lParam, &ret );
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pISB, IID_IShellBrowser );
return PyInt_FromLong(ret);
}
// @pymethod |PyIShellBrowser|QueryActiveShellView|Description of QueryActiveShellView.
PyObject *PyIShellBrowser::QueryActiveShellView(PyObject *self, PyObject *args)
{
IShellBrowser *pISB = GetI(self);
if ( pISB == NULL )
return NULL;
IShellView * ppshv;
if ( !PyArg_ParseTuple(args, ":QueryActiveShellView") )
return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pISB->QueryActiveShellView( &ppshv );
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pISB, IID_IShellBrowser );
return PyCom_PyObjectFromIUnknown(ppshv, IID_IShellView, FALSE);
}
// @pymethod |PyIShellBrowser|OnViewWindowActive|Description of OnViewWindowActive.
PyObject *PyIShellBrowser::OnViewWindowActive(PyObject *self, PyObject *args)
{
IShellBrowser *pISB = GetI(self);
if ( pISB == NULL )
return NULL;
// @pyparm <o PyIShellView>|pshv||Description for pshv
PyObject *obpshv;
IShellView *pshv;
if ( !PyArg_ParseTuple(args, "O:OnViewWindowActive", &obpshv) )
return NULL;
BOOL bPythonIsHappy = TRUE;
if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obpshv, IID_IShellView, (void **)&pshv, TRUE /* bNoneOK */))
bPythonIsHappy = FALSE;
if (!bPythonIsHappy) return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pISB->OnViewWindowActive( pshv );
if (pshv) pshv->Release();
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pISB, IID_IShellBrowser );
Py_INCREF(Py_None);
return Py_None;
}
/*
// @pymethod |PyIShellBrowser|SetToolbarItems|Description of SetToolbarItems.
PyObject *PyIShellBrowser::SetToolbarItems(PyObject *self, PyObject *args)
{
IShellBrowser *pISB = GetI(self);
if ( pISB == NULL )
return NULL;
// *** The input argument lpButtons of type "LPTBBUTTONSB" was not processed ***
// Please check the conversion function is appropriate and exists!
LPTBBUTTONSB lpButtons;
PyObject *oblpButtons;
// @pyparm <o PyLPTBBUTTONSB>|lpButtons||Description for lpButtons
// @pyparm int|nButtons||Description for nButtons
// @pyparm int|uFlags||Description for uFlags
UINT nButtons;
UINT uFlags;
if ( !PyArg_ParseTuple(args, "Oii:SetToolbarItems", &oblpButtons, &nButtons, &uFlags) )
return NULL;
BOOL bPythonIsHappy = TRUE;
if (bPythonIsHappy && !PyObject_AsLPTBBUTTONSB( oblpButtons, &lpButtons )) bPythonIsHappy = FALSE;
if (!bPythonIsHappy) return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pISB->SetToolbarItems( lpButtons, nButtons, uFlags );
PyObject_FreeLPTBBUTTONSB(lpButtons);
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pISB, IID_IShellBrowser );
Py_INCREF(Py_None);
return Py_None;
}
*/
// @object PyIShellBrowser|Description of the interface
static struct PyMethodDef PyIShellBrowser_methods[] =
{
// { "InsertMenusSB", PyIShellBrowser::InsertMenusSB, 1 }, // @pymeth InsertMenusSB|Description of InsertMenusSB
{ "SetMenuSB", PyIShellBrowser::SetMenuSB, 1 }, // @pymeth SetMenuSB|Description of SetMenuSB
{ "RemoveMenusSB", PyIShellBrowser::RemoveMenusSB, 1 }, // @pymeth RemoveMenusSB|Description of RemoveMenusSB
{ "SetStatusTextSB", PyIShellBrowser::SetStatusTextSB, 1 }, // @pymeth SetStatusTextSB|Description of SetStatusTextSB
{ "EnableModelessSB", PyIShellBrowser::EnableModelessSB, 1 }, // @pymeth EnableModelessSB|Description of EnableModelessSB
{ "TranslateAcceleratorSB", PyIShellBrowser::TranslateAcceleratorSB, 1 }, // @pymeth TranslateAcceleratorSB|Description of TranslateAcceleratorSB
{ "BrowseObject", PyIShellBrowser::BrowseObject, 1 }, // @pymeth BrowseObject|Description of BrowseObject
{ "GetViewStateStream", PyIShellBrowser::GetViewStateStream, 1 }, // @pymeth GetViewStateStream|Description of GetViewStateStream
{ "GetControlWindow", PyIShellBrowser::GetControlWindow, 1 }, // @pymeth GetControlWindow|Description of GetControlWindow
{ "SendControlMsg", PyIShellBrowser::SendControlMsg, 1 }, // @pymeth SendControlMsg|Description of SendControlMsg
{ "QueryActiveShellView", PyIShellBrowser::QueryActiveShellView, 1 }, // @pymeth QueryActiveShellView|Description of QueryActiveShellView
{ "OnViewWindowActive", PyIShellBrowser::OnViewWindowActive, 1 }, // @pymeth OnViewWindowActive|Description of OnViewWindowActive
// { "SetToolbarItems", PyIShellBrowser::SetToolbarItems, 1 }, // @pymeth SetToolbarItems|Description of SetToolbarItems
{ NULL }
};
PyComTypeObject PyIShellBrowser::type("PyIShellBrowser",
&PyIOleWindow::type,
sizeof(PyIShellBrowser),
PyIShellBrowser_methods,
GET_PYCOM_CTOR(PyIShellBrowser));
// ---------------------------------------------------
//
// Gateway Implementation
STDMETHODIMP PyGShellBrowser::GetWindow(HWND __RPC_FAR * phwnd) {return PyGOleWindow::GetWindow(phwnd);}
STDMETHODIMP PyGShellBrowser::ContextSensitiveHelp(BOOL fEnterMode) {return PyGOleWindow::ContextSensitiveHelp(fEnterMode);}
STDMETHODIMP PyGShellBrowser::InsertMenusSB(
/* [in] */ HMENU hmenuShared,
/* [out][in] */ LPOLEMENUGROUPWIDTHS lpMenuWidths)
{
PY_GATEWAY_METHOD;
// *** The input argument lpMenuWidths of type "LPOLEMENUGROUPWIDTHS" was not processed ***
// - Please ensure this conversion function exists, and is appropriate
// - The type 'LPOLEMENUGROUPWIDTHS' (lpMenuWidths) is unknown.
PyObject *oblpMenuWidths = Py_None; //PyObject_FromLPOLEMENUGROUPWIDTHS(lpMenuWidths);
Py_INCREF(Py_None);
if (oblpMenuWidths==NULL) return PyCom_HandlePythonFailureToCOM();
PyObject *result;
HRESULT hr=InvokeViaPolicy("InsertMenusSB", &result, "iO", hmenuShared, oblpMenuWidths);
Py_DECREF(oblpMenuWidths);
if (FAILED(hr)) return hr;
Py_DECREF(result);
return hr;
}
STDMETHODIMP PyGShellBrowser::SetMenuSB(
/* [in] */ HMENU hmenuShared,
/* [in] */ HOLEMENU holemenuRes,
/* [in] */ HWND hwndActiveObject)
{
PY_GATEWAY_METHOD;
HRESULT hr=InvokeViaPolicy("SetMenuSB", NULL, "iil", hmenuShared, holemenuRes, hwndActiveObject);
return hr;
}
STDMETHODIMP PyGShellBrowser::RemoveMenusSB(
/* [in] */ HMENU hmenuShared)
{
PY_GATEWAY_METHOD;
HRESULT hr=InvokeViaPolicy("RemoveMenusSB", NULL, "i", hmenuShared);
return hr;
}
STDMETHODIMP PyGShellBrowser::SetStatusTextSB(
/* [unique][in] */ LPCOLESTR pszStatusText)
{
PY_GATEWAY_METHOD;
PyObject *obpszStatusText;
obpszStatusText = MakeOLECHARToObj(pszStatusText);
HRESULT hr=InvokeViaPolicy("SetStatusTextSB", NULL, "O", obpszStatusText);
Py_XDECREF(obpszStatusText);
return hr;
}
STDMETHODIMP PyGShellBrowser::EnableModelessSB(
/* [in] */ BOOL fEnable)
{
PY_GATEWAY_METHOD;
HRESULT hr=InvokeViaPolicy("EnableModelessSB", NULL, "i", fEnable);
return hr;
}
STDMETHODIMP PyGShellBrowser::TranslateAcceleratorSB(
/* [in] */ MSG * pmsg,
/* [in] */ WORD wID)
{
PY_GATEWAY_METHOD;
PyObject *obpmsg = PyObject_FromMSG(pmsg);
if (obpmsg==NULL) return PyCom_HandlePythonFailureToCOM();
HRESULT hr=InvokeViaPolicy("TranslateAcceleratorSB", NULL, "Oi", obpmsg, wID);
Py_DECREF(obpmsg);
return hr;
}
STDMETHODIMP PyGShellBrowser::BrowseObject(
/* [in] */ LPCITEMIDLIST pidl,
/* [in] */ UINT wFlags)
{
PY_GATEWAY_METHOD;
PyObject *obpidl;
obpidl = PyObject_FromPIDL(pidl, FALSE);
HRESULT hr=InvokeViaPolicy("BrowseObject", NULL, "Oi", obpidl, wFlags);
Py_XDECREF(obpidl);
return hr;
}
STDMETHODIMP PyGShellBrowser::GetViewStateStream(
/* [in] */ DWORD grfMode,
/* [out] */ IStream ** ppStrm)
{
PY_GATEWAY_METHOD;
PyObject *result;
HRESULT hr=InvokeViaPolicy("GetViewStateStream", &result, "l", grfMode);
if (FAILED(hr)) return hr;
// Process the Python results, and convert back to the real params
PyObject *obppStrm;
if (!PyArg_Parse(result, "O" , &obppStrm)) return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
BOOL bPythonIsHappy = TRUE;
if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obppStrm, IID_IStream, (void **)ppStrm, TRUE /* bNoneOK */))
bPythonIsHappy = FALSE;
if (!bPythonIsHappy) hr = PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
Py_DECREF(result);
return hr;
}
STDMETHODIMP PyGShellBrowser::GetControlWindow(
/* [in] */ UINT id,
/* [out] */ HWND * phwnd)
{
PY_GATEWAY_METHOD;
PyObject *result;
HRESULT hr=InvokeViaPolicy("GetControlWindow", &result, "i", id);
if (FAILED(hr)) return hr;
// Process the Python results, and convert back to the real params
if (PyInt_Check(result) || PyLong_Check(result))
*phwnd = (HWND)PyInt_AsLong(result);
Py_DECREF(result);
return hr;
}
STDMETHODIMP PyGShellBrowser::SendControlMsg(
/* [in] */ UINT id,
/* [in] */ UINT uMsg,
/* [in] */ WPARAM wParam,
/* [in] */ LPARAM lParam,
/* [in] */ LRESULT * pret)
{
PY_GATEWAY_METHOD;
PyObject *result;
HRESULT hr=InvokeViaPolicy("SendControlMsg", &result, "iiil", id, uMsg, wParam, lParam);
if (PyInt_Check(result) || PyLong_Check(result))
*pret = PyInt_AsLong(result);
Py_DECREF(result);
return hr;
}
STDMETHODIMP PyGShellBrowser::QueryActiveShellView(
/* [out] */ IShellView ** ppshv)
{
PY_GATEWAY_METHOD;
PyObject *result;
HRESULT hr=InvokeViaPolicy("QueryActiveShellView", &result);
if (FAILED(hr)) return hr;
// Process the Python results, and convert back to the real params
PyObject *obppshv;
if (!PyArg_Parse(result, "O" , &obppshv)) return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
BOOL bPythonIsHappy = TRUE;
if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obppshv, IID_IShellView, (void **)ppshv, TRUE /* bNoneOK */))
bPythonIsHappy = FALSE;
if (!bPythonIsHappy) hr = PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
Py_DECREF(result);
return hr;
}
STDMETHODIMP PyGShellBrowser::OnViewWindowActive(
/* [in] */ IShellView * pshv)
{
PY_GATEWAY_METHOD;
PyObject *obpshv;
obpshv = PyCom_PyObjectFromIUnknown(pshv, IID_IShellView, TRUE);
HRESULT hr=InvokeViaPolicy("OnViewWindowActive", NULL, "O", obpshv);
Py_XDECREF(obpshv);
return hr;
}
STDMETHODIMP PyGShellBrowser::SetToolbarItems(
/* [in] */ LPTBBUTTONSB lpButtons,
/* [in] */ UINT nButtons,
/* [in] */ UINT uFlags)
{
PY_GATEWAY_METHOD;
// *** The input argument lpButtons of type "LPTBBUTTONSB" was not processed ***
// - Please ensure this conversion function exists, and is appropriate
// - The type 'LPTBBUTTONSB' (lpButtons) is unknown.
PyObject *oblpButtons = Py_None; //PyObject_FromLPTBBUTTONSB(lpButtons);
Py_INCREF(Py_None);
if (oblpButtons==NULL) return PyCom_HandlePythonFailureToCOM();
HRESULT hr=InvokeViaPolicy("SetToolbarItems", NULL, "Oii", oblpButtons, nButtons, uFlags);
Py_DECREF(oblpButtons);
return hr;
}
--- NEW FILE: PyIShellBrowser.h ---
// This file declares the IShellBrowser Interface and Gateway for Python.
// Generated by makegw.py
// ---------------------------------------------------
//
// Interface Declaration
class PyIShellBrowser : public PyIOleWindow
{
public:
MAKE_PYCOM_CTOR(PyIShellBrowser);
static IShellBrowser *GetI(PyObject *self);
static PyComTypeObject type;
// The Python methods
static PyObject *InsertMenusSB(PyObject *self, PyObject *args);
static PyObject *SetMenuSB(PyObject *self, PyObject *args);
static PyObject *RemoveMenusSB(PyObject *self, PyObject *args);
static PyObject *SetStatusTextSB(PyObject *self, PyObject *args);
static PyObject *EnableModelessSB(PyObject *self, PyObject *args);
static PyObject *TranslateAcceleratorSB(PyObject *self, PyObject *args);
static PyObject *BrowseObject(PyObject *self, PyObject *args);
static PyObject *GetViewStateStream(PyObject *self, PyObject *args);
static PyObject *GetControlWindow(PyObject *self, PyObject *args);
static PyObject *SendControlMsg(PyObject *self, PyObject *args);
static PyObject *QueryActiveShellView(PyObject *self, PyObject *args);
static PyObject *OnViewWindowActive(PyObject *self, PyObject *args);
static PyObject *SetToolbarItems(PyObject *self, PyObject *args);
protected:
PyIShellBrowser(IUnknown *pdisp);
~PyIShellBrowser();
};
// ---------------------------------------------------
//
// Gateway Declaration
class PyGShellBrowser : public PyGOleWindow, public IShellBrowser
{
protected:
PyGShellBrowser(PyObject *instance) : PyGOleWindow(instance) { ; }
PYGATEWAY_MAKE_SUPPORT2(PyGShellBrowser, IShellBrowser, IID_IShellBrowser, PyGOleWindow)
// IOleWindow
STDMETHOD(GetWindow)(
HWND __RPC_FAR * phwnd);
STDMETHOD(ContextSensitiveHelp)(
BOOL fEnterMode);
// IShellBrowser
STDMETHOD(InsertMenusSB)(
HMENU hmenuShared,
LPOLEMENUGROUPWIDTHS lpMenuWidths);
STDMETHOD(SetMenuSB)(
HMENU hmenuShared,
HOLEMENU holemenuRes,
HWND hwndActiveObject);
STDMETHOD(RemoveMenusSB)(
HMENU hmenuShared);
STDMETHOD(SetStatusTextSB)(
LPCOLESTR pszStatusText);
STDMETHOD(EnableModelessSB)(
BOOL fEnable);
STDMETHOD(TranslateAcceleratorSB)(
MSG * pmsg,
WORD wID);
STDMETHOD(BrowseObject)(
LPCITEMIDLIST pidl,
UINT wFlags);
STDMETHOD(GetViewStateStream)(
DWORD grfMode,
IStream ** ppStrm);
STDMETHOD(GetControlWindow)(
UINT id,
HWND * phwnd);
STDMETHOD(SendControlMsg)(
UINT id,
UINT uMsg,
WPARAM wParam,
LPARAM lParam,
LRESULT * pret);
STDMETHOD(QueryActiveShellView)(
IShellView ** ppshv);
STDMETHOD(OnViewWindowActive)(
IShellView * pshv);
STDMETHOD(SetToolbarItems)(
LPTBBUTTONSB lpButtons,
UINT nButtons,
UINT uFlags);
};
--- NEW FILE: PyIShellView.cpp ---
// This file implements the IShellView Interface and Gateway for Python.
// Generated by makegw.py
#include "shell_pch.h"
#include "PyIOleWindow.h"
#include "PyIShellView.h"
// @doc - This file contains autoduck documentation
// ---------------------------------------------------
//
// Interface Implementation
PyIShellView::PyIShellView(IUnknown *pdisp):
PyIOleWindow(pdisp)
{
ob_type = &type;
}
PyIShellView::~PyIShellView()
{
}
/* static */ IShellView *PyIShellView::GetI(PyObject *self)
{
return (IShellView *)PyIOleWindow::GetI(self);
}
// @pymethod |PyIShellView|TranslateAccelerator|Description of TranslateAccelerator.
PyObject *PyIShellView::TranslateAccelerator(PyObject *self, PyObject *args)
{
IShellView *pISV = GetI(self);
if ( pISV == NULL )
return NULL;
MSG msg;
PyObject *obpmsg;
// @pyparm tuple|pmsg||Description for pmsg
if ( !PyArg_ParseTuple(args, "O:TranslateAccelerator", &obpmsg) )
return NULL;
BOOL bPythonIsHappy = TRUE;
if (bPythonIsHappy && !PyObject_AsMSG( obpmsg, &msg )) bPythonIsHappy = FALSE;
if (!bPythonIsHappy) return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pISV->TranslateAccelerator( &msg );
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pISV, IID_IShellView );
return PyInt_FromLong(hr);
}
// @pymethod |PyIShellView|EnableModeless|Description of EnableModeless.
PyObject *PyIShellView::EnableModeless(PyObject *self, PyObject *args)
{
IShellView *pISV = GetI(self);
if ( pISV == 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 = pISV->EnableModeless( fEnable );
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pISV, IID_IShellView );
Py_INCREF(Py_None);
return Py_None;
}
// @pymethod |PyIShellView|UIActivate|Description of UIActivate.
PyObject *PyIShellView::UIActivate(PyObject *self, PyObject *args)
{
IShellView *pISV = GetI(self);
if ( pISV == NULL )
return NULL;
// @pyparm int|uState||Description for uState
UINT uState;
if ( !PyArg_ParseTuple(args, "i:UIActivate", &uState) )
return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pISV->UIActivate( uState );
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pISV, IID_IShellView );
Py_INCREF(Py_None);
return Py_None;
}
// @pymethod |PyIShellView|Refresh|Description of Refresh.
PyObject *PyIShellView::Refresh(PyObject *self, PyObject *args)
{
IShellView *pISV = GetI(self);
if ( pISV == NULL )
return NULL;
if ( !PyArg_ParseTuple(args, ":Refresh") )
return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pISV->Refresh( );
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pISV, IID_IShellView );
Py_INCREF(Py_None);
return Py_None;
}
// @pymethod |PyIShellView|CreateViewWindow|Description of CreateViewWindow.
PyObject *PyIShellView::CreateViewWindow(PyObject *self, PyObject *args)
{
IShellView *pISV = GetI(self);
if ( pISV == NULL )
return NULL;
// @pyparm <o PyIShellView>|psvPrevious||Description for psvPrevious
FOLDERSETTINGS fs;
PyObject *obpfs;
// @pyparm (int, int)|pfs||Description for pfs
// @pyparm <o PyIShellBrowser>|psb||Description for psb
RECT rcView;
PyObject *obprcView;
// @pyparm (int, int, int, int)|prcView||Description for prcView
PyObject *obpsvPrevious;
PyObject *obpsb;
IShellView *psvPrevious;
IShellBrowser *psb;
if ( !PyArg_ParseTuple(args, "OOOO:CreateViewWindow", &obpsvPrevious, &obpfs, &obpsb, &obprcView) )
return NULL;
BOOL bPythonIsHappy = TRUE;
if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obpsvPrevious, IID_IShellView, (void **)&psvPrevious, TRUE /* bNoneOK */))
bPythonIsHappy = FALSE;
if (bPythonIsHappy && !PyObject_AsFOLDERSETTINGS( obpfs, &fs )) bPythonIsHappy = FALSE;
if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obpsb, IID_IShellBrowser, (void **)&psb, TRUE /* bNoneOK */))
bPythonIsHappy = FALSE;
if (bPythonIsHappy && !PyObject_AsRECT( obprcView, &rcView )) bPythonIsHappy = FALSE;
if (!bPythonIsHappy) return NULL;
HWND hWnd;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pISV->CreateViewWindow( psvPrevious, &fs, psb, &rcView, &hWnd );
if (psvPrevious) psvPrevious->Release();
if (psb) psb->Release();
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pISV, IID_IShellView );
return PyLong_FromVoidPtr(hWnd);
}
// @pymethod |PyIShellView|DestroyViewWindow|Description of DestroyViewWindow.
PyObject *PyIShellView::DestroyViewWindow(PyObject *self, PyObject *args)
{
IShellView *pISV = GetI(self);
if ( pISV == NULL )
return NULL;
if ( !PyArg_ParseTuple(args, ":DestroyViewWindow") )
return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pISV->DestroyViewWindow( );
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pISV, IID_IShellView );
Py_INCREF(Py_None);
return Py_None;
}
// @pymethod |PyIShellView|GetCurrentInfo|Description of GetCurrentInfo.
PyObject *PyIShellView::GetCurrentInfo(PyObject *self, PyObject *args)
{
IShellView *pISV = GetI(self);
if ( pISV == NULL )
return NULL;
FOLDERSETTINGS fs;
if ( !PyArg_ParseTuple(args, ":GetCurrentInfo") )
return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pISV->GetCurrentInfo(&fs);
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pISV, IID_IShellView );
return PyObject_FromFOLDERSETTINGS(&fs);
}
/*
// @pymethod |PyIShellView|AddPropertySheetPages|Description of AddPropertySheetPages.
PyObject *PyIShellView::AddPropertySheetPages(PyObject *self, PyObject *args)
{
IShellView *pISV = GetI(self);
if ( pISV == NULL )
return NULL;
// @pyparm int|dwReserved||Description for dwReserved
// *** The input argument pfn of type "LPFNSVADDPROPSHEETPAGE" was not processed ***
// Please check the conversion function is appropriate and exists!
LPFNSVADDPROPSHEETPAGE pfn;
PyObject *obpfn;
// @pyparm <o PyLPFNSVADDPROPSHEETPAGE>|pfn||Description for pfn
// @pyparm long|lparam||Description for lparam
DWORD dwReserved;
LPARAM lparam;
if ( !PyArg_ParseTuple(args, "lOl:AddPropertySheetPages", &dwReserved, &obpfn, &lparam) )
return NULL;
BOOL bPythonIsHappy = TRUE;
if (bPythonIsHappy && !PyObject_AsLPFNSVADDPROPSHEETPAGE( obpfn, &pfn )) bPythonIsHappy = FALSE;
if (!bPythonIsHappy) return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pISV->AddPropertySheetPages( dwReserved, pfn, lparam );
PyObject_FreeLPFNSVADDPROPSHEETPAGE(pfn);
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pISV, IID_IShellView );
Py_INCREF(Py_None);
return Py_None;
}
*/
// @pymethod |PyIShellView|SaveViewState|Description of SaveViewState.
PyObject *PyIShellView::SaveViewState(PyObject *self, PyObject *args)
{
IShellView *pISV = GetI(self);
if ( pISV == NULL )
return NULL;
if ( !PyArg_ParseTuple(args, ":SaveViewState") )
return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pISV->SaveViewState( );
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pISV, IID_IShellView );
Py_INCREF(Py_None);
return Py_None;
}
// @pymethod |PyIShellView|SelectItem|Description of SelectItem.
PyObject *PyIShellView::SelectItem(PyObject *self, PyObject *args)
{
IShellView *pISV = GetI(self);
if ( pISV == NULL )
return NULL;
// @pyparm <o PyIDL>|pidlItem||Description for pidlItem
// @pyparm int|uFlags||Description for uFlags
PyObject *obpidlItem;
INT iuFlags;
LPITEMIDLIST pidlItem;
SVSIF uFlags;
if ( !PyArg_ParseTuple(args, "Oi:SelectItem", &obpidlItem, &iuFlags) )
return NULL;
BOOL bPythonIsHappy = TRUE;
if (bPythonIsHappy && !PyObject_AsPIDL(obpidlItem, &pidlItem)) bPythonIsHappy = FALSE;
uFlags = iuFlags;
if (!bPythonIsHappy) return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pISV->SelectItem( pidlItem, uFlags );
PyObject_FreePIDL(pidlItem);
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pISV, IID_IShellView );
Py_INCREF(Py_None);
return Py_None;
}
// @pymethod |PyIShellView|GetItemObject|Description of GetItemObject.
PyObject *PyIShellView::GetItemObject(PyObject *self, PyObject *args)
{
IShellView *pISV = GetI(self);
if ( pISV == NULL )
return NULL;
// @pyparm int|uItem||Description for uItem
// @pyparm <o PyIID>|riid||Description for riid
PyObject *obriid;
UINT uItem;
IID riid;
IUnknown *ppv;
if ( !PyArg_ParseTuple(args, "iO:GetItemObject", &uItem, &obriid) )
return NULL;
BOOL bPythonIsHappy = TRUE;
if (!PyWinObject_AsIID(obriid, &riid)) bPythonIsHappy = FALSE;
if (!bPythonIsHappy) return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pISV->GetItemObject( uItem, riid, (void **)&ppv );
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pISV, IID_IShellView );
PyObject *obppv;
obppv = PyCom_PyObjectFromIUnknown(ppv, riid, FALSE);
PyObject *pyretval = Py_BuildValue("O", obppv);
Py_XDECREF(obppv);
return pyretval;
}
// @object PyIShellView|Description of the interface
static struct PyMethodDef PyIShellView_methods[] =
{
{ "TranslateAccelerator", PyIShellView::TranslateAccelerator, 1 }, // @pymeth TranslateAccelerator|Description of TranslateAccelerator
{ "EnableModeless", PyIShellView::EnableModeless, 1 }, // @pymeth EnableModeless|Description of EnableModeless
{ "UIActivate", PyIShellView::UIActivate, 1 }, // @pymeth UIActivate|Description of UIActivate
{ "Refresh", PyIShellView::Refresh, 1 }, // @pymeth Refresh|Description of Refresh
{ "CreateViewWindow", PyIShellView::CreateViewWindow, 1 }, // @pymeth CreateViewWindow|Description of CreateViewWindow
{ "DestroyViewWindow", PyIShellView::DestroyViewWindow, 1 }, // @pymeth DestroyViewWindow|Description of DestroyViewWindow
{ "GetCurrentInfo", PyIShellView::GetCurrentInfo, 1 }, // @pymeth GetCurrentInfo|Description of GetCurrentInfo
// { "AddPropertySheetPages", PyIShellView::AddPropertySheetPages, 1 }, // @pymeth AddPropertySheetPages|Description of AddPropertySheetPages
{ "SaveViewState", PyIShellView::SaveViewState, 1 }, // @pymeth SaveViewState|Description of SaveViewState
{ "SelectItem", PyIShellView::SelectItem, 1 }, // @pymeth SelectItem|Description of SelectItem
{ "GetItemObject", PyIShellView::GetItemObject, 1 }, // @pymeth GetItemObject|Description of GetItemObject
{ NULL }
};
PyComTypeObject PyIShellView::type("PyIShellView",
&PyIOleWindow::type,
sizeof(PyIShellView),
PyIShellView_methods,
GET_PYCOM_CTOR(PyIShellView));
// ---------------------------------------------------
//
// Gateway Implementation
STDMETHODIMP PyGShellView::GetWindow(HWND __RPC_FAR * phwnd) {return PyGOleWindow::GetWindow(phwnd);}
STDMETHODIMP PyGShellView::ContextSensitiveHelp(BOOL fEnterMode) {return PyGOleWindow::ContextSensitiveHelp(fEnterMode);}
STDMETHODIMP PyGShellView::TranslateAccelerator(
/* [in] */ MSG * pmsg)
{
PY_GATEWAY_METHOD;
PyObject *obpmsg = PyObject_FromMSG(pmsg);
if (obpmsg==NULL) return PyCom_HandlePythonFailureToCOM();
PyObject *result;
HRESULT hr=InvokeViaPolicy("TranslateAccelerator", &result, "(O)", obpmsg);
Py_DECREF(obpmsg);
if (FAILED(hr)) return hr;
// Process the Python results, and convert back to the real params
if (PyInt_Check(result) || PyLong_Check(result))
hr = PyInt_AsLong(result);
Py_DECREF(result);
return hr;
}
STDMETHODIMP PyGShellView::EnableModeless(
/* [in] */ BOOL fEnable)
{
PY_GATEWAY_METHOD;
HRESULT hr=InvokeViaPolicy("EnableModeless", NULL, "i", fEnable);
return hr;
}
STDMETHODIMP PyGShellView::UIActivate(
/* [in] */ UINT uState)
{
PY_GATEWAY_METHOD;
HRESULT hr=InvokeViaPolicy("UIActivate", NULL, "i", uState);
return hr;
}
STDMETHODIMP PyGShellView::Refresh(
void)
{
PY_GATEWAY_METHOD;
HRESULT hr=InvokeViaPolicy("Refresh", NULL);
return hr;
}
STDMETHODIMP PyGShellView::CreateViewWindow(
/* [in] */ IShellView * psvPrevious,
/* [in] */ LPCFOLDERSETTINGS pfs,
/* [in] */ IShellBrowser * psb,
/* [out] */ RECT * prcView,
/* [out] */ HWND * phWnd)
{
PY_GATEWAY_METHOD;
PyObject *obpfs = PyObject_FromFOLDERSETTINGS(pfs);
if (obpfs==NULL) return PyCom_HandlePythonFailureToCOM();
PyObject *obrect = PyObject_FromRECT(prcView);
if (obrect==NULL) return PyCom_HandlePythonFailureToCOM();
PyObject *obpsvPrevious;
PyObject *obpsb;
obpsvPrevious = PyCom_PyObjectFromIUnknown(psvPrevious, IID_IShellView, TRUE);
obpsb = PyCom_PyObjectFromIUnknown(psb, IID_IShellBrowser, TRUE);
PyObject *result;
HRESULT hr=InvokeViaPolicy("CreateViewWindow", &result, "OOOO", obpsvPrevious, obpfs, obpsb, obrect);
Py_XDECREF(obpsvPrevious);
Py_DECREF(obpfs);
Py_XDECREF(obpsb);
Py_DECREF(obrect);
if (FAILED(hr)) return hr;
// Process the Python results, and convert back to the real params
if (PyInt_Check(result) || PyLong_Check(result))
*phWnd = (HWND)PyInt_AsLong(result);
Py_DECREF(result);
return hr;
}
STDMETHODIMP PyGShellView::DestroyViewWindow(
void)
{
PY_GATEWAY_METHOD;
HRESULT hr=InvokeViaPolicy("DestroyViewWindow", NULL);
return hr;
}
STDMETHODIMP PyGShellView::GetCurrentInfo(
/* [out] */ LPFOLDERSETTINGS pfs)
{
PY_GATEWAY_METHOD;
PyObject *result;
HRESULT hr=InvokeViaPolicy("GetCurrentInfo", &result);
if (FAILED(hr)) return hr;
// Process the Python results, and convert back to the real params
PyObject_AsFOLDERSETTINGS(result, pfs);
return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
}
STDMETHODIMP PyGShellView::AddPropertySheetPages(
/* [in] */ DWORD dwReserved,
/* [in] */ LPFNSVADDPROPSHEETPAGE pfn,
/* [in] */ LPARAM lparam)
{
PY_GATEWAY_METHOD;
// *** The input argument pfn of type "LPFNSVADDPROPSHEETPAGE" was not processed ***
// - Please ensure this conversion function exists, and is appropriate
// - The type 'LPFNSVADDPROPSHEETPAGE' (pfn) is unknown.
PyObject *obpfn = Py_None;
Py_INCREF(Py_None);
if (obpfn==NULL) return PyCom_HandlePythonFailureToCOM();
HRESULT hr=InvokeViaPolicy("AddPropertySheetPages", NULL, "lOl", dwReserved, obpfn, lparam);
Py_DECREF(obpfn);
return hr;
}
STDMETHODIMP PyGShellView::SaveViewState(
void)
{
PY_GATEWAY_METHOD;
HRESULT hr=InvokeViaPolicy("SaveViewState", NULL);
return hr;
}
STDMETHODIMP PyGShellView::SelectItem(
/* [in] */ LPCITEMIDLIST pidlItem,
/* [in] */ SVSIF uFlags)
{
PY_GATEWAY_METHOD;
PyObject *obpidlItem;
obpidlItem = PyObject_FromPIDL(pidlItem, FALSE);
HRESULT hr=InvokeViaPolicy("SelectItem", NULL, "Oi", obpidlItem, uFlags);
Py_XDECREF(obpidlItem);
return hr;
}
STDMETHODIMP PyGShellView::GetItemObject(
/* [in] */ UINT uItem,
/* [in] */ REFIID riid,
/* [iid_is][out] */ void ** ppv)
{
PY_GATEWAY_METHOD;
*ppv = NULL;
PyObject *obriid;
obriid = PyWinObject_FromIID(riid);
PyObject *result;
HRESULT hr=InvokeViaPolicy("GetItemObject", &result, "iO", uItem, obriid);
Py_XDECREF(obriid);
if (FAILED(hr)) return hr;
// Process the Python results, and convert back to the real params
PyObject *obppv;
if (!PyArg_Parse(result, "O" , &obppv)) return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
BOOL bPythonIsHappy = TRUE;
if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obppv, riid, ppv, FALSE/* bNoneOK */))
bPythonIsHappy = FALSE;
if (!bPythonIsHappy) hr = PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
Py_DECREF(result);
return hr;
}
--- NEW FILE: PyIShellView.h ---
// This file declares the IShellView Interface and Gateway for Python.
// Generated by makegw.py
// ---------------------------------------------------
//
// Interface Declaration
class PyIShellView : public PyIOleWindow
{
public:
MAKE_PYCOM_CTOR(PyIShellView);
static IShellView *GetI(PyObject *self);
static PyComTypeObject type;
// The Python methods
static PyObject *TranslateAccelerator(PyObject *self, PyObject *args);
static PyObject *EnableModeless(PyObject *self, PyObject *args);
static PyObject *UIActivate(PyObject *self, PyObject *args);
static PyObject *Refresh(PyObject *self, PyObject *args);
static PyObject *CreateViewWindow(PyObject *self, PyObject *args);
static PyObject *DestroyViewWindow(PyObject *self, PyObject *args);
static PyObject *GetCurrentInfo(PyObject *self, PyObject *args);
static PyObject *AddPropertySheetPages(PyObject *self, PyObject *args);
static PyObject *SaveViewState(PyObject *self, PyObject *args);
static PyObject *SelectItem(PyObject *self, PyObject *args);
static PyObject *GetItemObject(PyObject *self, PyObject *args);
protected:
PyIShellView(IUnknown *pdisp);
~PyIShellView();
};
// ---------------------------------------------------
//
// Gateway Declaration
class PyGShellView : public PyGOleWindow, public IShellView
{
protected:
PyGShellView(PyObject *instance) : PyGOleWindow(instance) { ; }
PYGATEWAY_MAKE_SUPPORT2(PyGShellView, IShellView, IID_IShellView, PyGOleWindow)
// IOleWindow
STDMETHOD(GetWindow)(
HWND __RPC_FAR * phwnd);
STDMETHOD(ContextSensitiveHelp)(
BOOL fEnterMode);
// IShellView
STDMETHOD(TranslateAccelerator)(
MSG * pmsg);
STDMETHOD(EnableModeless)(
BOOL fEnable);
STDMETHOD(UIActivate)(
UINT uState);
STDMETHOD(Refresh)(
void);
STDMETHOD(CreateViewWindow)(
IShellView * psvPrevious,
LPCFOLDERSETTINGS pfs,
IShellBrowser * psb,
RECT * prcView,
HWND * phWnd);
STDMETHOD(DestroyViewWindow)(
void);
STDMETHOD(GetCurrentInfo)(
LPFOLDERSETTINGS pfs);
STDMETHOD(AddPropertySheetPages)(
DWORD dwReserved,
LPFNSVADDPROPSHEETPAGE pfn,
LPARAM lparam);
STDMETHOD(SaveViewState)(
void);
STDMETHOD(SelectItem)(
LPCITEMIDLIST pidlItem,
SVSIF uFlags);
STDMETHOD(GetItemObject)(
UINT uItem,
REFIID riid,
void ** ppv);
};
Index: PyIShellExtInit.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIShellExtInit.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** PyIShellExtInit.cpp 6 Oct 2003 12:47:57 -0000 1.1
--- PyIShellExtInit.cpp 8 Oct 2003 23:34:41 -0000 1.2
***************
*** 32,36 ****
return NULL;
// @pyparm <o PyIDL>|pFolder||Description for pFolder
! // @pyparm <o PyIDataObject *>|pDataObject||Description for pDataObject
// @pyparm <o PyHANDLE>|hkey||Description for hkey
PyObject *obpFolder;
--- 32,36 ----
return NULL;
// @pyparm <o PyIDL>|pFolder||Description for pFolder
! // @pyparm <o PyIDataObject>|pDataObject||Description for pDataObject
// @pyparm <o PyHANDLE>|hkey||Description for hkey
PyObject *obpFolder;
Index: shell.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/shell.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** shell.cpp 7 Oct 2003 05:13:22 -0000 1.8
--- shell.cpp 8 Oct 2003 23:34:41 -0000 1.9
***************
*** 21,24 ****
--- 21,31 ----
#include "PyIEnumIDList.h"
#include "PyICopyHook.h"
+ #include "PyIOleWindow.h"
+ #include "PyIShellView.h"
+ #include "PyIShellBrowser.h"
+ #include "PyIBrowserFrameOptions.h"
+ #include "PyIPersist.h"
+ #include "PyIPersistFolder.h"
+
#include "PythonCOMRegister.h" // For simpler registration of IIDs etc.
***************
*** 253,256 ****
--- 260,290 ----
}
+ BOOL PyObject_AsMSG( PyObject *obpmsg, MSG *msg )
+ {
+ return PyArg_ParseTuple(obpmsg, "iiiii(ii)", &msg->hwnd,&msg->message,&msg->wParam,&msg->lParam,&msg->time,&msg->pt.x,&msg->pt.y);
+ }
+ PyObject *PyObject_FromMSG(const MSG *msg)
+ {
+ return Py_BuildValue("iiiii(ii)", msg->hwnd,msg->message,msg->wParam,msg->lParam,msg->time,msg->pt.x,msg->pt.y);
+ }
+
+ BOOL PyObject_AsFOLDERSETTINGS( PyObject *ob, FOLDERSETTINGS *pf)
+ {
+ return PyArg_ParseTuple(ob, "ii", &pf->ViewMode, &pf->fFlags);
+ }
+ PyObject *PyObject_FromFOLDERSETTINGS( const FOLDERSETTINGS *pf)
+ {
+ return Py_BuildValue("ii", pf->ViewMode, pf->fFlags);
+ }
+
+ BOOL PyObject_AsRECT( PyObject *ob, RECT *r)
+ {
+ return PyArg_ParseTuple(ob, "iiii", &r->left, &r->top, &r->right, &r->bottom);
+ }
+ PyObject *PyObject_FromRECT(const RECT *r)
+ {
+ return Py_BuildValue("iiii", r->left, r->top, r->right, r->bottom);
+ }
+
//////////////////////////////////////////////////
//
***************
*** 669,673 ****
--- 703,711 ----
PYCOM_INTERFACE_FULL(ShellExtInit),
PYCOM_INTERFACE_FULL(ShellFolder),
+ PYCOM_INTERFACE_FULL(ShellView),
+ PYCOM_INTERFACE_FULL(ShellBrowser),
PYCOM_INTERFACE_FULL(EnumIDList),
+ PYCOM_INTERFACE_FULL(BrowserFrameOptions),
+ PYCOM_INTERFACE_FULL(PersistFolder),
// IID_ICopyHook doesn't exist - hack it up
{ &IID_IShellCopyHook, "IShellCopyHook", "IID_IShellCopyHook", &PyICopyHook::type, GET_PYGATEWAY_CTOR(PyGCopyHook) },
Index: shell_pch.h
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/shell_pch.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** shell_pch.h 6 Oct 2003 12:47:57 -0000 1.2
--- shell_pch.h 8 Oct 2003 23:34:41 -0000 1.3
***************
*** 24,25 ****
--- 24,34 ----
void PyObject_FreeSTRRET(STRRET &);
PyObject *PyObject_FromSTRRET(STRRET *pci, ITEMIDLIST *pidl, BOOL bFree);
+
+ BOOL PyObject_AsMSG( PyObject *obpmsg, MSG *msg );
+ PyObject *PyObject_FromMSG(const MSG *msg);
+
+ BOOL PyObject_AsFOLDERSETTINGS( PyObject *ob, FOLDERSETTINGS *pf);
+ PyObject *PyObject_FromFOLDERSETTINGS( const FOLDERSETTINGS *pf);
+
+ BOOL PyObject_AsRECT( PyObject *ob, RECT *r);
+ PyObject *PyObject_FromRECT(const RECT *r);
|