From ecb177cadbcff850a16c4b9e306beb15f61ac6f9 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 4 Nov 2012 18:51:53 +0000 Subject: kernel extraicons, part II git-svn-id: http://svn.miranda-ng.org/main/trunk@2188 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/New_GPG/src/init.cpp | 123 +++++++++++++++++++++---------------------- 1 file changed, 60 insertions(+), 63 deletions(-) (limited to 'plugins/New_GPG') diff --git a/plugins/New_GPG/src/init.cpp b/plugins/New_GPG/src/init.cpp index 8413f9734d..809613d024 100755 --- a/plugins/New_GPG/src/init.cpp +++ b/plugins/New_GPG/src/init.cpp @@ -24,8 +24,6 @@ list Accounts; HINSTANCE hInst; HANDLE hLoadPubKey = NULL, hToggleEncryption = NULL, hOnPreBuildContactMenu = NULL, hSendKey = NULL, g_hCLIcon = NULL, hExportGpgKeys = NULL, hImportGpgKeys = NULL; -IconExtraColumn g_IEC = {0}; -static int OnModulesLoaded(WPARAM wParam,LPARAM lParam); RECT key_from_keyserver_rect = {0}, firstrun_rect = {0}, new_key_rect = {0}, key_gen_rect = {0}, load_key_rect = {0}, import_key_rect = {0}, key_password_rect = {0}, load_existing_key_rect = {0}; XML_API xi = {0}; int hLangpack = 0; @@ -105,69 +103,8 @@ void init_vars() tabsrmm_used = isTabsrmmUsed(); } -extern "C" int __declspec(dllexport) Load() -{ - HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); - mir_getXI(&xi); //TODO: check if we have access to api - mir_getLP(&pluginInfo); - init_vars(); - CreateServiceFunction("/LoadPubKey",LoadKey); - CreateServiceFunction("/ToggleEncryption",ToggleEncryption); - CreateServiceFunction("/SendKey",SendKey); - CreateServiceFunction("/ExportGPGKeys",ExportGpGKeys); - CreateServiceFunction("/ImportGPGKeys",ImportGpGKeys); - - CLISTMENUITEM mi = {0}; - mi.cbSize=sizeof(mi); - mi.position=-0x7FFFFFFF; - mi.flags=CMIF_TCHAR; - mi.hIcon=LoadSkinnedIcon(SKINICON_OTHER_MIRANDA); - mi.ptszName=LPGENT("Load GPG public key"); - mi.pszService="/LoadPubKey"; - hLoadPubKey = Menu_AddContactMenuItem(&mi); - - ZeroMemory(&mi,sizeof(mi)); - mi.cbSize=sizeof(mi); - mi.position=-0x7FFFFFFe; - mi.flags=CMIF_TCHAR; - mi.hIcon=LoadSkinnedIcon(SKINICON_OTHER_MIRANDA); - mi.ptszName=LPGENT("Toggle GPG encryption"); - mi.pszService="/ToggleEncryption"; - hToggleEncryption = Menu_AddContactMenuItem(&mi); - - ZeroMemory(&mi,sizeof(mi)); - mi.cbSize=sizeof(mi); - mi.position=-0x7FFFFFFe; - mi.flags=CMIF_TCHAR; - mi.hIcon=LoadSkinnedIcon(SKINICON_OTHER_MIRANDA); - mi.ptszName=LPGENT("Send public key"); - mi.pszService="/SendKey"; - hSendKey = Menu_AddContactMenuItem(&mi); - - ZeroMemory(&mi,sizeof(mi)); - mi.cbSize=sizeof(mi); - mi.position=-0x7FFFFFFF; - mi.flags=CMIF_TCHAR; - mi.hIcon=LoadSkinnedIcon(SKINICON_OTHER_MIRANDA); - mi.ptszName=LPGENT("Export GPG Public keys from all users"); - mi.pszService="/ExportGPGKeys"; - hExportGpgKeys = Menu_AddMainMenuItem(&mi); - - ZeroMemory(&mi,sizeof(mi)); - mi.cbSize=sizeof(mi); - mi.position=-0x7FFFFFFF; - mi.flags=CMIF_TCHAR; - mi.hIcon=LoadSkinnedIcon(SKINICON_OTHER_MIRANDA); - mi.ptszName=LPGENT("Import GPG Public keys from all users"); - mi.pszService="/ImportGPGKeys"; - hImportGpgKeys = Menu_AddMainMenuItem(&mi); - - return 0; -} - static int OnModulesLoaded(WPARAM wParam,LPARAM lParam) { - int GpgOptInit(WPARAM wParam,LPARAM lParam); int OnPreBuildContactMenu(WPARAM w, LPARAM l); int RecvMsgSvc(WPARAM w, LPARAM l); @@ -246,6 +183,66 @@ static int OnModulesLoaded(WPARAM wParam,LPARAM lParam) return 0; } +extern "C" int __declspec(dllexport) Load() +{ + HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); + mir_getXI(&xi); //TODO: check if we have access to api + mir_getLP(&pluginInfo); + init_vars(); + CreateServiceFunction("/LoadPubKey",LoadKey); + CreateServiceFunction("/ToggleEncryption",ToggleEncryption); + CreateServiceFunction("/SendKey",SendKey); + CreateServiceFunction("/ExportGPGKeys",ExportGpGKeys); + CreateServiceFunction("/ImportGPGKeys",ImportGpGKeys); + + CLISTMENUITEM mi = {0}; + mi.cbSize=sizeof(mi); + mi.position=-0x7FFFFFFF; + mi.flags=CMIF_TCHAR; + mi.hIcon=LoadSkinnedIcon(SKINICON_OTHER_MIRANDA); + mi.ptszName=LPGENT("Load GPG public key"); + mi.pszService="/LoadPubKey"; + hLoadPubKey = Menu_AddContactMenuItem(&mi); + + ZeroMemory(&mi,sizeof(mi)); + mi.cbSize=sizeof(mi); + mi.position=-0x7FFFFFFe; + mi.flags=CMIF_TCHAR; + mi.hIcon=LoadSkinnedIcon(SKINICON_OTHER_MIRANDA); + mi.ptszName=LPGENT("Toggle GPG encryption"); + mi.pszService="/ToggleEncryption"; + hToggleEncryption = Menu_AddContactMenuItem(&mi); + + ZeroMemory(&mi,sizeof(mi)); + mi.cbSize=sizeof(mi); + mi.position=-0x7FFFFFFe; + mi.flags=CMIF_TCHAR; + mi.hIcon=LoadSkinnedIcon(SKINICON_OTHER_MIRANDA); + mi.ptszName=LPGENT("Send public key"); + mi.pszService="/SendKey"; + hSendKey = Menu_AddContactMenuItem(&mi); + + ZeroMemory(&mi,sizeof(mi)); + mi.cbSize=sizeof(mi); + mi.position=-0x7FFFFFFF; + mi.flags=CMIF_TCHAR; + mi.hIcon=LoadSkinnedIcon(SKINICON_OTHER_MIRANDA); + mi.ptszName=LPGENT("Export GPG Public keys from all users"); + mi.pszService="/ExportGPGKeys"; + hExportGpgKeys = Menu_AddMainMenuItem(&mi); + + ZeroMemory(&mi,sizeof(mi)); + mi.cbSize=sizeof(mi); + mi.position=-0x7FFFFFFF; + mi.flags=CMIF_TCHAR; + mi.hIcon=LoadSkinnedIcon(SKINICON_OTHER_MIRANDA); + mi.ptszName=LPGENT("Import GPG Public keys from all users"); + mi.pszService="/ImportGPGKeys"; + hImportGpgKeys = Menu_AddMainMenuItem(&mi); + + return 0; +} + extern list transfers; extern "C" int __declspec(dllexport) Unload(void) { -- cgit v1.2.3