summaryrefslogtreecommitdiff
path: root/protocols/AimOscar/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-11-03 20:16:42 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-11-03 20:16:42 +0000
commitf12d8b56f2894e94491bd7424d69f595d285f01f (patch)
tree3f54d66c8c248bb456da1cb0c5cc31661f144e5f /protocols/AimOscar/src
parent1b1a54dc156bec90be3ddc337c17b4e67179d4ea (diff)
no more MS_CLIST_EXTRA_ADD_ICON in the application code
git-svn-id: http://svn.miranda-ng.org/main/trunk@2175 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/AimOscar/src')
-rw-r--r--protocols/AimOscar/src/aim.cpp8
-rw-r--r--protocols/AimOscar/src/theme.cpp121
-rw-r--r--protocols/AimOscar/src/theme.h2
-rw-r--r--protocols/AimOscar/src/utility.h1
4 files changed, 13 insertions, 119 deletions
diff --git a/protocols/AimOscar/src/aim.cpp b/protocols/AimOscar/src/aim.cpp
index 1cc9482e14..32ce3f8c58 100644
--- a/protocols/AimOscar/src/aim.cpp
+++ b/protocols/AimOscar/src/aim.cpp
@@ -21,13 +21,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
char AIM_CAP_MIRANDA[16] = "MirandaA";
-
int hLangpack;
HINSTANCE hInstance;
-static HANDLE hMooduleLoaded;
-
/////////////////////////////////////////////////////////////////////////////
// Protocol instances
static int sttCompareProtocols(const CAimProto *p1, const CAimProto *p2)
@@ -108,7 +105,7 @@ extern "C" int __declspec(dllexport) Load(void)
mir_getLP(&pluginInfo);
- hMooduleLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
+ HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
PROTOCOLDESCRIPTOR pd = {0};
pd.cbSize = sizeof(pd);
@@ -130,8 +127,5 @@ extern "C" int __declspec(dllexport) Load(void)
extern "C" int __declspec(dllexport) Unload(void)
{
aim_links_destroy();
- UnhookEvent(hMooduleLoaded);
-
- DestroyExtraIcons();
return 0;
}
diff --git a/protocols/AimOscar/src/theme.cpp b/protocols/AimOscar/src/theme.cpp
index cec3df5708..9ba7307d0d 100644
--- a/protocols/AimOscar/src/theme.cpp
+++ b/protocols/AimOscar/src/theme.cpp
@@ -139,7 +139,6 @@ extern OBJLIST<CAimProto> g_Instances;
static HANDLE bot_icon, icq_icon, aol_icon, hiptop_icon;
static HANDLE admin_icon, confirmed_icon, unconfirmed_icon;
-static HANDLE hListRebuld, hIconApply;
static HANDLE hExtraAT, hExtraES;
static const char* extra_AT_icon_name[5] =
@@ -160,48 +159,14 @@ static const char* extra_ES_icon_name[2] =
static HANDLE extra_AT_icon_handle[5];
static HANDLE extra_ES_icon_handle[2];
-static void load_extra_icons(void)
-{
- if (!ServiceExists(MS_CLIST_EXTRA_ADD_ICON)) return;
-
- unsigned i;
-
- for (i = 0; i < SIZEOF(extra_AT_icon_handle); ++i)
- {
- extra_AT_icon_handle[i] = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)LoadIconEx(extra_AT_icon_name[i]), 0);
- ReleaseIconEx(extra_AT_icon_name[i]);
- }
-
- for (i = 0; i < SIZEOF(extra_ES_icon_handle); ++i)
- {
- extra_ES_icon_handle[i] = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)LoadIconEx(extra_ES_icon_name[i]), 0);
- ReleaseIconEx(extra_ES_icon_name[i]);
- }
-}
-
-static void set_extra_icon(HANDLE hContact, HANDLE hImage, int column_type)
-{
- IconExtraColumn iec;
- iec.cbSize = sizeof(iec);
- iec.hImage = hImage;
- iec.ColumnType = column_type;
- CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM)hContact, (LPARAM)&iec);
-}
-
static void clear_AT_icon(HANDLE hContact)
{
- if (hExtraAT)
- ExtraIcon_SetIcon(hExtraAT, hContact, (char*)NULL);
- else
- set_extra_icon(hContact, (HANDLE)-1, EXTRA_ICON_ADV2);
+ ExtraIcon_SetIcon(hExtraAT, hContact, (char*)NULL);
}
static void clear_ES_icon(HANDLE hContact)
{
- if (hExtraES)
- ExtraIcon_SetIcon(hExtraES, hContact, (char*)NULL);
- else
- set_extra_icon(hContact, (HANDLE)-1, EXTRA_ICON_ADV3);
+ ExtraIcon_SetIcon(hExtraES, hContact, (char*)NULL);
}
static void set_AT_icon(CAimProto* ppro, HANDLE hContact)
@@ -210,19 +175,12 @@ static void set_AT_icon(CAimProto* ppro, HANDLE hContact)
unsigned i = ppro->getByte(hContact, AIM_KEY_AC, 0) - 1;
- if (hExtraAT)
- {
- if (i < 5)
- {
- char name[64];
- mir_snprintf(name, sizeof(name), "AIM_%s", extra_AT_icon_name[i]);
- ExtraIcon_SetIcon(hExtraAT, hContact, name);
- }
- else
- ExtraIcon_SetIcon(hExtraAT, hContact, (char*)NULL);
+ if (i < 5) {
+ char name[64];
+ mir_snprintf(name, sizeof(name), "AIM_%s", extra_AT_icon_name[i]);
+ ExtraIcon_SetIcon(hExtraAT, hContact, name);
}
- else
- set_extra_icon(hContact, i < 5 ? extra_AT_icon_handle[i] : (HANDLE)-1, EXTRA_ICON_ADV2);
+ else ExtraIcon_SetIcon(hExtraAT, hContact, (char*)NULL);
}
static void set_ES_icon(CAimProto* ppro, HANDLE hContact)
@@ -231,19 +189,12 @@ static void set_ES_icon(CAimProto* ppro, HANDLE hContact)
unsigned i = ppro->getByte(hContact, AIM_KEY_ET, 0) - 1;
- if (hExtraES)
- {
- if (i < 2)
- {
- char name[64];
- mir_snprintf(name, sizeof(name), "AIM_%s", extra_ES_icon_name[i]);
- ExtraIcon_SetIcon(hExtraES, hContact, name);
- }
- else
- ExtraIcon_SetIcon(hExtraES, hContact, (char*)NULL);
+ if (i < 2) {
+ char name[64];
+ mir_snprintf(name, sizeof(name), "AIM_%s", extra_ES_icon_name[i]);
+ ExtraIcon_SetIcon(hExtraES, hContact, name);
}
- else
- set_extra_icon(hContact, i < 2 ? extra_ES_icon_handle[i] : (HANDLE)-1, EXTRA_ICON_ADV3);
+ else ExtraIcon_SetIcon(hExtraES, hContact, (char*)NULL);
}
void set_contact_icon(CAimProto* ppro, HANDLE hContact)
@@ -252,37 +203,8 @@ void set_contact_icon(CAimProto* ppro, HANDLE hContact)
if (!ppro->getByte(AIM_KEY_ES, 0)) set_ES_icon(ppro, hContact);
}
-static int OnExtraIconsRebuild(WPARAM /*wParam*/, LPARAM /*lParam*/)
-{
- load_extra_icons();
- return 0;
-}
-
-static int OnExtraIconsApply(WPARAM wParam, LPARAM /*lParam*/)
-{
- if (!ServiceExists(MS_CLIST_EXTRA_SET_ICON)) return 0;
-
- HANDLE hContact = (HANDLE)wParam;
-
- CAimProto *ppro = NULL;
- for (int i = 0; i < g_Instances.getCount(); ++i)
- {
- if (g_Instances[i].is_my_contact(hContact))
- {
- ppro = &g_Instances[i];
- break;
- }
- }
-
- if (ppro) set_contact_icon(ppro, hContact);
-
- return 0;
-}
-
void remove_AT_icons(CAimProto* ppro)
{
- if (!ServiceExists(MS_CLIST_EXTRA_ADD_ICON)) return;
-
HANDLE hContact = db_find_first();
while (hContact)
{
@@ -295,8 +217,6 @@ void remove_AT_icons(CAimProto* ppro)
void remove_ES_icons(CAimProto* ppro)
{
- if (!ServiceExists(MS_CLIST_EXTRA_ADD_ICON)) return;
-
HANDLE hContact = db_find_first();
while (hContact)
{
@@ -334,18 +254,6 @@ void InitExtraIcons(void)
{
hExtraAT = ExtraIcon_Register("aimaccounttype", LPGEN("AIM Account Type"), "AIM_aol");
hExtraES = ExtraIcon_Register("aimextstatus", LPGEN("AIM Extended Status"), "AIM_hiptop");
-
- if (hExtraAT == NULL)
- {
- hListRebuld = HookEvent(ME_CLIST_EXTRA_LIST_REBUILD, OnExtraIconsRebuild);
- hIconApply = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, OnExtraIconsApply);
- }
-}
-
-void DestroyExtraIcons(void)
-{
- UnhookEvent(hIconApply);
- UnhookEvent(hListRebuld);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -371,11 +279,6 @@ void InitThemeSupport(void)
}
}
-void DestroyThemeSupport(void)
-{
- DestroyExtraIcons();
-}
-
/////////////////////////////////////////////////////////////////////////////////////////
// OnPreBuildContactMenu
diff --git a/protocols/AimOscar/src/theme.h b/protocols/AimOscar/src/theme.h
index 41b098aff6..09566479ad 100644
--- a/protocols/AimOscar/src/theme.h
+++ b/protocols/AimOscar/src/theme.h
@@ -28,8 +28,6 @@ void InitThemeSupport(void);
void InitIcons(void);
void InitExtraIcons(void);
-void DestroyExtraIcons(void);
-
HICON LoadIconEx(const char* name, bool big = false);
HANDLE GetIconHandle(const char* name);
void ReleaseIconEx(const char* name, bool big = false);
diff --git a/protocols/AimOscar/src/utility.h b/protocols/AimOscar/src/utility.h
index a6608d38f3..447d78538e 100644
--- a/protocols/AimOscar/src/utility.h
+++ b/protocols/AimOscar/src/utility.h
@@ -22,7 +22,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
char *normalize_name(const char *s);
char* trim_str(char* s);
void create_group(const char *group);
-void set_extra_icon(HANDLE hContact, HANDLE hImage, int column_type);
unsigned int aim_oft_checksum_file(TCHAR *filename, unsigned __int64 size = -1);
char* long_ip_to_char_ip(unsigned long host, char* ip);
unsigned long char_ip_to_long_ip(char* ip);