Skip to content

Commit 36fc734

Browse files
committed
Update all dependencies
1 parent 3d89efa commit 36fc734

File tree

13 files changed

+1978
-1073
lines changed

13 files changed

+1978
-1073
lines changed

external/npp/Docking.h

Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
1-
/*
2-
this file is part of Function List Plugin for Notepad++
3-
Copyright (C)2005 Jens Lorenz <[email protected]>
1+
// This file is part of Notepad++ project
2+
// Copyright (C)2025 Don HO <[email protected]>
43

5-
This program is free software; you can redistribute it and/or
6-
modify it under the terms of the GNU General Public License
7-
as published by the Free Software Foundation; either
8-
version 2 of the License, or (at your option) any later version.
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+
//
9+
// This program is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU General Public License
15+
// along with this program. If not, see <https://www.gnu.org/licenses/>.
916

10-
This program is distributed in the hope that it will be useful,
11-
but WITHOUT ANY WARRANTY; without even the implied warranty of
12-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13-
GNU General Public License for more details.
1417

15-
You should have received a copy of the GNU General Public License
16-
along with this program; if not, write to the Free Software
17-
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18-
*/
18+
#pragma once
1919

20-
#ifndef DOCKING_H
21-
#define DOCKING_H
20+
#include <windows.h>
2221

2322
// ATTENTION : It's a part of interface header, so don't include the others header here
2423

@@ -37,6 +36,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
3736
#define DWS_ICONTAB 0x00000001 // Icon for tabs are available
3837
#define DWS_ICONBAR 0x00000002 // Icon for icon bar are available (currently not supported)
3938
#define DWS_ADDINFO 0x00000004 // Additional information are in use
39+
#define DWS_USEOWNDARKMODE 0x00000008 // Use plugin's own dark mode
4040
#define DWS_PARAMSALL (DWS_ICONTAB|DWS_ICONBAR|DWS_ADDINFO)
4141

4242
// default docking values for first call of plugin
@@ -47,31 +47,29 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
4747
#define DWS_DF_FLOATING 0x80000000 // default state is floating
4848

4949

50-
typedef struct {
51-
HWND hClient; // client Window Handle
52-
TCHAR *pszName; // name of plugin (shown in window)
53-
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 wchar_t* 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
5454

5555
// user modifications
56-
UINT uMask; // mask params: look to above defines
57-
HICON hIconTab; // icon for tabs
58-
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 wchar_t* pszAddInfo = nullptr; // for plugin to display additional information
5959

6060
// internal data, do not use !!!
61-
RECT rcFloat; // floating position
62-
int iPrevCont; // stores the privious container (toggling between float and dock)
63-
const TCHAR* pszModuleName; // it's the plugin file name. It's used to identify the plugin
64-
} tTbData;
61+
RECT rcFloat = {}; // floating position
62+
int iPrevCont = 0; // stores the privious container (toggling between float and dock)
63+
const wchar_t* pszModuleName = nullptr; // it's the plugin file name. It's used to identify the plugin
64+
};
6565

6666

67-
typedef struct {
68-
HWND hWnd; // the docking manager wnd
69-
RECT rcRegion[DOCKCONT_MAX]; // position of docked dialogs
70-
} tDockMgr;
67+
struct tDockMgr {
68+
HWND hWnd = nullptr; // the docking manager wnd
69+
RECT rcRegion[DOCKCONT_MAX] = {{}}; // position of docked dialogs
70+
};
7171

7272

7373
#define HIT_TEST_THICKNESS 20
7474
#define SPLITTER_WIDTH 4
7575

76-
77-
#endif // DOCKING_H

external/npp/DockingDlgInterface.h

Lines changed: 87 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,120 +1,131 @@
1-
/*
2-
this file is part of Function List Plugin for Notepad++
3-
Copyright (C)2005 Jens Lorenz <[email protected]>
1+
// This file is part of Notepad++ project
2+
// Copyright (C)2006 Jens Lorenz <[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+
//
9+
// This program is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU General Public License
15+
// along with this program. If not, see <https://www.gnu.org/licenses/>.
416

5-
This program is free software; you can redistribute it and/or
6-
modify it under the terms of the GNU General Public License
7-
as published by the Free Software Foundation; either
8-
version 2 of the License, or (at your option) any later version.
9-
10-
This program is distributed in the hope that it will be useful,
11-
but WITHOUT ANY WARRANTY; without even the implied warranty of
12-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13-
GNU General Public License for more details.
14-
15-
You should have received a copy of the GNU General Public License
16-
along with this program; if not, write to the Free Software
17-
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18-
*/
1917

2018
#pragma once
2119

22-
#include "StaticDialog.h"
2320
#include "dockingResource.h"
2421
#include "Docking.h"
22+
23+
#include <assert.h>
2524
#include <shlwapi.h>
25+
#include <string>
26+
#include "StaticDialog.h"
27+
2628

2729

2830
class DockingDlgInterface : public StaticDialog
2931
{
3032
public:
31-
DockingDlgInterface() : StaticDialog() {};
32-
DockingDlgInterface(int dlgID) : StaticDialog(), _dlgID(dlgID) {};
33+
DockingDlgInterface() = default;
34+
explicit DockingDlgInterface(int dlgID): _dlgID(dlgID) {}
3335

34-
virtual void init(HINSTANCE hInst, HWND parent)
35-
{
36+
virtual void init(HINSTANCE hInst, HWND parent) {
3637
StaticDialog::init(hInst, parent);
37-
::GetModuleFileName((HMODULE)hInst, _moduleName, MAX_PATH);
38-
lstrcpy(_moduleName, PathFindFileName(_moduleName));
38+
TCHAR temp[MAX_PATH];
39+
::GetModuleFileName(reinterpret_cast<HMODULE>(hInst), temp, MAX_PATH);
40+
_moduleName = ::PathFindFileName(temp);
3941
}
4042

41-
void create(tTbData * data, bool isRTL = false)
42-
{
43+
void create(tTbData* data, bool isRTL = false) {
44+
assert(data != nullptr);
4345
StaticDialog::create(_dlgID, isRTL);
44-
::GetWindowText(_hSelf, _pluginName, _countof(_pluginName));
46+
TCHAR temp[MAX_PATH];
47+
::GetWindowText(_hSelf, temp, MAX_PATH);
48+
_pluginName = temp;
4549

46-
// user information
50+
// user information
4751
data->hClient = _hSelf;
48-
data->pszName = _pluginName;
52+
data->pszName = _pluginName.c_str();
4953

5054
// supported features by plugin
5155
data->uMask = 0;
5256

5357
// additional info
5458
data->pszAddInfo = NULL;
55-
_data = data;
59+
}
5660

61+
virtual void updateDockingDlg() {
62+
::SendMessage(_hParent, NPPM_DMMUPDATEDISPINFO, 0, reinterpret_cast<LPARAM>(_hSelf));
5763
}
5864

59-
virtual void updateDockingDlg(void)
60-
{
61-
::SendMessage(_hParent, NPPM_DMMUPDATEDISPINFO, 0, (LPARAM)_hSelf);
65+
virtual void destroy() {}
66+
67+
virtual void setBackgroundColor(COLORREF) {}
68+
virtual void setForegroundColor(COLORREF) {}
69+
70+
virtual void display(bool toShow = true) const {
71+
::SendMessage(_hParent, toShow ? NPPM_DMMSHOW : NPPM_DMMHIDE, 0, reinterpret_cast<LPARAM>(_hSelf));
6272
}
6373

64-
virtual void destroy() {}
74+
bool isClosed() const {
75+
return _isClosed;
76+
}
6577

66-
virtual void display(bool toShow = true) const
67-
{
68-
::SendMessage(_hParent, toShow ? NPPM_DMMSHOW : NPPM_DMMHIDE, 0, (LPARAM)_hSelf);
78+
void setClosed(bool toClose) {
79+
_isClosed = toClose;
6980
}
7081

71-
const TCHAR * getPluginFileName() const { return _moduleName; }
82+
const TCHAR * getPluginFileName() const {
83+
return _moduleName.c_str();
84+
}
7285

73-
protected:
74-
virtual INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM /*wParam*/, LPARAM lParam)
75-
{
76-
switch (message)
77-
{
86+
protected :
87+
int _dlgID = -1;
88+
bool _isFloating = true;
89+
int _iDockedPos = 0;
90+
std::wstring _moduleName;
91+
std::wstring _pluginName;
92+
bool _isClosed = false;
7893

79-
case WM_NOTIFY:
94+
virtual INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM, LPARAM lParam) {
95+
switch (message)
8096
{
81-
LPNMHDR pnmh = (LPNMHDR)lParam;
82-
83-
if (pnmh->hwndFrom == _hParent)
97+
case WM_NOTIFY:
8498
{
85-
switch (LOWORD(pnmh->code))
86-
{
87-
case DMN_CLOSE:
88-
{
89-
break;
90-
}
91-
case DMN_FLOAT:
92-
{
93-
_isFloating = true;
94-
break;
95-
}
96-
case DMN_DOCK:
99+
LPNMHDR pnmh = reinterpret_cast<LPNMHDR>(lParam);
100+
101+
if (pnmh->hwndFrom == _hParent)
97102
{
98-
_isFloating = false;
99-
break;
100-
}
101-
default:
102-
break;
103+
switch (LOWORD(pnmh->code))
104+
{
105+
case DMN_CLOSE:
106+
{
107+
break;
108+
}
109+
case DMN_FLOAT:
110+
{
111+
_isFloating = true;
112+
break;
113+
}
114+
case DMN_DOCK:
115+
{
116+
_iDockedPos = HIWORD(pnmh->code);
117+
_isFloating = false;
118+
break;
119+
}
120+
default:
121+
break;
122+
}
103123
}
124+
break;
104125
}
105-
break;
106-
}
107-
default:
108-
break;
126+
default:
127+
break;
109128
}
110129
return FALSE;
111130
};
112-
113-
// Handles
114-
HWND _HSource = nullptr;
115-
tTbData* _data = nullptr;
116-
int _dlgID = 0;
117-
bool _isFloating = false;
118-
TCHAR _moduleName[MAX_PATH] = {};
119-
TCHAR _pluginName[MAX_PATH] = {};
120131
};

0 commit comments

Comments
 (0)