Convert function definitions in lwlib files to standard C.
* lwlib/lwlib-Xaw.c: Convert function definitions to standard C. * lwlib/lwlib-Xlw.c: * lwlib/lwlib-utils.c: * lwlib/lwlib.c: * lwlib/lwlib.h: * lwlib/xlwmenu.c: Likewise.
This commit is contained in:
parent
1c027a2427
commit
c3174d16e2
7 changed files with 149 additions and 401 deletions
|
|
@ -1,3 +1,12 @@
|
||||||
|
2010-07-04 Dan Nicolaescu <dann@ics.uci.edu>
|
||||||
|
|
||||||
|
* lwlib-Xaw.c: Convert function definitions to standard C.
|
||||||
|
* lwlib-Xlw.c:
|
||||||
|
* lwlib-utils.c:
|
||||||
|
* lwlib.c:
|
||||||
|
* lwlib.h:
|
||||||
|
* xlwmenu.c: Likewise.
|
||||||
|
|
||||||
2010-07-02 Jan Djärv <jan.h.d@swipnet.se>
|
2010-07-02 Jan Djärv <jan.h.d@swipnet.se>
|
||||||
|
|
||||||
* lwlib-Xm.c: Remove __P and P_ from .c and .m files.
|
* lwlib-Xm.c: Remove __P and P_ from .c and .m files.
|
||||||
|
|
|
||||||
|
|
@ -70,12 +70,11 @@ struct widget_xft_data
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void xaw_generic_callback (/*Widget, XtPointer, XtPointer*/);
|
static void xaw_generic_callback (Widget widget, XtPointer closure, XtPointer call_data);
|
||||||
|
|
||||||
|
|
||||||
Boolean
|
Boolean
|
||||||
lw_xaw_widget_p (widget)
|
lw_xaw_widget_p (Widget widget)
|
||||||
Widget widget;
|
|
||||||
{
|
{
|
||||||
return (XtIsSubclass (widget, scrollbarWidgetClass) ||
|
return (XtIsSubclass (widget, scrollbarWidgetClass) ||
|
||||||
XtIsSubclass (widget, dialogWidgetClass));
|
XtIsSubclass (widget, dialogWidgetClass));
|
||||||
|
|
@ -427,10 +426,7 @@ xaw_update_one_widget (instance, widget, val, deep_p)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
xaw_update_one_value (instance, widget, val)
|
xaw_update_one_value (widget_instance *instance, Widget widget, widget_value *val)
|
||||||
widget_instance *instance;
|
|
||||||
Widget widget;
|
|
||||||
widget_value *val;
|
|
||||||
{
|
{
|
||||||
/* This function is not used by the scrollbars and those are the only
|
/* This function is not used by the scrollbars and those are the only
|
||||||
Athena widget implemented at the moment so do nothing. */
|
Athena widget implemented at the moment so do nothing. */
|
||||||
|
|
@ -438,8 +434,7 @@ xaw_update_one_value (instance, widget, val)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
xaw_destroy_instance (instance)
|
xaw_destroy_instance (widget_instance *instance)
|
||||||
widget_instance *instance;
|
|
||||||
{
|
{
|
||||||
#ifdef HAVE_XFT
|
#ifdef HAVE_XFT
|
||||||
if (instance->xft_data)
|
if (instance->xft_data)
|
||||||
|
|
@ -471,9 +466,7 @@ xaw_destroy_instance (instance)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
xaw_popup_menu (widget, event)
|
xaw_popup_menu (Widget widget, XEvent *event)
|
||||||
Widget widget;
|
|
||||||
XEvent *event;
|
|
||||||
{
|
{
|
||||||
/* An Athena menubar has not been implemented. */
|
/* An Athena menubar has not been implemented. */
|
||||||
return;
|
return;
|
||||||
|
|
@ -557,7 +550,7 @@ static char overrideTrans[] =
|
||||||
/* Dialogs pop down on any key press */
|
/* Dialogs pop down on any key press */
|
||||||
static char dialogOverride[] =
|
static char dialogOverride[] =
|
||||||
"<KeyPress>Escape: lwlib_delete_dialog()";
|
"<KeyPress>Escape: lwlib_delete_dialog()";
|
||||||
static void wm_delete_window();
|
static void wm_delete_window(Widget w, XtPointer closure, XtPointer call_data);
|
||||||
static XtActionsRec xaw_actions [] = {
|
static XtActionsRec xaw_actions [] = {
|
||||||
{"lwlib_delete_dialog", wm_delete_window}
|
{"lwlib_delete_dialog", wm_delete_window}
|
||||||
};
|
};
|
||||||
|
|
@ -748,8 +741,7 @@ make_dialog (name, parent, pop_up_p, shell_title, icon_name, text_input_slot,
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget
|
Widget
|
||||||
xaw_create_dialog (instance)
|
xaw_create_dialog (widget_instance *instance)
|
||||||
widget_instance* instance;
|
|
||||||
{
|
{
|
||||||
char *name = instance->info->type;
|
char *name = instance->info->type;
|
||||||
Widget parent = instance->parent;
|
Widget parent = instance->parent;
|
||||||
|
|
@ -813,10 +805,7 @@ xaw_create_dialog (instance)
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
xaw_generic_callback (widget, closure, call_data)
|
xaw_generic_callback (Widget widget, XtPointer closure, XtPointer call_data)
|
||||||
Widget widget;
|
|
||||||
XtPointer closure;
|
|
||||||
XtPointer call_data;
|
|
||||||
{
|
{
|
||||||
widget_instance *instance = (widget_instance *) closure;
|
widget_instance *instance = (widget_instance *) closure;
|
||||||
Widget instance_widget;
|
Widget instance_widget;
|
||||||
|
|
@ -862,10 +851,7 @@ xaw_generic_callback (widget, closure, call_data)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
wm_delete_window (w, closure, call_data)
|
wm_delete_window (Widget w, XtPointer closure, XtPointer call_data)
|
||||||
Widget w;
|
|
||||||
XtPointer closure;
|
|
||||||
XtPointer call_data;
|
|
||||||
{
|
{
|
||||||
LWLIB_ID id;
|
LWLIB_ID id;
|
||||||
Cardinal nkids;
|
Cardinal nkids;
|
||||||
|
|
@ -966,8 +952,7 @@ xaw_scrollbar_jump (widget, closure, call_data)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static Widget
|
static Widget
|
||||||
xaw_create_scrollbar (instance)
|
xaw_create_scrollbar (widget_instance *instance)
|
||||||
widget_instance *instance;
|
|
||||||
{
|
{
|
||||||
#if 0
|
#if 0
|
||||||
Arg av[20];
|
Arg av[20];
|
||||||
|
|
@ -1007,8 +992,7 @@ xaw_create_scrollbar (instance)
|
||||||
}
|
}
|
||||||
|
|
||||||
static Widget
|
static Widget
|
||||||
xaw_create_main (instance)
|
xaw_create_main (widget_instance *instance)
|
||||||
widget_instance *instance;
|
|
||||||
{
|
{
|
||||||
Arg al[1];
|
Arg al[1];
|
||||||
int ac;
|
int ac;
|
||||||
|
|
|
||||||
|
|
@ -72,10 +72,7 @@ x_print_complete_resource_name (widget)
|
||||||
if there isn't any highlighted menu item. */
|
if there isn't any highlighted menu item. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
highlight_hook (w, client_data, call_data)
|
highlight_hook (Widget w, XtPointer client_data, XtPointer call_data)
|
||||||
Widget w;
|
|
||||||
XtPointer client_data;
|
|
||||||
XtPointer call_data;
|
|
||||||
{
|
{
|
||||||
widget_instance *instance = (widget_instance *) client_data;
|
widget_instance *instance = (widget_instance *) client_data;
|
||||||
|
|
||||||
|
|
@ -85,29 +82,20 @@ highlight_hook (w, client_data, call_data)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
enter_hook (w, client_data, call_data)
|
enter_hook (Widget w, XtPointer client_data, XtPointer call_data)
|
||||||
Widget w;
|
|
||||||
XtPointer client_data;
|
|
||||||
XtPointer call_data;
|
|
||||||
{
|
{
|
||||||
highlight_hook (w, client_data, call_data);
|
highlight_hook (w, client_data, call_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
leave_hook (w, client_data, call_data)
|
leave_hook (Widget w, XtPointer client_data, XtPointer call_data)
|
||||||
Widget w;
|
|
||||||
XtPointer client_data;
|
|
||||||
XtPointer call_data;
|
|
||||||
{
|
{
|
||||||
highlight_hook (w, client_data, NULL);
|
highlight_hook (w, client_data, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
pre_hook (w, client_data, call_data)
|
pre_hook (Widget w, XtPointer client_data, XtPointer call_data)
|
||||||
Widget w;
|
|
||||||
XtPointer client_data;
|
|
||||||
XtPointer call_data;
|
|
||||||
{
|
{
|
||||||
widget_instance* instance = (widget_instance*)client_data;
|
widget_instance* instance = (widget_instance*)client_data;
|
||||||
widget_value* val;
|
widget_value* val;
|
||||||
|
|
@ -122,10 +110,7 @@ pre_hook (w, client_data, call_data)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
pick_hook (w, client_data, call_data)
|
pick_hook (Widget w, XtPointer client_data, XtPointer call_data)
|
||||||
Widget w;
|
|
||||||
XtPointer client_data;
|
|
||||||
XtPointer call_data;
|
|
||||||
{
|
{
|
||||||
widget_instance* instance = (widget_instance*)client_data;
|
widget_instance* instance = (widget_instance*)client_data;
|
||||||
widget_value* contents_val = (widget_value*)call_data;
|
widget_value* contents_val = (widget_value*)call_data;
|
||||||
|
|
@ -150,8 +135,7 @@ pick_hook (w, client_data, call_data)
|
||||||
/* creation functions */
|
/* creation functions */
|
||||||
|
|
||||||
static Widget
|
static Widget
|
||||||
xlw_create_menubar (instance)
|
xlw_create_menubar (widget_instance *instance)
|
||||||
widget_instance* instance;
|
|
||||||
{
|
{
|
||||||
Widget widget;
|
Widget widget;
|
||||||
Arg al[5];
|
Arg al[5];
|
||||||
|
|
@ -178,8 +162,7 @@ xlw_create_menubar (instance)
|
||||||
}
|
}
|
||||||
|
|
||||||
static Widget
|
static Widget
|
||||||
xlw_create_popup_menu (instance)
|
xlw_create_popup_menu (widget_instance *instance)
|
||||||
widget_instance* instance;
|
|
||||||
{
|
{
|
||||||
Widget popup_shell
|
Widget popup_shell
|
||||||
= XtCreatePopupShell (instance->info->name, overrideShellWidgetClass,
|
= XtCreatePopupShell (instance->info->name, overrideShellWidgetClass,
|
||||||
|
|
@ -214,8 +197,7 @@ xlw_creation_table [] =
|
||||||
};
|
};
|
||||||
|
|
||||||
Boolean
|
Boolean
|
||||||
lw_lucid_widget_p (widget)
|
lw_lucid_widget_p (Widget widget)
|
||||||
Widget widget;
|
|
||||||
{
|
{
|
||||||
WidgetClass the_class = XtClass (widget);
|
WidgetClass the_class = XtClass (widget);
|
||||||
|
|
||||||
|
|
@ -249,10 +231,7 @@ xlw_update_one_widget (instance, widget, val, deep_p)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
xlw_update_one_value (instance, widget, val)
|
xlw_update_one_value (widget_instance *instance, Widget widget, widget_value *val)
|
||||||
widget_instance* instance;
|
|
||||||
Widget widget;
|
|
||||||
widget_value* val;
|
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -269,9 +248,7 @@ xlw_pop_instance (instance, up)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
xlw_popup_menu (widget, event)
|
xlw_popup_menu (Widget widget, XEvent *event)
|
||||||
Widget widget;
|
|
||||||
XEvent *event;
|
|
||||||
{
|
{
|
||||||
XlwMenuWidget mw;
|
XlwMenuWidget mw;
|
||||||
|
|
||||||
|
|
@ -304,8 +281,7 @@ xlw_popup_menu (widget, event)
|
||||||
|
|
||||||
/* Destruction of instances */
|
/* Destruction of instances */
|
||||||
void
|
void
|
||||||
xlw_destroy_instance (instance)
|
xlw_destroy_instance (widget_instance *instance)
|
||||||
widget_instance* instance;
|
|
||||||
{
|
{
|
||||||
if (instance->widget)
|
if (instance->widget)
|
||||||
XtDestroyWidget (instance->widget);
|
XtDestroyWidget (instance->widget);
|
||||||
|
|
|
||||||
|
|
@ -42,8 +42,7 @@ Boston, MA 02110-1301, USA. */
|
||||||
|
|
||||||
/* Redisplay the contents of the widget, without first clearing it. */
|
/* Redisplay the contents of the widget, without first clearing it. */
|
||||||
void
|
void
|
||||||
XtNoClearRefreshWidget (widget)
|
XtNoClearRefreshWidget (Widget widget)
|
||||||
Widget widget;
|
|
||||||
{
|
{
|
||||||
XEvent event;
|
XEvent event;
|
||||||
|
|
||||||
|
|
@ -67,10 +66,7 @@ XtNoClearRefreshWidget (widget)
|
||||||
* Apply a function to all the subwidgets of a given widget recursively.
|
* Apply a function to all the subwidgets of a given widget recursively.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
XtApplyToWidgets (w, proc, arg)
|
XtApplyToWidgets (Widget w, XtApplyToWidgetsProc proc, XtPointer arg)
|
||||||
Widget w;
|
|
||||||
XtApplyToWidgetsProc proc;
|
|
||||||
XtPointer arg;
|
|
||||||
{
|
{
|
||||||
if (XtIsComposite (w))
|
if (XtIsComposite (w))
|
||||||
{
|
{
|
||||||
|
|
@ -101,10 +97,7 @@ XtApplyToWidgets (w, proc, arg)
|
||||||
* Stop as soon as the function returns non NULL and returns this as a value.
|
* Stop as soon as the function returns non NULL and returns this as a value.
|
||||||
*/
|
*/
|
||||||
void *
|
void *
|
||||||
XtApplyUntilToWidgets (w, proc, arg)
|
XtApplyUntilToWidgets (Widget w, XtApplyUntilToWidgetsProc proc, XtPointer arg)
|
||||||
Widget w;
|
|
||||||
XtApplyUntilToWidgetsProc proc;
|
|
||||||
XtPointer arg;
|
|
||||||
{
|
{
|
||||||
void* result;
|
void* result;
|
||||||
if (XtIsComposite (w))
|
if (XtIsComposite (w))
|
||||||
|
|
@ -130,9 +123,7 @@ XtApplyUntilToWidgets (w, proc, arg)
|
||||||
* Returns a copy of the list of all children of a composite widget
|
* Returns a copy of the list of all children of a composite widget
|
||||||
*/
|
*/
|
||||||
Widget *
|
Widget *
|
||||||
XtCompositeChildren (widget, number)
|
XtCompositeChildren (Widget widget, unsigned int *number)
|
||||||
Widget widget;
|
|
||||||
unsigned int* number;
|
|
||||||
{
|
{
|
||||||
CompositeWidget cw = (CompositeWidget)widget;
|
CompositeWidget cw = (CompositeWidget)widget;
|
||||||
Widget* result;
|
Widget* result;
|
||||||
|
|
@ -153,15 +144,13 @@ XtCompositeChildren (widget, number)
|
||||||
}
|
}
|
||||||
|
|
||||||
Boolean
|
Boolean
|
||||||
XtWidgetBeingDestroyedP (widget)
|
XtWidgetBeingDestroyedP (Widget widget)
|
||||||
Widget widget;
|
|
||||||
{
|
{
|
||||||
return widget->core.being_destroyed;
|
return widget->core.being_destroyed;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
XtSafelyDestroyWidget (widget)
|
XtSafelyDestroyWidget (Widget widget)
|
||||||
Widget widget;
|
|
||||||
{
|
{
|
||||||
#if 0
|
#if 0
|
||||||
|
|
||||||
|
|
|
||||||
141
lwlib/lwlib.c
141
lwlib/lwlib.c
|
|
@ -106,10 +106,7 @@ static Boolean get_one_value (widget_instance *, widget_value *);
|
||||||
static void show_one_widget_busy (Widget, Boolean);
|
static void show_one_widget_busy (Widget, Boolean);
|
||||||
|
|
||||||
void
|
void
|
||||||
lwlib_memset (address, value, length)
|
lwlib_memset (char *address, int value, size_t length)
|
||||||
char *address;
|
|
||||||
int value;
|
|
||||||
size_t length;
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
@ -118,10 +115,7 @@ lwlib_memset (address, value, length)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
lwlib_bcopy (from, to, length)
|
lwlib_bcopy (char *from, char *to, int length)
|
||||||
char *from;
|
|
||||||
char *to;
|
|
||||||
int length;
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
@ -130,8 +124,7 @@ lwlib_bcopy (from, to, length)
|
||||||
}
|
}
|
||||||
/* utility functions for widget_instance and widget_info */
|
/* utility functions for widget_instance and widget_info */
|
||||||
char *
|
char *
|
||||||
safe_strdup (s)
|
safe_strdup (const char *s)
|
||||||
const char *s;
|
|
||||||
{
|
{
|
||||||
char *result;
|
char *result;
|
||||||
if (! s) return 0;
|
if (! s) return 0;
|
||||||
|
|
@ -145,8 +138,7 @@ safe_strdup (s)
|
||||||
/* Like strcmp but ignore differences in case. */
|
/* Like strcmp but ignore differences in case. */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
my_strcasecmp (s1, s2)
|
my_strcasecmp (char *s1, char *s2)
|
||||||
char *s1, *s2;
|
|
||||||
{
|
{
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
|
|
@ -164,8 +156,7 @@ my_strcasecmp (s1, s2)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
safe_free_str (s)
|
safe_free_str (char *s)
|
||||||
char *s;
|
|
||||||
{
|
{
|
||||||
free (s);
|
free (s);
|
||||||
}
|
}
|
||||||
|
|
@ -174,7 +165,7 @@ static widget_value *widget_value_free_list = 0;
|
||||||
static int malloc_cpt = 0;
|
static int malloc_cpt = 0;
|
||||||
|
|
||||||
widget_value *
|
widget_value *
|
||||||
malloc_widget_value ()
|
malloc_widget_value (void)
|
||||||
{
|
{
|
||||||
widget_value *wv;
|
widget_value *wv;
|
||||||
if (widget_value_free_list)
|
if (widget_value_free_list)
|
||||||
|
|
@ -196,8 +187,7 @@ malloc_widget_value ()
|
||||||
by malloc_widget_value(), and no substructures.
|
by malloc_widget_value(), and no substructures.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
free_widget_value (wv)
|
free_widget_value (widget_value *wv)
|
||||||
widget_value *wv;
|
|
||||||
{
|
{
|
||||||
if (wv->free_list)
|
if (wv->free_list)
|
||||||
abort ();
|
abort ();
|
||||||
|
|
@ -217,8 +207,7 @@ free_widget_value (wv)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
free_widget_value_tree (wv)
|
free_widget_value_tree (widget_value *wv)
|
||||||
widget_value *wv;
|
|
||||||
{
|
{
|
||||||
if (!wv)
|
if (!wv)
|
||||||
return;
|
return;
|
||||||
|
|
@ -249,9 +238,7 @@ free_widget_value_tree (wv)
|
||||||
}
|
}
|
||||||
|
|
||||||
static widget_value *
|
static widget_value *
|
||||||
copy_widget_value_tree (val, change)
|
copy_widget_value_tree (widget_value *val, change_type change)
|
||||||
widget_value* val;
|
|
||||||
change_type change;
|
|
||||||
{
|
{
|
||||||
widget_value* copy;
|
widget_value* copy;
|
||||||
|
|
||||||
|
|
@ -310,8 +297,7 @@ allocate_widget_info (type, name, id, val, pre_activate_cb,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
free_widget_info (info)
|
free_widget_info (widget_info *info)
|
||||||
widget_info* info;
|
|
||||||
{
|
{
|
||||||
safe_free_str (info->type);
|
safe_free_str (info->type);
|
||||||
safe_free_str (info->name);
|
safe_free_str (info->name);
|
||||||
|
|
@ -321,10 +307,7 @@ free_widget_info (info)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mark_widget_destroyed (widget, closure, call_data)
|
mark_widget_destroyed (Widget widget, XtPointer closure, XtPointer call_data)
|
||||||
Widget widget;
|
|
||||||
XtPointer closure;
|
|
||||||
XtPointer call_data;
|
|
||||||
{
|
{
|
||||||
widget_instance* instance = (widget_instance*)closure;
|
widget_instance* instance = (widget_instance*)closure;
|
||||||
|
|
||||||
|
|
@ -363,8 +346,7 @@ allocate_widget_instance (info, parent, pop_up_p)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
free_widget_instance (instance)
|
free_widget_instance (widget_instance *instance)
|
||||||
widget_instance* instance;
|
|
||||||
{
|
{
|
||||||
lwlib_memset ((void*)instance, 0xDEADBEEF, sizeof (widget_instance));
|
lwlib_memset ((void*)instance, 0xDEADBEEF, sizeof (widget_instance));
|
||||||
free (instance);
|
free (instance);
|
||||||
|
|
@ -401,8 +383,7 @@ get_widget_info (id, remove_p)
|
||||||
/* Internal function used by the library dependent implementation to get the
|
/* Internal function used by the library dependent implementation to get the
|
||||||
widget_value for a given widget in an instance */
|
widget_value for a given widget in an instance */
|
||||||
widget_info *
|
widget_info *
|
||||||
lw_get_widget_info (id)
|
lw_get_widget_info (LWLIB_ID id)
|
||||||
LWLIB_ID id;
|
|
||||||
{
|
{
|
||||||
return get_widget_info (id, 0);
|
return get_widget_info (id, 0);
|
||||||
}
|
}
|
||||||
|
|
@ -441,8 +422,7 @@ get_widget_instance (widget, remove_p)
|
||||||
WIDGET, or null if WIDGET is not a lwlib widget. */
|
WIDGET, or null if WIDGET is not a lwlib widget. */
|
||||||
|
|
||||||
widget_instance *
|
widget_instance *
|
||||||
lw_get_widget_instance (widget)
|
lw_get_widget_instance (Widget widget)
|
||||||
Widget widget;
|
|
||||||
{
|
{
|
||||||
return get_widget_instance (widget, False);
|
return get_widget_instance (widget, False);
|
||||||
}
|
}
|
||||||
|
|
@ -471,9 +451,7 @@ find_instance (id, parent, pop_up_p)
|
||||||
|
|
||||||
/* utility function for widget_value */
|
/* utility function for widget_value */
|
||||||
static Boolean
|
static Boolean
|
||||||
safe_strcmp (s1, s2)
|
safe_strcmp (char *s1, char *s2)
|
||||||
char* s1;
|
|
||||||
char* s2;
|
|
||||||
{
|
{
|
||||||
if (!!s1 ^ !!s2) return True;
|
if (!!s1 ^ !!s2) return True;
|
||||||
return (s1 && s2) ? strcmp (s1, s2) : s1 ? False : !!s2;
|
return (s1 && s2) ? strcmp (s1, s2) : s1 ? False : !!s2;
|
||||||
|
|
@ -500,11 +478,7 @@ safe_strcmp (s1, s2)
|
||||||
|
|
||||||
|
|
||||||
static widget_value *
|
static widget_value *
|
||||||
merge_widget_value (val1, val2, level, change_p)
|
merge_widget_value (widget_value *val1, widget_value *val2, int level, int *change_p)
|
||||||
widget_value* val1;
|
|
||||||
widget_value* val2;
|
|
||||||
int level;
|
|
||||||
int *change_p;
|
|
||||||
{
|
{
|
||||||
change_type change, this_one_change;
|
change_type change, this_one_change;
|
||||||
widget_value* merged_next;
|
widget_value* merged_next;
|
||||||
|
|
@ -658,9 +632,7 @@ merge_widget_value (val1, val2, level, change_p)
|
||||||
|
|
||||||
/* modifying the widgets */
|
/* modifying the widgets */
|
||||||
static Widget
|
static Widget
|
||||||
name_to_widget (instance, name)
|
name_to_widget (widget_instance *instance, char *name)
|
||||||
widget_instance* instance;
|
|
||||||
char* name;
|
|
||||||
{
|
{
|
||||||
Widget widget = NULL;
|
Widget widget = NULL;
|
||||||
|
|
||||||
|
|
@ -814,8 +786,7 @@ lw_modify_all_widgets (id, val, deep_p)
|
||||||
/* creating the widgets */
|
/* creating the widgets */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
initialize_widget_instance (instance)
|
initialize_widget_instance (widget_instance *instance)
|
||||||
widget_instance* instance;
|
|
||||||
{
|
{
|
||||||
widget_value* val;
|
widget_value* val;
|
||||||
|
|
||||||
|
|
@ -830,9 +801,7 @@ initialize_widget_instance (instance)
|
||||||
|
|
||||||
|
|
||||||
static widget_creation_function
|
static widget_creation_function
|
||||||
find_in_table (type, table)
|
find_in_table (char *type, widget_creation_entry *table)
|
||||||
char* type;
|
|
||||||
widget_creation_entry* table;
|
|
||||||
{
|
{
|
||||||
widget_creation_entry* cur;
|
widget_creation_entry* cur;
|
||||||
for (cur = table; cur->type; cur++)
|
for (cur = table; cur->type; cur++)
|
||||||
|
|
@ -842,8 +811,7 @@ find_in_table (type, table)
|
||||||
}
|
}
|
||||||
|
|
||||||
static Boolean
|
static Boolean
|
||||||
dialog_spec_p (name)
|
dialog_spec_p (char *name)
|
||||||
char* name;
|
|
||||||
{
|
{
|
||||||
/* return True if name matches [EILPQeilpq][1-9][Bb] or
|
/* return True if name matches [EILPQeilpq][1-9][Bb] or
|
||||||
[EILPQeilpq][1-9][Bb][Rr][1-9] */
|
[EILPQeilpq][1-9][Bb][Rr][1-9] */
|
||||||
|
|
@ -876,8 +844,7 @@ dialog_spec_p (name)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
instantiate_widget_instance (instance)
|
instantiate_widget_instance (widget_instance *instance)
|
||||||
widget_instance* instance;
|
|
||||||
{
|
{
|
||||||
widget_creation_function function = NULL;
|
widget_creation_function function = NULL;
|
||||||
|
|
||||||
|
|
@ -1016,8 +983,7 @@ lw_create_widget (type, name, id, val, parent, pop_up_p, pre_activate_cb,
|
||||||
|
|
||||||
/* destroying the widgets */
|
/* destroying the widgets */
|
||||||
static void
|
static void
|
||||||
destroy_one_instance (instance)
|
destroy_one_instance (widget_instance *instance)
|
||||||
widget_instance* instance;
|
|
||||||
{
|
{
|
||||||
/* Remove the destroy callback on the widget; that callback will try to
|
/* Remove the destroy callback on the widget; that callback will try to
|
||||||
dereference the instance object (to set its widget slot to 0, since the
|
dereference the instance object (to set its widget slot to 0, since the
|
||||||
|
|
@ -1059,8 +1025,7 @@ destroy_one_instance (instance)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
lw_destroy_widget (w)
|
lw_destroy_widget (Widget w)
|
||||||
Widget w;
|
|
||||||
{
|
{
|
||||||
widget_instance* instance = get_widget_instance (w, True);
|
widget_instance* instance = get_widget_instance (w, True);
|
||||||
|
|
||||||
|
|
@ -1076,8 +1041,7 @@ lw_destroy_widget (w)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
lw_destroy_all_widgets (id)
|
lw_destroy_all_widgets (LWLIB_ID id)
|
||||||
LWLIB_ID id;
|
|
||||||
{
|
{
|
||||||
widget_info* info = get_widget_info (id, True);
|
widget_info* info = get_widget_info (id, True);
|
||||||
widget_instance* instance;
|
widget_instance* instance;
|
||||||
|
|
@ -1096,14 +1060,14 @@ lw_destroy_all_widgets (id)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
lw_destroy_everything ()
|
lw_destroy_everything (void)
|
||||||
{
|
{
|
||||||
while (all_widget_info)
|
while (all_widget_info)
|
||||||
lw_destroy_all_widgets (all_widget_info->id);
|
lw_destroy_all_widgets (all_widget_info->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
lw_destroy_all_pop_ups ()
|
lw_destroy_all_pop_ups (void)
|
||||||
{
|
{
|
||||||
widget_info* info;
|
widget_info* info;
|
||||||
widget_info* next;
|
widget_info* next;
|
||||||
|
|
@ -1123,7 +1087,7 @@ extern Widget first_child (/* Widget */); /* garbage */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Widget
|
Widget
|
||||||
lw_raise_all_pop_up_widgets ()
|
lw_raise_all_pop_up_widgets (void)
|
||||||
{
|
{
|
||||||
widget_info* info;
|
widget_info* info;
|
||||||
widget_instance* instance;
|
widget_instance* instance;
|
||||||
|
|
@ -1197,23 +1161,19 @@ lw_pop_all_widgets (id, up)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
lw_pop_up_all_widgets (id)
|
lw_pop_up_all_widgets (LWLIB_ID id)
|
||||||
LWLIB_ID id;
|
|
||||||
{
|
{
|
||||||
lw_pop_all_widgets (id, True);
|
lw_pop_all_widgets (id, True);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
lw_pop_down_all_widgets (id)
|
lw_pop_down_all_widgets (LWLIB_ID id)
|
||||||
LWLIB_ID id;
|
|
||||||
{
|
{
|
||||||
lw_pop_all_widgets (id, False);
|
lw_pop_all_widgets (id, False);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
lw_popup_menu (widget, event)
|
lw_popup_menu (Widget widget, XEvent *event)
|
||||||
Widget widget;
|
|
||||||
XEvent *event;
|
|
||||||
{
|
{
|
||||||
#if defined (USE_LUCID)
|
#if defined (USE_LUCID)
|
||||||
if (lw_lucid_widget_p (widget))
|
if (lw_lucid_widget_p (widget))
|
||||||
|
|
@ -1231,9 +1191,7 @@ lw_popup_menu (widget, event)
|
||||||
|
|
||||||
/* get the values back */
|
/* get the values back */
|
||||||
static Boolean
|
static Boolean
|
||||||
get_one_value (instance, val)
|
get_one_value (widget_instance *instance, widget_value *val)
|
||||||
widget_instance* instance;
|
|
||||||
widget_value* val;
|
|
||||||
{
|
{
|
||||||
Widget widget = name_to_widget (instance, val->name);
|
Widget widget = name_to_widget (instance, val->name);
|
||||||
|
|
||||||
|
|
@ -1258,9 +1216,7 @@ get_one_value (instance, val)
|
||||||
}
|
}
|
||||||
|
|
||||||
Boolean
|
Boolean
|
||||||
lw_get_some_values (id, val_out)
|
lw_get_some_values (LWLIB_ID id, widget_value *val_out)
|
||||||
LWLIB_ID id;
|
|
||||||
widget_value* val_out;
|
|
||||||
{
|
{
|
||||||
widget_info* info = get_widget_info (id, False);
|
widget_info* info = get_widget_info (id, False);
|
||||||
widget_instance* instance;
|
widget_instance* instance;
|
||||||
|
|
@ -1282,8 +1238,7 @@ lw_get_some_values (id, val_out)
|
||||||
}
|
}
|
||||||
|
|
||||||
widget_value*
|
widget_value*
|
||||||
lw_get_all_values (id)
|
lw_get_all_values (LWLIB_ID id)
|
||||||
LWLIB_ID id;
|
|
||||||
{
|
{
|
||||||
widget_info* info = get_widget_info (id, False);
|
widget_info* info = get_widget_info (id, False);
|
||||||
widget_value* val = info->val;
|
widget_value* val = info->val;
|
||||||
|
|
@ -1296,9 +1251,7 @@ lw_get_all_values (id)
|
||||||
/* internal function used by the library dependent implementation to get the
|
/* internal function used by the library dependent implementation to get the
|
||||||
widget_value for a given widget in an instance */
|
widget_value for a given widget in an instance */
|
||||||
widget_value*
|
widget_value*
|
||||||
lw_get_widget_value_for_widget (instance, w)
|
lw_get_widget_value_for_widget (widget_instance *instance, Widget w)
|
||||||
widget_instance* instance;
|
|
||||||
Widget w;
|
|
||||||
{
|
{
|
||||||
char* name = XtName (w);
|
char* name = XtName (w);
|
||||||
widget_value* cur;
|
widget_value* cur;
|
||||||
|
|
@ -1317,10 +1270,7 @@ static Boolean lwlib_updating;
|
||||||
modified to update other instances of the widgets. Closure should be the
|
modified to update other instances of the widgets. Closure should be the
|
||||||
widget_instance. */
|
widget_instance. */
|
||||||
void
|
void
|
||||||
lw_internal_update_other_instances (widget, closure, call_data)
|
lw_internal_update_other_instances (Widget widget, XtPointer closure, XtPointer call_data)
|
||||||
Widget widget;
|
|
||||||
XtPointer closure;
|
|
||||||
XtPointer call_data;
|
|
||||||
{
|
{
|
||||||
widget_instance* instance = (widget_instance*)closure;
|
widget_instance* instance = (widget_instance*)closure;
|
||||||
char* name = XtName (widget);
|
char* name = XtName (widget);
|
||||||
|
|
@ -1357,8 +1307,7 @@ lw_internal_update_other_instances (widget, closure, call_data)
|
||||||
/* get the id */
|
/* get the id */
|
||||||
|
|
||||||
LWLIB_ID
|
LWLIB_ID
|
||||||
lw_get_widget_id (w)
|
lw_get_widget_id (Widget w)
|
||||||
Widget w;
|
|
||||||
{
|
{
|
||||||
widget_instance* instance = get_widget_instance (w, False);
|
widget_instance* instance = get_widget_instance (w, False);
|
||||||
|
|
||||||
|
|
@ -1367,9 +1316,7 @@ lw_get_widget_id (w)
|
||||||
|
|
||||||
/* set the keyboard focus */
|
/* set the keyboard focus */
|
||||||
void
|
void
|
||||||
lw_set_keyboard_focus (parent, w)
|
lw_set_keyboard_focus (Widget parent, Widget w)
|
||||||
Widget parent;
|
|
||||||
Widget w;
|
|
||||||
{
|
{
|
||||||
#if defined (USE_MOTIF)
|
#if defined (USE_MOTIF)
|
||||||
xm_set_keyboard_focus (parent, w);
|
xm_set_keyboard_focus (parent, w);
|
||||||
|
|
@ -1455,9 +1402,7 @@ lw_refigure_widget (w, doit)
|
||||||
/* Toolkit independent way of determining if an event window is in the
|
/* Toolkit independent way of determining if an event window is in the
|
||||||
menubar. */
|
menubar. */
|
||||||
Boolean
|
Boolean
|
||||||
lw_window_is_in_menubar (win, menubar_widget)
|
lw_window_is_in_menubar (Window win, Widget menubar_widget)
|
||||||
Window win;
|
|
||||||
Widget menubar_widget;
|
|
||||||
{
|
{
|
||||||
return menubar_widget
|
return menubar_widget
|
||||||
#if defined (USE_LUCID)
|
#if defined (USE_LUCID)
|
||||||
|
|
@ -1473,10 +1418,7 @@ lw_window_is_in_menubar (win, menubar_widget)
|
||||||
|
|
||||||
/* Motif hack to set the main window areas. */
|
/* Motif hack to set the main window areas. */
|
||||||
void
|
void
|
||||||
lw_set_main_areas (parent, menubar, work_area)
|
lw_set_main_areas (Widget parent, Widget menubar, Widget work_area)
|
||||||
Widget parent;
|
|
||||||
Widget menubar;
|
|
||||||
Widget work_area;
|
|
||||||
{
|
{
|
||||||
#if defined (USE_MOTIF)
|
#if defined (USE_MOTIF)
|
||||||
xm_set_main_areas (parent, menubar, work_area);
|
xm_set_main_areas (parent, menubar, work_area);
|
||||||
|
|
@ -1506,10 +1448,7 @@ lw_allow_resizing (w, flag)
|
||||||
to similar ones that are supported. */
|
to similar ones that are supported. */
|
||||||
|
|
||||||
int
|
int
|
||||||
lw_separator_p (label, type, motif_p)
|
lw_separator_p (char *label, enum menu_separator *type, int motif_p)
|
||||||
char *label;
|
|
||||||
enum menu_separator *type;
|
|
||||||
int motif_p;
|
|
||||||
{
|
{
|
||||||
int separator_p = 0;
|
int separator_p = 0;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -156,7 +156,7 @@ widget_value* lw_get_all_values (LWLIB_ID id);
|
||||||
Boolean lw_get_some_values (LWLIB_ID id, widget_value* val);
|
Boolean lw_get_some_values (LWLIB_ID id, widget_value* val);
|
||||||
void lw_pop_up_all_widgets (LWLIB_ID id);
|
void lw_pop_up_all_widgets (LWLIB_ID id);
|
||||||
void lw_pop_down_all_widgets (LWLIB_ID id);
|
void lw_pop_down_all_widgets (LWLIB_ID id);
|
||||||
widget_value *malloc_widget_value ();
|
widget_value *malloc_widget_value (void);
|
||||||
void free_widget_value (widget_value *);
|
void free_widget_value (widget_value *);
|
||||||
void lw_popup_menu (Widget, XEvent *);
|
void lw_popup_menu (Widget, XEvent *);
|
||||||
|
|
||||||
|
|
|
||||||
291
lwlib/xlwmenu.c
291
lwlib/xlwmenu.c
|
|
@ -185,22 +185,22 @@ xlwMenuResources[] =
|
||||||
};
|
};
|
||||||
#undef offset
|
#undef offset
|
||||||
|
|
||||||
static Boolean XlwMenuSetValues();
|
static Boolean XlwMenuSetValues(Widget current, Widget request, Widget new);
|
||||||
static void XlwMenuRealize();
|
static void XlwMenuRealize(Widget w, Mask *valueMask, XSetWindowAttributes *attributes);
|
||||||
static void XlwMenuResize();
|
static void XlwMenuResize(Widget w);
|
||||||
static void XlwMenuInitialize();
|
static void XlwMenuInitialize(Widget request, XlwMenuWidget mw, ArgList args, Cardinal *num_args);
|
||||||
static void XlwMenuRedisplay();
|
static void XlwMenuRedisplay(Widget w, XEvent *ev, Region region);
|
||||||
static void XlwMenuDestroy();
|
static void XlwMenuDestroy(Widget w);
|
||||||
static void XlwMenuClassInitialize();
|
static void XlwMenuClassInitialize(void);
|
||||||
static void Start();
|
static void Start(Widget w, XEvent *ev, String *params, Cardinal *num_params);
|
||||||
static void Drag();
|
static void Drag(Widget w, XEvent *ev, String *params, Cardinal *num_params);
|
||||||
static void Down();
|
static void Down(Widget w, XEvent *ev, String *params, Cardinal *num_params);
|
||||||
static void Up();
|
static void Up(Widget w, XEvent *ev, String *params, Cardinal *num_params);
|
||||||
static void Left();
|
static void Left(Widget w, XEvent *ev, String *params, Cardinal *num_params);
|
||||||
static void Right();
|
static void Right(Widget w, XEvent *ev, String *params, Cardinal *num_params);
|
||||||
static void Select();
|
static void Select(Widget w, XEvent *ev, String *params, Cardinal *num_params);
|
||||||
static void Key();
|
static void Key(Widget w, XEvent *ev, String *params, Cardinal *num_params);
|
||||||
static void Nothing();
|
static void Nothing(Widget w, XEvent *ev, String *params, Cardinal *num_params);
|
||||||
static int separator_height (enum menu_separator);
|
static int separator_height (enum menu_separator);
|
||||||
static void pop_up_menu (XlwMenuWidget, XButtonPressedEvent *);
|
static void pop_up_menu (XlwMenuWidget, XButtonPressedEvent *);
|
||||||
|
|
||||||
|
|
@ -278,9 +278,7 @@ static int next_release_must_exit;
|
||||||
|
|
||||||
/* Ungrab pointer and keyboard */
|
/* Ungrab pointer and keyboard */
|
||||||
static void
|
static void
|
||||||
ungrab_all (w, ungrabtime)
|
ungrab_all (Widget w, Time ungrabtime)
|
||||||
Widget w;
|
|
||||||
Time ungrabtime;
|
|
||||||
{
|
{
|
||||||
XtUngrabPointer (w, ungrabtime);
|
XtUngrabPointer (w, ungrabtime);
|
||||||
if (GRAB_KEYBOARD) XtUngrabKeyboard (w, ungrabtime);
|
if (GRAB_KEYBOARD) XtUngrabKeyboard (w, ungrabtime);
|
||||||
|
|
@ -289,8 +287,7 @@ ungrab_all (w, ungrabtime)
|
||||||
/* Like abort, but remove grabs from widget W before. */
|
/* Like abort, but remove grabs from widget W before. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
abort_gracefully (w)
|
abort_gracefully (Widget w)
|
||||||
Widget w;
|
|
||||||
{
|
{
|
||||||
if (XtIsShell (XtParent (w)))
|
if (XtIsShell (XtParent (w)))
|
||||||
XtRemoveGrab (w);
|
XtRemoveGrab (w);
|
||||||
|
|
@ -299,9 +296,7 @@ abort_gracefully (w)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
push_new_stack (mw, val)
|
push_new_stack (XlwMenuWidget mw, widget_value *val)
|
||||||
XlwMenuWidget mw;
|
|
||||||
widget_value* val;
|
|
||||||
{
|
{
|
||||||
if (!mw->menu.new_stack)
|
if (!mw->menu.new_stack)
|
||||||
{
|
{
|
||||||
|
|
@ -321,8 +316,7 @@ push_new_stack (mw, val)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
pop_new_stack_if_no_contents (mw)
|
pop_new_stack_if_no_contents (XlwMenuWidget mw)
|
||||||
XlwMenuWidget mw;
|
|
||||||
{
|
{
|
||||||
if (mw->menu.new_depth > 1)
|
if (mw->menu.new_depth > 1)
|
||||||
{
|
{
|
||||||
|
|
@ -332,9 +326,7 @@ pop_new_stack_if_no_contents (mw)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
make_old_stack_space (mw, n)
|
make_old_stack_space (XlwMenuWidget mw, int n)
|
||||||
XlwMenuWidget mw;
|
|
||||||
int n;
|
|
||||||
{
|
{
|
||||||
if (!mw->menu.old_stack)
|
if (!mw->menu.old_stack)
|
||||||
{
|
{
|
||||||
|
|
@ -354,9 +346,7 @@ make_old_stack_space (mw, n)
|
||||||
|
|
||||||
/* Size code */
|
/* Size code */
|
||||||
static int
|
static int
|
||||||
string_width (mw, s)
|
string_width (XlwMenuWidget mw, char *s)
|
||||||
XlwMenuWidget mw;
|
|
||||||
char *s;
|
|
||||||
{
|
{
|
||||||
XCharStruct xcs;
|
XCharStruct xcs;
|
||||||
int drop;
|
int drop;
|
||||||
|
|
@ -415,8 +405,7 @@ string_width (mw, s)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int
|
static int
|
||||||
arrow_width (mw)
|
arrow_width (XlwMenuWidget mw)
|
||||||
XlwMenuWidget mw;
|
|
||||||
{
|
{
|
||||||
return (MENU_FONT_ASCENT (mw) * 3/4) | 1;
|
return (MENU_FONT_ASCENT (mw) * 3/4) | 1;
|
||||||
}
|
}
|
||||||
|
|
@ -424,8 +413,7 @@ arrow_width (mw)
|
||||||
/* Return the width of toggle buttons of widget MW. */
|
/* Return the width of toggle buttons of widget MW. */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
toggle_button_width (mw)
|
toggle_button_width (XlwMenuWidget mw)
|
||||||
XlwMenuWidget mw;
|
|
||||||
{
|
{
|
||||||
return (MENU_FONT_HEIGHT (mw) * 2 / 3) | 1;
|
return (MENU_FONT_HEIGHT (mw) * 2 / 3) | 1;
|
||||||
}
|
}
|
||||||
|
|
@ -434,8 +422,7 @@ toggle_button_width (mw)
|
||||||
/* Return the width of radio buttons of widget MW. */
|
/* Return the width of radio buttons of widget MW. */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
radio_button_width (mw)
|
radio_button_width (XlwMenuWidget mw)
|
||||||
XlwMenuWidget mw;
|
|
||||||
{
|
{
|
||||||
return toggle_button_width (mw) * 1.41;
|
return toggle_button_width (mw) * 1.41;
|
||||||
}
|
}
|
||||||
|
|
@ -449,9 +436,7 @@ nameResource[] =
|
||||||
};
|
};
|
||||||
|
|
||||||
static char*
|
static char*
|
||||||
resource_widget_value (mw, val)
|
resource_widget_value (XlwMenuWidget mw, widget_value *val)
|
||||||
XlwMenuWidget mw;
|
|
||||||
widget_value *val;
|
|
||||||
{
|
{
|
||||||
if (!val->toolkit_data)
|
if (!val->toolkit_data)
|
||||||
{
|
{
|
||||||
|
|
@ -537,9 +522,7 @@ size_menu_item (mw, val, horizontal_p, label_width, rest_width, button_width,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
size_menu (mw, level)
|
size_menu (XlwMenuWidget mw, int level)
|
||||||
XlwMenuWidget mw;
|
|
||||||
int level;
|
|
||||||
{
|
{
|
||||||
unsigned int label_width = 0;
|
unsigned int label_width = 0;
|
||||||
int rest_width = 0;
|
int rest_width = 0;
|
||||||
|
|
@ -605,14 +588,7 @@ size_menu (mw, level)
|
||||||
/* Display code */
|
/* Display code */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
draw_arrow (mw, window, gc, x, y, width, down_p)
|
draw_arrow (XlwMenuWidget mw, Window window, GC gc, int x, int y, int width, int down_p)
|
||||||
XlwMenuWidget mw;
|
|
||||||
Window window;
|
|
||||||
GC gc;
|
|
||||||
int x;
|
|
||||||
int y;
|
|
||||||
int width;
|
|
||||||
int down_p;
|
|
||||||
{
|
{
|
||||||
Display *dpy = XtDisplay (mw);
|
Display *dpy = XtDisplay (mw);
|
||||||
GC top_gc = mw->menu.shadow_top_gc;
|
GC top_gc = mw->menu.shadow_top_gc;
|
||||||
|
|
@ -669,15 +645,7 @@ draw_arrow (mw, window, gc, x, y, width, down_p)
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
draw_shadow_rectangle (mw, window, x, y, width, height, erase_p, down_p)
|
draw_shadow_rectangle (XlwMenuWidget mw, Window window, int x, int y, int width, int height, int erase_p, int down_p)
|
||||||
XlwMenuWidget mw;
|
|
||||||
Window window;
|
|
||||||
int x;
|
|
||||||
int y;
|
|
||||||
int width;
|
|
||||||
int height;
|
|
||||||
int erase_p;
|
|
||||||
int down_p;
|
|
||||||
{
|
{
|
||||||
Display *dpy = XtDisplay (mw);
|
Display *dpy = XtDisplay (mw);
|
||||||
GC top_gc = !erase_p ? mw->menu.shadow_top_gc : mw->menu.background_gc;
|
GC top_gc = !erase_p ? mw->menu.shadow_top_gc : mw->menu.background_gc;
|
||||||
|
|
@ -733,15 +701,7 @@ draw_shadow_rectangle (mw, window, x, y, width, height, erase_p, down_p)
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
draw_shadow_rhombus (mw, window, x, y, width, height, erase_p, down_p)
|
draw_shadow_rhombus (XlwMenuWidget mw, Window window, int x, int y, int width, int height, int erase_p, int down_p)
|
||||||
XlwMenuWidget mw;
|
|
||||||
Window window;
|
|
||||||
int x;
|
|
||||||
int y;
|
|
||||||
int width;
|
|
||||||
int height;
|
|
||||||
int erase_p;
|
|
||||||
int down_p;
|
|
||||||
{
|
{
|
||||||
Display *dpy = XtDisplay (mw);
|
Display *dpy = XtDisplay (mw);
|
||||||
GC top_gc = !erase_p ? mw->menu.shadow_top_gc : mw->menu.background_gc;
|
GC top_gc = !erase_p ? mw->menu.shadow_top_gc : mw->menu.background_gc;
|
||||||
|
|
@ -801,10 +761,7 @@ draw_shadow_rhombus (mw, window, x, y, width, height, erase_p, down_p)
|
||||||
toggle button is selected. */
|
toggle button is selected. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
draw_toggle (mw, window, x, y, selected_p)
|
draw_toggle (XlwMenuWidget mw, Window window, int x, int y, int selected_p)
|
||||||
XlwMenuWidget mw;
|
|
||||||
Window window;
|
|
||||||
int x, y, selected_p;
|
|
||||||
{
|
{
|
||||||
int width, height;
|
int width, height;
|
||||||
|
|
||||||
|
|
@ -821,10 +778,7 @@ draw_toggle (mw, window, x, y, selected_p)
|
||||||
toggle button is selected. */
|
toggle button is selected. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
draw_radio (mw, window, x, y, selected_p)
|
draw_radio (XlwMenuWidget mw, Window window, int x, int y, int selected_p)
|
||||||
XlwMenuWidget mw;
|
|
||||||
Window window;
|
|
||||||
int x, y, selected_p;
|
|
||||||
{
|
{
|
||||||
int width, height;
|
int width, height;
|
||||||
|
|
||||||
|
|
@ -841,11 +795,7 @@ draw_radio (mw, window, x, y, selected_p)
|
||||||
separator to draw. TYPE is the separator type. */
|
separator to draw. TYPE is the separator type. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
draw_separator (mw, window, x, y, width, type)
|
draw_separator (XlwMenuWidget mw, Window window, int x, int y, int width, enum menu_separator type)
|
||||||
XlwMenuWidget mw;
|
|
||||||
Window window;
|
|
||||||
int x, y, width;
|
|
||||||
enum menu_separator type;
|
|
||||||
{
|
{
|
||||||
Display *dpy = XtDisplay (mw);
|
Display *dpy = XtDisplay (mw);
|
||||||
XGCValues xgcv;
|
XGCValues xgcv;
|
||||||
|
|
@ -958,8 +908,7 @@ draw_separator (mw, window, x, y, width, type)
|
||||||
/* Return the pixel height of menu separator SEPARATOR. */
|
/* Return the pixel height of menu separator SEPARATOR. */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
separator_height (separator)
|
separator_height (enum menu_separator separator)
|
||||||
enum menu_separator separator;
|
|
||||||
{
|
{
|
||||||
switch (separator)
|
switch (separator)
|
||||||
{
|
{
|
||||||
|
|
@ -1188,13 +1137,7 @@ display_menu_item (mw, val, ws, where, highlighted_p, horizontal_p,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
display_menu (mw, level, just_compute_p, highlighted_pos, hit, hit_return)
|
display_menu (XlwMenuWidget mw, int level, Boolean just_compute_p, XPoint *highlighted_pos, XPoint *hit, widget_value **hit_return)
|
||||||
XlwMenuWidget mw;
|
|
||||||
int level;
|
|
||||||
Boolean just_compute_p;
|
|
||||||
XPoint* highlighted_pos;
|
|
||||||
XPoint* hit;
|
|
||||||
widget_value** hit_return;
|
|
||||||
{
|
{
|
||||||
widget_value* val;
|
widget_value* val;
|
||||||
widget_value* following_item;
|
widget_value* following_item;
|
||||||
|
|
@ -1285,10 +1228,7 @@ display_menu (mw, level, just_compute_p, highlighted_pos, hit, hit_return)
|
||||||
|
|
||||||
/* Motion code */
|
/* Motion code */
|
||||||
static void
|
static void
|
||||||
set_new_state (mw, val, level)
|
set_new_state (XlwMenuWidget mw, widget_value *val, int level)
|
||||||
XlwMenuWidget mw;
|
|
||||||
widget_value* val;
|
|
||||||
int level;
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
@ -1311,7 +1251,7 @@ expose_cb (Widget widget,
|
||||||
for (i = 0; i < mw->menu.windows_length; ++i)
|
for (i = 0; i < mw->menu.windows_length; ++i)
|
||||||
if (mw->menu.windows [i].w == widget) break;
|
if (mw->menu.windows [i].w == widget) break;
|
||||||
if (i < mw->menu.windows_length && i < mw->menu.old_depth)
|
if (i < mw->menu.windows_length && i < mw->menu.old_depth)
|
||||||
display_menu (mw, i, False, NULL, NULL, NULL, NULL, NULL);
|
display_menu (mw, i, False, NULL, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -1332,9 +1272,7 @@ set_window_type (Widget w, XlwMenuWidget mw)
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
make_windows_if_needed (mw, n)
|
make_windows_if_needed (XlwMenuWidget mw, int n)
|
||||||
XlwMenuWidget mw;
|
|
||||||
int n;
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int start_at;
|
int start_at;
|
||||||
|
|
@ -1396,9 +1334,7 @@ make_windows_if_needed (mw, n)
|
||||||
/* Value is non-zero if WINDOW is part of menu bar widget W. */
|
/* Value is non-zero if WINDOW is part of menu bar widget W. */
|
||||||
|
|
||||||
int
|
int
|
||||||
xlwmenu_window_p (w, window)
|
xlwmenu_window_p (Widget w, Window window)
|
||||||
Widget w;
|
|
||||||
Window window;
|
|
||||||
{
|
{
|
||||||
XlwMenuWidget mw = (XlwMenuWidget) w;
|
XlwMenuWidget mw = (XlwMenuWidget) w;
|
||||||
int i;
|
int i;
|
||||||
|
|
@ -1412,11 +1348,7 @@ xlwmenu_window_p (w, window)
|
||||||
|
|
||||||
/* Make the window fit in the screen */
|
/* Make the window fit in the screen */
|
||||||
static void
|
static void
|
||||||
fit_to_screen (mw, ws, previous_ws, horizontal_p)
|
fit_to_screen (XlwMenuWidget mw, window_state *ws, window_state *previous_ws, Boolean horizontal_p)
|
||||||
XlwMenuWidget mw;
|
|
||||||
window_state* ws;
|
|
||||||
window_state* previous_ws;
|
|
||||||
Boolean horizontal_p;
|
|
||||||
{
|
{
|
||||||
unsigned int screen_width = WidthOfScreen (XtScreen (mw));
|
unsigned int screen_width = WidthOfScreen (XtScreen (mw));
|
||||||
unsigned int screen_height = HeightOfScreen (XtScreen (mw));
|
unsigned int screen_height = HeightOfScreen (XtScreen (mw));
|
||||||
|
|
@ -1497,8 +1429,7 @@ create_pixmap_for_menu (window_state* ws, XlwMenuWidget mw)
|
||||||
|
|
||||||
/* Updates old_stack from new_stack and redisplays. */
|
/* Updates old_stack from new_stack and redisplays. */
|
||||||
static void
|
static void
|
||||||
remap_menubar (mw)
|
remap_menubar (XlwMenuWidget mw)
|
||||||
XlwMenuWidget mw;
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int last_same;
|
int last_same;
|
||||||
|
|
@ -1591,11 +1522,7 @@ remap_menubar (mw)
|
||||||
}
|
}
|
||||||
|
|
||||||
static Boolean
|
static Boolean
|
||||||
motion_event_is_in_menu (mw, ev, level, relative_pos)
|
motion_event_is_in_menu (XlwMenuWidget mw, XMotionEvent *ev, int level, XPoint *relative_pos)
|
||||||
XlwMenuWidget mw;
|
|
||||||
XMotionEvent* ev;
|
|
||||||
int level;
|
|
||||||
XPoint* relative_pos;
|
|
||||||
{
|
{
|
||||||
window_state* ws = &mw->menu.windows [level];
|
window_state* ws = &mw->menu.windows [level];
|
||||||
int shadow = level == 0 ? 0 : mw->menu.shadow_thickness;
|
int shadow = level == 0 ? 0 : mw->menu.shadow_thickness;
|
||||||
|
|
@ -1608,11 +1535,7 @@ motion_event_is_in_menu (mw, ev, level, relative_pos)
|
||||||
}
|
}
|
||||||
|
|
||||||
static Boolean
|
static Boolean
|
||||||
map_event_to_widget_value (mw, ev, val, level)
|
map_event_to_widget_value (XlwMenuWidget mw, XMotionEvent *ev, widget_value **val, int *level)
|
||||||
XlwMenuWidget mw;
|
|
||||||
XMotionEvent* ev;
|
|
||||||
widget_value** val;
|
|
||||||
int* level;
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
XPoint relative_pos;
|
XPoint relative_pos;
|
||||||
|
|
@ -1651,8 +1574,7 @@ map_event_to_widget_value (mw, ev, val, level)
|
||||||
|
|
||||||
/* Procedures */
|
/* Procedures */
|
||||||
static void
|
static void
|
||||||
make_drawing_gcs (mw)
|
make_drawing_gcs (XlwMenuWidget mw)
|
||||||
XlwMenuWidget mw;
|
|
||||||
{
|
{
|
||||||
XGCValues xgcv;
|
XGCValues xgcv;
|
||||||
float scale;
|
float scale;
|
||||||
|
|
@ -1722,8 +1644,7 @@ make_drawing_gcs (mw)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
release_drawing_gcs (mw)
|
release_drawing_gcs (XlwMenuWidget mw)
|
||||||
XlwMenuWidget mw;
|
|
||||||
{
|
{
|
||||||
XtReleaseGC ((Widget) mw, mw->menu.foreground_gc);
|
XtReleaseGC ((Widget) mw, mw->menu.foreground_gc);
|
||||||
XtReleaseGC ((Widget) mw, mw->menu.button_gc);
|
XtReleaseGC ((Widget) mw, mw->menu.button_gc);
|
||||||
|
|
@ -1742,8 +1663,7 @@ release_drawing_gcs (mw)
|
||||||
? ((unsigned long) (x)) : ((unsigned long) (y)))
|
? ((unsigned long) (x)) : ((unsigned long) (y)))
|
||||||
|
|
||||||
static void
|
static void
|
||||||
make_shadow_gcs (mw)
|
make_shadow_gcs (XlwMenuWidget mw)
|
||||||
XlwMenuWidget mw;
|
|
||||||
{
|
{
|
||||||
XGCValues xgcv;
|
XGCValues xgcv;
|
||||||
unsigned long pm = 0;
|
unsigned long pm = 0;
|
||||||
|
|
@ -1875,8 +1795,7 @@ make_shadow_gcs (mw)
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
release_shadow_gcs (mw)
|
release_shadow_gcs (XlwMenuWidget mw)
|
||||||
XlwMenuWidget mw;
|
|
||||||
{
|
{
|
||||||
Display *dpy = XtDisplay ((Widget) mw);
|
Display *dpy = XtDisplay ((Widget) mw);
|
||||||
Screen *screen = XtScreen ((Widget) mw);
|
Screen *screen = XtScreen ((Widget) mw);
|
||||||
|
|
@ -1897,8 +1816,7 @@ release_shadow_gcs (mw)
|
||||||
|
|
||||||
#ifdef HAVE_XFT
|
#ifdef HAVE_XFT
|
||||||
static int
|
static int
|
||||||
openXftFont (mw)
|
openXftFont (XlwMenuWidget mw)
|
||||||
XlwMenuWidget mw;
|
|
||||||
{
|
{
|
||||||
char *fname = mw->menu.faceName;
|
char *fname = mw->menu.faceName;
|
||||||
|
|
||||||
|
|
@ -1934,11 +1852,7 @@ openXftFont (mw)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
XlwMenuInitialize (request, mw, args, num_args)
|
XlwMenuInitialize (Widget request, XlwMenuWidget mw, ArgList args, Cardinal *num_args)
|
||||||
Widget request;
|
|
||||||
XlwMenuWidget mw;
|
|
||||||
ArgList args;
|
|
||||||
Cardinal *num_args;
|
|
||||||
{
|
{
|
||||||
/* Get the GCs and the widget size */
|
/* Get the GCs and the widget size */
|
||||||
|
|
||||||
|
|
@ -2018,16 +1932,13 @@ XlwMenuInitialize (request, mw, args, num_args)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
XlwMenuClassInitialize ()
|
XlwMenuClassInitialize (void)
|
||||||
{
|
{
|
||||||
xlwmenu_default_font = 0;
|
xlwmenu_default_font = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
XlwMenuRealize (w, valueMask, attributes)
|
XlwMenuRealize (Widget w, Mask *valueMask, XSetWindowAttributes *attributes)
|
||||||
Widget w;
|
|
||||||
Mask *valueMask;
|
|
||||||
XSetWindowAttributes *attributes;
|
|
||||||
{
|
{
|
||||||
XlwMenuWidget mw = (XlwMenuWidget)w;
|
XlwMenuWidget mw = (XlwMenuWidget)w;
|
||||||
XSetWindowAttributes xswa;
|
XSetWindowAttributes xswa;
|
||||||
|
|
@ -2089,10 +2000,7 @@ XlwMenuRealize (w, valueMask, attributes)
|
||||||
receives expose events through Xt. So we repaint all the other panes
|
receives expose events through Xt. So we repaint all the other panes
|
||||||
when receiving an Expose event. */
|
when receiving an Expose event. */
|
||||||
static void
|
static void
|
||||||
XlwMenuRedisplay (w, ev, region)
|
XlwMenuRedisplay (Widget w, XEvent *ev, Region region)
|
||||||
Widget w;
|
|
||||||
XEvent* ev;
|
|
||||||
Region region;
|
|
||||||
{
|
{
|
||||||
XlwMenuWidget mw = (XlwMenuWidget)w;
|
XlwMenuWidget mw = (XlwMenuWidget)w;
|
||||||
int i;
|
int i;
|
||||||
|
|
@ -2113,15 +2021,13 @@ XlwMenuRedisplay (w, ev, region)
|
||||||
over a menu item is unmapped. */
|
over a menu item is unmapped. */
|
||||||
|
|
||||||
void
|
void
|
||||||
xlwmenu_redisplay (w)
|
xlwmenu_redisplay (Widget w)
|
||||||
Widget w;
|
|
||||||
{
|
{
|
||||||
XlwMenuRedisplay (w, NULL, None);
|
XlwMenuRedisplay (w, NULL, None);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
XlwMenuDestroy (w)
|
XlwMenuDestroy (Widget w)
|
||||||
Widget w;
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
XlwMenuWidget mw = (XlwMenuWidget) w;
|
XlwMenuWidget mw = (XlwMenuWidget) w;
|
||||||
|
|
@ -2200,10 +2106,7 @@ facename_changed (XlwMenuWidget newmw,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static Boolean
|
static Boolean
|
||||||
XlwMenuSetValues (current, request, new)
|
XlwMenuSetValues (Widget current, Widget request, Widget new)
|
||||||
Widget current;
|
|
||||||
Widget request;
|
|
||||||
Widget new;
|
|
||||||
{
|
{
|
||||||
XlwMenuWidget oldmw = (XlwMenuWidget)current;
|
XlwMenuWidget oldmw = (XlwMenuWidget)current;
|
||||||
XlwMenuWidget newmw = (XlwMenuWidget)new;
|
XlwMenuWidget newmw = (XlwMenuWidget)new;
|
||||||
|
|
@ -2292,8 +2195,7 @@ XlwMenuSetValues (current, request, new)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
XlwMenuResize (w)
|
XlwMenuResize (Widget w)
|
||||||
Widget w;
|
|
||||||
{
|
{
|
||||||
XlwMenuWidget mw = (XlwMenuWidget)w;
|
XlwMenuWidget mw = (XlwMenuWidget)w;
|
||||||
|
|
||||||
|
|
@ -2315,9 +2217,7 @@ XlwMenuResize (w)
|
||||||
|
|
||||||
/* Action procedures */
|
/* Action procedures */
|
||||||
static void
|
static void
|
||||||
handle_single_motion_event (mw, ev)
|
handle_single_motion_event (XlwMenuWidget mw, XMotionEvent *ev)
|
||||||
XlwMenuWidget mw;
|
|
||||||
XMotionEvent* ev;
|
|
||||||
{
|
{
|
||||||
widget_value* val;
|
widget_value* val;
|
||||||
int level;
|
int level;
|
||||||
|
|
@ -2333,9 +2233,7 @@ handle_single_motion_event (mw, ev)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
handle_motion_event (mw, ev)
|
handle_motion_event (XlwMenuWidget mw, XMotionEvent *ev)
|
||||||
XlwMenuWidget mw;
|
|
||||||
XMotionEvent* ev;
|
|
||||||
{
|
{
|
||||||
int x = ev->x_root;
|
int x = ev->x_root;
|
||||||
int y = ev->y_root;
|
int y = ev->y_root;
|
||||||
|
|
@ -2357,11 +2255,7 @@ handle_motion_event (mw, ev)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
Start (w, ev, params, num_params)
|
Start (Widget w, XEvent *ev, String *params, Cardinal *num_params)
|
||||||
Widget w;
|
|
||||||
XEvent *ev;
|
|
||||||
String *params;
|
|
||||||
Cardinal *num_params;
|
|
||||||
{
|
{
|
||||||
XlwMenuWidget mw = (XlwMenuWidget)w;
|
XlwMenuWidget mw = (XlwMenuWidget)w;
|
||||||
|
|
||||||
|
|
@ -2394,11 +2288,7 @@ Start (w, ev, params, num_params)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
Drag (w, ev, params, num_params)
|
Drag (Widget w, XEvent *ev, String *params, Cardinal *num_params)
|
||||||
Widget w;
|
|
||||||
XEvent *ev;
|
|
||||||
String *params;
|
|
||||||
Cardinal *num_params;
|
|
||||||
{
|
{
|
||||||
XlwMenuWidget mw = (XlwMenuWidget)w;
|
XlwMenuWidget mw = (XlwMenuWidget)w;
|
||||||
if (mw->menu.popped_up)
|
if (mw->menu.popped_up)
|
||||||
|
|
@ -2408,19 +2298,12 @@ Drag (w, ev, params, num_params)
|
||||||
/* Do nothing.
|
/* Do nothing.
|
||||||
This is how we handle presses and releases of modifier keys. */
|
This is how we handle presses and releases of modifier keys. */
|
||||||
static void
|
static void
|
||||||
Nothing (w, ev, params, num_params)
|
Nothing (Widget w, XEvent *ev, String *params, Cardinal *num_params)
|
||||||
Widget w;
|
|
||||||
XEvent *ev;
|
|
||||||
String *params;
|
|
||||||
Cardinal *num_params;
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static widget_value *
|
static widget_value *
|
||||||
find_first_selectable (mw, item, skip_titles)
|
find_first_selectable (XlwMenuWidget mw, widget_value *item, int skip_titles)
|
||||||
XlwMenuWidget mw;
|
|
||||||
widget_value *item;
|
|
||||||
int skip_titles;
|
|
||||||
{
|
{
|
||||||
widget_value *current = item;
|
widget_value *current = item;
|
||||||
enum menu_separator separator;
|
enum menu_separator separator;
|
||||||
|
|
@ -2436,10 +2319,7 @@ find_first_selectable (mw, item, skip_titles)
|
||||||
}
|
}
|
||||||
|
|
||||||
static widget_value *
|
static widget_value *
|
||||||
find_next_selectable (mw, item, skip_titles)
|
find_next_selectable (XlwMenuWidget mw, widget_value *item, int skip_titles)
|
||||||
XlwMenuWidget mw;
|
|
||||||
widget_value *item;
|
|
||||||
int skip_titles;
|
|
||||||
{
|
{
|
||||||
widget_value *current = item;
|
widget_value *current = item;
|
||||||
enum menu_separator separator;
|
enum menu_separator separator;
|
||||||
|
|
@ -2473,10 +2353,7 @@ find_next_selectable (mw, item, skip_titles)
|
||||||
}
|
}
|
||||||
|
|
||||||
static widget_value *
|
static widget_value *
|
||||||
find_prev_selectable (mw, item, skip_titles)
|
find_prev_selectable (XlwMenuWidget mw, widget_value *item, int skip_titles)
|
||||||
XlwMenuWidget mw;
|
|
||||||
widget_value *item;
|
|
||||||
int skip_titles;
|
|
||||||
{
|
{
|
||||||
widget_value *current = item;
|
widget_value *current = item;
|
||||||
widget_value *prev = item;
|
widget_value *prev = item;
|
||||||
|
|
@ -2493,11 +2370,7 @@ find_prev_selectable (mw, item, skip_titles)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
Down (w, ev, params, num_params)
|
Down (Widget w, XEvent *ev, String *params, Cardinal *num_params)
|
||||||
Widget w;
|
|
||||||
XEvent *ev;
|
|
||||||
String *params;
|
|
||||||
Cardinal *num_params;
|
|
||||||
{
|
{
|
||||||
XlwMenuWidget mw = (XlwMenuWidget) w;
|
XlwMenuWidget mw = (XlwMenuWidget) w;
|
||||||
widget_value* selected_item = mw->menu.old_stack [mw->menu.old_depth - 1];
|
widget_value* selected_item = mw->menu.old_stack [mw->menu.old_depth - 1];
|
||||||
|
|
@ -2522,11 +2395,7 @@ Down (w, ev, params, num_params)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
Up (w, ev, params, num_params)
|
Up (Widget w, XEvent *ev, String *params, Cardinal *num_params)
|
||||||
Widget w;
|
|
||||||
XEvent *ev;
|
|
||||||
String *params;
|
|
||||||
Cardinal *num_params;
|
|
||||||
{
|
{
|
||||||
XlwMenuWidget mw = (XlwMenuWidget) w;
|
XlwMenuWidget mw = (XlwMenuWidget) w;
|
||||||
widget_value* selected_item = mw->menu.old_stack [mw->menu.old_depth - 1];
|
widget_value* selected_item = mw->menu.old_stack [mw->menu.old_depth - 1];
|
||||||
|
|
@ -2562,11 +2431,7 @@ Up (w, ev, params, num_params)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Left (w, ev, params, num_params)
|
Left (Widget w, XEvent *ev, String *params, Cardinal *num_params)
|
||||||
Widget w;
|
|
||||||
XEvent *ev;
|
|
||||||
String *params;
|
|
||||||
Cardinal *num_params;
|
|
||||||
{
|
{
|
||||||
XlwMenuWidget mw = (XlwMenuWidget) w;
|
XlwMenuWidget mw = (XlwMenuWidget) w;
|
||||||
widget_value* selected_item = mw->menu.old_stack [mw->menu.old_depth - 1];
|
widget_value* selected_item = mw->menu.old_stack [mw->menu.old_depth - 1];
|
||||||
|
|
@ -2602,11 +2467,7 @@ Left (w, ev, params, num_params)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Right (w, ev, params, num_params)
|
Right (Widget w, XEvent *ev, String *params, Cardinal *num_params)
|
||||||
Widget w;
|
|
||||||
XEvent *ev;
|
|
||||||
String *params;
|
|
||||||
Cardinal *num_params;
|
|
||||||
{
|
{
|
||||||
XlwMenuWidget mw = (XlwMenuWidget) w;
|
XlwMenuWidget mw = (XlwMenuWidget) w;
|
||||||
widget_value* selected_item = mw->menu.old_stack [mw->menu.old_depth - 1];
|
widget_value* selected_item = mw->menu.old_stack [mw->menu.old_depth - 1];
|
||||||
|
|
@ -2642,11 +2503,7 @@ Right (w, ev, params, num_params)
|
||||||
/* Handle key press and release events while menu is popped up.
|
/* Handle key press and release events while menu is popped up.
|
||||||
Our action is to get rid of the menu. */
|
Our action is to get rid of the menu. */
|
||||||
static void
|
static void
|
||||||
Key (w, ev, params, num_params)
|
Key (Widget w, XEvent *ev, String *params, Cardinal *num_params)
|
||||||
Widget w;
|
|
||||||
XEvent *ev;
|
|
||||||
String *params;
|
|
||||||
Cardinal *num_params;
|
|
||||||
{
|
{
|
||||||
XlwMenuWidget mw = (XlwMenuWidget)w;
|
XlwMenuWidget mw = (XlwMenuWidget)w;
|
||||||
|
|
||||||
|
|
@ -2672,11 +2529,7 @@ Key (w, ev, params, num_params)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
Select (w, ev, params, num_params)
|
Select (Widget w, XEvent *ev, String *params, Cardinal *num_params)
|
||||||
Widget w;
|
|
||||||
XEvent *ev;
|
|
||||||
String *params;
|
|
||||||
Cardinal *num_params;
|
|
||||||
{
|
{
|
||||||
XlwMenuWidget mw = (XlwMenuWidget)w;
|
XlwMenuWidget mw = (XlwMenuWidget)w;
|
||||||
widget_value* selected_item = mw->menu.old_stack [mw->menu.old_depth - 1];
|
widget_value* selected_item = mw->menu.old_stack [mw->menu.old_depth - 1];
|
||||||
|
|
@ -2715,9 +2568,7 @@ Select (w, ev, params, num_params)
|
||||||
|
|
||||||
/* Special code to pop-up a menu */
|
/* Special code to pop-up a menu */
|
||||||
static void
|
static void
|
||||||
pop_up_menu (mw, event)
|
pop_up_menu (XlwMenuWidget mw, XButtonPressedEvent *event)
|
||||||
XlwMenuWidget mw;
|
|
||||||
XButtonPressedEvent* event;
|
|
||||||
{
|
{
|
||||||
int x = event->x_root;
|
int x = event->x_root;
|
||||||
int y = event->y_root;
|
int y = event->y_root;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue