From 90c2f2a24e911c832e11fcc6443afd24efdd4cc9 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 28 Jul 2013 11:05:10 +0000 Subject: - fix for name conflict in proto helpers; - switch to constants defined in m_nudge.h git-svn-id: http://svn.miranda-ng.org/main/trunk@5504 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/MRA/src/Mra.h | 1 + protocols/MRA/src/MraChat.cpp | 2 +- protocols/MRA/src/MraConstans.h | 3 --- protocols/MRA/src/MraIcons.cpp | 4 ++-- protocols/MRA/src/MraProto.cpp | 40 ++++++++++++++++++++-------------------- 5 files changed, 24 insertions(+), 26 deletions(-) (limited to 'protocols/MRA') diff --git a/protocols/MRA/src/Mra.h b/protocols/MRA/src/Mra.h index 1d6df272b0..da0a7f76be 100644 --- a/protocols/MRA/src/Mra.h +++ b/protocols/MRA/src/Mra.h @@ -63,6 +63,7 @@ #include #include #include +#include #include diff --git a/protocols/MRA/src/MraChat.cpp b/protocols/MRA/src/MraChat.cpp index f4f0e0e3e1..beb07b9dcc 100644 --- a/protocols/MRA/src/MraChat.cpp +++ b/protocols/MRA/src/MraChat.cpp @@ -28,7 +28,7 @@ BOOL CMraProto::MraChatRegister() gcr.pszModule = m_szModuleName; CallServiceSync(MS_GC_REGISTER, NULL, (LPARAM)&gcr); - HookEvent(ME_GC_EVENT, &CMraProto::MraChatGcEventHook); + HookProtoEvent(ME_GC_EVENT, &CMraProto::MraChatGcEventHook); return TRUE; } diff --git a/protocols/MRA/src/MraConstans.h b/protocols/MRA/src/MraConstans.h index 7b4e35e3dd..021294e93a 100644 --- a/protocols/MRA/src/MraConstans.h +++ b/protocols/MRA/src/MraConstans.h @@ -114,11 +114,8 @@ static const LPSTR lpcszMailRuDomains[] = #define MRA_ANSWERS_STR LPGENT("Answers") #define MRA_WORLD "/World" #define MRA_WORLD_STR LPGENT("World") -#define MRA_SEND_NUDGE "/SendNudge" -#define MS_NUDGE "/Nudge" #define MRA_SENDNUDGE_STR LPGENT("Send &Nudge") - #define ADV_ICON_DELETED 0 #define ADV_ICON_DELETED_ID "ADV_ICON_DELETED" #define ADV_ICON_DELETED_STR LPGENT("Mail box deleted") diff --git a/protocols/MRA/src/MraIcons.cpp b/protocols/MRA/src/MraIcons.cpp index 0bb4de9214..9cf3233c60 100644 --- a/protocols/MRA/src/MraIcons.cpp +++ b/protocols/MRA/src/MraIcons.cpp @@ -32,7 +32,7 @@ GUI_DISPLAY_ITEM gdiContactMenuItems[] = { MRA_VIEW_VIDEO, MRA_VIEW_VIDEO_STR, IDI_MRA_VIDEO, &CMraProto::MraViewVideo }, { MRA_ANSWERS, MRA_ANSWERS_STR, IDI_MRA_ANSWERS, &CMraProto::MraAnswers }, { MRA_WORLD, MRA_WORLD_STR, IDI_MRA_WORLD, &CMraProto::MraWorld }, - { MRA_SEND_NUDGE, MRA_SENDNUDGE_STR, IDI_MRA_ALARM, NULL } + { PS_SEND_NUDGE, MRA_SENDNUDGE_STR, IDI_MRA_ALARM, NULL } }; GUI_DISPLAY_ITEM gdiExtraStatusIconsItems[] = @@ -191,7 +191,7 @@ void CMraProto::CListCreateMenu(LONG lPosition, LONG lPopupPosition, HICON hMain for (size_t i = 0; i < dwCount; i++) { memmove(pszServiceFunctionName, pgdiItems[i].lpszName, lstrlenA(pgdiItems[i].lpszName)+1); if (pgdiItems[i].lpFunc) - CreateService(pgdiItems[i].lpszName, pgdiItems[i].lpFunc); + CreateProtoService(pgdiItems[i].lpszName, pgdiItems[i].lpFunc); mi.position = int(lPosition + i); mi.icolibItem = pgdiItems[i].hIconHandle; mi.ptszName = pgdiItems[i].lpwszDescr; diff --git a/protocols/MRA/src/MraProto.cpp b/protocols/MRA/src/MraProto.cpp index 86b9d52f04..f7dc6eb9c6 100644 --- a/protocols/MRA/src/MraProto.cpp +++ b/protocols/MRA/src/MraProto.cpp @@ -17,22 +17,22 @@ CMraProto::CMraProto(const char* _module, const TCHAR* _displayName) : MraMPopSessionQueueInitialize(&hMPopSessionQueue); MraAvatarsQueueInitialize(&hAvatarsQueueHandle); - CreateService(PS_SETCUSTOMSTATUSEX, &CMraProto::MraSetXStatusEx); - CreateService(PS_GETCUSTOMSTATUSEX, &CMraProto::MraGetXStatusEx); - CreateService(PS_GETCUSTOMSTATUSICON, &CMraProto::MraGetXStatusIcon); + CreateProtoService(PS_SETCUSTOMSTATUSEX, &CMraProto::MraSetXStatusEx); + CreateProtoService(PS_GETCUSTOMSTATUSEX, &CMraProto::MraGetXStatusEx); + CreateProtoService(PS_GETCUSTOMSTATUSICON, &CMraProto::MraGetXStatusIcon); - CreateService(PS_SET_LISTENINGTO, &CMraProto::MraSetListeningTo); + CreateProtoService(PS_SET_LISTENINGTO, &CMraProto::MraSetListeningTo); - CreateService(PS_CREATEACCMGRUI, &CMraProto::MraCreateAccMgrUI); - CreateService(PS_GETAVATARCAPS, &CMraProto::MraGetAvatarCaps); - CreateService(PS_GETAVATARINFOT, &CMraProto::MraGetAvatarInfo); - CreateService(PS_GETMYAVATART, &CMraProto::MraGetMyAvatar); + CreateProtoService(PS_CREATEACCMGRUI, &CMraProto::MraCreateAccMgrUI); + CreateProtoService(PS_GETAVATARCAPS, &CMraProto::MraGetAvatarCaps); + CreateProtoService(PS_GETAVATARINFOT, &CMraProto::MraGetAvatarInfo); + CreateProtoService(PS_GETMYAVATART, &CMraProto::MraGetMyAvatar); - CreateService(MS_ICQ_SENDSMS, &CMraProto::MraSendSMS); - CreateService(MRA_SEND_NUDGE, &CMraProto::MraSendNudge); + CreateProtoService(MS_ICQ_SENDSMS, &CMraProto::MraSendSMS); + CreateProtoService(PS_SEND_NUDGE, &CMraProto::MraSendNudge); if ( ServiceExists(MS_NUDGE_SEND)) - heNudgeReceived = CreateHookableEvent(MS_NUDGE); + heNudgeReceived = CreateProtoEvent(PE_NUDGE); TCHAR name[128]; mir_sntprintf( name, SIZEOF(name), TranslateT("%s connection"), m_tszUserName); @@ -43,7 +43,7 @@ CMraProto::CMraProto(const char* _module, const TCHAR* _displayName) : nlu.ptszDescriptiveName = name; hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu); - HookEvent(ME_SYSTEM_PRESHUTDOWN, &CMraProto::OnPreShutdown); + HookProtoEvent(ME_SYSTEM_PRESHUTDOWN, &CMraProto::OnPreShutdown); InitContactMenu(); @@ -51,13 +51,13 @@ CMraProto::CMraProto(const char* _module, const TCHAR* _displayName) : for (size_t i = 0; i < MRA_XSTATUS_COUNT; i++) { char szServiceName[100]; mir_snprintf(szServiceName, SIZEOF(szServiceName), "/menuXStatus%ld", i); - CreateServiceParam(szServiceName, &CMraProto::MraXStatusMenu, i); + CreateProtoServiceParam(szServiceName, &CMraProto::MraXStatusMenu, i); } mir_snprintf(szNewMailSound, SIZEOF(szNewMailSound), "%s: %s", m_szModuleName, MRA_SOUND_NEW_EMAIL); SkinAddNewSoundEx(szNewMailSound, m_szModuleName, MRA_SOUND_NEW_EMAIL); - HookEvent(ME_CLIST_PREBUILDSTATUSMENU, &CMraProto::MraRebuildStatusMenu); + HookProtoEvent(ME_CLIST_PREBUILDSTATUSMENU, &CMraProto::MraRebuildStatusMenu); hExtraXstatusIcon = ExtraIcon_Register("MRAXstatus", LPGEN("Mail.ru Xstatus"), "mra_xstatus25"); hExtraInfo = ExtraIcon_Register("MRAStatus", LPGEN("Mail.ru extra info"), "mra_xstatus49"); @@ -91,12 +91,12 @@ INT_PTR CMraProto::MraCreateAccMgrUI(WPARAM wParam,LPARAM lParam) int CMraProto::OnModulesLoaded(WPARAM, LPARAM) { - HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, &CMraProto::MraExtraIconsApply); - HookEvent(ME_OPT_INITIALISE, &CMraProto::OnOptionsInit); - HookEvent(ME_DB_CONTACT_DELETED, &CMraProto::MraContactDeleted); - HookEvent(ME_DB_CONTACT_SETTINGCHANGED, &CMraProto::MraDbSettingChanged); - HookEvent(ME_CLIST_PREBUILDCONTACTMENU, &CMraProto::MraRebuildContactMenu); - HookEvent(ME_WAT_NEWSTATUS, &CMraProto::MraMusicChanged); + HookProtoEvent(ME_CLIST_EXTRA_IMAGE_APPLY, &CMraProto::MraExtraIconsApply); + HookProtoEvent(ME_OPT_INITIALISE, &CMraProto::OnOptionsInit); + HookProtoEvent(ME_DB_CONTACT_DELETED, &CMraProto::MraContactDeleted); + HookProtoEvent(ME_DB_CONTACT_SETTINGCHANGED, &CMraProto::MraDbSettingChanged); + HookProtoEvent(ME_CLIST_PREBUILDCONTACTMENU, &CMraProto::MraRebuildContactMenu); + HookProtoEvent(ME_WAT_NEWSTATUS, &CMraProto::MraMusicChanged); // всех в offline // тк unsaved values сохраняются их нужно инициализировать for (HANDLE hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact)) -- cgit v1.2.3