From 479d1226faaa937ef6820b14f36099ef3f575883 Mon Sep 17 00:00:00 2001 From: Jonas Kümmerlin Date: Sat, 18 Apr 2020 17:34:55 +0200 Subject: implement background color reduce flickering by keeping pixels if we know the background didn't change panel text is now gone, it would require us to redraw every transparent widget on top, which is a bad tradeoff since that panel text isn't very useful anyway. --- alf/alf.h | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'alf/alf.h') diff --git a/alf/alf.h b/alf/alf.h index 3274016..20dccfc 100644 --- a/alf/alf.h +++ b/alf/alf.h @@ -33,9 +33,10 @@ typedef struct { #define ALF_LAYOUT_SIZE_RADIOBUTTON 0x07 /* unimplemented */ #define ALF_LAYOUT_SIZE_CHECKBOX 0x07 /* unimplemented */ #define ALF_LAYOUT_SIZETYPE_MASK 0x0f -#define ALF_LAYOUT_INHERITFONT 0x10 -#define ALF_LAYOUT_CUSTOMPOS 0x20 -#define ALF_LAYOUT_SIZE_PX 0x40 +#define ALF_LAYOUT_INHERITFONT 0x10 +#define ALF_LAYOUT_CUSTOMPOS 0x20 +#define ALF_LAYOUT_SIZE_PX 0x40 +#define ALF_LAYOUT_INHERITBGCOLOR 0x80 // label style flags @@ -64,6 +65,8 @@ typedef struct { #define ALF_WM_CENTIPOINTTOPX (ALF_WM__BASE + 9) #define ALF_WM_SETFOCUS (ALF_WM__BASE + 10) #define ALF_WM_APPLYSIZE (ALF_WM__BASE + 12) +#define ALF_WM_SETBGCOLOR (ALF_WM__BASE + 13) +#define ALF_WM_GETBGCOLOR (ALF_WM__BASE + 14) #define ALF_WM_GETWIDGETATPOS (ALF_WM__BASE + 15) #define ALF_WM_PRETRANSLATEMSG (ALF_WM__BASE + 16) #define ALF_WM_INVALIDATELAYOUT (ALF_WM__BASE + 17) @@ -90,6 +93,11 @@ typedef struct { #define ALF_WM_LBL_GETSTYLE (ALF_WM__BASE + 201) #define ALF_WM_LBL_SETSTYLE (ALF_WM__BASE + 202) +typedef DWORD ALFColor; + +#define ALF_COLOR_TRANSPARENT ((ALFColor)-1) +#define ALF_COLOR_RGB(r, g, b) ((ALFColor)(((DWORD)(BYTE)r) | (((DWORD)(BYTE)g) << 8) | (((DWORD)(BYTE)b) << 16))) +#define ALF_COLOR_SYS(i) ((ALFColor)(0x80000000 | (((DWORD)(BYTE)i) << 24))) typedef struct { const TCHAR *className; @@ -124,6 +132,9 @@ ALF_ReAlloc(void *ptr, SIZE_T nmemb, SIZE_T size); void ALF_Free(const void *p); +COLORREF +ALF_ColorToGdi(ALFColor color); + LPTSTR ALF_RegisterWindowClass(HINSTANCE instance, const ALFWindowClassParams *params); -- cgit v1.2.3