ui/common/args.c

Sat, 07 Jun 2025 08:25:00 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sat, 07 Jun 2025 08:25:00 +0200
changeset 609
1dbfc944a773
parent 601
9f67b662f694
child 610
7255f59f339a
permissions
-rw-r--r--

add wrapper functions for menuitem 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
609
1dbfc944a773 add wrapper functions for menuitem args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 601
diff changeset
36 /* ---------------------------- UiMenuItemArgs ---------------------------- */
1dbfc944a773 add wrapper functions for menuitem args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 601
diff changeset
37
1dbfc944a773 add wrapper functions for menuitem args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 601
diff changeset
38 UiMenuItemArgs* ui_menuitem_args_new(void) {
1dbfc944a773 add wrapper functions for menuitem args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 601
diff changeset
39 UiMenuItemArgs *args = malloc(sizeof(UiMenuItemArgs));
1dbfc944a773 add wrapper functions for menuitem args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 601
diff changeset
40 memset(args, 0, sizeof(UiMenuItemArgs));
1dbfc944a773 add wrapper functions for menuitem args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 601
diff changeset
41 return args;
1dbfc944a773 add wrapper functions for menuitem args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 601
diff changeset
42 }
1dbfc944a773 add wrapper functions for menuitem args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 601
diff changeset
43
1dbfc944a773 add wrapper functions for menuitem args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 601
diff changeset
44 void ui_menuitem_args_set_label(UiMenuItemArgs *args, const char *label) {
1dbfc944a773 add wrapper functions for menuitem args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 601
diff changeset
45 args->label = strdup(label);
1dbfc944a773 add wrapper functions for menuitem args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 601
diff changeset
46 }
1dbfc944a773 add wrapper functions for menuitem args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 601
diff changeset
47
1dbfc944a773 add wrapper functions for menuitem args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 601
diff changeset
48 void ui_menuitem_args_set_stockid(UiMenuItemArgs *args, const char *stockid) {
1dbfc944a773 add wrapper functions for menuitem args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 601
diff changeset
49 args->stockid = strdup(stockid);
1dbfc944a773 add wrapper functions for menuitem args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 601
diff changeset
50 }
1dbfc944a773 add wrapper functions for menuitem args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 601
diff changeset
51
1dbfc944a773 add wrapper functions for menuitem args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 601
diff changeset
52 void ui_menuitem_args_set_icon(UiMenuItemArgs *args, const char *icon) {
1dbfc944a773 add wrapper functions for menuitem args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 601
diff changeset
53 args->icon = strdup(icon);
1dbfc944a773 add wrapper functions for menuitem args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 601
diff changeset
54 }
1dbfc944a773 add wrapper functions for menuitem args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 601
diff changeset
55
1dbfc944a773 add wrapper functions for menuitem args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 601
diff changeset
56 void ui_menuitem_args_set_onclick(UiMenuItemArgs *args, ui_callback callback) {
1dbfc944a773 add wrapper functions for menuitem args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 601
diff changeset
57 args->onclick = callback;
1dbfc944a773 add wrapper functions for menuitem args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 601
diff changeset
58 }
1dbfc944a773 add wrapper functions for menuitem args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 601
diff changeset
59
1dbfc944a773 add wrapper functions for menuitem args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 601
diff changeset
60 void ui_menuitem_args_set_onclickdata(UiMenuItemArgs *args, void *onclickdata) {
1dbfc944a773 add wrapper functions for menuitem args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 601
diff changeset
61 args->onclickdata = onclickdata;
1dbfc944a773 add wrapper functions for menuitem args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 601
diff changeset
62 }
1dbfc944a773 add wrapper functions for menuitem args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 601
diff changeset
63
1dbfc944a773 add wrapper functions for menuitem args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 601
diff changeset
64 void ui_menuitem_args_free(UiMenuItemArgs *args) {
1dbfc944a773 add wrapper functions for menuitem args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 601
diff changeset
65 free((void*)args->label);
1dbfc944a773 add wrapper functions for menuitem args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 601
diff changeset
66 free((void*)args->stockid);
1dbfc944a773 add wrapper functions for menuitem args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 601
diff changeset
67 free((void*)args->icon);
1dbfc944a773 add wrapper functions for menuitem args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 601
diff changeset
68 free(args);
1dbfc944a773 add wrapper functions for menuitem args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 601
diff changeset
69 }
1dbfc944a773 add wrapper functions for menuitem args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 601
diff changeset
70
599
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
71 /* ---------------------------- UiContainerArgs ---------------------------- */
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
72
601
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
73 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
74 UiContainerArgs *args = malloc(sizeof(UiContainerArgs));
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
75 memset(args, 0, sizeof(UiContainerArgs));
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
76 return args;
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
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
79 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
80 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
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_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->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_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->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_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->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_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->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_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
104 args->override_defaults = value;
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_colspan(UiContainerArgs *args, int colspan) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
109 args->colspan = colspan;
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_rolspan(UiContainerArgs *args, int rowspan) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
114 args->rowspan = rowspan;
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_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
119 args->def_hexpand = 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_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
124 args->def_vexpand = 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_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
129 args->def_hfill = 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_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
134 args->def_vfill = value;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
135 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
136
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 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
139 args->name = strdup(name);
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
140 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
141
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
142
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
143 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
144 args->style_class = strdup(classname);
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
145 }
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 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
149 args->margin = value;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
150 }
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 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
154 args->spacing = value;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
155 }
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 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
159 args->columnspacing = value;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
160 }
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 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
164 args->rowspacing = value;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
165 }
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 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
169 free((void*)args->name);
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
170 free((void*)args->style_class);
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
171 free(args);
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
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
175 /* ------------------------------- UiFrameArgs ------------------------------*/
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
176
601
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
177 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
178 UiFrameArgs *args = malloc(sizeof(UiFrameArgs));
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
179 memset(args, 0, sizeof(UiContainerArgs));
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
180 return args;
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_fill(UiFrameArgs *args, UiBool fill) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
185 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
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_hexpand(UiFrameArgs *args, UiBool value) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
190 args->hexpand = value;
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_vexpand(UiFrameArgs *args, UiBool value) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
195 args->vexpand = value;
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_hfill(UiFrameArgs *args, UiBool value) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
200 args->hfill = 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_vfill(UiFrameArgs *args, UiBool value) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
205 args->vfill = 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_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
210 args->override_defaults = 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_colspan(UiFrameArgs *args, int colspan) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
215 args->colspan = colspan;
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_rolspan(UiFrameArgs *args, int rowspan) {
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
220 args->rowspan = rowspan;
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_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
225 args->name = strdup(name);
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_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
230 args->style_class = strdup(classname);
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
231 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
232
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
233
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
234 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
235 args->margin = value;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
236 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
237
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
238
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
239 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
240 args->spacing = value;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
241 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
242
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
243
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
244 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
245 args->columnspacing = value;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
246 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
247
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
248
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
249 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
250 args->rowspacing = value;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
251 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
252
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
253
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
254 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
255 args->isexpanded = value;
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
256 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
257
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
258
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
259 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
260 args->label = strdup(label);
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
261 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
262
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
263
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
264 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
265 free((void*)args->name);
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
266 free((void*)args->style_class);
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
267 free((void*)args->label);
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
268 free(args);
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
269 }
54012d674e07 add wrapper functions for container and frame arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
270
601
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
271
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
272 /* ---------------------------- UiButtonArgs -------------------------------*/
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 UiButtonArgs* ui_button_args_new(void) {
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
275 UiButtonArgs *args = malloc(sizeof(UiButtonArgs));
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
276 memset(args, 0, sizeof(UiContainerArgs));
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
277 return args;
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_fill(UiButtonArgs *args, UiBool fill) {
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
282 args->fill = fill ? UI_ON : UI_OFF;
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_hexpand(UiButtonArgs *args, UiBool value) {
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
287 args->hexpand = value;
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_vexpand(UiButtonArgs *args, UiBool value) {
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
292 args->vexpand = value;
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
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
296 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
297 args->hfill = value;
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
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
301 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
302 args->vfill = value;
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
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
306 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
307 args->override_defaults = value;
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
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
311 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
312 args->colspan = colspan;
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
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
315
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
316 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
317 args->rowspan = rowspan;
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
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
320
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
321 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
322 args->name = strdup(name);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
323 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
324
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 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
327 args->style_class = strdup(classname);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
328 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
329
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
330 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
331 args->label = strdup(label);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
332 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
333
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
334
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
335 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
336 args->stockid = strdup(stockid);
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
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 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
341 args->icon = strdup(icon);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
342 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
343
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
344
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
345 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
346 args->labeltype = labeltype;
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
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
349 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
350 args->onclick = callback;
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
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
354 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
355 args->onclickdata = onclickdata;
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_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
359 // TODO
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 void ui_button_args_free(UiButtonArgs *args) {
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
363 free((void*)args->name);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
364 free((void*)args->style_class);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
365 free((void*)args->label);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
366 free((void*)args->stockid);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
367 free((void*)args->icon);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
368 free((void*)args->groups);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
369 free(args);
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 /* ------------------------- UiToggleArgs ----------------------------*/
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
374
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 UiToggleArgs* ui_toggle_args_new(void) {
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
377 UiToggleArgs *args = malloc(sizeof(UiToggleArgs));
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
378 memset(args, 0, sizeof(UiContainerArgs));
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
379 return args;
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_fill(UiToggleArgs *args, UiBool fill) {
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
384 args->fill = fill ? UI_ON : UI_OFF;
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_hexpand(UiToggleArgs *args, UiBool value) {
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
389 args->hexpand = value;
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_vexpand(UiToggleArgs *args, UiBool value) {
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
394 args->vexpand = value;
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
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
398 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
399 args->hfill = value;
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
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
403 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
404 args->vfill = value;
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
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
408 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
409 args->override_defaults = value;
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
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
413 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
414 args->colspan = colspan;
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
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
417
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
418 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
419 args->rowspan = rowspan;
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
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
422
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
423 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
424 args->name = strdup(name);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
425 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
426
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 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
429 args->style_class = strdup(classname);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
430 }
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 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
433 args->label = strdup(label);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
434 }
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_stockid(UiToggleArgs *args, const char *stockid){
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
438 args->stockid = strdup(stockid);
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
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
442 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
443 args->icon = strdup(icon);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
444 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
445
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
446
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
447 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
448 args->labeltype = labeltype;
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
449 }
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 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
452 args->onchange = callback;
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
453 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
454
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
455
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
456 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
457 args->onchangedata = onchangedata;
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
458 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
459
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
460 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
461 args->varname = strdup(varname);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
462 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
463
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
464 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
465 args->value = value;
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
466 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
467
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
468 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
469 args->enable_group = group;
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
470 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
471
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
472 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
473 // TODO
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
474 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
475
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
476 void ui_toggle_args_free(UiToggleArgs *args) {
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
477 free((void*)args->name);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
478 free((void*)args->style_class);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
479 free((void*)args->label);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
480 free((void*)args->stockid);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
481 free((void*)args->icon);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
482 free((void*)args->varname);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
483 free((void*)args->groups);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
484 free(args);
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
485 }
9f67b662f694 add wrapper for button/toggle args
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 599
diff changeset
486

mercurial