summaryrefslogtreecommitdiff
path: root/src/gtkutil.c
diff options
context:
space:
mode:
authorDan Nicolaescu <dann@ics.uci.edu>2010-07-04 00:50:25 -0700
committerDan Nicolaescu <dann@ics.uci.edu>2010-07-04 00:50:25 -0700
commit971de7fb158335fbda39525feb2d7776a26bc030 (patch)
tree605333d85f16e35bb06baffcb66ac49f4ec0dce9 /src/gtkutil.c
parentb8463cbfbe2c5183cf40772df2746e58b787ddeb (diff)
downloademacs-971de7fb158335fbda39525feb2d7776a26bc030.tar.gz
Convert (most) functions in src to standard C.
* src/alloc.c: Convert function definitions to standard C. * src/atimer.c: * src/bidi.c: * src/bytecode.c: * src/callint.c: * src/callproc.c: * src/casefiddle.c: * src/casetab.c: * src/category.c: * src/ccl.c: * src/character.c: * src/charset.c: * src/chartab.c: * src/cmds.c: * src/coding.c: * src/composite.c: * src/data.c: * src/dbusbind.c: * src/dired.c: * src/dispnew.c: * src/doc.c: * src/doprnt.c: * src/ecrt0.c: * src/editfns.c: * src/fileio.c: * src/filelock.c: * src/filemode.c: * src/fns.c: * src/font.c: * src/fontset.c: * src/frame.c: * src/fringe.c: * src/ftfont.c: * src/ftxfont.c: * src/gtkutil.c: * src/indent.c: * src/insdel.c: * src/intervals.c: * src/keymap.c: * src/lread.c: * src/macros.c: * src/marker.c: * src/md5.c: * src/menu.c: * src/minibuf.c: * src/prefix-args.c: * src/print.c: * src/ralloc.c: * src/regex.c: * src/region-cache.c: * src/scroll.c: * src/search.c: * src/sound.c: * src/strftime.c: * src/syntax.c: * src/sysdep.c: * src/termcap.c: * src/terminal.c: * src/terminfo.c: * src/textprop.c: * src/tparam.c: * src/undo.c: * src/unexelf.c: * src/window.c: * src/xfaces.c: * src/xfns.c: * src/xfont.c: * src/xftfont.c: * src/xgselect.c: * src/xmenu.c: * src/xrdb.c: * src/xselect.c: * src/xsettings.c: * src/xsmfns.c: * src/xterm.c: Likewise.
Diffstat (limited to 'src/gtkutil.c')
-rw-r--r--src/gtkutil.c320
1 files changed, 79 insertions, 241 deletions
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 63de2b02fe5..ba111164a95 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -85,9 +85,7 @@ static GdkDisplay *gdpy_def;
W can be a GtkMenu or a GtkWindow widget. */
static void
-xg_set_screen (w, f)
- GtkWidget *w;
- FRAME_PTR f;
+xg_set_screen (GtkWidget *w, FRAME_PTR f)
{
if (FRAME_X_DISPLAY (f) != GDK_DISPLAY ())
{
@@ -110,9 +108,7 @@ xg_set_screen (w, f)
multipe displays. */
void
-xg_display_open (display_name, dpy)
- char *display_name;
- Display **dpy;
+xg_display_open (char *display_name, Display **dpy)
{
GdkDisplay *gdpy;
@@ -180,7 +176,7 @@ static int malloc_cpt;
Return a pointer to the allocated structure. */
widget_value *
-malloc_widget_value ()
+malloc_widget_value (void)
{
widget_value *wv;
if (widget_value_free_list)
@@ -202,8 +198,7 @@ malloc_widget_value ()
by malloc_widget_value, and no substructures. */
void
-free_widget_value (wv)
- widget_value *wv;
+free_widget_value (widget_value *wv)
{
if (wv->free_list)
abort ();
@@ -227,8 +222,7 @@ free_widget_value (wv)
scroll bars on display DPY. */
GdkCursor *
-xg_create_default_cursor (dpy)
- Display *dpy;
+xg_create_default_cursor (Display *dpy)
{
GdkDisplay *gdpy = gdk_x11_lookup_xdisplay (dpy);
return gdk_cursor_new_for_display (gdpy, GDK_LEFT_PTR);
@@ -237,10 +231,7 @@ xg_create_default_cursor (dpy)
/* Apply GMASK to GPIX and return a GdkPixbuf with an alpha channel. */
static GdkPixbuf *
-xg_get_pixbuf_from_pix_and_mask (gpix, gmask, cmap)
- GdkPixmap *gpix;
- GdkPixmap *gmask;
- GdkColormap *cmap;
+xg_get_pixbuf_from_pix_and_mask (GdkPixmap *gpix, GdkPixmap *gmask, GdkColormap *cmap)
{
int width, height;
GdkPixbuf *icon_buf, *tmp_buf;
@@ -291,8 +282,7 @@ xg_get_pixbuf_from_pix_and_mask (gpix, gmask, cmap)
}
static Lisp_Object
-file_for_image (image)
- Lisp_Object image;
+file_for_image (Lisp_Object image)
{
Lisp_Object specified_file = Qnil;
Lisp_Object tail;
@@ -319,11 +309,7 @@ file_for_image (image)
If OLD_WIDGET is not NULL, that widget is modified. */
static GtkWidget *
-xg_get_image_for_pixmap (f, img, widget, old_widget)
- FRAME_PTR f;
- struct image *img;
- GtkWidget *widget;
- GtkImage *old_widget;
+xg_get_image_for_pixmap (FRAME_PTR f, struct image *img, GtkWidget *widget, GtkImage *old_widget)
{
GdkPixmap *gpix;
GdkPixmap *gmask;
@@ -391,9 +377,7 @@ xg_get_image_for_pixmap (f, img, widget, old_widget)
and it is those widgets that are visible. */
static void
-xg_set_cursor (w, cursor)
- GtkWidget *w;
- GdkCursor *cursor;
+xg_set_cursor (GtkWidget *w, GdkCursor *cursor)
{
GdkWindow *window = gtk_widget_get_window(w);
GList *children = gdk_window_peek_children (window);
@@ -446,8 +430,7 @@ xg_list_remove (xg_list_node *list, xg_list_node *node)
with g_free. */
static char *
-get_utf8_string (str)
- char *str;
+get_utf8_string (char *str)
{
char *utf8_str = str;
@@ -526,8 +509,7 @@ get_utf8_string (str)
F is the frame we shall set geometry for. */
static void
-xg_set_geometry (f)
- FRAME_PTR f;
+xg_set_geometry (FRAME_PTR f)
{
if (f->size_hint_flags & (USPosition | PPosition))
{
@@ -558,8 +540,7 @@ xg_set_geometry (f)
and use a GtkFixed widget, this doesn't happen automatically. */
static void
-xg_clear_under_internal_border (f)
- FRAME_PTR f;
+xg_clear_under_internal_border (FRAME_PTR f)
{
if (FRAME_INTERNAL_BORDER_WIDTH (f) > 0)
{
@@ -597,9 +578,7 @@ xg_clear_under_internal_border (f)
PIXELWIDTH, PIXELHEIGHT is the new size in pixels. */
void
-xg_frame_resized (f, pixelwidth, pixelheight)
- FRAME_PTR f;
- int pixelwidth, pixelheight;
+xg_frame_resized (FRAME_PTR f, int pixelwidth, int pixelheight)
{
int rows, columns;
@@ -635,10 +614,7 @@ xg_frame_resized (f, pixelwidth, pixelheight)
COLUMNS/ROWS is the size the edit area shall have after the resize. */
void
-xg_frame_set_char_size (f, cols, rows)
- FRAME_PTR f;
- int cols;
- int rows;
+xg_frame_set_char_size (FRAME_PTR f, int cols, int rows)
{
int pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows)
+ FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f);
@@ -700,8 +676,7 @@ xg_frame_set_char_size (f, cols, rows)
The policy is to keep the number of editable lines. */
static void
-xg_height_changed (f)
- FRAME_PTR f;
+xg_height_changed (FRAME_PTR f)
{
gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
FRAME_PIXEL_WIDTH (f), FRAME_TOTAL_PIXEL_HEIGHT (f));
@@ -716,9 +691,7 @@ xg_height_changed (f)
Return 0 if no widget match WDESC. */
GtkWidget *
-xg_win_to_widget (dpy, wdesc)
- Display *dpy;
- Window wdesc;
+xg_win_to_widget (Display *dpy, Window wdesc)
{
gpointer gdkwin;
GtkWidget *gwdesc = 0;
@@ -742,10 +715,7 @@ xg_win_to_widget (dpy, wdesc)
W is the widget that color will be used for. Used to find colormap. */
static void
-xg_pix_to_gcolor (w, pixel, c)
- GtkWidget *w;
- unsigned long pixel;
- GdkColor *c;
+xg_pix_to_gcolor (GtkWidget *w, long unsigned int pixel, GdkColor *c)
{
GdkColormap *map = gtk_widget_get_colormap (w);
gdk_colormap_query_color (map, pixel, c);
@@ -755,8 +725,7 @@ xg_pix_to_gcolor (w, pixel, c)
Return 0 if creation failed, non-zero otherwise. */
int
-xg_create_frame_widgets (f)
- FRAME_PTR f;
+xg_create_frame_widgets (FRAME_PTR f)
{
GtkWidget *wtop;
GtkWidget *wvbox;
@@ -882,10 +851,7 @@ xg_create_frame_widgets (f)
flag (this is useful when FLAGS is 0). */
void
-x_wm_set_size_hint (f, flags, user_position)
- FRAME_PTR f;
- long flags;
- int user_position;
+x_wm_set_size_hint (FRAME_PTR f, long int flags, int user_position)
{
/* Must use GTK routines here, otherwise GTK resets the size hints
to its own defaults. */
@@ -981,9 +947,7 @@ x_wm_set_size_hint (f, flags, user_position)
BG is the pixel value to change to. */
void
-xg_set_background_color (f, bg)
- FRAME_PTR f;
- unsigned long bg;
+xg_set_background_color (FRAME_PTR f, long unsigned int bg)
{
if (FRAME_GTK_WIDGET (f))
{
@@ -1001,10 +965,7 @@ xg_set_background_color (f, bg)
functions so GTK does not overwrite the icon. */
void
-xg_set_frame_icon (f, icon_pixmap, icon_mask)
- FRAME_PTR f;
- Pixmap icon_pixmap;
- Pixmap icon_mask;
+xg_set_frame_icon (FRAME_PTR f, Pixmap icon_pixmap, Pixmap icon_mask)
{
GdkDisplay *gdpy = gdk_x11_lookup_xdisplay (FRAME_X_DISPLAY (f));
GdkPixmap *gpix = gdk_pixmap_foreign_new_for_display (gdpy, icon_pixmap);
@@ -1064,10 +1025,7 @@ get_dialog_title (char key)
Returns TRUE to end propagation of event. */
static gboolean
-dialog_delete_callback (w, event, user_data)
- GtkWidget *w;
- GdkEvent *event;
- gpointer user_data;
+dialog_delete_callback (GtkWidget *w, GdkEvent *event, gpointer user_data)
{
gtk_widget_unmap (w);
return TRUE;
@@ -1081,10 +1039,7 @@ dialog_delete_callback (w, event, user_data)
Returns the GTK dialog widget. */
static GtkWidget *
-create_dialog (wv, select_cb, deactivate_cb)
- widget_value *wv;
- GCallback select_cb;
- GCallback deactivate_cb;
+create_dialog (widget_value *wv, GCallback select_cb, GCallback deactivate_cb)
{
char *title = get_dialog_title (wv->name[0]);
int total_buttons = wv->name[1] - '0';
@@ -1215,8 +1170,7 @@ xg_dialog_response_cb (w,
/* Destroy the dialog. This makes it pop down. */
static Lisp_Object
-pop_down_dialog (arg)
- Lisp_Object arg;
+pop_down_dialog (Lisp_Object arg)
{
struct Lisp_Save_Value *p = XSAVE_VALUE (arg);
struct xg_dialog_data *dd = (struct xg_dialog_data *) p->pointer;
@@ -1237,8 +1191,7 @@ pop_down_dialog (arg)
We pass in DATA as gpointer* so we can use this as a callback. */
static gboolean
-xg_maybe_add_timer (data)
- gpointer data;
+xg_maybe_add_timer (gpointer data)
{
struct xg_dialog_data *dd = (struct xg_dialog_data *) data;
EMACS_TIME next_time = timer_check (1);
@@ -1262,10 +1215,7 @@ xg_maybe_add_timer (data)
The dialog W is not destroyed when this function returns. */
static int
-xg_dialog_run (f, w)
- FRAME_PTR f;
- GtkWidget *w;
-
+xg_dialog_run (FRAME_PTR f, GtkWidget *w)
{
int count = SPECPDL_INDEX ();
struct xg_dialog_data dd;
@@ -1308,7 +1258,7 @@ xg_dialog_run (f, w)
Return zero if not. */
int
-xg_uses_old_file_dialog ()
+xg_uses_old_file_dialog (void)
{
#ifdef HAVE_GTK_FILE_SELECTION_NEW
extern int x_gtk_use_old_file_dialog;
@@ -1325,8 +1275,7 @@ typedef char * (*xg_get_file_func) (GtkWidget *);
The returned string must be free:d. */
static char *
-xg_get_file_name_from_chooser (w)
- GtkWidget *w;
+xg_get_file_name_from_chooser (GtkWidget *w)
{
return gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (w));
}
@@ -1335,9 +1284,7 @@ xg_get_file_name_from_chooser (w)
WIDGET is the toggle widget, DATA is the file chooser dialog. */
static void
-xg_toggle_visibility_cb (widget, data)
- GtkWidget *widget;
- gpointer data;
+xg_toggle_visibility_cb (GtkWidget *widget, gpointer data)
{
GtkFileChooser *dialog = GTK_FILE_CHOOSER (data);
gboolean visible;
@@ -1353,10 +1300,7 @@ xg_toggle_visibility_cb (widget, data)
changes that property by right clicking in the file list. */
static void
-xg_toggle_notify_cb (gobject, arg1, user_data)
- GObject *gobject;
- GParamSpec *arg1;
- gpointer user_data;
+xg_toggle_notify_cb (GObject *gobject, GParamSpec *arg1, gpointer user_data)
{
extern int x_gtk_show_hidden_files;
@@ -1503,8 +1447,7 @@ xg_get_file_with_chooser (f, prompt, default_filename,
The returned string must be free:d. */
static char *
-xg_get_file_name_from_selector (w)
- GtkWidget *w;
+xg_get_file_name_from_selector (GtkWidget *w)
{
GtkFileSelection *filesel = GTK_FILE_SELECTION (w);
return xstrdup ((char*) gtk_file_selection_get_filename (filesel));
@@ -1565,11 +1508,7 @@ xg_get_file_with_selection (f, prompt, default_filename,
The returned string must be freed by the caller. */
char *
-xg_get_file_name (f, prompt, default_filename, mustmatch_p, only_dir_p)
- FRAME_PTR f;
- char *prompt;
- char *default_filename;
- int mustmatch_p, only_dir_p;
+xg_get_file_name (FRAME_PTR f, char *prompt, char *default_filename, int mustmatch_p, int only_dir_p)
{
GtkWidget *w = 0;
char *fn = 0;
@@ -1623,9 +1562,7 @@ xg_get_file_name (f, prompt, default_filename, mustmatch_p, only_dir_p)
DEFAULT_NAME, if non-zero, is the default font name. */
char *
-xg_get_font_name (f, default_name)
- FRAME_PTR f;
- char *default_name;
+xg_get_font_name (FRAME_PTR f, char *default_name)
{
GtkWidget *w;
char *fontname = NULL;
@@ -1690,10 +1627,7 @@ static xg_list_node xg_menu_item_cb_list;
allocated xg_menu_cb_data if CL_DATA is NULL. */
static xg_menu_cb_data *
-make_cl_data (cl_data, f, highlight_cb)
- xg_menu_cb_data *cl_data;
- FRAME_PTR f;
- GCallback highlight_cb;
+make_cl_data (xg_menu_cb_data *cl_data, FRAME_PTR f, GCallback highlight_cb)
{
if (! cl_data)
{
@@ -1724,10 +1658,7 @@ make_cl_data (cl_data, f, highlight_cb)
creating the menu bar. */
static void
-update_cl_data (cl_data, f, highlight_cb)
- xg_menu_cb_data *cl_data;
- FRAME_PTR f;
- GCallback highlight_cb;
+update_cl_data (xg_menu_cb_data *cl_data, FRAME_PTR f, GCallback highlight_cb)
{
if (cl_data)
{
@@ -1742,8 +1673,7 @@ update_cl_data (cl_data, f, highlight_cb)
If reference count is zero, free CL_DATA. */
static void
-unref_cl_data (cl_data)
- xg_menu_cb_data *cl_data;
+unref_cl_data (xg_menu_cb_data *cl_data)
{
if (cl_data && cl_data->ref_count > 0)
{
@@ -1759,7 +1689,7 @@ unref_cl_data (cl_data)
/* Function that marks all lisp data during GC. */
void
-xg_mark_data ()
+xg_mark_data (void)
{
xg_list_node *iter;
@@ -1781,9 +1711,7 @@ xg_mark_data ()
CLIENT_DATA points to the xg_menu_item_cb_data associated with the W. */
static void
-menuitem_destroy_callback (w, client_data)
- GtkWidget *w;
- gpointer client_data;
+menuitem_destroy_callback (GtkWidget *w, gpointer client_data)
{
if (client_data)
{
@@ -1801,10 +1729,7 @@ menuitem_destroy_callback (w, client_data)
Returns FALSE to tell GTK to keep processing this event. */
static gboolean
-menuitem_highlight_callback (w, event, client_data)
- GtkWidget *w;
- GdkEventCrossing *event;
- gpointer client_data;
+menuitem_highlight_callback (GtkWidget *w, GdkEventCrossing *event, gpointer client_data)
{
GdkEvent ev;
GtkWidget *subwidget;
@@ -1832,9 +1757,7 @@ menuitem_highlight_callback (w, event, client_data)
CLIENT_DATA points to the xg_menu_cb_data associated with W. */
static void
-menu_destroy_callback (w, client_data)
- GtkWidget *w;
- gpointer client_data;
+menu_destroy_callback (GtkWidget *w, gpointer client_data)
{
unref_cl_data ((xg_menu_cb_data*) client_data);
}
@@ -1845,9 +1768,7 @@ menu_destroy_callback (w, client_data)
Returns the GtkHBox. */
static GtkWidget *
-make_widget_for_menu_item (utf8_label, utf8_key)
- char *utf8_label;
- char *utf8_key;
+make_widget_for_menu_item (char *utf8_label, char *utf8_key)
{
GtkWidget *wlbl;
GtkWidget *wkey;
@@ -1885,11 +1806,7 @@ make_widget_for_menu_item (utf8_label, utf8_key)
but the MacOS X version doesn't either, so I guess that is OK. */
static GtkWidget *
-make_menu_item (utf8_label, utf8_key, item, group)
- char *utf8_label;
- char *utf8_key;
- widget_value *item;
- GSList **group;
+make_menu_item (char *utf8_label, char *utf8_key, widget_value *item, GSList **group)
{
GtkWidget *w;
GtkWidget *wtoadd = 0;
@@ -1984,7 +1901,7 @@ static int xg_detached_menus;
/* Returns non-zero if there are detached menus. */
int
-xg_have_tear_offs ()
+xg_have_tear_offs (void)
{
return xg_detached_menus > 0;
}
@@ -1995,9 +1912,7 @@ xg_have_tear_offs ()
CLIENT_DATA is not used. */
static void
-tearoff_remove (widget, client_data)
- GtkWidget *widget;
- gpointer client_data;
+tearoff_remove (GtkWidget *widget, gpointer client_data)
{
if (xg_detached_menus > 0) --xg_detached_menus;
}
@@ -2008,9 +1923,7 @@ tearoff_remove (widget, client_data)
CLIENT_DATA is not used. */
static void
-tearoff_activate (widget, client_data)
- GtkWidget *widget;
- gpointer client_data;
+tearoff_activate (GtkWidget *widget, gpointer client_data)
{
GtkWidget *menu = gtk_widget_get_parent (widget);
if (gtk_menu_get_tearoff_state (GTK_MENU (menu)))
@@ -2038,13 +1951,7 @@ tearoff_activate (widget, client_data)
Returns the created GtkWidget. */
static GtkWidget *
-xg_create_one_menuitem (item, f, select_cb, highlight_cb, cl_data, group)
- widget_value *item;
- FRAME_PTR f;
- GCallback select_cb;
- GCallback highlight_cb;
- xg_menu_cb_data *cl_data;
- GSList **group;
+xg_create_one_menuitem (widget_value *item, FRAME_PTR f, GCallback select_cb, GCallback highlight_cb, xg_menu_cb_data *cl_data, GSList **group)
{
char *utf8_label;
char *utf8_key;
@@ -2317,8 +2224,7 @@ xg_create_widget (type, name, f, val,
/* Return the label for menu item WITEM. */
static const char *
-xg_get_menu_item_label (witem)
- GtkMenuItem *witem;
+xg_get_menu_item_label (GtkMenuItem *witem)
{
GtkLabel *wlabel = GTK_LABEL (gtk_bin_get_child (GTK_BIN (witem)));
return gtk_label_get_label (wlabel);
@@ -2327,9 +2233,7 @@ xg_get_menu_item_label (witem)
/* Return non-zero if the menu item WITEM has the text LABEL. */
static int
-xg_item_label_same_p (witem, label)
- GtkMenuItem *witem;
- char *label;
+xg_item_label_same_p (GtkMenuItem *witem, char *label)
{
int is_same = 0;
char *utf8_label = get_utf8_string (label);
@@ -2348,8 +2252,7 @@ xg_item_label_same_p (witem, label)
/* Destroy widgets in LIST. */
static void
-xg_destroy_widgets (list)
- GList *list;
+xg_destroy_widgets (GList *list)
{
GList *iter;
@@ -2561,12 +2464,7 @@ xg_update_menubar (menubar, f, list, iter, pos, val,
CL_DATA is the data to set in the widget for menu invocation. */
static void
-xg_update_menu_item (val, w, select_cb, highlight_cb, cl_data)
- widget_value *val;
- GtkWidget *w;
- GCallback select_cb;
- GCallback highlight_cb;
- xg_menu_cb_data *cl_data;
+xg_update_menu_item (widget_value *val, GtkWidget *w, GCallback select_cb, GCallback highlight_cb, xg_menu_cb_data *cl_data)
{
GtkWidget *wchild;
GtkLabel *wlbl = 0;
@@ -2666,9 +2564,7 @@ xg_update_menu_item (val, w, select_cb, highlight_cb, cl_data)
/* Update the toggle menu item W so it corresponds to VAL. */
static void
-xg_update_toggle_item (val, w)
- widget_value *val;
- GtkWidget *w;
+xg_update_toggle_item (widget_value *val, GtkWidget *w)
{
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (w), val->selected);
}
@@ -2676,9 +2572,7 @@ xg_update_toggle_item (val, w)
/* Update the radio menu item W so it corresponds to VAL. */
static void
-xg_update_radio_item (val, w)
- widget_value *val;
- GtkWidget *w;
+xg_update_radio_item (widget_value *val, GtkWidget *w)
{
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (w), val->selected);
}
@@ -2915,8 +2809,7 @@ xg_modify_menubar_widgets (menubar, f, val, deep_p,
changed. Value is non-zero if widgets were updated. */
int
-xg_update_frame_menubar (f)
- FRAME_PTR f;
+xg_update_frame_menubar (FRAME_PTR f)
{
struct x_output *x = f->output_data.x;
GtkRequisition req;
@@ -2946,8 +2839,7 @@ xg_update_frame_menubar (f)
This is used when deleting a frame, and when turning off the menu bar. */
void
-free_frame_menubar (f)
- FRAME_PTR f;
+free_frame_menubar (FRAME_PTR f)
{
struct x_output *x = f->output_data.x;
@@ -2995,8 +2887,7 @@ static struct
/* Store the widget pointer W in id_to_widget and return the integer index. */
static int
-xg_store_widget_in_map (w)
- GtkWidget *w;
+xg_store_widget_in_map (GtkWidget *w)
{
int i;
@@ -3034,8 +2925,7 @@ xg_store_widget_in_map (w)
Called when scroll bar is destroyed. */
static void
-xg_remove_widget_from_map (idx)
- int idx;
+xg_remove_widget_from_map (int idx)
{
if (idx < id_to_widget.max_size && id_to_widget.widgets[idx] != 0)
{
@@ -3047,8 +2937,7 @@ xg_remove_widget_from_map (idx)
/* Get the widget pointer at IDX from id_to_widget. */
static GtkWidget *
-xg_get_widget_from_map (idx)
- int idx;
+xg_get_widget_from_map (int idx)
{
if (idx < id_to_widget.max_size && id_to_widget.widgets[idx] != 0)
return id_to_widget.widgets[idx];
@@ -3060,9 +2949,7 @@ xg_get_widget_from_map (idx)
Return -1 if WID not in id_to_widget. */
int
-xg_get_scroll_id_for_window (dpy, wid)
- Display *dpy;
- Window wid;
+xg_get_scroll_id_for_window (Display *dpy, Window wid)
{
int idx;
GtkWidget *w;
@@ -3084,9 +2971,7 @@ xg_get_scroll_id_for_window (dpy, wid)
We free pointer to last scroll bar values here and remove the index. */
static void
-xg_gtk_scroll_destroy (widget, data)
- GtkWidget *widget;
- gpointer data;
+xg_gtk_scroll_destroy (GtkWidget *widget, gpointer data)
{
int id = (int) (EMACS_INT) data; /* The EMACS_INT cast avoids a warning. */
xg_remove_widget_from_map (id);
@@ -3101,11 +2986,7 @@ xg_gtk_scroll_destroy (widget, data)
to set resources for the widget. */
void
-xg_create_scroll_bar (f, bar, scroll_callback, end_callback, scroll_bar_name)
- FRAME_PTR f;
- struct scroll_bar *bar;
- GCallback scroll_callback, end_callback;
- char *scroll_bar_name;
+xg_create_scroll_bar (FRAME_PTR f, struct scroll_bar *bar, GCallback scroll_callback, GCallback end_callback, char *scroll_bar_name)
{
GtkWidget *wscroll;
GtkWidget *webox;
@@ -3158,9 +3039,7 @@ xg_create_scroll_bar (f, bar, scroll_callback, end_callback, scroll_bar_name)
/* Remove the scroll bar represented by SCROLLBAR_ID from the frame F. */
void
-xg_remove_scroll_bar (f, scrollbar_id)
- FRAME_PTR f;
- int scrollbar_id;
+xg_remove_scroll_bar (FRAME_PTR f, int scrollbar_id)
{
GtkWidget *w = xg_get_widget_from_map (scrollbar_id);
if (w)
@@ -3178,13 +3057,7 @@ xg_remove_scroll_bar (f, scrollbar_id)
WIDTH, HEIGHT is the size in pixels the bar shall have. */
void
-xg_update_scrollbar_pos (f, scrollbar_id, top, left, width, height)
- FRAME_PTR f;
- int scrollbar_id;
- int top;
- int left;
- int width;
- int height;
+xg_update_scrollbar_pos (FRAME_PTR f, int scrollbar_id, int top, int left, int width, int height)
{
GtkWidget *wscroll = xg_get_widget_from_map (scrollbar_id);
@@ -3245,9 +3118,7 @@ xg_update_scrollbar_pos (f, scrollbar_id, top, left, width, height)
displaying PORTION out of a whole WHOLE, and our position POSITION. */
void
-xg_set_toolkit_scroll_bar_thumb (bar, portion, position, whole)
- struct scroll_bar *bar;
- int portion, position, whole;
+xg_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar, int portion, int position, int whole)
{
GtkWidget *wscroll = xg_get_widget_from_map (bar->x_window);
@@ -3329,9 +3200,7 @@ xg_set_toolkit_scroll_bar_thumb (bar, portion, position, whole)
Return non-zero if the event is for a scroll bar, zero otherwise. */
int
-xg_event_is_for_scrollbar (f, event)
- FRAME_PTR f;
- XEvent *event;
+xg_event_is_for_scrollbar (FRAME_PTR f, XEvent *event)
{
int retval = 0;
@@ -3386,10 +3255,7 @@ xg_event_is_for_scrollbar (f, event)
tool bar. 0 is the first button. */
static gboolean
-xg_tool_bar_button_cb (widget, event, user_data)
- GtkWidget *widget;
- GdkEventButton *event;
- gpointer user_data;
+xg_tool_bar_button_cb (GtkWidget *widget, GdkEventButton *event, gpointer user_data)
{
/* Casts to avoid warnings when gpointer is 64 bits and int is 32 bits */
gpointer ptr = (gpointer) (EMACS_INT) event->state;
@@ -3404,9 +3270,7 @@ xg_tool_bar_button_cb (widget, event, user_data)
tool bar. 0 is the first button. */
static void
-xg_tool_bar_callback (w, client_data)
- GtkWidget *w;
- gpointer client_data;
+xg_tool_bar_callback (GtkWidget *w, gpointer client_data)
{
/* The EMACS_INT cast avoids a warning. */
int idx = (int) (EMACS_INT) client_data;
@@ -3455,9 +3319,7 @@ xg_tool_bar_callback (w, client_data)
tool bar. 0 is the first button. */
static void
-xg_tool_bar_proxy_callback (w, client_data)
- GtkWidget *w;
- gpointer client_data;
+xg_tool_bar_proxy_callback (GtkWidget *w, gpointer client_data)
{
GtkWidget *wbutton = GTK_WIDGET (g_object_get_data (G_OBJECT (w),
XG_TOOL_BAR_PROXY_BUTTON));
@@ -3474,10 +3336,7 @@ xg_tool_bar_help_callback (GtkWidget *w,
the detached tool bar when the detached tool bar it is not expanded. */
static gboolean
-xg_tool_bar_proxy_help_callback (w, event, client_data)
- GtkWidget *w;
- GdkEventCrossing *event;
- gpointer client_data;
+xg_tool_bar_proxy_help_callback (GtkWidget *w, GdkEventCrossing *event, gpointer client_data)
{
GtkWidget *wbutton = GTK_WIDGET (g_object_get_data (G_OBJECT (w),
XG_TOOL_BAR_PROXY_BUTTON));
@@ -3503,9 +3362,7 @@ xg_get_tool_bar_widgets (GtkWidget *vb, GtkWidget **wimage)
blank. */
static gboolean
-xg_tool_bar_menu_proxy (toolitem, user_data)
- GtkToolItem *toolitem;
- gpointer user_data;
+xg_tool_bar_menu_proxy (GtkToolItem *toolitem, gpointer user_data)
{
GtkWidget *weventbox = gtk_bin_get_child (GTK_BIN (toolitem));
GtkButton *wbutton = GTK_BUTTON (gtk_bin_get_child (GTK_BIN (weventbox)));
@@ -3615,10 +3472,7 @@ xg_tool_bar_menu_proxy (toolitem, user_data)
CLIENT_DATA is a pointer to the frame the tool bar belongs to. */
static void
-xg_tool_bar_detach_callback (wbox, w, client_data)
- GtkHandleBox *wbox;
- GtkWidget *w;
- gpointer client_data;
+xg_tool_bar_detach_callback (GtkHandleBox *wbox, GtkWidget *w, gpointer client_data)
{
FRAME_PTR f = (FRAME_PTR) client_data;
extern int x_gtk_whole_detached_tool_bar;
@@ -3646,10 +3500,7 @@ xg_tool_bar_detach_callback (wbox, w, client_data)
CLIENT_DATA is a pointer to the frame the tool bar belongs to. */
static void
-xg_tool_bar_attach_callback (wbox, w, client_data)
- GtkHandleBox *wbox;
- GtkWidget *w;
- gpointer client_data;
+xg_tool_bar_attach_callback (GtkHandleBox *wbox, GtkWidget *w, gpointer client_data)
{
FRAME_PTR f = (FRAME_PTR) client_data;
g_object_set (G_OBJECT (w), "show-arrow", TRUE, NULL);
@@ -3676,10 +3527,7 @@ xg_tool_bar_attach_callback (wbox, w, client_data)
Returns FALSE to tell GTK to keep processing this event. */
static gboolean
-xg_tool_bar_help_callback (w, event, client_data)
- GtkWidget *w;
- GdkEventCrossing *event;
- gpointer client_data;
+xg_tool_bar_help_callback (GtkWidget *w, GdkEventCrossing *event, gpointer client_data)
{
/* The EMACS_INT cast avoids a warning. */
int idx = (int) (EMACS_INT) client_data;
@@ -3718,10 +3566,7 @@ xg_tool_bar_help_callback (w, event, client_data)
Returns FALSE to tell GTK to keep processing this event. */
static gboolean
-xg_tool_bar_item_expose_callback (w, event, client_data)
- GtkWidget *w;
- GdkEventExpose *event;
- gpointer client_data;
+xg_tool_bar_item_expose_callback (GtkWidget *w, GdkEventExpose *event, gpointer client_data)
{
gint width, height;
@@ -3742,8 +3587,7 @@ xg_tool_bar_item_expose_callback (w, event, client_data)
/* Attach a tool bar to frame F. */
static void
-xg_pack_tool_bar (f)
- FRAME_PTR f;
+xg_pack_tool_bar (FRAME_PTR f)
{
struct x_output *x = f->output_data.x;
int vbox_pos = x->menubar_widget ? 1 : 0;
@@ -3777,8 +3621,7 @@ xg_pack_tool_bar (f)
#endif
static void
-xg_create_tool_bar (f)
- FRAME_PTR f;
+xg_create_tool_bar (FRAME_PTR f)
{
struct x_output *x = f->output_data.x;
@@ -3799,10 +3642,7 @@ xg_create_tool_bar (f)
Returns IMAGE if RTL is not found. */
static Lisp_Object
-find_rtl_image (f, image, rtl)
- FRAME_PTR f;
- Lisp_Object image;
- Lisp_Object rtl;
+find_rtl_image (FRAME_PTR f, Lisp_Object image, Lisp_Object rtl)
{
int i;
Lisp_Object file, rtl_name;
@@ -3955,8 +3795,7 @@ xg_show_toolbar_item (GtkToolItem *ti)
extern Lisp_Object Qx_gtk_map_stock;
void
-update_frame_tool_bar (f)
- FRAME_PTR f;
+update_frame_tool_bar (FRAME_PTR f)
{
int i;
GtkRequisition old_req, new_req;
@@ -4237,8 +4076,7 @@ update_frame_tool_bar (f)
Remove the tool bar. */
void
-free_frame_tool_bar (f)
- FRAME_PTR f;
+free_frame_tool_bar (FRAME_PTR f)
{
struct x_output *x = f->output_data.x;
@@ -4269,7 +4107,7 @@ free_frame_tool_bar (f)
Initializing
***********************************************************************/
void
-xg_initialize ()
+xg_initialize (void)
{
GtkBindingSet *binding_set;