diff options
| author | Jonas Kümmerlin <jonas@kuemmerlin.eu> | 2020-06-01 10:16:29 +0200 |
|---|---|---|
| committer | Jonas Kümmerlin <jonas@kuemmerlin.eu> | 2020-06-01 10:16:29 +0200 |
| commit | 960d6984b373207f1f0cbca39e458f05e623390e (patch) | |
| tree | a32da5b298ab5871928ad32cb05e263e0ead1ef0 /alf/alfnotebook.cpp | |
| parent | 3fcb8cd1a66b409ae3a8e9ba4941ec2c751ef856 (diff) | |
notebook: switch to underscored naming convention, WM name fix
Diffstat (limited to 'alf/alfnotebook.cpp')
| -rw-r--r-- | alf/alfnotebook.cpp | 50 |
1 files changed, 22 insertions, 28 deletions
diff --git a/alf/alfnotebook.cpp b/alf/alfnotebook.cpp index d08fd74..494cbee 100644 --- a/alf/alfnotebook.cpp +++ b/alf/alfnotebook.cpp @@ -1,12 +1,6 @@ #include "alfpriv.h" #include "alfcompat.h" -#define ALF_NB_ADDTAB (ALF_WM__BASE + 300) -#define ALF_NB_TABCOUNT (ALF_WM__BASE + 301) -#define ALF_NB_GETPANEL (ALF_WM__BASE + 302) -#define ALF_NB_GETSELINDEX (ALF_WM__BASE + 303) -#define ALF_NB_GETPNLINDEX (ALF_WM__BASE + 304) - #define TABP_BODY 10 #define TMT_FILLCOLORHINT 3821 @@ -148,7 +142,7 @@ ALF_Notebook_PropagateDpiChange(HWND hwndNotebook, ALFNotebookPriv *priv, WPARAM { int n = ALF_Notebook_InternalTabCount(hwndNotebook, priv->hwndTabCtrl); for (int i = 0; i < n; ++i) { - HWND hwndPanel = ALF_NotebookTabPanel(hwndNotebook, i); + HWND hwndPanel = ALF_Notebook_TabPanel(hwndNotebook, i); SendMessage(hwndPanel, ALF_WM_DPICHANGE, wparam, lparam); } } @@ -383,7 +377,7 @@ ALF_Notebook_SetWidgetFlags(HWND hwndNotebook, ALFNotebookPriv *priv, HWND widge } static LRESULT CALLBACK -ALF__NotebookWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) +ALF_Notebook_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { ALFNotebookPriv *priv = (ALFNotebookPriv *)GetWindowLongPtr(hwnd, 0); @@ -502,18 +496,18 @@ ALF__NotebookWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) && priv->tabPaneBgColor == ALF_COLOR_TRANSPARENT && ((oldR.bottom - oldR.top) != (r.bottom - r.top))) { // only needed when height changes, since bg is tiled horizontally - HWND panel = ALF_NotebookSelectedPanel(hwnd); + HWND panel = ALF_Notebook_SelectedPanel(hwnd); if (panel != NULL) ALF_InvalidateBackground(panel); } } - } else if (uMsg == ALF_NB_ADDTAB) { + } else if (uMsg == ALF_WM_NTBK_ADDTAB) { return (LRESULT)ALF_Notebook_InternalAddTab(hwnd, priv, (TCHAR *)lParam); - } else if (uMsg == ALF_NB_TABCOUNT) { + } else if (uMsg == ALF_WM_NTBK_TABCOUNT) { return (LRESULT)ALF_Notebook_InternalTabCount(hwnd, priv->hwndTabCtrl); - } else if (uMsg == ALF_NB_GETPANEL) { + } else if (uMsg == ALF_WM_NTBK_GETPANEL) { return (LRESULT)ALF_Notebook_InternalTabPanel(hwnd, priv->hwndTabCtrl, (int)lParam); - } else if (uMsg == ALF_NB_GETSELINDEX) { + } else if (uMsg == ALF_WM_NTBK_GETSELINDEX) { return (LRESULT)ALF_Notebook_InternalSelectedIndex(hwnd, priv->hwndTabCtrl); } else if (uMsg == WM_THEMECHANGED) { ALF_Notebook_InternalHandleThemeChange(hwnd, priv); @@ -567,7 +561,7 @@ ALF_AddNotebook(HWND parent, WORD id, int x, int y) 0, 0, 100, 100, parent, (HMENU)(ULONG_PTR)id, - ALF__NotebookWindowProc, + ALF_Notebook_WindowProc, NULL); ALF_AddWidget(parent, x, y, hwndNtbk, 0, 0, ALF_LAYOUT_SIZE_QUERY | ALF_LAYOUT_INHERITFONT | ALF_LAYOUT_SENDDPICHANGE); @@ -576,51 +570,51 @@ ALF_AddNotebook(HWND parent, WORD id, int x, int y) } HWND -ALF_NotebookAddTab(HWND notebook, const TCHAR *title) +ALF_Notebook_AddTab(HWND notebook, const TCHAR *title) { - return (HWND)SendMessage(notebook, ALF_NB_ADDTAB, 0, (LPARAM)title); + return (HWND)SendMessage(notebook, ALF_WM_NTBK_ADDTAB, 0, (LPARAM)title); } int -ALF_NotebookTabCount(HWND notebook) +ALF_Notebook_TabCount(HWND notebook) { - return (int)SendMessage(notebook, ALF_NB_TABCOUNT, 0, 0); + return (int)SendMessage(notebook, ALF_WM_NTBK_TABCOUNT, 0, 0); } int -ALF_NotebookTabIndex(HWND notebook, HWND tabPanel); +ALF_Notebook_TabIndex(HWND notebook, HWND tabPanel); HWND -ALF_NotebookTabPanel(HWND notebook, int index) +ALF_Notebook_TabPanel(HWND notebook, int index) { - return (HWND)SendMessage(notebook, ALF_NB_GETPANEL, 0, (LPARAM)index); + return (HWND)SendMessage(notebook, ALF_WM_NTBK_GETPANEL, 0, (LPARAM)index); } int -ALF_NotebookSelectedIndex(HWND notebook) +ALF_Notebook_SelectedIndex(HWND notebook) { - return (int)SendMessage(notebook, ALF_NB_GETSELINDEX, 0, 0); + return (int)SendMessage(notebook, ALF_WM_NTBK_GETSELINDEX, 0, 0); } HWND -ALF_NotebookSelectedPanel(HWND notebook) +ALF_Notebook_SelectedPanel(HWND notebook) { - int i = ALF_NotebookSelectedIndex(notebook); + int i = ALF_Notebook_SelectedIndex(notebook); if (i >= 0) { - return ALF_NotebookTabPanel(notebook, i); + return ALF_Notebook_TabPanel(notebook, i); } else { return NULL; } } DWORD -ALF_NotebookFlags(HWND notebook) +ALF_Notebook_Flags(HWND notebook) { return (DWORD)SendMessage(notebook, ALF_WM_NTBK_GETFLAGS, 0, 0); } void -ALF_NotebookSetFlags(HWND notebook, DWORD flags) +ALF_Notebook_SetFlags(HWND notebook, DWORD flags) { SendMessage(notebook, ALF_WM_NTBK_SETFLAGS, 0, (LPARAM)flags); } |
