Update to 7-Zip Version 21.04

- first test... no release!!!
This commit is contained in:
Tino Reichardt
2021-11-06 22:17:34 +01:00
parent 0f6bcfd2ed
commit 09497b7ba0
152 changed files with 6166 additions and 1341 deletions

View File

@@ -7,13 +7,27 @@
#include <ShlObj.h>
#include "MyExplorerCommand.h"
#include "../../../Common/MyString.h"
#include "../FileManager/MyCom2.h"
enum ECtxCommandType
{
CtxCommandType_Normal,
CtxCommandType_OpenRoot,
CtxCommandType_OpenChild,
CtxCommandType_CrcRoot,
CtxCommandType_CrcChild,
};
class CZipContextMenu:
public IContextMenu,
public IShellExtInit,
public IExplorerCommand,
public IEnumExplorerCommand,
public CMyUnknownImp
{
public:
@@ -45,10 +59,17 @@ public:
kHash_SHA512,
kHash_BLAKE2sp,
kHash_BLAKE3,
kHash_All
kHash_All,
kHash_Generate_SHA256,
kHash_TestArc
};
MY_UNKNOWN_IMP2_MT(IContextMenu, IShellExtInit)
MY_UNKNOWN_IMP4_MT(
IContextMenu,
IShellExtInit,
IExplorerCommand,
IEnumExplorerCommand
)
// IShellExtInit
STDMETHOD(Initialize)(LPCITEMIDLIST pidlFolder, LPDATAOBJECT dataObject, HKEY hkeyProgID);
@@ -60,6 +81,24 @@ public:
HRESULT InitContextMenu(const wchar_t *folder, const wchar_t * const *names, unsigned numFiles);
void LoadItems(IShellItemArray *psiItemArray);
// IExplorerCommand
STDMETHOD (GetTitle) (IShellItemArray *psiItemArray, LPWSTR *ppszName);
STDMETHOD (GetIcon) (IShellItemArray *psiItemArray, LPWSTR *ppszIcon);
STDMETHOD (GetToolTip) (IShellItemArray *psiItemArray, LPWSTR *ppszInfotip);
STDMETHOD (GetCanonicalName) (GUID *pguidCommandName);
STDMETHOD (GetState) (IShellItemArray *psiItemArray, BOOL fOkToBeSlow, EXPCMDSTATE *pCmdState);
STDMETHOD (Invoke) (IShellItemArray *psiItemArray, IBindCtx *pbc);
STDMETHOD (GetFlags) (EXPCMDFLAGS *pFlags);
STDMETHOD (EnumSubCommands) (IEnumExplorerCommand **ppEnum);
// IEnumExplorerCommand
STDMETHOD (Next) (ULONG celt, IExplorerCommand **pUICommand, ULONG *pceltFetched);
STDMETHOD (Skip) (ULONG celt);
STDMETHOD (Reset) (void);
STDMETHOD (Clone) (IEnumExplorerCommand **ppenum);
CZipContextMenu();
~CZipContextMenu();
@@ -67,10 +106,25 @@ public:
{
ECommandInternalID CommandInternalID;
UString Verb;
UString UserString;
// UString HelpString;
UString Folder;
UString ArcName;
UString ArcType;
bool IsPopup;
ECtxCommandType CtxCommandType;
CCommandMapItem():
IsPopup(false),
CtxCommandType(CtxCommandType_Normal)
{}
bool IsSubMenu() const
{
return
CtxCommandType == CtxCommandType_CrcRoot ||
CtxCommandType == CtxCommandType_OpenRoot;
}
};
private:
@@ -80,16 +134,28 @@ private:
bool _dropMode;
UString _dropPath;
CObjectVector<CCommandMapItem> _commandMap;
CObjectVector<CCommandMapItem> _commandMap_Cur;
HBITMAP _bitmap;
CBoolPair _elimDup;
bool IsSeparator;
bool IsRoot;
CObjectVector< CMyComPtr<IExplorerCommand> > SubCommands;
ULONG CurrentSubCommand;
void Set_UserString_in_LastCommand(const UString &s)
{
_commandMap.Back().UserString = s;
}
HRESULT GetFileNames(LPDATAOBJECT dataObject, UStringVector &fileNames);
int FindVerb(const UString &verb);
void FillCommand(ECommandInternalID id, UString &mainString, CCommandMapItem &cmi);
void AddCommand(ECommandInternalID id, UString &mainString, CCommandMapItem &cmi);
void AddMapItem_ForSubMenu(const char *ver);
HRESULT InvokeCommandCommon(const CCommandMapItem &cmi);
};
#endif