OSDN Git Service

Initial revision
[winmerge-jp/winmerge-jp.git] / ArchiveSupport / Merge7z / Merge7zCommon.h
1 // includes from 7-Zip sources
2 #include "7zip/Archive/IArchive.h"
3 #include "7zip/UI/Agent/ArchiveExtractCallback.h"
4 #include "7zip/UI/Agent/ArchiveUpdateCallback.h"
5 #include "Common/StringConvert.h"
6 #include "Windows/PropVariant.h"
7 #include "Windows/PropVariantConversions.h"
8 #include "Windows/FileDir.h"
9 #include "Windows/Thread.h"
10 // Merge7z includes
11 #include "tools.h"
12 #include "Merge7z.h"
13
14 using namespace NWindows;
15
16 extern HINSTANCE g_hInstance;
17 extern DWORD g_dwFlags;
18 extern CHAR g_cPath7z[MAX_PATH];
19
20 typedef UINT32 (WINAPI * CreateObjectFunc)(
21     const GUID *clsID, 
22     const GUID *interfaceID, 
23     void **outObject);
24
25 struct Format7zDLL
26 {
27         HMODULE origin;
28         CreateObjectFunc CreateObject;
29         HMODULE handle;
30         const CLSID *clsid;
31         struct Proxy;
32         interface Interface;
33 };
34
35 struct Format7zDLL::Proxy
36 {
37         LPCSTR Format7zDLL
38         [
39                 &((struct Format7zDLL *)0)->handle
40         -       &((struct Format7zDLL *)0)->origin
41         ];
42         HMODULE handle;
43         const CLSID *clsid;
44         struct Format7zDLL *operator->();
45 };
46
47 interface Format7zDLL::Interface : Merge7z::Format
48 {
49         Proxy &proxy;
50         Interface(Proxy &proxy):proxy(proxy)
51         {
52         }
53         virtual IInArchive *GetInArchive();
54         virtual HRESULT DeCompressArchive(HWND, LPCTSTR path, LPCTSTR folder);
55         virtual IOutArchive *GetOutArchive();
56         virtual HRESULT CompressArchive(HWND, LPCTSTR path, Merge7z::DirItemEnumerator *);
57 };
58