summaryrefslogtreecommitdiff
path: root/plugins/ExternalAPI
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-05-09 18:45:30 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-05-10 19:46:05 +0300
commit50c2fbbb1f7f6f233c980d7e4a52151fb72820f7 (patch)
tree349bc156e11357e68e2814778e7e4287eae43b3b /plugins/ExternalAPI
parent0943ae89e869ded753e5fbc5b64dca458a8f31b8 (diff)
suddenly: tipper services were used as string constants
(cherry picked from commit 15fcbbc128178ea5a4cdb1a58927a43ea740be88)
Diffstat (limited to 'plugins/ExternalAPI')
-rw-r--r--plugins/ExternalAPI/m_tipper.h29
1 files changed, 24 insertions, 5 deletions
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 <m_clc.h>
+
// 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);
+}