+2010-07-12 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * xterm.c (x_frame_of_widget, x_alloc_nearest_color_for_widget)
+ (x_alloc_lighter_color_for_widget, cvt_string_to_pixel)
+ (cvt_pixel_dtor, x_window_to_menu_bar, xt_action_hook)
+ (xaw_jump_callback, xaw_scroll_callback)
+ (x_create_toolkit_scroll_bar, x_set_toolkit_scroll_bar_thumb)
+ (x_wm_set_size_hint, x_activate_timeout_atimer): Convert
+ definitions to standard C.
+ * xmenu.c (menubar_id_to_frame, popup_get_selection)
+ (popup_activate_callback, popup_deactivate_callback)
+ (menu_highlight_callback, menubar_selection_callback)
+ (apply_systemfont_to_dialog, apply_systemfont_to_menu)
+ (free_frame_menubar, popup_selection_callback, as)
+ (create_and_show_popup_menu, dialog_selection_callback)
+ (create_and_show_dialog):
+ * xfns.c (hack_wm_protocols, x_window):
+ * xfaces.c (x_update_menu_appearance):
+ * widget.c (get_default_char_pixel_size, pixel_to_char_size)
+ (char_to_pixel_size, round_size_to_char, get_wm_shell)
+ (set_frame_size, update_wm_hints, setup_frame_gcs)
+ (update_various_frame_slots, update_from_various_frame_slots)
+ (EmacsFrameInitialize, EmacsFrameRealize, EmacsFrameResize)
+ (EmacsFrameSetValues, EmacsFrameQueryGeometry)
+ (EmacsFrameSetCharSize, widget_store_internal_border): Likewise.
+
2010-07-12 Andreas Schwab <schwab@linux-m68k.org>
* dbusbind.c (xd_initialize): Don't compare boolean with a
#define DEFAULT_FACE_FONT "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*"
-static void EmacsFrameInitialize (/*Widget, Widget, ArgList, Cardinal * */);
-static void EmacsFrameDestroy (/* Widget */);
-static void EmacsFrameRealize (/* Widget, XtValueMask*, XSetWindowAttributes* */);
-void EmacsFrameResize (/* Widget widget */);
-static Boolean EmacsFrameSetValues (/* Widget, Widget, Widget,
- ArgList, Cardinal * */);
-static XtGeometryResult EmacsFrameQueryGeometry (/* Widget, XtWidgetGeometry*,
- XtWidgetGeometry* */);
+static void EmacsFrameInitialize (Widget request, Widget new, ArgList dum1, Cardinal *dum2);
+static void EmacsFrameDestroy (Widget widget);
+static void EmacsFrameRealize (Widget widget, XtValueMask *mask, XSetWindowAttributes *attrs);
+void EmacsFrameResize (Widget widget);
+static Boolean EmacsFrameSetValues (Widget cur_widget, Widget req_widget, Widget new_widget, ArgList dum1, Cardinal *dum2);
+static XtGeometryResult EmacsFrameQueryGeometry (Widget widget, XtWidgetGeometry *request, XtWidgetGeometry *result);
#undef XtOffset
WidgetClass emacsFrameClass = (WidgetClass) &emacsFrameClassRec;
static void
-get_default_char_pixel_size (ew, pixel_width, pixel_height)
- EmacsFrame ew;
- int* pixel_width;
- int* pixel_height;
+get_default_char_pixel_size (EmacsFrame ew, int *pixel_width, int *pixel_height)
{
struct frame* f = ew->emacs_frame.frame;
*pixel_width = FRAME_COLUMN_WIDTH (f);
}
static void
-pixel_to_char_size (ew, pixel_width, pixel_height, char_width, char_height)
- EmacsFrame ew;
- Dimension pixel_width;
- Dimension pixel_height;
- int* char_width;
- int* char_height;
+pixel_to_char_size (EmacsFrame ew, Dimension pixel_width, Dimension pixel_height, int *char_width, int *char_height)
{
struct frame* f = ew->emacs_frame.frame;
*char_width = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, (int) pixel_width);
}
static void
-char_to_pixel_size (ew, char_width, char_height, pixel_width, pixel_height)
- EmacsFrame ew;
- int char_width;
- int char_height;
- Dimension* pixel_width;
- Dimension* pixel_height;
+char_to_pixel_size (EmacsFrame ew, int char_width, int char_height, Dimension *pixel_width, Dimension *pixel_height)
{
struct frame* f = ew->emacs_frame.frame;
*pixel_width = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, char_width);
}
static void
-round_size_to_char (ew, in_width, in_height, out_width, out_height)
- EmacsFrame ew;
- Dimension in_width;
- Dimension in_height;
- Dimension* out_width;
- Dimension* out_height;
+round_size_to_char (EmacsFrame ew, Dimension in_width, Dimension in_height, Dimension *out_width, Dimension *out_height)
{
int char_width;
int char_height;
}
static Widget
-get_wm_shell (w)
- Widget w;
+get_wm_shell (Widget w)
{
Widget wmshell;
#endif
static void
-set_frame_size (ew)
- EmacsFrame ew;
+set_frame_size (EmacsFrame ew)
{
/* The widget hierarchy is
int update_hints_inhibit;
static void
-update_wm_hints (ew)
- EmacsFrame ew;
+update_wm_hints (EmacsFrame ew)
{
Widget wmshell = get_wm_shell ((Widget)ew);
int cw;
};
static void
-setup_frame_gcs (ew)
- EmacsFrame ew;
+setup_frame_gcs (EmacsFrame ew)
{
XGCValues gc_values;
struct frame* s = ew->emacs_frame.frame;
}
static void
-update_various_frame_slots (ew)
- EmacsFrame ew;
+update_various_frame_slots (EmacsFrame ew)
{
struct frame *f = ew->emacs_frame.frame;
struct x_output *x = f->output_data.x;
}
static void
-update_from_various_frame_slots (ew)
- EmacsFrame ew;
+update_from_various_frame_slots (EmacsFrame ew)
{
struct frame *f = ew->emacs_frame.frame;
struct x_output *x = f->output_data.x;
}
static void
-EmacsFrameInitialize (request, new, dum1, dum2)
- Widget request;
- Widget new;
- ArgList dum1;
- Cardinal *dum2;
+EmacsFrameInitialize (Widget request, Widget new, ArgList dum1, Cardinal *dum2)
{
EmacsFrame ew = (EmacsFrame)new;
static void
-EmacsFrameRealize (widget, mask, attrs)
- Widget widget;
- XtValueMask *mask;
- XSetWindowAttributes *attrs;
+EmacsFrameRealize (Widget widget, XtValueMask *mask, XSetWindowAttributes *attrs)
{
EmacsFrame ew = (EmacsFrame)widget;
update_wm_hints (ew);
}
-extern void free_frame_faces (/* struct frame * */);
+extern void free_frame_faces (struct frame *);
static void
-EmacsFrameDestroy (widget)
- Widget widget;
+EmacsFrameDestroy (Widget widget)
{
EmacsFrame ew = (EmacsFrame) widget;
struct frame* s = ew->emacs_frame.frame;
}
void
-EmacsFrameResize (widget)
- Widget widget;
+EmacsFrameResize (Widget widget)
{
EmacsFrame ew = (EmacsFrame)widget;
struct frame *f = ew->emacs_frame.frame;
}
static Boolean
-EmacsFrameSetValues (cur_widget, req_widget, new_widget, dum1, dum2)
- Widget cur_widget;
- Widget req_widget;
- Widget new_widget;
- ArgList dum1;
- Cardinal *dum2;
+EmacsFrameSetValues (Widget cur_widget, Widget req_widget, Widget new_widget, ArgList dum1, Cardinal *dum2)
{
EmacsFrame cur = (EmacsFrame)cur_widget;
EmacsFrame new = (EmacsFrame)new_widget;
}
static XtGeometryResult
-EmacsFrameQueryGeometry (widget, request, result)
- Widget widget;
- XtWidgetGeometry* request;
- XtWidgetGeometry* result;
+EmacsFrameQueryGeometry (Widget widget, XtWidgetGeometry *request, XtWidgetGeometry *result)
{
EmacsFrame ew = (EmacsFrame)widget;
/* Special entrypoints */
void
-EmacsFrameSetCharSize (widget, columns, rows)
- Widget widget;
- int columns;
- int rows;
+EmacsFrameSetCharSize (Widget widget, int columns, int rows)
{
EmacsFrame ew = (EmacsFrame) widget;
struct frame *f = ew->emacs_frame.frame;
\f
void
-widget_store_internal_border (widget)
- Widget widget;
+widget_store_internal_border (Widget widget)
{
EmacsFrame ew = (EmacsFrame) widget;
FRAME_PTR f = ew->emacs_frame.frame;
/* Make menus on frame F appear as specified by the `menu' face. */
static void
-x_update_menu_appearance (f)
- struct frame *f;
+x_update_menu_appearance (struct frame *f)
{
struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
XrmDatabase rdb;
for example, but Xt doesn't). */
static void
-hack_wm_protocols (f, widget)
- FRAME_PTR f;
- Widget widget;
+hack_wm_protocols (FRAME_PTR f, Widget widget)
{
Display *dpy = XtDisplay (widget);
Window w = XtWindow (widget);
/* Create and set up the X widget for frame F. */
static void
-x_window (f, window_prompting, minibuffer_only)
- struct frame *f;
- long window_prompting;
- int minibuffer_only;
+x_window (struct frame *f, long window_prompting, int minibuffer_only)
{
XClassHint class_hints;
XSetWindowAttributes attributes;
/* Return the frame whose ->output_data.x->id equals ID, or 0 if none. */
static struct frame *
-menubar_id_to_frame (id)
- LWLIB_ID id;
+menubar_id_to_frame (LWLIB_ID id)
{
Lisp_Object tail, frame;
FRAME_PTR f;
with BLOCK_INPUT, UNBLOCK_INPUT wrappers. */
static void
-popup_get_selection (initial_event, dpyinfo, id, do_timers)
- XEvent *initial_event;
- struct x_display_info *dpyinfo;
- LWLIB_ID id;
- int do_timers;
+popup_get_selection (XEvent *initial_event, struct x_display_info *dpyinfo, LWLIB_ID id, int do_timers)
{
XEvent event;
#ifndef USE_GTK
static void
-popup_activate_callback (widget, id, client_data)
- Widget widget;
- LWLIB_ID id;
- XtPointer client_data;
+popup_activate_callback (Widget widget, LWLIB_ID id, XtPointer client_data)
{
popup_activated_flag = 1;
#ifdef USE_X_TOOLKIT
}
#else
static void
-popup_deactivate_callback (widget, id, client_data)
- Widget widget;
- LWLIB_ID id;
- XtPointer client_data;
+popup_deactivate_callback (Widget widget, LWLIB_ID id, XtPointer client_data)
{
popup_activated_flag = 0;
}
}
#else
void
-menu_highlight_callback (widget, id, call_data)
- Widget widget;
- LWLIB_ID id;
- void *call_data;
+menu_highlight_callback (Widget widget, LWLIB_ID id, void *call_data)
{
struct frame *f;
Lisp_Object help;
Figure out what the user chose
and put the appropriate events into the keyboard buffer. */
static void
-menubar_selection_callback (widget, id, client_data)
- Widget widget;
- LWLIB_ID id;
- XtPointer client_data;
+menubar_selection_callback (Widget widget, LWLIB_ID id, XtPointer client_data)
{
FRAME_PTR f;
#ifdef USE_LUCID
static void
-apply_systemfont_to_dialog (w)
- Widget w;
+apply_systemfont_to_dialog (Widget w)
{
const char *fn = xsettings_get_system_normal_font ();
if (fn)
}
static void
-apply_systemfont_to_menu (w)
- Widget w;
+apply_systemfont_to_menu (Widget w)
{
const char *fn = xsettings_get_system_normal_font ();
int defflt;
#ifndef USE_GTK
void
-free_frame_menubar (f)
- FRAME_PTR f;
+free_frame_menubar (FRAME_PTR f)
{
Widget menubar_widget;
LWLIB_ID widget_id_tick;
static void
-popup_selection_callback (widget, id, client_data)
- Widget widget;
- LWLIB_ID id;
- XtPointer client_data;
+popup_selection_callback (Widget widget, LWLIB_ID id, XtPointer client_data)
{
menu_item_selection = (Lisp_Object *) client_data;
}
as a Lisp object as (HIGHPART . LOWPART). */
static Lisp_Object
-pop_down_menu (arg)
- Lisp_Object arg;
+pop_down_menu (Lisp_Object arg)
{
LWLIB_ID id = (XINT (XCAR (arg)) << 4 * sizeof (LWLIB_ID)
| XINT (XCDR (arg)));
menu pops down.
menu_item_selection will be set to the selection. */
static void
-create_and_show_popup_menu (f, first_wv, x, y, for_click, timestamp)
- FRAME_PTR f;
- widget_value *first_wv;
- int x;
- int y;
- int for_click;
- EMACS_UINT timestamp;
+create_and_show_popup_menu (FRAME_PTR f, widget_value *first_wv, int x, int y, int for_click, unsigned int timestamp)
{
int i;
Arg av[2];
#else /* not USE_GTK */
static void
-dialog_selection_callback (widget, id, client_data)
- Widget widget;
- LWLIB_ID id;
- XtPointer client_data;
+dialog_selection_callback (Widget widget, LWLIB_ID id, XtPointer client_data)
{
/* The EMACS_INT cast avoids a warning. There's no problem
as long as pointers have enough bits to hold small integers. */
dialog pops down.
menu_item_selection will be set to the selection. */
static void
-create_and_show_dialog (f, first_wv)
- FRAME_PTR f;
- widget_value *first_wv;
+create_and_show_dialog (FRAME_PTR f, widget_value *first_wv)
{
LWLIB_ID dialog_id;
cannot be determined. */
static struct frame *
-x_frame_of_widget (widget)
- Widget widget;
+x_frame_of_widget (Widget widget)
{
struct x_display_info *dpyinfo;
Lisp_Object tail;
if successful. This is called from lwlib. */
int
-x_alloc_nearest_color_for_widget (widget, cmap, color)
- Widget widget;
- Colormap cmap;
- XColor *color;
+x_alloc_nearest_color_for_widget (Widget widget, Colormap cmap, XColor *color)
{
struct frame *f = x_frame_of_widget (widget);
return x_alloc_nearest_color (f, cmap, color);
Value is non-zero if successful. */
int
-x_alloc_lighter_color_for_widget (widget, display, cmap, pixel, factor, delta)
- Widget widget;
- Display *display;
- Colormap cmap;
- unsigned long *pixel;
- double factor;
- int delta;
+x_alloc_lighter_color_for_widget (Widget widget, Display *display, Colormap cmap,
+ unsigned long *pixel, double factor, int delta)
{
struct frame *f = x_frame_of_widget (widget);
return x_alloc_lighter_color (f, display, cmap, pixel, factor, delta);
Value is True if successful, False otherwise. */
static Boolean
-cvt_string_to_pixel (dpy, args, nargs, from, to, closure_ret)
- Display *dpy;
- XrmValue *args;
- Cardinal *nargs;
- XrmValue *from, *to;
- XtPointer *closure_ret;
+cvt_string_to_pixel (Display *dpy, XrmValue *args, Cardinal *nargs,
+ XrmValue *from, XrmValue *to,
+ XtPointer *closure_ret)
{
Screen *screen;
Colormap cmap;
ARGS and NARGS are like for cvt_string_to_pixel. */
static void
-cvt_pixel_dtor (app, to, closure, args, nargs)
- XtAppContext app;
- XrmValuePtr to;
- XtPointer closure;
- XrmValuePtr args;
- Cardinal *nargs;
+cvt_pixel_dtor (XtAppContext app, XrmValuePtr to, XtPointer closure, XrmValuePtr args,
+ Cardinal *nargs)
{
if (*nargs != 2)
{
if WINDOW is not part of a menu bar. */
static Widget
-x_window_to_menu_bar (window)
- Window window;
+x_window_to_menu_bar (Window window)
{
Lisp_Object tail;
a `end-scroll' SCROLL_BAR_CLICK_EVENT' event if so. */
static void
-xt_action_hook (widget, client_data, action_name, event, params,
- num_params)
- Widget widget;
- XtPointer client_data;
- String action_name;
- XEvent *event;
- String *params;
- Cardinal *num_params;
+xt_action_hook (Widget widget, XtPointer client_data, String action_name,
+ XEvent *event, String *params, Cardinal *num_params)
{
int scroll_bar_p;
char *end_action;
the thumb is. */
static void
-xaw_jump_callback (widget, client_data, call_data)
- Widget widget;
- XtPointer client_data, call_data;
+xaw_jump_callback (Widget widget, XtPointer client_data, XtPointer call_data)
{
struct scroll_bar *bar = (struct scroll_bar *) client_data;
float top = *(float *) call_data;
Values < height of scroll bar mean line-wise movement. */
static void
-xaw_scroll_callback (widget, client_data, call_data)
- Widget widget;
- XtPointer client_data, call_data;
+xaw_scroll_callback (Widget widget, XtPointer client_data, XtPointer call_data)
{
struct scroll_bar *bar = (struct scroll_bar *) client_data;
/* The position really is stored cast to a pointer. */
#else /* not USE_GTK */
static void
-x_create_toolkit_scroll_bar (f, bar)
- struct frame *f;
- struct scroll_bar *bar;
+x_create_toolkit_scroll_bar (struct frame *f, struct scroll_bar *bar)
{
Window xwindow;
Widget widget;
#else /* not USE_GTK */
static void
-x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole)
- struct scroll_bar *bar;
- int portion, position, whole;
+x_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar, int portion, int position,
+ int whole)
{
struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
Widget widget = SCROLL_BAR_X_WIDGET (FRAME_X_DISPLAY (f), bar);
#ifndef USE_GTK
void
-x_wm_set_size_hint (f, flags, user_position)
- struct frame *f;
- long flags;
- int user_position;
+x_wm_set_size_hint (struct frame *f, long flags, int user_position)
{
XSizeHints size_hints;
Window window = FRAME_OUTER_WINDOW (f);
processed, these widgets don't behave normally. */
void
-x_activate_timeout_atimer ()
+x_activate_timeout_atimer (void)
{
BLOCK_INPUT;
if (!x_timeout_atimer_activated_flag)