From 079fdbf1a553e314cbba386b85ca92b67c61b8df Mon Sep 17 00:00:00 2001 From: Jonas Kümmerlin Date: Mon, 20 Apr 2020 17:18:20 +0200 Subject: fixup transparent background work and add test in widgetfactory Win32s bites once again with its 16bit WPARAM --- alf/alf.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'alf/alf.h') diff --git a/alf/alf.h b/alf/alf.h index 4102a1e..bd8ca0e 100644 --- a/alf/alf.h +++ b/alf/alf.h @@ -23,6 +23,7 @@ typedef struct { LRESULT (*notify)(void * /*closure*/, HWND /*window*/, WPARAM /*sourceid*/, NMHDR *); BOOL (*pretranslatemessage)(void * /*closure*/, HWND /*window*/, MSG * /*message*/); void (*paint)(void * /*closure*/, HWND, HDC, RECT *); + void (*windowposchanged)(void * /*closure*/, HWND, WINDOWPOS *); } ALFWindowVTable; typedef struct { @@ -45,6 +46,8 @@ typedef struct { #define ALF_LAYOUT_CUSTOMPOS 0x20 #define ALF_LAYOUT_SIZE_PX 0x40 #define ALF_LAYOUT_INHERITBGCOLOR 0x80 +#define ALF_LAYOUT_TRANSPARENTBG 0x100 +#define ALF_LAYOUT_SENDBGCHANGE 0x200 // label style flags @@ -72,6 +75,7 @@ typedef struct { #define ALF_WM_GETMODALRESULT (ALF_WM__BASE + 8) #define ALF_WM_CENTIPOINTTOPX (ALF_WM__BASE + 9) #define ALF_WM_SETFOCUS (ALF_WM__BASE + 10) +#define ALF_WM_BACKGROUNDCHANGE (ALF_WM__BASE + 11) #define ALF_WM_APPLYSIZE (ALF_WM__BASE + 12) #define ALF_WM_SETBGCOLOR (ALF_WM__BASE + 13) #define ALF_WM_GETBGCOLOR (ALF_WM__BASE + 14) @@ -190,12 +194,24 @@ ALF_WidgetHwndById(HWND win, WORD id); void ALF_InvalidateLayout(HWND win); +// Sends ALF_WM_BACKGROUNDCHANGE to notify the window of a changed background +// Only useful when you have overridden the window or panel pain() vfunc +// when you use solid background colors, ALF will handle this automatically +void +ALF_InvalidateBackground(HWND win); + // Recalculates the window's DPI and all fonts and applies them to child widgets. // ALF does this automatically on a DPI or settings change so you shouldn't have // to call ALF_UpdateFonts(). void ALF_UpdateFonts(HWND win); +void +ALF_SetBackgroundColor(HWND win, ALFColor color); + +ALFColor +ALF_GetBackgroundColor(HWND win); + void ALF_ResizeWindow(HWND win, int cptWidth, int cptHeight); -- cgit v1.2.3