summaryrefslogtreecommitdiff
path: root/plugins/UserInfoEx
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-26 23:41:55 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-26 23:41:55 +0000
commit25221b7d2afb70f82eb3805330fd39a6f6708049 (patch)
tree6fdd3eb5c5642788e1f8286385b15535f9a7ec16 /plugins/UserInfoEx
parentef81e9edc10e2478f514e1fbfb0828ad1e7d8e49 (diff)
mk: removed all LIST_INTERFACE, MI_INTERFACE & UTF8_INTERFACE instances.
all related functions moved to mir_core. git-svn-id: http://svn.miranda-ng.org/main/trunk@644 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/UserInfoEx')
-rw-r--r--plugins/UserInfoEx/commonheaders.cpp22
-rw-r--r--plugins/UserInfoEx/commonheaders.h9
-rw-r--r--plugins/UserInfoEx/init.cpp137
3 files changed, 72 insertions, 96 deletions
diff --git a/plugins/UserInfoEx/commonheaders.cpp b/plugins/UserInfoEx/commonheaders.cpp
index f74cb2261e..608d7ddbfc 100644
--- a/plugins/UserInfoEx/commonheaders.cpp
+++ b/plugins/UserInfoEx/commonheaders.cpp
@@ -31,10 +31,6 @@ Last change by : $Author: ing.u.horn $
// global:
HINSTANCE ghInst = NULL;
-MM_INTERFACE mmi; //memory interface
-UTF8_INTERFACE utfi; //utf8 interface
-LIST_INTERFACE li; //list interface
-//XML_API xi; //for late use
TIME_API tmi; //timezone interface
FI_INTERFACE *FIP = NULL; //freeimage interface
CLIST_INTERFACE *pcli = NULL;
@@ -57,7 +53,7 @@ pfnDwmIsCompositionEnabled dwmIsCompositionEnabled;
DWORD hashSetting(LPCSTR szStr)
{
#if defined _M_IX86 && !defined _NUMEGA_BC_FINALCHECK && !defined NOINLINEASM
- __asm
+ __asm
{
xor edx,edx
xor eax,eax
@@ -82,7 +78,7 @@ DWORD hashSetting(LPCSTR szStr)
DWORD hash = 0;
int i;
int shift = 0;
- for (i = 0; szStr[i]; i++)
+ for (i = 0; szStr[i]; i++)
{
hash ^= szStr[i] << shift;
if (shift > 24)
@@ -95,7 +91,7 @@ DWORD hashSetting(LPCSTR szStr)
#endif
}
-// MurmurHash2
+// MurmurHash2
#ifdef _DEBUG
#pragma optimize( "gt", on )
#endif
@@ -116,17 +112,17 @@ unsigned int __fastcall hash_M2(const void * key, unsigned int len)
{
unsigned int k = *(unsigned int *)data;
- k *= m;
- k ^= k >> r;
- k *= m;
-
- h *= m;
+ k *= m;
+ k ^= k >> r;
+ k *= m;
+
+ h *= m;
h ^= k;
data += 4;
len -= 4;
}
-
+
// Handle the last few bytes of the input array
switch(len)
{
diff --git a/plugins/UserInfoEx/commonheaders.h b/plugins/UserInfoEx/commonheaders.h
index de1ac528f8..e7b4f51bad 100644
--- a/plugins/UserInfoEx/commonheaders.h
+++ b/plugins/UserInfoEx/commonheaders.h
@@ -171,11 +171,7 @@ typedef struct _MGLOBAL
extern HINSTANCE ghInst;
extern MGLOBAL myGlobals;
-extern MM_INTERFACE mmi;
-extern LIST_INTERFACE li;
-extern UTF8_INTERFACE utfi;
-//extern TIME_API tmi;
-extern FI_INTERFACE *FIP;
+extern FI_INTERFACE* FIP;
/***********************************************************************************************************
* MIRANDA_CPP_PLUGIN_API
@@ -183,7 +179,7 @@ extern FI_INTERFACE *FIP;
/**
* These macros provide an interface for classes to use member
- * function as services and event hooks.
+ * function as services and event hooks.
*
* @note This requires Miranda Core 0.8+!
*
@@ -236,4 +232,3 @@ static FORCEINLINE BOOLEAN IsAeroMode()
BOOL result;
return myGlobals.WantAeroAdaption && dwmIsCompositionEnabled && (dwmIsCompositionEnabled(&result) == S_OK) && result;
}
-
diff --git a/plugins/UserInfoEx/init.cpp b/plugins/UserInfoEx/init.cpp
index 1cab813504..d1a1a47bcc 100644
--- a/plugins/UserInfoEx/init.cpp
+++ b/plugins/UserInfoEx/init.cpp
@@ -60,7 +60,7 @@ static PLUGININFOEX pluginInfo = {
__AUTHOR,
__AUTHOREMAIL,
__COPYRIGHT,
- __AUTHORWEB,
+ __AUTHORWEB,
UNICODE_AWARE,
DEFMOD_UIUSERINFO,
MIID_UIUSERINFOEX
@@ -89,7 +89,7 @@ PLUGINLINK* pluginLink = NULL;
*
* @return always 0
**/
-static INT OnTopToolBarLoaded(WPARAM wParam, LPARAM lParam)
+static INT OnTopToolBarLoaded(WPARAM wParam, LPARAM lParam)
{
UnhookEvent(ghTopToolBarLoaded);
DlgAnniversaryListOnTopToolBarLoaded();
@@ -106,7 +106,7 @@ static INT OnTopToolBarLoaded(WPARAM wParam, LPARAM lParam)
*
* @return always 0
**/
-static INT OnModernToolBarLoaded(WPARAM wParam, LPARAM lParam)
+static INT OnModernToolBarLoaded(WPARAM wParam, LPARAM lParam)
{
UnhookEvent(ghModernToolBarLoaded);
DlgAnniversaryListOnToolBarLoaded();
@@ -122,15 +122,8 @@ static INT OnModernToolBarLoaded(WPARAM wParam, LPARAM lParam)
*
* @return always 0
**/
-static INT OnModulesLoaded(WPARAM wParam, LPARAM lParam)
+static INT OnModulesLoaded(WPARAM wParam, LPARAM lParam)
{
-#ifdef _DEBUG
- #define new DEBUG_NEW;
- int tmpFlag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
- tmpFlag |= _CRTDBG_LEAK_CHECK_DF;
- _CrtSetDbgFlag(tmpFlag);
-// _CrtSetBreakAlloc(4852);
-#endif
INT_PTR ptr;
UnhookEvent(ghModulesLoadedHook);
@@ -160,13 +153,13 @@ static INT OnModulesLoaded(WPARAM wParam, LPARAM lParam)
#ifdef _DEBUG // new feature, not in release jet
NServices::NAvatar::OnModulesLoaded();
#endif
-
+
// build contact's menuitems
RebuildMenu();
ghPrebuildStatusMenu = HookEvent( ME_CLIST_PREBUILDSTATUSMENU, (MIRANDAHOOK)RebuildAccount);
// finally register for updater
- if (ServiceExists(MS_UPDATE_REGISTER))
+ if (ServiceExists(MS_UPDATE_REGISTER))
{
Update update = {0};
CHAR szVersion[16];
@@ -176,7 +169,7 @@ static INT OnModulesLoaded(WPARAM wParam, LPARAM lParam)
update.cpbVersion = (INT)strlen((LPSTR)update.pbVersion);
update.szUpdateURL = UPDATER_AUTOREGISTER;
-
+
update.szBetaVersionURL = "http://userinfoex.googlecode.com/svn/trunk/changelog.txt";
// bytes occuring in VersionURL before the version, used to locate the version information within the URL data
// e.g. change '[0.8.1.0 (in work)]' to 'UserinfoEx: 0.8.1.0' for beta versions bump
@@ -243,7 +236,7 @@ static BOOL CoreCheck()
bOk *= (GetVersion() & 0x80000000) == 0;
bOk *= strstr(szVer, "unicode") != 0;
-
+
bOk *= _tcsstr(_tcsrchr(tszExePath, '\\'), _T("miranda")) != 0;
bOk *= !strstr(szVer, "coffee") && strncmp(szVer, "1.", 2) && !strstr(szVer, " 1.");
bOk *= myGlobals.mirandaVersion < PLUGIN_MAKE_VERSION(1,0,0,0);
@@ -261,7 +254,7 @@ static BOOL CoreCheck()
*
* @return pointer to pluginInfo struct
**/
-extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD mirandaVersion)
{
myGlobals.mirandaVersion = mirandaVersion;
return &pluginInfo;
@@ -277,7 +270,7 @@ extern "C" __declspec(dllexport) const MUUID *MirandaPluginInterfaces()
static const MUUID interfaces[] = {
MIID_UIUSERINFOEX, // this is just me
MIID_UIUSERINFO, // replace the default userinfo module
- MIID_CONTACTINFO, // indicate, that MS_CONTACT_GETCONTACTINFO service is provided
+ MIID_CONTACTINFO, // indicate, that MS_CONTACT_GETCONTACTINFO service is provided
MIID_REMINDER, // indicate an Reminder of being provided
MIID_SREMAIL, // Send/Receive E-Mail service is provided
MIID_LAST
@@ -315,66 +308,59 @@ extern "C" INT __declspec(dllexport) Load(PLUGINLINK *link)
ZeroMemory(&myGlobals, sizeof(MGLOBAL));
- // init miranda's memory interface
- if (!mir_getMMI(&mmi) && !mir_getLI(&li) && !mir_getUTFI(&utfi) /*&& mir_getXI(&xi)*/)
- {
+ // init clist interface
+ pcli = (CLIST_INTERFACE*)CallService(MS_CLIST_RETRIEVE_INTERFACE, 0, (LPARAM)0);
+
+ // init new miranda timezone interface
+ mir_getTMI(&tmi);
- // init clist interface
- pcli = (CLIST_INTERFACE*)CallService(MS_CLIST_RETRIEVE_INTERFACE, 0, (LPARAM)0);
-
- // init new miranda timezone interface
- mir_getTMI(&tmi);
-
- // init freeimage interface
- INT_PTR result = CALLSERVICE_NOTFOUND;
- if(ServiceExists(MS_IMG_GETINTERFACE))
- result = CallService(MS_IMG_GETINTERFACE, FI_IF_VERSION, (LPARAM)&FIP);
-
- if(FIP == NULL || result != S_OK) {
- MessageBoxEx(NULL, TranslateT("Fatal error, image services not found. Flags Module will be disabled."), _T("Error"), MB_OK | MB_ICONERROR | MB_APPLMODAL, 0);
- return 1;
- }
-
- if (IsWinVerVistaPlus())
- {
- HMODULE hDwmApi = LoadLibraryA("dwmapi.dll");
- if (hDwmApi)
- {
- dwmIsCompositionEnabled = (pfnDwmIsCompositionEnabled)GetProcAddress(hDwmApi,"DwmIsCompositionEnabled");
- }
- }
-
- // check for dbx_tree
- myGlobals.UseDbxTree = ServiceExists("DBT/Entity/GetRoot");
-
- // load icon library
- IcoLib_LoadModule();
-
- SvcFlagsLoadModule();
- tmi.getTimeZoneTime ? SvcTimezoneLoadModule() : SvcTimezoneLoadModule_old();
- SvcContactInfoLoadModule();
- SvcEMailLoadModule();
- SvcRefreshContactInfoLoadModule();
-
- CtrlContactLoadModule();
- // load my button class
- CtrlButtonLoadModule();
- // initializes the Ex/Import Services
- SvcExImport_LoadModule();
- // load the UserInfoPropertySheet module
- DlgContactInfoLoadModule();
-
- // Anniversary stuff
- DlgAnniversaryListLoadModule();
- SvcReminderLoadModule();
-
- // Now the module is loaded! Start initializing certain things
- ghModulesLoadedHook = HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
- ghTopToolBarLoaded = HookEvent(ME_TTB_MODULELOADED, OnTopToolBarLoaded);
- ghModernToolBarLoaded = HookEvent(ME_TB_MODULELOADED, OnModernToolBarLoaded);
- ghShutdownHook = HookEvent(ME_SYSTEM_SHUTDOWN, OnShutdown);
- return 0;
+ // init freeimage interface
+ INT_PTR result = CALLSERVICE_NOTFOUND;
+ if(ServiceExists(MS_IMG_GETINTERFACE))
+ result = CallService(MS_IMG_GETINTERFACE, FI_IF_VERSION, (LPARAM)&FIP);
+
+ if(FIP == NULL || result != S_OK) {
+ MessageBoxEx(NULL, TranslateT("Fatal error, image services not found. Flags Module will be disabled."), _T("Error"), MB_OK | MB_ICONERROR | MB_APPLMODAL, 0);
+ return 1;
+ }
+
+ if (IsWinVerVistaPlus())
+ {
+ HMODULE hDwmApi = LoadLibraryA("dwmapi.dll");
+ if (hDwmApi)
+ dwmIsCompositionEnabled = (pfnDwmIsCompositionEnabled)GetProcAddress(hDwmApi,"DwmIsCompositionEnabled");
}
+
+ // check for dbx_tree
+ myGlobals.UseDbxTree = ServiceExists("DBT/Entity/GetRoot");
+
+ // load icon library
+ IcoLib_LoadModule();
+
+ SvcFlagsLoadModule();
+ tmi.getTimeZoneTime ? SvcTimezoneLoadModule() : SvcTimezoneLoadModule_old();
+ SvcContactInfoLoadModule();
+ SvcEMailLoadModule();
+ SvcRefreshContactInfoLoadModule();
+
+ CtrlContactLoadModule();
+ // load my button class
+ CtrlButtonLoadModule();
+ // initializes the Ex/Import Services
+ SvcExImport_LoadModule();
+ // load the UserInfoPropertySheet module
+ DlgContactInfoLoadModule();
+
+ // Anniversary stuff
+ DlgAnniversaryListLoadModule();
+ SvcReminderLoadModule();
+
+ // Now the module is loaded! Start initializing certain things
+ ghModulesLoadedHook = HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
+ ghTopToolBarLoaded = HookEvent(ME_TTB_MODULELOADED, OnTopToolBarLoaded);
+ ghModernToolBarLoaded = HookEvent(ME_TB_MODULELOADED, OnModernToolBarLoaded);
+ ghShutdownHook = HookEvent(ME_SYSTEM_SHUTDOWN, OnShutdown);
+ return 0;
}
return 1;
}
@@ -393,4 +379,3 @@ BOOL WINAPI DllMain(HINSTANCE hinst, DWORD fdwReason, LPVOID lpvReserved)
}
return TRUE;
}
-