1 // this file is part of Notepad++
2 // Copyright (C)2005 Jens Lorenz <jens.plugin.npp@gmx.de>
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 // 
19 // This program is distributed in the hope that it will be useful,
20 // but WITHOUT ANY WARRANTY; without even the implied warranty of
21 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22 // GNU General Public License for more details.
23 // 
24 // 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.
27 /**
28  *
29  *
30  * License: GPL-2.0 or later
31  */
32 module npp_api.powereditor.wincontrols.dockingwnd.docking;
33 
34 
35 version (Windows):
36 
37 private static import core.sys.windows.windef;
38 private static import core.sys.windows.winnt;
39 
40 // ATTENTION : It's a part of interface header, so don't include the others header here
41 
42 // styles for containers
43 enum CAPTION_TOP = core.sys.windows.windef.TRUE;
44 enum CAPTION_BOTTOM = core.sys.windows.windef.FALSE;
45 
46 //   defines for docking manager
47 enum CONT_LEFT = 0;
48 enum CONT_RIGHT = 1;
49 enum CONT_TOP = 2;
50 enum CONT_BOTTOM = 3;
51 enum DOCKCONT_MAX = 4;
52 
53 // mask params for plugins of internal dialogs
54 
55 /**
56  * Icon for tabs are available
57  */
58 enum DWS_ICONTAB = 0x00000001;
59 
60 /**
61  * Icon for icon bar are available (currently not supported)
62  */
63 enum DWS_ICONBAR = 0x00000002;
64 
65 /**
66  * Additional information are in use
67  */
68 enum DWS_ADDINFO = 0x00000004;
69 
70 enum DWS_PARAMSALL = .DWS_ICONTAB | .DWS_ICONBAR | .DWS_ADDINFO;
71 
72 // default docking values for first call of plugin
73 
74 /**
75  * default docking on left
76  */
77 enum DWS_DF_CONT_LEFT = .CONT_LEFT << 28;
78 
79 /**
80  * default docking on right
81  */
82 enum DWS_DF_CONT_RIGHT = .CONT_RIGHT << 28;
83 
84 /**
85  * default docking on top
86  */
87 enum DWS_DF_CONT_TOP = .CONT_TOP << 28;
88 
89 /**
90  * default docking on bottom
91  */
92 enum DWS_DF_CONT_BOTTOM = .CONT_BOTTOM << 28;
93 
94 /**
95  * default state is floating
96  */
97 enum DWS_DF_FLOATING = 0x80000000;
98 
99 extern (C)
100 struct tTbData
101 {
102 	static import core.sys.windows.windef;
103 	static import core.sys.windows.winnt;
104 
105 	/**
106 	 * client Window Handle
107 	 */
108 	core.sys.windows.windef.HWND hClient;
109 
110 	/**
111 	 * name of plugin (shown in window)
112 	 */
113 	const (core.sys.windows.winnt.WCHAR)* pszName;
114 
115 	/**
116 	 * a funcItem provides the function pointer to start a dialog. Please parse here these ID
117 	 */
118 	int dlgID;
119 
120 	// user modifications
121 
122 	/**
123 	 * mask params: look to above defines
124 	 */
125 	core.sys.windows.windef.UINT uMask;
126 
127 	/**
128 	 * icon for tabs
129 	 */
130 	core.sys.windows.windef.HICON hIconTab;
131 
132 	/**
133 	 * for plugin to display additional informations
134 	 */
135 	const (core.sys.windows.winnt.WCHAR)* pszAddInfo;
136 
137 private:
138 	/**
139 	 * floating position
140 	 */
141 	core.sys.windows.windef.RECT rcFloat;
142 
143 	/**
144 	 * stores the privious container (toggling between float and dock)
145 	 */
146 	int iPrevCont;
147 
148 public:
149 	/**
150 	 * it's the plugin file name. It's used to identify the plugin
151 	 */
152 	const (core.sys.windows.winnt.WCHAR)* pszModuleName;
153 }
154 
155 struct tDockMgr
156 {
157 	static import core.sys.windows.windef;
158 
159 	/**
160 	 * the docking manager wnd
161 	 */
162 	core.sys.windows.windef.HWND hWnd;
163 
164 	/**
165 	 * position of docked dialogs
166 	 */
167 	core.sys.windows.windef.RECT[.DOCKCONT_MAX] rcRegion;
168 }
169 
170 enum HIT_TEST_THICKNESS = 20;
171 enum SPLITTER_WIDTH = 4;