diff options
Diffstat (limited to 'plugins/New_GPG/src/init.cpp')
-rwxr-xr-x | plugins/New_GPG/src/init.cpp | 78 |
1 files changed, 41 insertions, 37 deletions
diff --git a/plugins/New_GPG/src/init.cpp b/plugins/New_GPG/src/init.cpp index db4f6cc28e..cfc89ded5f 100755 --- a/plugins/New_GPG/src/init.cpp +++ b/plugins/New_GPG/src/init.cpp @@ -22,7 +22,7 @@ CMPlugin g_plugin; ///////////////////////////////////////////////////////////////////////////////////////// -PLUGININFOEX pluginInfo={ +PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX), __PLUGIN_NAME, PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), @@ -35,9 +35,13 @@ PLUGININFOEX pluginInfo={ { 0x4227c050, 0x8d97, 0x48d2, { 0x91, 0xec, 0x6a, 0x95, 0x2b, 0x3d, 0xab, 0x94 } } }; +CMPlugin::CMPlugin() : + PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx) +{} + extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) { - return &pluginInfo; + return &pluginInfoEx; } ///////////////////////////////////////////////////////////////////////////////////////// @@ -53,34 +57,34 @@ void InitIconLib(); void init_vars() { - globals.bAppendTags = db_get_b(NULL, szGPGModuleName, "bAppendTags", 0) != 0; - globals.bStripTags = db_get_b(NULL, szGPGModuleName, "bStripTags", 0) != 0; - globals.inopentag = UniGetContactSettingUtf(NULL, szGPGModuleName, "szInOpenTag", L"<GPGdec>"); - globals.inclosetag = UniGetContactSettingUtf(NULL, szGPGModuleName, "szInCloseTag", L"</GPGdec>"); - globals.outopentag = UniGetContactSettingUtf(NULL, szGPGModuleName, "szOutOpenTag", L"<GPGenc>"); - globals.outclosetag = UniGetContactSettingUtf(NULL, szGPGModuleName, "szOutCloseTag", L"</GPGenc>"); - globals.bDebugLog = db_get_b(NULL, szGPGModuleName, "bDebugLog", 0) != 0; - globals.bAutoExchange = db_get_b(NULL, szGPGModuleName, "bAutoExchange", 0) != 0; - globals.bSameAction = db_get_b(NULL, szGPGModuleName, "bSameAction", 0) != 0; - globals.password = UniGetContactSettingUtf(NULL, szGPGModuleName, "szKeyPassword", L""); + globals.bAppendTags = db_get_b(NULL, MODULENAME, "bAppendTags", 0) != 0; + globals.bStripTags = db_get_b(NULL, MODULENAME, "bStripTags", 0) != 0; + globals.inopentag = UniGetContactSettingUtf(NULL, MODULENAME, "szInOpenTag", L"<GPGdec>"); + globals.inclosetag = UniGetContactSettingUtf(NULL, MODULENAME, "szInCloseTag", L"</GPGdec>"); + globals.outopentag = UniGetContactSettingUtf(NULL, MODULENAME, "szOutOpenTag", L"<GPGenc>"); + globals.outclosetag = UniGetContactSettingUtf(NULL, MODULENAME, "szOutCloseTag", L"</GPGenc>"); + globals.bDebugLog = db_get_b(NULL, MODULENAME, "bDebugLog", 0) != 0; + globals.bAutoExchange = db_get_b(NULL, MODULENAME, "bAutoExchange", 0) != 0; + globals.bSameAction = db_get_b(NULL, MODULENAME, "bSameAction", 0) != 0; + globals.password = UniGetContactSettingUtf(NULL, MODULENAME, "szKeyPassword", L""); globals.debuglog.init(); - globals.bJabberAPI = db_get_b(NULL, szGPGModuleName, "bJabberAPI", true) != 0; - globals.bPresenceSigning = db_get_b(NULL, szGPGModuleName, "bPresenceSigning", 0) != 0; - globals.bFileTransfers = db_get_b(NULL, szGPGModuleName, "bFileTransfers", 0) != 0; - globals.firstrun_rect.left = db_get_dw(NULL, szGPGModuleName, "FirstrunWindowX", 0); - globals.firstrun_rect.top = db_get_dw(NULL, szGPGModuleName, "FirstrunWindowY", 0); - globals.key_password_rect.left = db_get_dw(NULL, szGPGModuleName, "PasswordWindowX", 0); - globals.key_password_rect.top = db_get_dw(NULL, szGPGModuleName, "PasswordWindowY", 0); - globals.key_gen_rect.left = db_get_dw(NULL, szGPGModuleName, "KeyGenWindowX", 0); - globals.key_gen_rect.top = db_get_dw(NULL, szGPGModuleName, "KeyGenWindowY", 0); - globals.load_key_rect.left = db_get_dw(NULL, szGPGModuleName, "LoadKeyWindowX", 0); - globals.load_key_rect.top = db_get_dw(NULL, szGPGModuleName, "LoadKeyWindowY", 0); - globals.import_key_rect.left = db_get_dw(NULL, szGPGModuleName, "ImportKeyWindowX", 0); - globals.import_key_rect.top = db_get_dw(NULL, szGPGModuleName, "ImportKeyWindowY", 0); - globals.new_key_rect.left = db_get_dw(NULL, szGPGModuleName, "NewKeyWindowX", 0); - globals.new_key_rect.top = db_get_dw(NULL, szGPGModuleName, "NewKeyWindowY", 0); - globals.load_existing_key_rect.left = db_get_dw(NULL, szGPGModuleName, "LoadExistingKeyWindowX", 0); - globals.load_existing_key_rect.top = db_get_dw(NULL, szGPGModuleName, "LoadExistingKeyWindowY", 0); + globals.bJabberAPI = db_get_b(NULL, MODULENAME, "bJabberAPI", true) != 0; + globals.bPresenceSigning = db_get_b(NULL, MODULENAME, "bPresenceSigning", 0) != 0; + globals.bFileTransfers = db_get_b(NULL, MODULENAME, "bFileTransfers", 0) != 0; + globals.firstrun_rect.left = db_get_dw(NULL, MODULENAME, "FirstrunWindowX", 0); + globals.firstrun_rect.top = db_get_dw(NULL, MODULENAME, "FirstrunWindowY", 0); + globals.key_password_rect.left = db_get_dw(NULL, MODULENAME, "PasswordWindowX", 0); + globals.key_password_rect.top = db_get_dw(NULL, MODULENAME, "PasswordWindowY", 0); + globals.key_gen_rect.left = db_get_dw(NULL, MODULENAME, "KeyGenWindowX", 0); + globals.key_gen_rect.top = db_get_dw(NULL, MODULENAME, "KeyGenWindowY", 0); + globals.load_key_rect.left = db_get_dw(NULL, MODULENAME, "LoadKeyWindowX", 0); + globals.load_key_rect.top = db_get_dw(NULL, MODULENAME, "LoadKeyWindowY", 0); + globals.import_key_rect.left = db_get_dw(NULL, MODULENAME, "ImportKeyWindowX", 0); + globals.import_key_rect.top = db_get_dw(NULL, MODULENAME, "ImportKeyWindowY", 0); + globals.new_key_rect.left = db_get_dw(NULL, MODULENAME, "NewKeyWindowX", 0); + globals.new_key_rect.top = db_get_dw(NULL, MODULENAME, "NewKeyWindowY", 0); + globals.load_existing_key_rect.left = db_get_dw(NULL, MODULENAME, "LoadExistingKeyWindowX", 0); + globals.load_existing_key_rect.top = db_get_dw(NULL, MODULENAME, "LoadExistingKeyWindowY", 0); globals.tabsrmm_used = isTabsrmmUsed(); globals.bold_font = CreateFont(14, 0, 0, 0, 600, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 0, L"Arial"); } @@ -102,11 +106,11 @@ static int OnModulesLoaded(WPARAM, LPARAM) void InitCheck(); void FirstRun(); FirstRun(); - if(!db_get_b(NULL, szGPGModuleName, "FirstRun", 1)) + if(!db_get_b(NULL, MODULENAME, "FirstRun", 1)) InitCheck(); StatusIconData sid = {}; - sid.szModule = szGPGModuleName; + sid.szModule = MODULENAME; sid.flags = MBF_HIDDEN; sid.dwId = 0x00000001; sid.hIcon = IcoLib_GetIcon("secured"); @@ -133,18 +137,18 @@ static int OnModulesLoaded(WPARAM, LPARAM) HookEvent(ME_MSG_WINDOWEVENT, onWindowEvent); HookEvent(ME_MSG_ICONPRESSED, onIconPressed); - Proto_RegisterModule(PROTOTYPE_ENCRYPTION, szGPGModuleName); + Proto_RegisterModule(PROTOTYPE_ENCRYPTION, MODULENAME); - CreateProtoServiceFunction(szGPGModuleName, PSR_MESSAGE, RecvMsgSvc); - CreateProtoServiceFunction(szGPGModuleName, PSS_MESSAGE, SendMsgSvc); - CreateProtoServiceFunction(szGPGModuleName, PSS_FILE, onSendFile); + CreateProtoServiceFunction(MODULENAME, PSR_MESSAGE, RecvMsgSvc); + CreateProtoServiceFunction(MODULENAME, PSS_MESSAGE, SendMsgSvc); + CreateProtoServiceFunction(MODULENAME, PSS_FILE, onSendFile); clean_temp_dir(); return 0; } extern "C" int __declspec(dllexport) Load() { - mir_getLP(&pluginInfo); + mir_getLP(&pluginInfoEx); HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); @@ -195,7 +199,7 @@ extern "C" int __declspec(dllexport) Load() InitIconLib(); - globals.g_hCLIcon = ExtraIcon_RegisterCallback(szGPGModuleName, Translate("GPG encryption status"), "secured", onExtraImageListRebuilding, onExtraImageApplying); + globals.g_hCLIcon = ExtraIcon_RegisterCallback(MODULENAME, Translate("GPG encryption status"), "secured", onExtraImageListRebuilding, onExtraImageApplying); return 0; } |