diff options
author | mataes2007 <mataes2007@e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb> | 2011-12-31 16:11:05 +0000 |
---|---|---|
committer | mataes2007 <mataes2007@e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb> | 2011-12-31 16:11:05 +0000 |
commit | f39683393b0f9c31559ef05c824774541d9a19be (patch) | |
tree | 715aca7e40f104ea9839d2ec1bcbf8dfb7d017e3 | |
parent | 85863331bd2920991e8e7093a472e60d749b4a7a (diff) |
patch by FREAK_THEMIGHTY:
add x64 support
added context-sensitive langpacks support
git-svn-id: http://miranda-plugins.googlecode.com/svn/trunk@252 e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb
-rw-r--r-- | SecureIM/commonheaders.cpp | 17 | ||||
-rw-r--r-- | SecureIM/commonheaders.h | 5 | ||||
-rw-r--r-- | SecureIM/crypt_popups.cpp | 4 | ||||
-rw-r--r-- | SecureIM/main.cpp | 49 | ||||
-rw-r--r-- | SecureIM/options.cpp | 12 | ||||
-rw-r--r-- | SecureIM/options.h | 10 |
6 files changed, 40 insertions, 57 deletions
diff --git a/SecureIM/commonheaders.cpp b/SecureIM/commonheaders.cpp index aa6c454..e3b51a0 100644 --- a/SecureIM/commonheaders.cpp +++ b/SecureIM/commonheaders.cpp @@ -1,8 +1,6 @@ #include "commonheaders.h"
HINSTANCE g_hInst, g_hIconInst;
-PLUGINLINK *pluginLink;
-MM_INTERFACE mmi = {0};
MUUID interfaces[] = {MIID_SECUREIM, MIID_LAST};
LPCSTR szModuleName = MODULENAME;
@@ -28,19 +26,6 @@ BYTE bADV, bPGP, bGPG; DWORD iCoreVersion = 0;
CRITICAL_SECTION localQueueMutex;
-PLUGININFO pluginInfo = {
- sizeof(PLUGININFO),
- MODULENAME" (2in1)",
- __VERSION_DWORD,
- MODULENAME" plugin for Miranda IM ("__DATE__")",
- "Johell, Ghost, Nightwish, __alex, Baloo",
- "Johell@ifrance.com, baloo@bk.ru",
- "© 2003 Johell, © 2005-09 Baloo",
- "http://addons.miranda-im.org/details.php?action=viewfile&id=2445",
- 0, 0
-};
-
-
PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
MODULENAME" (2in1)",
@@ -70,7 +55,7 @@ LPSTR myDBGetString(HANDLE hContact,const char *szModule,const char *szSetting) LPSTR myDBGetStringDecode(HANDLE hContact,const char *szModule,const char *szSetting) {
char *val = myDBGetString(hContact,szModule,szSetting);
if(!val) return NULL;
- int len = strlen(val)+64;
+ size_t len = strlen(val)+64;
char *buf = (LPSTR)mir_alloc(len);
strncpy(buf,val,len); mir_free(val);
CallService(MS_DB_CRYPT_DECODESTRING,(WPARAM)len,(LPARAM)buf);
diff --git a/SecureIM/commonheaders.h b/SecureIM/commonheaders.h index 2bf7228..f383756 100644 --- a/SecureIM/commonheaders.h +++ b/SecureIM/commonheaders.h @@ -43,6 +43,7 @@ #define M_SIM_COMMONHEADERS_H
#define MIRANDA_VER 0x0700
+#define MIRANDA_CUSTOM_LP
#include <m_stdhdr.h>
// Windows API
@@ -131,10 +132,7 @@ extern int TEMP_SIZE; // shared vars
extern HINSTANCE g_hInst, g_hIconInst;
-extern PLUGINLINK *pluginLink;
-extern PLUGININFO pluginInfo;
extern PLUGININFOEX pluginInfoEx;
-extern MM_INTERFACE mmi;
extern MUUID interfaces[];
#define MIID_SECUREIM {0x1B2A39E5, 0xE2F6, 0x494D, { 0x95, 0x8D, 0x18, 0x08, 0xFD, 0x11, 0x0D, 0xD5 }} //1B2A39E5-E2F6-494D-958D-1808FD110DD5
@@ -147,7 +145,6 @@ extern MUUID interfaces[]; extern "C" {
DLLEXPORT int Load(PLUGINLINK *);
- DLLEXPORT PLUGININFO *MirandaPluginInfo(DWORD);
DLLEXPORT PLUGININFOEX *MirandaPluginInfoEx(DWORD);
DLLEXPORT MUUID* MirandaPluginInterfaces(void);
DLLEXPORT int Unload();
diff --git a/SecureIM/crypt_popups.cpp b/SecureIM/crypt_popups.cpp index 0a33652..768423e 100644 --- a/SecureIM/crypt_popups.cpp +++ b/SecureIM/crypt_popups.cpp @@ -90,7 +90,7 @@ void showPopUp(LPCSTR lpzText,HANDLE hContact,HICON hIcon, UINT type) { // ppd.PluginData = NULL;
//Now that every field has been filled, we want to see the popup.
- CallService(MS_POPUP_ADDPOPUPW, (WPARAM)&ppd, 0);
+ PUAddPopUpW(&ppd);
}
else {
POPUPDATAEX ppd = {0};
@@ -109,7 +109,7 @@ void showPopUp(LPCSTR lpzText,HANDLE hContact,HICON hIcon, UINT type) { // ppd.PluginData = NULL;
//Now that every field has been filled, we want to see the popup.
- CallService(MS_POPUP_ADDPOPUPEX, (WPARAM)&ppd, 0);
+ PUAddPopUpEx(&ppd);
}
}
diff --git a/SecureIM/main.cpp b/SecureIM/main.cpp index 00844d8..b1f71e0 100644 --- a/SecureIM/main.cpp +++ b/SecureIM/main.cpp @@ -1,5 +1,9 @@ #include "commonheaders.h"
+PLUGINLINK *pluginLink;
+MM_INTERFACE mmi = {0};
+int hLangpack = 0;
+
extern "C" BOOL APIENTRY DllMain(HINSTANCE hInst, DWORD dwReason, LPVOID) {
g_hInst = hInst;
if (dwReason == DLL_PROCESS_ATTACH) {
@@ -12,11 +16,6 @@ extern "C" BOOL APIENTRY DllMain(HINSTANCE hInst, DWORD dwReason, LPVOID) { }
-PLUGININFO *MirandaPluginInfo(DWORD mirandaVersion) {
- return &pluginInfo;
-}
-
-
PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) {
return &pluginInfoEx;
}
@@ -59,7 +58,7 @@ HANDLE AddMenuItem(LPCSTR name,int pos,HICON hicon,LPCSTR service,int flags=0,WP mi.flags=flags | CMIF_HIDDEN;
mi.position=pos;
mi.hIcon=hicon;
- mi.pszName=Translate(name);
+ mi.pszName= (char*)name;
mi.pszPopupName=(char*)-1;
mi.pszService=(char*)service;
return((HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,wParam,(LPARAM)&mi));
@@ -75,7 +74,7 @@ HANDLE AddSubItem(HANDLE rootid,LPCSTR name,int pos,int poppos,LPCSTR service,WP mi.position=pos;
mi.popupPosition=poppos;
mi.hIcon=NULL;
- mi.pszName=Translate(name);
+ mi.pszName=(char*)name;
mi.pszPopupName=(char*)rootid;
mi.pszService=(char*)service;
return((HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,wParam,(LPARAM)&mi));
@@ -101,6 +100,8 @@ int __cdecl Load(PLUGINLINK *link) { // get memoryManagerInterface address
mir_getMMI( &mmi );
+ //get per-plugin langpack interface
+ mir_getLP(&pluginInfoEx);
// check for support TrueColor Icons
BOOL bIsComCtl6 = FALSE;
@@ -152,20 +153,20 @@ int __cdecl Load(PLUGINLINK *link) { g_hEvent[0] = CreateHookableEvent(MODULENAME"/Disabled");
g_hEvent[1] = CreateHookableEvent(MODULENAME"/Established");
- AddServiceFunction((LPCSTR)MODULENAME"/IsContactSecured",(MIRANDASERVICE)Service_IsContactSecured);
- AddServiceFunction((LPCSTR)MODULENAME"/SIM_EST",(MIRANDASERVICE)Service_CreateIM);
- AddServiceFunction((LPCSTR)MODULENAME"/SIM_DIS",(MIRANDASERVICE)Service_DisableIM);
- AddServiceFunction((LPCSTR)MODULENAME"/SIM_ST_DIS",(MIRANDASERVICE)Service_StatusDis);
- AddServiceFunction((LPCSTR)MODULENAME"/SIM_ST_ENA",(MIRANDASERVICE)Service_StatusEna);
- AddServiceFunction((LPCSTR)MODULENAME"/SIM_ST_TRY",(MIRANDASERVICE)Service_StatusTry);
- AddServiceFunction((LPCSTR)MODULENAME"/PGP_SET",(MIRANDASERVICE)Service_PGPsetKey);
- AddServiceFunction((LPCSTR)MODULENAME"/PGP_DEL",(MIRANDASERVICE)Service_PGPdelKey);
- AddServiceFunction((LPCSTR)MODULENAME"/GPG_SET",(MIRANDASERVICE)Service_GPGsetKey);
- AddServiceFunction((LPCSTR)MODULENAME"/GPG_DEL",(MIRANDASERVICE)Service_GPGdelKey);
- AddServiceFunction((LPCSTR)MODULENAME"/MODE_NAT",(MIRANDASERVICE)Service_ModeNative);
- AddServiceFunction((LPCSTR)MODULENAME"/MODE_PGP",(MIRANDASERVICE)Service_ModePGP);
- AddServiceFunction((LPCSTR)MODULENAME"/MODE_GPG",(MIRANDASERVICE)Service_ModeGPG);
- AddServiceFunction((LPCSTR)MODULENAME"/MODE_RSA",(MIRANDASERVICE)Service_ModeRSAAES);
+ AddServiceFunction(MODULENAME"/IsContactSecured",Service_IsContactSecured);
+ AddServiceFunction(MODULENAME"/SIM_EST",Service_CreateIM);
+ AddServiceFunction(MODULENAME"/SIM_DIS",Service_DisableIM);
+ AddServiceFunction(MODULENAME"/SIM_ST_DIS",Service_StatusDis);
+ AddServiceFunction(MODULENAME"/SIM_ST_ENA",Service_StatusEna);
+ AddServiceFunction(MODULENAME"/SIM_ST_TRY",Service_StatusTry);
+ AddServiceFunction(MODULENAME"/PGP_SET",Service_PGPsetKey);
+ AddServiceFunction(MODULENAME"/PGP_DEL",Service_PGPdelKey);
+ AddServiceFunction(MODULENAME"/GPG_SET",Service_GPGsetKey);
+ AddServiceFunction(MODULENAME"/GPG_DEL",Service_GPGdelKey);
+ AddServiceFunction(MODULENAME"/MODE_NAT",Service_ModeNative);
+ AddServiceFunction(MODULENAME"/MODE_PGP",Service_ModePGP);
+ AddServiceFunction(MODULENAME"/MODE_GPG",Service_ModeGPG);
+ AddServiceFunction(MODULENAME"/MODE_RSA",Service_ModeRSAAES);
return 0;
}
@@ -385,8 +386,8 @@ int __cdecl onModulesLoaded(WPARAM wParam,LPARAM lParam) { if( ServiceExists(MS_EXTRAICON_REGISTER) ) {
g_hCLIcon = ExtraIcon_Register(szModuleName, Translate("SecureIM status"), "sim_cm_est",
- (MIRANDAHOOK)onExtraImageListRebuilding,
- (MIRANDAHOOK)onExtraImageApplying);
+ onExtraImageListRebuilding,
+ onExtraImageApplying);
}
else {
AddHookFunction(ME_CLIST_EXTRA_LIST_REBUILD, onExtraImageListRebuilding);
@@ -466,7 +467,7 @@ int __cdecl onModulesLoaded(WPARAM wParam,LPARAM lParam) { // updater plugin support
if(ServiceExists(MS_UPDATE_REGISTERFL)) {
- CallService(MS_UPDATE_REGISTERFL, (WPARAM)2445, (LPARAM)&pluginInfo);
+ CallService(MS_UPDATE_REGISTERFL, (WPARAM)2445, (LPARAM)&pluginInfoEx);
}
#if defined(_DEBUG) || defined(NETLIB_LOG)
diff --git a/SecureIM/options.cpp b/SecureIM/options.cpp index e93057d..e2ba837 100644 --- a/SecureIM/options.cpp +++ b/SecureIM/options.cpp @@ -99,7 +99,7 @@ void LV_GetItemTextA(HWND hwnd, WPARAM wparam, int iSubItem, LPSTR text, int cch * tabbed options dialog
*/
-BOOL CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
+INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
static int iInit = TRUE;
TCITEM tci;
@@ -225,7 +225,7 @@ BOOL CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) }
-BOOL CALLBACK DlgProcOptionsGeneral(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lParam) {
+INT_PTR CALLBACK DlgProcOptionsGeneral(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lParam) {
static int iInit = TRUE;
static HIMAGELIST hLarge, hSmall;
@@ -556,7 +556,7 @@ BOOL CALLBACK DlgProcOptionsGeneral(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM }
-BOOL CALLBACK DlgProcOptionsProto(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lParam) {
+INT_PTR CALLBACK DlgProcOptionsProto(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lParam) {
static int iInit = TRUE;
char buf[32];
@@ -701,7 +701,7 @@ BOOL CALLBACK DlgProcOptionsProto(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lP static BOOL bPGP9;
-BOOL CALLBACK DlgProcOptionsPGP(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lParam) {
+INT_PTR CALLBACK DlgProcOptionsPGP(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lParam) {
static int iInit = TRUE;
static HIMAGELIST hLarge, hSmall;
@@ -853,7 +853,7 @@ BOOL CALLBACK DlgProcOptionsPGP(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lPar }
-BOOL CALLBACK DlgProcOptionsGPG(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lParam) {
+INT_PTR CALLBACK DlgProcOptionsGPG(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lParam) {
static int iInit = TRUE;
static HIMAGELIST hLarge, hSmall;
@@ -1926,7 +1926,7 @@ int onRegisterOptions(WPARAM wParam, LPARAM) { odp.hInstance = g_hInst;
odp.pszTemplate = MAKEINTRESOURCE(IDD_OPTIONSTAB);
odp.pszTitle = (char*)szModuleName;
- odp.pszGroup = Translate("Services");
+ odp.pszGroup = LPGEN("Services");
odp.pfnDlgProc = OptionsDlgProc;
CallService(MS_OPT_ADDPAGE, wParam, (LPARAM)&odp);
return 0;
diff --git a/SecureIM/options.h b/SecureIM/options.h index 4bcfcd8..c87a0de 100644 --- a/SecureIM/options.h +++ b/SecureIM/options.h @@ -1,11 +1,11 @@ #ifndef __OPTIONS_H__
#define __OPTIONS_H__
-BOOL CALLBACK OptionsDlgProc(HWND,UINT,WPARAM,LPARAM);
-BOOL CALLBACK DlgProcOptionsGeneral(HWND,UINT,WPARAM,LPARAM);
-BOOL CALLBACK DlgProcOptionsProto(HWND,UINT,WPARAM,LPARAM);
-BOOL CALLBACK DlgProcOptionsPGP(HWND,UINT,WPARAM,LPARAM);
-BOOL CALLBACK DlgProcOptionsGPG(HWND,UINT,WPARAM,LPARAM);
+INT_PTR CALLBACK OptionsDlgProc(HWND,UINT,WPARAM,LPARAM);
+INT_PTR CALLBACK DlgProcOptionsGeneral(HWND,UINT,WPARAM,LPARAM);
+INT_PTR CALLBACK DlgProcOptionsProto(HWND,UINT,WPARAM,LPARAM);
+INT_PTR CALLBACK DlgProcOptionsPGP(HWND,UINT,WPARAM,LPARAM);
+INT_PTR CALLBACK DlgProcOptionsGPG(HWND,UINT,WPARAM,LPARAM);
BOOL CALLBACK DlgProcSetPSK(HWND,UINT,WPARAM,LPARAM);
BOOL CALLBACK DlgProcSetPassphrase(HWND,UINT,WPARAM,LPARAM);
void ApplyGeneralSettings(HWND);
|