|
1 |
| -// this file is part of Notepad++ |
2 |
| -// Copyright (C)2005 Jens Lorenz <[email protected]> |
3 |
| -// |
4 |
| -// This program is free software; you can redistribute it and/or |
5 |
| -// modify it under the terms of the GNU General Public License |
6 |
| -// as published by the Free Software Foundation; either |
7 |
| -// version 2 of the License, or (at your option) any later version. |
8 |
| -// |
9 |
| -// // Note that the GPL places important restrictions on "derived works", yet |
10 |
| -// it does not provide a detailed definition of that term. To avoid |
11 |
| -// misunderstandings, we consider an application to constitute a |
12 |
| -// "derivative work" for the purpose of this license if it does any of the |
13 |
| -// following: |
14 |
| -// 1. Integrates source code from Notepad++. |
15 |
| -// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable |
16 |
| -// installer, such as those produced by InstallShield. |
17 |
| -// 3. Links to a library or executes a program that does any of the above. |
18 |
| -// |
| 1 | +// This file is part of Notepad++ project |
| 2 | +// Copyright (C)2021 Don HO <[email protected]> |
| 3 | + |
| 4 | +// This program is free software: you can redistribute it and/or modify |
| 5 | +// it under the terms of the GNU General Public License as published by |
| 6 | +// the Free Software Foundation, either version 3 of the License, or |
| 7 | +// at your option any later version. |
| 8 | +// |
19 | 9 | // This program is distributed in the hope that it will be useful,
|
20 | 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
|
21 |
| -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
22 | 12 | // GNU General Public License for more details.
|
23 |
| -// |
| 13 | +// |
24 | 14 | // You should have received a copy of the GNU General Public License
|
25 |
| -// along with this program; if not, write to the Free Software |
26 |
| -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 15 | +// along with this program. If not, see <https://www.gnu.org/licenses/>. |
27 | 16 |
|
28 | 17 |
|
29 | 18 | #pragma once
|
|
47 | 36 | #define DWS_ICONTAB 0x00000001 // Icon for tabs are available
|
48 | 37 | #define DWS_ICONBAR 0x00000002 // Icon for icon bar are available (currently not supported)
|
49 | 38 | #define DWS_ADDINFO 0x00000004 // Additional information are in use
|
| 39 | +#define DWS_USEOWNDARKMODE 0x00000008 // Use plugin's own dark mode |
50 | 40 | #define DWS_PARAMSALL (DWS_ICONTAB|DWS_ICONBAR|DWS_ADDINFO)
|
51 | 41 |
|
52 | 42 | // default docking values for first call of plugin
|
|
57 | 47 | #define DWS_DF_FLOATING 0x80000000 // default state is floating
|
58 | 48 |
|
59 | 49 |
|
60 |
| -typedef struct { |
61 |
| - HWND hClient; // client Window Handle |
62 |
| - const TCHAR *pszName; // name of plugin (shown in window) |
63 |
| - int dlgID; // a funcItem provides the function pointer to start a dialog. Please parse here these ID |
| 50 | +struct tTbData { |
| 51 | + HWND hClient = nullptr; // client Window Handle |
| 52 | + const TCHAR* pszName = nullptr; // name of plugin (shown in window) |
| 53 | + int dlgID = 0; // a funcItem provides the function pointer to start a dialog. Please parse here these ID |
64 | 54 |
|
65 | 55 | // user modifications
|
66 |
| - UINT uMask; // mask params: look to above defines |
67 |
| - HICON hIconTab; // icon for tabs |
68 |
| - const TCHAR *pszAddInfo; // for plugin to display additional informations |
| 56 | + UINT uMask = 0; // mask params: look to above defines |
| 57 | + HICON hIconTab = nullptr; // icon for tabs |
| 58 | + const TCHAR* pszAddInfo = nullptr; // for plugin to display additional informations |
69 | 59 |
|
70 | 60 | // internal data, do not use !!!
|
71 |
| - RECT rcFloat; // floating position |
72 |
| - int iPrevCont; // stores the privious container (toggling between float and dock) |
73 |
| - const TCHAR* pszModuleName; // it's the plugin file name. It's used to identify the plugin |
74 |
| -} tTbData; |
| 61 | + RECT rcFloat = {}; // floating position |
| 62 | + int iPrevCont = 0; // stores the privious container (toggling between float and dock) |
| 63 | + const TCHAR* pszModuleName = nullptr; // it's the plugin file name. It's used to identify the plugin |
| 64 | +}; |
75 | 65 |
|
76 | 66 |
|
77 |
| -typedef struct { |
78 |
| - HWND hWnd; // the docking manager wnd |
79 |
| - RECT rcRegion[DOCKCONT_MAX]; // position of docked dialogs |
80 |
| -} tDockMgr; |
| 67 | +struct tDockMgr { |
| 68 | + HWND hWnd = nullptr; // the docking manager wnd |
| 69 | + RECT rcRegion[DOCKCONT_MAX] = {{}}; // position of docked dialogs |
| 70 | +}; |
81 | 71 |
|
82 | 72 |
|
83 | 73 | #define HIT_TEST_THICKNESS 20
|
|
0 commit comments