Skip to content
This repository was archived by the owner on Jan 13, 2024. It is now read-only.

Commit d8f758d

Browse files
committed
Split code into Docking_h
1 parent 071844a commit d8f758d

File tree

4 files changed

+75
-56
lines changed

4 files changed

+75
-56
lines changed

Demo Plugin/NppManagedPluginDemo/NppManagedPluginDemo.VS2015.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@
4848
<Compile Include="..\..\Visual Studio Project Template C#\DllExport\DllExportAttribute.cs">
4949
<Link>DllExport\DllExportAttribute.cs</Link>
5050
</Compile>
51+
<Compile Include="..\..\Visual Studio Project Template C#\Integration\Docking_h.cs">
52+
<Link>Integration\Docking_h.cs</Link>
53+
</Compile>
5154
<Compile Include="..\..\Visual Studio Project Template C#\NppPluginNETBase.cs">
5255
<Link>NppPluginNETBase.cs</Link>
5356
</Compile>

Visual Studio Project Template C#/$projectname$.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
<Compile Include="Main.cs" />
4545
<Compile Include="NppPluginNETBase.cs" />
4646
<Compile Include="NppPluginNETHelper.cs" />
47+
<Compile Include="Integration\Docking_h.cs" />
4748
<Compile Include="Properties\AssemblyInfo.cs" />
4849
<Compile Include="Properties\Resources.Designer.cs">
4950
<AutoGen>True</AutoGen>
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
// NPP plugin for .Net by Kasper Graversen
2+
//
3+
// This file should stay in sync with the CPP project file
4+
// "notepad-plus-plus/PowerEditor/src/WinControls/DockingWnd/Docking.h"
5+
// found at
6+
// https://github.com/notepad-plus-plus/notepad-plus-plus/blob/287ce9ec147d6d64224d8990f99385f57a240df4/PowerEditor/src/WinControls/DockingWnd/Docking.h
7+
8+
using System;
9+
using System.Runtime.InteropServices;
10+
11+
namespace Kbg.NppPluginNET
12+
{
13+
14+
[Flags]
15+
public enum NppTbMsg : uint
16+
{
17+
// styles for containers
18+
//CAPTION_TOP = 1,
19+
//CAPTION_BOTTOM = 0,
20+
21+
// defines for docking manager
22+
CONT_LEFT = 0,
23+
CONT_RIGHT = 1,
24+
CONT_TOP = 2,
25+
CONT_BOTTOM = 3,
26+
DOCKCONT_MAX = 4,
27+
28+
// mask params for plugins of internal dialogs
29+
DWS_ICONTAB = 0x00000001, // Icon for tabs are available
30+
DWS_ICONBAR = 0x00000002, // Icon for icon bar are available (currently not supported)
31+
DWS_ADDINFO = 0x00000004, // Additional information are in use
32+
DWS_PARAMSALL = (DWS_ICONTAB | DWS_ICONBAR | DWS_ADDINFO),
33+
34+
// default docking values for first call of plugin
35+
DWS_DF_CONT_LEFT = (CONT_LEFT << 28), // default docking on left
36+
DWS_DF_CONT_RIGHT = (CONT_RIGHT << 28), // default docking on right
37+
DWS_DF_CONT_TOP = (CONT_TOP << 28), // default docking on top
38+
DWS_DF_CONT_BOTTOM = (CONT_BOTTOM << 28), // default docking on bottom
39+
DWS_DF_FLOATING = 0x80000000 // default state is floating
40+
}
41+
42+
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
43+
public struct NppTbData
44+
{
45+
public IntPtr hClient; // HWND: client Window Handle
46+
public string pszName; // TCHAR*: name of plugin (shown in window)
47+
public int dlgID; // int: a funcItem provides the function pointer to start a dialog. Please parse here these ID
48+
// user modifications
49+
public NppTbMsg uMask; // UINT: mask params: look to above defines
50+
public uint hIconTab; // HICON: icon for tabs
51+
public string pszAddInfo; // TCHAR*: for plugin to display additional informations
52+
// internal data, do not use !!!
53+
public RECT rcFloat; // RECT: floating position
54+
public int iPrevCont; // int: stores the privious container (toggling between float and dock)
55+
public string pszModuleName; // const TCHAR*: it's the plugin file name. It's used to identify the plugin
56+
}
57+
58+
[StructLayout(LayoutKind.Sequential)]
59+
public struct RECT
60+
{
61+
public RECT(int left, int top, int right, int bottom)
62+
{
63+
Left = left; Top = top; Right = right; Bottom = bottom;
64+
}
65+
public int Left;
66+
public int Top;
67+
public int Right;
68+
public int Bottom;
69+
}
70+
71+
}

Visual Studio Project Template C#/NppPluginNETHelper.cs

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -136,62 +136,6 @@ public void Dispose()
136136
}
137137
}
138138

139-
[StructLayout(LayoutKind.Sequential)]
140-
public struct RECT
141-
{
142-
public RECT(int left, int top, int right, int bottom)
143-
{
144-
Left = left; Top = top; Right = right; Bottom = bottom;
145-
}
146-
public int Left;
147-
public int Top;
148-
public int Right;
149-
public int Bottom;
150-
}
151-
152-
[Flags]
153-
public enum NppTbMsg : uint
154-
{
155-
// styles for containers
156-
//CAPTION_TOP = 1,
157-
//CAPTION_BOTTOM = 0,
158-
159-
// defines for docking manager
160-
CONT_LEFT = 0,
161-
CONT_RIGHT = 1,
162-
CONT_TOP = 2,
163-
CONT_BOTTOM = 3,
164-
DOCKCONT_MAX = 4,
165-
166-
// mask params for plugins of internal dialogs
167-
DWS_ICONTAB = 0x00000001, // Icon for tabs are available
168-
DWS_ICONBAR = 0x00000002, // Icon for icon bar are available (currently not supported)
169-
DWS_ADDINFO = 0x00000004, // Additional information are in use
170-
DWS_PARAMSALL = (DWS_ICONTAB|DWS_ICONBAR|DWS_ADDINFO),
171-
172-
// default docking values for first call of plugin
173-
DWS_DF_CONT_LEFT = (CONT_LEFT << 28), // default docking on left
174-
DWS_DF_CONT_RIGHT = (CONT_RIGHT << 28), // default docking on right
175-
DWS_DF_CONT_TOP = (CONT_TOP << 28), // default docking on top
176-
DWS_DF_CONT_BOTTOM = (CONT_BOTTOM << 28), // default docking on bottom
177-
DWS_DF_FLOATING = 0x80000000 // default state is floating
178-
}
179-
180-
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
181-
public struct NppTbData
182-
{
183-
public IntPtr hClient; // HWND: client Window Handle
184-
public string pszName; // TCHAR*: name of plugin (shown in window)
185-
public int dlgID; // int: a funcItem provides the function pointer to start a dialog. Please parse here these ID
186-
// user modifications
187-
public NppTbMsg uMask; // UINT: mask params: look to above defines
188-
public uint hIconTab; // HICON: icon for tabs
189-
public string pszAddInfo; // TCHAR*: for plugin to display additional informations
190-
// internal data, do not use !!!
191-
public RECT rcFloat; // RECT: floating position
192-
public int iPrevCont; // int: stores the privious container (toggling between float and dock)
193-
public string pszModuleName; // const TCHAR*: it's the plugin file name. It's used to identify the plugin
194-
}
195139

196140
public enum LangType
197141
{

0 commit comments

Comments
 (0)