ICOMization of remaining interfaces.

This commit is contained in:
Adrian Thurston 1999-04-22 15:23:18 +00:00 committed by Alexandre Julliard
parent abefaa5dd2
commit 17551f9863
5 changed files with 179 additions and 236 deletions

View file

@ -176,6 +176,163 @@ static HRESULT WINAPI IEnumFORMATETC_fnClone(LPENUMFORMATETC iface, LPENUMFORMAT
return E_NOTIMPL;
}
/**************************************************************************
* IDLList "Item ID List List"
*
* NOTES
* interal data holder for IDataObject
*/
#define STDMETHOD(xfn) HRESULT (CALLBACK *fn##xfn)
#define STDMETHOD_(type,xfn) type (CALLBACK *fn##xfn)
#define THIS_ THIS,
typedef struct tagLPIDLLIST *LPIDLLIST, IDLList;
#define THIS LPIDLLIST me
typedef enum
{ State_UnInit=1,
State_Init=2,
State_OutOfMem=3
} IDLListState;
typedef struct IDLList_VTable
{ STDMETHOD_(UINT, GetState)(THIS);
STDMETHOD_(LPITEMIDLIST, GetElement)(THIS_ UINT nIndex);
STDMETHOD_(UINT, GetCount)(THIS);
STDMETHOD_(BOOL, StoreItem)(THIS_ LPITEMIDLIST pidl);
STDMETHOD_(BOOL, AddItems)(THIS_ LPITEMIDLIST *apidl, UINT cidl);
STDMETHOD_(BOOL, InitList)(THIS);
STDMETHOD_(void, CleanList)(THIS);
} IDLList_VTable,*LPIDLLIST_VTABLE;
struct tagLPIDLLIST
{ LPIDLLIST_VTABLE lpvtbl;
HDPA dpa;
UINT uStep;
};
extern LPIDLLIST IDLList_Constructor (UINT uStep);
extern void IDLList_Destructor(LPIDLLIST me);
#undef THIS
/**************************************************************************
* IDLList "Item ID List List"
*
*/
static UINT WINAPI IDLList_GetState(LPIDLLIST this);
static LPITEMIDLIST WINAPI IDLList_GetElement(LPIDLLIST this, UINT nIndex);
static UINT WINAPI IDLList_GetCount(LPIDLLIST this);
static BOOL WINAPI IDLList_StoreItem(LPIDLLIST this, LPITEMIDLIST pidl);
static BOOL WINAPI IDLList_AddItems(LPIDLLIST this, LPITEMIDLIST *apidl, UINT cidl);
static BOOL WINAPI IDLList_InitList(LPIDLLIST this);
static void WINAPI IDLList_CleanList(LPIDLLIST this);
static IDLList_VTable idllvt =
{ IDLList_GetState,
IDLList_GetElement,
IDLList_GetCount,
IDLList_StoreItem,
IDLList_AddItems,
IDLList_InitList,
IDLList_CleanList
};
LPIDLLIST IDLList_Constructor (UINT uStep)
{ LPIDLLIST lpidll;
if (!(lpidll = (LPIDLLIST)HeapAlloc(GetProcessHeap(),0,sizeof(IDLList))))
return NULL;
lpidll->lpvtbl=&idllvt;
lpidll->uStep=uStep;
lpidll->dpa=NULL;
TRACE (shell,"(%p)\n",lpidll);
return lpidll;
}
void IDLList_Destructor(LPIDLLIST this)
{ TRACE (shell,"(%p)\n",this);
IDLList_CleanList(this);
}
static UINT WINAPI IDLList_GetState(LPIDLLIST this)
{ TRACE (shell,"(%p)->(uStep=%u dpa=%p)\n",this, this->uStep, this->dpa);
if (this->uStep == 0)
{ if (this->dpa)
return(State_Init);
return(State_OutOfMem);
}
return(State_UnInit);
}
static LPITEMIDLIST WINAPI IDLList_GetElement(LPIDLLIST this, UINT nIndex)
{ TRACE (shell,"(%p)->(index=%u)\n",this, nIndex);
return((LPITEMIDLIST)pDPA_GetPtr(this->dpa, nIndex));
}
static UINT WINAPI IDLList_GetCount(LPIDLLIST this)
{ TRACE (shell,"(%p)\n",this);
return(IDLList_GetState(this)==State_Init ? DPA_GetPtrCount(this->dpa) : 0);
}
static BOOL WINAPI IDLList_StoreItem(LPIDLLIST this, LPITEMIDLIST pidl)
{ TRACE (shell,"(%p)->(pidl=%p)\n",this, pidl);
if (pidl)
{ if (IDLList_InitList(this) && pDPA_InsertPtr(this->dpa, 0x7fff, (LPSTR)pidl)>=0)
return(TRUE);
ILFree(pidl);
}
IDLList_CleanList(this);
return(FALSE);
}
static BOOL WINAPI IDLList_AddItems(LPIDLLIST this, LPITEMIDLIST *apidl, UINT cidl)
{ INT i;
TRACE (shell,"(%p)->(apidl=%p cidl=%u)\n",this, apidl, cidl);
for (i=0; i<cidl; ++i)
{ if (!IDLList_StoreItem(this, ILClone((LPCITEMIDLIST)apidl[i])))
return(FALSE);
}
return(TRUE);
}
static BOOL WINAPI IDLList_InitList(LPIDLLIST this)
{ TRACE (shell,"(%p)\n",this);
switch (IDLList_GetState(this))
{ case State_Init:
return(TRUE);
case State_OutOfMem:
return(FALSE);
case State_UnInit:
default:
this->dpa = pDPA_Create(this->uStep);
this->uStep = 0;
return(IDLList_InitList(this));
}
}
static void WINAPI IDLList_CleanList(LPIDLLIST this)
{ INT i;
TRACE (shell,"(%p)\n",this);
if (this->uStep != 0)
{ this->dpa = NULL;
this->uStep = 0;
return;
}
if (!this->dpa)
{ return;
}
for (i=DPA_GetPtrCount(this->dpa)-1; i>=0; --i)
{ ILFree(IDLList_GetElement(this,i));
}
pDPA_Destroy(this->dpa);
this->dpa=NULL;
}
/***********************************************************************
* IDataObject implementation
*/

View file

@ -1216,118 +1216,3 @@ BOOL WINAPI _ILGetExtension (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize)
return TRUE;
}
/**************************************************************************
* IDLList "Item ID List List"
*
*/
static UINT WINAPI IDLList_GetState(LPIDLLIST this);
static LPITEMIDLIST WINAPI IDLList_GetElement(LPIDLLIST this, UINT nIndex);
static UINT WINAPI IDLList_GetCount(LPIDLLIST this);
static BOOL WINAPI IDLList_StoreItem(LPIDLLIST this, LPITEMIDLIST pidl);
static BOOL WINAPI IDLList_AddItems(LPIDLLIST this, LPITEMIDLIST *apidl, UINT cidl);
static BOOL WINAPI IDLList_InitList(LPIDLLIST this);
static void WINAPI IDLList_CleanList(LPIDLLIST this);
static IDLList_VTable idllvt =
{ IDLList_GetState,
IDLList_GetElement,
IDLList_GetCount,
IDLList_StoreItem,
IDLList_AddItems,
IDLList_InitList,
IDLList_CleanList
};
LPIDLLIST IDLList_Constructor (UINT uStep)
{ LPIDLLIST lpidll;
if (!(lpidll = (LPIDLLIST)HeapAlloc(GetProcessHeap(),0,sizeof(IDLList))))
return NULL;
lpidll->lpvtbl=&idllvt;
lpidll->uStep=uStep;
lpidll->dpa=NULL;
TRACE (shell,"(%p)\n",lpidll);
return lpidll;
}
void IDLList_Destructor(LPIDLLIST this)
{ TRACE (shell,"(%p)\n",this);
IDLList_CleanList(this);
}
static UINT WINAPI IDLList_GetState(LPIDLLIST this)
{ TRACE (shell,"(%p)->(uStep=%u dpa=%p)\n",this, this->uStep, this->dpa);
if (this->uStep == 0)
{ if (this->dpa)
return(State_Init);
return(State_OutOfMem);
}
return(State_UnInit);
}
static LPITEMIDLIST WINAPI IDLList_GetElement(LPIDLLIST this, UINT nIndex)
{ TRACE (shell,"(%p)->(index=%u)\n",this, nIndex);
return((LPITEMIDLIST)pDPA_GetPtr(this->dpa, nIndex));
}
static UINT WINAPI IDLList_GetCount(LPIDLLIST this)
{ TRACE (shell,"(%p)\n",this);
return(IDLList_GetState(this)==State_Init ? DPA_GetPtrCount(this->dpa) : 0);
}
static BOOL WINAPI IDLList_StoreItem(LPIDLLIST this, LPITEMIDLIST pidl)
{ TRACE (shell,"(%p)->(pidl=%p)\n",this, pidl);
if (pidl)
{ if (IDLList_InitList(this) && pDPA_InsertPtr(this->dpa, 0x7fff, (LPSTR)pidl)>=0)
return(TRUE);
ILFree(pidl);
}
IDLList_CleanList(this);
return(FALSE);
}
static BOOL WINAPI IDLList_AddItems(LPIDLLIST this, LPITEMIDLIST *apidl, UINT cidl)
{ INT i;
TRACE (shell,"(%p)->(apidl=%p cidl=%u)\n",this, apidl, cidl);
for (i=0; i<cidl; ++i)
{ if (!IDLList_StoreItem(this, ILClone((LPCITEMIDLIST)apidl[i])))
return(FALSE);
}
return(TRUE);
}
static BOOL WINAPI IDLList_InitList(LPIDLLIST this)
{ TRACE (shell,"(%p)\n",this);
switch (IDLList_GetState(this))
{ case State_Init:
return(TRUE);
case State_OutOfMem:
return(FALSE);
case State_UnInit:
default:
this->dpa = pDPA_Create(this->uStep);
this->uStep = 0;
return(IDLList_InitList(this));
}
}
static void WINAPI IDLList_CleanList(LPIDLLIST this)
{ INT i;
TRACE (shell,"(%p)\n",this);
if (this->uStep != 0)
{ this->dpa = NULL;
this->uStep = 0;
return;
}
if (!this->dpa)
{ return;
}
for (i=DPA_GetPtrCount(this->dpa)-1; i>=0; --i)
{ ILFree(IDLList_GetElement(this,i));
}
pDPA_Destroy(this->dpa);
this->dpa=NULL;
}

View file

@ -58,6 +58,7 @@ LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST iil1,LPCITEMIDLIST iil2);
LPITEMIDLIST WINAPI ILFindLastID(LPITEMIDLIST pidl);
DWORD WINAPI ILGetSize(LPITEMIDLIST pidl);
BOOL WINAPI ILGetDisplayName(LPCITEMIDLIST pidl,LPSTR path);
DWORD WINAPI ILFree(LPITEMIDLIST pidl);
HRESULT WINAPI SHILCreateFromPathA (LPSTR path, LPITEMIDLIST * ppidl, DWORD attributes);
HRESULT WINAPI SHILCreateFromPathW (LPWSTR path, LPITEMIDLIST * ppidl, DWORD attributes);

View file

@ -5,60 +5,7 @@
#include "wine/obj_storage.h"
#include "wine/obj_moniker.h"
#include "wine/obj_dataobject.h"
#include "wine/obj_oleobj.h"
#define STDMETHOD(xfn) HRESULT (CALLBACK *fn##xfn)
#define STDMETHOD_(type,xfn) type (CALLBACK *fn##xfn)
#define PURE
#define FAR
#define THIS_ THIS,
/* forward declaration of the objects*/
typedef struct tagOLEADVISEHOLDER *LPOLEADVISEHOLDER, IOleAdviseHolder;
/****************************************************************************
* OLE ID
*/
DEFINE_OLEGUID(IID_IOleAdviseHolder, 0x00000111L, 0, 0);
/*****************************************************************************
* IOleAdviseHolder interface
*/
#define THIS LPOLEADVISEHOLDER this
typedef struct IOleAdviseHolder_VTable
{
/*** IUnknown methods ***/
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/*** IOleAdviseHolder methods ***/
STDMETHOD(Advise)(THIS_ IAdviseSink *pAdvise, DWORD *pdwConnection) PURE;
STDMETHOD(Unadvise)(THIS_ DWORD dwConnection) PURE;
STDMETHOD(Enum_Advise)(THIS_ IEnumSTATDATA**ppenumAdvise) PURE;
STDMETHOD(SendOnRename)(THIS_ IMoniker *pmk) PURE;
STDMETHOD(SendOnSave)(THIS) PURE;
STDMETHOD(SendOnClose)(THIS) PURE;
} IOleAdviseHolder_VTable, *LPOLEADVISEHOLDER_VTABLE;
struct tagOLEADVISEHOLDER
{
LPOLEADVISEHOLDER_VTABLE lpvtbl;
DWORD ref;
};
#undef THIS
#undef PURE
#undef FAR
#undef THIS
#undef THIS_
#undef STDMETHOD
#undef STDMETHOD_
#endif /*_WINE_OLEOBJ_H*/

View file

@ -18,14 +18,10 @@
#include "commctrl.h"
#include "prsht.h"
#define STDMETHOD(xfn) HRESULT (CALLBACK *fn##xfn)
#define STDMETHOD_(type,xfn) type (CALLBACK *fn##xfn)
#define PURE
#define FAR
#define THIS_ THIS,
/* foreward declaration of the objects*/
typedef struct tagSHELLICON *LPSHELLICON, IShellIcon;
/*****************************************************************************
* Predeclare interfaces
*/
typedef struct IShellIcon IShellIcon, *LPSHELLICON;
/*****************************************************************************
@ -67,42 +63,6 @@ extern UINT cfFileContents;
#define CFSTR_PASTESUCCEEDED "Paste Succeeded"
#define CFSTR_INDRAGLOOP "InShellDragLoop"
/**************************************************************************
* IDLList "Item ID List List"
*
* NOTES
* interal data holder for IDataObject
*/
typedef struct tagLPIDLLIST *LPIDLLIST, IDLList;
#define THIS LPIDLLIST me
typedef enum
{ State_UnInit=1,
State_Init=2,
State_OutOfMem=3
} IDLListState;
typedef struct IDLList_VTable
{ STDMETHOD_(UINT, GetState)(THIS);
STDMETHOD_(LPITEMIDLIST, GetElement)(THIS_ UINT nIndex);
STDMETHOD_(UINT, GetCount)(THIS);
STDMETHOD_(BOOL, StoreItem)(THIS_ LPITEMIDLIST pidl);
STDMETHOD_(BOOL, AddItems)(THIS_ LPITEMIDLIST *apidl, UINT cidl);
STDMETHOD_(BOOL, InitList)(THIS);
STDMETHOD_(void, CleanList)(THIS);
} IDLList_VTable,*LPIDLLIST_VTABLE;
struct tagLPIDLLIST
{ LPIDLLIST_VTABLE lpvtbl;
HDPA dpa;
UINT uStep;
};
extern LPIDLLIST IDLList_Constructor (UINT uStep);
extern void IDLList_Destructor(LPIDLLIST me);
#undef THIS
/************************************************************************
* IShellView interface
@ -119,23 +79,23 @@ UINT WINAPI SHMapPIDLToSystemImageListIndex(LPSHELLFOLDER sh, LPITEMIDLIST pidl,
* IShellIcon interface
*/
#define THIS LPSHELLICON me
#define ICOM_INTERFACE IShellIcon
#define IShellIcon_METHODS \
ICOM_METHOD3(HRESULT, GetIconOf, LPCITEMIDLIST,pidl, UINT,flags, LPINT,lpIconIndex)
#define IShellIcon_IMETHODS \
IUnknown_IMETHODS \
IShellIcon_METHODS
ICOM_DEFINE(IShellIcon, IUnknown)
#undef ICOM_INTERFACE
typedef struct IShellIcon_VTable
{ /*** IUnknown methods ***/
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/*** IShellIcon methods ***/
STDMETHOD(GetIconOf)(THIS_ LPCITEMIDLIST pidl, UINT flags, LPINT lpIconIndex) PURE;
} IShellIcon_VTable,*LPSHELLICON_VTABLE;
struct tagSHELLICON
{ LPSHELLICON_VTABLE lpvtbl;
DWORD ref;
};
#undef THIS
#ifdef ICOM_CINTERFACE
/*** IUnknown methods ***/
#define IShellIcon_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
#define IShellIcon_AddRef(p) ICOM_CALL (AddRef,p)
#define IShellIcon_Release(p) ICOM_CALL (Release,p)
/*** IShellIcon methods ***/
#define IShellIcon_GetIconOf(p,a,b,c) ICOM_CALL3(GetIconOf,p,a,b,c)
#endif
/****************************************************************************
* Shell Execute API
@ -438,11 +398,4 @@ void WINAPI SHGetSettings(LPSHELLFLAGSTATE lpsfs, DWORD dwMask, DWORD dwx);
/**********************************************************************/
#undef PURE
#undef FAR
#undef THIS
#undef THIS_
#undef STDMETHOD
#undef STDMETHOD_
#endif /* __WINE_SHLOBJ_H */