Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26197/win32comext/shell/src
Modified Files:
shell.cpp
Added Files:
PyIShellIcon.cpp PyIShellIcon.h PyIShellIconOverlay.cpp
PyIShellIconOverlay.h PyIShellIconOverlayIdentifier.cpp
PyIShellIconOverlayIdentifier.h PyIShellIconOverlayManager.cpp
PyIShellIconOverlayManager.h
Log Message:
PyIShellIcon* interfaces added to win32com.shell.shell
--- NEW FILE: PyIShellIcon.h ---
// This file declares the IShellIcon Interface and Gateway for Python.
// Generated by makegw.py
// ---------------------------------------------------
//
// Interface Declaration
class PyIShellIcon : public PyIUnknown
{
public:
MAKE_PYCOM_CTOR(PyIShellIcon);
static IShellIcon *GetI(PyObject *self);
static PyComTypeObject type;
// The Python methods
static PyObject *GetIconOf(PyObject *self, PyObject *args);
protected:
PyIShellIcon(IUnknown *pdisp);
~PyIShellIcon();
};
// ---------------------------------------------------
//
// Gateway Declaration
class PyGShellIcon : public PyGatewayBase, public IShellIcon
{
protected:
PyGShellIcon(PyObject *instance) : PyGatewayBase(instance) { ; }
PYGATEWAY_MAKE_SUPPORT2(PyGShellIcon, IShellIcon, IID_IShellIcon, PyGatewayBase)
// IShellIcon
STDMETHOD(GetIconOf)(
LPCITEMIDLIST pidl,
UINT flags,
int __RPC_FAR * index);
};
--- NEW FILE: PyIShellIconOverlayIdentifier.cpp ---
// This file implements the IShellIconOverlayIdentifier Interface and Gateway for Python.
// Generated by makegw.py
#include "shell_pch.h"
#include "PyIShellIconOverlayIdentifier.h"
// @doc - This file contains autoduck documentation
// ---------------------------------------------------
//
// Interface Implementation
PyIShellIconOverlayIdentifier::PyIShellIconOverlayIdentifier(IUnknown *pdisp):
PyIUnknown(pdisp)
{
ob_type = &type;
}
PyIShellIconOverlayIdentifier::~PyIShellIconOverlayIdentifier()
{
}
/* static */ IShellIconOverlayIdentifier *PyIShellIconOverlayIdentifier::GetI(PyObject *self)
{
return (IShellIconOverlayIdentifier *)PyIUnknown::GetI(self);
}
// @pymethod |PyIShellIconOverlayIdentifier|IsMemberOf|Description of IsMemberOf.
PyObject *PyIShellIconOverlayIdentifier::IsMemberOf(PyObject *self, PyObject *args)
{
IShellIconOverlayIdentifier *pISIOI = GetI(self);
if ( pISIOI == NULL )
return NULL;
// @pyparm string/<o unicode>|path||Description for path
// @pyparm int|attrib||Description for attrib
PyObject *obpath;
LPWSTR path;
DWORD attrib;
if ( !PyArg_ParseTuple(args, "Ol:IsMemberOf", &obpath, &attrib) )
return NULL;
BOOL bPythonIsHappy = TRUE;
if (bPythonIsHappy && !PyWinObject_AsWCHAR(obpath, &path)) bPythonIsHappy = FALSE;
if (!bPythonIsHappy) return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pISIOI->IsMemberOf( path, attrib );
PyWinObject_FreeWCHAR(path);
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pISIOI, IID_IShellIconOverlayIdentifier );
Py_INCREF(Py_None);
return Py_None;
}
// @pymethod |PyIShellIconOverlayIdentifier|GetOverlayInfo|Description of GetOverlayInfo.
PyObject *PyIShellIconOverlayIdentifier::GetOverlayInfo(PyObject *self, PyObject *args)
{
IShellIconOverlayIdentifier *pISIOI = GetI(self);
if ( pISIOI == NULL )
return NULL;
WCHAR szIconFile[_MAX_PATH+1];
int pIndex;
DWORD pFlags;
if ( !PyArg_ParseTuple(args, ":GetOverlayInfo") )
return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pISIOI->GetOverlayInfo( szIconFile, sizeof(szIconFile)/sizeof(szIconFile[0]), &pIndex, &pFlags );
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pISIOI, IID_IShellIconOverlayIdentifier );
PyObject *obiconFile;
obiconFile = PyWinObject_FromWCHAR(szIconFile);
PyObject *pyretval = Py_BuildValue("Nii", obiconFile, pIndex, pFlags);
return pyretval;
}
// @pymethod |PyIShellIconOverlayIdentifier|GetPriority|Description of GetPriority.
PyObject *PyIShellIconOverlayIdentifier::GetPriority(PyObject *self, PyObject *args)
{
IShellIconOverlayIdentifier *pISIOI = GetI(self);
if ( pISIOI == NULL )
return NULL;
int pri;
if ( !PyArg_ParseTuple(args, ":GetPriority") )
return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pISIOI->GetPriority( &pri );
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pISIOI, IID_IShellIconOverlayIdentifier );
PyObject *pyretval = Py_BuildValue("i", pri);
return pyretval;
}
// @object PyIShellIconOverlayIdentifier|Description of the interface
static struct PyMethodDef PyIShellIconOverlayIdentifier_methods[] =
{
{ "IsMemberOf", PyIShellIconOverlayIdentifier::IsMemberOf, 1 }, // @pymeth IsMemberOf|Description of IsMemberOf
{ "GetOverlayInfo", PyIShellIconOverlayIdentifier::GetOverlayInfo, 1 }, // @pymeth GetOverlayInfo|Description of GetOverlayInfo
{ "GetPriority", PyIShellIconOverlayIdentifier::GetPriority, 1 }, // @pymeth GetPriority|Description of GetPriority
{ NULL }
};
PyComTypeObject PyIShellIconOverlayIdentifier::type("PyIShellIconOverlayIdentifier",
&PyIUnknown::type,
sizeof(PyIShellIconOverlayIdentifier),
PyIShellIconOverlayIdentifier_methods,
GET_PYCOM_CTOR(PyIShellIconOverlayIdentifier));
// ---------------------------------------------------
//
// Gateway Implementation
STDMETHODIMP PyGShellIconOverlayIdentifier::IsMemberOf(
/* [unique][in] */ LPCWSTR path,
/* [unique][in] */ DWORD attrib)
{
PY_GATEWAY_METHOD;
PyObject *obpath;
obpath = PyWinObject_FromWCHAR(path);
PyObject *ret;
HRESULT hr=InvokeViaPolicy("IsMemberOf", &ret, "Ol", obpath, attrib);
if (FAILED(hr)) return hr;
if (PyInt_Check(ret))
hr = PyInt_AsLong(ret);
Py_XDECREF(ret);
return hr;
}
STDMETHODIMP PyGShellIconOverlayIdentifier::GetOverlayInfo(
LPWSTR iconFile,
int maxChars,
int __RPC_FAR * pIndex,
DWORD __RPC_FAR * pFlags)
{
PY_GATEWAY_METHOD;
PyObject *result;
HRESULT hr=InvokeViaPolicy("GetOverlayInfo", &result);
if (FAILED(hr)) return hr;
// Process the Python results, and convert back to the real params
PyObject *obiconFile;
if (!PyArg_ParseTuple(result, "Oii" , &obiconFile, pIndex, pFlags)) return PyCom_SetAndLogCOMErrorFromPyException("GetOverlayInfo", GetIID());
BOOL bPythonIsHappy = TRUE;
if (bPythonIsHappy) {
WCHAR *retIconFile;
if (PyWinObject_AsWCHAR(obiconFile, &retIconFile)) {
wcsncpy(iconFile, retIconFile, maxChars);
PyWinObject_FreeWCHAR(retIconFile);
} else
bPythonIsHappy = FALSE;
}
if (!bPythonIsHappy) hr = PyCom_SetAndLogCOMErrorFromPyException("GetOverlayInfo", GetIID());
Py_DECREF(result);
return hr;
}
STDMETHODIMP PyGShellIconOverlayIdentifier::GetPriority(
/* [unique][out] */ int __RPC_FAR * pri)
{
PY_GATEWAY_METHOD;
PyObject *result;
HRESULT hr=InvokeViaPolicy("GetPriority", &result);
if (FAILED(hr)) return hr;
// Process the Python results, and convert back to the real params
if (!PyArg_Parse(result, "i" , pri)) return PyCom_SetAndLogCOMErrorFromPyException("GetPriority", GetIID());
Py_DECREF(result);
return hr;
}
--- NEW FILE: PyIShellIcon.cpp ---
// This file implements the IShellIcon Interface and Gateway for Python.
// Generated by makegw.py
#include "shell_pch.h"
#include "PyIShellIcon.h"
// @doc - This file contains autoduck documentation
// ---------------------------------------------------
//
// Interface Implementation
PyIShellIcon::PyIShellIcon(IUnknown *pdisp):
PyIUnknown(pdisp)
{
ob_type = &type;
}
PyIShellIcon::~PyIShellIcon()
{
}
/* static */ IShellIcon *PyIShellIcon::GetI(PyObject *self)
{
return (IShellIcon *)PyIUnknown::GetI(self);
}
// @pymethod |PyIShellIcon|GetIconOf|Description of GetIconOf.
PyObject *PyIShellIcon::GetIconOf(PyObject *self, PyObject *args)
{
IShellIcon *pISI = GetI(self);
if ( pISI == NULL )
return NULL;
// @pyparm <o PyIDL>|pidl||Description for pidl
PyObject *obpidl;
LPITEMIDLIST pidl;
UINT flags;
int index;
if ( !PyArg_ParseTuple(args, "O:GetIconOf", &obpidl) )
return NULL;
BOOL bPythonIsHappy = TRUE;
if (bPythonIsHappy && !PyObject_AsPIDL(obpidl, &pidl)) bPythonIsHappy = FALSE;
if (!bPythonIsHappy) return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pISI->GetIconOf( pidl, flags, &index );
PyObject_FreePIDL(pidl);
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pISI, IID_IShellIcon );
PyObject *pyretval = Py_BuildValue("i", index);
return pyretval;
}
// @object PyIShellIcon|Description of the interface
static struct PyMethodDef PyIShellIcon_methods[] =
{
{ "GetIconOf", PyIShellIcon::GetIconOf, 1 }, // @pymeth GetIconOf|Description of GetIconOf
{ NULL }
};
PyComTypeObject PyIShellIcon::type("PyIShellIcon",
&PyIUnknown::type,
sizeof(PyIShellIcon),
PyIShellIcon_methods,
GET_PYCOM_CTOR(PyIShellIcon));
// ---------------------------------------------------
//
// Gateway Implementation
STDMETHODIMP PyGShellIcon::GetIconOf(
/* [unique][in] */ LPCITEMIDLIST pidl,
/* [int] */ UINT flags,
/* [unique][out] */ int __RPC_FAR * index)
{
PY_GATEWAY_METHOD;
PyObject *obpidl;
obpidl = PyObject_FromPIDL(pidl, FALSE);
PyObject *result;
HRESULT hr=InvokeViaPolicy("GetIconOf", &result, "O", obpidl);
Py_XDECREF(obpidl);
if (FAILED(hr)) return hr;
// Process the Python results, and convert back to the real params
if (!PyArg_Parse(result, "i" , index)) return PyCom_SetAndLogCOMErrorFromPyException("GetIconOf", GetIID());
Py_DECREF(result);
return hr;
}
Index: shell.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/shell.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** shell.cpp 16 Dec 2004 05:02:21 -0000 1.31
--- shell.cpp 25 Jan 2005 09:42:32 -0000 1.32
***************
*** 23,26 ****
--- 23,30 ----
#include "PyIOleWindow.h"
#include "PyIShellView.h"
+ #include "PyIShellIcon.h"
+ #include "PyIShellIconOverlay.h"
+ #include "PyIShellIconOverlayManager.h"
+ #include "PyIShellIconOverlayIdentifier.h"
#include "PyIShellBrowser.h"
#include "PyIBrowserFrameOptions.h"
***************
*** 1936,1940 ****
}
! // @pymethod <o PyIQueryAssociations|shell|AssocCreate|Creates a <o PyIQueryAssociations> object
static PyObject *PyAssocCreate(PyObject *self, PyObject *args)
{
--- 1940,1944 ----
}
! // @pymethod <o PyIQueryAssociations>|shell|AssocCreate|Creates a <o PyIQueryAssociations> object
static PyObject *PyAssocCreate(PyObject *self, PyObject *args)
{
***************
*** 2010,2013 ****
--- 2014,2021 ----
PYCOM_INTERFACE_FULL(ShellExtInit),
PYCOM_INTERFACE_FULL(ShellFolder),
+ PYCOM_INTERFACE_FULL(ShellIcon),
+ PYCOM_INTERFACE_FULL(ShellIconOverlay),
+ PYCOM_INTERFACE_FULL(ShellIconOverlayIdentifier),
+ PYCOM_INTERFACE_FULL(ShellIconOverlayManager),
PYCOM_INTERFACE_FULL(ShellView),
PYCOM_INTERFACE_FULL(ShellBrowser),
--- NEW FILE: PyIShellIconOverlay.cpp ---
// This file implements the IShellIconOverlay Interface and Gateway for Python.
// Generated by makegw.py
#include "shell_pch.h"
#include "PyIShellIconOverlay.h"
// @doc - This file contains autoduck documentation
// ---------------------------------------------------
//
// Interface Implementation
PyIShellIconOverlay::PyIShellIconOverlay(IUnknown *pdisp):
PyIUnknown(pdisp)
{
ob_type = &type;
}
PyIShellIconOverlay::~PyIShellIconOverlay()
{
}
/* static */ IShellIconOverlay *PyIShellIconOverlay::GetI(PyObject *self)
{
return (IShellIconOverlay *)PyIUnknown::GetI(self);
}
// @pymethod |PyIShellIconOverlay|GetOverlayIndex|Description of GetOverlayIndex.
PyObject *PyIShellIconOverlay::GetOverlayIndex(PyObject *self, PyObject *args)
{
IShellIconOverlay *pISIO = GetI(self);
if ( pISIO == NULL )
return NULL;
// @pyparm <o PyIDL>|pidl||Description for pidl
PyObject *obpidl;
LPITEMIDLIST pidl;
int index;
if ( !PyArg_ParseTuple(args, "O:GetOverlayIndex", &obpidl) )
return NULL;
BOOL bPythonIsHappy = TRUE;
if (bPythonIsHappy && !PyObject_AsPIDL(obpidl, &pidl)) bPythonIsHappy = FALSE;
if (!bPythonIsHappy) return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pISIO->GetOverlayIndex( pidl, &index );
PyObject_FreePIDL(pidl);
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pISIO, IID_IShellIconOverlay );
PyObject *pyretval = Py_BuildValue("i", index);
return pyretval;
}
// @pymethod |PyIShellIconOverlay|GetOverlayIconIndex|Description of GetOverlayIconIndex.
PyObject *PyIShellIconOverlay::GetOverlayIconIndex(PyObject *self, PyObject *args)
{
IShellIconOverlay *pISIO = GetI(self);
if ( pISIO == NULL )
return NULL;
// @pyparm <o PyIDL>|pidl||Description for pidl
PyObject *obpidl;
LPITEMIDLIST pidl;
int index;
if ( !PyArg_ParseTuple(args, "O:GetOverlayIconIndex", &obpidl) )
return NULL;
BOOL bPythonIsHappy = TRUE;
if (bPythonIsHappy && !PyObject_AsPIDL(obpidl, &pidl)) bPythonIsHappy = FALSE;
if (!bPythonIsHappy) return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pISIO->GetOverlayIconIndex( pidl, &index );
PyObject_FreePIDL(pidl);
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pISIO, IID_IShellIconOverlay );
PyObject *pyretval = Py_BuildValue("i", index);
return pyretval;
}
// @object PyIShellIconOverlay|Description of the interface
static struct PyMethodDef PyIShellIconOverlay_methods[] =
{
{ "GetOverlayIndex", PyIShellIconOverlay::GetOverlayIndex, 1 }, // @pymeth GetOverlayIndex|Description of GetOverlayIndex
{ "GetOverlayIconIndex", PyIShellIconOverlay::GetOverlayIconIndex, 1 }, // @pymeth GetOverlayIconIndex|Description of GetOverlayIconIndex
{ NULL }
};
PyComTypeObject PyIShellIconOverlay::type("PyIShellIconOverlay",
&PyIUnknown::type,
sizeof(PyIShellIconOverlay),
PyIShellIconOverlay_methods,
GET_PYCOM_CTOR(PyIShellIconOverlay));
// ---------------------------------------------------
//
// Gateway Implementation
STDMETHODIMP PyGShellIconOverlay::GetOverlayIndex(
/* [unique][in] */ LPCITEMIDLIST pidl,
/* [out] */ int __RPC_FAR * index)
{
PY_GATEWAY_METHOD;
PyObject *obpidl;
obpidl = PyObject_FromPIDL(pidl, FALSE);
PyObject *result;
HRESULT hr=InvokeViaPolicy("GetOverlayIndex", &result, "O", obpidl);
Py_XDECREF(obpidl);
if (FAILED(hr)) return hr;
// Process the Python results, and convert back to the real params
if (!PyArg_Parse(result, "i" , index)) return PyCom_SetAndLogCOMErrorFromPyException("GetOverlayIndex", GetIID());
Py_DECREF(result);
return hr;
}
STDMETHODIMP PyGShellIconOverlay::GetOverlayIconIndex(
/* [unique][in] */ LPCITEMIDLIST pidl,
/* [out] */ int __RPC_FAR * index)
{
PY_GATEWAY_METHOD;
PyObject *obpidl;
obpidl = PyObject_FromPIDL(pidl, FALSE);
PyObject *result;
HRESULT hr=InvokeViaPolicy("GetOverlayIconIndex", &result, "O", obpidl);
Py_XDECREF(obpidl);
if (FAILED(hr)) return hr;
// Process the Python results, and convert back to the real params
if (!PyArg_Parse(result, "i" , index)) return PyCom_SetAndLogCOMErrorFromPyException("GetOverlayIconIndex", GetIID());
Py_DECREF(result);
return hr;
}
--- NEW FILE: PyIShellIconOverlayIdentifier.h ---
// This file declares the IShellIconOverlayIdentifier Interface and Gateway for Python.
// Generated by makegw.py
// ---------------------------------------------------
//
// Interface Declaration
class PyIShellIconOverlayIdentifier : public PyIUnknown
{
public:
MAKE_PYCOM_CTOR(PyIShellIconOverlayIdentifier);
static IShellIconOverlayIdentifier *GetI(PyObject *self);
static PyComTypeObject type;
// The Python methods
static PyObject *IsMemberOf(PyObject *self, PyObject *args);
static PyObject *GetOverlayInfo(PyObject *self, PyObject *args);
static PyObject *GetPriority(PyObject *self, PyObject *args);
protected:
PyIShellIconOverlayIdentifier(IUnknown *pdisp);
~PyIShellIconOverlayIdentifier();
};
// ---------------------------------------------------
//
// Gateway Declaration
class PyGShellIconOverlayIdentifier : public PyGatewayBase, public IShellIconOverlayIdentifier
{
protected:
PyGShellIconOverlayIdentifier(PyObject *instance) : PyGatewayBase(instance) { ; }
PYGATEWAY_MAKE_SUPPORT2(PyGShellIconOverlayIdentifier, IShellIconOverlayIdentifier, IID_IShellIconOverlayIdentifier, PyGatewayBase)
// IShellIconOverlayIdentifier
STDMETHOD(IsMemberOf)(
LPCWSTR path,
DWORD attrib);
STDMETHOD(GetOverlayInfo)(
LPWSTR pwszIconFile, int cchMax, int * pIndex, DWORD * pdwFlags);
STDMETHOD(GetPriority)(
int __RPC_FAR * pri);
};
--- NEW FILE: PyIShellIconOverlayManager.h ---
// This file declares the IShellIconOverlayManager Interface and Gateway for Python.
// Generated by makegw.py
// ---------------------------------------------------
//
// Interface Declaration
class PyIShellIconOverlayManager : public PyIUnknown
{
public:
MAKE_PYCOM_CTOR(PyIShellIconOverlayManager);
static IShellIconOverlayManager *GetI(PyObject *self);
static PyComTypeObject type;
// The Python methods
static PyObject *GetFileOverlayInfo(PyObject *self, PyObject *args);
static PyObject *GetReservedOverlayInfo(PyObject *self, PyObject *args);
static PyObject *RefreshOverlayImages(PyObject *self, PyObject *args);
static PyObject *LoadNonloadedOverlayIdentifiers(PyObject *self, PyObject *args);
static PyObject *OverlayIndexFromImageIndex(PyObject *self, PyObject *args);
protected:
PyIShellIconOverlayManager(IUnknown *pdisp);
~PyIShellIconOverlayManager();
};
// ---------------------------------------------------
//
// Gateway Declaration
class PyGShellIconOverlayManager : public PyGatewayBase, public IShellIconOverlayManager
{
protected:
PyGShellIconOverlayManager(PyObject *instance) : PyGatewayBase(instance) { ; }
PYGATEWAY_MAKE_SUPPORT2(PyGShellIconOverlayManager, IShellIconOverlayManager, IID_IShellIconOverlayManager, PyGatewayBase)
// IShellIconOverlayManager
STDMETHOD(GetFileOverlayInfo)(
LPCWSTR path,
DWORD attrib,
int __RPC_FAR * index,
DWORD flags);
STDMETHOD(GetReservedOverlayInfo)(
LPCWSTR path,
DWORD attrib,
int __RPC_FAR * index,
DWORD flags,
int ireservedID);
STDMETHOD(RefreshOverlayImages)(
DWORD flags);
STDMETHOD(LoadNonloadedOverlayIdentifiers)(
void);
STDMETHOD(OverlayIndexFromImageIndex)(
int iImage,
int __RPC_FAR * index,
BOOL fAdd);
};
--- NEW FILE: PyIShellIconOverlayManager.cpp ---
// This file implements the IShellIconOverlayManager Interface and Gateway for Python.
// Generated by makegw.py
#include "shell_pch.h"
#include "PyIShellIconOverlayManager.h"
// @doc - This file contains autoduck documentation
// ---------------------------------------------------
//
// Interface Implementation
PyIShellIconOverlayManager::PyIShellIconOverlayManager(IUnknown *pdisp):
PyIUnknown(pdisp)
{
ob_type = &type;
}
PyIShellIconOverlayManager::~PyIShellIconOverlayManager()
{
}
/* static */ IShellIconOverlayManager *PyIShellIconOverlayManager::GetI(PyObject *self)
{
return (IShellIconOverlayManager *)PyIUnknown::GetI(self);
}
// @pymethod |PyIShellIconOverlayManager|GetFileOverlayInfo|Description of GetFileOverlayInfo.
PyObject *PyIShellIconOverlayManager::GetFileOverlayInfo(PyObject *self, PyObject *args)
{
IShellIconOverlayManager *pISIOM = GetI(self);
if ( pISIOM == NULL )
return NULL;
// @pyparm <o unicode>|path||Description for path
// @pyparm int|attrib||Description for attrib
// @pyparm int|flags||Description for flags
PyObject *obpath;
LPWSTR path;
DWORD attrib;
int index;
DWORD flags;
if ( !PyArg_ParseTuple(args, "Oll:GetFileOverlayInfo", &obpath, &attrib, &flags) )
return NULL;
BOOL bPythonIsHappy = TRUE;
if (bPythonIsHappy && !PyWinObject_AsBstr(obpath, &path)) bPythonIsHappy = FALSE;
if (!bPythonIsHappy) return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pISIOM->GetFileOverlayInfo( path, attrib, &index, flags );
SysFreeString(path);
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pISIOM, IID_IShellIconOverlayManager );
PyObject *pyretval = Py_BuildValue("i", index);
return pyretval;
}
// @pymethod |PyIShellIconOverlayManager|GetReservedOverlayInfo|Description of GetReservedOverlayInfo.
PyObject *PyIShellIconOverlayManager::GetReservedOverlayInfo(PyObject *self, PyObject *args)
{
IShellIconOverlayManager *pISIOM = GetI(self);
if ( pISIOM == NULL )
return NULL;
// @pyparm <o unicode>|path||Description for path
// @pyparm int|attrib||Description for attrib
// @pyparm int|flags||Description for flags
// @pyparm int|ireservedID||Description for ireservedID
PyObject *obpath;
LPWSTR path;
DWORD attrib;
int index;
DWORD flags;
int ireservedID;
if ( !PyArg_ParseTuple(args, "Olli:GetReservedOverlayInfo", &obpath, &attrib, &flags, &ireservedID) )
return NULL;
BOOL bPythonIsHappy = TRUE;
if (bPythonIsHappy && !PyWinObject_AsBstr(obpath, &path)) bPythonIsHappy = FALSE;
if (!bPythonIsHappy) return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pISIOM->GetReservedOverlayInfo( path, attrib, &index, flags, ireservedID );
SysFreeString(path);
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pISIOM, IID_IShellIconOverlayManager );
PyObject *pyretval = Py_BuildValue("i", index);
return pyretval;
}
// @pymethod |PyIShellIconOverlayManager|RefreshOverlayImages|Description of RefreshOverlayImages.
PyObject *PyIShellIconOverlayManager::RefreshOverlayImages(PyObject *self, PyObject *args)
{
IShellIconOverlayManager *pISIOM = GetI(self);
if ( pISIOM == NULL )
return NULL;
// @pyparm int|flags||Description for flags
DWORD flags;
if ( !PyArg_ParseTuple(args, "l:RefreshOverlayImages", &flags) )
return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pISIOM->RefreshOverlayImages( flags );
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pISIOM, IID_IShellIconOverlayManager );
Py_INCREF(Py_None);
return Py_None;
}
// @pymethod |PyIShellIconOverlayManager|LoadNonloadedOverlayIdentifiers|Description of LoadNonloadedOverlayIdentifiers.
PyObject *PyIShellIconOverlayManager::LoadNonloadedOverlayIdentifiers(PyObject *self, PyObject *args)
{
IShellIconOverlayManager *pISIOM = GetI(self);
if ( pISIOM == NULL )
return NULL;
if ( !PyArg_ParseTuple(args, ":LoadNonloadedOverlayIdentifiers") )
return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pISIOM->LoadNonloadedOverlayIdentifiers( );
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pISIOM, IID_IShellIconOverlayManager );
Py_INCREF(Py_None);
return Py_None;
}
// @pymethod |PyIShellIconOverlayManager|OverlayIndexFromImageIndex|Description of OverlayIndexFromImageIndex.
PyObject *PyIShellIconOverlayManager::OverlayIndexFromImageIndex(PyObject *self, PyObject *args)
{
IShellIconOverlayManager *pISIOM = GetI(self);
if ( pISIOM == NULL )
return NULL;
// @pyparm int|iImage||Description for iImage
// @pyparm int|fAdd||Description for fAdd
int iImage;
int index;
BOOL fAdd;
if ( !PyArg_ParseTuple(args, "ii:OverlayIndexFromImageIndex", &iImage, &fAdd) )
return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pISIOM->OverlayIndexFromImageIndex( iImage, &index, fAdd );
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pISIOM, IID_IShellIconOverlayManager );
PyObject *pyretval = Py_BuildValue("i", index);
return pyretval;
}
// @object PyIShellIconOverlayManager|Description of the interface
static struct PyMethodDef PyIShellIconOverlayManager_methods[] =
{
{ "GetFileOverlayInfo", PyIShellIconOverlayManager::GetFileOverlayInfo, 1 }, // @pymeth GetFileOverlayInfo|Description of GetFileOverlayInfo
{ "GetReservedOverlayInfo", PyIShellIconOverlayManager::GetReservedOverlayInfo, 1 }, // @pymeth GetReservedOverlayInfo|Description of GetReservedOverlayInfo
{ "RefreshOverlayImages", PyIShellIconOverlayManager::RefreshOverlayImages, 1 }, // @pymeth RefreshOverlayImages|Description of RefreshOverlayImages
{ "LoadNonloadedOverlayIdentifiers", PyIShellIconOverlayManager::LoadNonloadedOverlayIdentifiers, 1 }, // @pymeth LoadNonloadedOverlayIdentifiers|Description of LoadNonloadedOverlayIdentifiers
{ "OverlayIndexFromImageIndex", PyIShellIconOverlayManager::OverlayIndexFromImageIndex, 1 }, // @pymeth OverlayIndexFromImageIndex|Description of OverlayIndexFromImageIndex
{ NULL }
};
PyComTypeObject PyIShellIconOverlayManager::type("PyIShellIconOverlayManager",
&PyIUnknown::type,
sizeof(PyIShellIconOverlayManager),
PyIShellIconOverlayManager_methods,
GET_PYCOM_CTOR(PyIShellIconOverlayManager));
// ---------------------------------------------------
//
// Gateway Implementation
STDMETHODIMP PyGShellIconOverlayManager::GetFileOverlayInfo(
/* [unique][in] */ LPCWSTR path,
/* [unique][in] */ DWORD attrib,
/* [out] */ int __RPC_FAR * index,
/* [in] */ DWORD flags)
{
PY_GATEWAY_METHOD;
PyObject *obpath;
obpath = MakeOLECHARToObj(path);
PyObject *result;
HRESULT hr=InvokeViaPolicy("GetFileOverlayInfo", &result, "Oll", obpath, attrib, flags);
Py_XDECREF(obpath);
if (FAILED(hr)) return hr;
// Process the Python results, and convert back to the real params
if (!PyArg_Parse(result, "i" , index)) return PyCom_SetAndLogCOMErrorFromPyException("GetFileOverlayInfo", GetIID());
Py_DECREF(result);
return hr;
}
STDMETHODIMP PyGShellIconOverlayManager::GetReservedOverlayInfo(
/* [unique][in] */ LPCWSTR path,
/* [unique][in] */ DWORD attrib,
/* [out] */ int __RPC_FAR * index,
/* [in] */ DWORD flags,
/* [in] */ int ireservedID)
{
PY_GATEWAY_METHOD;
PyObject *obpath;
obpath = MakeOLECHARToObj(path);
PyObject *result;
HRESULT hr=InvokeViaPolicy("GetReservedOverlayInfo", &result, "Olli", obpath, attrib, flags, ireservedID);
Py_XDECREF(obpath);
if (FAILED(hr)) return hr;
// Process the Python results, and convert back to the real params
if (!PyArg_Parse(result, "i" , index)) return PyCom_SetAndLogCOMErrorFromPyException("GetReservedOverlayInfo", GetIID());
Py_DECREF(result);
return hr;
}
STDMETHODIMP PyGShellIconOverlayManager::RefreshOverlayImages(
/* [in] */ DWORD flags)
{
PY_GATEWAY_METHOD;
HRESULT hr=InvokeViaPolicy("RefreshOverlayImages", NULL, "l", flags);
return hr;
}
STDMETHODIMP PyGShellIconOverlayManager::LoadNonloadedOverlayIdentifiers(
void)
{
PY_GATEWAY_METHOD;
HRESULT hr=InvokeViaPolicy("LoadNonloadedOverlayIdentifiers", NULL);
return hr;
}
STDMETHODIMP PyGShellIconOverlayManager::OverlayIndexFromImageIndex(
/* [unique][in] */ int iImage,
/* [out] */ int __RPC_FAR * index,
/* [in] */ BOOL fAdd)
{
PY_GATEWAY_METHOD;
PyObject *result;
HRESULT hr=InvokeViaPolicy("OverlayIndexFromImageIndex", &result, "ii", iImage, fAdd);
if (FAILED(hr)) return hr;
// Process the Python results, and convert back to the real params
if (!PyArg_Parse(result, "i" , index)) return PyCom_SetAndLogCOMErrorFromPyException("OverlayIndexFromImageIndex", GetIID());
Py_DECREF(result);
return hr;
}
--- NEW FILE: PyIShellIconOverlay.h ---
// This file declares the IShellIconOverlay Interface and Gateway for Python.
// Generated by makegw.py
// ---------------------------------------------------
//
// Interface Declaration
class PyIShellIconOverlay : public PyIUnknown
{
public:
MAKE_PYCOM_CTOR(PyIShellIconOverlay);
static IShellIconOverlay *GetI(PyObject *self);
static PyComTypeObject type;
// The Python methods
static PyObject *GetOverlayIndex(PyObject *self, PyObject *args);
static PyObject *GetOverlayIconIndex(PyObject *self, PyObject *args);
protected:
PyIShellIconOverlay(IUnknown *pdisp);
~PyIShellIconOverlay();
};
// ---------------------------------------------------
//
// Gateway Declaration
class PyGShellIconOverlay : public PyGatewayBase, public IShellIconOverlay
{
protected:
PyGShellIconOverlay(PyObject *instance) : PyGatewayBase(instance) { ; }
PYGATEWAY_MAKE_SUPPORT2(PyGShellIconOverlay, IShellIconOverlay, IID_IShellIconOverlay, PyGatewayBase)
// IShellIconOverlay
STDMETHOD(GetOverlayIndex)(
LPCITEMIDLIST pidl,
int __RPC_FAR * index);
STDMETHOD(GetOverlayIconIndex)(
LPCITEMIDLIST pidl,
int __RPC_FAR * index);
};
|