-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfiletags.cpp
More file actions
97 lines (81 loc) · 2.25 KB
/
filetags.cpp
File metadata and controls
97 lines (81 loc) · 2.25 KB
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
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4121)
#endif // _MSC_VER
#include <windows.h>
#include <Shlobj.h>
#include <initguid.h>
#include <string.h>
#include <plugin.hpp>
#include <CRT/crt.hpp>
#include <PluginSettings.hpp>
#include <DlgBuilder.hpp>
#include "mix.hpp"
#include "filetagslng.hpp"
#include "guid.hpp"
#include "version.hpp"
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#if defined(__GNUC__)
#ifdef __cplusplus
extern "C"
{
#endif
BOOL WINAPI DllMainCRTStartup(HANDLE hDll,DWORD dwReason,LPVOID lpReserved);
#ifdef __cplusplus
};
#endif
BOOL WINAPI DllMainCRTStartup(HANDLE hDll,DWORD dwReason,LPVOID lpReserved)
{
(void) hDll;
(void) dwReason;
(void) lpReserved;
return TRUE;
}
#endif
struct Options Opt;
struct PluginStartupInfo Info;
struct FarStandardFunctions FSF;
PanelNotifier notifier;
void WINAPI GetGlobalInfoW(struct GlobalInfo *Info)
{
Info->StructSize=sizeof(GlobalInfo);
Info->MinFarVersion=MAKEFARVERSION(3, 0, 0, 2927, VS_RELEASE);
Info->Version=MAKEFARVERSION(PLUGIN_MAJOR, PLUGIN_MINOR, 0, 0, VS_RELEASE);
Info->Guid=MainGuid;
Info->Title=PLUGIN_NAME;
Info->Description=PLUGIN_DESC;
Info->Author=PLUGIN_AUTHOR;
}
void WINAPI SetStartupInfoW(const struct PluginStartupInfo *Info)
{
::Info=*Info;
::FSF=*Info->FSF;
::Info.FSF=&::FSF;
PluginSettings settings(MainGuid, ::Info.SettingsControl);
Opt.ExactMatch = settings.Get(0, OptionExactMatch, 0);
Opt.TagMarker = settings.Get(0, OptionTagMarker, L"");
Opt.StorePanelMode = settings.Get(0, OptionStorePanelMode, 1);
Opt.PanelMode = settings.Get(0, OptionPanelMode, 6);
}
intptr_t WINAPI ConfigureW(const ConfigureInfo* CInfo)
{
return Config(CInfo);
}
void WINAPI GetPluginInfoW(struct PluginInfo *Info)
{
Info->StructSize=sizeof(*Info);
Info->Flags=0;
Info->CommandPrefix = L"tags";
static const wchar_t *PluginMenuStrings[1];
PluginMenuStrings[0]=GetMsg(MPluginsMenuString);
Info->PluginMenu.Guids=&ConfigMenuGuid;
Info->PluginMenu.Strings=PluginMenuStrings;
Info->PluginMenu.Count=ARRAYSIZE(PluginMenuStrings);
static const wchar_t *PluginCfgStrings[1];
PluginCfgStrings[0]=GetMsg(MPluginsCfgMenuString);
Info->PluginConfig.Guids=&ConfigMenuGuid;
Info->PluginConfig.Strings=PluginCfgStrings;
Info->PluginConfig.Count=ARRAYSIZE(PluginCfgStrings);
}