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

This commit is contained in:
Nishi 2026-04-17 21:26:41 +09:00
commit 7b9870cebc
Signed by: nishi
GPG key ID: 27EF69B208EB9343
11 changed files with 66 additions and 25 deletions

View file

@ -5,7 +5,7 @@ AlignConsecutiveAssignments:
Enabled: true Enabled: true
AlignConsecutiveDeclarations: AlignConsecutiveDeclarations:
Enabled: true Enabled: true
IndentAccessModifiers: true AccessModifierOffset: -4
NamespaceIndentation: All NamespaceIndentation: All
IndentWidth: 8 IndentWidth: 8
PointerAlignment: Left PointerAlignment: Left

View file

@ -231,6 +231,7 @@ int main() {
add(f); add(f);
f = frame("Entry", -PaddingContent, 24, MwEntryClass, NULL); f = frame("Entry", -PaddingContent, 24, MwEntryClass, NULL);
MwAddUserHandler(child(f), MwNchangedHandler, abort, NULL);
add(f); add(f);
f = frame("Label", -PaddingContent, -PaddingContent, MwLabelClass, f = frame("Label", -PaddingContent, -PaddingContent, MwLabelClass,

View file

@ -84,7 +84,7 @@ typedef struct {
@end @end
@interface MilskoCocoaPixmap : NSObject { @interface MilskoCocoaPixmap : NSObject {
@public @public
MwBool valid; MwBool valid;
int width; int width;
int height; int height;
@ -106,7 +106,7 @@ typedef struct {
@interface MilskoCocoaView : NSView { @interface MilskoCocoaView : NSView {
MwBool _child; MwBool _child;
@public @public
draw_command* commands; draw_command* commands;
} }
@ -119,7 +119,7 @@ typedef struct {
@end @end
@interface MilskoCocoa : NSObject { @interface MilskoCocoa : NSObject {
@public @public
MilskoCocoaApplication* application; MilskoCocoaApplication* application;
MwBool _forceRender; MwBool _forceRender;
MwBool _eventsPending; MwBool _eventsPending;

View file

@ -454,7 +454,7 @@ struct _MwLLWayland {
#endif #endif
MwBool dark_theme_detection; MwBool dark_theme_detection;
MwU32 dark_theme; MwU32 dark_theme;
/* clipboard related stuff. /* clipboard related stuff.
* Note that unlike most interfaces, we don't keep zwp_primary_selection stuff in a wayland_protocol_t because we use wl_data_device as a fallback and want to have it share memory space.*/ * Note that unlike most interfaces, we don't keep zwp_primary_selection stuff in a wayland_protocol_t because we use wl_data_device as a fallback and want to have it share memory space.*/

View file

@ -112,7 +112,8 @@
<pixmap name="backgroundPixmap" common="yes" /> <pixmap name="backgroundPixmap" common="yes" />
<pointer name="monospaceFont" /> <pointer name="monospaceFont" />
<pointer name="boldMonospaceFont" /> <pointer name="boldMonospaceFont" />
</properties>
<handlers>
<handler name="activate" /> <handler name="activate" />
<handler name="listBoxActivate"> <handler name="listBoxActivate">
<integer pointer="yes" /> <integer pointer="yes" />
@ -120,33 +121,33 @@
<handler name="treeViewActivate"> <handler name="treeViewActivate">
<pointer /> <pointer />
</handler> </handler>
<handler name="resize" /> <handler name="resize" common="yes" />
<handler name="tick" /> <handler name="tick" common="yes" />
<handler name="menu"> <handler name="menu">
<pointer /> <pointer />
</handler> </handler>
<handler name="mouseDown"> <handler name="mouseDown" common="yes">
<struct defname="MwMouse" pointer="yes" /> <struct defname="MwMouse" pointer="yes" />
</handler> </handler>
<handler name="mouseUp"> <handler name="mouseUp" common="yes">
<struct defname="MwMouse" pointer="yes" /> <struct defname="MwMouse" pointer="yes" />
</handler> </handler>
<handler name="mouseMove"> <handler name="mouseMove" common="yes">
<struct defname="MwPoint" pointer="yes" /> <struct defname="MwPoint" pointer="yes" />
</handler> </handler>
<handler name="changed" /> <handler name="changed" />
<handler name="comboBoxChanged"> <handler name="comboBoxChanged">
<integer pointer="yes" /> <integer pointer="yes" />
</handler> </handler>
<handler name="key"> <handler name="key" common="yes">
<integer pointer="yes" /> <integer pointer="yes" />
</handler> </handler>
<handler name="keyRelease"> <handler name="keyRelease" common="yes">
<integer pointer="yes" /> <integer pointer="yes" />
</handler> </handler>
<handler name="close" /> <handler name="close" />
<handler name="focusIn" /> <handler name="focusIn" common="yes" />
<handler name="focusOut" /> <handler name="focusOut" common="yes" />
<handler name="fileChosen"> <handler name="fileChosen">
<string /> <string />
</handler> </handler>
@ -157,13 +158,13 @@
<struct defname="MwRGB" pointer="yes" /> <struct defname="MwRGB" pointer="yes" />
</handler> </handler>
<handler name="draw" /> <handler name="draw" />
<handler name="clipboard"> <handler name="clipboard" common="yes">
<string /> <string />
</handler> </handler>
<handler name="darkTheme"> <handler name="darkTheme" common="yes">
<integer pointer="yes" /> <integer pointer="yes" />
</handler> </handler>
</properties> </handlers>
<enumerations> <enumerations>
<enumeration name="MwDIRECTION"> <enumeration name="MwDIRECTION">
<integer name="MwNORTH">0</integer> <integer name="MwNORTH">0</integer>
@ -598,17 +599,28 @@
<property name="padding" /> <property name="padding" />
<property name="fillArea" /> <property name="fillArea" />
</properties> </properties>
<handlers>
<handler name="activate" />
<handler name="changed" />
</handlers>
</widget> </widget>
<widget name="CheckBox"> <widget name="CheckBox">
<properties> <properties>
<property name="checked" /> <property name="checked" />
</properties> </properties>
<handlers>
<handler name="changed" />
</handlers>
</widget> </widget>
<widget name="Entry"> <widget name="Entry">
<properties> <properties>
<property name="text" /> <property name="text" />
<property name="hideInput" /> <property name="hideInput" />
</properties> </properties>
<handlers>
<handler name="activate" />
<handler name="changed" />
</handlers>
</widget> </widget>
<widget name="Frame"> <widget name="Frame">
<properties> <properties>
@ -648,6 +660,9 @@
<property name="hasHeading" /> <property name="hasHeading" />
<property name="singleClickSelectable" /> <property name="singleClickSelectable" />
</properties> </properties>
<handlers>
<handler name="listBoxActivate" />
</handlers>
<functions> <functions>
<function name="Insert"> <function name="Insert">
<arguments> <arguments>
@ -678,6 +693,9 @@
</functions> </functions>
</widget> </widget>
<widget name="Menu"> <widget name="Menu">
<handlers>
<handler name="menu" />
</handlers>
<functions> <functions>
<function name="Add"> <function name="Add">
<return> <return>
@ -694,6 +712,10 @@
<properties> <properties>
<property name="text" /> <property name="text" />
</properties> </properties>
<handlers>
<handler name="activate" />
<handler name="changed" />
</handlers>
</widget> </widget>
<widget name="ScrollBar"> <widget name="ScrollBar">
<properties> <properties>
@ -704,6 +726,9 @@
<property name="maxValue" /> <property name="maxValue" />
<property name="orientation" /> <property name="orientation" />
</properties> </properties>
<handlers>
<handler name="changed" />
</handlers>
<functions> <functions>
<function name="GetVisibleLength"> <function name="GetVisibleLength">
<return> <return>
@ -764,12 +789,18 @@
<properties> <properties>
<property name="checked" /> <property name="checked" />
</properties> </properties>
<handlers>
<handler name="changed" />
</handlers>
</widget> </widget>
<widget name="ComboBox"> <widget name="ComboBox">
<properties> <properties>
<property name="areaShown" /> <property name="areaShown" />
<property name="value" /> <property name="value" />
</properties> </properties>
<handlers>
<handler name="comboBoxChanged" />
</handlers>
<functions> <functions>
<function name="Add"> <function name="Add">
<integer name="index" /> <integer name="index" />
@ -782,6 +813,9 @@
<property name="leftPadding" /> <property name="leftPadding" />
<property name="singleClickSelectable" /> <property name="singleClickSelectable" />
</properties> </properties>
<handlers>
<handler name="treeViewActivate" />
</handlers>
<functions> <functions>
<function name="Add"> <function name="Add">
<arguments> <arguments>

View file

@ -788,7 +788,9 @@ static void MwLLNextEventImpl(MwLL handle) {
} else { } else {
n = s; n = s;
} }
} else if(strcmp(str, "BackSpace") == 0) { }
if(strcmp(str, "BackSpace") == 0) {
n = MwLLKeyBackSpace; n = MwLLKeyBackSpace;
} else if(strcmp(str, "Left") == 0) { } else if(strcmp(str, "Left") == 0) {
n = MwLLKeyLeft; n = MwLLKeyLeft;

View file

@ -128,7 +128,7 @@ MwBool MwLLDBusNewContext(MwLLDBusFuncTable* tbl, MwLLDBusContext* ctx) {
MWDECL MwBool MwLLDBusPortalGet(MwLLDBusFuncTable* tbl, MwLLDBusContext* ctx, const char* portal, const char* namespace, const char* key, void* out) { MWDECL MwBool MwLLDBusPortalGet(MwLLDBusFuncTable* tbl, MwLLDBusContext* ctx, const char* portal, const char* namespace, const char* key, void* out) {
DBusMessageIter dbus_args, dbus_variant, dbus_inner_variant; DBusMessageIter dbus_args, dbus_variant, dbus_inner_variant;
char arg_type; char arg_type;
if(!ctx->dbus_conn) { if(!ctx->dbus_conn) {
return MwFALSE; return MwFALSE;
} }
@ -182,7 +182,7 @@ MWDECL MwBool MwLLDBusPortalGet(MwLLDBusFuncTable* tbl, MwLLDBusContext* ctx, co
return MwFALSE; return MwFALSE;
} }
tbl->dbus_message_iter_get_basic(&dbus_inner_variant, out); tbl->dbus_message_iter_get_basic(&dbus_inner_variant, out);
} else if (arg_type == 'u') { } else if(arg_type == 'u') {
tbl->dbus_message_iter_get_basic(&dbus_variant, out); tbl->dbus_message_iter_get_basic(&dbus_variant, out);
} else { } else {
fprintf(stderr, "[WARNING] Couldn't get %s::%s: Expected variant or string, got: %c\n", namespace, key, arg_type); fprintf(stderr, "[WARNING] Couldn't get %s::%s: Expected variant or string, got: %c\n", namespace, key, arg_type);
@ -277,7 +277,7 @@ MWDECL MwBool MwLLDBusPortalPoll(MwLLDBusFuncTable* tbl, MwLLDBusContext* ctx, M
return MwFALSE; return MwFALSE;
} }
tbl->dbus_message_iter_get_basic(&msg_value_inner, &msg_value_content); tbl->dbus_message_iter_get_basic(&msg_value_inner, &msg_value_content);
} else if (arg_type == 'u') { } else if(arg_type == 'u') {
tbl->dbus_message_iter_get_basic(&msg_value, &msg_value_content); tbl->dbus_message_iter_get_basic(&msg_value, &msg_value_content);
} else { } else {
fprintf(stderr, "[WARNING] Couldn't get %s::%s: Expected variant or string, got: %c\n", namespace, key, arg_type); fprintf(stderr, "[WARNING] Couldn't get %s::%s: Expected variant or string, got: %c\n", namespace, key, arg_type);

View file

@ -133,7 +133,7 @@ static void click(MwWidget handle) {
MwListBoxInsert(cb->listbox, -1, packet); MwListBoxInsert(cb->listbox, -1, packet);
MwListBoxDestroyPacket(packet); MwListBoxDestroyPacket(packet);
MwAddUserHandler(cb->listbox, MwNactivateHandler, listbox_activate, NULL); MwAddUserHandler(cb->listbox, MwNlistBoxActivateHandler, listbox_activate, NULL);
p.x = 0; p.x = 0;
p.y = MwGetInteger(handle, MwNheight); p.y = MwGetInteger(handle, MwNheight);

View file

@ -102,6 +102,7 @@ static void key(MwWidget handle, int code) {
MwUTF8Copy(str, t->cursor + 1, out, t->cursor, MwUTF8Length(str) - (t->cursor + 1)); MwUTF8Copy(str, t->cursor + 1, out, t->cursor, MwUTF8Length(str) - (t->cursor + 1));
MwSetText(handle, MwNtext, out); MwSetText(handle, MwNtext, out);
MwDispatchUserHandler(handle, MwNchangedHandler, NULL);
free(out); free(out);
} else if(code == MwLLKeyLeft) { } else if(code == MwLLKeyLeft) {
@ -124,6 +125,7 @@ static void key(MwWidget handle, int code) {
t->cursor++; t->cursor++;
MwSetText(handle, MwNtext, out); MwSetText(handle, MwNtext, out);
MwDispatchUserHandler(handle, MwNchangedHandler, NULL);
free(out); free(out);
} }

View file

@ -108,6 +108,8 @@ static void mouse_up(MwWidget handle, void* ptr) {
MwStringPrintIntoBuffer(s, 512, "%g", atof(str) + 1); MwStringPrintIntoBuffer(s, 512, "%g", atof(str) + 1);
} }
MwSetText(handle, MwNtext, s); MwSetText(handle, MwNtext, s);
MwDispatchUserHandler(handle, MwNchangedHandler, NULL);
} }
MwForceRender(handle); MwForceRender(handle);

View file

@ -556,8 +556,8 @@ static void* mwVulkanGetFieldImpl(MwWidget handle, int field, int* err) {
static void func_handler(MwWidget handle, const char* name, void* output, va_list va) { static void func_handler(MwWidget handle, const char* name, void* output, va_list va) {
if(strcmp(name, "mwVulkanGetField") == 0) { if(strcmp(name, "mwVulkanGetField") == 0) {
int field = va_arg(va, int); int field = va_arg(va, int);
int* err = va_arg(va, int*); int* err = va_arg(va, int*);
*(void**)output = mwVulkanGetFieldImpl(handle, field, err); *(void**)output = mwVulkanGetFieldImpl(handle, field, err);
} }
} }