Commit e9fa0599 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

shell32: Merge ShellView menu implementations into a single file.

parent de0813c7
...@@ -46,9 +46,8 @@ C_SRCS = \ ...@@ -46,9 +46,8 @@ C_SRCS = \
shlfsbind.c \ shlfsbind.c \
shlmenu.c \ shlmenu.c \
shlview.c \ shlview.c \
shlview_cmenu.c \
shpolicy.c \ shpolicy.c \
shv_bg_cmenu.c \
shv_item_cmenu.c \
systray.c \ systray.c \
trash.c \ trash.c \
xdg.c xdg.c
......
...@@ -600,7 +600,7 @@ static HRESULT WINAPI ISF_ControlPanel_fnGetUIObjectOf(IShellFolder2 *iface, HWN ...@@ -600,7 +600,7 @@ static HRESULT WINAPI ISF_ControlPanel_fnGetUIObjectOf(IShellFolder2 *iface, HWN
*ppvOut = NULL; *ppvOut = NULL;
if (IsEqualIID(riid, &IID_IContextMenu) &&(cidl >= 1)) { if (IsEqualIID(riid, &IID_IContextMenu) &&(cidl >= 1)) {
pObj = (LPUNKNOWN) ISvItemCm_Constructor((IShellFolder *) iface, This->pidlRoot, apidl, cidl); pObj = (LPUNKNOWN) ItemMenu_Constructor((IShellFolder *) iface, This->pidlRoot, apidl, cidl);
hr = S_OK; hr = S_OK;
} else if (IsEqualIID(riid, &IID_IDataObject) &&(cidl >= 1)) { } else if (IsEqualIID(riid, &IID_IDataObject) &&(cidl >= 1)) {
pObj = (LPUNKNOWN) IDataObject_Constructor(hwndOwner, This->pidlRoot, apidl, cidl); pObj = (LPUNKNOWN) IDataObject_Constructor(hwndOwner, This->pidlRoot, apidl, cidl);
......
...@@ -78,8 +78,8 @@ LPDATAOBJECT IDataObject_Constructor(HWND hwndOwner, LPCITEMIDLIST myPidl, LPCIT ...@@ -78,8 +78,8 @@ LPDATAOBJECT IDataObject_Constructor(HWND hwndOwner, LPCITEMIDLIST myPidl, LPCIT
LPENUMFORMATETC IEnumFORMATETC_Constructor(UINT, const FORMATETC []) DECLSPEC_HIDDEN; LPENUMFORMATETC IEnumFORMATETC_Constructor(UINT, const FORMATETC []) DECLSPEC_HIDDEN;
LPCLASSFACTORY IClassFactory_Constructor(REFCLSID) DECLSPEC_HIDDEN; LPCLASSFACTORY IClassFactory_Constructor(REFCLSID) DECLSPEC_HIDDEN;
IContextMenu2 * ISvItemCm_Constructor(LPSHELLFOLDER pSFParent, LPCITEMIDLIST pidl, const LPCITEMIDLIST *aPidls, UINT uItemCount) DECLSPEC_HIDDEN; IContextMenu2 * ItemMenu_Constructor(IShellFolder*, LPCITEMIDLIST, const LPCITEMIDLIST*, UINT) DECLSPEC_HIDDEN;
IContextMenu2 * ISvBgCm_Constructor(LPSHELLFOLDER pSFParent, BOOL bDesktop) DECLSPEC_HIDDEN; IContextMenu2 * BackgroundMenu_Constructor(IShellFolder*, BOOL) DECLSPEC_HIDDEN;
LPSHELLVIEW IShellView_Constructor(LPSHELLFOLDER) DECLSPEC_HIDDEN; LPSHELLVIEW IShellView_Constructor(LPSHELLFOLDER) DECLSPEC_HIDDEN;
HRESULT WINAPI IFSFolder_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv) DECLSPEC_HIDDEN; HRESULT WINAPI IFSFolder_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv) DECLSPEC_HIDDEN;
......
...@@ -530,9 +530,9 @@ static HRESULT WINAPI ISF_Desktop_fnGetUIObjectOf (IShellFolder2 * iface, ...@@ -530,9 +530,9 @@ static HRESULT WINAPI ISF_Desktop_fnGetUIObjectOf (IShellFolder2 * iface,
if (IsEqualIID (riid, &IID_IContextMenu)) if (IsEqualIID (riid, &IID_IContextMenu))
{ {
if (cidl > 0) if (cidl > 0)
pObj = (LPUNKNOWN) ISvItemCm_Constructor( (IShellFolder *) iface, This->pidlRoot, apidl, cidl); pObj = (LPUNKNOWN) ItemMenu_Constructor( (IShellFolder *) iface, This->pidlRoot, apidl, cidl);
else else
pObj = (LPUNKNOWN) ISvBgCm_Constructor( (IShellFolder *) iface, TRUE); pObj = (LPUNKNOWN) BackgroundMenu_Constructor( (IShellFolder *) iface, TRUE);
hr = S_OK; hr = S_OK;
} }
else if (IsEqualIID (riid, &IID_IDataObject) && (cidl >= 1)) else if (IsEqualIID (riid, &IID_IDataObject) && (cidl >= 1))
......
...@@ -744,7 +744,7 @@ IShellFolder_fnGetUIObjectOf (IShellFolder2 * iface, ...@@ -744,7 +744,7 @@ IShellFolder_fnGetUIObjectOf (IShellFolder2 * iface,
} }
if (IsEqualIID (riid, &IID_IContextMenu) && (cidl >= 1)) { if (IsEqualIID (riid, &IID_IContextMenu) && (cidl >= 1)) {
pObj = (LPUNKNOWN) ISvItemCm_Constructor ((IShellFolder *) iface, pObj = (LPUNKNOWN) ItemMenu_Constructor ((IShellFolder *) iface,
This->pidlRoot, apidl, cidl); This->pidlRoot, apidl, cidl);
hr = S_OK; hr = S_OK;
} else if (IsEqualIID (riid, &IID_IDataObject) && (cidl >= 1)) { } else if (IsEqualIID (riid, &IID_IDataObject) && (cidl >= 1)) {
......
...@@ -532,7 +532,7 @@ static HRESULT WINAPI ISF_MyComputer_fnGetUIObjectOf (IShellFolder2 * iface, ...@@ -532,7 +532,7 @@ static HRESULT WINAPI ISF_MyComputer_fnGetUIObjectOf (IShellFolder2 * iface,
if (IsEqualIID (riid, &IID_IContextMenu) && (cidl >= 1)) if (IsEqualIID (riid, &IID_IContextMenu) && (cidl >= 1))
{ {
pObj = (LPUNKNOWN) ISvItemCm_Constructor ((IShellFolder *) iface, pObj = (LPUNKNOWN) ItemMenu_Constructor ((IShellFolder *) iface,
This->pidlRoot, apidl, cidl); This->pidlRoot, apidl, cidl);
hr = S_OK; hr = S_OK;
} }
......
...@@ -426,7 +426,7 @@ static HRESULT WINAPI ISF_NetworkPlaces_fnGetUIObjectOf (IShellFolder2 * iface, ...@@ -426,7 +426,7 @@ static HRESULT WINAPI ISF_NetworkPlaces_fnGetUIObjectOf (IShellFolder2 * iface,
if (IsEqualIID (riid, &IID_IContextMenu) && (cidl >= 1)) if (IsEqualIID (riid, &IID_IContextMenu) && (cidl >= 1))
{ {
pObj = (LPUNKNOWN) ISvItemCm_Constructor ((IShellFolder *) iface, This->pidlRoot, apidl, cidl); pObj = (LPUNKNOWN) ItemMenu_Constructor ((IShellFolder *) iface, This->pidlRoot, apidl, cidl);
hr = S_OK; hr = S_OK;
} }
else if (IsEqualIID (riid, &IID_IDataObject) && (cidl >= 1)) else if (IsEqualIID (riid, &IID_IDataObject) && (cidl >= 1))
......
...@@ -1167,7 +1167,7 @@ static HRESULT WINAPI UnixFolder_IShellFolder2_GetUIObjectOf(IShellFolder2* ifac ...@@ -1167,7 +1167,7 @@ static HRESULT WINAPI UnixFolder_IShellFolder2_GetUIObjectOf(IShellFolder2* ifac
} }
if (IsEqualIID(&IID_IContextMenu, riid)) { if (IsEqualIID(&IID_IContextMenu, riid)) {
*ppvOut = ISvItemCm_Constructor((IShellFolder*)iface, This->m_pidlLocation, apidl, cidl); *ppvOut = ItemMenu_Constructor((IShellFolder*)iface, This->m_pidlLocation, apidl, cidl);
return S_OK; return S_OK;
} else if (IsEqualIID(&IID_IDataObject, riid)) { } else if (IsEqualIID(&IID_IDataObject, riid)) {
*ppvOut = IDataObject_Constructor(hwndOwner, This->m_pidlLocation, apidl, cidl); *ppvOut = IDataObject_Constructor(hwndOwner, This->m_pidlLocation, apidl, cidl);
......
...@@ -1275,7 +1275,7 @@ HRESULT WINAPI CDefFolderMenu_Create2(LPCITEMIDLIST pidlFolder, HWND hwnd, UINT ...@@ -1275,7 +1275,7 @@ HRESULT WINAPI CDefFolderMenu_Create2(LPCITEMIDLIST pidlFolder, HWND hwnd, UINT
} }
else else
folder_pidl=ILClone(pidlFolder); folder_pidl=ILClone(pidlFolder);
system_menu = (IContextMenu*)ISvItemCm_Constructor(psf,folder_pidl,(const LPCITEMIDLIST*)apidl,cidl); system_menu = (IContextMenu*)ItemMenu_Constructor(psf,folder_pidl,(const LPCITEMIDLIST*)apidl,cidl);
hres= SHELL_CreateContextMenu(hwnd,system_menu,psf,folder_pidl,apidl,cidl,ahkeys,nKeys,&IID_IContextMenu,(void**)ppcm); hres= SHELL_CreateContextMenu(hwnd,system_menu,psf,folder_pidl,apidl,cidl,ahkeys,nKeys,&IID_IContextMenu,(void**)ppcm);
IContextMenu_Release(system_menu); IContextMenu_Release(system_menu);
ILFree(folder_pidl); ILFree(folder_pidl);
...@@ -1300,7 +1300,7 @@ HRESULT WINAPI SHCreateDefaultContextMenu(const DEFCONTEXTMENU *pdcm, REFIID rii ...@@ -1300,7 +1300,7 @@ HRESULT WINAPI SHCreateDefaultContextMenu(const DEFCONTEXTMENU *pdcm, REFIID rii
folder_pidl=ILClone(pdcm->pidlFolder); folder_pidl=ILClone(pdcm->pidlFolder);
if(pdcm->cKeys==0) if(pdcm->cKeys==0)
FIXME("Loading shell extensions using IQueryAssociations not yet supported\n"); FIXME("Loading shell extensions using IQueryAssociations not yet supported\n");
system_menu = (IContextMenu*)ISvItemCm_Constructor(folder,folder_pidl,(const LPCITEMIDLIST*)pdcm->apidl,pdcm->cidl); system_menu = (IContextMenu*)ItemMenu_Constructor(folder,folder_pidl,(const LPCITEMIDLIST*)pdcm->apidl,pdcm->cidl);
ret = SHELL_CreateContextMenu(pdcm->hwnd,system_menu,folder,folder_pidl,(LPCITEMIDLIST*)pdcm->apidl,pdcm->cidl,pdcm->aKeys,pdcm->cKeys,riid,ppv); ret = SHELL_CreateContextMenu(pdcm->hwnd,system_menu,folder,folder_pidl,(LPCITEMIDLIST*)pdcm->apidl,pdcm->cidl,pdcm->aKeys,pdcm->cKeys,riid,ppv);
IContextMenu_Release(system_menu); IContextMenu_Release(system_menu);
ILFree(folder_pidl); ILFree(folder_pidl);
......
...@@ -1095,7 +1095,7 @@ static void ShellView_DoContextMenu(IShellViewImpl * This, WORD x, WORD y, BOOL ...@@ -1095,7 +1095,7 @@ static void ShellView_DoContextMenu(IShellViewImpl * This, WORD x, WORD y, BOOL
{ {
hMenu = CreatePopupMenu(); hMenu = CreatePopupMenu();
pCM = ISvBgCm_Constructor(This->pSFParent, FALSE); pCM = BackgroundMenu_Constructor(This->pSFParent, FALSE);
IContextMenu2_QueryContextMenu(pCM, hMenu, 0, FCIDM_SHVIEWFIRST, FCIDM_SHVIEWLAST, 0); IContextMenu2_QueryContextMenu(pCM, hMenu, 0, FCIDM_SHVIEWFIRST, FCIDM_SHVIEWLAST, 0);
uCommand = TrackPopupMenu( hMenu, TPM_LEFTALIGN | TPM_RETURNCMD,x,y,0,This->hWnd,NULL); uCommand = TrackPopupMenu( hMenu, TPM_LEFTALIGN | TPM_RETURNCMD,x,y,0,This->hWnd,NULL);
...@@ -2050,7 +2050,7 @@ static HRESULT WINAPI IShellView_fnGetItemObject(IShellView2 *iface, UINT uItem, ...@@ -2050,7 +2050,7 @@ static HRESULT WINAPI IShellView_fnGetItemObject(IShellView2 *iface, UINT uItem,
if (IsEqualIID(&IID_IContextMenu, riid)) if (IsEqualIID(&IID_IContextMenu, riid))
{ {
*ppvOut = ISvBgCm_Constructor(This->pSFParent, FALSE); *ppvOut = BackgroundMenu_Constructor(This->pSFParent, FALSE);
hr = S_OK; hr = S_OK;
} }
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment