From 2fbcc27fe4fd3dd89d21b49c0332db2efe880ded Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 25 Oct 2017 15:45:35 +0300 Subject: SRMM internal structures & functions moved to the separate header file m_srmm_int.h --- include/m_message.h | 63 ---------------------------- include/m_srmm_int.h | 98 ++++++++++++++++++++++++++++++++++++++++++++ plugins/Scriver/src/stdafx.h | 1 + plugins/TabSRMM/src/stdafx.h | 1 + src/core/stdmsg/src/stdafx.h | 1 + 5 files changed, 101 insertions(+), 63 deletions(-) create mode 100644 include/m_srmm_int.h diff --git a/include/m_message.h b/include/m_message.h index e1dfd41ed7..9c9e421f50 100644 --- a/include/m_message.h +++ b/include/m_message.h @@ -278,8 +278,6 @@ EXTERN_C MIR_APP_DLL(void) Srmm_RedrawToolbarIcons(HWND hwndDlg); /////////////////////////////////////////////////////////////////////////////////////////////////////////////// // toolbar button clicked event -EXTERN_C MIR_APP_DLL(void) Srmm_ClickToolbarIcon(MCONTACT hContact, DWORD idFrom, HWND hwndFrom, BOOL code); - // wParam = (HANDLE)hContact; // lParam = (CustomButtonClickData*) pointer to the click data; // catch to show a popup menu, etc. @@ -301,65 +299,4 @@ struct CustomButtonClickData DWORD flags; // BBCF_ flags }; -/////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// toolbar button internal representation - -#define MIN_CBUTTONID 4000 -#define MAX_CBUTTONID 5000 - -#define BBSF_IMBUTTON (1<<0) -#define BBSF_CHATBUTTON (1<<1) -#define BBSF_CANBEHIDDEN (1<<2) -#define BBSF_NTBSWAPED (1<<3) -#define BBSF_NTBDESTRUCT (1<<4) - -struct CustomButtonData : public MZeroedObject -{ - ~CustomButtonData() - {} - - DWORD m_dwPosition; // default order pos of button, counted from window edge (left or right) - - DWORD m_dwButtonID; // id of button used while button creation and to store button info in DB - ptrA m_pszModuleName; // module name without spaces and underline symbols (e.g. "tabsrmm") - - DWORD m_dwButtonCID; // button's control id - DWORD m_dwArrowCID; // only use with BBBF_ISARROWBUTTON flag - - ptrW m_pwszText; // button's text - ptrW m_pwszTooltip; // button's tooltip - - int m_iButtonWidth; // must be 22 for regular button and 33 for button with arrow - HANDLE m_hIcon; // Handle to icolib registred icon - - bool m_bIMButton, m_bChatButton; - bool m_bCanBeHidden, m_bCantBeHidden, m_bHidden, m_bAutoHidden, m_bSeparator, m_bDisabled, m_bPushButton; - bool m_bRSided; - BYTE m_opFlags; - int m_hLangpack; - DWORD m_dwOrigPosition; - struct THotkeyItem *m_hotkey; -}; - -// gets the required button or NULL, if i is out of boundaries -EXTERN_C MIR_APP_DLL(CustomButtonData*) Srmm_GetNthButton(int i); - -// retrieves total number of toolbar buttons -EXTERN_C MIR_APP_DLL(int) Srmm_GetButtonCount(void); - -// these messages are sent to the message windows if toolbar buttons are changed -#define WM_CBD_FIRST (WM_USER+0x600) - -// wParam = 0 (ignored) -// lParam = (CustomButtonData*)pointer to button or null if any button can be changed -#define WM_CBD_UPDATED (WM_CBD_FIRST+1) - -// wParam = button id -// lParam = (CustomButtonData*)pointer to button -#define WM_CBD_REMOVED (WM_CBD_FIRST+2) - -// wParam = 0 (ignored) -// lParam = 0 (ignored) -#define WM_CBD_LOADICONS (WM_CBD_FIRST+3) - #endif // M_MESSAGE_H__ diff --git a/include/m_srmm_int.h b/include/m_srmm_int.h new file mode 100644 index 0000000000..9c7770d955 --- /dev/null +++ b/include/m_srmm_int.h @@ -0,0 +1,98 @@ +/* + +Miranda NG: the free IM client for Microsoft* Windows* + +Copyright (ñ) 2012-17 Miranda NG project (https://miranda-ng.org) +Copyright (c) 2000-08 Miranda ICQ/IM project, +all portions of this codebase are copyrighted to the people +listed in contributors.txt. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef M_SRMM_INT_H__ +#define M_SRMM_INT_H__ 1 + +#include + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// toolbar button internal representation + +#define MIN_CBUTTONID 4000 +#define MAX_CBUTTONID 5000 + +#define BBSF_IMBUTTON (1<<0) +#define BBSF_CHATBUTTON (1<<1) +#define BBSF_CANBEHIDDEN (1<<2) +#define BBSF_NTBSWAPED (1<<3) +#define BBSF_NTBDESTRUCT (1<<4) + +struct CustomButtonData : public MZeroedObject +{ + ~CustomButtonData() + {} + + int m_dwPosition; // default order pos of button, counted from window edge (left or right) + + int m_dwButtonID; // id of button used while button creation and to store button info in DB + ptrA m_pszModuleName; // module name without spaces and underline symbols (e.g. "tabsrmm") + + int m_dwButtonCID; // button's control id + int m_dwArrowCID; // only use with BBBF_ISARROWBUTTON flag + + ptrW m_pwszText; // button's text + ptrW m_pwszTooltip; // button's tooltip + + int m_iButtonWidth; // must be 22 for regular button and 33 for button with arrow + HANDLE m_hIcon; // Handle to icolib registred icon + + bool m_bIMButton, m_bChatButton; + bool m_bCanBeHidden, m_bCantBeHidden, m_bHidden, m_bAutoHidden, m_bSeparator, m_bDisabled, m_bPushButton; + bool m_bRSided; + BYTE m_opFlags; + int m_hLangpack; + DWORD m_dwOrigPosition; + struct THotkeyItem *m_hotkey; + + struct { + bool bit1 : 1, bit2 : 1, bit3 : 1, bit4 : 1; + } m_dwOrigFlags; +}; + +// gets the required button or NULL, if i is out of boundaries +EXTERN_C MIR_APP_DLL(CustomButtonData*) Srmm_GetNthButton(int i); + +// retrieves total number of toolbar buttons +EXTERN_C MIR_APP_DLL(int) Srmm_GetButtonCount(void); + +// emulates a click on a toolbar button +EXTERN_C MIR_APP_DLL(void) Srmm_ClickToolbarIcon(MCONTACT hContact, DWORD idFrom, HWND hwndFrom, BOOL code); + +// these messages are sent to the message windows if toolbar buttons are changed +#define WM_CBD_FIRST (WM_USER+0x600) + +// wParam = 0 (ignored) +// lParam = (CustomButtonData*)pointer to button or null if any button can be changed +#define WM_CBD_UPDATED (WM_CBD_FIRST+1) + +// wParam = button id +// lParam = (CustomButtonData*)pointer to button +#define WM_CBD_REMOVED (WM_CBD_FIRST+2) + +// wParam = 0 (ignored) +// lParam = 0 (ignored) +#define WM_CBD_LOADICONS (WM_CBD_FIRST+3) + +#endif // M_MESSAGE_H__ diff --git a/plugins/Scriver/src/stdafx.h b/plugins/Scriver/src/stdafx.h index 221cb7b0ca..422d4fb8ae 100644 --- a/plugins/Scriver/src/stdafx.h +++ b/plugins/Scriver/src/stdafx.h @@ -62,6 +62,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include +#include #include #include diff --git a/plugins/TabSRMM/src/stdafx.h b/plugins/TabSRMM/src/stdafx.h index b9b6827200..b53148b5d1 100644 --- a/plugins/TabSRMM/src/stdafx.h +++ b/plugins/TabSRMM/src/stdafx.h @@ -79,6 +79,7 @@ #include #include #include +#include #include #include diff --git a/src/core/stdmsg/src/stdafx.h b/src/core/stdmsg/src/stdafx.h index 7c8348f6e8..6069356b35 100644 --- a/src/core/stdmsg/src/stdafx.h +++ b/src/core/stdmsg/src/stdafx.h @@ -67,6 +67,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include +#include #include "cmdlist.h" #include "msgs.h" -- cgit v1.2.3