client/args.c

changeset 1024
d218b70e1499
parent 980
39cb60b6a81b
--- a/client/args.c	Wed Dec 24 08:48:50 2025 +0100
+++ b/client/args.c	Thu Dec 25 10:40:35 2025 +0100
@@ -60,80 +60,80 @@
     
     // boolean args
     val = cxJsonObjGet(value, "fill");
-    if(val && val->type == CX_JSON_LITERAL && val->value.literal == CX_JSON_TRUE) {
+    if(val && val->type == CX_JSON_LITERAL && val->literal == CX_JSON_TRUE) {
         funcs->fill(args, TRUE);
     }
     
     val = cxJsonObjGet(value, "hexpand");
-    if(val && val->type == CX_JSON_LITERAL && val->value.literal == CX_JSON_TRUE) {
+    if(val && val->type == CX_JSON_LITERAL && val->literal == CX_JSON_TRUE) {
         funcs->hexpand(args, TRUE);
     }
     
     val = cxJsonObjGet(value, "vexpand");
-    if(val && val->type == CX_JSON_LITERAL && val->value.literal == CX_JSON_TRUE) {
+    if(val && val->type == CX_JSON_LITERAL && val->literal == CX_JSON_TRUE) {
         funcs->vexpand(args, TRUE);
     }
     
     val = cxJsonObjGet(value, "hfill");
-    if(val && val->type == CX_JSON_LITERAL && val->value.literal == CX_JSON_TRUE) {
+    if(val && val->type == CX_JSON_LITERAL && val->literal == CX_JSON_TRUE) {
         funcs->hfill(args, TRUE);
     }
     
     val = cxJsonObjGet(value, "vfill");
-    if(val && val->type == CX_JSON_LITERAL && val->value.literal == CX_JSON_TRUE) {
+    if(val && val->type == CX_JSON_LITERAL && val->literal == CX_JSON_TRUE) {
         funcs->vfill(args, TRUE);
     }
     
     val = cxJsonObjGet(value, "override_defaults");
-    if(val && val->type == CX_JSON_LITERAL && val->value.literal == CX_JSON_TRUE) {
+    if(val && val->type == CX_JSON_LITERAL && val->literal == CX_JSON_TRUE) {
         funcs->override_defaults(args, TRUE);
     }
     
     // int args
     val = cxJsonObjGet(value, "margin");
     if(val && val->type == CX_JSON_INTEGER) {
-        funcs->margin(args, (int)val->value.integer);
+        funcs->margin(args, (int)val->integer);
     }
     
     val = cxJsonObjGet(value, "margin_left");
     if(val && val->type == CX_JSON_INTEGER) {
-        funcs->margin_left(args, (int)val->value.integer);
+        funcs->margin_left(args, (int)val->integer);
     }
     
     val = cxJsonObjGet(value, "margin_right");
     if(val && val->type == CX_JSON_INTEGER) {
-        funcs->margin_right(args, (int)val->value.integer);
+        funcs->margin_right(args, (int)val->integer);
     }
     
     val = cxJsonObjGet(value, "margin_top");
     if(val && val->type == CX_JSON_INTEGER) {
-        funcs->margin_top(args, (int)val->value.integer);
+        funcs->margin_top(args, (int)val->integer);
     }
     
     val = cxJsonObjGet(value, "margin_bottom");
     if(val && val->type == CX_JSON_INTEGER) {
-        funcs->margin_bottom(args, (int)val->value.integer);
+        funcs->margin_bottom(args, (int)val->integer);
     }
     
     val = cxJsonObjGet(value, "colspan");
     if(val && val->type == CX_JSON_INTEGER) {
-        funcs->colspan(args, (int)val->value.integer);
+        funcs->colspan(args, (int)val->integer);
     }
     
     val = cxJsonObjGet(value, "rowspan");
     if(val && val->type == CX_JSON_INTEGER) {
-        funcs->rowspan(args, (int)val->value.integer);
+        funcs->rowspan(args, (int)val->integer);
     }
     
     // string args
     val = cxJsonObjGet(value, "name");
     if(val && val->type == CX_JSON_STRING) {
-        funcs->name(args, val->value.string.ptr);
+        funcs->name(args, val->string.ptr);
     }
     
     val = cxJsonObjGet(value, "style_class");
     if(val && val->type == CX_JSON_STRING) {
-        funcs->name(args, val->value.string.ptr);
+        funcs->name(args, val->string.ptr);
     }
 }
 
@@ -143,12 +143,12 @@
         return;
     }
     
-    int len = (int)val->value.array.array_size;
+    int len = (int)val->array.size;
     int *states = calloc(len, sizeof(int));
     for(int i=0;i<len;i++) {
-        CxJsonValue *s = val->value.array.array[i];
+        CxJsonValue *s = val->array.data[i];
         if(s->type == CX_JSON_INTEGER) {
-            states[i] = (int)s->value.integer;
+            states[i] = (int)s->integer;
         }
     }
     
@@ -165,36 +165,36 @@
     
     CxJsonValue *val = cxJsonObjGet(value, "spacing");
     if(val && val->type == CX_JSON_INTEGER) {
-        args->spacing = (int)val->value.integer;
+        args->spacing = (int)val->integer;
     }
     
     val = cxJsonObjGet(value, "columnspacing");
     if(val && val->type == CX_JSON_INTEGER) {
-        args->columnspacing = (int)val->value.integer;
+        args->columnspacing = (int)val->integer;
     }
     
     val = cxJsonObjGet(value, "rowspacing");
     if(val && val->type == CX_JSON_INTEGER) {
-        args->rowspacing = (int)val->value.integer;
+        args->rowspacing = (int)val->integer;
     }
     
     val = cxJsonObjGet(value, "def_hfill");
-    if(val && val->type == CX_JSON_LITERAL && val->value.literal == CX_JSON_TRUE) {
+    if(val && val->type == CX_JSON_LITERAL && val->literal == CX_JSON_TRUE) {
         args->def_hfill = TRUE;
     }
     
     val = cxJsonObjGet(value, "def_vfill");
-    if(val && val->type == CX_JSON_LITERAL && val->value.literal == CX_JSON_TRUE) {
+    if(val && val->type == CX_JSON_LITERAL && val->literal == CX_JSON_TRUE) {
         args->def_vfill = TRUE;
     }
     
     val = cxJsonObjGet(value, "def_hexpand");
-    if(val && val->type == CX_JSON_LITERAL && val->value.literal == CX_JSON_TRUE) {
+    if(val && val->type == CX_JSON_LITERAL && val->literal == CX_JSON_TRUE) {
         args->def_hexpand = TRUE;
     }
     
     val = cxJsonObjGet(value, "def_vexpand");
-    if(val && val->type == CX_JSON_LITERAL && val->value.literal == CX_JSON_TRUE) {
+    if(val && val->type == CX_JSON_LITERAL && val->literal == CX_JSON_TRUE) {
         args->def_vexpand = TRUE;
     }
     
@@ -212,22 +212,22 @@
     
     CxJsonValue *val = cxJsonObjGet(value, "label");
     if(val && val->type == CX_JSON_STRING) {
-        ui_button_args_set_label(args, val->value.string.ptr);
+        ui_button_args_set_label(args, val->string.ptr);
     }
     
     val = cxJsonObjGet(value, "icon");
     if(val && val->type == CX_JSON_STRING) {
-        ui_button_args_set_icon(args, val->value.string.ptr);
+        ui_button_args_set_icon(args, val->string.ptr);
     }
     
     val = cxJsonObjGet(value, "tooltip");
     if(val && val->type == CX_JSON_STRING) {
-        ui_button_args_set_tooltip(args, val->value.string.ptr);
+        ui_button_args_set_tooltip(args, val->string.ptr);
     }
     
     val = cxJsonObjGet(value, "labeltype");
     if(val && val->type == CX_JSON_INTEGER) {
-        ui_button_args_set_labeltype(args, (int)val->value.integer);
+        ui_button_args_set_labeltype(args, (int)val->integer);
     }
     
     return args;
@@ -244,27 +244,27 @@
     
     CxJsonValue *val = cxJsonObjGet(value, "label");
     if(val && val->type == CX_JSON_STRING) {
-        ui_toggle_args_set_label(args, val->value.string.ptr);
+        ui_toggle_args_set_label(args, val->string.ptr);
     }
     
     val = cxJsonObjGet(value, "icon");
     if(val && val->type == CX_JSON_STRING) {
-        ui_toggle_args_set_icon(args, val->value.string.ptr);
+        ui_toggle_args_set_icon(args, val->string.ptr);
     }
     
     val = cxJsonObjGet(value, "tooltip");
     if(val && val->type == CX_JSON_STRING) {
-        ui_toggle_args_set_tooltip(args, val->value.string.ptr);
+        ui_toggle_args_set_tooltip(args, val->string.ptr);
     }
     
     val = cxJsonObjGet(value, "labeltype");
     if(val && val->type == CX_JSON_INTEGER) {
-        ui_toggle_args_set_labeltype(args, (int)val->value.integer);
+        ui_toggle_args_set_labeltype(args, (int)val->integer);
     }
     
     val = cxJsonObjGet(value, "enable_group");
     if(val && val->type == CX_JSON_INTEGER) {
-        ui_toggle_args_set_enablestate(args, (int)val->value.integer);
+        ui_toggle_args_set_enablestate(args, (int)val->integer);
     }
     
     return args;

mercurial