From 50c2fbbb1f7f6f233c980d7e4a52151fb72820f7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 9 May 2021 18:45:30 +0300 Subject: suddenly: tipper services were used as string constants (cherry picked from commit 15fcbbc128178ea5a4cdb1a58927a43ea740be88) --- plugins/ExternalAPI/m_tipper.h | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) (limited to 'plugins/ExternalAPI') diff --git a/plugins/ExternalAPI/m_tipper.h b/plugins/ExternalAPI/m_tipper.h index abaac6c206..f97e105959 100644 --- a/plugins/ExternalAPI/m_tipper.h +++ b/plugins/ExternalAPI/m_tipper.h @@ -18,27 +18,46 @@ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - // Tipper API # pragma once +#include + // translation function type // use hContact, module and setting to read your db value(s) and put the resulting string into buff // return buff if the translation was successful, or return 0 for failure -typedef TCHAR *(TranslateFunc)(MCONTACT hContact, const char *module, const char *setting_or_prefix, TCHAR *buff, int bufflen); +typedef wchar_t* (TranslateFunc)(MCONTACT hContact, const char *module, const char *setting_or_prefix, wchar_t *buff, int bufflen); typedef struct { TranslateFunc *transFunc; // address of your translation function (see typedef above) - const TCHAR *swzName; // make sure this is unique, and DO NOT translate it + const wchar_t *swzName; // make sure this is unique, and DO NOT translate it DWORD id; // will be overwritten by Tipper - do not use } DBVTranslation; // add a translation to tipper // wParam not used // lParam = (DBVTranslation *)translation -#define MS_TIPPER_ADDTRANSLATION "Tipper/AddTranslation" +#define MS_TIPPER_ADDTRANSLATION "Tipper/AddTranslation" + +// ansi version of tipper +// wParam - optional (wchar_t *)text for text-only tips +// lParam - (CLCINFOTIP *)infoTip +#define MS_TIPPER_SHOWTIP "mToolTip/ShowTip" // unicode extension to the basic functionality // wParam - optional (wchar_t *)text for text-only tips // lParam - (CLCINFOTIP *)infoTip -#define MS_TIPPER_SHOWTIPW "mToolTip/ShowTipW" \ No newline at end of file +#define MS_TIPPER_SHOWTIPW "mToolTip/ShowTipW" + +__forceinline void Tipper_ShowTip(const wchar_t *pwsztext, CLCINFOTIP *ti) +{ CallService(MS_TIPPER_SHOWTIPW, WPARAM(pwsztext), LPARAM(ti)); +} + +// hides a tooltip +// wParam - 0 +// lParam - 0 +#define MS_TIPPER_HIDETIP "mToolTip/HideTip" + +__forceinline void Tipper_Hide() +{ CallService(MS_TIPPER_HIDETIP, 0, 0); +} -- cgit v1.2.3