diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-14 13:17:26 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-14 13:17:26 +0000 |
commit | 02ed4455c23e3562d71bfc80a0e2c4fede8708f1 (patch) | |
tree | 115a3d24e4a3877cd28bd4ff2d9d4011b790cc5f /plugins/MirOTR/src | |
parent | c72584d6b934b37dbd18d5f15ffb24a140e1e3f2 (diff) |
- all icolib services removed;
- IcoLib_* functions are bound directly to the code
git-svn-id: http://svn.miranda-ng.org/main/trunk@14161 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirOTR/src')
-rw-r--r-- | plugins/MirOTR/src/icons.cpp | 21 | ||||
-rw-r--r-- | plugins/MirOTR/src/icons.h | 4 | ||||
-rw-r--r-- | plugins/MirOTR/src/mirotrmenu.cpp | 16 | ||||
-rw-r--r-- | plugins/MirOTR/src/otr.cpp | 4 | ||||
-rw-r--r-- | plugins/MirOTR/src/svcs_menu.cpp | 4 | ||||
-rw-r--r-- | plugins/MirOTR/src/svcs_srmm.cpp | 26 |
6 files changed, 25 insertions, 50 deletions
diff --git a/plugins/MirOTR/src/icons.cpp b/plugins/MirOTR/src/icons.cpp index ca38927383..fa92c1804c 100644 --- a/plugins/MirOTR/src/icons.cpp +++ b/plugins/MirOTR/src/icons.cpp @@ -1,7 +1,5 @@ #include "stdafx.h"
-TCHAR g_dllpath[1024];
-
static IconItem iconList[] = {
{ LPGEN(LANG_ICON_OTR), ICON_OTR, IDI_OTR },
{ LPGEN(LANG_ICON_PRIVATE), ICON_PRIVATE, IDI_PRIVATE },
@@ -15,22 +13,3 @@ void InitIcons() {
Icon_Register(hInst, "OTR", iconList, SIZEOF(iconList));
}
-
-HICON LoadIcon(const char* name, int big) {
- return Skin_GetIcon(name, big);
-}
-
-HANDLE GetIconHandle(const char* name)
-{
- return Skin_GetIconHandle(name);
-}
-
-void ReleaseIcon(const char* name, int big)
-{
- Skin_ReleaseIcon(name, big);
-}
-
-void ReleaseIcon(HICON handle, int big)
-{
- Skin_ReleaseIcon(handle);
-}
diff --git a/plugins/MirOTR/src/icons.h b/plugins/MirOTR/src/icons.h index 039b455773..a366517bdc 100644 --- a/plugins/MirOTR/src/icons.h +++ b/plugins/MirOTR/src/icons.h @@ -7,7 +7,3 @@ #define ICON_REFRESH (MODULENAME"_refresh")
void InitIcons();
-HICON LoadIcon(const char* name, int big);
-HANDLE GetIconHandle(const char* name);
-void ReleaseIcon(const char* name, int big);
-void ReleaseIcon(HICON handle, int big);
\ No newline at end of file diff --git a/plugins/MirOTR/src/mirotrmenu.cpp b/plugins/MirOTR/src/mirotrmenu.cpp index c616756954..6c685d11f8 100644 --- a/plugins/MirOTR/src/mirotrmenu.cpp +++ b/plugins/MirOTR/src/mirotrmenu.cpp @@ -106,25 +106,25 @@ INT_PTR MirOTRMenuCheckService(WPARAM wParam,LPARAM) mi.flags = CMIM_NAME | CMIM_ICON | CMIF_TCHAR; switch (level) { case TRUST_PRIVATE:{ - mi.hIcolibItem = GetIconHandle(ICON_PRIVATE); + mi.hIcolibItem = IcoLib_GetIconHandle(ICON_PRIVATE); mir_tstrncpy(text,TranslateT(LANG_STATUS_PRIVATE),SIZEOF(text)); size_t len = mir_tstrlen(text); if(len < SIZEOF(text)) mir_sntprintf(text+len, SIZEOF(text)-len, _T(" [v%i]"), context->protocol_version); break;} case TRUST_UNVERIFIED:{ - mi.hIcolibItem = GetIconHandle(ICON_UNVERIFIED); + mi.hIcolibItem = IcoLib_GetIconHandle(ICON_UNVERIFIED); mir_tstrncpy(text,TranslateT(LANG_STATUS_UNVERIFIED),SIZEOF(text)); size_t len = mir_tstrlen(text); if(len < SIZEOF(text)) mir_sntprintf(text+len, SIZEOF(text)-len, _T(" [v%i]"), context->protocol_version); break;} case TRUST_FINISHED: - mi.hIcolibItem = GetIconHandle(ICON_FINISHED); + mi.hIcolibItem = IcoLib_GetIconHandle(ICON_FINISHED); mi.ptszName = TranslateT(LANG_STATUS_FINISHED); break; default: - mi.hIcolibItem = GetIconHandle(ICON_NOT_PRIVATE); + mi.hIcolibItem = IcoLib_GetIconHandle(ICON_NOT_PRIVATE); mi.ptszName = TranslateT(LANG_STATUS_DISABLED); } CallService(MO_MODIFYMENUITEM, (WPARAM)hStatusInfoItem, (LPARAM)&mi); @@ -228,28 +228,28 @@ void InitMirOTRMenu(void) mi.ptszName = LANG_MENU_START; mi.position = 100001; mi.pszService = MS_OTR_MENUSTART; - mi.icolibItem = GetIconHandle(ICON_UNVERIFIED); + mi.icolibItem = IcoLib_GetIconHandle(ICON_UNVERIFIED); AddMirOTRMenuItem(0, (LPARAM) &mi); mi.flags = CMIF_TCHAR | CMIF_NOTNOTPRIVATE | CMIF_NOTFINISHED; mi.ptszName = LANG_MENU_REFRESH; mi.position = 100002; mi.pszService = MS_OTR_MENUREFRESH; - mi.icolibItem = GetIconHandle(ICON_FINISHED); + mi.icolibItem = IcoLib_GetIconHandle(ICON_FINISHED); AddMirOTRMenuItem(0, (LPARAM) &mi); mi.flags = CMIF_TCHAR | CMIF_NOTNOTPRIVATE; mi.ptszName = LANG_MENU_STOP; mi.position = 100003; mi.pszService = MS_OTR_MENUSTOP; - mi.icolibItem = GetIconHandle(ICON_NOT_PRIVATE); + mi.icolibItem = IcoLib_GetIconHandle(ICON_NOT_PRIVATE); AddMirOTRMenuItem(0, (LPARAM) &mi); mi.flags = CMIF_TCHAR | CMIF_NOTNOTPRIVATE | CMIF_NOTFINISHED; mi.ptszName = LANG_MENU_VERIFY; mi.position = 200001; mi.pszService = MS_OTR_MENUVERIFY; - mi.icolibItem = GetIconHandle(ICON_PRIVATE); + mi.icolibItem = IcoLib_GetIconHandle(ICON_PRIVATE); AddMirOTRMenuItem(0, (LPARAM) &mi); mi.flags = CMIF_TCHAR|CMIF_CHECKED; diff --git a/plugins/MirOTR/src/otr.cpp b/plugins/MirOTR/src/otr.cpp index cda80811eb..9d5a690cd3 100644 --- a/plugins/MirOTR/src/otr.cpp +++ b/plugins/MirOTR/src/otr.cpp @@ -55,7 +55,7 @@ INT_PTR CALLBACK GenKeyDlgBoxProc(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM return 0; } TranslateDialogDefault(hWndDlg); - SetClassLongPtr(hWndDlg, GCLP_HICON, (LONG_PTR)LoadIcon(ICON_OTR, 1)); + SetClassLongPtr(hWndDlg, GCLP_HICON, (LONG_PTR)IcoLib_GetIcon(ICON_OTR, 1)); TCHAR buff[256]; TCHAR *proto = mir_a2t((char*)lParam); mir_sntprintf(buff, TranslateT(LANG_GENERATE_KEY), proto); @@ -71,7 +71,7 @@ INT_PTR CALLBACK GenKeyDlgBoxProc(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM return TRUE; case WM_DESTROY: SetClassLongPtr(hWndDlg, GCLP_HICON, 0); - ReleaseIcon(ICON_OTR, 1); + IcoLib_Release(ICON_OTR, 1); } return FALSE; } diff --git a/plugins/MirOTR/src/svcs_menu.cpp b/plugins/MirOTR/src/svcs_menu.cpp index caf9fed357..d5837ae2bc 100644 --- a/plugins/MirOTR/src/svcs_menu.cpp +++ b/plugins/MirOTR/src/svcs_menu.cpp @@ -164,13 +164,13 @@ void InitMenu() mi.ptszName = _T(LANG_STOP_OTR); mi.pszService = MS_OTR_MENUSTOP; - mi.icolibItem = GetIconHandle(ICON_PRIVATE); + mi.icolibItem = IcoLib_GetIconHandle(ICON_PRIVATE); hStopItem = Menu_AddContactMenuItem(&mi); mi.ptszName = _T(LANG_START_OTR); mi.pszService = MS_OTR_MENUSTART; - mi.icolibItem = GetIconHandle(ICON_NOT_PRIVATE); + mi.icolibItem = IcoLib_GetIconHandle(ICON_NOT_PRIVATE); hStartItem = Menu_AddContactMenuItem(&mi); diff --git a/plugins/MirOTR/src/svcs_srmm.cpp b/plugins/MirOTR/src/svcs_srmm.cpp index 62f37c9daa..51ebb6145d 100644 --- a/plugins/MirOTR/src/svcs_srmm.cpp +++ b/plugins/MirOTR/src/svcs_srmm.cpp @@ -41,22 +41,22 @@ void SetEncryptionStatus(MCONTACT hContact, TrustLevel level) case TRUST_FINISHED: sid.flags = 0; button.ptszTooltip = TranslateT(LANG_STATUS_FINISHED); - button.hIcon = GetIconHandle(ICON_FINISHED); + button.hIcon = IcoLib_GetIconHandle(ICON_FINISHED); break; case TRUST_UNVERIFIED: sid2.flags = MBF_DISABLED; button.ptszTooltip = TranslateT(LANG_STATUS_UNVERIFIED); - button.hIcon = GetIconHandle(ICON_UNVERIFIED); + button.hIcon = IcoLib_GetIconHandle(ICON_UNVERIFIED); break; case TRUST_PRIVATE: sid2.flags = 0; button.ptszTooltip = TranslateT(LANG_STATUS_PRIVATE); - button.hIcon = GetIconHandle(ICON_PRIVATE); + button.hIcon = IcoLib_GetIconHandle(ICON_PRIVATE); break; default: sid.flags = MBF_DISABLED; button.ptszTooltip = TranslateT(LANG_STATUS_DISABLED); - button.hIcon = GetIconHandle(ICON_NOT_PRIVATE); + button.hIcon = IcoLib_GetIconHandle(ICON_NOT_PRIVATE); break; } button.bbbFlags = 0; @@ -112,10 +112,10 @@ void InitSRMM() // add icon to srmm status icons InitMirOTRMenu(); - hIconNotSecure = LoadIcon(ICON_NOT_PRIVATE, 0); - hIconFinished = LoadIcon(ICON_FINISHED, 0); - hIconPrivate = LoadIcon(ICON_PRIVATE, 0); - hIconUnverified = LoadIcon(ICON_UNVERIFIED, 0); + hIconNotSecure = IcoLib_GetIcon(ICON_NOT_PRIVATE, 0); + hIconFinished = IcoLib_GetIcon(ICON_FINISHED, 0); + hIconPrivate = IcoLib_GetIcon(ICON_PRIVATE, 0); + hIconUnverified = IcoLib_GetIcon(ICON_UNVERIFIED, 0); StatusIconData sid = { sizeof(sid) }; sid.szModule = MODULENAME; @@ -141,17 +141,17 @@ void InitSRMM() OTRButton.dwDefPos = 200; OTRButton.bbbFlags = BBBF_ISRSIDEBUTTON|BBBF_CANBEHIDDEN|BBBF_ISIMBUTTON; OTRButton.ptszTooltip = TranslateT(LANG_OTR_TOOLTIP); - OTRButton.hIcon = GetIconHandle(ICON_NOT_PRIVATE); + OTRButton.hIcon = IcoLib_GetIconHandle(ICON_NOT_PRIVATE); HookEvent(ME_MSG_TOOLBARLOADED, SVC_ButtonsBarLoaded); HookEvent(ME_MSG_BUTTONPRESSED, SVC_ButtonsBarPressed); } } void DeinitSRMM() { - ReleaseIcon(ICON_NOT_PRIVATE, 0); - ReleaseIcon(ICON_FINISHED, 0); - ReleaseIcon(ICON_PRIVATE, 0); - ReleaseIcon(ICON_UNVERIFIED, 0); + IcoLib_Release(ICON_NOT_PRIVATE, 0); + IcoLib_Release(ICON_FINISHED, 0); + IcoLib_Release(ICON_PRIVATE, 0); + IcoLib_Release(ICON_UNVERIFIED, 0); hIconNotSecure = hIconFinished = hIconPrivate = hIconUnverified =0; UninitMirOTRMenu(); |