21 |
*/ |
*/ |
22 |
|
|
23 |
#include "arshell.h" |
#include "arshell.h" |
|
#ifdef HAVE_YACLIB |
|
24 |
#include "../../yaclib/yaclib.h" |
#include "../../yaclib/yaclib.h" |
25 |
|
|
26 |
void |
void |
27 |
arshell_interface_system_cb(Widget widget, XtPointer client_data, |
arshell_interface_system_cb (Widget widget, XtPointer client_data, |
28 |
XtPointer call_data) |
XtPointer call_data) |
29 |
{ |
{ |
30 |
char *name; |
char *name; |
31 |
call_data=NULL; |
call_data = NULL; |
32 |
client_data=NULL; |
client_data = NULL; |
33 |
ARCLARG; |
ARCLARG; |
34 |
antiright_set(XtNname, (XtArgVal)&name); |
antiright_set (XtNname, (XtArgVal) & name); |
35 |
antiright_get_values(widget); |
antiright_get_values (widget); |
36 |
antiright_system(name); |
antiright_system (name); |
37 |
XtFree(name); |
XtFree (name); |
38 |
|
|
39 |
} |
} |
40 |
|
|
41 |
int |
int |
42 |
arshell_interface_button_cb(yacl_list *call_data) |
arshell_interface_button_cb (yacl_list * call_data) |
43 |
{ |
{ |
44 |
Widget button; |
Widget button; |
45 |
arshell_row_layout(); |
arshell_row_layout (); |
46 |
button=antiright_button(arshell.gui.layout.row_widget, call_data->data, |
button = antiright_button (arshell.gui.layout.row_widget, call_data->data, |
47 |
arshell_interface_system_cb, call_data->data); |
arshell_interface_system_cb, call_data->data); |
48 |
antiright_set_tooltip(button, call_data->data); |
antiright_set_tooltip (button, call_data->data); |
49 |
arshell_beautify_label(button, call_data->data); |
arshell_beautify_label (button, call_data->data); |
50 |
return(0); |
return (0); |
51 |
} |
} |
52 |
|
|
53 |
int |
int |
54 |
arshell_interface_obutton_cb(yacl_list *call_data) |
arshell_interface_obutton_cb (yacl_list * call_data) |
55 |
{ |
{ |
56 |
Widget button; |
Widget button; |
57 |
char *command; |
char *command; |
58 |
arshell_row_layout(); |
arshell_row_layout (); |
59 |
asprintf(&command, "%s %s", |
asprintf (&command, "%s %s", |
60 |
(char*)call_data->data, (char*)call_data->next->data); |
(char *) call_data->data, (char *) call_data->next->data); |
61 |
button=antiright_button(arshell.gui.layout.row_widget, command, |
button = antiright_button (arshell.gui.layout.row_widget, command, |
62 |
arshell_interface_system_cb, command); |
arshell_interface_system_cb, command); |
63 |
antiright_set_tooltip(button, command); |
antiright_set_tooltip (button, command); |
64 |
arshell_beautify_label(button, command); |
arshell_beautify_label (button, command); |
65 |
free(command); |
free (command); |
66 |
return(0); |
return (0); |
67 |
} |
} |
68 |
|
|
69 |
int |
int |
70 |
arshell_interface_status_cb(yacl_list *call_data) |
arshell_interface_status_cb (yacl_list * call_data) |
71 |
{ |
{ |
72 |
call_data=NULL; |
call_data = NULL; |
73 |
puts("status"); |
puts ("status"); |
74 |
antiright_create_status_bar(arshell.gui.widgets.mainwindow); |
antiright_create_status_bar (arshell.gui.widgets.mainwindow); |
75 |
return(0); |
return (0); |
76 |
} |
} |
77 |
|
|
78 |
int |
int |
79 |
arshell_interface_menubar_cb(yacl_list *call_data) |
arshell_interface_menubar_cb (yacl_list * call_data) |
80 |
{ |
{ |
81 |
call_data=NULL; |
call_data = NULL; |
82 |
arshell_default_menubar_action(); |
arshell_default_menubar_action (); |
83 |
return(0); |
return (0); |
84 |
} |
} |
85 |
|
|
86 |
int |
int |
87 |
arshell_interface_label_cb(yacl_list *call_data) |
arshell_interface_label_cb (yacl_list * call_data) |
88 |
{ |
{ |
89 |
antiright_label(arshell.gui.widgets.row, call_data->data); |
antiright_label (arshell.gui.widgets.row, call_data->data); |
90 |
return(0); |
return (0); |
91 |
} |
} |
92 |
|
|
93 |
int |
int |
94 |
arshell_interface_field_cb(yacl_list *call_data) |
arshell_interface_field_cb (yacl_list * call_data) |
95 |
{ |
{ |
96 |
int counter_int=0; |
int counter_int = 0; |
97 |
char **argv=NULL; |
char **argv = NULL; |
98 |
argv[0]=call_data->data; |
argv[0] = call_data->data; |
99 |
arshell_create_default_text_entry(arshell.gui.widgets.row, |
arshell_create_default_text_entry (arshell.gui.widgets.row, |
100 |
&counter_int, argv); |
&counter_int, argv); |
101 |
return(0); |
return (0); |
102 |
} |
} |
103 |
|
|
104 |
int |
int |
105 |
arshell_interface_icon_cb(yacl_list *call_data) |
arshell_interface_icon_cb (yacl_list * call_data) |
106 |
{ |
{ |
107 |
Widget button; |
Widget button; |
108 |
arshell_transparency_hack(); |
arshell_transparency_hack (); |
109 |
arshell_row_layout(); |
arshell_row_layout (); |
110 |
button=antiright_button(arshell.gui.layout.row_widget, call_data->data, |
button = antiright_button (arshell.gui.layout.row_widget, call_data->data, |
111 |
arshell_interface_system_cb, call_data->data); |
arshell_interface_system_cb, call_data->data); |
112 |
antiright_set_bitmap_from_file(button, call_data->next->data); |
antiright_set_bitmap_from_file (button, call_data->next->data); |
113 |
return(0); |
return (0); |
114 |
} |
} |
115 |
|
|
116 |
int |
int |
117 |
arshell_interface_oicon_cb(yacl_list *call_data) |
arshell_interface_oicon_cb (yacl_list * call_data) |
118 |
{ |
{ |
119 |
Widget button; |
Widget button; |
120 |
char *command; |
char *command; |
121 |
asprintf(&command, "%s %s", |
asprintf (&command, "%s %s", |
122 |
(char*)call_data->data, (char*)call_data->next->data); |
(char *) call_data->data, (char *) call_data->next->data); |
123 |
arshell_transparency_hack(); |
arshell_transparency_hack (); |
124 |
arshell_row_layout(); |
arshell_row_layout (); |
125 |
button=antiright_button(arshell.gui.layout.row_widget, command, |
button = antiright_button (arshell.gui.layout.row_widget, command, |
126 |
arshell_interface_system_cb, command); |
arshell_interface_system_cb, command); |
127 |
free(command); |
free (command); |
128 |
antiright_set_bitmap_from_file(button, call_data->next->next->data); |
antiright_set_bitmap_from_file (button, call_data->next->next->data); |
129 |
return(0); |
return (0); |
130 |
} |
} |
131 |
|
|
132 |
int |
int |
133 |
arshell_interface_color_cb(yacl_list *call_data) |
arshell_interface_color_cb (yacl_list * call_data) |
134 |
{ |
{ |
135 |
call_data=NULL; |
call_data = NULL; |
136 |
arshell_color_widget(arshell.gui.widgets.row); |
arshell_color_widget (arshell.gui.widgets.row); |
137 |
return(0); |
return (0); |
138 |
} |
} |
139 |
|
|
140 |
int |
int |
141 |
arshell_interface_work_cb(yacl_list *call_data) |
arshell_interface_work_cb (yacl_list * call_data) |
142 |
{ |
{ |
143 |
call_data=NULL; |
call_data = NULL; |
144 |
arshell_create_text_work_area(); |
arshell_create_text_work_area (); |
145 |
return(0); |
return (0); |
146 |
} |
} |
147 |
|
|
148 |
void |
void |
149 |
arshell_parse_interface_file(char *filename) |
arshell_parse_interface_file (char *filename) |
150 |
{ |
{ |
151 |
/* char *a="one", *b="two", *c="three";*/ |
/* char *a="one", *b="two", *c="three"; */ |
152 |
yacl_list *grammar=(yacl_list *)xmalloc(sizeof(yacl_list)); |
yacl_list *grammar = (yacl_list *) xmalloc (sizeof (yacl_list)); |
153 |
struct yaclib_parse_rule rule; |
struct yaclib_parse_rule rule; |
154 |
L_INIT_PTR(grammar); |
L_INIT_PTR (grammar); |
155 |
|
|
156 |
rule.identifier="button"; |
rule.identifier = "button"; |
157 |
rule.parameters=1; |
rule.parameters = 1; |
158 |
rule.callback=&arshell_interface_button_cb; |
rule.callback = &arshell_interface_button_cb; |
159 |
yaclib_add_rule(grammar, &rule); |
yaclib_add_rule (grammar, &rule); |
160 |
|
|
161 |
/* This creates an optioned button. */ |
/* This creates an optioned button. */ |
162 |
rule.identifier="obutton"; |
rule.identifier = "obutton"; |
163 |
rule.parameters=2; |
rule.parameters = 2; |
164 |
rule.callback=&arshell_interface_button_cb; |
rule.callback = &arshell_interface_button_cb; |
165 |
yaclib_add_rule(grammar, &rule); |
yaclib_add_rule (grammar, &rule); |
166 |
|
|
167 |
rule.identifier="label"; |
rule.identifier = "label"; |
168 |
rule.parameters=1; |
rule.parameters = 1; |
169 |
rule.callback=&arshell_interface_label_cb; |
rule.callback = &arshell_interface_label_cb; |
170 |
yaclib_add_rule(grammar, &rule); |
yaclib_add_rule (grammar, &rule); |
171 |
|
|
172 |
rule.identifier="menubar"; |
rule.identifier = "menubar"; |
173 |
rule.parameters=0; |
rule.parameters = 0; |
174 |
rule.callback=&arshell_interface_menubar_cb; |
rule.callback = &arshell_interface_menubar_cb; |
175 |
yaclib_add_rule(grammar, &rule); |
yaclib_add_rule (grammar, &rule); |
176 |
|
|
177 |
rule.identifier="color_selector"; |
rule.identifier = "color_selector"; |
178 |
rule.parameters=0; |
rule.parameters = 0; |
179 |
rule.callback=&arshell_interface_color_cb; |
rule.callback = &arshell_interface_color_cb; |
180 |
yaclib_add_rule(grammar, &rule); |
yaclib_add_rule (grammar, &rule); |
181 |
|
|
182 |
rule.identifier="work"; |
rule.identifier = "work"; |
183 |
rule.parameters=0; |
rule.parameters = 0; |
184 |
rule.callback=&arshell_interface_work_cb; |
rule.callback = &arshell_interface_work_cb; |
185 |
yaclib_add_rule(grammar, &rule); |
yaclib_add_rule (grammar, &rule); |
186 |
|
|
187 |
rule.identifier="status"; |
rule.identifier = "status"; |
188 |
rule.parameters=0; |
rule.parameters = 0; |
189 |
rule.callback=&arshell_interface_status_cb; |
rule.callback = &arshell_interface_status_cb; |
190 |
yaclib_add_rule(grammar, &rule); |
yaclib_add_rule (grammar, &rule); |
191 |
|
|
192 |
rule.identifier="field"; |
rule.identifier = "field"; |
193 |
rule.parameters=1; |
rule.parameters = 1; |
194 |
rule.callback=&arshell_interface_field_cb; |
rule.callback = &arshell_interface_field_cb; |
195 |
yaclib_add_rule(grammar, &rule); |
yaclib_add_rule (grammar, &rule); |
196 |
|
|
197 |
rule.identifier="icon"; |
rule.identifier = "icon"; |
198 |
rule.parameters=2; |
rule.parameters = 2; |
199 |
rule.callback=&arshell_interface_icon_cb; |
rule.callback = &arshell_interface_icon_cb; |
200 |
yaclib_add_rule(grammar, &rule); |
yaclib_add_rule (grammar, &rule); |
201 |
|
|
202 |
/* This creates an optioned icon button. */ |
/* This creates an optioned icon button. */ |
203 |
rule.identifier="oicon"; |
rule.identifier = "oicon"; |
204 |
rule.parameters=3; |
rule.parameters = 3; |
205 |
rule.callback=&arshell_interface_oicon_cb; |
rule.callback = &arshell_interface_oicon_cb; |
206 |
yaclib_add_rule(grammar, &rule); |
yaclib_add_rule (grammar, &rule); |
207 |
|
|
208 |
yaclib_end_grammar(&grammar); |
yaclib_end_grammar (&grammar); |
209 |
yaclib_print_grammar(grammar); |
yaclib_print_grammar (grammar); |
210 |
yaclib_parse_file(filename, grammar); |
yaclib_parse_file (filename, grammar); |
211 |
l_free(&grammar); |
l_free (&grammar); |
212 |
} |
} |
213 |
#endif /* HAVE_YACLIB */ |
|