2021-02-22 14:55:45 +01:00
# pragma once
# include <Windows.h>
namespace NppDarkMode
{
struct Options
{
bool enable = false ;
bool enableExperimental = false ;
bool enableMenubar = false ;
bool enableScrollbarHack = false ;
} ;
void initDarkMode ( ) ; // pulls options from NppParameters
void refreshDarkMode ( HWND hwnd , bool forceRefresh = false ) ; // attempts to apply new options from NppParameters, sends NPPM_INTERNAL_REFRESHDARKMODE to hwnd's top level parent
bool isEnabled ( ) ;
bool isDarkMenuEnabled ( ) ;
bool isExperimentalEnabled ( ) ;
bool isScrollbarHackEnabled ( ) ;
COLORREF invertLightness ( COLORREF c ) ;
COLORREF invertLightnessSofter ( COLORREF c ) ;
COLORREF getBackgroundColor ( ) ;
COLORREF getSofterBackgroundColor ( ) ;
COLORREF getHotBackgroundColor ( ) ;
COLORREF getPureBackgroundColor ( ) ;
COLORREF getTextColor ( ) ;
COLORREF getDarkerTextColor ( ) ;
COLORREF getEdgeColor ( ) ;
COLORREF getErrorBackgroundColor ( ) ;
HBRUSH getBackgroundBrush ( ) ;
HBRUSH getPureBackgroundBrush ( ) ;
HBRUSH getSofterBackgroundBrush ( ) ;
HBRUSH getHotBackgroundBrush ( ) ;
HBRUSH getErrorBackgroundBrush ( ) ;
// handle events
2021-04-26 08:15:16 +02:00
void handleSettingChange ( HWND hwnd , LPARAM lParam ) ;
2021-02-22 14:55:45 +01:00
// processes messages related to UAH / custom menubar drawing.
// return true if handled, false to continue with normal processing in your wndproc
bool runUAHWndProc ( HWND hWnd , UINT message , WPARAM wParam , LPARAM lParam , LRESULT * lr ) ;
// from DarkMode.h
2021-04-26 08:15:16 +02:00
void initExperimentalDarkMode ( bool fixDarkScrollbar , bool dark ) ;
2021-02-22 14:55:45 +01:00
void allowDarkModeForApp ( bool allow ) ;
bool allowDarkModeForWindow ( HWND hWnd , bool allow ) ;
2021-04-26 08:15:16 +02:00
void setTitleBarThemeColor ( HWND hWnd , bool dark ) ;
2021-02-22 14:55:45 +01:00
// enhancements to DarkMode.h
void enableDarkScrollBarForWindowAndChildren ( HWND hwnd ) ;
void subclassButtonControl ( HWND hwnd ) ;
2021-04-23 23:41:11 +02:00
void subclassGroupboxControl ( HWND hwnd ) ;
2021-02-22 14:55:45 +01:00
void subclassToolbarControl ( HWND hwnd ) ;
2021-04-23 23:41:11 +02:00
void subclassTabControl ( HWND hwnd ) ;
2021-04-26 08:15:16 +02:00
void autoSubclassAndThemeChildControls ( HWND hwndParent , bool subclass = true , bool theme = true ) ;
void autoThemeChildControls ( HWND hwndParent ) ;
2021-02-22 14:55:45 +01:00
}