fix things
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good

This commit is contained in:
Nishi 2026-03-29 09:42:34 +09:00
commit e312b325c8
Signed by: nishi
GPG key ID: 27EF69B208EB9343
7 changed files with 34 additions and 26 deletions

View file

@ -32,7 +32,7 @@ endif()
file( file(
GLOB GLOB
SOURCES SOURCES
src/*.c src/cursor/*.c src/icon/*.c src/widget/*.c src/text/*.c src/text/font/*.c src/dialog/*.c src/abstract/*.c external/*.c external/libz/src/*.c src/*.c src/cursor/*.c src/icon/*.c src/widget/*.c src/text/*.c src/text/font/*.c src/dialog/*.c src/abstract/*.c external/*.c
) )
list(REMOVE_ITEM SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/widget/opengl.c") list(REMOVE_ITEM SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/widget/opengl.c")
@ -103,7 +103,7 @@ else()
file( file(
GLOB GLOB
IMAGE_SOURCES IMAGE_SOURCES
external/libz/src/*.c external/libjpeg/src/*.c external/libpng/src/*.c external/libjpeg/src/*.c external/libpng/src/*.c
) )
target_sources( target_sources(
Mw Mw
@ -113,7 +113,7 @@ else()
target_include_directories( target_include_directories(
Mw Mw
PRIVATE PRIVATE
external/libz/include external/libjpeg/include external/libpng/include external/libjpeg/include external/libpng/include
) )
endif() endif()
@ -239,6 +239,12 @@ if(APPLE AND MW_BUILD_OPENGL)
) )
endif() endif()
target_include_directories(
Mw
PRIVATE
external/libz/include
)
target_include_directories( target_include_directories(
Mw Mw
PUBLIC PUBLIC

View file

@ -9,7 +9,7 @@
MwWidget window, menu, box; MwWidget window, menu, box;
MwWidget boxes[32]; MwWidget boxes[32];
int n = 0, row = -1; int n = 0, row = -1;
MwMenu e; MwMenu e;
static void resize(MwWidget handle, void* user, void* call) { static void resize(MwWidget handle, void* user, void* call) {
int w = MwGetInteger(window, MwNwidth); int w = MwGetInteger(window, MwNwidth);
@ -140,7 +140,7 @@ static MwWidget child(MwWidget w) {
return MwGetVoid(w, "VhandledWidget"); return MwGetVoid(w, "VhandledWidget");
} }
static void menu_handler(MwWidget handle, void* user, void* call){ static void menu_handler(MwWidget handle, void* user, void* call) {
if(call == e) MwDestroyWidget(window); if(call == e) MwDestroyWidget(window);
} }
@ -149,8 +149,8 @@ int main() {
MwWidget f, w; MwWidget f, w;
MwListBoxPacket* pkt; MwListBoxPacket* pkt;
int index; int index;
MwMenu m, m2; MwMenu m, m2;
void* v; void* v;
MwLibraryInit(); MwLibraryInit();
@ -187,7 +187,7 @@ int main() {
MwMenuAdd(menu, m, "Month"); MwMenuAdd(menu, m, "Month");
MwMenuAdd(menu, m, "Year"); MwMenuAdd(menu, m, "Year");
m = MwMenuAdd(menu, NULL, "Options"); m = MwMenuAdd(menu, NULL, "Options");
m2 = MwMenuAdd(menu, m, "Font"); m2 = MwMenuAdd(menu, m, "Font");
MwMenuAdd(menu, m2, "Small"); MwMenuAdd(menu, m2, "Small");
MwMenuAdd(menu, m2, "Medium"); MwMenuAdd(menu, m2, "Medium");
@ -255,13 +255,13 @@ int main() {
add(f); add(f);
f = frame("ProgressBar", -PaddingContent, 24, MwProgressBarClass, f = frame("ProgressBar", -PaddingContent, 24, MwProgressBarClass,
MwNvalue, 25, MwNvalue, 25,
NULL); NULL);
add(f); add(f);
f = frame("ScrollBar", -PaddingContent, 16, MwScrollBarClass, f = frame("ScrollBar", -PaddingContent, 16, MwScrollBarClass,
MwNorientation, MwHORIZONTAL, MwNorientation, MwHORIZONTAL,
NULL); NULL);
add(f); add(f);
f = frame("Separator", -PaddingContent, -PaddingContent, MwSeparatorClass, NULL); f = frame("Separator", -PaddingContent, -PaddingContent, MwSeparatorClass, NULL);

View file

@ -27,7 +27,7 @@ typedef struct _MwListBoxEntry MwListBoxEntry;
typedef struct _MwTreeViewEntry MwTreeViewEntry; typedef struct _MwTreeViewEntry MwTreeViewEntry;
typedef struct _MwDirectoryEntry MwDirectoryEntry; typedef struct _MwDirectoryEntry MwDirectoryEntry;
typedef struct _MwListBoxPacket MwListBoxPacket; typedef struct _MwListBoxPacket MwListBoxPacket;
typedef struct _MwBox* MwBox; typedef struct _MwBox* MwBox;
#ifdef _MILSKO #ifdef _MILSKO
typedef struct _MwWidget* MwWidget; typedef struct _MwWidget* MwWidget;
#else #else

View file

@ -43,7 +43,7 @@ if (grep(/^wayland$/, @backends)) {
scan_wayland_protocol("unstable", "xdg-decoration", "-unstable-v1"); scan_wayland_protocol("unstable", "xdg-decoration", "-unstable-v1");
scan_wayland_protocol("unstable", "primary-selection", "-unstable-v1"); scan_wayland_protocol("unstable", "primary-selection", "-unstable-v1");
scan_wayland_protocol("unstable", "pointer-constraints", "-unstable-v1"); scan_wayland_protocol("unstable", "pointer-constraints", "-unstable-v1");
scan_wayland_protocol("unstable", "relative-pointer", "-unstable-v1"); scan_wayland_protocol("unstable", "relative-pointer", "-unstable-v1");
$gl_libs = "-lGL -lGLU"; $gl_libs = "-lGL -lGLU";
} }
@ -64,7 +64,8 @@ if (grep(/^cocoa$/, @backends)) {
if (param_get("stb-image")) { if (param_get("stb-image")) {
add_cflags("-DUSE_STB_IMAGE"); add_cflags("-DUSE_STB_IMAGE");
}else{ }
else {
new_object("external/libjpeg/src/*.c"); new_object("external/libjpeg/src/*.c");
new_object("external/libpng/src/*.c"); new_object("external/libpng/src/*.c");
add_incdir("-Iexternal/libjpeg/include -Iexternal/libpng/include"); add_incdir("-Iexternal/libjpeg/include -Iexternal/libpng/include");

View file

@ -117,7 +117,7 @@ void MwDrawRectFading(MwWidget handle, MwRect* rect, MwLLColor color, int rounde
MwRect r = *rect; MwRect r = *rect;
int roundness = MwGetInteger(handle, MwNroundness); int roundness = MwGetInteger(handle, MwNroundness);
double div; double div;
if(rect->width <= 0 || rect->height <= 0){ if(rect->width <= 0 || rect->height <= 0) {
free(data); free(data);
return; return;
} }

View file

@ -21,7 +21,7 @@ static int create(MwWidget handle) {
return 0; return 0;
} }
static void destroy(MwWidget handle){ static void destroy(MwWidget handle) {
MwBox b = handle->internal; MwBox b = handle->internal;
free(b); free(b);
} }
@ -78,7 +78,7 @@ static void layout(MwWidget handle) {
static void draw(MwWidget handle) { static void draw(MwWidget handle) {
MwRect r; MwRect r;
MwLLColor base = MwParseColor(handle, MwGetText(handle, MwNbackground)); MwLLColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
MwBox b = handle->internal; MwBox b = handle->internal;
r.x = 0; r.x = 0;
r.y = 0; r.y = 0;
@ -93,7 +93,7 @@ static void draw(MwWidget handle) {
MwLLFreeColor(base); MwLLFreeColor(base);
if(b->layout){ if(b->layout) {
layout(handle); layout(handle);
b->layout = 0; b->layout = 0;
@ -101,8 +101,8 @@ static void draw(MwWidget handle) {
} }
static void prop_change(MwWidget handle, const char* key) { static void prop_change(MwWidget handle, const char* key) {
if(strcmp(key, MwNorientation) == 0){ if(strcmp(key, MwNorientation) == 0) {
MwBox b = handle->internal; MwBox b = handle->internal;
b->layout = 1; b->layout = 1;
MwForceRender(handle); MwForceRender(handle);
@ -112,8 +112,8 @@ static void prop_change(MwWidget handle, const char* key) {
static void children_prop_change(MwWidget handle, MwWidget child, const char* key) { static void children_prop_change(MwWidget handle, MwWidget child, const char* key) {
(void)child; (void)child;
if(strcmp(key, MwNratio) == 0 || strcmp(key, MwNfixedSize) == 0){ if(strcmp(key, MwNratio) == 0 || strcmp(key, MwNfixedSize) == 0) {
MwBox b = handle->internal; MwBox b = handle->internal;
b->layout = 1; b->layout = 1;
MwForceRender(handle); MwForceRender(handle);
@ -121,14 +121,14 @@ static void children_prop_change(MwWidget handle, MwWidget child, const char* ke
} }
static void resize(MwWidget handle) { static void resize(MwWidget handle) {
MwBox b = handle->internal; MwBox b = handle->internal;
b->layout = 1; b->layout = 1;
MwForceRender(handle); MwForceRender(handle);
} }
static void children_update(MwWidget handle) { static void children_update(MwWidget handle) {
MwBox b = handle->internal; MwBox b = handle->internal;
b->layout = 1; b->layout = 1;
MwForceRender(handle); MwForceRender(handle);

View file

@ -93,7 +93,7 @@ sub generate {
print(OUT "LD = $link\n"); print(OUT "LD = $link\n");
print(OUT "\n"); print(OUT "\n");
print(OUT print(OUT
"CFLAGS = ${inc}include ${def}_MILSKO ${def}USE_GDI ${def}USE_STB_TRUETYPE ${def}USE_STB_IMAGE ${def}STBI_NO_SIMD\n" "CFLAGS = ${inc}include ${inc}external${dir}libz${dir}include ${def}_MILSKO ${def}USE_GDI ${def}USE_STB_TRUETYPE ${def}USE_STB_IMAGE ${def}STBI_NO_SIMD\n"
); );
print(OUT "LDFLAGS = $dll"); print(OUT "LDFLAGS = $dll");
print(OUT "\n"); print(OUT "\n");
@ -143,6 +143,7 @@ sub generate {
scan("src"); scan("src");
scan("external"); scan("external");
scan("external/libz/src");
scan("src/icon"); scan("src/icon");
scan("src/cursor"); scan("src/cursor");
scan("src/widget"); scan("src/widget");