summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2014-08-12 20:36:33 +0000
committerKirill Volinsky <mataes2007@gmail.com>2014-08-12 20:36:33 +0000
commit5d55c351109d18bb46b97c7e6142f6f321595849 (patch)
treee0423a19189dadc6ca8b5b72dd881aa97a2c1ea7
parent2e2390295cbf3f8f24a938bf957d3ecd5b86d3a6 (diff)
icons registration moved to Load()
git-svn-id: http://svn.miranda-ng.org/main/trunk@10173 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/Alarms/src/alarms.cpp8
-rw-r--r--plugins/AuthState/src/main.cpp6
-rw-r--r--plugins/BuddyExpectator/src/BuddyExpectator.cpp12
-rw-r--r--plugins/ChangeKeyboardLayout/src/commonheaders.h1
-rw-r--r--plugins/ChangeKeyboardLayout/src/hook_events.cpp12
-rw-r--r--plugins/ChangeKeyboardLayout/src/main.cpp14
-rw-r--r--plugins/Console/src/Console.cpp12
-rw-r--r--plugins/Console/src/commonheaders.h1
-rw-r--r--plugins/Console/src/init.cpp16
-rw-r--r--plugins/DbEditorPP/src/main.cpp6
-rw-r--r--plugins/Db_autobackups/src/main.cpp4
-rw-r--r--plugins/FTPFileYM/src/ftpfile.cpp5
-rw-r--r--plugins/IgnoreState/src/main.cpp6
-rw-r--r--plugins/ListeningTo/src/listeningto.cpp18
-rw-r--r--plugins/MenuItemEx/src/main.cpp7
-rw-r--r--plugins/MirOTR/MirOTR/src/dllmain.cpp3
-rw-r--r--plugins/MobileState/src/main.cpp6
-rw-r--r--plugins/MyDetails/src/mydetails.cpp9
18 files changed, 81 insertions, 65 deletions
diff --git a/plugins/Alarms/src/alarms.cpp b/plugins/Alarms/src/alarms.cpp
index a7e8e391bb..5c38706ce8 100644
--- a/plugins/Alarms/src/alarms.cpp
+++ b/plugins/Alarms/src/alarms.cpp
@@ -172,9 +172,6 @@ static int InitTopToolbarButton(WPARAM wParam, LPARAM lParam)
static int MainInit(WPARAM wparam,LPARAM lparam)
{
- // initialize icons
- InitIcons();
-
// TopToolbar support
HookEvent(ME_TTB_MODULELOADED, InitTopToolbarButton);
@@ -205,7 +202,10 @@ extern "C" int __declspec(dllexport) Load(void)
LoadOptions();
InitList();
- HookEvent(ME_OPT_INITIALISE, OptInit );
+ // initialize icons
+ InitIcons();
+
+ HookEvent(ME_OPT_INITIALISE, OptInit);
return 0;
}
diff --git a/plugins/AuthState/src/main.cpp b/plugins/AuthState/src/main.cpp
index be989b00e2..62d63b1b72 100644
--- a/plugins/AuthState/src/main.cpp
+++ b/plugins/AuthState/src/main.cpp
@@ -165,9 +165,6 @@ static IconItem iconList[] =
int onModulesLoaded(WPARAM, LPARAM)
{
- // IcoLib support
- Icon_Register(g_hInst, "Auth State", iconList, SIZEOF(iconList));
-
// Set initial value for all contacts
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
onExtraImageApplying(hContact, 1);
@@ -211,6 +208,9 @@ extern "C" int __declspec(dllexport) Load(void)
hUserMenu = Menu_AddContactMenuItem(&mi);
}
+ // IcoLib support
+ Icon_Register(g_hInst, "Auth State", iconList, SIZEOF(iconList));
+
// extra icons
hExtraIcon = ExtraIcon_Register("authstate", LPGEN("Auth State"), "authgrant_icon");
diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp
index fa0dcb9876..091c912a6b 100644
--- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp
+++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp
@@ -614,12 +614,6 @@ int ModulesLoaded(WPARAM, LPARAM)
////////////////////////////////////////////////////////////////////////////
- Icon_Register(hInst, "BuddyExpectator", iconList, SIZEOF(iconList));
-
- HookEvent(ME_SKIN2_ICONSCHANGED, onIconsChanged);
-
- onIconsChanged(0,0);
-
if (options.enableMissYou) {
HookEvent(ME_CLIST_PREBUILDCONTACTMENU, onPrebuildContactMenu);
@@ -702,6 +696,12 @@ extern "C" int __declspec(dllexport) Load(void)
db_set_dw(hContact, MODULE_NAME, "CreationTime", current_time);
}
+ Icon_Register(hInst, "BuddyExpectator", iconList, SIZEOF(iconList));
+
+ HookEvent(ME_SKIN2_ICONSCHANGED, onIconsChanged);
+
+ onIconsChanged(0, 0);
+
hExtraIcon = ExtraIcon_Register("buddy_exp", LPGEN("Buddy Expectator"), "enabled_icon");
return 0;
diff --git a/plugins/ChangeKeyboardLayout/src/commonheaders.h b/plugins/ChangeKeyboardLayout/src/commonheaders.h
index 3692b5a59b..1160595f75 100644
--- a/plugins/ChangeKeyboardLayout/src/commonheaders.h
+++ b/plugins/ChangeKeyboardLayout/src/commonheaders.h
@@ -110,5 +110,6 @@ extern MainOptions moOptions;
extern PopupOptions poOptions, poOptionsTemp;
LRESULT CALLBACK Keyboard_Hook(int code, WPARAM wParam, LPARAM lParam);
+int OnIconsChanged(WPARAM wParam, LPARAM lParam);
#endif \ No newline at end of file
diff --git a/plugins/ChangeKeyboardLayout/src/hook_events.cpp b/plugins/ChangeKeyboardLayout/src/hook_events.cpp
index 5033843923..8253c9c7ab 100644
--- a/plugins/ChangeKeyboardLayout/src/hook_events.cpp
+++ b/plugins/ChangeKeyboardLayout/src/hook_events.cpp
@@ -93,12 +93,6 @@ int OnIconsChanged(WPARAM wParam, LPARAM lParam)
return 0;
}
-static IconItem iconList[] =
-{
- { LPGEN("Popup"), "ckl_popup_icon", IDI_POPUPICON },
- { LPGEN("Copy to clipboard"), "ckl_copy_icon", IDI_COPYICON }
-};
-
int ModulesLoaded(WPARAM wParam, LPARAM lParam)
{
LPCTSTR ptszEmptySting = _T("");
@@ -138,12 +132,6 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam)
hGetLayoutOfText = CreateServiceFunction(MS_CKL_GETLAYOUTOFTEXT, APIGetLayoutOfText);
hChangeTextLayout = CreateServiceFunction(MS_CKL_CHANGETEXTLAYOUT, APIChangeTextLayout);
- // IcoLib support
- Icon_Register(hInst, ModuleName, iconList, SIZEOF(iconList));
-
- HookEvent(ME_SKIN2_ICONSCHANGED, OnIconsChanged);
-
- OnIconsChanged(0, 0);
RegPopupActions();
db_set_dw(NULL, ModuleName, "CurrentVer", PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM));
diff --git a/plugins/ChangeKeyboardLayout/src/main.cpp b/plugins/ChangeKeyboardLayout/src/main.cpp
index f2ea678b30..ae2c9e9a88 100644
--- a/plugins/ChangeKeyboardLayout/src/main.cpp
+++ b/plugins/ChangeKeyboardLayout/src/main.cpp
@@ -43,6 +43,12 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfoEx;
}
+static IconItem iconList[] =
+{
+ { LPGEN("Popup"), "ckl_popup_icon", IDI_POPUPICON },
+ { LPGEN("Copy to clipboard"), "ckl_copy_icon", IDI_COPYICON }
+};
+
extern "C" __declspec(dllexport) int Load(void)
{
mir_getLP(&pluginInfoEx);
@@ -53,6 +59,14 @@ extern "C" __declspec(dllexport) int Load(void)
HookEvent(ME_OPT_INITIALISE, OnOptionsInitialise);
HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
+
+ // IcoLib support
+ Icon_Register(hInst, ModuleName, iconList, SIZEOF(iconList));
+
+ HookEvent(ME_SKIN2_ICONSCHANGED, OnIconsChanged);
+
+ OnIconsChanged(0, 0);
+
return 0;
}
diff --git a/plugins/Console/src/Console.cpp b/plugins/Console/src/Console.cpp
index ee237b8df7..907d77b9d2 100644
--- a/plugins/Console/src/Console.cpp
+++ b/plugins/Console/src/Console.cpp
@@ -115,21 +115,13 @@ static int Openfile(TCHAR *outputFile, int selection);
static HANDLE hTTBButt = 0;
-static IconItem iconList[] =
-{
- { "Show", "Console_Up", IDI_BTN_UP },
- { "Hide", "Console_Down", IDI_BTN_DN },
-};
-
static int OnTTBLoaded(WPARAM wParam,LPARAM lParam)
{
int state = IsWindowVisible(hwndConsole);
- Icon_Register(hInst, "Console", iconList, SIZEOF(iconList));
-
TTBButton ttb = { sizeof(ttb) };
- ttb.hIconHandleUp = iconList[0].hIcolib;
- ttb.hIconHandleDn = iconList[1].hIcolib;
+ ttb.hIconHandleUp = LoadIcon(IDI_BTN_UP);
+ ttb.hIconHandleDn = LoadIcon(IDI_BTN_DN);
ttb.dwFlags = (state ? TTBBF_PUSHED : 0) | TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
ttb.pszService = MS_CONSOLE_SHOW_HIDE;
ttb.name = LPGEN("Show/Hide Console");
diff --git a/plugins/Console/src/commonheaders.h b/plugins/Console/src/commonheaders.h
index d41768aaeb..d83748550b 100644
--- a/plugins/Console/src/commonheaders.h
+++ b/plugins/Console/src/commonheaders.h
@@ -49,5 +49,6 @@ extern HINSTANCE hInst;
void InitConsole();
void ShutdownConsole();
+HANDLE LoadIcon(int iIconID);
#define MS_NETLIB_LOGWIN "Netlib/Log/Win"
diff --git a/plugins/Console/src/init.cpp b/plugins/Console/src/init.cpp
index 0b8637c1dc..1d68a1c76e 100644
--- a/plugins/Console/src/init.cpp
+++ b/plugins/Console/src/init.cpp
@@ -53,10 +53,26 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfoEx;
}
+static IconItem iconList[] =
+{
+ { "Show", "Console_Up", IDI_BTN_UP },
+ { "Hide", "Console_Down", IDI_BTN_DN },
+};
+
+HANDLE LoadIcon(int iIconID)
+{
+ for (int i = 0; i < SIZEOF(iconList); i++)
+ if (iconList[i].defIconID == iIconID)
+ return iconList[i].hIcolib;
+ return NULL;
+}
+
extern "C" __declspec(dllexport) int Load(void)
{
mir_getLP(&pluginInfoEx);
+ Icon_Register(hInst, "Console", iconList, SIZEOF(iconList));
+
InitCommonControls();
InitConsole();
return 0;
diff --git a/plugins/DbEditorPP/src/main.cpp b/plugins/DbEditorPP/src/main.cpp
index 1245c39541..74dd0b2574 100644
--- a/plugins/DbEditorPP/src/main.cpp
+++ b/plugins/DbEditorPP/src/main.cpp
@@ -143,9 +143,6 @@ static int OnTTBLoaded(WPARAM wParam, LPARAM lParam)
int ModulesLoaded(WPARAM wParam, LPARAM lParam)
{
- // icons
- addIcons();
-
// Register menu item
CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 1900000001;
@@ -220,6 +217,9 @@ extern "C" __declspec(dllexport) int Load(void)
{
mir_getLP(&pluginInfoEx);
+ // icons
+ addIcons();
+
hwnd2mainWindow = hwnd2watchedVarsWindow = hwnd2importWindow = 0;
hRestore = NULL;
g_db = GetCurrentDatabase();
diff --git a/plugins/Db_autobackups/src/main.cpp b/plugins/Db_autobackups/src/main.cpp
index a078599f50..79ea056065 100644
--- a/plugins/Db_autobackups/src/main.cpp
+++ b/plugins/Db_autobackups/src/main.cpp
@@ -42,8 +42,6 @@ static void FoldersInit(void)
static void MenuInit(void)
{
- Icon_Register(hInst, LPGEN("Database")"/"LPGEN("Database backups"), iconList, SIZEOF(iconList));
-
CLISTMENUITEM mi = { sizeof(mi) };
mi.pszPopupName = LPGEN("Database");
@@ -95,6 +93,8 @@ void SysInit()
HookEvent(ME_OPT_INITIALISE, OptionsInit);
HookEvent(ME_SYSTEM_PRESHUTDOWN, PreShutdown);
HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoad);
+
+ Icon_Register(hInst, LPGEN("Database")"/"LPGEN("Database backups"), iconList, SIZEOF(iconList));
}
BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
diff --git a/plugins/FTPFileYM/src/ftpfile.cpp b/plugins/FTPFileYM/src/ftpfile.cpp
index 16c452c027..ef6ffd166a 100644
--- a/plugins/FTPFileYM/src/ftpfile.cpp
+++ b/plugins/FTPFileYM/src/ftpfile.cpp
@@ -378,9 +378,7 @@ INT_PTR MainMenuService(WPARAM wParam, LPARAM lParam)
int ModulesLoaded(WPARAM, LPARAM)
{
- InitIcolib();
InitMenuItems();
- InitHotkeys();
InitTabsrmmButton();
SkinAddNewSoundEx(SOUND_UPCOMPLETE, LPGEN("FTP File"), LPGEN("File upload complete"));
@@ -429,6 +427,9 @@ extern "C" int __declspec(dllexport) Load(void)
hServiceContactMenu = CreateServiceFunction(MS_FTPFILE_CONTACTMENU, ContactMenuService);
hServiceMainMenu = CreateServiceFunction(MS_FTPFILE_MAINMENU, MainMenuService);
+ InitIcolib();
+ InitHotkeys();
+
opt.loadOptions();
deleteTimer.init();
ftpList.init();
diff --git a/plugins/IgnoreState/src/main.cpp b/plugins/IgnoreState/src/main.cpp
index d97e81254b..3f46a7856b 100644
--- a/plugins/IgnoreState/src/main.cpp
+++ b/plugins/IgnoreState/src/main.cpp
@@ -133,9 +133,6 @@ int onModulesLoaded(WPARAM wParam,LPARAM lParam)
{
HookEvent(ME_OPT_INITIALISE, onOptInitialise);
- //IcoLib support
- Icon_Register(g_hInst, LPGEN("Ignore State"), iconList, SIZEOF(iconList));
-
fill_filter();
// Set initial value for all contacts
@@ -169,6 +166,9 @@ extern "C" int __declspec(dllexport) Load(void)
HookEvent(ME_SYSTEM_MODULESLOADED, onModulesLoaded);
HookEvent(ME_DB_CONTACT_SETTINGCHANGED, onContactSettingChanged);
+ //IcoLib support
+ Icon_Register(g_hInst, LPGEN("Ignore State"), iconList, SIZEOF(iconList));
+
hExtraIcon = ExtraIcon_Register("ignore", LPGEN("Ignore State"), "ignore_full");
return 0;
diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp
index 7b9253b3ab..7dcceb47b1 100644
--- a/plugins/ListeningTo/src/listeningto.cpp
+++ b/plugins/ListeningTo/src/listeningto.cpp
@@ -103,6 +103,12 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
+static IconItem iconList[] =
+{
+ { LPGEN("Listening to (enabled)"), "listening_to_icon", IDI_LISTENINGTO },
+ { LPGEN("Listening to (disabled)"), "listening_off_icon", IDI_LISTENINGOFF },
+};
+
extern "C" int __declspec(dllexport) Load(void)
{
mir_getLP(&pluginInfo);
@@ -133,6 +139,9 @@ extern "C" int __declspec(dllexport) Load(void)
InitMusic();
InitOptions();
+ // icons
+ Icon_Register(hInst, LPGEN("ListeningTo"), iconList, SIZEOF(iconList));
+
// Extra icon support
hExtraIcon = ExtraIcon_Register(MODULE_NAME "_icon", LPGEN("Listening to music"), "listening_to_icon");
@@ -271,19 +280,10 @@ int AccListChanged(WPARAM wParam, LPARAM lParam)
// Called when all the modules are loaded
-static IconItem iconList[] =
-{
- { LPGEN("Listening to (enabled)"), "listening_to_icon", IDI_LISTENINGTO },
- { LPGEN("Listening to (disabled)"), "listening_off_icon", IDI_LISTENINGOFF },
-};
-
int ModulesLoaded(WPARAM, LPARAM)
{
EnableDisablePlayers();
- // icons
- Icon_Register(hInst, LPGEN("ListeningTo"), iconList, SIZEOF(iconList));
-
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
char *proto = GetContactProto(hContact);
if (proto != NULL) {
diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp
index 702a585406..337237a28a 100644
--- a/plugins/MenuItemEx/src/main.cpp
+++ b/plugins/MenuItemEx/src/main.cpp
@@ -964,9 +964,6 @@ static int PluginInit(WPARAM wparam, LPARAM lparam)
{
int pos = 1000, i = 0;
- Icon_Register(hinstance, LPGEN("MenuItemEx"), iconList, SIZEOF(iconList));
- Icon_Register(hinstance, LPGEN("MenuItemEx"), overlayIconList, SIZEOF(overlayIconList));
-
CreateServiceFunction(MS_SETINVIS, onSetInvis);
CreateServiceFunction(MS_SETVIS, onSetVis);
CreateServiceFunction(MS_HIDE, onHide);
@@ -1096,6 +1093,10 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
extern "C" __declspec(dllexport) int Load(void)
{
mir_getLP(&pluginInfoEx);
+
+ Icon_Register(hinstance, LPGEN("MenuItemEx"), iconList, SIZEOF(iconList));
+ Icon_Register(hinstance, LPGEN("MenuItemEx"), overlayIconList, SIZEOF(overlayIconList));
+
HookEvent(ME_SYSTEM_MODULESLOADED, PluginInit);
HookEvent(ME_SYSTEM_MODULELOAD, ModuleLoad);
HookEvent(ME_SYSTEM_MODULEUNLOAD, ModuleLoad);
diff --git a/plugins/MirOTR/MirOTR/src/dllmain.cpp b/plugins/MirOTR/MirOTR/src/dllmain.cpp
index b7327db69b..55f8eef436 100644
--- a/plugins/MirOTR/MirOTR/src/dllmain.cpp
+++ b/plugins/MirOTR/MirOTR/src/dllmain.cpp
@@ -43,7 +43,6 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam)
InitOptions();
InitDBFilter();
- InitIcons();
InitMenu();
InitSRMM();
@@ -67,6 +66,8 @@ extern "C" __declspec(dllexport) int Load(void)
/* for timezones
mir_getTMI(&tmi); */
+ InitIcons();
+
OTRL_INIT;
INITCOMMONCONTROLSEX icce = {0};
icce.dwSize = sizeof(icce);
diff --git a/plugins/MobileState/src/main.cpp b/plugins/MobileState/src/main.cpp
index 467359d2ca..c78672e85a 100644
--- a/plugins/MobileState/src/main.cpp
+++ b/plugins/MobileState/src/main.cpp
@@ -95,9 +95,6 @@ int onContactSettingChanged(WPARAM wParam,LPARAM lParam)
int onModulesLoaded(WPARAM wParam,LPARAM lParam)
{
- // IcoLib support
- Icon_Register(g_hInst, "Mobile State", &icon, 1);
-
// Set initial value for all contacts
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
ExtraIconsApply(hContact, 1);
@@ -113,6 +110,9 @@ extern "C" int __declspec(dllexport) Load(void)
HookEvent(ME_DB_CONTACT_SETTINGCHANGED, onContactSettingChanged);
HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, ExtraIconsApply);
+ // IcoLib support
+ Icon_Register(g_hInst, "Mobile State", &icon, 1);
+
// Extra icons
hExtraIcon = ExtraIcon_Register("mobilestate", LPGEN("Mobile State"), "mobile_icon");
diff --git a/plugins/MyDetails/src/mydetails.cpp b/plugins/MyDetails/src/mydetails.cpp
index 0ccf19a2d5..ac4c362c89 100644
--- a/plugins/MyDetails/src/mydetails.cpp
+++ b/plugins/MyDetails/src/mydetails.cpp
@@ -594,10 +594,6 @@ static int MainInit(WPARAM wparam, LPARAM lparam)
InitFrames();
- if (Skin_GetIcon("LISTENING_TO_ICON") == NULL)
- Icon_Register(hInst, LPGEN("Contact list"), iconList, 1);
-
- Icon_Register(hInst, LPGEN("My details"), iconList + 1, SIZEOF(iconList) - 1);
return 0;
}
@@ -624,6 +620,11 @@ extern "C" __declspec(dllexport) int Load()
// Options
InitOptions();
+ if (Skin_GetIcon("LISTENING_TO_ICON") == NULL)
+ Icon_Register(hInst, LPGEN("Contact list"), iconList, 1);
+
+ Icon_Register(hInst, LPGEN("My details"), iconList + 1, SIZEOF(iconList) - 1);
+
// Register services
CreateServiceFunction(MS_MYDETAILS_SETMYNICKNAME, PluginCommand_SetMyNickname);
CreateServiceFunction(MS_MYDETAILS_SETMYNICKNAMEUI, PluginCommand_SetMyNicknameUI);