MwLLDoModern

This commit is contained in:
IoIxD 2026-04-26 23:55:34 -07:00
commit 2323b7f69f
11 changed files with 39 additions and 5 deletions

2
WatMakefile generated
View file

@ -1,7 +1,7 @@
CC = wcc386 -bt=nt -q -bd
LD = wlink option quiet
CFLAGS = -i=include -i=external/libz/include -d_MILSKO -dUSE_GDI -dUSE_STB_TRUETYPE -dUSE_STB_IMAGE -dSTBI_NO_SIMD
CFLAGS = -i=include -i=external/libz/include -d_MILSKO -dUSE_GDI -dUSE_STB_TRUETYPE -dUSE_STB_IMAGE -dSTBI_NO_SIMD -dUSE_CLASSIC_THEME
LDFLAGS = system nt_dll
all: src/Mw.dll
clean: .SYMBOLIC

View file

@ -300,13 +300,21 @@ MWDECL void (*MwLLGetCursorCoord)(MwLL handle, MwPoint* point);
MWDECL void (*MwLLGetScreenSize)(MwLL handle, MwRect* rect);
/*!
* @brief Set dark theme
* @brief Set any extra parameters for dark theme
* @param handle Handle
* @param toggle Toggle
* @warning Do not run `handle->common.handler->dark_theme` when this function gets called
* @warning This is for stuff like, i.e. setting the accent color on modern Windows. The user themselves sets dark theme with MwNdarkTheme.
*/
MWDECL void (*MwLLSetDarkTheme)(MwLL handle, int toggle);
/*!
* @brief Whether or not the platform should default to modern theme.
* @param handle Handle
* @return whether to default.
*/
MWDECL MwBool (*MwLLDoModern)(MwLL handle);
/* font renderer */
MWDECL void MwFLSetup(void);

View file

@ -56,6 +56,6 @@
MwLLGetScreenSize = MwLLGetScreenSizeImpl; \
\
MwLLSetDarkTheme = MwLLSetDarkThemeImpl; \
\
MwLLDoModern = MwLLDoModernImpl; \
return 0; \
}

View file

@ -340,6 +340,11 @@ static void MwLLSetDarkThemeImpl(MwLL handle, int toggle) {
(void)toggle;
}
static MwBool MwLLDoModernImpl(MwLL handle) {
(void)handle;
return MwFALSE;
}
static int MwLLClassicMacOSCallInitImpl(void) {
InitGraf(&qd.thePort);
InitFonts();

View file

@ -1156,6 +1156,11 @@ static void MwLLSetDarkThemeImpl(MwLL handle, int toggle) {
(void)toggle;
}
static MwBool MwLLDoModernImpl(MwLL handle) {
(void)handle;
return MwTRUE;
}
static int MwLLCocoaCallInitImpl(void) {
#ifndef __APPLE__
printf("Using GNUStep Backend\n");

View file

@ -839,6 +839,11 @@ static void MwLLSetDarkThemeImpl(MwLL handle, int toggle) {
DwmSetWindowAttribute(handle->gdi.hWnd, 20, &v, sizeof(v));
}
static MwBool MwLLDoModernImpl(MwLL handle) {
(void)handle;
return MwTRUE;
}
static int MwLLGDICallInitImpl(void) {
memset(&wsymtbl, 0, sizeof(wsymtbl));

View file

@ -2851,5 +2851,10 @@ static int MwLLWaylandCallInitImpl(void) {
return 1;
}
static MwBool MwLLDoModernImpl(MwLL handle) {
(void)handle;
return MwTRUE;
}
#include "call.c"
CALL(Wayland);

View file

@ -1449,5 +1449,10 @@ static int MwLLX11CallInitImpl(void) {
return 0;
}
static MwBool MwLLDoModernImpl(MwLL handle) {
(void)handle;
return MwTRUE;
}
#include "call.c"
CALL(X11);

View file

@ -674,7 +674,7 @@ int MwGetInteger(MwWidget handle, const char* key) {
#ifdef USE_CLASSIC_THEME
if(strcmp(key, MwNmodernLook) == 0) return inherit_integer(handle, key, 0);
#else
if(strcmp(key, MwNmodernLook) == 0) return inherit_integer(handle, key, 1);
if(strcmp(key, MwNmodernLook) == 0) return inherit_integer(handle, key, MwLLDoModern(handle->lowlevel));
#endif
if(strcmp(key, MwNdarkTheme) == 0) return inherit_integer(handle, key, 0);
if(strcmp(key, MwNuseMonospace) == 0) return inherit_integer(handle, key, 0);

View file

@ -53,6 +53,8 @@ void (*MwLLGetScreenSize)(MwLL handle, MwRect* rect) = NULL;
void (*MwLLSetDarkTheme)(MwLL handle, int toggle) = NULL;
MwBool (*MwLLDoModern)(MwLL handle) = NULL;
void MwLLCreateCommon(MwLL handle) {
handle->common.handler = malloc(sizeof(*handle->common.handler));
memset(handle->common.handler, 0, sizeof(*handle->common.handler));

View file

@ -20,4 +20,3 @@ cd ../..
rm -f milsko-examples.zip
cp resource/logo/logo.png examples/picture.jpg examples/picture.png milsko-examples/
zip -rv milsko-examples.zip milsko-examples
rm -rf milsko-examples