ui/common/args.c

Thu, 29 May 2025 14:55:32 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Thu, 29 May 2025 14:55:32 +0200
changeset 601
9f67b662f694
parent 599
54012d674e07
child 609
1dbfc944a773
permissions
-rw-r--r--

add wrapper for button/toggle args

599
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
1 /*
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
3 *
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
4 * Copyright 2025 Olaf Wintermann. All rights reserved.
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
5 *
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
6 * Redistribution and use in source and binary forms, with or without
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
7 * modification, are permitted provided that the following conditions are met:
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
8 *
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
9 * 1. Redistributions of source code must retain the above copyright
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
10 * notice, this list of conditions and the following disclaimer.
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
11 *
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
12 * 2. Redistributions in binary form must reproduce the above copyright
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
13 * notice, this list of conditions and the following disclaimer in the
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
14 * documentation and/or other materials provided with the distribution.
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
15 *
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
26 * POSSIBILITY OF SUCH DAMAGE.
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
27 */
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
28
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
29 #include "args.h"
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
30
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
31 #include <string.h>
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
32 #include <stdlib.h>
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
33
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
34 #include "../ui/container.h"
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
35
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
36 /* ---------------------------- UiContainerArgs ---------------------------- */
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
37
601
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
38 UiContainerArgs* ui_container_args_new(void) {
599
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
39 UiContainerArgs *args = malloc(sizeof(UiContainerArgs));
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
40 memset(args, 0, sizeof(UiContainerArgs));
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
41 return args;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
42 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
43
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
44 void ui_container_args_set_fill(UiContainerArgs *args, UiBool fill) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
45 args->fill = fill ? UI_ON : UI_OFF;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
46 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
47
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
48 void ui_container_args_set_hexpand(UiContainerArgs *args, UiBool value) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
49 args->hexpand = value;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
50 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
51
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
52
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
53 void ui_container_args_set_vexpand(UiContainerArgs *args, UiBool value) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
54 args->vexpand = value;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
55 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
56
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
57
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
58 void ui_container_args_set_hfill(UiContainerArgs *args, UiBool value) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
59 args->hfill = value;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
60 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
61
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
62
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
63 void ui_container_args_set_vfill(UiContainerArgs *args, UiBool value) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
64 args->vfill = value;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
65 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
66
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
67
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
68 void ui_container_args_set_override_defaults(UiContainerArgs *args, UiBool value) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
69 args->override_defaults = value;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
70 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
71
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
72
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
73 void ui_container_args_set_colspan(UiContainerArgs *args, int colspan) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
74 args->colspan = colspan;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
75 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
76
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
77
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
78 void ui_container_args_set_rolspan(UiContainerArgs *args, int rowspan) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
79 args->rowspan = rowspan;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
80 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
81
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
82
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
83 void ui_container_args_set_def_hexpand(UiContainerArgs *args, UiBool value) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
84 args->def_hexpand = value;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
85 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
86
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
87
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
88 void ui_container_args_set_def_vexpand(UiContainerArgs *args, UiBool value) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
89 args->def_vexpand = value;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
90 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
91
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
92
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
93 void ui_container_args_set_def_hfill(UiContainerArgs *args, UiBool value) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
94 args->def_hfill = value;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
95 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
96
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
97
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
98 void ui_container_args_set_def_vfill(UiContainerArgs *args, UiBool value) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
99 args->def_vfill = value;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
100 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
101
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
102
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
103 void ui_container_args_set_name(UiContainerArgs *args, const char *name) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
104 args->name = strdup(name);
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
105 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
106
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
107
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
108 void ui_container_args_set_style_class(UiContainerArgs *args, const char *classname) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
109 args->style_class = strdup(classname);
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
110 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
111
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
112
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
113 void ui_container_args_set_margin(UiContainerArgs *args, int value) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
114 args->margin = value;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
115 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
116
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
117
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
118 void ui_container_args_set_spacing(UiContainerArgs *args, int value) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
119 args->spacing = value;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
120 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
121
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
122
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
123 void ui_container_args_set_columnspacing(UiContainerArgs *args, int value) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
124 args->columnspacing = value;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
125 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
126
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
127
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
128 void ui_container_args_set_rowspacing(UiContainerArgs *args, int value) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
129 args->rowspacing = value;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
130 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
131
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
132
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
133 void ui_container_args_free(UiContainerArgs *args) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
134 free((void*)args->name);
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
135 free((void*)args->style_class);
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
136 free(args);
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
137 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
138
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
139
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
140 /* ------------------------------- UiFrameArgs ------------------------------*/
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
141
601
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
142 UiFrameArgs* ui_frame_args_new(void) {
599
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
143 UiFrameArgs *args = malloc(sizeof(UiFrameArgs));
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
144 memset(args, 0, sizeof(UiContainerArgs));
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
145 return args;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
146 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
147
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
148
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
149 void ui_frame_args_set_fill(UiFrameArgs *args, UiBool fill) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
150 args->fill = fill ? UI_ON : UI_OFF;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
151 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
152
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
153
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
154 void ui_frame_args_set_hexpand(UiFrameArgs *args, UiBool value) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
155 args->hexpand = value;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
156 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
157
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
158
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
159 void ui_frame_args_set_vexpand(UiFrameArgs *args, UiBool value) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
160 args->vexpand = value;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
161 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
162
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
163
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
164 void ui_frame_args_set_hfill(UiFrameArgs *args, UiBool value) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
165 args->hfill = value;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
166 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
167
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
168
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
169 void ui_frame_args_set_vfill(UiFrameArgs *args, UiBool value) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
170 args->vfill = value;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
171 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
172
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
173
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
174 void ui_frame_args_set_override_defaults(UiFrameArgs *args, UiBool value) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
175 args->override_defaults = value;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
176 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
177
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
178
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
179 void ui_frame_args_set_colspan(UiFrameArgs *args, int colspan) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
180 args->colspan = colspan;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
181 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
182
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
183
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
184 void ui_frame_args_set_rolspan(UiFrameArgs *args, int rowspan) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
185 args->rowspan = rowspan;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
186 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
187
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
188
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
189 void ui_frame_args_set_name(UiFrameArgs *args, const char *name) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
190 args->name = strdup(name);
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
191 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
192
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
193
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
194 void ui_frame_args_set_style_class(UiFrameArgs *args, const char *classname) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
195 args->style_class = strdup(classname);
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
196 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
197
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
198
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
199 void ui_frame_args_set_margin(UiFrameArgs *args, int value) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
200 args->margin = value;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
201 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
202
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
203
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
204 void ui_frame_args_set_spacing(UiFrameArgs *args, int value) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
205 args->spacing = value;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
206 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
207
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
208
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
209 void ui_frame_args_set_columnspacing(UiFrameArgs *args, int value) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
210 args->columnspacing = value;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
211 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
212
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
213
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
214 void ui_frame_args_set_rowspacing(UiFrameArgs *args, int value) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
215 args->rowspacing = value;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
216 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
217
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
218
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
219 void ui_frame_args_set_expanded(UiFrameArgs *args, UiBool value) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
220 args->isexpanded = value;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
221 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
222
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
223
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
224 void ui_frame_args_set_label(UiFrameArgs *args, const char *label) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
225 args->label = strdup(label);
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
226 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
227
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
228
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
229 void ui_frame_args_free(UiFrameArgs *args) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
230 free((void*)args->name);
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
231 free((void*)args->style_class);
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
232 free((void*)args->label);
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
233 free(args);
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
234 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
235
601
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
236
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
237 /* ---------------------------- UiButtonArgs -------------------------------*/
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
238
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
239 UiButtonArgs* ui_button_args_new(void) {
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
240 UiButtonArgs *args = malloc(sizeof(UiButtonArgs));
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
241 memset(args, 0, sizeof(UiContainerArgs));
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
242 return args;
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
243 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
244
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
245
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
246 void ui_button_args_set_fill(UiButtonArgs *args, UiBool fill) {
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
247 args->fill = fill ? UI_ON : UI_OFF;
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
248 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
249
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
250
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
251 void ui_button_args_set_hexpand(UiButtonArgs *args, UiBool value) {
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
252 args->hexpand = value;
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
253 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
254
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
255
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
256 void ui_button_args_set_vexpand(UiButtonArgs *args, UiBool value) {
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
257 args->vexpand = value;
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
258 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
259
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
260
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
261 void ui_button_args_set_hfill(UiButtonArgs *args, UiBool value) {
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
262 args->hfill = value;
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
263 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
264
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
265
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
266 void ui_button_args_set_vfill(UiButtonArgs *args, UiBool value) {
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
267 args->vfill = value;
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
268 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
269
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
270
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
271 void ui_button_args_set_override_defaults(UiButtonArgs *args, UiBool value) {
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
272 args->override_defaults = value;
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
273 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
274
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
275
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
276 void ui_button_args_set_colspan(UiButtonArgs *args, int colspan) {
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
277 args->colspan = colspan;
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
278 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
279
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
280
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
281 void ui_button_args_set_rolspan(UiButtonArgs *args, int rowspan) {
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
282 args->rowspan = rowspan;
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
283 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
284
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
285
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
286 void ui_button_args_set_name(UiButtonArgs *args, const char *name) {
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
287 args->name = strdup(name);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
288 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
289
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
290
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
291 void ui_button_args_set_style_class(UiButtonArgs *args, const char *classname) {
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
292 args->style_class = strdup(classname);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
293 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
294
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
295 void ui_button_args_set_label(UiButtonArgs *args, const char *label){
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
296 args->label = strdup(label);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
297 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
298
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
299
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
300 void ui_button_args_set_stockid(UiButtonArgs *args, const char *stockid){
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
301 args->stockid = strdup(stockid);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
302 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
303
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
304
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
305 void ui_button_args_set_icon(UiButtonArgs *args, const char *icon){
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
306 args->icon = strdup(icon);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
307 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
308
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
309
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
310 void ui_button_args_set_labeltype(UiButtonArgs *args, int labeltype){
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
311 args->labeltype = labeltype;
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
312 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
313
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
314 void ui_button_args_set_onclick(UiButtonArgs *args, ui_callback callback){
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
315 args->onclick = callback;
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
316 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
317
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
318
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
319 void ui_button_args_set_onclickdata(UiButtonArgs *args, void *onclickdata){
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
320 args->onclickdata = onclickdata;
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
321 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
322
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
323 void ui_button_args_set_groups(UiButtonArgs *args, int *groups){
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
324 // TODO
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
325 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
326
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
327 void ui_button_args_free(UiButtonArgs *args) {
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
328 free((void*)args->name);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
329 free((void*)args->style_class);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
330 free((void*)args->label);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
331 free((void*)args->stockid);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
332 free((void*)args->icon);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
333 free((void*)args->groups);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
334 free(args);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
335 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
336
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
337
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
338 /* ------------------------- UiToggleArgs ----------------------------*/
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
339
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
340
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
341 UiToggleArgs* ui_toggle_args_new(void) {
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
342 UiToggleArgs *args = malloc(sizeof(UiToggleArgs));
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
343 memset(args, 0, sizeof(UiContainerArgs));
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
344 return args;
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
345 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
346
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
347
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
348 void ui_toggle_args_set_fill(UiToggleArgs *args, UiBool fill) {
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
349 args->fill = fill ? UI_ON : UI_OFF;
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
350 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
351
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
352
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
353 void ui_toggle_args_set_hexpand(UiToggleArgs *args, UiBool value) {
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
354 args->hexpand = value;
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
355 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
356
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
357
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
358 void ui_toggle_args_set_vexpand(UiToggleArgs *args, UiBool value) {
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
359 args->vexpand = value;
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
360 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
361
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
362
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
363 void ui_toggle_args_set_hfill(UiToggleArgs *args, UiBool value) {
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
364 args->hfill = value;
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
365 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
366
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
367
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
368 void ui_toggle_args_set_vfill(UiToggleArgs *args, UiBool value) {
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
369 args->vfill = value;
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
370 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
371
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
372
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
373 void ui_toggle_args_set_override_defaults(UiToggleArgs *args, UiBool value) {
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
374 args->override_defaults = value;
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
375 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
376
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
377
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
378 void ui_toggle_args_set_colspan(UiToggleArgs *args, int colspan) {
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
379 args->colspan = colspan;
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
380 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
381
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
382
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
383 void ui_toggle_args_set_rolspan(UiToggleArgs *args, int rowspan) {
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
384 args->rowspan = rowspan;
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
385 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
386
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
387
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
388 void ui_toggle_args_set_name(UiToggleArgs *args, const char *name) {
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
389 args->name = strdup(name);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
390 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
391
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
392
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
393 void ui_toggle_args_set_style_class(UiToggleArgs *args, const char *classname) {
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
394 args->style_class = strdup(classname);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
395 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
396
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
397 void ui_toggle_args_set_label(UiToggleArgs *args, const char *label){
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
398 args->label = strdup(label);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
399 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
400
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
401
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
402 void ui_toggle_args_set_stockid(UiToggleArgs *args, const char *stockid){
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
403 args->stockid = strdup(stockid);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
404 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
405
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
406
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
407 void ui_toggle_args_set_icon(UiToggleArgs *args, const char *icon){
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
408 args->icon = strdup(icon);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
409 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
410
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
411
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
412 void ui_toggle_args_set_labeltype(UiToggleArgs *args, int labeltype){
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
413 args->labeltype = labeltype;
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
414 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
415
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
416 void ui_toggle_args_set_onchange(UiToggleArgs *args, ui_callback callback){
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
417 args->onchange = callback;
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
418 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
419
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
420
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
421 void ui_toggle_args_set_onchangedata(UiToggleArgs *args, void *onchangedata){
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
422 args->onchangedata = onchangedata;
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
423 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
424
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
425 void ui_toggle_args_set_varname(UiToggleArgs *args, const char *varname) {
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
426 args->varname = strdup(varname);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
427 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
428
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
429 void ui_toggle_args_set_value(UiToggleArgs *args, UiInteger *value) {
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
430 args->value = value;
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
431 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
432
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
433 void ui_toggle_args_set_enablegroup(UiToggleArgs *args, int group) {
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
434 args->enable_group = group;
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
435 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
436
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
437 void ui_toggle_args_set_groups(UiToggleArgs *args, int *groups){
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
438 // TODO
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
439 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
440
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
441 void ui_toggle_args_free(UiToggleArgs *args) {
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
442 free((void*)args->name);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
443 free((void*)args->style_class);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
444 free((void*)args->label);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
445 free((void*)args->stockid);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
446 free((void*)args->icon);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
447 free((void*)args->varname);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
448 free((void*)args->groups);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
449 free(args);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
450 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
451

mercurial