diff options
author | George Hazan <ghazan@miranda.im> | 2018-05-22 18:00:57 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-05-22 18:00:57 +0300 |
commit | feac2b1a6a79c9d0bb58b0825ec2a776b888f9ce (patch) | |
tree | ef2fde024f8e13ac1ff5f2de8c772066319b3e6c /include | |
parent | 737d05018bbc2da54414bea0c2ccce6f1e15bde2 (diff) |
m_genmenu.h unbound from hLangpack
Diffstat (limited to 'include')
-rw-r--r-- | include/m_core.h | 2 | ||||
-rw-r--r-- | include/m_genmenu.h | 23 | ||||
-rw-r--r-- | include/newpluginapi.h | 8 |
3 files changed, 14 insertions, 19 deletions
diff --git a/include/m_core.h b/include/m_core.h index 8aac2587fb..f28ef1957f 100644 --- a/include/m_core.h +++ b/include/m_core.h @@ -53,6 +53,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. DECLARE_HANDLE(HNETLIBBIND);
#endif
+typedef struct TMO_IntMenuItem* HGENMENU;
+
#define MIR_APP_DLL(T) MIR_APP_EXPORT T __stdcall
#pragma warning(disable:4201 4127 4312 4706)
diff --git a/include/m_genmenu.h b/include/m_genmenu.h index 8fa4ef0728..00d01c1c10 100644 --- a/include/m_genmenu.h +++ b/include/m_genmenu.h @@ -9,12 +9,6 @@ #include <newpluginapi.h>
#endif
-#if defined MIR_APP_EXPORTS
- typedef struct TMO_IntMenuItem* HGENMENU;
-#else
- DECLARE_HANDLE(HGENMENU);
-#endif
-
// predefined menu objects
#define MO_MAIN (-1)
#define MO_CONTACT (-2)
@@ -50,21 +44,16 @@ struct TMO_MenuItem MUUID uid;
};
-#if _MSC_VER <= 1600
- #define SET_UID(M,A,B,C,D1,D2,D3,D4,D5,D6,D7,D8) { MUUID tmp = { A, B, C, {D1,D2,D3,D4,D5,D6,D7,D8}}; M.uid = tmp; }
- #define UNSET_UID(M) { MUUID tmp = MIID_LAST; M.uid = tmp; }
-#else
- #define SET_UID(M,A,B,C,D1,D2,D3,D4,D5,D6,D7,D8) { M.uid = { A, B, C, {D1,D2,D3,D4,D5,D6,D7,D8}}; }
- #define UNSET_UID(M) { M.uid = MIID_LAST; }
-#endif
+#define SET_UID(M,A,B,C,D1,D2,D3,D4,D5,D6,D7,D8) { M.uid = { A, B, C, {D1,D2,D3,D4,D5,D6,D7,D8}}; }
+#define UNSET_UID(M) { M.uid = MIID_LAST; }
#ifdef __cplusplus
struct CMenuItem : public TMO_MenuItem
{
- CMenuItem()
+ CMenuItem(const CMPluginBase &pPlugin)
{
memset(this, 0, sizeof(CMenuItem));
- this->langId = ::hLangpack;
+ this->langId = pPlugin.m_hLang;
}
};
#endif
@@ -118,7 +107,7 @@ EXTERN_C MIR_APP_DLL(HGENMENU) Menu_AddItem(int hMenuObject, TMO_MenuItem *pItem // Adds new submenu
// Returns HGENMENU on success, or NULL on failure
-EXTERN_C MIR_APP_DLL(HGENMENU) Menu_CreateRoot(int hMenuObject, LPCWSTR ptszName, int position, HANDLE hIcoLib = nullptr, int hLang = hLangpack);
+EXTERN_C MIR_APP_DLL(HGENMENU) Menu_CreateRoot(int hMenuObject, LPCWSTR ptszName, int position, HANDLE hIcoLib, int langId);
/////////////////////////////////////////////////////////////////////////////////////////
// process a WM_DRAWITEM message for user context menus v0.1.1.0+
@@ -258,7 +247,7 @@ __forceinline int Menu_ConfigureItem(HGENMENU hMenu, int iSetting, LPCSTR pszVal EXTERN_C MIR_APP_DLL(HGENMENU) Menu_GetProtocolRoot(PROTO_INTERFACE *pThis);
/////////////////////////////////////////////////////////////////////////////////////////
-// kills all menu items & submenus that belong to the hLangpack given
+// kills all menu items & submenus that belong to the language id given
EXTERN_C MIR_APP_DLL(void) KillModuleMenus(int langId);
diff --git a/include/newpluginapi.h b/include/newpluginapi.h index 611b92b7b0..280f34eacf 100644 --- a/include/newpluginapi.h +++ b/include/newpluginapi.h @@ -46,10 +46,12 @@ struct MUUID };
__forceinline bool operator==(const MUUID &p1, const MUUID &p2)
-{ return memcmp(&p1, &p2, sizeof(MUUID)) == 0;
+{
+ return memcmp(&p1, &p2, sizeof(MUUID)) == 0;
}
__forceinline bool operator!=(const MUUID &p1, const MUUID &p2)
-{ return memcmp(&p1, &p2, sizeof(MUUID)) != 0;
+{
+ return memcmp(&p1, &p2, sizeof(MUUID)) != 0;
}
MIR_APP_DLL(int) GetPluginLangId(const MUUID &uuid, int langId);
@@ -201,6 +203,8 @@ public: HANDLE addIcon(const struct SKINICONDESC*);
+ HGENMENU addRootMenu(int hMenuObject, LPCWSTR ptszName, int position, HANDLE hIcoLib = nullptr);
+
int addHotkey(const struct HOTKEYDESC*);
int addSound(const char *name, const wchar_t *section, const wchar_t *description, const wchar_t *defaultFile = nullptr);
int addUserInfo(WPARAM wParam, struct OPTIONSDIALOGPAGE *odp);
|