-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWinMergeScript.h
128 lines (105 loc) · 3.96 KB
/
WinMergeScript.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
// WinMergeScript.h : Declaration of the CWinMergeScript
#ifndef __WINMERGESCRIPT_H_
#define __WINMERGESCRIPT_H_
#include "resource.h" // main symbols
#include "stdafx.h"
// change 1 : add this include
#include "CbzDiffPlugin.h"
#include "typeinfoex.h"
/////////////////////////////////////////////////////////////////////////////
// CWinMergeScript
// change 2 : add this
typedef CComTypeInfoHolderModule<1> CComTypeInfoHolderFileOnly;
class ATL_NO_VTABLE CWinMergeScript
: public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CWinMergeScript, &CLSID_WinMergeScript>,
// change 3 : insert the text ", 1, 0, CComTypeInfoHolderFileOnly"
// public IDispatchImpl<IWinMergeScript, &IID_IWinMergeScript, &LIBID_CbzDiffPlugin>
public IDispatchImpl<IWinMergeScript, &IID_IWinMergeScript, &LIBID_CbzDiffPlugin, 1, 0,
CComTypeInfoHolderFileOnly>
{
public:
CWinMergeScript()
{
}
DECLARE_REGISTRY_RESOURCEID(IDR_WINMERGESCRIPT)
DECLARE_PROTECT_FINAL_CONSTRUCT()
BEGIN_COM_MAP(CWinMergeScript)
COM_INTERFACE_ENTRY(IWinMergeScript)
COM_INTERFACE_ENTRY(IDispatch)
END_COM_MAP()
// IWinMergeScript
public:
IFACEMETHODIMP ShowSettingsDialog(/*[out, retval]*/ VARIANT_BOOL *pbHandled) override;
IFACEMETHODIMP get_PluginIsAutomatic(/*[out, retval]*/ VARIANT_BOOL *pVal) override
{
*pVal = VARIANT_TRUE;
return S_OK;
}
IFACEMETHODIMP get_PluginFileFilters(/*[out, retval]*/ BSTR *pVal) override
{
*pVal = SysAllocString(LR"(\.cbz$;\.cbr$;\.cb7$)");
return S_OK;
}
IFACEMETHODIMP get_PluginDescription(/*[out, retval]*/ BSTR *pVal) override
{
*pVal = SysAllocString(L"Compare .CBZ/.CBR/.CB7 as Image");
return S_OK;
}
IFACEMETHODIMP get_PluginEvent(/*[out, retval]*/ BSTR *pVal) override;
IFACEMETHODIMP get_PluginUnpackedFileExtension(/* [retval][out] */ BSTR *pVal) override;
IFACEMETHODIMP get_PluginExtendedProperties(/* [retval][out] */ BSTR *pVal) override
{
*pVal = SysAllocString(L"ProcessType=Content Extraction;FileType=CBZ/CBR/CB7;MenuCaption=CBZ/CBR/CB7");
return S_OK;
}
IFACEMETHODIMP UnpackBufferA(
/* [in] */ SAFEARRAY **pBuffer,
/* [in] */ INT *pSize,
/* [in] */ VARIANT_BOOL *pbChanged,
/* [in] */ INT *pSubcode,
/* [retval][out] */ VARIANT_BOOL *pbSuccess) override;
IFACEMETHODIMP PackBufferA(
/* [in] */ SAFEARRAY **pBuffer,
/* [in] */ INT *pSize,
/* [in] */ VARIANT_BOOL *pbChanged,
/* [in] */ INT subcode,
/* [retval][out] */ VARIANT_BOOL *pbSuccess) override
{
*pbSuccess = VARIANT_FALSE;
return S_OK;
}
IFACEMETHODIMP UnpackFile(
/* [in] */ BSTR fileSrc,
/* [in] */ BSTR fileDst, VARIANT_BOOL *pbChanged, INT *pSubcode,
/* [retval][out] */ VARIANT_BOOL *pbSuccess) override;
IFACEMETHODIMP PackFile(
/* [in] */ BSTR fileSrc,
/* [in] */ BSTR fileDst, VARIANT_BOOL *pbChanged, INT pSubcode,
/* [retval][out] */ VARIANT_BOOL *pbSuccess) override
{
*pbSuccess = VARIANT_FALSE;
return S_OK;
}
IFACEMETHODIMP IsFolder(
/* [in] */ BSTR file,
/* [retval][out] */ VARIANT_BOOL *pbSuccess) override
{
*pbSuccess = VARIANT_TRUE; // always true
return S_OK;
}
IFACEMETHODIMP UnpackFolder(
/* [in] */ BSTR fileSrc,
/* [in] */ BSTR folderDst, VARIANT_BOOL *pbChanged, INT *pSubcode,
/* [retval][out] */ VARIANT_BOOL *pbSuccess) override;
IFACEMETHODIMP PackFolder(
/* [in] */ BSTR fileSrc,
/* [in] */ BSTR fileDst, VARIANT_BOOL *pbChanged, INT pSubcode,
/* [retval][out] */ VARIANT_BOOL *pbSuccess) override
{
*pbSuccess = VARIANT_FALSE;
return S_OK;
}
};
extern INT_PTR CALLBACK SettingDlgProc(HWND hWnd, UINT uiMsg, WPARAM wParam, LPARAM lParam) noexcept;
#endif //__WINMERGESCRIPT_H_