summaryrefslogtreecommitdiff
path: root/lwlib
diff options
context:
space:
mode:
authorJan D <jan.h.d@swipnet.se>2010-07-08 12:29:51 +0200
committerJan D <jan.h.d@swipnet.se>2010-07-08 12:29:51 +0200
commitc825c0b6473c1bd995dbef43cc07087609607cda (patch)
tree0f67889373ab35bd69e133046f61dfd7bc189343 /lwlib
parent0216627eb39f77958e30f4750f581714fdfd7faf (diff)
downloademacs-c825c0b6473c1bd995dbef43cc07087609607cda.tar.gz
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.
Diffstat (limited to 'lwlib')
-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 @@
+2010-07-08 Jan Djärv <jan.h.d@swipnet.se>
+
+ * 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.
+
+ * lwlib.c (allocate_widget_info, lw_register_widget): Change from K&R
+ to prototype.
+ (lw_internal_update_other_instances, merge_widget_value): Reformat.
+
+ * lwlib-int.h (widget_creation_function): Fix prototype.
+
+ * 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-Xlw.c (x_print_complete_resource_name): Change from K&R to
+ prototype.
+ (xlw_update_one_value): Reformat.
+
+ * 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.
+
2010-07-08 Dan Nicolaescu <dann@ics.uci.edu>
* 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
#endif
-static void xaw_generic_callback (Widget widget, XtPointer closure, XtPointer call_data);
+static void xaw_generic_callback (Widget widget,
+ XtPointer closure,
+ XtPointer call_data);
Boolean
@@ -81,70 +83,6 @@ lw_xaw_widget_p (Widget widget)
XtIsSubclass (widget, dialogWidgetClass));
}
-#if 0
-static void
-xaw_update_scrollbar (instance, widget, val)
- widget_instance *instance;
- Widget widget;
- widget_value *val;
-{
- if (val->scrollbar_data)
- {
- scrollbar_values *data = val->scrollbar_data;
- Dimension height, width;
- Dimension pos_x, pos_y;
- int widget_shown, widget_topOfThumb;
- float new_shown, new_topOfThumb;
-
- XtVaGetValues (widget,
- XtNheight, &height,
- XtNwidth, &width,
- XtNx, &pos_x,
- XtNy, &pos_y,
- XtNtopOfThumb, &widget_topOfThumb,
- XtNshown, &widget_shown,
- NULL);
-
- /*
- * First size and position the scrollbar widget.
- * We need to position it to second-guess the Paned widget's notion
- * of what should happen when the WMShell gets resized.
- */
- if (height != data->scrollbar_height || pos_y != data->scrollbar_pos)
- {
- XtConfigureWidget (widget, pos_x, data->scrollbar_pos,
- width, data->scrollbar_height, 0);
-
- XtVaSetValues (widget,
- XtNlength, data->scrollbar_height,
- XtNthickness, width,
- NULL);
- }
-
- /*
- * Now the size the scrollbar's slider.
- */
- new_shown = (float) data->slider_size /
- (float) (data->maximum - data->minimum);
-
- new_topOfThumb = (float) (data->slider_position - data->minimum) /
- (float) (data->maximum - data->minimum);
-
- if (new_shown > 1.0)
- new_shown = 1.0;
- if (new_shown < 0)
- new_shown = 0;
-
- if (new_topOfThumb > 1.0)
- new_topOfThumb = 1.0;
- if (new_topOfThumb < 0)
- new_topOfThumb = 0;
-
- if (new_shown != widget_shown || new_topOfThumb != widget_topOfThumb)
- XawScrollbarSetThumb (widget, new_topOfThumb, new_shown);
- }
-}
-#endif
#ifdef HAVE_XFT
static void
@@ -325,9 +263,9 @@ command_press (Widget widget,
static void
command_reset (Widget widget,
- XEvent* event,
- String *params,
- Cardinal *num_params)
+ XEvent* event,
+ String *params,
+ Cardinal *num_params)
{
struct widget_xft_data *data = find_xft_data (widget);
if (data)
@@ -348,15 +286,11 @@ command_reset (Widget widget,
#endif
void
-xaw_update_one_widget (widget_instance *instance, Widget widget,
- widget_value *val, Boolean deep_p)
+xaw_update_one_widget (widget_instance *instance,
+ Widget widget,
+ widget_value *val,
+ Boolean deep_p)
{
-#if 0
- if (XtIsSubclass (widget, scrollbarWidgetClass))
- {
- xaw_update_scrollbar (instance, widget, val);
- }
-#endif
if (XtIsSubclass (widget, dialogWidgetClass))
{
@@ -419,7 +353,9 @@ xaw_update_one_widget (widget_instance *instance, Widget widget,
}
void
-xaw_update_one_value (widget_instance *instance, Widget widget, widget_value *val)
+xaw_update_one_value (widget_instance *instance,
+ Widget widget,
+ widget_value *val)
{
/* This function is not used by the scrollbars and those are the only
Athena widget implemented at the moment so do nothing. */
@@ -559,19 +495,17 @@ char buttonTrans[] =
#endif
static Widget
-make_dialog (name, parent, pop_up_p, shell_title, icon_name, text_input_slot,
- radio_box, list, left_buttons, right_buttons, instance)
- char* name;
- Widget parent;
- Boolean pop_up_p;
- char* shell_title;
- char* icon_name;
- Boolean text_input_slot;
- Boolean radio_box;
- Boolean list;
- int left_buttons;
- int right_buttons;
- widget_instance *instance;
+make_dialog (char* name,
+ Widget parent,
+ Boolean pop_up_p,
+ char* shell_title,
+ char* icon_name,
+ Boolean text_input_slot,
+ Boolean radio_box,
+ Boolean list,
+ int left_buttons,
+ int right_buttons,
+ widget_instance *instance)
{
Arg av [20];
int ac = 0;
@@ -815,10 +749,6 @@ xaw_generic_callback (Widget widget, XtPointer closure, XtPointer call_data)
id = instance->info->id;
-#if 0
- user_data = NULL;
- XtVaGetValues (widget, XtNuserData, &user_data, NULL);
-#else
/* Damn! Athena doesn't give us a way to hang our own data on the
buttons, so we have to go find it... I guess this assumes that
all instances of a button have the same call data. */
@@ -834,7 +764,6 @@ xaw_generic_callback (Widget widget, XtPointer closure, XtPointer call_data)
if (! val) abort ();
user_data = val->call_data;
}
-#endif
if (instance->info->selection_cb)
instance->info->selection_cb (widget, id, user_data);
@@ -885,106 +814,6 @@ wm_delete_window (Widget w,
}
-/* Scrollbars */
-
-#if 0
-static void
-xaw_scrollbar_scroll (widget, closure, call_data)
- Widget widget;
- XtPointer closure;
- XtPointer call_data;
-{
- widget_instance *instance = (widget_instance *) closure;
- LWLIB_ID id;
- scroll_event event_data;
-
- if (!instance || widget->core.being_destroyed)
- return;
-
- id = instance->info->id;
- event_data.slider_value = 0;
- event_data.time = 0;
-
- if ((int) call_data > 0)
- event_data.action = SCROLLBAR_PAGE_DOWN;
- else
- event_data.action = SCROLLBAR_PAGE_UP;
-
- if (instance->info->pre_activate_cb)
- instance->info->pre_activate_cb (widget, id, (XtPointer) &event_data);
-}
-#endif
-
-#if 0
-static void
-xaw_scrollbar_jump (widget, closure, call_data)
- Widget widget;
- XtPointer closure;
- XtPointer call_data;
-{
- widget_instance *instance = (widget_instance *) closure;
- LWLIB_ID id;
- scroll_event event_data;
- scrollbar_values *val =
- (scrollbar_values *) instance->info->val->scrollbar_data;
- float percent;
-
- if (!instance || widget->core.being_destroyed)
- return;
-
- id = instance->info->id;
-
- percent = * (float *) call_data;
- event_data.slider_value =
- (int) (percent * (float) (val->maximum - val->minimum)) + val->minimum;
-
- event_data.time = 0;
- event_data.action = SCROLLBAR_DRAG;
-
- if (instance->info->pre_activate_cb)
- instance->info->pre_activate_cb (widget, id, (XtPointer) &event_data);
-}
-#endif
-
-static Widget
-xaw_create_scrollbar (widget_instance *instance)
-{
-#if 0
- Arg av[20];
- int ac = 0;
- Dimension width;
- Widget scrollbar;
-
- XtVaGetValues (instance->parent, XtNwidth, &width, NULL);
-
- XtSetArg (av[ac], XtNshowGrip, 0); ac++;
- XtSetArg (av[ac], XtNresizeToPreferred, 1); ac++;
- XtSetArg (av[ac], XtNallowResize, True); ac++;
- XtSetArg (av[ac], XtNskipAdjust, True); ac++;
- XtSetArg (av[ac], XtNwidth, width); ac++;
- XtSetArg (av[ac], XtNmappedWhenManaged, True); ac++;
-
- scrollbar =
- XtCreateWidget (instance->info->name, scrollbarWidgetClass,
- instance->parent, av, ac);
-
- /* We have to force the border width to be 0 otherwise the
- geometry manager likes to start looping for awhile... */
- XtVaSetValues (scrollbar, XtNborderWidth, 0, NULL);
-
- XtRemoveAllCallbacks (scrollbar, "jumpProc");
- XtRemoveAllCallbacks (scrollbar, "scrollProc");
-
- XtAddCallback (scrollbar, "jumpProc", xaw_scrollbar_jump,
- (XtPointer) instance);
- XtAddCallback (scrollbar, "scrollProc", xaw_scrollbar_scroll,
- (XtPointer) instance);
-
- return scrollbar;
-#else
- return NULL;
-#endif
-}
static Widget
xaw_create_main (widget_instance *instance)
@@ -1002,7 +831,6 @@ xaw_create_main (widget_instance *instance)
widget_creation_entry
xaw_creation_table [] =
{
- {"scrollbar", xaw_create_scrollbar},
{"main", xaw_create_main},
{NULL, NULL}
};
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. */
This is sometimes handy to have available. */
void
-x_print_complete_resource_name (widget)
- Widget widget;
+x_print_complete_resource_name (Widget widget)
{
int i;
String names[100];
@@ -223,7 +222,9 @@ xlw_update_one_widget (widget_instance* instance, Widget widget,
}
void
-xlw_update_one_value (widget_instance *instance, Widget widget, widget_value *val)
+xlw_update_one_value (widget_instance *instance,
+ Widget widget,
+ widget_value *val)
{
return;
}
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);
This is sometimes handy to have available. */
void
-x_print_complete_resource_name (widget)
- Widget widget;
+x_print_complete_resource_name (Widget widget)
{
int i;
String names[100];
@@ -168,12 +167,11 @@ x_print_complete_resource_name (widget)
static destroyed_instance *all_destroyed_instances = NULL;
static destroyed_instance*
-make_destroyed_instance (name, type, widget, parent, pop_up_p)
- char* name;
- char* type;
- Widget widget;
- Widget parent;
- Boolean pop_up_p;
+make_destroyed_instance (char* name,
+ char* type,
+ Widget widget,
+ Widget parent,
+ Boolean pop_up_p)
{
destroyed_instance* instance =
(destroyed_instance*)malloc (sizeof (destroyed_instance));
@@ -187,8 +185,7 @@ make_destroyed_instance (name, type, widget, parent, pop_up_p)
}
static void
-free_destroyed_instance (instance)
- destroyed_instance* instance;
+free_destroyed_instance (destroyed_instance* instance)
{
free (instance->name);
free (instance->type);
@@ -197,15 +194,13 @@ free_destroyed_instance (instance)
/* motif utility functions */
Widget
-first_child (widget)
- Widget widget;
+first_child (Widget widget)
{
return ((CompositeWidget)widget)->composite.children [0];
}
Boolean
-lw_motif_widget_p (widget)
- Widget widget;
+lw_motif_widget_p (Widget widget)
{
return
XtClass (widget) == xmDialogShellWidgetClass
@@ -213,9 +208,8 @@ lw_motif_widget_p (widget)
}
static XmString
-resource_motif_string (widget, name)
- Widget widget;
- char* name;
+resource_motif_string (Widget widget,
+ char* name)
{
XtResource resource;
XmString result = 0;
@@ -237,9 +231,8 @@ resource_motif_string (widget, name)
starting with number FIRST_CHILD_TO_DESTROY. */
static void
-destroy_all_children (widget, first_child_to_destroy)
- Widget widget;
- int first_child_to_destroy;
+destroy_all_children (Widget widget,
+ int first_child_to_destroy)
{
Widget* children;
unsigned int number;
@@ -285,9 +278,7 @@ destroy_all_children (widget, first_child_to_destroy)
is called. */
static void
-xm_arm_callback (w, client_data, call_data)
- Widget w;
- XtPointer client_data, call_data;
+xm_arm_callback (Widget w, XtPointer client_data, XtPointer call_data)
{
XmPushButtonCallbackStruct *cbs = (XmPushButtonCallbackStruct *) call_data;
widget_value *wv = (widget_value *) client_data;
@@ -339,10 +330,9 @@ xm_arm_callback (w, client_data, call_data)
not null, and contains the label string to display. */
static void
-xm_update_label (instance, widget, val)
- widget_instance* instance;
- Widget widget;
- widget_value* val;
+xm_update_label (widget_instance* instance,
+ Widget widget,
+ widget_value* val)
{
XmString res_string = 0;
XmString built_string = 0;
@@ -390,10 +380,9 @@ xm_update_label (instance, widget, val)
/* update of list */
static void
-xm_update_list (instance, widget, val)
- widget_instance* instance;
- Widget widget;
- widget_value* val;
+xm_update_list (widget_instance* instance,
+ Widget widget,
+ widget_value* val)
{
widget_value* cur;
int i;
@@ -414,10 +403,9 @@ xm_update_list (instance, widget, val)
/* update of buttons */
static void
-xm_update_pushbutton (instance, widget, val)
- widget_instance* instance;
- Widget widget;
- widget_value* val;
+xm_update_pushbutton (widget_instance* instance,
+ Widget widget,
+ widget_value* val)
{
XtVaSetValues (widget, XmNalignment, XmALIGNMENT_CENTER, NULL);
XtRemoveAllCallbacks (widget, XmNactivateCallback);
@@ -425,10 +413,9 @@ xm_update_pushbutton (instance, widget, val)
}
static void
-xm_update_cascadebutton (instance, widget, val)
- widget_instance* instance;
- Widget widget;
- widget_value* val;
+xm_update_cascadebutton (widget_instance* instance,
+ Widget widget,
+ widget_value* val)
{
/* Should also rebuild the menu by calling ...update_menu... */
XtRemoveAllCallbacks (widget, XmNcascadingCallback);
@@ -438,10 +425,9 @@ xm_update_cascadebutton (instance, widget, val)
/* update toggle and radiobox */
static void
-xm_update_toggle (instance, widget, val)
- widget_instance* instance;
- Widget widget;
- widget_value* val;
+xm_update_toggle (widget_instance* instance,
+ Widget widget,
+ widget_value* val)
{
XtRemoveAllCallbacks (widget, XmNvalueChangedCallback);
XtAddCallback (widget, XmNvalueChangedCallback,
@@ -451,10 +437,9 @@ xm_update_toggle (instance, widget, val)
}
static void
-xm_update_radiobox (instance, widget, val)
- widget_instance* instance;
- Widget widget;
- widget_value* val;
+xm_update_radiobox (widget_instance* instance,
+ Widget widget,
+ widget_value* val)
{
Widget toggle;
@@ -498,11 +483,10 @@ xm_update_radiobox (instance, widget, val)
/* KEEP_FIRST_CHILDREN gives the number of initial children to keep. */
static void
-make_menu_in_widget (instance, widget, val, keep_first_children)
- widget_instance* instance;
- Widget widget;
- widget_value* val;
- int keep_first_children;
+make_menu_in_widget (widget_instance* instance,
+ Widget widget,
+ widget_value* val,
+ int keep_first_children)
{
Widget* children = 0;
int num_children;
@@ -655,11 +639,10 @@ make_menu_in_widget (instance, widget, val, keep_first_children)
}
static void
-update_one_menu_entry (instance, widget, val, deep_p)
- widget_instance* instance;
- Widget widget;
- widget_value* val;
- Boolean deep_p;
+update_one_menu_entry (widget_instance* instance,
+ Widget widget,
+ widget_value* val,
+ Boolean deep_p)
{
Arg al [256];
int ac;
@@ -757,11 +740,10 @@ update_one_menu_entry (instance, widget, val, deep_p)
}
static void
-xm_update_menu (instance, widget, val, deep_p)
- widget_instance* instance;
- Widget widget;
- widget_value* val;
- Boolean deep_p;
+xm_update_menu (widget_instance* instance,
+ Widget widget,
+ widget_value* val,
+ Boolean deep_p)
{
Widget* children;
unsigned int num_children;
@@ -832,10 +814,9 @@ xm_update_menu (instance, widget, val, deep_p)
/* update text widgets */
static void
-xm_update_text (instance, widget, val)
- widget_instance* instance;
- Widget widget;
- widget_value* val;
+xm_update_text (widget_instance* instance,
+ Widget widget,
+ widget_value* val)
{
XmTextSetString (widget, val->value ? val->value : "");
XtRemoveAllCallbacks (widget, XmNactivateCallback);
@@ -846,10 +827,9 @@ xm_update_text (instance, widget, val)
}
static void
-xm_update_text_field (instance, widget, val)
- widget_instance* instance;
- Widget widget;
- widget_value* val;
+xm_update_text_field (widget_instance* instance,
+ Widget widget,
+ widget_value* val)
{
XmTextFieldSetString (widget, val->value ? val->value : "");
XtRemoveAllCallbacks (widget, XmNactivateCallback);
@@ -863,11 +843,10 @@ xm_update_text_field (instance, widget, val)
/* update a motif widget */
void
-xm_update_one_widget (instance, widget, val, deep_p)
- widget_instance* instance;
- Widget widget;
- widget_value* val;
- Boolean deep_p;
+xm_update_one_widget (widget_instance* instance,
+ Widget widget,
+ widget_value* val,
+ Boolean deep_p)
{
WidgetClass class;
@@ -928,10 +907,9 @@ xm_update_one_widget (instance, widget, val, deep_p)
/* getting the value back */
void
-xm_update_one_value (instance, widget, val)
- widget_instance* instance;
- Widget widget;
- widget_value* val;
+xm_update_one_value (widget_instance* instance,
+ Widget widget,
+ widget_value* val)
{
WidgetClass class = XtClass (widget);
widget_value *old_wv;
@@ -1024,10 +1002,9 @@ xm_update_one_value (instance, widget, val)
I could not find a way to do that with accelerators.
*/
static void
-activate_button (widget, closure, call_data)
- Widget widget;
- XtPointer closure;
- XtPointer call_data;
+activate_button (Widget widget,
+ XtPointer closure,
+ XtPointer call_data)
{
Widget button = (Widget)closure;
XtCallCallbacks (button, XmNactivateCallback, NULL);
@@ -1037,11 +1014,10 @@ activate_button (widget, closure, call_data)
/* Called for key press in dialogs. Used to pop down dialog on ESC. */
static void
-dialog_key_cb (widget, closure, event, continue_to_dispatch)
- Widget widget;
- XtPointer closure;
- XEvent *event;
- Boolean *continue_to_dispatch;
+dialog_key_cb (Widget widget,
+ XtPointer closure,
+ XEvent *event,
+ Boolean *continue_to_dispatch)
{
KeySym sym = 0;
Modifiers modif_ret;
@@ -1064,18 +1040,16 @@ dialog_key_cb (widget, closure, event, continue_to_dispatch)
/* dialogs */
static Widget
-make_dialog (name, parent, pop_up_p, shell_title, icon_name, text_input_slot,
- radio_box, list, left_buttons, right_buttons)
- char* name;
- Widget parent;
- Boolean pop_up_p;
- char* shell_title;
- char* icon_name;
- Boolean text_input_slot;
- Boolean radio_box;
- Boolean list;
- int left_buttons;
- int right_buttons;
+make_dialog (char* name,
+ Widget parent,
+ Boolean pop_up_p,
+ char* shell_title,
+ char* icon_name,
+ Boolean text_input_slot,
+ Boolean radio_box,
+ Boolean list,
+ int left_buttons,
+ int right_buttons)
{
Widget result;
Widget form;
@@ -1328,8 +1302,7 @@ make_dialog (name, parent, pop_up_p, shell_title, icon_name, text_input_slot,
}
static destroyed_instance*
-find_matching_instance (instance)
- widget_instance* instance;
+find_matching_instance (widget_instance* instance)
{
destroyed_instance* cur;
destroyed_instance* prev;
@@ -1366,18 +1339,16 @@ find_matching_instance (instance)
}
static void
-mark_dead_instance_destroyed (widget, closure, call_data)
- Widget widget;
- XtPointer closure;
- XtPointer call_data;
+mark_dead_instance_destroyed (Widget widget,
+ XtPointer closure,
+ XtPointer call_data)
{
destroyed_instance* instance = (destroyed_instance*)closure;
instance->widget = NULL;
}
static void
-recenter_widget (widget)
- Widget widget;
+recenter_widget (Widget widget)
{
Widget parent = XtParent (widget);
Screen* screen = XtScreen (widget);
@@ -1413,8 +1384,7 @@ recenter_widget (widget)
}
static Widget
-recycle_instance (instance)
- destroyed_instance* instance;
+recycle_instance (destroyed_instance* instance)
{
Widget widget = instance->widget;
@@ -1450,8 +1420,7 @@ recycle_instance (instance)
}
Widget
-xm_create_dialog (instance)
- widget_instance* instance;
+xm_create_dialog (widget_instance* instance)
{
char* name = instance->info->type;
Widget parent = instance->parent;
@@ -1531,8 +1500,7 @@ xm_create_dialog (instance)
because we have not yet managed to make it work right in Motif. */
static Widget
-make_menubar (instance)
- widget_instance* instance;
+make_menubar (widget_instance* instance)
{
Arg al[3];
int ac;
@@ -1543,18 +1511,16 @@ make_menubar (instance)
}
static void
-remove_grabs (shell, closure, call_data)
- Widget shell;
- XtPointer closure;
- XtPointer call_data;
+remove_grabs (Widget shell,
+ XtPointer closure,
+ XtPointer call_data)
{
Widget menu = (Widget) closure;
XmRemoveFromPostFromList (menu, XtParent (XtParent (menu)));
}
static Widget
-make_popup_menu (instance)
- widget_instance* instance;
+make_popup_menu (widget_instance* instance)
{
Widget parent = instance->parent;
Window parent_window = parent->core.window;
@@ -1570,8 +1536,7 @@ make_popup_menu (instance)
}
static Widget
-make_main (instance)
- widget_instance* instance;
+make_main (widget_instance* instance)
{
Widget parent = instance->parent;
Widget result;
@@ -1710,8 +1675,7 @@ xm_creation_table [] =
/* Destruction of instances */
void
-xm_destroy_instance (instance)
- widget_instance* instance;
+xm_destroy_instance ( widget_instance* instance)
{
Widget widget = instance->widget;
/* recycle the dialog boxes */
@@ -1745,9 +1709,7 @@ xm_destroy_instance (instance)
/* popup utility */
void
-xm_popup_menu (widget, event)
- Widget widget;
- XEvent *event;
+xm_popup_menu (Widget widget, XEvent *event)
{
XButtonPressedEvent dummy;
@@ -1795,8 +1757,7 @@ xm_popup_menu (widget, event)
}
static void
-set_min_dialog_size (w)
- Widget w;
+set_min_dialog_size (Widget w)
{
short width;
short height;
@@ -1805,9 +1766,7 @@ set_min_dialog_size (w)
}
void
-xm_pop_instance (instance, up)
- widget_instance* instance;
- Boolean up;
+xm_pop_instance (widget_instance* instance, Boolean up)
{
Widget widget = instance->widget;
@@ -1836,10 +1795,9 @@ xm_pop_instance (instance, up)
/* motif callback */
static void
-do_call (widget, closure, type)
- Widget widget;
- XtPointer closure;
- enum do_call_type type;
+do_call (Widget widget,
+ XtPointer closure,
+ enum do_call_type type)
{
Arg al [256];
int ac;
@@ -1896,10 +1854,9 @@ do_call (widget, closure, type)
if the widget was ``destroyed'' by caching it in the all_destroyed_instances
list */
static void
-xm_internal_update_other_instances (widget, closure, call_data)
- Widget widget;
- XtPointer closure;
- XtPointer call_data;
+xm_internal_update_other_instances (Widget widget,
+ XtPointer closure,
+ XtPointer call_data)
{
Widget parent;
for (parent = widget; parent; parent = XtParent (parent))
@@ -1911,20 +1868,18 @@ xm_internal_update_other_instances (widget, closure, call_data)
}
static void
-xm_generic_callback (widget, closure, call_data)
- Widget widget;
- XtPointer closure;
- XtPointer call_data;
+xm_generic_callback (Widget widget,
+ XtPointer closure,
+ XtPointer call_data)
{
lw_internal_update_other_instances (widget, closure, call_data);
do_call (widget, closure, selection);
}
static void
-xm_nosel_callback (widget, closure, call_data)
- Widget widget;
- XtPointer closure;
- XtPointer call_data;
+xm_nosel_callback (Widget widget,
+ XtPointer closure,
+ XtPointer call_data)
{
/* This callback is only called when a dialog box is dismissed with
the wm's destroy button (WM_DELETE_WINDOW.) We want the dialog
@@ -1939,10 +1894,9 @@ xm_nosel_callback (widget, closure, call_data)
}
static void
-xm_pull_down_callback (widget, closure, call_data)
- Widget widget;
- XtPointer closure;
- XtPointer call_data;
+xm_pull_down_callback (Widget widget,
+ XtPointer closure,
+ XtPointer call_data)
{
Widget parent = XtParent (widget);
@@ -1963,10 +1917,9 @@ xm_pull_down_callback (widget, closure, call_data)
menu, whether or not its submenu is visible. */
static void
-xm_pop_down_callback (widget, closure, call_data)
- Widget widget;
- XtPointer closure;
- XtPointer call_data;
+xm_pop_down_callback (Widget widget,
+ XtPointer closure,
+ XtPointer call_data)
{
widget_instance *instance = (widget_instance *) closure;
@@ -1978,9 +1931,7 @@ xm_pop_down_callback (widget, closure, call_data)
/* set the keyboard focus */
void
-xm_set_keyboard_focus (parent, w)
- Widget parent;
- Widget w;
+xm_set_keyboard_focus (Widget parent, Widget w)
{
XmProcessTraversal (w, 0);
XtSetKeyboardFocus (parent, w);
@@ -1988,10 +1939,9 @@ xm_set_keyboard_focus (parent, w)
/* Motif hack to set the main window areas. */
void
-xm_set_main_areas (parent, menubar, work_area)
- Widget parent;
- Widget menubar;
- Widget work_area;
+xm_set_main_areas (Widget parent,
+ Widget menubar,
+ Widget work_area)
{
XmMainWindowSetAreas (parent,
menubar, /* menubar (maybe 0) */
@@ -2003,9 +1953,7 @@ xm_set_main_areas (parent, menubar, work_area)
/* Motif hack to control resizing on the menubar. */
void
-xm_manage_resizing (w, flag)
- Widget w;
- Boolean flag;
+xm_manage_resizing (Widget w, Boolean flag)
{
XtVaSetValues (w, XtNallowShellResize, flag, NULL);
}
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
struct _widget_info* next;
} widget_info;
-typedef Widget
-(*widget_creation_function) ();
+typedef Widget (*widget_creation_function) (widget_instance *instance);
typedef struct _widget_creation_entry
{
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)
}
static widget_info *
-allocate_widget_info (type, name, id, val, pre_activate_cb,
- selection_cb, post_activate_cb, highlight_cb)
- char* type;
- char* name;
- LWLIB_ID id;
- widget_value* val;
- lw_callback pre_activate_cb;
- lw_callback selection_cb;
- lw_callback post_activate_cb;
- lw_callback highlight_cb;
+allocate_widget_info (char* type,
+ char* name,
+ LWLIB_ID id,
+ widget_value* val,
+ lw_callback pre_activate_cb,
+ lw_callback selection_cb,
+ lw_callback post_activate_cb,
+ lw_callback highlight_cb)
{
widget_info* info = (widget_info*)malloc (sizeof (widget_info));
info->type = safe_strdup (type);
@@ -431,7 +429,10 @@ safe_strcmp (char *s1, char *s2)
static widget_value *
-merge_widget_value (widget_value *val1, widget_value *val2, int level, int *change_p)
+merge_widget_value (widget_value *val1,
+ widget_value *val2,
+ int level,
+ int *change_p)
{
change_type change, this_one_change;
widget_value* merged_next;
@@ -822,16 +823,14 @@ instantiate_widget_instance (widget_instance *instance)
}
void
-lw_register_widget (type, name, id, val, pre_activate_cb,
- selection_cb, post_activate_cb, highlight_cb)
- char* type;
- char* name;
- LWLIB_ID id;
- widget_value* val;
- lw_callback pre_activate_cb;
- lw_callback selection_cb;
- lw_callback post_activate_cb;
- lw_callback highlight_cb;
+lw_register_widget (char* type,
+ char* name,
+ LWLIB_ID id,
+ widget_value* val,
+ lw_callback pre_activate_cb,
+ lw_callback selection_cb,
+ lw_callback post_activate_cb,
+ lw_callback highlight_cb)
{
if (!get_widget_info (id, False))
allocate_widget_info (type, name, id, val, pre_activate_cb, selection_cb,
@@ -1162,7 +1161,9 @@ static Boolean lwlib_updating;
modified to update other instances of the widgets. Closure should be the
widget_instance. */
void
-lw_internal_update_other_instances (Widget widget, XtPointer closure, XtPointer call_data)
+lw_internal_update_other_instances (Widget widget,
+ XtPointer closure,
+ XtPointer call_data)
{
widget_instance* instance = (widget_instance*)closure;
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[] =
static Boolean XlwMenuSetValues(Widget current, Widget request, Widget new,
ArgList args, Cardinal *num_args);
-static void XlwMenuRealize(Widget w, Mask *valueMask, XSetWindowAttributes *attributes);
+static void XlwMenuRealize(Widget, Mask *, XSetWindowAttributes *);
static void XlwMenuResize(Widget w);
-static void XlwMenuInitialize(Widget request, Widget mw, ArgList args, Cardinal *num_args);
+static void XlwMenuInitialize(Widget, Widget, ArgList, Cardinal *);
static void XlwMenuRedisplay(Widget w, XEvent *ev, Region region);
static void XlwMenuDestroy(Widget w);
static void XlwMenuClassInitialize(void);
@@ -473,15 +473,13 @@ resource_widget_value (XlwMenuWidget mw, widget_value *val)
/* Returns the sizes of an item */
static void
-size_menu_item (mw, val, horizontal_p, label_width, rest_width, button_width,
- height)
- XlwMenuWidget mw;
- widget_value* val;
- int horizontal_p;
- int* label_width;
- int* rest_width;
- int* button_width;
- int* height;
+size_menu_item (XlwMenuWidget mw,
+ widget_value* val,
+ int horizontal_p,
+ int* label_width,
+ int* rest_width,
+ int* button_width,
+ int* height)
{
enum menu_separator separator;
@@ -525,12 +523,12 @@ size_menu_item (mw, val, horizontal_p, label_width, rest_width, button_width,
static void
size_menu (XlwMenuWidget mw, int level)
{
- unsigned int label_width = 0;
+ int label_width = 0;
int rest_width = 0;
int button_width = 0;
int max_rest_width = 0;
int max_button_width = 0;
- unsigned int height = 0;
+ int height = 0;
int horizontal_p = mw->menu.horizontal && (level == 0);
widget_value* val;
window_state* ws;
@@ -589,7 +587,13 @@ size_menu (XlwMenuWidget mw, int level)
/* Display code */
static void
-draw_arrow (XlwMenuWidget mw, Window window, GC gc, int x, int y, int width, int down_p)
+draw_arrow (XlwMenuWidget mw,
+ Window window,
+ GC gc,
+ int x,
+ int y,
+ int width,
+ int down_p)
{
Display *dpy = XtDisplay (mw);
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
static void
-draw_shadow_rectangle (XlwMenuWidget mw, Window window, int x, int y, int width, int height, int erase_p, int down_p)
+draw_shadow_rectangle (XlwMenuWidget mw,
+ Window window,
+ int x,
+ int y,
+ int width,
+ int height,
+ int erase_p,
+ int down_p)
{
Display *dpy = XtDisplay (mw);
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,
static void
-draw_shadow_rhombus (XlwMenuWidget mw, Window window, int x, int y, int width, int height, int erase_p, int down_p)
+draw_shadow_rhombus (XlwMenuWidget mw,
+ Window window,
+ int x,
+ int y,
+ int width,
+ int height,
+ int erase_p,
+ int down_p)
{
Display *dpy = XtDisplay (mw);
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)
separator to draw. TYPE is the separator type. */
static void
-draw_separator (XlwMenuWidget mw, Window window, int x, int y, int width, enum menu_separator type)
+draw_separator (XlwMenuWidget mw,
+ Window window,
+ int x,
+ int y,
+ int width,
+ enum menu_separator type)
{
Display *dpy = XtDisplay (mw);
XGCValues xgcv;
@@ -946,15 +969,13 @@ separator_height (enum menu_separator separator)
the menu item was. */
static void
-display_menu_item (mw, val, ws, where, highlighted_p, horizontal_p,
- just_compute_p)
- XlwMenuWidget mw;
- widget_value* val;
- window_state* ws;
- XPoint* where;
- Boolean highlighted_p;
- Boolean horizontal_p;
- Boolean just_compute_p;
+display_menu_item (XlwMenuWidget mw,
+ widget_value* val,
+ window_state* ws,
+ XPoint* where,
+ Boolean highlighted_p,
+ Boolean horizontal_p,
+ Boolean just_compute_p)
{
GC deco_gc;
GC text_gc;
@@ -1137,7 +1158,12 @@ display_menu_item (mw, val, ws, where, highlighted_p, horizontal_p,
}
static void
-display_menu (XlwMenuWidget mw, int level, Boolean just_compute_p, XPoint *highlighted_pos, XPoint *hit, widget_value **hit_return)
+display_menu (XlwMenuWidget mw,
+ int level,
+ Boolean just_compute_p,
+ XPoint *highlighted_pos,
+ XPoint *hit,
+ widget_value **hit_return)
{
widget_value* val;
widget_value* following_item;
@@ -1345,7 +1371,10 @@ xlwmenu_window_p (Widget w, Window window)
/* Make the window fit in the screen */
static void
-fit_to_screen (XlwMenuWidget mw, window_state *ws, window_state *previous_ws, Boolean horizontal_p)
+fit_to_screen (XlwMenuWidget mw,
+ window_state *ws,
+ window_state *previous_ws,
+ Boolean horizontal_p)
{
unsigned int screen_width = WidthOfScreen (XtScreen (mw));
unsigned int screen_height = HeightOfScreen (XtScreen (mw));
@@ -1519,7 +1548,10 @@ remap_menubar (XlwMenuWidget mw)
}
static Boolean
-motion_event_is_in_menu (XlwMenuWidget mw, XMotionEvent *ev, int level, XPoint *relative_pos)
+motion_event_is_in_menu (XlwMenuWidget mw,
+ XMotionEvent *ev,
+ int level,
+ XPoint *relative_pos)
{
window_state* ws = &mw->menu.windows [level];
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 *
}
static Boolean
-map_event_to_widget_value (XlwMenuWidget mw, XMotionEvent *ev, widget_value **val, int *level)
+map_event_to_widget_value (XlwMenuWidget mw,
+ XMotionEvent *ev,
+ widget_value **val,
+ int *level)
{
int i;
XPoint relative_pos;