rewrite: update default dumb and smart prefixes
[elinks/elinks-j605.git] / src / bfu / checkbox.h
blobf18faeef56d94b51e47e3883a51db61bdc6f1370
1 #ifndef EL__BFU_CHECKBOX_H
2 #define EL__BFU_CHECKBOX_H
4 struct dialog;
5 struct dialog_data;
6 struct terminal;
7 struct widget_data;
9 struct widget_info_checkbox {
10 /* gid is 0 for checkboxes, or a positive int for
11 * each group of radio buttons. */
12 int gid;
13 /* gnum is 0 for checkboxes, or a positive int for
14 * each radio button in a group. */
15 int gnum;
18 struct widget_data_info_checkbox {
19 int checked;
23 void add_dlg_radio_do(struct dialog *dlg, unsigned char *text, int groupid, int groupnum, int *data);
25 #define add_dlg_radio(dlg, text, groupid, groupnum, data) \
26 add_dlg_radio_do(dlg, text, groupid, groupnum, data)
28 #define add_dlg_checkbox(dlg, text, data) \
29 add_dlg_radio_do(dlg, text, 0, 0, data)
31 extern const struct widget_ops checkbox_ops;
33 void
34 dlg_format_checkbox(struct dialog_data *dlg_data,
35 struct widget_data *widget_data,
36 int x, int *y, int w, int *rw,
37 enum format_align align, int format_only);
39 #define widget_has_group(widget_data) ((widget_data)->widget->type == WIDGET_CHECKBOX \
40 ? (widget_data)->widget->info.checkbox.gid : -1)
42 #endif