|
|
@ -20,11 +20,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
#include "Common.h" // for generic_string
|
|
|
|
#include "Common.h" // for generic_string
|
|
|
|
|
|
|
|
|
|
|
|
namespace NppDarkMode
|
|
|
|
namespace NppDarkMode //命名空间NppDarkMode
|
|
|
|
{
|
|
|
|
{
|
|
|
|
struct Colors
|
|
|
|
struct Colors //Colors颜色结构体
|
|
|
|
{
|
|
|
|
{
|
|
|
|
COLORREF background = 0;
|
|
|
|
COLORREF background = 0; //COLORREF 是一个 32-bit 整型数值,它代表了一种颜色。
|
|
|
|
COLORREF softerBackground = 0;
|
|
|
|
COLORREF softerBackground = 0;
|
|
|
|
COLORREF hotBackground = 0;
|
|
|
|
COLORREF hotBackground = 0;
|
|
|
|
COLORREF pureBackground = 0;
|
|
|
|
COLORREF pureBackground = 0;
|
|
|
@ -38,30 +38,30 @@ namespace NppDarkMode
|
|
|
|
COLORREF disabledEdge = 0;
|
|
|
|
COLORREF disabledEdge = 0;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct Options
|
|
|
|
struct Options //Options选项结构体
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bool enable = false;
|
|
|
|
bool enable = false;
|
|
|
|
bool enableMenubar = false;
|
|
|
|
bool enableMenubar = false;
|
|
|
|
bool enablePlugin = false;
|
|
|
|
bool enablePlugin = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct NppDarkModeParams
|
|
|
|
struct NppDarkModeParams //params参数结构体
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const wchar_t* _themeClassName = nullptr;
|
|
|
|
const wchar_t* _themeClassName = nullptr;
|
|
|
|
bool _subclass = false;
|
|
|
|
bool _subclass = false;
|
|
|
|
bool _theme = false;
|
|
|
|
bool _theme = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
enum class ToolTipsType
|
|
|
|
enum class ToolTipsType //域内枚举,类型为ToolTipsType
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tooltip,
|
|
|
|
tooltip, //括号里是常量
|
|
|
|
toolbar,
|
|
|
|
toolbar,
|
|
|
|
listview,
|
|
|
|
listview,
|
|
|
|
treeview,
|
|
|
|
treeview,
|
|
|
|
tabbar
|
|
|
|
tabbar
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
enum ColorTone {
|
|
|
|
enum ColorTone { //色温
|
|
|
|
blackTone = 0,
|
|
|
|
blackTone = 0,
|
|
|
|
redTone = 1,
|
|
|
|
redTone = 1,
|
|
|
|
greenTone = 2,
|
|
|
|
greenTone = 2,
|
|
|
@ -72,14 +72,14 @@ namespace NppDarkMode
|
|
|
|
customizedTone = 32
|
|
|
|
customizedTone = 32
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
enum class TreeViewStyle
|
|
|
|
enum class TreeViewStyle //风格
|
|
|
|
{
|
|
|
|
{
|
|
|
|
classic = 0,
|
|
|
|
classic = 0,
|
|
|
|
light = 1,
|
|
|
|
light = 1,
|
|
|
|
dark = 2
|
|
|
|
dark = 2
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct AdvOptDefaults
|
|
|
|
struct AdvOptDefaults //默认选项
|
|
|
|
{
|
|
|
|
{
|
|
|
|
generic_string _xmlFileName;
|
|
|
|
generic_string _xmlFileName;
|
|
|
|
int _toolBarIconSet = -1;
|
|
|
|
int _toolBarIconSet = -1;
|
|
|
@ -87,7 +87,7 @@ namespace NppDarkMode
|
|
|
|
bool _tabUseTheme = false;
|
|
|
|
bool _tabUseTheme = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct AdvancedOptions
|
|
|
|
struct AdvancedOptions //高级选项
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bool _enableWindowsMode = false;
|
|
|
|
bool _enableWindowsMode = false;
|
|
|
|
|
|
|
|
|
|
|
@ -108,7 +108,7 @@ namespace NppDarkMode
|
|
|
|
|
|
|
|
|
|
|
|
bool isWindowsModeEnabled();
|
|
|
|
bool isWindowsModeEnabled();
|
|
|
|
void setWindowsMode(bool enable);
|
|
|
|
void setWindowsMode(bool enable);
|
|
|
|
generic_string getThemeName();
|
|
|
|
generic_string getThemeName(); //generic_string 类
|
|
|
|
void setThemeName(const generic_string& newThemeName);
|
|
|
|
void setThemeName(const generic_string& newThemeName);
|
|
|
|
int getToolBarIconSet(bool useDark);
|
|
|
|
int getToolBarIconSet(bool useDark);
|
|
|
|
void setToolBarIconSet(int state2Set, bool useDark);
|
|
|
|
void setToolBarIconSet(int state2Set, bool useDark);
|
|
|
@ -119,7 +119,7 @@ namespace NppDarkMode
|
|
|
|
|
|
|
|
|
|
|
|
bool isWindows10();
|
|
|
|
bool isWindows10();
|
|
|
|
bool isWindows11();
|
|
|
|
bool isWindows11();
|
|
|
|
DWORD getWindowsBuildNumber();
|
|
|
|
DWORD getWindowsBuildNumber(); //DWORD 就是 Double Word, 每个word为2个字节的长度,DWORD 双字即为4个字节,每个字节是8位,共32位。
|
|
|
|
|
|
|
|
|
|
|
|
COLORREF invertLightness(COLORREF c);
|
|
|
|
COLORREF invertLightness(COLORREF c);
|
|
|
|
COLORREF invertLightnessSofter(COLORREF c);
|
|
|
|
COLORREF invertLightnessSofter(COLORREF c);
|
|
|
@ -142,7 +142,7 @@ namespace NppDarkMode
|
|
|
|
COLORREF getHotEdgeColor();
|
|
|
|
COLORREF getHotEdgeColor();
|
|
|
|
COLORREF getDisabledEdgeColor();
|
|
|
|
COLORREF getDisabledEdgeColor();
|
|
|
|
|
|
|
|
|
|
|
|
HBRUSH getBackgroundBrush();
|
|
|
|
HBRUSH getBackgroundBrush(); //HBRUSH 取画刷
|
|
|
|
HBRUSH getDarkerBackgroundBrush();
|
|
|
|
HBRUSH getDarkerBackgroundBrush();
|
|
|
|
HBRUSH getSofterBackgroundBrush();
|
|
|
|
HBRUSH getSofterBackgroundBrush();
|
|
|
|
HBRUSH getHotBackgroundBrush();
|
|
|
|
HBRUSH getHotBackgroundBrush();
|
|
|
@ -152,7 +152,7 @@ namespace NppDarkMode
|
|
|
|
HBRUSH getHotEdgeBrush();
|
|
|
|
HBRUSH getHotEdgeBrush();
|
|
|
|
HBRUSH getDisabledEdgeBrush();
|
|
|
|
HBRUSH getDisabledEdgeBrush();
|
|
|
|
|
|
|
|
|
|
|
|
HPEN getDarkerTextPen();
|
|
|
|
HPEN getDarkerTextPen(); //画笔
|
|
|
|
HPEN getEdgePen();
|
|
|
|
HPEN getEdgePen();
|
|
|
|
HPEN getHotEdgePen();
|
|
|
|
HPEN getHotEdgePen();
|
|
|
|
HPEN getDisabledEdgePen();
|
|
|
|
HPEN getDisabledEdgePen();
|
|
|
@ -175,12 +175,12 @@ namespace NppDarkMode
|
|
|
|
Colors getDarkModeDefaultColors();
|
|
|
|
Colors getDarkModeDefaultColors();
|
|
|
|
void changeCustomTheme(const Colors& colors);
|
|
|
|
void changeCustomTheme(const Colors& colors);
|
|
|
|
|
|
|
|
|
|
|
|
// handle events
|
|
|
|
// handle events 处理事件
|
|
|
|
void handleSettingChange(HWND hwnd, LPARAM lParam, bool isFromBtn = false);
|
|
|
|
void handleSettingChange(HWND hwnd, LPARAM lParam, bool isFromBtn = false);
|
|
|
|
bool isDarkModeReg();
|
|
|
|
bool isDarkModeReg();
|
|
|
|
|
|
|
|
|
|
|
|
// processes messages related to UAH / custom menubar drawing.
|
|
|
|
// processes messages related to UAH / custom menubar drawing. 处理相关信息
|
|
|
|
// return true if handled, false to continue with normal processing in your wndproc
|
|
|
|
// return true if handled, false to continue with normal processing in your wndproc 解决了返回true,否则false,继续处理
|
|
|
|
bool runUAHWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT* lr);
|
|
|
|
bool runUAHWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT* lr);
|
|
|
|
void drawUAHMenuNCBottomLine(HWND hWnd);
|
|
|
|
void drawUAHMenuNCBottomLine(HWND hWnd);
|
|
|
|
|
|
|
|
|
|
|
@ -235,13 +235,13 @@ namespace NppDarkMode
|
|
|
|
bool isThemeDark();
|
|
|
|
bool isThemeDark();
|
|
|
|
void setBorder(HWND hwnd, bool border = true);
|
|
|
|
void setBorder(HWND hwnd, bool border = true);
|
|
|
|
|
|
|
|
|
|
|
|
BOOL CALLBACK enumAutocompleteProc(HWND hwnd, LPARAM lParam);
|
|
|
|
BOOL CALLBACK enumAutocompleteProc(HWND hwnd, LPARAM lParam); //Windows API中的回调函数,用于枚举自动完成列表中的项。HWND hwnd:自动完成列表的窗口句柄。 LPARAM lParam:用户定义的附加参数。
|
|
|
|
void setDarkAutoCompletion();
|
|
|
|
void setDarkAutoCompletion();
|
|
|
|
|
|
|
|
|
|
|
|
LRESULT onCtlColor(HDC hdc);
|
|
|
|
LRESULT onCtlColor(HDC hdc); //LRESULT是一个数据类型,指的是从窗口程序或者回调函数返回的32位值
|
|
|
|
LRESULT onCtlColorSofter(HDC hdc);
|
|
|
|
LRESULT onCtlColorSofter(HDC hdc);
|
|
|
|
LRESULT onCtlColorDarker(HDC hdc);
|
|
|
|
LRESULT onCtlColorDarker(HDC hdc);
|
|
|
|
LRESULT onCtlColorError(HDC hdc);
|
|
|
|
LRESULT onCtlColorError(HDC hdc);
|
|
|
|
LRESULT onCtlColorDarkerBGStaticText(HDC hdc, bool isTextEnabled);
|
|
|
|
LRESULT onCtlColorDarkerBGStaticText(HDC hdc, bool isTextEnabled);
|
|
|
|
INT_PTR onCtlColorListbox(WPARAM wParam, LPARAM lParam);
|
|
|
|
INT_PTR onCtlColorListbox(WPARAM wParam, LPARAM lParam); //INT_PTR是特殊定义的类型,是为了解决32位与64位编译器的兼容性而设置的关键字
|
|
|
|
}
|
|
|
|
}
|
|
|
|