aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan D2010-07-08 12:29:51 +0200
committerJan D2010-07-08 12:29:51 +0200
commitc825c0b6473c1bd995dbef43cc07087609607cda (patch)
tree0f67889373ab35bd69e133046f61dfd7bc189343
parent0216627eb39f77958e30f4750f581714fdfd7faf (diff)
downloademacs-c825c0b6473c1bd995dbef43cc07087609607cda.tar.gz
emacs-c825c0b6473c1bd995dbef43cc07087609607cda.zip
Change function definition from K&R to prototype. Fix prototype warnings.
* lwlib-Xaw.c (xaw_generic_callback, command_reset) (xaw_update_one_value): Reformat. (xaw_update_one_widget): Reformat and remove dead code. (xaw_scrollbar_scroll, xaw_scrollbar_jump, xaw_create_scrollbar) (xaw_update_scrollbar): Remove (not used). (make_dialog): Change from K&R to prototype. Remove dead code. (xaw_creation_table): Remove scrollbar entry. * lwlib-Xlw.c (x_print_complete_resource_name): Change from K&R to prototype. (xlw_update_one_value): Reformat. * lwlib-Xm.c (x_print_complete_resource_name) (make_destroyed_instance, free_destroyed_instance, first_child) (lw_motif_widget_p, resource_motif_string, destroy_all_children) (xm_arm_callback, xm_update_label, xm_update_list) (xm_update_pushbutton, xm_update_cascadebutton) (xm_update_toggle, xm_update_radiobox, make_menu_in_widget) (update_one_menu_entry, xm_update_menu, xm_update_text) (xm_update_text_field, xm_update_one_widget) (xm_update_one_value, activate_button, dialog_key_cb) (make_dialog, mark_dead_instance_destroyed) (find_matching_instance, recenter_widget, recycle_instance) (xm_create_dialog, make_menubar, remove_grabs, make_popup_menu) (make_main, xm_destroy_instance, xm_popup_menu) (set_min_dialog_size, xm_pop_instance, do_call) (xm_internal_update_other_instances, xm_generic_callback) (xm_nosel_callback, xm_pull_down_callback, xm_pop_down_callback) (xm_set_keyboard_focus, xm_set_main_areas, xm_manage_resizing): Change from K&R to prototype. * lwlib-int.h (widget_creation_function): Fix prototype. * lwlib.c (allocate_widget_info, lw_register_widget): Change from K&R to prototype. (lw_internal_update_other_instances, merge_widget_value): Reformat. * xlwmenu.c (size_menu_item): Change from K&R to prototype. Change label_width and height to int. (draw_arrow, draw_shadow_rectangle, draw_shadow_rhombus) (draw_separator, display_menu, fit_to_screen, motion_event_is_in_menu) (map_event_to_widget_value): Reformat. (display_menu_item): Change from K&R to prototype.
-rw-r--r--lwlib/ChangeLog46
-rw-r--r--lwlib/lwlib-Xaw.c220
-rw-r--r--lwlib/lwlib-Xlw.c7
-rw-r--r--lwlib/lwlib-Xm.c280
-rw-r--r--lwlib/lwlib-int.h3
-rw-r--r--lwlib/lwlib.c45
-rw-r--r--lwlib/xlwmenu.c95
7 files changed, 277 insertions, 419 deletions
diff --git a/lwlib/ChangeLog b/lwlib/ChangeLog
index 67762e16041..97ed18691c8 100644
--- a/lwlib/ChangeLog
+++ b/lwlib/ChangeLog
@@ -1,3 +1,49 @@
12010-07-08 Jan Djärv <jan.h.d@swipnet.se>
2
3 * xlwmenu.c (size_menu_item): Change from K&R to prototype.
4 Change label_width and height to int.
5 (draw_arrow, draw_shadow_rectangle, draw_shadow_rhombus)
6 (draw_separator, display_menu, fit_to_screen, motion_event_is_in_menu)
7 (map_event_to_widget_value): Reformat.
8 (display_menu_item): Change from K&R to prototype.
9
10 * lwlib.c (allocate_widget_info, lw_register_widget): Change from K&R
11 to prototype.
12 (lw_internal_update_other_instances, merge_widget_value): Reformat.
13
14 * lwlib-int.h (widget_creation_function): Fix prototype.
15
16 * lwlib-Xm.c (x_print_complete_resource_name)
17 (make_destroyed_instance, free_destroyed_instance, first_child)
18 (lw_motif_widget_p, resource_motif_string, destroy_all_children)
19 (xm_arm_callback, xm_update_label, xm_update_list)
20 (xm_update_pushbutton, xm_update_cascadebutton)
21 (xm_update_toggle, xm_update_radiobox, make_menu_in_widget)
22 (update_one_menu_entry, xm_update_menu, xm_update_text)
23 (xm_update_text_field, xm_update_one_widget)
24 (xm_update_one_value, activate_button, dialog_key_cb)
25 (make_dialog, mark_dead_instance_destroyed)
26 (find_matching_instance, recenter_widget, recycle_instance)
27 (xm_create_dialog, make_menubar, remove_grabs, make_popup_menu)
28 (make_main, xm_destroy_instance, xm_popup_menu)
29 (set_min_dialog_size, xm_pop_instance, do_call)
30 (xm_internal_update_other_instances, xm_generic_callback)
31 (xm_nosel_callback, xm_pull_down_callback, xm_pop_down_callback)
32 (xm_set_keyboard_focus, xm_set_main_areas, xm_manage_resizing): Change
33 from K&R to prototype.
34
35 * lwlib-Xlw.c (x_print_complete_resource_name): Change from K&R to
36 prototype.
37 (xlw_update_one_value): Reformat.
38
39 * lwlib-Xaw.c (xaw_generic_callback, command_reset)
40 (xaw_update_one_value): Reformat.
41 (xaw_update_one_widget): Reformat and remove dead code.
42 (xaw_scrollbar_scroll, xaw_scrollbar_jump, xaw_create_scrollbar)
43 (xaw_update_scrollbar): Remove (not used).
44 (make_dialog): Change from K&R to prototype. Remove dead code.
45 (xaw_creation_table): Remove scrollbar entry.
46
12010-07-08 Dan Nicolaescu <dann@ics.uci.edu> 472010-07-08 Dan Nicolaescu <dann@ics.uci.edu>
2 48
3 * lwlib.c (allocate_widget_instance, get_widget_info) 49 * lwlib.c (allocate_widget_instance, get_widget_info)
diff --git a/lwlib/lwlib-Xaw.c b/lwlib/lwlib-Xaw.c
index 924764376ef..2e08dd12bd0 100644
--- a/lwlib/lwlib-Xaw.c
+++ b/lwlib/lwlib-Xaw.c
@@ -71,7 +71,9 @@ struct widget_xft_data
71 71
72#endif 72#endif
73 73
74static void xaw_generic_callback (Widget widget, XtPointer closure, XtPointer call_data); 74static void xaw_generic_callback (Widget widget,
75 XtPointer closure,
76 XtPointer call_data);
75 77
76 78
77Boolean 79Boolean
@@ -81,70 +83,6 @@ lw_xaw_widget_p (Widget widget)
81 XtIsSubclass (widget, dialogWidgetClass)); 83 XtIsSubclass (widget, dialogWidgetClass));
82} 84}
83 85
84#if 0
85static void
86xaw_update_scrollbar (instance, widget, val)
87 widget_instance *instance;
88 Widget widget;
89 widget_value *val;
90{
91 if (val->scrollbar_data)
92 {
93 scrollbar_values *data = val->scrollbar_data;
94 Dimension height, width;
95 Dimension pos_x, pos_y;
96 int widget_shown, widget_topOfThumb;
97 float new_shown, new_topOfThumb;
98
99 XtVaGetValues (widget,
100 XtNheight, &height,
101 XtNwidth, &width,
102 XtNx, &pos_x,
103 XtNy, &pos_y,
104 XtNtopOfThumb, &widget_topOfThumb,
105 XtNshown, &widget_shown,
106 NULL);
107
108 /*
109 * First size and position the scrollbar widget.
110 * We need to position it to second-guess the Paned widget's notion
111 * of what should happen when the WMShell gets resized.
112 */
113 if (height != data->scrollbar_height || pos_y != data->scrollbar_pos)
114 {
115 XtConfigureWidget (widget, pos_x, data->scrollbar_pos,
116 width, data->scrollbar_height, 0);
117
118 XtVaSetValues (widget,
119 XtNlength, data->scrollbar_height,
120 XtNthickness, width,
121 NULL);
122 }
123
124 /*
125 * Now the size the scrollbar's slider.
126 */
127 new_shown = (float) data->slider_size /
128 (float) (data->maximum - data->minimum);
129
130 new_topOfThumb = (float) (data->slider_position - data->minimum) /
131 (float) (data->maximum - data->minimum);
132
133 if (new_shown > 1.0)
134 new_shown = 1.0;
135 if (new_shown < 0)
136 new_shown = 0;
137
138 if (new_topOfThumb > 1.0)
139 new_topOfThumb = 1.0;
140 if (new_topOfThumb < 0)
141 new_topOfThumb = 0;
142
143 if (new_shown != widget_shown || new_topOfThumb != widget_topOfThumb)
144 XawScrollbarSetThumb (widget, new_topOfThumb, new_shown);
145 }
146}
147#endif
148 86
149#ifdef HAVE_XFT 87#ifdef HAVE_XFT
150static void 88static void
@@ -325,9 +263,9 @@ command_press (Widget widget,
325 263
326static void 264static void
327command_reset (Widget widget, 265command_reset (Widget widget,
328 XEvent* event, 266 XEvent* event,
329 String *params, 267 String *params,
330 Cardinal *num_params) 268 Cardinal *num_params)
331{ 269{
332 struct widget_xft_data *data = find_xft_data (widget); 270 struct widget_xft_data *data = find_xft_data (widget);
333 if (data) 271 if (data)
@@ -348,15 +286,11 @@ command_reset (Widget widget,
348#endif 286#endif
349 287
350void 288void
351xaw_update_one_widget (widget_instance *instance, Widget widget, 289xaw_update_one_widget (widget_instance *instance,
352 widget_value *val, Boolean deep_p) 290 Widget widget,
291 widget_value *val,
292 Boolean deep_p)
353{ 293{
354#if 0
355 if (XtIsSubclass (widget, scrollbarWidgetClass))
356 {
357 xaw_update_scrollbar (instance, widget, val);
358 }
359#endif
360 if (XtIsSubclass (widget, dialogWidgetClass)) 294 if (XtIsSubclass (widget, dialogWidgetClass))
361 { 295 {
362 296
@@ -419,7 +353,9 @@ xaw_update_one_widget (widget_instance *instance, Widget widget,
419} 353}
420 354
421void 355void
422xaw_update_one_value (widget_instance *instance, Widget widget, widget_value *val) 356xaw_update_one_value (widget_instance *instance,
357 Widget widget,
358 widget_value *val)
423{ 359{
424 /* This function is not used by the scrollbars and those are the only 360 /* This function is not used by the scrollbars and those are the only
425 Athena widget implemented at the moment so do nothing. */ 361 Athena widget implemented at the moment so do nothing. */
@@ -559,19 +495,17 @@ char buttonTrans[] =
559#endif 495#endif
560 496
561static Widget 497static Widget
562make_dialog (name, parent, pop_up_p, shell_title, icon_name, text_input_slot, 498make_dialog (char* name,
563 radio_box, list, left_buttons, right_buttons, instance) 499 Widget parent,
564 char* name; 500 Boolean pop_up_p,
565 Widget parent; 501 char* shell_title,
566 Boolean pop_up_p; 502 char* icon_name,
567 char* shell_title; 503 Boolean text_input_slot,
568 char* icon_name; 504 Boolean radio_box,
569 Boolean text_input_slot; 505 Boolean list,
570 Boolean radio_box; 506 int left_buttons,
571 Boolean list; 507 int right_buttons,
572 int left_buttons; 508 widget_instance *instance)
573 int right_buttons;
574 widget_instance *instance;
575{ 509{
576 Arg av [20]; 510 Arg av [20];
577 int ac = 0; 511 int ac = 0;
@@ -815,10 +749,6 @@ xaw_generic_callback (Widget widget, XtPointer closure, XtPointer call_data)
815 749
816 id = instance->info->id; 750 id = instance->info->id;
817 751
818#if 0
819 user_data = NULL;
820 XtVaGetValues (widget, XtNuserData, &user_data, NULL);
821#else
822 /* Damn! Athena doesn't give us a way to hang our own data on the 752 /* Damn! Athena doesn't give us a way to hang our own data on the
823 buttons, so we have to go find it... I guess this assumes that 753 buttons, so we have to go find it... I guess this assumes that
824 all instances of a button have the same call data. */ 754 all instances of a button have the same call data. */
@@ -834,7 +764,6 @@ xaw_generic_callback (Widget widget, XtPointer closure, XtPointer call_data)
834 if (! val) abort (); 764 if (! val) abort ();
835 user_data = val->call_data; 765 user_data = val->call_data;
836 } 766 }
837#endif
838 767
839 if (instance->info->selection_cb) 768 if (instance->info->selection_cb)
840 instance->info->selection_cb (widget, id, user_data); 769 instance->info->selection_cb (widget, id, user_data);
@@ -885,106 +814,6 @@ wm_delete_window (Widget w,
885} 814}
886 815
887 816
888/* Scrollbars */
889
890#if 0
891static void
892xaw_scrollbar_scroll (widget, closure, call_data)
893 Widget widget;
894 XtPointer closure;
895 XtPointer call_data;
896{
897 widget_instance *instance = (widget_instance *) closure;
898 LWLIB_ID id;
899 scroll_event event_data;
900
901 if (!instance || widget->core.being_destroyed)
902 return;
903
904 id = instance->info->id;
905 event_data.slider_value = 0;
906 event_data.time = 0;
907
908 if ((int) call_data > 0)
909 event_data.action = SCROLLBAR_PAGE_DOWN;
910 else
911 event_data.action = SCROLLBAR_PAGE_UP;
912
913 if (instance->info->pre_activate_cb)
914 instance->info->pre_activate_cb (widget, id, (XtPointer) &event_data);
915}
916#endif
917
918#if 0
919static void
920xaw_scrollbar_jump (widget, closure, call_data)
921 Widget widget;
922 XtPointer closure;
923 XtPointer call_data;
924{
925 widget_instance *instance = (widget_instance *) closure;
926 LWLIB_ID id;
927 scroll_event event_data;
928 scrollbar_values *val =
929 (scrollbar_values *) instance->info->val->scrollbar_data;
930 float percent;
931
932 if (!instance || widget->core.being_destroyed)
933 return;
934
935 id = instance->info->id;
936
937 percent = * (float *) call_data;
938 event_data.slider_value =
939 (int) (percent * (float) (val->maximum - val->minimum)) + val->minimum;
940
941 event_data.time = 0;
942 event_data.action = SCROLLBAR_DRAG;
943
944 if (instance->info->pre_activate_cb)
945 instance->info->pre_activate_cb (widget, id, (XtPointer) &event_data);
946}
947#endif
948
949static Widget
950xaw_create_scrollbar (widget_instance *instance)
951{
952#if 0
953 Arg av[20];
954 int ac = 0;
955 Dimension width;
956 Widget scrollbar;
957
958 XtVaGetValues (instance->parent, XtNwidth, &width, NULL);
959
960 XtSetArg (av[ac], XtNshowGrip, 0); ac++;
961 XtSetArg (av[ac], XtNresizeToPreferred, 1); ac++;
962 XtSetArg (av[ac], XtNallowResize, True); ac++;
963 XtSetArg (av[ac], XtNskipAdjust, True); ac++;
964 XtSetArg (av[ac], XtNwidth, width); ac++;
965 XtSetArg (av[ac], XtNmappedWhenManaged, True); ac++;
966
967 scrollbar =
968 XtCreateWidget (instance->info->name, scrollbarWidgetClass,
969 instance->parent, av, ac);
970
971 /* We have to force the border width to be 0 otherwise the
972 geometry manager likes to start looping for awhile... */
973 XtVaSetValues (scrollbar, XtNborderWidth, 0, NULL);
974
975 XtRemoveAllCallbacks (scrollbar, "jumpProc");
976 XtRemoveAllCallbacks (scrollbar, "scrollProc");
977
978 XtAddCallback (scrollbar, "jumpProc", xaw_scrollbar_jump,
979 (XtPointer) instance);
980 XtAddCallback (scrollbar, "scrollProc", xaw_scrollbar_scroll,
981 (XtPointer) instance);
982
983 return scrollbar;
984#else
985 return NULL;
986#endif
987}
988 817
989static Widget 818static Widget
990xaw_create_main (widget_instance *instance) 819xaw_create_main (widget_instance *instance)
@@ -1002,7 +831,6 @@ xaw_create_main (widget_instance *instance)
1002widget_creation_entry 831widget_creation_entry
1003xaw_creation_table [] = 832xaw_creation_table [] =
1004{ 833{
1005 {"scrollbar", xaw_create_scrollbar},
1006 {"main", xaw_create_main}, 834 {"main", xaw_create_main},
1007 {NULL, NULL} 835 {NULL, NULL}
1008}; 836};
diff --git a/lwlib/lwlib-Xlw.c b/lwlib/lwlib-Xlw.c
index 8a98184ab93..9a0ff10b11f 100644
--- a/lwlib/lwlib-Xlw.c
+++ b/lwlib/lwlib-Xlw.c
@@ -43,8 +43,7 @@ Boston, MA 02110-1301, USA. */
43 This is sometimes handy to have available. */ 43 This is sometimes handy to have available. */
44 44
45void 45void
46x_print_complete_resource_name (widget) 46x_print_complete_resource_name (Widget widget)
47 Widget widget;
48{ 47{
49 int i; 48 int i;
50 String names[100]; 49 String names[100];
@@ -223,7 +222,9 @@ xlw_update_one_widget (widget_instance* instance, Widget widget,
223} 222}
224 223
225void 224void
226xlw_update_one_value (widget_instance *instance, Widget widget, widget_value *val) 225xlw_update_one_value (widget_instance *instance,
226 Widget widget,
227 widget_value *val)
227{ 228{
228 return; 229 return;
229} 230}
diff --git a/lwlib/lwlib-Xm.c b/lwlib/lwlib-Xm.c
index e8276eb7ca1..1116a6a5440 100644
--- a/lwlib/lwlib-Xm.c
+++ b/lwlib/lwlib-Xm.c
@@ -145,8 +145,7 @@ void xm_manage_resizing (Widget, Boolean);
145 This is sometimes handy to have available. */ 145 This is sometimes handy to have available. */
146 146
147void 147void
148x_print_complete_resource_name (widget) 148x_print_complete_resource_name (Widget widget)
149 Widget widget;
150{ 149{
151 int i; 150 int i;
152 String names[100]; 151 String names[100];
@@ -168,12 +167,11 @@ x_print_complete_resource_name (widget)
168static destroyed_instance *all_destroyed_instances = NULL; 167static destroyed_instance *all_destroyed_instances = NULL;
169 168
170static destroyed_instance* 169static destroyed_instance*
171make_destroyed_instance (name, type, widget, parent, pop_up_p) 170make_destroyed_instance (char* name,
172 char* name; 171 char* type,
173 char* type; 172 Widget widget,
174 Widget widget; 173 Widget parent,
175 Widget parent; 174 Boolean pop_up_p)
176 Boolean pop_up_p;
177{ 175{
178 destroyed_instance* instance = 176 destroyed_instance* instance =
179 (destroyed_instance*)malloc (sizeof (destroyed_instance)); 177 (destroyed_instance*)malloc (sizeof (destroyed_instance));
@@ -187,8 +185,7 @@ make_destroyed_instance (name, type, widget, parent, pop_up_p)
187} 185}
188 186
189static void 187static void
190free_destroyed_instance (instance) 188free_destroyed_instance (destroyed_instance* instance)
191 destroyed_instance* instance;
192{ 189{
193 free (instance->name); 190 free (instance->name);
194 free (instance->type); 191 free (instance->type);
@@ -197,15 +194,13 @@ free_destroyed_instance (instance)
197 194
198 /* motif utility functions */ 195 /* motif utility functions */
199Widget 196Widget
200first_child (widget) 197first_child (Widget widget)
201 Widget widget;
202{ 198{
203 return ((CompositeWidget)widget)->composite.children [0]; 199 return ((CompositeWidget)widget)->composite.children [0];
204} 200}
205 201
206Boolean 202Boolean
207lw_motif_widget_p (widget) 203lw_motif_widget_p (Widget widget)
208 Widget widget;
209{ 204{
210 return 205 return
211 XtClass (widget) == xmDialogShellWidgetClass 206 XtClass (widget) == xmDialogShellWidgetClass
@@ -213,9 +208,8 @@ lw_motif_widget_p (widget)
213} 208}
214 209
215static XmString 210static XmString
216resource_motif_string (widget, name) 211resource_motif_string (Widget widget,
217 Widget widget; 212 char* name)
218 char* name;
219{ 213{
220 XtResource resource; 214 XtResource resource;
221 XmString result = 0; 215 XmString result = 0;
@@ -237,9 +231,8 @@ resource_motif_string (widget, name)
237 starting with number FIRST_CHILD_TO_DESTROY. */ 231 starting with number FIRST_CHILD_TO_DESTROY. */
238 232
239static void 233static void
240destroy_all_children (widget, first_child_to_destroy) 234destroy_all_children (Widget widget,
241 Widget widget; 235 int first_child_to_destroy)
242 int first_child_to_destroy;
243{ 236{
244 Widget* children; 237 Widget* children;
245 unsigned int number; 238 unsigned int number;
@@ -285,9 +278,7 @@ destroy_all_children (widget, first_child_to_destroy)
285 is called. */ 278 is called. */
286 279
287static void 280static void
288xm_arm_callback (w, client_data, call_data) 281xm_arm_callback (Widget w, XtPointer client_data, XtPointer call_data)
289 Widget w;
290 XtPointer client_data, call_data;
291{ 282{
292 XmPushButtonCallbackStruct *cbs = (XmPushButtonCallbackStruct *) call_data; 283 XmPushButtonCallbackStruct *cbs = (XmPushButtonCallbackStruct *) call_data;
293 widget_value *wv = (widget_value *) client_data; 284 widget_value *wv = (widget_value *) client_data;
@@ -339,10 +330,9 @@ xm_arm_callback (w, client_data, call_data)
339 not null, and contains the label string to display. */ 330 not null, and contains the label string to display. */
340 331
341static void 332static void
342xm_update_label (instance, widget, val) 333xm_update_label (widget_instance* instance,
343 widget_instance* instance; 334 Widget widget,
344 Widget widget; 335 widget_value* val)
345 widget_value* val;
346{ 336{
347 XmString res_string = 0; 337 XmString res_string = 0;
348 XmString built_string = 0; 338 XmString built_string = 0;
@@ -390,10 +380,9 @@ xm_update_label (instance, widget, val)
390 380
391 /* update of list */ 381 /* update of list */
392static void 382static void
393xm_update_list (instance, widget, val) 383xm_update_list (widget_instance* instance,
394 widget_instance* instance; 384 Widget widget,
395 Widget widget; 385 widget_value* val)
396 widget_value* val;
397{ 386{
398 widget_value* cur; 387 widget_value* cur;
399 int i; 388 int i;
@@ -414,10 +403,9 @@ xm_update_list (instance, widget, val)
414 403
415 /* update of buttons */ 404 /* update of buttons */
416static void 405static void
417xm_update_pushbutton (instance, widget, val) 406xm_update_pushbutton (widget_instance* instance,
418 widget_instance* instance; 407 Widget widget,
419 Widget widget; 408 widget_value* val)
420 widget_value* val;
421{ 409{
422 XtVaSetValues (widget, XmNalignment, XmALIGNMENT_CENTER, NULL); 410 XtVaSetValues (widget, XmNalignment, XmALIGNMENT_CENTER, NULL);
423 XtRemoveAllCallbacks (widget, XmNactivateCallback); 411 XtRemoveAllCallbacks (widget, XmNactivateCallback);
@@ -425,10 +413,9 @@ xm_update_pushbutton (instance, widget, val)
425} 413}
426 414
427static void 415static void
428xm_update_cascadebutton (instance, widget, val) 416xm_update_cascadebutton (widget_instance* instance,
429 widget_instance* instance; 417 Widget widget,
430 Widget widget; 418 widget_value* val)
431 widget_value* val;
432{ 419{
433 /* Should also rebuild the menu by calling ...update_menu... */ 420 /* Should also rebuild the menu by calling ...update_menu... */
434 XtRemoveAllCallbacks (widget, XmNcascadingCallback); 421 XtRemoveAllCallbacks (widget, XmNcascadingCallback);
@@ -438,10 +425,9 @@ xm_update_cascadebutton (instance, widget, val)
438 425
439 /* update toggle and radiobox */ 426 /* update toggle and radiobox */
440static void 427static void
441xm_update_toggle (instance, widget, val) 428xm_update_toggle (widget_instance* instance,
442 widget_instance* instance; 429 Widget widget,
443 Widget widget; 430 widget_value* val)
444 widget_value* val;
445{ 431{
446 XtRemoveAllCallbacks (widget, XmNvalueChangedCallback); 432 XtRemoveAllCallbacks (widget, XmNvalueChangedCallback);
447 XtAddCallback (widget, XmNvalueChangedCallback, 433 XtAddCallback (widget, XmNvalueChangedCallback,
@@ -451,10 +437,9 @@ xm_update_toggle (instance, widget, val)
451} 437}
452 438
453static void 439static void
454xm_update_radiobox (instance, widget, val) 440xm_update_radiobox (widget_instance* instance,
455 widget_instance* instance; 441 Widget widget,
456 Widget widget; 442 widget_value* val)
457 widget_value* val;
458 443
459{ 444{
460 Widget toggle; 445 Widget toggle;
@@ -498,11 +483,10 @@ xm_update_radiobox (instance, widget, val)
498/* KEEP_FIRST_CHILDREN gives the number of initial children to keep. */ 483/* KEEP_FIRST_CHILDREN gives the number of initial children to keep. */
499 484
500static void 485static void
501make_menu_in_widget (instance, widget, val, keep_first_children) 486make_menu_in_widget (widget_instance* instance,
502 widget_instance* instance; 487 Widget widget,
503 Widget widget; 488 widget_value* val,
504 widget_value* val; 489 int keep_first_children)
505 int keep_first_children;
506{ 490{
507 Widget* children = 0; 491 Widget* children = 0;
508 int num_children; 492 int num_children;
@@ -655,11 +639,10 @@ make_menu_in_widget (instance, widget, val, keep_first_children)
655} 639}
656 640
657static void 641static void
658update_one_menu_entry (instance, widget, val, deep_p) 642update_one_menu_entry (widget_instance* instance,
659 widget_instance* instance; 643 Widget widget,
660 Widget widget; 644 widget_value* val,
661 widget_value* val; 645 Boolean deep_p)
662 Boolean deep_p;
663{ 646{
664 Arg al [256]; 647 Arg al [256];
665 int ac; 648 int ac;
@@ -757,11 +740,10 @@ update_one_menu_entry (instance, widget, val, deep_p)
757} 740}
758 741
759static void 742static void
760xm_update_menu (instance, widget, val, deep_p) 743xm_update_menu (widget_instance* instance,
761 widget_instance* instance; 744 Widget widget,
762 Widget widget; 745 widget_value* val,
763 widget_value* val; 746 Boolean deep_p)
764 Boolean deep_p;
765{ 747{
766 Widget* children; 748 Widget* children;
767 unsigned int num_children; 749 unsigned int num_children;
@@ -832,10 +814,9 @@ xm_update_menu (instance, widget, val, deep_p)
832/* update text widgets */ 814/* update text widgets */
833 815
834static void 816static void
835xm_update_text (instance, widget, val) 817xm_update_text (widget_instance* instance,
836 widget_instance* instance; 818 Widget widget,
837 Widget widget; 819 widget_value* val)
838 widget_value* val;
839{ 820{
840 XmTextSetString (widget, val->value ? val->value : ""); 821 XmTextSetString (widget, val->value ? val->value : "");
841 XtRemoveAllCallbacks (widget, XmNactivateCallback); 822 XtRemoveAllCallbacks (widget, XmNactivateCallback);
@@ -846,10 +827,9 @@ xm_update_text (instance, widget, val)
846} 827}
847 828
848static void 829static void
849xm_update_text_field (instance, widget, val) 830xm_update_text_field (widget_instance* instance,
850 widget_instance* instance; 831 Widget widget,
851 Widget widget; 832 widget_value* val)
852 widget_value* val;
853{ 833{
854 XmTextFieldSetString (widget, val->value ? val->value : ""); 834 XmTextFieldSetString (widget, val->value ? val->value : "");
855 XtRemoveAllCallbacks (widget, XmNactivateCallback); 835 XtRemoveAllCallbacks (widget, XmNactivateCallback);
@@ -863,11 +843,10 @@ xm_update_text_field (instance, widget, val)
863/* update a motif widget */ 843/* update a motif widget */
864 844
865void 845void
866xm_update_one_widget (instance, widget, val, deep_p) 846xm_update_one_widget (widget_instance* instance,
867 widget_instance* instance; 847 Widget widget,
868 Widget widget; 848 widget_value* val,
869 widget_value* val; 849 Boolean deep_p)
870 Boolean deep_p;
871{ 850{
872 WidgetClass class; 851 WidgetClass class;
873 852
@@ -928,10 +907,9 @@ xm_update_one_widget (instance, widget, val, deep_p)
928 907
929 /* getting the value back */ 908 /* getting the value back */
930void 909void
931xm_update_one_value (instance, widget, val) 910xm_update_one_value (widget_instance* instance,
932 widget_instance* instance; 911 Widget widget,
933 Widget widget; 912 widget_value* val)
934 widget_value* val;
935{ 913{
936 WidgetClass class = XtClass (widget); 914 WidgetClass class = XtClass (widget);
937 widget_value *old_wv; 915 widget_value *old_wv;
@@ -1024,10 +1002,9 @@ xm_update_one_value (instance, widget, val)
1024 I could not find a way to do that with accelerators. 1002 I could not find a way to do that with accelerators.
1025 */ 1003 */
1026static void 1004static void
1027activate_button (widget, closure, call_data) 1005activate_button (Widget widget,
1028 Widget widget; 1006 XtPointer closure,
1029 XtPointer closure; 1007 XtPointer call_data)
1030 XtPointer call_data;
1031{ 1008{
1032 Widget button = (Widget)closure; 1009 Widget button = (Widget)closure;
1033 XtCallCallbacks (button, XmNactivateCallback, NULL); 1010 XtCallCallbacks (button, XmNactivateCallback, NULL);
@@ -1037,11 +1014,10 @@ activate_button (widget, closure, call_data)
1037 1014
1038/* Called for key press in dialogs. Used to pop down dialog on ESC. */ 1015/* Called for key press in dialogs. Used to pop down dialog on ESC. */
1039static void 1016static void
1040dialog_key_cb (widget, closure, event, continue_to_dispatch) 1017dialog_key_cb (Widget widget,
1041 Widget widget; 1018 XtPointer closure,
1042 XtPointer closure; 1019 XEvent *event,
1043 XEvent *event; 1020 Boolean *continue_to_dispatch)
1044 Boolean *continue_to_dispatch;
1045{ 1021{
1046 KeySym sym = 0; 1022 KeySym sym = 0;
1047 Modifiers modif_ret; 1023 Modifiers modif_ret;
@@ -1064,18 +1040,16 @@ dialog_key_cb (widget, closure, event, continue_to_dispatch)
1064 1040
1065/* dialogs */ 1041/* dialogs */
1066static Widget 1042static Widget
1067make_dialog (name, parent, pop_up_p, shell_title, icon_name, text_input_slot, 1043make_dialog (char* name,
1068 radio_box, list, left_buttons, right_buttons) 1044 Widget parent,
1069 char* name; 1045 Boolean pop_up_p,
1070 Widget parent; 1046 char* shell_title,
1071 Boolean pop_up_p; 1047 char* icon_name,
1072 char* shell_title; 1048 Boolean text_input_slot,
1073 char* icon_name; 1049 Boolean radio_box,
1074 Boolean text_input_slot; 1050 Boolean list,
1075 Boolean radio_box; 1051 int left_buttons,
1076 Boolean list; 1052 int right_buttons)
1077 int left_buttons;
1078 int right_buttons;
1079{ 1053{
1080 Widget result; 1054 Widget result;
1081 Widget form; 1055 Widget form;
@@ -1328,8 +1302,7 @@ make_dialog (name, parent, pop_up_p, shell_title, icon_name, text_input_slot,
1328} 1302}
1329 1303
1330static destroyed_instance* 1304static destroyed_instance*
1331find_matching_instance (instance) 1305find_matching_instance (widget_instance* instance)
1332 widget_instance* instance;
1333{ 1306{
1334 destroyed_instance* cur; 1307 destroyed_instance* cur;
1335 destroyed_instance* prev; 1308 destroyed_instance* prev;
@@ -1366,18 +1339,16 @@ find_matching_instance (instance)
1366} 1339}
1367 1340
1368static void 1341static void
1369mark_dead_instance_destroyed (widget, closure, call_data) 1342mark_dead_instance_destroyed (Widget widget,
1370 Widget widget; 1343 XtPointer closure,
1371 XtPointer closure; 1344 XtPointer call_data)
1372 XtPointer call_data;
1373{ 1345{
1374 destroyed_instance* instance = (destroyed_instance*)closure; 1346 destroyed_instance* instance = (destroyed_instance*)closure;
1375 instance->widget = NULL; 1347 instance->widget = NULL;
1376} 1348}
1377 1349
1378static void 1350static void
1379recenter_widget (widget) 1351recenter_widget (Widget widget)
1380 Widget widget;
1381{ 1352{
1382 Widget parent = XtParent (widget); 1353 Widget parent = XtParent (widget);
1383 Screen* screen = XtScreen (widget); 1354 Screen* screen = XtScreen (widget);
@@ -1413,8 +1384,7 @@ recenter_widget (widget)
1413} 1384}
1414 1385
1415static Widget 1386static Widget
1416recycle_instance (instance) 1387recycle_instance (destroyed_instance* instance)
1417 destroyed_instance* instance;
1418{ 1388{
1419 Widget widget = instance->widget; 1389 Widget widget = instance->widget;
1420 1390
@@ -1450,8 +1420,7 @@ recycle_instance (instance)
1450} 1420}
1451 1421
1452Widget 1422Widget
1453xm_create_dialog (instance) 1423xm_create_dialog (widget_instance* instance)
1454 widget_instance* instance;
1455{ 1424{
1456 char* name = instance->info->type; 1425 char* name = instance->info->type;
1457 Widget parent = instance->parent; 1426 Widget parent = instance->parent;
@@ -1531,8 +1500,7 @@ xm_create_dialog (instance)
1531 because we have not yet managed to make it work right in Motif. */ 1500 because we have not yet managed to make it work right in Motif. */
1532 1501
1533static Widget 1502static Widget
1534make_menubar (instance) 1503make_menubar (widget_instance* instance)
1535 widget_instance* instance;
1536{ 1504{
1537 Arg al[3]; 1505 Arg al[3];
1538 int ac; 1506 int ac;
@@ -1543,18 +1511,16 @@ make_menubar (instance)
1543} 1511}
1544 1512
1545static void 1513static void
1546remove_grabs (shell, closure, call_data) 1514remove_grabs (Widget shell,
1547 Widget shell; 1515 XtPointer closure,
1548 XtPointer closure; 1516 XtPointer call_data)
1549 XtPointer call_data;
1550{ 1517{
1551 Widget menu = (Widget) closure; 1518 Widget menu = (Widget) closure;
1552 XmRemoveFromPostFromList (menu, XtParent (XtParent (menu))); 1519 XmRemoveFromPostFromList (menu, XtParent (XtParent (menu)));
1553} 1520}
1554 1521
1555static Widget 1522static Widget
1556make_popup_menu (instance) 1523make_popup_menu (widget_instance* instance)
1557 widget_instance* instance;
1558{ 1524{
1559 Widget parent = instance->parent; 1525 Widget parent = instance->parent;
1560 Window parent_window = parent->core.window; 1526 Window parent_window = parent->core.window;
@@ -1570,8 +1536,7 @@ make_popup_menu (instance)
1570} 1536}
1571 1537
1572static Widget 1538static Widget
1573make_main (instance) 1539make_main (widget_instance* instance)
1574 widget_instance* instance;
1575{ 1540{
1576 Widget parent = instance->parent; 1541 Widget parent = instance->parent;
1577 Widget result; 1542 Widget result;
@@ -1710,8 +1675,7 @@ xm_creation_table [] =
1710 1675
1711 /* Destruction of instances */ 1676 /* Destruction of instances */
1712void 1677void
1713xm_destroy_instance (instance) 1678xm_destroy_instance ( widget_instance* instance)
1714 widget_instance* instance;
1715{ 1679{
1716 Widget widget = instance->widget; 1680 Widget widget = instance->widget;
1717 /* recycle the dialog boxes */ 1681 /* recycle the dialog boxes */
@@ -1745,9 +1709,7 @@ xm_destroy_instance (instance)
1745 1709
1746 /* popup utility */ 1710 /* popup utility */
1747void 1711void
1748xm_popup_menu (widget, event) 1712xm_popup_menu (Widget widget, XEvent *event)
1749 Widget widget;
1750 XEvent *event;
1751{ 1713{
1752 XButtonPressedEvent dummy; 1714 XButtonPressedEvent dummy;
1753 1715
@@ -1795,8 +1757,7 @@ xm_popup_menu (widget, event)
1795} 1757}
1796 1758
1797static void 1759static void
1798set_min_dialog_size (w) 1760set_min_dialog_size (Widget w)
1799 Widget w;
1800{ 1761{
1801 short width; 1762 short width;
1802 short height; 1763 short height;
@@ -1805,9 +1766,7 @@ set_min_dialog_size (w)
1805} 1766}
1806 1767
1807void 1768void
1808xm_pop_instance (instance, up) 1769xm_pop_instance (widget_instance* instance, Boolean up)
1809 widget_instance* instance;
1810 Boolean up;
1811{ 1770{
1812 Widget widget = instance->widget; 1771 Widget widget = instance->widget;
1813 1772
@@ -1836,10 +1795,9 @@ xm_pop_instance (instance, up)
1836/* motif callback */ 1795/* motif callback */
1837 1796
1838static void 1797static void
1839do_call (widget, closure, type) 1798do_call (Widget widget,
1840 Widget widget; 1799 XtPointer closure,
1841 XtPointer closure; 1800 enum do_call_type type)
1842 enum do_call_type type;
1843{ 1801{
1844 Arg al [256]; 1802 Arg al [256];
1845 int ac; 1803 int ac;
@@ -1896,10 +1854,9 @@ do_call (widget, closure, type)
1896 if the widget was ``destroyed'' by caching it in the all_destroyed_instances 1854 if the widget was ``destroyed'' by caching it in the all_destroyed_instances
1897 list */ 1855 list */
1898static void 1856static void
1899xm_internal_update_other_instances (widget, closure, call_data) 1857xm_internal_update_other_instances (Widget widget,
1900 Widget widget; 1858 XtPointer closure,
1901 XtPointer closure; 1859 XtPointer call_data)
1902 XtPointer call_data;
1903{ 1860{
1904 Widget parent; 1861 Widget parent;
1905 for (parent = widget; parent; parent = XtParent (parent)) 1862 for (parent = widget; parent; parent = XtParent (parent))
@@ -1911,20 +1868,18 @@ xm_internal_update_other_instances (widget, closure, call_data)
1911} 1868}
1912 1869
1913static void 1870static void
1914xm_generic_callback (widget, closure, call_data) 1871xm_generic_callback (Widget widget,
1915 Widget widget; 1872 XtPointer closure,
1916 XtPointer closure; 1873 XtPointer call_data)
1917 XtPointer call_data;
1918{ 1874{
1919 lw_internal_update_other_instances (widget, closure, call_data); 1875 lw_internal_update_other_instances (widget, closure, call_data);
1920 do_call (widget, closure, selection); 1876 do_call (widget, closure, selection);
1921} 1877}
1922 1878
1923static void 1879static void
1924xm_nosel_callback (widget, closure, call_data) 1880xm_nosel_callback (Widget widget,
1925 Widget widget; 1881 XtPointer closure,
1926 XtPointer closure; 1882 XtPointer call_data)
1927 XtPointer call_data;
1928{ 1883{
1929 /* This callback is only called when a dialog box is dismissed with 1884 /* This callback is only called when a dialog box is dismissed with
1930 the wm's destroy button (WM_DELETE_WINDOW.) We want the dialog 1885 the wm's destroy button (WM_DELETE_WINDOW.) We want the dialog
@@ -1939,10 +1894,9 @@ xm_nosel_callback (widget, closure, call_data)
1939} 1894}
1940 1895
1941static void 1896static void
1942xm_pull_down_callback (widget, closure, call_data) 1897xm_pull_down_callback (Widget widget,
1943 Widget widget; 1898 XtPointer closure,
1944 XtPointer closure; 1899 XtPointer call_data)
1945 XtPointer call_data;
1946{ 1900{
1947 Widget parent = XtParent (widget); 1901 Widget parent = XtParent (widget);
1948 1902
@@ -1963,10 +1917,9 @@ xm_pull_down_callback (widget, closure, call_data)
1963 menu, whether or not its submenu is visible. */ 1917 menu, whether or not its submenu is visible. */
1964 1918
1965static void 1919static void
1966xm_pop_down_callback (widget, closure, call_data) 1920xm_pop_down_callback (Widget widget,
1967 Widget widget; 1921 XtPointer closure,
1968 XtPointer closure; 1922 XtPointer call_data)
1969 XtPointer call_data;
1970{ 1923{
1971 widget_instance *instance = (widget_instance *) closure; 1924 widget_instance *instance = (widget_instance *) closure;
1972 1925
@@ -1978,9 +1931,7 @@ xm_pop_down_callback (widget, closure, call_data)
1978 1931
1979/* set the keyboard focus */ 1932/* set the keyboard focus */
1980void 1933void
1981xm_set_keyboard_focus (parent, w) 1934xm_set_keyboard_focus (Widget parent, Widget w)
1982 Widget parent;
1983 Widget w;
1984{ 1935{
1985 XmProcessTraversal (w, 0); 1936 XmProcessTraversal (w, 0);
1986 XtSetKeyboardFocus (parent, w); 1937 XtSetKeyboardFocus (parent, w);
@@ -1988,10 +1939,9 @@ xm_set_keyboard_focus (parent, w)
1988 1939
1989/* Motif hack to set the main window areas. */ 1940/* Motif hack to set the main window areas. */
1990void 1941void
1991xm_set_main_areas (parent, menubar, work_area) 1942xm_set_main_areas (Widget parent,
1992 Widget parent; 1943 Widget menubar,
1993 Widget menubar; 1944 Widget work_area)
1994 Widget work_area;
1995{ 1945{
1996 XmMainWindowSetAreas (parent, 1946 XmMainWindowSetAreas (parent,
1997 menubar, /* menubar (maybe 0) */ 1947 menubar, /* menubar (maybe 0) */
@@ -2003,9 +1953,7 @@ xm_set_main_areas (parent, menubar, work_area)
2003 1953
2004/* Motif hack to control resizing on the menubar. */ 1954/* Motif hack to control resizing on the menubar. */
2005void 1955void
2006xm_manage_resizing (w, flag) 1956xm_manage_resizing (Widget w, Boolean flag)
2007 Widget w;
2008 Boolean flag;
2009{ 1957{
2010 XtVaSetValues (w, XtNallowShellResize, flag, NULL); 1958 XtVaSetValues (w, XtNallowShellResize, flag, NULL);
2011} 1959}
diff --git a/lwlib/lwlib-int.h b/lwlib/lwlib-int.h
index b786bbb7a08..e84d7fb9956 100644
--- a/lwlib/lwlib-int.h
+++ b/lwlib/lwlib-int.h
@@ -58,8 +58,7 @@ typedef struct _widget_info
58 struct _widget_info* next; 58 struct _widget_info* next;
59} widget_info; 59} widget_info;
60 60
61typedef Widget 61typedef Widget (*widget_creation_function) (widget_instance *instance);
62(*widget_creation_function) ();
63 62
64typedef struct _widget_creation_entry 63typedef struct _widget_creation_entry
65{ 64{
diff --git a/lwlib/lwlib.c b/lwlib/lwlib.c
index fe228b9a69a..2b72f54bb19 100644
--- a/lwlib/lwlib.c
+++ b/lwlib/lwlib.c
@@ -249,16 +249,14 @@ copy_widget_value_tree (widget_value *val, change_type change)
249} 249}
250 250
251static widget_info * 251static widget_info *
252allocate_widget_info (type, name, id, val, pre_activate_cb, 252allocate_widget_info (char* type,
253 selection_cb, post_activate_cb, highlight_cb) 253 char* name,
254 char* type; 254 LWLIB_ID id,
255 char* name; 255 widget_value* val,
256 LWLIB_ID id; 256 lw_callback pre_activate_cb,
257 widget_value* val; 257 lw_callback selection_cb,
258 lw_callback pre_activate_cb; 258 lw_callback post_activate_cb,
259 lw_callback selection_cb; 259 lw_callback highlight_cb)
260 lw_callback post_activate_cb;
261 lw_callback highlight_cb;
262{ 260{
263 widget_info* info = (widget_info*)malloc (sizeof (widget_info)); 261 widget_info* info = (widget_info*)malloc (sizeof (widget_info));
264 info->type = safe_strdup (type); 262 info->type = safe_strdup (type);
@@ -431,7 +429,10 @@ safe_strcmp (char *s1, char *s2)
431 429
432 430
433static widget_value * 431static widget_value *
434merge_widget_value (widget_value *val1, widget_value *val2, int level, int *change_p) 432merge_widget_value (widget_value *val1,
433 widget_value *val2,
434 int level,
435 int *change_p)
435{ 436{
436 change_type change, this_one_change; 437 change_type change, this_one_change;
437 widget_value* merged_next; 438 widget_value* merged_next;
@@ -822,16 +823,14 @@ instantiate_widget_instance (widget_instance *instance)
822} 823}
823 824
824void 825void
825lw_register_widget (type, name, id, val, pre_activate_cb, 826lw_register_widget (char* type,
826 selection_cb, post_activate_cb, highlight_cb) 827 char* name,
827 char* type; 828 LWLIB_ID id,
828 char* name; 829 widget_value* val,
829 LWLIB_ID id; 830 lw_callback pre_activate_cb,
830 widget_value* val; 831 lw_callback selection_cb,
831 lw_callback pre_activate_cb; 832 lw_callback post_activate_cb,
832 lw_callback selection_cb; 833 lw_callback highlight_cb)
833 lw_callback post_activate_cb;
834 lw_callback highlight_cb;
835{ 834{
836 if (!get_widget_info (id, False)) 835 if (!get_widget_info (id, False))
837 allocate_widget_info (type, name, id, val, pre_activate_cb, selection_cb, 836 allocate_widget_info (type, name, id, val, pre_activate_cb, selection_cb,
@@ -1162,7 +1161,9 @@ static Boolean lwlib_updating;
1162 modified to update other instances of the widgets. Closure should be the 1161 modified to update other instances of the widgets. Closure should be the
1163 widget_instance. */ 1162 widget_instance. */
1164void 1163void
1165lw_internal_update_other_instances (Widget widget, XtPointer closure, XtPointer call_data) 1164lw_internal_update_other_instances (Widget widget,
1165 XtPointer closure,
1166 XtPointer call_data)
1166{ 1167{
1167 widget_instance* instance = (widget_instance*)closure; 1168 widget_instance* instance = (widget_instance*)closure;
1168 char* name = XtName (widget); 1169 char* name = XtName (widget);
diff --git a/lwlib/xlwmenu.c b/lwlib/xlwmenu.c
index 0ccf70d8c34..143c4c51d58 100644
--- a/lwlib/xlwmenu.c
+++ b/lwlib/xlwmenu.c
@@ -187,9 +187,9 @@ xlwMenuResources[] =
187 187
188static Boolean XlwMenuSetValues(Widget current, Widget request, Widget new, 188static Boolean XlwMenuSetValues(Widget current, Widget request, Widget new,
189 ArgList args, Cardinal *num_args); 189 ArgList args, Cardinal *num_args);
190static void XlwMenuRealize(Widget w, Mask *valueMask, XSetWindowAttributes *attributes); 190static void XlwMenuRealize(Widget, Mask *, XSetWindowAttributes *);
191static void XlwMenuResize(Widget w); 191static void XlwMenuResize(Widget w);
192static void XlwMenuInitialize(Widget request, Widget mw, ArgList args, Cardinal *num_args); 192static void XlwMenuInitialize(Widget, Widget, ArgList, Cardinal *);
193static void XlwMenuRedisplay(Widget w, XEvent *ev, Region region); 193static void XlwMenuRedisplay(Widget w, XEvent *ev, Region region);
194static void XlwMenuDestroy(Widget w); 194static void XlwMenuDestroy(Widget w);
195static void XlwMenuClassInitialize(void); 195static void XlwMenuClassInitialize(void);
@@ -473,15 +473,13 @@ resource_widget_value (XlwMenuWidget mw, widget_value *val)
473 473
474/* Returns the sizes of an item */ 474/* Returns the sizes of an item */
475static void 475static void
476size_menu_item (mw, val, horizontal_p, label_width, rest_width, button_width, 476size_menu_item (XlwMenuWidget mw,
477 height) 477 widget_value* val,
478 XlwMenuWidget mw; 478 int horizontal_p,
479 widget_value* val; 479 int* label_width,
480 int horizontal_p; 480 int* rest_width,
481 int* label_width; 481 int* button_width,
482 int* rest_width; 482 int* height)
483 int* button_width;
484 int* height;
485{ 483{
486 enum menu_separator separator; 484 enum menu_separator separator;
487 485
@@ -525,12 +523,12 @@ size_menu_item (mw, val, horizontal_p, label_width, rest_width, button_width,
525static void 523static void
526size_menu (XlwMenuWidget mw, int level) 524size_menu (XlwMenuWidget mw, int level)
527{ 525{
528 unsigned int label_width = 0; 526 int label_width = 0;
529 int rest_width = 0; 527 int rest_width = 0;
530 int button_width = 0; 528 int button_width = 0;
531 int max_rest_width = 0; 529 int max_rest_width = 0;
532 int max_button_width = 0; 530 int max_button_width = 0;
533 unsigned int height = 0; 531 int height = 0;
534 int horizontal_p = mw->menu.horizontal && (level == 0); 532 int horizontal_p = mw->menu.horizontal && (level == 0);
535 widget_value* val; 533 widget_value* val;
536 window_state* ws; 534 window_state* ws;
@@ -589,7 +587,13 @@ size_menu (XlwMenuWidget mw, int level)
589 /* Display code */ 587 /* Display code */
590 588
591static void 589static void
592draw_arrow (XlwMenuWidget mw, Window window, GC gc, int x, int y, int width, int down_p) 590draw_arrow (XlwMenuWidget mw,
591 Window window,
592 GC gc,
593 int x,
594 int y,
595 int width,
596 int down_p)
593{ 597{
594 Display *dpy = XtDisplay (mw); 598 Display *dpy = XtDisplay (mw);
595 GC top_gc = mw->menu.shadow_top_gc; 599 GC top_gc = mw->menu.shadow_top_gc;
@@ -646,7 +650,14 @@ draw_arrow (XlwMenuWidget mw, Window window, GC gc, int x, int y, int width, int
646 650
647 651
648static void 652static void
649draw_shadow_rectangle (XlwMenuWidget mw, Window window, int x, int y, int width, int height, int erase_p, int down_p) 653draw_shadow_rectangle (XlwMenuWidget mw,
654 Window window,
655 int x,
656 int y,
657 int width,
658 int height,
659 int erase_p,
660 int down_p)
650{ 661{
651 Display *dpy = XtDisplay (mw); 662 Display *dpy = XtDisplay (mw);
652 GC top_gc = !erase_p ? mw->menu.shadow_top_gc : mw->menu.background_gc; 663 GC top_gc = !erase_p ? mw->menu.shadow_top_gc : mw->menu.background_gc;
@@ -702,7 +713,14 @@ draw_shadow_rectangle (XlwMenuWidget mw, Window window, int x, int y, int width,
702 713
703 714
704static void 715static void
705draw_shadow_rhombus (XlwMenuWidget mw, Window window, int x, int y, int width, int height, int erase_p, int down_p) 716draw_shadow_rhombus (XlwMenuWidget mw,
717 Window window,
718 int x,
719 int y,
720 int width,
721 int height,
722 int erase_p,
723 int down_p)
706{ 724{
707 Display *dpy = XtDisplay (mw); 725 Display *dpy = XtDisplay (mw);
708 GC top_gc = !erase_p ? mw->menu.shadow_top_gc : mw->menu.background_gc; 726 GC top_gc = !erase_p ? mw->menu.shadow_top_gc : mw->menu.background_gc;
@@ -796,7 +814,12 @@ draw_radio (XlwMenuWidget mw, Window window, int x, int y, int selected_p)
796 separator to draw. TYPE is the separator type. */ 814 separator to draw. TYPE is the separator type. */
797 815
798static void 816static void
799draw_separator (XlwMenuWidget mw, Window window, int x, int y, int width, enum menu_separator type) 817draw_separator (XlwMenuWidget mw,
818 Window window,
819 int x,
820 int y,
821 int width,
822 enum menu_separator type)
800{ 823{
801 Display *dpy = XtDisplay (mw); 824 Display *dpy = XtDisplay (mw);
802 XGCValues xgcv; 825 XGCValues xgcv;
@@ -946,15 +969,13 @@ separator_height (enum menu_separator separator)
946 the menu item was. */ 969 the menu item was. */
947 970
948static void 971static void
949display_menu_item (mw, val, ws, where, highlighted_p, horizontal_p, 972display_menu_item (XlwMenuWidget mw,
950 just_compute_p) 973 widget_value* val,
951 XlwMenuWidget mw; 974 window_state* ws,
952 widget_value* val; 975 XPoint* where,
953 window_state* ws; 976 Boolean highlighted_p,
954 XPoint* where; 977 Boolean horizontal_p,
955 Boolean highlighted_p; 978 Boolean just_compute_p)
956 Boolean horizontal_p;
957 Boolean just_compute_p;
958{ 979{
959 GC deco_gc; 980 GC deco_gc;
960 GC text_gc; 981 GC text_gc;
@@ -1137,7 +1158,12 @@ display_menu_item (mw, val, ws, where, highlighted_p, horizontal_p,
1137} 1158}
1138 1159
1139static void 1160static void
1140display_menu (XlwMenuWidget mw, int level, Boolean just_compute_p, XPoint *highlighted_pos, XPoint *hit, widget_value **hit_return) 1161display_menu (XlwMenuWidget mw,
1162 int level,
1163 Boolean just_compute_p,
1164 XPoint *highlighted_pos,
1165 XPoint *hit,
1166 widget_value **hit_return)
1141{ 1167{
1142 widget_value* val; 1168 widget_value* val;
1143 widget_value* following_item; 1169 widget_value* following_item;
@@ -1345,7 +1371,10 @@ xlwmenu_window_p (Widget w, Window window)
1345 1371
1346/* Make the window fit in the screen */ 1372/* Make the window fit in the screen */
1347static void 1373static void
1348fit_to_screen (XlwMenuWidget mw, window_state *ws, window_state *previous_ws, Boolean horizontal_p) 1374fit_to_screen (XlwMenuWidget mw,
1375 window_state *ws,
1376 window_state *previous_ws,
1377 Boolean horizontal_p)
1349{ 1378{
1350 unsigned int screen_width = WidthOfScreen (XtScreen (mw)); 1379 unsigned int screen_width = WidthOfScreen (XtScreen (mw));
1351 unsigned int screen_height = HeightOfScreen (XtScreen (mw)); 1380 unsigned int screen_height = HeightOfScreen (XtScreen (mw));
@@ -1519,7 +1548,10 @@ remap_menubar (XlwMenuWidget mw)
1519} 1548}
1520 1549
1521static Boolean 1550static Boolean
1522motion_event_is_in_menu (XlwMenuWidget mw, XMotionEvent *ev, int level, XPoint *relative_pos) 1551motion_event_is_in_menu (XlwMenuWidget mw,
1552 XMotionEvent *ev,
1553 int level,
1554 XPoint *relative_pos)
1523{ 1555{
1524 window_state* ws = &mw->menu.windows [level]; 1556 window_state* ws = &mw->menu.windows [level];
1525 int shadow = level == 0 ? 0 : mw->menu.shadow_thickness; 1557 int shadow = level == 0 ? 0 : mw->menu.shadow_thickness;
@@ -1532,7 +1564,10 @@ motion_event_is_in_menu (XlwMenuWidget mw, XMotionEvent *ev, int level, XPoint *
1532} 1564}
1533 1565
1534static Boolean 1566static Boolean
1535map_event_to_widget_value (XlwMenuWidget mw, XMotionEvent *ev, widget_value **val, int *level) 1567map_event_to_widget_value (XlwMenuWidget mw,
1568 XMotionEvent *ev,
1569 widget_value **val,
1570 int *level)
1536{ 1571{
1537 int i; 1572 int i;
1538 XPoint relative_pos; 1573 XPoint relative_pos;