summaryrefslogtreecommitdiff
path: root/plugins/ListeningTo
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-10 14:46:58 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-10 14:46:58 +0000
commit101ca36412b3e7b8851b6b48a4f6cbc17d9f9eff (patch)
treea846c60f7c2a7df17b694deba92e7f6df3bbb882 /plugins/ListeningTo
parenta3fdadd09f12f6b246b11a5156bf6f0358e9a5f8 (diff)
bitmap operations were removed from TopToolBar and replaced with IcoLib
git-svn-id: http://svn.miranda-ng.org/main/trunk@379 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/ListeningTo')
-rw-r--r--plugins/ListeningTo/listeningto.cpp53
-rw-r--r--plugins/ListeningTo/res/listening_off.icobin0 -> 2038 bytes
-rw-r--r--plugins/ListeningTo/res/ttb_disabled.bmpbin1016 -> 0 bytes
-rw-r--r--plugins/ListeningTo/res/ttb_enabled.bmpbin1016 -> 0 bytes
-rw-r--r--plugins/ListeningTo/resource.h7
-rw-r--r--plugins/ListeningTo/resource.rc17
6 files changed, 20 insertions, 57 deletions
diff --git a/plugins/ListeningTo/listeningto.cpp b/plugins/ListeningTo/listeningto.cpp
index ca89e587f9..f5fbfd6d20 100644
--- a/plugins/ListeningTo/listeningto.cpp
+++ b/plugins/ListeningTo/listeningto.cpp
@@ -34,8 +34,6 @@ Boston, MA 02111-1307, USA.
#define MS_LISTENINGTO_HOTKEYS_DISABLE "ListeningTo/HotkeysDisable"
#define MS_LISTENINGTO_HOTKEYS_TOGGLE "ListeningTo/HotkeysToggle"
-#define ICON_NAME "LISTENING_TO_ICON"
-
int hLangpack;
PLUGININFOEX pluginInfo={
@@ -60,8 +58,8 @@ struct UTF8_INTERFACE utfi;
static std::vector<HANDLE> hHooks;
static std::vector<HANDLE> hServices;
-static HANDLE hEnableStateChangedEvent = NULL;
-HANDLE hExtraIcon = NULL;
+static HANDLE hEnableStateChangedEvent;
+HANDLE hExtraIcon, hIcon1, hIcon2;
static HANDLE hMainMenuGroup = NULL;
static HANDLE hListeningInfoChangedEvent = NULL;
@@ -74,7 +72,6 @@ static DWORD lastInfoSetTime = 0;
std::vector<ProtocolInfo> proto_itens;
-
int ModulesLoaded(WPARAM wParam, LPARAM lParam);
int PreShutdown(WPARAM wParam, LPARAM lParam);
int PreBuildContactMenu(WPARAM wParam,LPARAM lParam);
@@ -117,47 +114,24 @@ TCHAR* VariablesParsePlayer(ARGUMENTSINFO *ai);
// Functions ////////////////////////////////////////////////////////////////////////////
-
-
extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
hInst = hinstDLL;
return TRUE;
}
-
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
{
pluginInfo.cbSize = sizeof(PLUGININFOEX);
return &pluginInfo;
}
-
static const MUUID interfaces[] = { MIID_LISTENINGTO, MIID_LAST };
extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
{
return interfaces;
}
-/*
-BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam)
-{
- // Find the windows
- char class_name[1024];
- if (GetClassNameA(hwnd, class_name, sizeof(class_name)))
- {
- class_name[sizeof(class_name)-1] = '\0';
-OutputDebugStringA(class_name);
-OutputDebugStringA(" -> ");
- GetWindowTextA(hwnd, class_name, 1024);
-OutputDebugStringA(class_name);
-OutputDebugStringA("\n");
- }
-
- return TRUE;
-}
-*/
-
extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
{
pluginLink = link;
@@ -352,10 +326,11 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam)
// add our modules to the KnownModules list
CallService("DBEditorpp/RegisterSingleModule", (WPARAM) MODULE_NAME, 0);
- IcoLib_Register(ICON_NAME, _T("Contact List"), _T("Listening to"), IDI_LISTENINGTO);
+ hIcon1 = IcoLib_Register("listening_to_icon", _T("Contact List"), _T("Listening to"), IDI_LISTENINGTO);
+ hIcon2 = IcoLib_Register("listening_off_icon", _T("Contact List"), _T("Listening to"), IDI_LISTENINGOFF);
// Extra icon support
- hExtraIcon = ExtraIcon_Register(MODULE_NAME, "Listening to music", ICON_NAME);
+ hExtraIcon = ExtraIcon_Register(MODULE_NAME, "Listening to music", "listening_to_icon");
if (hExtraIcon != NULL)
{
HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
@@ -390,8 +365,8 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam)
mi.position = 500080000;
mi.pszPopupName = (char*) -1;
mi.pszName = "Listening to";
- mi.flags = CMIF_ROOTPOPUP;
- mi.hIcon = IcoLib_LoadIcon(ICON_NAME);
+ mi.flags = CMIF_ROOTPOPUP | CMIF_ICONFROMICOLIB;
+ mi.icolibItem = hIcon1;
hMainMenuGroup = (HANDLE) CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM) &mi);
@@ -594,11 +569,11 @@ int TopToolBarLoaded(WPARAM wParam, LPARAM lParam)
TTBButton ttb = {0};
ttb.cbSize = sizeof(ttb);
- ttb.hbBitmapUp = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_TTB_UP_DISABLED));
- ttb.hbBitmapDown = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_TTB_UP_ENABLED));
+ ttb.hIconHandleDn = hIcon2;
+ ttb.hIconHandleUp = hIcon1;
ttb.pszServiceUp = MS_LISTENINGTO_TTB;
ttb.pszServiceDown = MS_LISTENINGTO_TTB;
- ttb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP | (enabled ? TTBBF_PUSHED : 0);
+ ttb.dwFlags = TTBBF_VISIBLE | TTBBF_ICONBYHANDLE | TTBBF_SHOWTOOLTIP | (enabled ? TTBBF_PUSHED : 0);
ttb.name = Translate("Enable/Disable sending Listening To info (to all protocols)");
hTTB = (HANDLE)CallService(MS_TTB_ADDBUTTON, (WPARAM)&ttb, 0);
@@ -1076,11 +1051,11 @@ void HasNewListeningInfo()
int ClistExtraListRebuild(WPARAM wParam, LPARAM lParam)
{
- HICON hIcon = IcoLib_LoadIcon(ICON_NAME);
+ HICON hIcon = Skin_GetIconByHandle(hIcon1);
hExtraImage = (HANDLE) CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM) hIcon, 0);
- IcoLib_ReleaseIcon(hIcon);
+ Skin_ReleaseIcon(hIcon);
return 0;
}
@@ -1089,7 +1064,7 @@ void SetExtraIcon(HANDLE hContact, BOOL set)
{
if (hExtraIcon != NULL)
{
- ExtraIcon_SetIcon(hExtraIcon, hContact, set ? ICON_NAME : NULL);
+ ExtraIcon_SetIcon(hExtraIcon, hContact, set ? "listening_to_icon" : NULL);
}
else if (opts.show_adv_icon && hExtraImage != NULL)
{
@@ -1248,5 +1223,3 @@ TCHAR* VariablesParsePlayer(ARGUMENTSINFO *ai)
{
VARIABLES_PARSE_BODY(ptszPlayer);
}
-
-
diff --git a/plugins/ListeningTo/res/listening_off.ico b/plugins/ListeningTo/res/listening_off.ico
new file mode 100644
index 0000000000..bdacbb028a
--- /dev/null
+++ b/plugins/ListeningTo/res/listening_off.ico
Binary files differ
diff --git a/plugins/ListeningTo/res/ttb_disabled.bmp b/plugins/ListeningTo/res/ttb_disabled.bmp
deleted file mode 100644
index df1a9abde5..0000000000
--- a/plugins/ListeningTo/res/ttb_disabled.bmp
+++ /dev/null
Binary files differ
diff --git a/plugins/ListeningTo/res/ttb_enabled.bmp b/plugins/ListeningTo/res/ttb_enabled.bmp
deleted file mode 100644
index 98467fb6e5..0000000000
--- a/plugins/ListeningTo/res/ttb_enabled.bmp
+++ /dev/null
Binary files differ
diff --git a/plugins/ListeningTo/resource.h b/plugins/ListeningTo/resource.h
index 3f35843a69..d4084c98b4 100644
--- a/plugins/ListeningTo/resource.h
+++ b/plugins/ListeningTo/resource.h
@@ -5,9 +5,8 @@
#define IDD_OPTIONS 119
#define IDD_PLAYERS 120
#define IDD_FORMAT 121
-#define IDB_TTB_UP_DISABLED 122
-#define IDB_TTB_UP_ENABLED 123
-#define IDI_LISTENINGTO 124
+#define IDI_LISTENINGTO 122
+#define IDI_LISTENINGOFF 123
#define IDC_DELAY 1001
#define IDC_WINCOLORS 1002
#define IDC_DEFAULTCOLORS 1003
@@ -81,7 +80,7 @@
#define IDC_STATIC -1
// Next default values for new objects
-//
+//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
diff --git a/plugins/ListeningTo/resource.rc b/plugins/ListeningTo/resource.rc
index 893cf39de6..49f777458d 100644
--- a/plugins/ListeningTo/resource.rc
+++ b/plugins/ListeningTo/resource.rc
@@ -116,7 +116,7 @@ END
//
#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO
+GUIDELINES DESIGNINFO
BEGIN
IDD_OPTIONS, DIALOG
BEGIN
@@ -147,14 +147,6 @@ END
/////////////////////////////////////////////////////////////////////////////
//
-// Bitmap
-//
-
-IDB_TTB_UP_DISABLED BITMAP "res\\ttb_disabled.bmp"
-IDB_TTB_UP_ENABLED BITMAP "res\\ttb_enabled.bmp"
-
-/////////////////////////////////////////////////////////////////////////////
-//
// Icon
//
@@ -180,19 +172,19 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_CAN
// TEXTINCLUDE
//
-1 TEXTINCLUDE
+1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
-2 TEXTINCLUDE
+2 TEXTINCLUDE
BEGIN
"#include ""resource.h""\r\n"
"#include ""winresrc.h""\r\n"
"\0"
END
-3 TEXTINCLUDE
+3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
@@ -214,4 +206,3 @@ END
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
-