From 7deea6cec5d2173f66d4c2dd75ca0b633b887bc7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 20 May 2018 00:17:30 +0300 Subject: sounds packed into CMPlugin (reduces usage of hLangpack) --- include/m_core.h | 10 ---------- include/m_skin.h | 6 ------ include/newpluginapi.h | 11 +++++++++++ 3 files changed, 11 insertions(+), 16 deletions(-) (limited to 'include') diff --git a/include/m_core.h b/include/m_core.h index 83771c6120..5c6ce4dd5a 100644 --- a/include/m_core.h +++ b/include/m_core.h @@ -301,16 +301,6 @@ MIR_CORE_DLL(wchar_t*) mir_wstrdup(const wchar_t* str); MIR_CORE_DLL(char*) mir_strndup(const char* str, size_t len); MIR_CORE_DLL(wchar_t*) mir_wstrndup(const wchar_t *str, size_t len); -/////////////////////////////////////////////////////////////////////////////// -// modules - -class CMPluginBase; -MIR_CORE_DLL(void) RegisterModule(CMPluginBase*); -MIR_CORE_DLL(void) UnregisterModule(CMPluginBase*); - -MIR_CORE_DLL(HINSTANCE) GetInstByAddress(void* codePtr); -MIR_CORE_DLL(CMPluginBase&) GetPluginByInstance(HINSTANCE hInst); - /////////////////////////////////////////////////////////////////////////////// // print functions diff --git a/include/m_skin.h b/include/m_skin.h index 326abd39d4..956f693fed 100644 --- a/include/m_skin.h +++ b/include/m_skin.h @@ -120,12 +120,6 @@ EXTERN_C MIR_APP_DLL(char*) Skin_GetIconName(int idx); EXTERN_C MIR_APP_DLL(HICON) Skin_LoadProtoIcon(const char *szProto, int status, bool big = false); -///////////////////////////////////////////////////////////////////////////////////////// -// adds a new sound so it has a default and can be changed in the options dialog -// returns 0 on success, nonzero otherwise - -EXTERN_C MIR_APP_DLL(int) Skin_AddSound(const char *name, const wchar_t *section, const wchar_t *description, const wchar_t *defaultFile = nullptr, int = hLangpack); - ///////////////////////////////////////////////////////////////////////////////////////// // plays a registered sound // returns 0 on success, nonzero otherwise diff --git a/include/newpluginapi.h b/include/newpluginapi.h index 859c4e60d0..4aa29322b4 100644 --- a/include/newpluginapi.h +++ b/include/newpluginapi.h @@ -177,6 +177,9 @@ public: __forceinline HINSTANCE getInst() const { return m_hInst; } __forceinline void setInst(HINSTANCE hInst) { m_hInst = hInst; } + //////////////////////////////////////////////////////////////////////////////////////// + // registering module's resources + template __forceinline void registerIcon(const char *szSection, IconItem(&pIcons)[_Size], const char *prefix = nullptr) { @@ -189,6 +192,10 @@ public: Icon_RegisterT(m_hInst, szSection, pIcons, _Size, prefix, m_hLang); } + int addSound(const char *name, const wchar_t *section, const wchar_t *description, const wchar_t *defaultFile = nullptr); + + //////////////////////////////////////////////////////////////////////////////////////// + __forceinline INT_PTR delSetting(const char *name) { return db_unset(0, m_szModuleName, name); @@ -435,4 +442,8 @@ OBJLIST

ACCPROTOPLUGIN

::g_arInstances(1, PtrKeySortT); #endif #endif +EXTERN_C MIR_APP_DLL(HINSTANCE) GetInstByAddress(void* codePtr); +EXTERN_C MIR_APP_DLL(CMPluginBase*) GetPluginByLangId(int hLangpack); +EXTERN_C MIR_APP_DLL(CMPluginBase&) GetPluginByInstance(HINSTANCE hInst); + #endif // M_NEWPLUGINAPI_H__ -- cgit v1.2.3