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 --- plugins/ExternalAPI/m_nudge.h | 14 ++++++++++---- plugins/MetaContacts/src/meta_menu.cpp | 16 ++++++++-------- plugins/MetaContacts/src/meta_services.cpp | 6 +++--- plugins/MetaContacts/src/metacontacts.h | 1 + plugins/Nudge/src/main.cpp | 6 +++--- plugins/SecureIM/src/svcs_proto.cpp | 2 +- plugins/TabSRMM/src/generic_msghandlers.cpp | 10 +++++----- plugins/TabSRMM/src/msgdlgutils.cpp | 6 +++--- 8 files changed, 34 insertions(+), 27 deletions(-) (limited to 'plugins') diff --git a/plugins/ExternalAPI/m_nudge.h b/plugins/ExternalAPI/m_nudge.h index e80215e572..8067499145 100644 --- a/plugins/ExternalAPI/m_nudge.h +++ b/plugins/ExternalAPI/m_nudge.h @@ -1,8 +1,14 @@ -#define MS_SHAKE_CLIST "SHAKE/Service/ShakeClist" -#define MS_SHAKE_CHAT "SHAKE/Service/ShakeChat" -#define MS_NUDGE_SEND "NUDGE/Send" +// protocol service that sends a nudge +#define PS_SEND_NUDGE "/SendNudge" -// Hide or Show the context menu "send nudge" +// event to be create in protocol with its m_szModuleName +#define PE_NUDGE "/Nudge" + +#define MS_SHAKE_CLIST "SHAKE/Service/ShakeClist" +#define MS_SHAKE_CHAT "SHAKE/Service/ShakeChat" +#define MS_NUDGE_SEND "NUDGE/Send" + +// Hide or Show the context menu "send nudge" // wParam = char *szProto // lParam = BOOL show #define MS_NUDGE_SHOWMENU "NudgeShowMenu" diff --git a/plugins/MetaContacts/src/meta_menu.cpp b/plugins/MetaContacts/src/meta_menu.cpp index e32f4ae75a..fecb0520fe 100644 --- a/plugins/MetaContacts/src/meta_menu.cpp +++ b/plugins/MetaContacts/src/meta_menu.cpp @@ -18,7 +18,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/** @file meta_menu.c +/** @file meta_menu.c * * Functions needed to handle MetaContacts. * Centralizes functions called when the user chooses @@ -40,7 +40,7 @@ INT_PTR Meta_Convert(WPARAM wParam, LPARAM lParam) { DBVARIANT dbv; char *group = 0; - + // Get some information about the selected contact. if ( !db_get_utf((HANDLE)wParam, "CList", "Group", &dbv)) { group = _strdup(dbv.pszVal); @@ -59,7 +59,7 @@ INT_PTR Meta_Convert(WPARAM wParam, LPARAM lParam) if (group) db_set_utf(hMetaContact, "CList", "Group", group); - + // Assign the contact to the MetaContact just created (and make default). if ( !Meta_Assign((HANDLE)wParam, hMetaContact, TRUE)) { MessageBox(0, TranslateT("There was a problem in assigning the contact to the MetaContact"), TranslateT("Error"), MB_ICONEXCLAMATION); @@ -164,7 +164,7 @@ void Meta_RemoveContactNumber(HANDLE hMeta, int number) // if the default contact was equal to or greater than 'number', decrement it (and deal with ends) if (default_contact >= number) { default_contact--; - if (default_contact < 0) + if (default_contact < 0) default_contact = 0; db_set_dw(hMeta, META_PROTO, "Default", (DWORD)default_contact); @@ -209,7 +209,7 @@ INT_PTR Meta_Delete(WPARAM wParam,LPARAM lParam) // The wParam is a metacontact if ((metaID = db_get_dw((HANDLE)wParam, META_PROTO, META_ID, (DWORD)-1)) != (DWORD)-1) { if ( !lParam) { // check from recursion - see second half of this function - if ( MessageBox((HWND)CallService(MS_CLUI_GETHWND,0,0), + if ( MessageBox((HWND)CallService(MS_CLUI_GETHWND,0,0), TranslateT("This will remove the MetaContact permanently.\n\nProceed Anyway?"), TranslateT("Are you sure?"),MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON2) != IDYES) return 0; @@ -320,7 +320,7 @@ int Meta_ModifyMenu(WPARAM wParam, LPARAM lParam) if (db_get_dw((HANDLE)wParam, META_PROTO, META_ID,-1) != (DWORD)-1) { // save the mouse pos in case they open a subcontact menu GetCursorPos(&menuMousePoint); - + // This is a MetaContact, show the edit, force default, and the delete menu, and hide the others Menu_ShowItem(hMenuEdit, true); Menu_ShowItem(hMenuAdd, false); @@ -339,7 +339,7 @@ int Meta_ModifyMenu(WPARAM wParam, LPARAM lParam) Menu_ShowItem(hMenuContact[i], false); continue; } - + HANDLE hContact = Meta_GetContactHandle((HANDLE)wParam, i); char *szProto = GetContactProto(hContact); if ( !szProto) @@ -391,7 +391,7 @@ int Meta_ModifyMenu(WPARAM wParam, LPARAM lParam) // wParam = char *szProto // lParam = BOOL show char serviceFunc[256]; - mir_snprintf(serviceFunc, 256, "%s/SendNudge", GetContactProto( Meta_GetMostOnline((HANDLE)wParam))); + mir_snprintf(serviceFunc, 256, "%s%s", GetContactProto( Meta_GetMostOnline((HANDLE)wParam)), PS_SEND_NUDGE); CallService(MS_NUDGE_SHOWMENU, (WPARAM)META_PROTO, (LPARAM)ServiceExists(serviceFunc)); } else { // This is a simple contact diff --git a/plugins/MetaContacts/src/meta_services.cpp b/plugins/MetaContacts/src/meta_services.cpp index 55562a2f84..0bc80c7254 100755 --- a/plugins/MetaContacts/src/meta_services.cpp +++ b/plugins/MetaContacts/src/meta_services.cpp @@ -262,7 +262,7 @@ INT_PTR MetaFilter_SendMessage(WPARAM wParam,LPARAM lParam) INT_PTR Meta_SendNudge(WPARAM wParam,LPARAM lParam) { HANDLE hSubContact = Meta_GetMostOnline((HANDLE)wParam); - return ProtoCallService(GetContactProto(hSubContact), "/SendNudge", (WPARAM)hSubContact, lParam); + return ProtoCallService(GetContactProto(hSubContact), PS_SEND_NUDGE, (WPARAM)hSubContact, lParam); } ///////////////////////////////////////////////////////////////// @@ -1284,7 +1284,7 @@ INT_PTR Meta_GetInfo(WPARAM wParam, LPARAM lParam) ccs->hContact = most_online; if ( !ProtoServiceExists(proto, PSS_GETINFO)) return 0; // fail - + return CallContactService(ccs->hContact, PSS_GETINFO, ccs->wParam, ccs->lParam); } @@ -1445,7 +1445,7 @@ void Meta_InitServices() CreateServiceFunction("MetaContacts/OnOff", Meta_OnOff); CreateServiceFunction("MetaContacts/CListMessageEvent", Meta_ClistMessageEventClicked); - CreateProtoServiceFunction(META_PROTO, "/SendNudge", Meta_SendNudge); + CreateProtoServiceFunction(META_PROTO, PS_SEND_NUDGE, Meta_SendNudge); // create our hookable events hEventDefaultChanged = CreateHookableEvent(ME_MC_DEFAULTTCHANGED); diff --git a/plugins/MetaContacts/src/metacontacts.h b/plugins/MetaContacts/src/metacontacts.h index 680b8c78b5..a7fb25823c 100644 --- a/plugins/MetaContacts/src/metacontacts.h +++ b/plugins/MetaContacts/src/metacontacts.h @@ -44,6 +44,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include +#include #include #include diff --git a/plugins/Nudge/src/main.cpp b/plugins/Nudge/src/main.cpp index 144a585c07..32cde9fd00 100644 --- a/plugins/Nudge/src/main.cpp +++ b/plugins/Nudge/src/main.cpp @@ -69,7 +69,7 @@ INT_PTR NudgeSend(WPARAM wParam,LPARAM lParam) else if(DefaultNudge.showStatus) Nudge_SentStatus(DefaultNudge, (HANDLE) wParam); - CallProtoService(protoName,"/SendNudge",wParam,lParam); + CallProtoService(protoName, PS_SEND_NUDGE, wParam, lParam); return 0; } @@ -272,10 +272,10 @@ static int TabsrmmButtonInit(WPARAM wParam, LPARAM lParam) void HideNudgeButton(HANDLE hContact) { char *szProto = GetContactProto(hContact); - if ( !ProtoServiceExists(szProto, "/SendNudge")) { + if ( !ProtoServiceExists(szProto, PS_SEND_NUDGE)) { BBButton bbd = { sizeof(bbd) }; bbd.bbbFlags = BBSF_HIDDEN | BBSF_DISABLED; - bbd.pszModuleName="Nudge"; + bbd.pszModuleName = "Nudge"; bbd.dwButtonID = 6000; CallService(MS_BB_SETBUTTONSTATE, (WPARAM)hContact, (LPARAM)&bbd); } diff --git a/plugins/SecureIM/src/svcs_proto.cpp b/plugins/SecureIM/src/svcs_proto.cpp index 310b2c9505..7350aa9e95 100644 --- a/plugins/SecureIM/src/svcs_proto.cpp +++ b/plugins/SecureIM/src/svcs_proto.cpp @@ -802,7 +802,7 @@ INT_PTR __cdecl onSendFile(WPARAM wParam, LPARAM lParam) if (!name ) name = file[i]; else name++; - int size = TEMP_SIZE + strlen(name) + 20; + int size = TEMP_SIZE + (int)strlen(name) + 20; char *file_out = (char *)mir_alloc(size); mir_snprintf(file_out, size, "%s\\%s.AESHELL(%d)", TEMP, name, file_idx++); diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index ea6872ee57..d4f15ba995 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -458,7 +458,7 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer, CheckMenuItem(submenu, ID_SENDMENU_SENDWITHOUTTIMEOUTS, MF_BYCOMMAND | (dat->sendMode & SMODE_NOACK ? MF_CHECKED : MF_UNCHECKED)); { const char *szFinalProto = dat->cache->getActiveProto(); - EnableMenuItem(submenu, ID_SENDMENU_SENDNUDGE, MF_BYCOMMAND | ((ProtoServiceExists(szFinalProto, "/SendNudge") && ServiceExists(MS_NUDGE_SEND)) ? MF_ENABLED : MF_GRAYED)); + EnableMenuItem(submenu, ID_SENDMENU_SENDNUDGE, MF_BYCOMMAND | ((ProtoServiceExists(szFinalProto, PS_SEND_NUDGE) && ServiceExists(MS_NUDGE_SEND)) ? MF_ENABLED : MF_GRAYED)); } if (lParam) iSelection = TrackPopupMenu(submenu, TPM_RETURNCMD, rc.left, rc.bottom, 0, hwndDlg, NULL); @@ -787,7 +787,7 @@ void TSAPI DM_InitRichEdit(TWindowData *dat) if (fIsChat) { LOGFONTA lf; LoadLogfont(MSGFONTID_MESSAGEAREA, &lf, &inputcharcolor, FONTMODULE); - + cf2.dwMask = CFM_COLOR | CFM_FACE | CFM_CHARSET | CFM_SIZE | CFM_WEIGHT | CFM_ITALIC | CFM_BACKCOLOR; cf2.crTextColor = inputcharcolor; cf2.bCharSet = lf.lfCharSet; @@ -1062,7 +1062,7 @@ void TSAPI DM_UpdateLastMessage(const TWindowData *dat) } else szBuf[0] = 0; } - + SendMessage(dat->pContainer->hwndStatus, SB_SETTEXT, 0, (LPARAM)szBuf); } @@ -1288,7 +1288,7 @@ void TSAPI DM_NotifyTyping(struct TWindowData *dat, int mode) if (!dat || !dat->hContact) return; - + DeletePopupsForContact(dat->hContact, PU_REMOVE_ON_TYPE); if (dat->bIsMeta){ @@ -1929,7 +1929,7 @@ void DrawStatusIcons(struct TWindowData *dat, HDC hDC, RECT r, int gap) while (StatusIconData *si = Srmm_GetNthIcon(dat->hContact, nIcon++)) { if ( !strcmp(si->szModule, MSG_ICON_MODULE)) { if (si->dwId == MSG_ICON_SOUND) { - DrawIconEx(hDC, x, y, PluginConfig.g_buttonBarIcons[ICON_DEFAULT_SOUNDS], + DrawIconEx(hDC, x, y, PluginConfig.g_buttonBarIcons[ICON_DEFAULT_SOUNDS], cx_icon, cy_icon, 0, NULL, DI_NORMAL); DrawIconEx(hDC, x, y, dat->pContainer->dwFlags & CNT_NOSOUND ? diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index 2385b9fed7..11901b9fa6 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -2184,7 +2184,7 @@ void TSAPI EnableSendButton(const TWindowData *dat, int iMode) void TSAPI SendNudge(const TWindowData *dat) { - if ( ProtoServiceExists(dat->cache->getActiveProto(), "/SendNudge") && ServiceExists(MS_NUDGE_SEND)) + if ( ProtoServiceExists(dat->cache->getActiveProto(), PS_SEND_NUDGE) && ServiceExists(MS_NUDGE_SEND)) CallService(MS_NUDGE_SEND, (WPARAM)dat->cache->getActiveContact(), 0); else SendMessage(dat->hwnd, DM_ACTIVATETOOLTIP, IDC_MESSAGE, @@ -2374,11 +2374,11 @@ LONG TSAPI GetDefaultMinimumInputHeight(const TWindowData* dat) LONG height = MINSPLITTERY; if (dat) { - if (dat->bType == SESSIONTYPE_IM) + if (dat->bType == SESSIONTYPE_IM) height = ((dat->pContainer->dwFlags & CNT_BOTTOMTOOLBAR) ? DPISCALEY_S(46 + 22) : DPISCALEY_S(46)); else height = ((dat->pContainer->dwFlags & CNT_BOTTOMTOOLBAR) ? DPISCALEY_S(22 + 46) : DPISCALEY_S(46)) - DPISCALEY_S(23); - + if (CSkin::m_skinEnabled && !SkinItems[ID_EXTBKINPUTAREA].IGNORED) height += (SkinItems[ID_EXTBKINPUTAREA].MARGIN_BOTTOM + SkinItems[ID_EXTBKINPUTAREA].MARGIN_TOP - 2); } -- cgit v1.2.3