diff options
| author | Dan Nicolaescu | 2010-07-04 00:50:25 -0700 |
|---|---|---|
| committer | Dan Nicolaescu | 2010-07-04 00:50:25 -0700 |
| commit | 971de7fb158335fbda39525feb2d7776a26bc030 (patch) | |
| tree | 605333d85f16e35bb06baffcb66ac49f4ec0dce9 /src/gtkutil.c | |
| parent | b8463cbfbe2c5183cf40772df2746e58b787ddeb (diff) | |
| download | emacs-971de7fb158335fbda39525feb2d7776a26bc030.tar.gz emacs-971de7fb158335fbda39525feb2d7776a26bc030.zip | |
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.c | 320 |
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; | |||
| 85 | W can be a GtkMenu or a GtkWindow widget. */ | 85 | W can be a GtkMenu or a GtkWindow widget. */ |
| 86 | 86 | ||
| 87 | static void | 87 | static void |
| 88 | xg_set_screen (w, f) | 88 | xg_set_screen (GtkWidget *w, FRAME_PTR f) |
| 89 | GtkWidget *w; | ||
| 90 | FRAME_PTR f; | ||
| 91 | { | 89 | { |
| 92 | if (FRAME_X_DISPLAY (f) != GDK_DISPLAY ()) | 90 | if (FRAME_X_DISPLAY (f) != GDK_DISPLAY ()) |
| 93 | { | 91 | { |
| @@ -110,9 +108,7 @@ xg_set_screen (w, f) | |||
| 110 | multipe displays. */ | 108 | multipe displays. */ |
| 111 | 109 | ||
| 112 | void | 110 | void |
| 113 | xg_display_open (display_name, dpy) | 111 | xg_display_open (char *display_name, Display **dpy) |
| 114 | char *display_name; | ||
| 115 | Display **dpy; | ||
| 116 | { | 112 | { |
| 117 | GdkDisplay *gdpy; | 113 | GdkDisplay *gdpy; |
| 118 | 114 | ||
| @@ -180,7 +176,7 @@ static int malloc_cpt; | |||
| 180 | Return a pointer to the allocated structure. */ | 176 | Return a pointer to the allocated structure. */ |
| 181 | 177 | ||
| 182 | widget_value * | 178 | widget_value * |
| 183 | malloc_widget_value () | 179 | malloc_widget_value (void) |
| 184 | { | 180 | { |
| 185 | widget_value *wv; | 181 | widget_value *wv; |
| 186 | if (widget_value_free_list) | 182 | if (widget_value_free_list) |
| @@ -202,8 +198,7 @@ malloc_widget_value () | |||
| 202 | by malloc_widget_value, and no substructures. */ | 198 | by malloc_widget_value, and no substructures. */ |
| 203 | 199 | ||
| 204 | void | 200 | void |
| 205 | free_widget_value (wv) | 201 | free_widget_value (widget_value *wv) |
| 206 | widget_value *wv; | ||
| 207 | { | 202 | { |
| 208 | if (wv->free_list) | 203 | if (wv->free_list) |
| 209 | abort (); | 204 | abort (); |
| @@ -227,8 +222,7 @@ free_widget_value (wv) | |||
| 227 | scroll bars on display DPY. */ | 222 | scroll bars on display DPY. */ |
| 228 | 223 | ||
| 229 | GdkCursor * | 224 | GdkCursor * |
| 230 | xg_create_default_cursor (dpy) | 225 | xg_create_default_cursor (Display *dpy) |
| 231 | Display *dpy; | ||
| 232 | { | 226 | { |
| 233 | GdkDisplay *gdpy = gdk_x11_lookup_xdisplay (dpy); | 227 | GdkDisplay *gdpy = gdk_x11_lookup_xdisplay (dpy); |
| 234 | return gdk_cursor_new_for_display (gdpy, GDK_LEFT_PTR); | 228 | return gdk_cursor_new_for_display (gdpy, GDK_LEFT_PTR); |
| @@ -237,10 +231,7 @@ xg_create_default_cursor (dpy) | |||
| 237 | /* Apply GMASK to GPIX and return a GdkPixbuf with an alpha channel. */ | 231 | /* Apply GMASK to GPIX and return a GdkPixbuf with an alpha channel. */ |
| 238 | 232 | ||
| 239 | static GdkPixbuf * | 233 | static GdkPixbuf * |
| 240 | xg_get_pixbuf_from_pix_and_mask (gpix, gmask, cmap) | 234 | xg_get_pixbuf_from_pix_and_mask (GdkPixmap *gpix, GdkPixmap *gmask, GdkColormap *cmap) |
| 241 | GdkPixmap *gpix; | ||
| 242 | GdkPixmap *gmask; | ||
| 243 | GdkColormap *cmap; | ||
| 244 | { | 235 | { |
| 245 | int width, height; | 236 | int width, height; |
| 246 | GdkPixbuf *icon_buf, *tmp_buf; | 237 | GdkPixbuf *icon_buf, *tmp_buf; |
| @@ -291,8 +282,7 @@ xg_get_pixbuf_from_pix_and_mask (gpix, gmask, cmap) | |||
| 291 | } | 282 | } |
| 292 | 283 | ||
| 293 | static Lisp_Object | 284 | static Lisp_Object |
| 294 | file_for_image (image) | 285 | file_for_image (Lisp_Object image) |
| 295 | Lisp_Object image; | ||
| 296 | { | 286 | { |
| 297 | Lisp_Object specified_file = Qnil; | 287 | Lisp_Object specified_file = Qnil; |
| 298 | Lisp_Object tail; | 288 | Lisp_Object tail; |
| @@ -319,11 +309,7 @@ file_for_image (image) | |||
| 319 | If OLD_WIDGET is not NULL, that widget is modified. */ | 309 | If OLD_WIDGET is not NULL, that widget is modified. */ |
| 320 | 310 | ||
| 321 | static GtkWidget * | 311 | static GtkWidget * |
| 322 | xg_get_image_for_pixmap (f, img, widget, old_widget) | 312 | xg_get_image_for_pixmap (FRAME_PTR f, struct image *img, GtkWidget *widget, GtkImage *old_widget) |
| 323 | FRAME_PTR f; | ||
| 324 | struct image *img; | ||
| 325 | GtkWidget *widget; | ||
| 326 | GtkImage *old_widget; | ||
| 327 | { | 313 | { |
| 328 | GdkPixmap *gpix; | 314 | GdkPixmap *gpix; |
| 329 | GdkPixmap *gmask; | 315 | GdkPixmap *gmask; |
| @@ -391,9 +377,7 @@ xg_get_image_for_pixmap (f, img, widget, old_widget) | |||
| 391 | and it is those widgets that are visible. */ | 377 | and it is those widgets that are visible. */ |
| 392 | 378 | ||
| 393 | static void | 379 | static void |
| 394 | xg_set_cursor (w, cursor) | 380 | xg_set_cursor (GtkWidget *w, GdkCursor *cursor) |
| 395 | GtkWidget *w; | ||
| 396 | GdkCursor *cursor; | ||
| 397 | { | 381 | { |
| 398 | GdkWindow *window = gtk_widget_get_window(w); | 382 | GdkWindow *window = gtk_widget_get_window(w); |
| 399 | GList *children = gdk_window_peek_children (window); | 383 | GList *children = gdk_window_peek_children (window); |
| @@ -446,8 +430,7 @@ xg_list_remove (xg_list_node *list, xg_list_node *node) | |||
| 446 | with g_free. */ | 430 | with g_free. */ |
| 447 | 431 | ||
| 448 | static char * | 432 | static char * |
| 449 | get_utf8_string (str) | 433 | get_utf8_string (char *str) |
| 450 | char *str; | ||
| 451 | { | 434 | { |
| 452 | char *utf8_str = str; | 435 | char *utf8_str = str; |
| 453 | 436 | ||
| @@ -526,8 +509,7 @@ get_utf8_string (str) | |||
| 526 | F is the frame we shall set geometry for. */ | 509 | F is the frame we shall set geometry for. */ |
| 527 | 510 | ||
| 528 | static void | 511 | static void |
| 529 | xg_set_geometry (f) | 512 | xg_set_geometry (FRAME_PTR f) |
| 530 | FRAME_PTR f; | ||
| 531 | { | 513 | { |
| 532 | if (f->size_hint_flags & (USPosition | PPosition)) | 514 | if (f->size_hint_flags & (USPosition | PPosition)) |
| 533 | { | 515 | { |
| @@ -558,8 +540,7 @@ xg_set_geometry (f) | |||
| 558 | and use a GtkFixed widget, this doesn't happen automatically. */ | 540 | and use a GtkFixed widget, this doesn't happen automatically. */ |
| 559 | 541 | ||
| 560 | static void | 542 | static void |
| 561 | xg_clear_under_internal_border (f) | 543 | xg_clear_under_internal_border (FRAME_PTR f) |
| 562 | FRAME_PTR f; | ||
| 563 | { | 544 | { |
| 564 | if (FRAME_INTERNAL_BORDER_WIDTH (f) > 0) | 545 | if (FRAME_INTERNAL_BORDER_WIDTH (f) > 0) |
| 565 | { | 546 | { |
| @@ -597,9 +578,7 @@ xg_clear_under_internal_border (f) | |||
| 597 | PIXELWIDTH, PIXELHEIGHT is the new size in pixels. */ | 578 | PIXELWIDTH, PIXELHEIGHT is the new size in pixels. */ |
| 598 | 579 | ||
| 599 | void | 580 | void |
| 600 | xg_frame_resized (f, pixelwidth, pixelheight) | 581 | xg_frame_resized (FRAME_PTR f, int pixelwidth, int pixelheight) |
| 601 | FRAME_PTR f; | ||
| 602 | int pixelwidth, pixelheight; | ||
| 603 | { | 582 | { |
| 604 | int rows, columns; | 583 | int rows, columns; |
| 605 | 584 | ||
| @@ -635,10 +614,7 @@ xg_frame_resized (f, pixelwidth, pixelheight) | |||
| 635 | COLUMNS/ROWS is the size the edit area shall have after the resize. */ | 614 | COLUMNS/ROWS is the size the edit area shall have after the resize. */ |
| 636 | 615 | ||
| 637 | void | 616 | void |
| 638 | xg_frame_set_char_size (f, cols, rows) | 617 | xg_frame_set_char_size (FRAME_PTR f, int cols, int rows) |
| 639 | FRAME_PTR f; | ||
| 640 | int cols; | ||
| 641 | int rows; | ||
| 642 | { | 618 | { |
| 643 | int pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows) | 619 | int pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows) |
| 644 | + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f); | 620 | + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f); |
| @@ -700,8 +676,7 @@ xg_frame_set_char_size (f, cols, rows) | |||
| 700 | The policy is to keep the number of editable lines. */ | 676 | The policy is to keep the number of editable lines. */ |
| 701 | 677 | ||
| 702 | static void | 678 | static void |
| 703 | xg_height_changed (f) | 679 | xg_height_changed (FRAME_PTR f) |
| 704 | FRAME_PTR f; | ||
| 705 | { | 680 | { |
| 706 | gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), | 681 | gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), |
| 707 | FRAME_PIXEL_WIDTH (f), FRAME_TOTAL_PIXEL_HEIGHT (f)); | 682 | FRAME_PIXEL_WIDTH (f), FRAME_TOTAL_PIXEL_HEIGHT (f)); |
| @@ -716,9 +691,7 @@ xg_height_changed (f) | |||
| 716 | Return 0 if no widget match WDESC. */ | 691 | Return 0 if no widget match WDESC. */ |
| 717 | 692 | ||
| 718 | GtkWidget * | 693 | GtkWidget * |
| 719 | xg_win_to_widget (dpy, wdesc) | 694 | xg_win_to_widget (Display *dpy, Window wdesc) |
| 720 | Display *dpy; | ||
| 721 | Window wdesc; | ||
| 722 | { | 695 | { |
| 723 | gpointer gdkwin; | 696 | gpointer gdkwin; |
| 724 | GtkWidget *gwdesc = 0; | 697 | GtkWidget *gwdesc = 0; |
| @@ -742,10 +715,7 @@ xg_win_to_widget (dpy, wdesc) | |||
| 742 | W is the widget that color will be used for. Used to find colormap. */ | 715 | W is the widget that color will be used for. Used to find colormap. */ |
| 743 | 716 | ||
| 744 | static void | 717 | static void |
| 745 | xg_pix_to_gcolor (w, pixel, c) | 718 | xg_pix_to_gcolor (GtkWidget *w, long unsigned int pixel, GdkColor *c) |
| 746 | GtkWidget *w; | ||
| 747 | unsigned long pixel; | ||
| 748 | GdkColor *c; | ||
| 749 | { | 719 | { |
| 750 | GdkColormap *map = gtk_widget_get_colormap (w); | 720 | GdkColormap *map = gtk_widget_get_colormap (w); |
| 751 | gdk_colormap_query_color (map, pixel, c); | 721 | gdk_colormap_query_color (map, pixel, c); |
| @@ -755,8 +725,7 @@ xg_pix_to_gcolor (w, pixel, c) | |||
| 755 | Return 0 if creation failed, non-zero otherwise. */ | 725 | Return 0 if creation failed, non-zero otherwise. */ |
| 756 | 726 | ||
| 757 | int | 727 | int |
| 758 | xg_create_frame_widgets (f) | 728 | xg_create_frame_widgets (FRAME_PTR f) |
| 759 | FRAME_PTR f; | ||
| 760 | { | 729 | { |
| 761 | GtkWidget *wtop; | 730 | GtkWidget *wtop; |
| 762 | GtkWidget *wvbox; | 731 | GtkWidget *wvbox; |
| @@ -882,10 +851,7 @@ xg_create_frame_widgets (f) | |||
| 882 | flag (this is useful when FLAGS is 0). */ | 851 | flag (this is useful when FLAGS is 0). */ |
| 883 | 852 | ||
| 884 | void | 853 | void |
| 885 | x_wm_set_size_hint (f, flags, user_position) | 854 | x_wm_set_size_hint (FRAME_PTR f, long int flags, int user_position) |
| 886 | FRAME_PTR f; | ||
| 887 | long flags; | ||
| 888 | int user_position; | ||
| 889 | { | 855 | { |
| 890 | /* Must use GTK routines here, otherwise GTK resets the size hints | 856 | /* Must use GTK routines here, otherwise GTK resets the size hints |
| 891 | to its own defaults. */ | 857 | to its own defaults. */ |
| @@ -981,9 +947,7 @@ x_wm_set_size_hint (f, flags, user_position) | |||
| 981 | BG is the pixel value to change to. */ | 947 | BG is the pixel value to change to. */ |
| 982 | 948 | ||
| 983 | void | 949 | void |
| 984 | xg_set_background_color (f, bg) | 950 | xg_set_background_color (FRAME_PTR f, long unsigned int bg) |
| 985 | FRAME_PTR f; | ||
| 986 | unsigned long bg; | ||
| 987 | { | 951 | { |
| 988 | if (FRAME_GTK_WIDGET (f)) | 952 | if (FRAME_GTK_WIDGET (f)) |
| 989 | { | 953 | { |
| @@ -1001,10 +965,7 @@ xg_set_background_color (f, bg) | |||
| 1001 | functions so GTK does not overwrite the icon. */ | 965 | functions so GTK does not overwrite the icon. */ |
| 1002 | 966 | ||
| 1003 | void | 967 | void |
| 1004 | xg_set_frame_icon (f, icon_pixmap, icon_mask) | 968 | xg_set_frame_icon (FRAME_PTR f, Pixmap icon_pixmap, Pixmap icon_mask) |
| 1005 | FRAME_PTR f; | ||
| 1006 | Pixmap icon_pixmap; | ||
| 1007 | Pixmap icon_mask; | ||
| 1008 | { | 969 | { |
| 1009 | GdkDisplay *gdpy = gdk_x11_lookup_xdisplay (FRAME_X_DISPLAY (f)); | 970 | GdkDisplay *gdpy = gdk_x11_lookup_xdisplay (FRAME_X_DISPLAY (f)); |
| 1010 | GdkPixmap *gpix = gdk_pixmap_foreign_new_for_display (gdpy, icon_pixmap); | 971 | GdkPixmap *gpix = gdk_pixmap_foreign_new_for_display (gdpy, icon_pixmap); |
| @@ -1064,10 +1025,7 @@ get_dialog_title (char key) | |||
| 1064 | Returns TRUE to end propagation of event. */ | 1025 | Returns TRUE to end propagation of event. */ |
| 1065 | 1026 | ||
| 1066 | static gboolean | 1027 | static gboolean |
| 1067 | dialog_delete_callback (w, event, user_data) | 1028 | dialog_delete_callback (GtkWidget *w, GdkEvent *event, gpointer user_data) |
| 1068 | GtkWidget *w; | ||
| 1069 | GdkEvent *event; | ||
| 1070 | gpointer user_data; | ||
| 1071 | { | 1029 | { |
| 1072 | gtk_widget_unmap (w); | 1030 | gtk_widget_unmap (w); |
| 1073 | return TRUE; | 1031 | return TRUE; |
| @@ -1081,10 +1039,7 @@ dialog_delete_callback (w, event, user_data) | |||
| 1081 | Returns the GTK dialog widget. */ | 1039 | Returns the GTK dialog widget. */ |
| 1082 | 1040 | ||
| 1083 | static GtkWidget * | 1041 | static GtkWidget * |
| 1084 | create_dialog (wv, select_cb, deactivate_cb) | 1042 | create_dialog (widget_value *wv, GCallback select_cb, GCallback deactivate_cb) |
| 1085 | widget_value *wv; | ||
| 1086 | GCallback select_cb; | ||
| 1087 | GCallback deactivate_cb; | ||
| 1088 | { | 1043 | { |
| 1089 | char *title = get_dialog_title (wv->name[0]); | 1044 | char *title = get_dialog_title (wv->name[0]); |
| 1090 | int total_buttons = wv->name[1] - '0'; | 1045 | int total_buttons = wv->name[1] - '0'; |
| @@ -1215,8 +1170,7 @@ xg_dialog_response_cb (w, | |||
| 1215 | /* Destroy the dialog. This makes it pop down. */ | 1170 | /* Destroy the dialog. This makes it pop down. */ |
| 1216 | 1171 | ||
| 1217 | static Lisp_Object | 1172 | static Lisp_Object |
| 1218 | pop_down_dialog (arg) | 1173 | pop_down_dialog (Lisp_Object arg) |
| 1219 | Lisp_Object arg; | ||
| 1220 | { | 1174 | { |
| 1221 | struct Lisp_Save_Value *p = XSAVE_VALUE (arg); | 1175 | struct Lisp_Save_Value *p = XSAVE_VALUE (arg); |
| 1222 | struct xg_dialog_data *dd = (struct xg_dialog_data *) p->pointer; | 1176 | struct xg_dialog_data *dd = (struct xg_dialog_data *) p->pointer; |
| @@ -1237,8 +1191,7 @@ pop_down_dialog (arg) | |||
| 1237 | We pass in DATA as gpointer* so we can use this as a callback. */ | 1191 | We pass in DATA as gpointer* so we can use this as a callback. */ |
| 1238 | 1192 | ||
| 1239 | static gboolean | 1193 | static gboolean |
| 1240 | xg_maybe_add_timer (data) | 1194 | xg_maybe_add_timer (gpointer data) |
| 1241 | gpointer data; | ||
| 1242 | { | 1195 | { |
| 1243 | struct xg_dialog_data *dd = (struct xg_dialog_data *) data; | 1196 | struct xg_dialog_data *dd = (struct xg_dialog_data *) data; |
| 1244 | EMACS_TIME next_time = timer_check (1); | 1197 | EMACS_TIME next_time = timer_check (1); |
| @@ -1262,10 +1215,7 @@ xg_maybe_add_timer (data) | |||
| 1262 | The dialog W is not destroyed when this function returns. */ | 1215 | The dialog W is not destroyed when this function returns. */ |
| 1263 | 1216 | ||
| 1264 | static int | 1217 | static int |
| 1265 | xg_dialog_run (f, w) | 1218 | xg_dialog_run (FRAME_PTR f, GtkWidget *w) |
| 1266 | FRAME_PTR f; | ||
| 1267 | GtkWidget *w; | ||
| 1268 | |||
| 1269 | { | 1219 | { |
| 1270 | int count = SPECPDL_INDEX (); | 1220 | int count = SPECPDL_INDEX (); |
| 1271 | struct xg_dialog_data dd; | 1221 | struct xg_dialog_data dd; |
| @@ -1308,7 +1258,7 @@ xg_dialog_run (f, w) | |||
| 1308 | Return zero if not. */ | 1258 | Return zero if not. */ |
| 1309 | 1259 | ||
| 1310 | int | 1260 | int |
| 1311 | xg_uses_old_file_dialog () | 1261 | xg_uses_old_file_dialog (void) |
| 1312 | { | 1262 | { |
| 1313 | #ifdef HAVE_GTK_FILE_SELECTION_NEW | 1263 | #ifdef HAVE_GTK_FILE_SELECTION_NEW |
| 1314 | extern int x_gtk_use_old_file_dialog; | 1264 | extern int x_gtk_use_old_file_dialog; |
| @@ -1325,8 +1275,7 @@ typedef char * (*xg_get_file_func) (GtkWidget *); | |||
| 1325 | The returned string must be free:d. */ | 1275 | The returned string must be free:d. */ |
| 1326 | 1276 | ||
| 1327 | static char * | 1277 | static char * |
| 1328 | xg_get_file_name_from_chooser (w) | 1278 | xg_get_file_name_from_chooser (GtkWidget *w) |
| 1329 | GtkWidget *w; | ||
| 1330 | { | 1279 | { |
| 1331 | return gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (w)); | 1280 | return gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (w)); |
| 1332 | } | 1281 | } |
| @@ -1335,9 +1284,7 @@ xg_get_file_name_from_chooser (w) | |||
| 1335 | WIDGET is the toggle widget, DATA is the file chooser dialog. */ | 1284 | WIDGET is the toggle widget, DATA is the file chooser dialog. */ |
| 1336 | 1285 | ||
| 1337 | static void | 1286 | static void |
| 1338 | xg_toggle_visibility_cb (widget, data) | 1287 | xg_toggle_visibility_cb (GtkWidget *widget, gpointer data) |
| 1339 | GtkWidget *widget; | ||
| 1340 | gpointer data; | ||
| 1341 | { | 1288 | { |
| 1342 | GtkFileChooser *dialog = GTK_FILE_CHOOSER (data); | 1289 | GtkFileChooser *dialog = GTK_FILE_CHOOSER (data); |
| 1343 | gboolean visible; | 1290 | gboolean visible; |
| @@ -1353,10 +1300,7 @@ xg_toggle_visibility_cb (widget, data) | |||
| 1353 | changes that property by right clicking in the file list. */ | 1300 | changes that property by right clicking in the file list. */ |
| 1354 | 1301 | ||
| 1355 | static void | 1302 | static void |
| 1356 | xg_toggle_notify_cb (gobject, arg1, user_data) | 1303 | xg_toggle_notify_cb (GObject *gobject, GParamSpec *arg1, gpointer user_data) |
| 1357 | GObject *gobject; | ||
| 1358 | GParamSpec *arg1; | ||
| 1359 | gpointer user_data; | ||
| 1360 | { | 1304 | { |
| 1361 | extern int x_gtk_show_hidden_files; | 1305 | extern int x_gtk_show_hidden_files; |
| 1362 | 1306 | ||
| @@ -1503,8 +1447,7 @@ xg_get_file_with_chooser (f, prompt, default_filename, | |||
| 1503 | The returned string must be free:d. */ | 1447 | The returned string must be free:d. */ |
| 1504 | 1448 | ||
| 1505 | static char * | 1449 | static char * |
| 1506 | xg_get_file_name_from_selector (w) | 1450 | xg_get_file_name_from_selector (GtkWidget *w) |
| 1507 | GtkWidget *w; | ||
| 1508 | { | 1451 | { |
| 1509 | GtkFileSelection *filesel = GTK_FILE_SELECTION (w); | 1452 | GtkFileSelection *filesel = GTK_FILE_SELECTION (w); |
| 1510 | return xstrdup ((char*) gtk_file_selection_get_filename (filesel)); | 1453 | return xstrdup ((char*) gtk_file_selection_get_filename (filesel)); |
| @@ -1565,11 +1508,7 @@ xg_get_file_with_selection (f, prompt, default_filename, | |||
| 1565 | The returned string must be freed by the caller. */ | 1508 | The returned string must be freed by the caller. */ |
| 1566 | 1509 | ||
| 1567 | char * | 1510 | char * |
| 1568 | xg_get_file_name (f, prompt, default_filename, mustmatch_p, only_dir_p) | 1511 | xg_get_file_name (FRAME_PTR f, char *prompt, char *default_filename, int mustmatch_p, int only_dir_p) |
| 1569 | FRAME_PTR f; | ||
| 1570 | char *prompt; | ||
| 1571 | char *default_filename; | ||
| 1572 | int mustmatch_p, only_dir_p; | ||
| 1573 | { | 1512 | { |
| 1574 | GtkWidget *w = 0; | 1513 | GtkWidget *w = 0; |
| 1575 | char *fn = 0; | 1514 | char *fn = 0; |
| @@ -1623,9 +1562,7 @@ xg_get_file_name (f, prompt, default_filename, mustmatch_p, only_dir_p) | |||
| 1623 | DEFAULT_NAME, if non-zero, is the default font name. */ | 1562 | DEFAULT_NAME, if non-zero, is the default font name. */ |
| 1624 | 1563 | ||
| 1625 | char * | 1564 | char * |
| 1626 | xg_get_font_name (f, default_name) | 1565 | xg_get_font_name (FRAME_PTR f, char *default_name) |
| 1627 | FRAME_PTR f; | ||
| 1628 | char *default_name; | ||
| 1629 | { | 1566 | { |
| 1630 | GtkWidget *w; | 1567 | GtkWidget *w; |
| 1631 | char *fontname = NULL; | 1568 | char *fontname = NULL; |
| @@ -1690,10 +1627,7 @@ static xg_list_node xg_menu_item_cb_list; | |||
| 1690 | allocated xg_menu_cb_data if CL_DATA is NULL. */ | 1627 | allocated xg_menu_cb_data if CL_DATA is NULL. */ |
| 1691 | 1628 | ||
| 1692 | static xg_menu_cb_data * | 1629 | static xg_menu_cb_data * |
| 1693 | make_cl_data (cl_data, f, highlight_cb) | 1630 | make_cl_data (xg_menu_cb_data *cl_data, FRAME_PTR f, GCallback highlight_cb) |
| 1694 | xg_menu_cb_data *cl_data; | ||
| 1695 | FRAME_PTR f; | ||
| 1696 | GCallback highlight_cb; | ||
| 1697 | { | 1631 | { |
| 1698 | if (! cl_data) | 1632 | if (! cl_data) |
| 1699 | { | 1633 | { |
| @@ -1724,10 +1658,7 @@ make_cl_data (cl_data, f, highlight_cb) | |||
| 1724 | creating the menu bar. */ | 1658 | creating the menu bar. */ |
| 1725 | 1659 | ||
| 1726 | static void | 1660 | static void |
| 1727 | update_cl_data (cl_data, f, highlight_cb) | 1661 | update_cl_data (xg_menu_cb_data *cl_data, FRAME_PTR f, GCallback highlight_cb) |
| 1728 | xg_menu_cb_data *cl_data; | ||
| 1729 | FRAME_PTR f; | ||
| 1730 | GCallback highlight_cb; | ||
| 1731 | { | 1662 | { |
| 1732 | if (cl_data) | 1663 | if (cl_data) |
| 1733 | { | 1664 | { |
| @@ -1742,8 +1673,7 @@ update_cl_data (cl_data, f, highlight_cb) | |||
| 1742 | If reference count is zero, free CL_DATA. */ | 1673 | If reference count is zero, free CL_DATA. */ |
| 1743 | 1674 | ||
| 1744 | static void | 1675 | static void |
| 1745 | unref_cl_data (cl_data) | 1676 | unref_cl_data (xg_menu_cb_data *cl_data) |
| 1746 | xg_menu_cb_data *cl_data; | ||
| 1747 | { | 1677 | { |
| 1748 | if (cl_data && cl_data->ref_count > 0) | 1678 | if (cl_data && cl_data->ref_count > 0) |
| 1749 | { | 1679 | { |
| @@ -1759,7 +1689,7 @@ unref_cl_data (cl_data) | |||
| 1759 | /* Function that marks all lisp data during GC. */ | 1689 | /* Function that marks all lisp data during GC. */ |
| 1760 | 1690 | ||
| 1761 | void | 1691 | void |
| 1762 | xg_mark_data () | 1692 | xg_mark_data (void) |
| 1763 | { | 1693 | { |
| 1764 | xg_list_node *iter; | 1694 | xg_list_node *iter; |
| 1765 | 1695 | ||
| @@ -1781,9 +1711,7 @@ xg_mark_data () | |||
| 1781 | CLIENT_DATA points to the xg_menu_item_cb_data associated with the W. */ | 1711 | CLIENT_DATA points to the xg_menu_item_cb_data associated with the W. */ |
| 1782 | 1712 | ||
| 1783 | static void | 1713 | static void |
| 1784 | menuitem_destroy_callback (w, client_data) | 1714 | menuitem_destroy_callback (GtkWidget *w, gpointer client_data) |
| 1785 | GtkWidget *w; | ||
| 1786 | gpointer client_data; | ||
| 1787 | { | 1715 | { |
| 1788 | if (client_data) | 1716 | if (client_data) |
| 1789 | { | 1717 | { |
| @@ -1801,10 +1729,7 @@ menuitem_destroy_callback (w, client_data) | |||
| 1801 | Returns FALSE to tell GTK to keep processing this event. */ | 1729 | Returns FALSE to tell GTK to keep processing this event. */ |
| 1802 | 1730 | ||
| 1803 | static gboolean | 1731 | static gboolean |
| 1804 | menuitem_highlight_callback (w, event, client_data) | 1732 | menuitem_highlight_callback (GtkWidget *w, GdkEventCrossing *event, gpointer client_data) |
| 1805 | GtkWidget *w; | ||
| 1806 | GdkEventCrossing *event; | ||
| 1807 | gpointer client_data; | ||
| 1808 | { | 1733 | { |
| 1809 | GdkEvent ev; | 1734 | GdkEvent ev; |
| 1810 | GtkWidget *subwidget; | 1735 | GtkWidget *subwidget; |
| @@ -1832,9 +1757,7 @@ menuitem_highlight_callback (w, event, client_data) | |||
| 1832 | CLIENT_DATA points to the xg_menu_cb_data associated with W. */ | 1757 | CLIENT_DATA points to the xg_menu_cb_data associated with W. */ |
| 1833 | 1758 | ||
| 1834 | static void | 1759 | static void |
| 1835 | menu_destroy_callback (w, client_data) | 1760 | menu_destroy_callback (GtkWidget *w, gpointer client_data) |
| 1836 | GtkWidget *w; | ||
| 1837 | gpointer client_data; | ||
| 1838 | { | 1761 | { |
| 1839 | unref_cl_data ((xg_menu_cb_data*) client_data); | 1762 | unref_cl_data ((xg_menu_cb_data*) client_data); |
| 1840 | } | 1763 | } |
| @@ -1845,9 +1768,7 @@ menu_destroy_callback (w, client_data) | |||
| 1845 | Returns the GtkHBox. */ | 1768 | Returns the GtkHBox. */ |
| 1846 | 1769 | ||
| 1847 | static GtkWidget * | 1770 | static GtkWidget * |
| 1848 | make_widget_for_menu_item (utf8_label, utf8_key) | 1771 | make_widget_for_menu_item (char *utf8_label, char *utf8_key) |
| 1849 | char *utf8_label; | ||
| 1850 | char *utf8_key; | ||
| 1851 | { | 1772 | { |
| 1852 | GtkWidget *wlbl; | 1773 | GtkWidget *wlbl; |
| 1853 | GtkWidget *wkey; | 1774 | GtkWidget *wkey; |
| @@ -1885,11 +1806,7 @@ make_widget_for_menu_item (utf8_label, utf8_key) | |||
| 1885 | but the MacOS X version doesn't either, so I guess that is OK. */ | 1806 | but the MacOS X version doesn't either, so I guess that is OK. */ |
| 1886 | 1807 | ||
| 1887 | static GtkWidget * | 1808 | static GtkWidget * |
| 1888 | make_menu_item (utf8_label, utf8_key, item, group) | 1809 | make_menu_item (char *utf8_label, char *utf8_key, widget_value *item, GSList **group) |
| 1889 | char *utf8_label; | ||
| 1890 | char *utf8_key; | ||
| 1891 | widget_value *item; | ||
| 1892 | GSList **group; | ||
| 1893 | { | 1810 | { |
| 1894 | GtkWidget *w; | 1811 | GtkWidget *w; |
| 1895 | GtkWidget *wtoadd = 0; | 1812 | GtkWidget *wtoadd = 0; |
| @@ -1984,7 +1901,7 @@ static int xg_detached_menus; | |||
| 1984 | /* Returns non-zero if there are detached menus. */ | 1901 | /* Returns non-zero if there are detached menus. */ |
| 1985 | 1902 | ||
| 1986 | int | 1903 | int |
| 1987 | xg_have_tear_offs () | 1904 | xg_have_tear_offs (void) |
| 1988 | { | 1905 | { |
| 1989 | return xg_detached_menus > 0; | 1906 | return xg_detached_menus > 0; |
| 1990 | } | 1907 | } |
| @@ -1995,9 +1912,7 @@ xg_have_tear_offs () | |||
| 1995 | CLIENT_DATA is not used. */ | 1912 | CLIENT_DATA is not used. */ |
| 1996 | 1913 | ||
| 1997 | static void | 1914 | static void |
| 1998 | tearoff_remove (widget, client_data) | 1915 | tearoff_remove (GtkWidget *widget, gpointer client_data) |
| 1999 | GtkWidget *widget; | ||
| 2000 | gpointer client_data; | ||
| 2001 | { | 1916 | { |
| 2002 | if (xg_detached_menus > 0) --xg_detached_menus; | 1917 | if (xg_detached_menus > 0) --xg_detached_menus; |
| 2003 | } | 1918 | } |
| @@ -2008,9 +1923,7 @@ tearoff_remove (widget, client_data) | |||
| 2008 | CLIENT_DATA is not used. */ | 1923 | CLIENT_DATA is not used. */ |
| 2009 | 1924 | ||
| 2010 | static void | 1925 | static void |
| 2011 | tearoff_activate (widget, client_data) | 1926 | tearoff_activate (GtkWidget *widget, gpointer client_data) |
| 2012 | GtkWidget *widget; | ||
| 2013 | gpointer client_data; | ||
| 2014 | { | 1927 | { |
| 2015 | GtkWidget *menu = gtk_widget_get_parent (widget); | 1928 | GtkWidget *menu = gtk_widget_get_parent (widget); |
| 2016 | if (gtk_menu_get_tearoff_state (GTK_MENU (menu))) | 1929 | if (gtk_menu_get_tearoff_state (GTK_MENU (menu))) |
| @@ -2038,13 +1951,7 @@ tearoff_activate (widget, client_data) | |||
| 2038 | Returns the created GtkWidget. */ | 1951 | Returns the created GtkWidget. */ |
| 2039 | 1952 | ||
| 2040 | static GtkWidget * | 1953 | static GtkWidget * |
| 2041 | xg_create_one_menuitem (item, f, select_cb, highlight_cb, cl_data, group) | 1954 | xg_create_one_menuitem (widget_value *item, FRAME_PTR f, GCallback select_cb, GCallback highlight_cb, xg_menu_cb_data *cl_data, GSList **group) |
| 2042 | widget_value *item; | ||
| 2043 | FRAME_PTR f; | ||
| 2044 | GCallback select_cb; | ||
| 2045 | GCallback highlight_cb; | ||
| 2046 | xg_menu_cb_data *cl_data; | ||
| 2047 | GSList **group; | ||
| 2048 | { | 1955 | { |
| 2049 | char *utf8_label; | 1956 | char *utf8_label; |
| 2050 | char *utf8_key; | 1957 | char *utf8_key; |
| @@ -2317,8 +2224,7 @@ xg_create_widget (type, name, f, val, | |||
| 2317 | /* Return the label for menu item WITEM. */ | 2224 | /* Return the label for menu item WITEM. */ |
| 2318 | 2225 | ||
| 2319 | static const char * | 2226 | static const char * |
| 2320 | xg_get_menu_item_label (witem) | 2227 | xg_get_menu_item_label (GtkMenuItem *witem) |
| 2321 | GtkMenuItem *witem; | ||
| 2322 | { | 2228 | { |
| 2323 | GtkLabel *wlabel = GTK_LABEL (gtk_bin_get_child (GTK_BIN (witem))); | 2229 | GtkLabel *wlabel = GTK_LABEL (gtk_bin_get_child (GTK_BIN (witem))); |
| 2324 | return gtk_label_get_label (wlabel); | 2230 | return gtk_label_get_label (wlabel); |
| @@ -2327,9 +2233,7 @@ xg_get_menu_item_label (witem) | |||
| 2327 | /* Return non-zero if the menu item WITEM has the text LABEL. */ | 2233 | /* Return non-zero if the menu item WITEM has the text LABEL. */ |
| 2328 | 2234 | ||
| 2329 | static int | 2235 | static int |
| 2330 | xg_item_label_same_p (witem, label) | 2236 | xg_item_label_same_p (GtkMenuItem *witem, char *label) |
| 2331 | GtkMenuItem *witem; | ||
| 2332 | char *label; | ||
| 2333 | { | 2237 | { |
| 2334 | int is_same = 0; | 2238 | int is_same = 0; |
| 2335 | char *utf8_label = get_utf8_string (label); | 2239 | char *utf8_label = get_utf8_string (label); |
| @@ -2348,8 +2252,7 @@ xg_item_label_same_p (witem, label) | |||
| 2348 | /* Destroy widgets in LIST. */ | 2252 | /* Destroy widgets in LIST. */ |
| 2349 | 2253 | ||
| 2350 | static void | 2254 | static void |
| 2351 | xg_destroy_widgets (list) | 2255 | xg_destroy_widgets (GList *list) |
| 2352 | GList *list; | ||
| 2353 | { | 2256 | { |
| 2354 | GList *iter; | 2257 | GList *iter; |
| 2355 | 2258 | ||
| @@ -2561,12 +2464,7 @@ xg_update_menubar (menubar, f, list, iter, pos, val, | |||
| 2561 | CL_DATA is the data to set in the widget for menu invocation. */ | 2464 | CL_DATA is the data to set in the widget for menu invocation. */ |
| 2562 | 2465 | ||
| 2563 | static void | 2466 | static void |
| 2564 | xg_update_menu_item (val, w, select_cb, highlight_cb, cl_data) | 2467 | xg_update_menu_item (widget_value *val, GtkWidget *w, GCallback select_cb, GCallback highlight_cb, xg_menu_cb_data *cl_data) |
| 2565 | widget_value *val; | ||
| 2566 | GtkWidget *w; | ||
| 2567 | GCallback select_cb; | ||
| 2568 | GCallback highlight_cb; | ||
| 2569 | xg_menu_cb_data *cl_data; | ||
| 2570 | { | 2468 | { |
| 2571 | GtkWidget *wchild; | 2469 | GtkWidget *wchild; |
| 2572 | GtkLabel *wlbl = 0; | 2470 | GtkLabel *wlbl = 0; |
| @@ -2666,9 +2564,7 @@ xg_update_menu_item (val, w, select_cb, highlight_cb, cl_data) | |||
| 2666 | /* Update the toggle menu item W so it corresponds to VAL. */ | 2564 | /* Update the toggle menu item W so it corresponds to VAL. */ |
| 2667 | 2565 | ||
| 2668 | static void | 2566 | static void |
| 2669 | xg_update_toggle_item (val, w) | 2567 | xg_update_toggle_item (widget_value *val, GtkWidget *w) |
| 2670 | widget_value *val; | ||
| 2671 | GtkWidget *w; | ||
| 2672 | { | 2568 | { |
| 2673 | gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (w), val->selected); | 2569 | gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (w), val->selected); |
| 2674 | } | 2570 | } |
| @@ -2676,9 +2572,7 @@ xg_update_toggle_item (val, w) | |||
| 2676 | /* Update the radio menu item W so it corresponds to VAL. */ | 2572 | /* Update the radio menu item W so it corresponds to VAL. */ |
| 2677 | 2573 | ||
| 2678 | static void | 2574 | static void |
| 2679 | xg_update_radio_item (val, w) | 2575 | xg_update_radio_item (widget_value *val, GtkWidget *w) |
| 2680 | widget_value *val; | ||
| 2681 | GtkWidget *w; | ||
| 2682 | { | 2576 | { |
| 2683 | gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (w), val->selected); | 2577 | gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (w), val->selected); |
| 2684 | } | 2578 | } |
| @@ -2915,8 +2809,7 @@ xg_modify_menubar_widgets (menubar, f, val, deep_p, | |||
| 2915 | changed. Value is non-zero if widgets were updated. */ | 2809 | changed. Value is non-zero if widgets were updated. */ |
| 2916 | 2810 | ||
| 2917 | int | 2811 | int |
| 2918 | xg_update_frame_menubar (f) | 2812 | xg_update_frame_menubar (FRAME_PTR f) |
| 2919 | FRAME_PTR f; | ||
| 2920 | { | 2813 | { |
| 2921 | struct x_output *x = f->output_data.x; | 2814 | struct x_output *x = f->output_data.x; |
| 2922 | GtkRequisition req; | 2815 | GtkRequisition req; |
| @@ -2946,8 +2839,7 @@ xg_update_frame_menubar (f) | |||
| 2946 | This is used when deleting a frame, and when turning off the menu bar. */ | 2839 | This is used when deleting a frame, and when turning off the menu bar. */ |
| 2947 | 2840 | ||
| 2948 | void | 2841 | void |
| 2949 | free_frame_menubar (f) | 2842 | free_frame_menubar (FRAME_PTR f) |
| 2950 | FRAME_PTR f; | ||
| 2951 | { | 2843 | { |
| 2952 | struct x_output *x = f->output_data.x; | 2844 | struct x_output *x = f->output_data.x; |
| 2953 | 2845 | ||
| @@ -2995,8 +2887,7 @@ static struct | |||
| 2995 | /* Store the widget pointer W in id_to_widget and return the integer index. */ | 2887 | /* Store the widget pointer W in id_to_widget and return the integer index. */ |
| 2996 | 2888 | ||
| 2997 | static int | 2889 | static int |
| 2998 | xg_store_widget_in_map (w) | 2890 | xg_store_widget_in_map (GtkWidget *w) |
| 2999 | GtkWidget *w; | ||
| 3000 | { | 2891 | { |
| 3001 | int i; | 2892 | int i; |
| 3002 | 2893 | ||
| @@ -3034,8 +2925,7 @@ xg_store_widget_in_map (w) | |||
| 3034 | Called when scroll bar is destroyed. */ | 2925 | Called when scroll bar is destroyed. */ |
| 3035 | 2926 | ||
| 3036 | static void | 2927 | static void |
| 3037 | xg_remove_widget_from_map (idx) | 2928 | xg_remove_widget_from_map (int idx) |
| 3038 | int idx; | ||
| 3039 | { | 2929 | { |
| 3040 | if (idx < id_to_widget.max_size && id_to_widget.widgets[idx] != 0) | 2930 | if (idx < id_to_widget.max_size && id_to_widget.widgets[idx] != 0) |
| 3041 | { | 2931 | { |
| @@ -3047,8 +2937,7 @@ xg_remove_widget_from_map (idx) | |||
| 3047 | /* Get the widget pointer at IDX from id_to_widget. */ | 2937 | /* Get the widget pointer at IDX from id_to_widget. */ |
| 3048 | 2938 | ||
| 3049 | static GtkWidget * | 2939 | static GtkWidget * |
| 3050 | xg_get_widget_from_map (idx) | 2940 | xg_get_widget_from_map (int idx) |
| 3051 | int idx; | ||
| 3052 | { | 2941 | { |
| 3053 | if (idx < id_to_widget.max_size && id_to_widget.widgets[idx] != 0) | 2942 | if (idx < id_to_widget.max_size && id_to_widget.widgets[idx] != 0) |
| 3054 | return id_to_widget.widgets[idx]; | 2943 | return id_to_widget.widgets[idx]; |
| @@ -3060,9 +2949,7 @@ xg_get_widget_from_map (idx) | |||
| 3060 | Return -1 if WID not in id_to_widget. */ | 2949 | Return -1 if WID not in id_to_widget. */ |
| 3061 | 2950 | ||
| 3062 | int | 2951 | int |
| 3063 | xg_get_scroll_id_for_window (dpy, wid) | 2952 | xg_get_scroll_id_for_window (Display *dpy, Window wid) |
| 3064 | Display *dpy; | ||
| 3065 | Window wid; | ||
| 3066 | { | 2953 | { |
| 3067 | int idx; | 2954 | int idx; |
| 3068 | GtkWidget *w; | 2955 | GtkWidget *w; |
| @@ -3084,9 +2971,7 @@ xg_get_scroll_id_for_window (dpy, wid) | |||
| 3084 | We free pointer to last scroll bar values here and remove the index. */ | 2971 | We free pointer to last scroll bar values here and remove the index. */ |
| 3085 | 2972 | ||
| 3086 | static void | 2973 | static void |
| 3087 | xg_gtk_scroll_destroy (widget, data) | 2974 | xg_gtk_scroll_destroy (GtkWidget *widget, gpointer data) |
| 3088 | GtkWidget *widget; | ||
| 3089 | gpointer data; | ||
| 3090 | { | 2975 | { |
| 3091 | int id = (int) (EMACS_INT) data; /* The EMACS_INT cast avoids a warning. */ | 2976 | int id = (int) (EMACS_INT) data; /* The EMACS_INT cast avoids a warning. */ |
| 3092 | xg_remove_widget_from_map (id); | 2977 | xg_remove_widget_from_map (id); |
| @@ -3101,11 +2986,7 @@ xg_gtk_scroll_destroy (widget, data) | |||
| 3101 | to set resources for the widget. */ | 2986 | to set resources for the widget. */ |
| 3102 | 2987 | ||
| 3103 | void | 2988 | void |
| 3104 | xg_create_scroll_bar (f, bar, scroll_callback, end_callback, scroll_bar_name) | 2989 | xg_create_scroll_bar (FRAME_PTR f, struct scroll_bar *bar, GCallback scroll_callback, GCallback end_callback, char *scroll_bar_name) |
| 3105 | FRAME_PTR f; | ||
| 3106 | struct scroll_bar *bar; | ||
| 3107 | GCallback scroll_callback, end_callback; | ||
| 3108 | char *scroll_bar_name; | ||
| 3109 | { | 2990 | { |
| 3110 | GtkWidget *wscroll; | 2991 | GtkWidget *wscroll; |
| 3111 | GtkWidget *webox; | 2992 | GtkWidget *webox; |
| @@ -3158,9 +3039,7 @@ xg_create_scroll_bar (f, bar, scroll_callback, end_callback, scroll_bar_name) | |||
| 3158 | /* Remove the scroll bar represented by SCROLLBAR_ID from the frame F. */ | 3039 | /* Remove the scroll bar represented by SCROLLBAR_ID from the frame F. */ |
| 3159 | 3040 | ||
| 3160 | void | 3041 | void |
| 3161 | xg_remove_scroll_bar (f, scrollbar_id) | 3042 | xg_remove_scroll_bar (FRAME_PTR f, int scrollbar_id) |
| 3162 | FRAME_PTR f; | ||
| 3163 | int scrollbar_id; | ||
| 3164 | { | 3043 | { |
| 3165 | GtkWidget *w = xg_get_widget_from_map (scrollbar_id); | 3044 | GtkWidget *w = xg_get_widget_from_map (scrollbar_id); |
| 3166 | if (w) | 3045 | if (w) |
| @@ -3178,13 +3057,7 @@ xg_remove_scroll_bar (f, scrollbar_id) | |||
| 3178 | WIDTH, HEIGHT is the size in pixels the bar shall have. */ | 3057 | WIDTH, HEIGHT is the size in pixels the bar shall have. */ |
| 3179 | 3058 | ||
| 3180 | void | 3059 | void |
| 3181 | xg_update_scrollbar_pos (f, scrollbar_id, top, left, width, height) | 3060 | xg_update_scrollbar_pos (FRAME_PTR f, int scrollbar_id, int top, int left, int width, int height) |
| 3182 | FRAME_PTR f; | ||
| 3183 | int scrollbar_id; | ||
| 3184 | int top; | ||
| 3185 | int left; | ||
| 3186 | int width; | ||
| 3187 | int height; | ||
| 3188 | { | 3061 | { |
| 3189 | 3062 | ||
| 3190 | GtkWidget *wscroll = xg_get_widget_from_map (scrollbar_id); | 3063 | GtkWidget *wscroll = xg_get_widget_from_map (scrollbar_id); |
| @@ -3245,9 +3118,7 @@ xg_update_scrollbar_pos (f, scrollbar_id, top, left, width, height) | |||
| 3245 | displaying PORTION out of a whole WHOLE, and our position POSITION. */ | 3118 | displaying PORTION out of a whole WHOLE, and our position POSITION. */ |
| 3246 | 3119 | ||
| 3247 | void | 3120 | void |
| 3248 | xg_set_toolkit_scroll_bar_thumb (bar, portion, position, whole) | 3121 | xg_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar, int portion, int position, int whole) |
| 3249 | struct scroll_bar *bar; | ||
| 3250 | int portion, position, whole; | ||
| 3251 | { | 3122 | { |
| 3252 | GtkWidget *wscroll = xg_get_widget_from_map (bar->x_window); | 3123 | GtkWidget *wscroll = xg_get_widget_from_map (bar->x_window); |
| 3253 | 3124 | ||
| @@ -3329,9 +3200,7 @@ xg_set_toolkit_scroll_bar_thumb (bar, portion, position, whole) | |||
| 3329 | Return non-zero if the event is for a scroll bar, zero otherwise. */ | 3200 | Return non-zero if the event is for a scroll bar, zero otherwise. */ |
| 3330 | 3201 | ||
| 3331 | int | 3202 | int |
| 3332 | xg_event_is_for_scrollbar (f, event) | 3203 | xg_event_is_for_scrollbar (FRAME_PTR f, XEvent *event) |
| 3333 | FRAME_PTR f; | ||
| 3334 | XEvent *event; | ||
| 3335 | { | 3204 | { |
| 3336 | int retval = 0; | 3205 | int retval = 0; |
| 3337 | 3206 | ||
| @@ -3386,10 +3255,7 @@ xg_event_is_for_scrollbar (f, event) | |||
| 3386 | tool bar. 0 is the first button. */ | 3255 | tool bar. 0 is the first button. */ |
| 3387 | 3256 | ||
| 3388 | static gboolean | 3257 | static gboolean |
| 3389 | xg_tool_bar_button_cb (widget, event, user_data) | 3258 | xg_tool_bar_button_cb (GtkWidget *widget, GdkEventButton *event, gpointer user_data) |
| 3390 | GtkWidget *widget; | ||
| 3391 | GdkEventButton *event; | ||
| 3392 | gpointer user_data; | ||
| 3393 | { | 3259 | { |
| 3394 | /* Casts to avoid warnings when gpointer is 64 bits and int is 32 bits */ | 3260 | /* Casts to avoid warnings when gpointer is 64 bits and int is 32 bits */ |
| 3395 | gpointer ptr = (gpointer) (EMACS_INT) event->state; | 3261 | gpointer ptr = (gpointer) (EMACS_INT) event->state; |
| @@ -3404,9 +3270,7 @@ xg_tool_bar_button_cb (widget, event, user_data) | |||
| 3404 | tool bar. 0 is the first button. */ | 3270 | tool bar. 0 is the first button. */ |
| 3405 | 3271 | ||
| 3406 | static void | 3272 | static void |
| 3407 | xg_tool_bar_callback (w, client_data) | 3273 | xg_tool_bar_callback (GtkWidget *w, gpointer client_data) |
| 3408 | GtkWidget *w; | ||
| 3409 | gpointer client_data; | ||
| 3410 | { | 3274 | { |
| 3411 | /* The EMACS_INT cast avoids a warning. */ | 3275 | /* The EMACS_INT cast avoids a warning. */ |
| 3412 | int idx = (int) (EMACS_INT) client_data; | 3276 | int idx = (int) (EMACS_INT) client_data; |
| @@ -3455,9 +3319,7 @@ xg_tool_bar_callback (w, client_data) | |||
| 3455 | tool bar. 0 is the first button. */ | 3319 | tool bar. 0 is the first button. */ |
| 3456 | 3320 | ||
| 3457 | static void | 3321 | static void |
| 3458 | xg_tool_bar_proxy_callback (w, client_data) | 3322 | xg_tool_bar_proxy_callback (GtkWidget *w, gpointer client_data) |
| 3459 | GtkWidget *w; | ||
| 3460 | gpointer client_data; | ||
| 3461 | { | 3323 | { |
| 3462 | GtkWidget *wbutton = GTK_WIDGET (g_object_get_data (G_OBJECT (w), | 3324 | GtkWidget *wbutton = GTK_WIDGET (g_object_get_data (G_OBJECT (w), |
| 3463 | XG_TOOL_BAR_PROXY_BUTTON)); | 3325 | XG_TOOL_BAR_PROXY_BUTTON)); |
| @@ -3474,10 +3336,7 @@ xg_tool_bar_help_callback (GtkWidget *w, | |||
| 3474 | the detached tool bar when the detached tool bar it is not expanded. */ | 3336 | the detached tool bar when the detached tool bar it is not expanded. */ |
| 3475 | 3337 | ||
| 3476 | static gboolean | 3338 | static gboolean |
| 3477 | xg_tool_bar_proxy_help_callback (w, event, client_data) | 3339 | xg_tool_bar_proxy_help_callback (GtkWidget *w, GdkEventCrossing *event, gpointer client_data) |
| 3478 | GtkWidget *w; | ||
| 3479 | GdkEventCrossing *event; | ||
| 3480 | gpointer client_data; | ||
| 3481 | { | 3340 | { |
| 3482 | GtkWidget *wbutton = GTK_WIDGET (g_object_get_data (G_OBJECT (w), | 3341 | GtkWidget *wbutton = GTK_WIDGET (g_object_get_data (G_OBJECT (w), |
| 3483 | XG_TOOL_BAR_PROXY_BUTTON)); | 3342 | XG_TOOL_BAR_PROXY_BUTTON)); |
| @@ -3503,9 +3362,7 @@ xg_get_tool_bar_widgets (GtkWidget *vb, GtkWidget **wimage) | |||
| 3503 | blank. */ | 3362 | blank. */ |
| 3504 | 3363 | ||
| 3505 | static gboolean | 3364 | static gboolean |
| 3506 | xg_tool_bar_menu_proxy (toolitem, user_data) | 3365 | xg_tool_bar_menu_proxy (GtkToolItem *toolitem, gpointer user_data) |
| 3507 | GtkToolItem *toolitem; | ||
| 3508 | gpointer user_data; | ||
| 3509 | { | 3366 | { |
| 3510 | GtkWidget *weventbox = gtk_bin_get_child (GTK_BIN (toolitem)); | 3367 | GtkWidget *weventbox = gtk_bin_get_child (GTK_BIN (toolitem)); |
| 3511 | GtkButton *wbutton = GTK_BUTTON (gtk_bin_get_child (GTK_BIN (weventbox))); | 3368 | GtkButton *wbutton = GTK_BUTTON (gtk_bin_get_child (GTK_BIN (weventbox))); |
| @@ -3615,10 +3472,7 @@ xg_tool_bar_menu_proxy (toolitem, user_data) | |||
| 3615 | CLIENT_DATA is a pointer to the frame the tool bar belongs to. */ | 3472 | CLIENT_DATA is a pointer to the frame the tool bar belongs to. */ |
| 3616 | 3473 | ||
| 3617 | static void | 3474 | static void |
| 3618 | xg_tool_bar_detach_callback (wbox, w, client_data) | 3475 | xg_tool_bar_detach_callback (GtkHandleBox *wbox, GtkWidget *w, gpointer client_data) |
| 3619 | GtkHandleBox *wbox; | ||
| 3620 | GtkWidget *w; | ||
| 3621 | gpointer client_data; | ||
| 3622 | { | 3476 | { |
| 3623 | FRAME_PTR f = (FRAME_PTR) client_data; | 3477 | FRAME_PTR f = (FRAME_PTR) client_data; |
| 3624 | extern int x_gtk_whole_detached_tool_bar; | 3478 | extern int x_gtk_whole_detached_tool_bar; |
| @@ -3646,10 +3500,7 @@ xg_tool_bar_detach_callback (wbox, w, client_data) | |||
| 3646 | CLIENT_DATA is a pointer to the frame the tool bar belongs to. */ | 3500 | CLIENT_DATA is a pointer to the frame the tool bar belongs to. */ |
| 3647 | 3501 | ||
| 3648 | static void | 3502 | static void |
| 3649 | xg_tool_bar_attach_callback (wbox, w, client_data) | 3503 | xg_tool_bar_attach_callback (GtkHandleBox *wbox, GtkWidget *w, gpointer client_data) |
| 3650 | GtkHandleBox *wbox; | ||
| 3651 | GtkWidget *w; | ||
| 3652 | gpointer client_data; | ||
| 3653 | { | 3504 | { |
| 3654 | FRAME_PTR f = (FRAME_PTR) client_data; | 3505 | FRAME_PTR f = (FRAME_PTR) client_data; |
| 3655 | g_object_set (G_OBJECT (w), "show-arrow", TRUE, NULL); | 3506 | g_object_set (G_OBJECT (w), "show-arrow", TRUE, NULL); |
| @@ -3676,10 +3527,7 @@ xg_tool_bar_attach_callback (wbox, w, client_data) | |||
| 3676 | Returns FALSE to tell GTK to keep processing this event. */ | 3527 | Returns FALSE to tell GTK to keep processing this event. */ |
| 3677 | 3528 | ||
| 3678 | static gboolean | 3529 | static gboolean |
| 3679 | xg_tool_bar_help_callback (w, event, client_data) | 3530 | xg_tool_bar_help_callback (GtkWidget *w, GdkEventCrossing *event, gpointer client_data) |
| 3680 | GtkWidget *w; | ||
| 3681 | GdkEventCrossing *event; | ||
| 3682 | gpointer client_data; | ||
| 3683 | { | 3531 | { |
| 3684 | /* The EMACS_INT cast avoids a warning. */ | 3532 | /* The EMACS_INT cast avoids a warning. */ |
| 3685 | int idx = (int) (EMACS_INT) client_data; | 3533 | int idx = (int) (EMACS_INT) client_data; |
| @@ -3718,10 +3566,7 @@ xg_tool_bar_help_callback (w, event, client_data) | |||
| 3718 | Returns FALSE to tell GTK to keep processing this event. */ | 3566 | Returns FALSE to tell GTK to keep processing this event. */ |
| 3719 | 3567 | ||
| 3720 | static gboolean | 3568 | static gboolean |
| 3721 | xg_tool_bar_item_expose_callback (w, event, client_data) | 3569 | xg_tool_bar_item_expose_callback (GtkWidget *w, GdkEventExpose *event, gpointer client_data) |
| 3722 | GtkWidget *w; | ||
| 3723 | GdkEventExpose *event; | ||
| 3724 | gpointer client_data; | ||
| 3725 | { | 3570 | { |
| 3726 | gint width, height; | 3571 | gint width, height; |
| 3727 | 3572 | ||
| @@ -3742,8 +3587,7 @@ xg_tool_bar_item_expose_callback (w, event, client_data) | |||
| 3742 | /* Attach a tool bar to frame F. */ | 3587 | /* Attach a tool bar to frame F. */ |
| 3743 | 3588 | ||
| 3744 | static void | 3589 | static void |
| 3745 | xg_pack_tool_bar (f) | 3590 | xg_pack_tool_bar (FRAME_PTR f) |
| 3746 | FRAME_PTR f; | ||
| 3747 | { | 3591 | { |
| 3748 | struct x_output *x = f->output_data.x; | 3592 | struct x_output *x = f->output_data.x; |
| 3749 | int vbox_pos = x->menubar_widget ? 1 : 0; | 3593 | int vbox_pos = x->menubar_widget ? 1 : 0; |
| @@ -3777,8 +3621,7 @@ xg_pack_tool_bar (f) | |||
| 3777 | #endif | 3621 | #endif |
| 3778 | 3622 | ||
| 3779 | static void | 3623 | static void |
| 3780 | xg_create_tool_bar (f) | 3624 | xg_create_tool_bar (FRAME_PTR f) |
| 3781 | FRAME_PTR f; | ||
| 3782 | { | 3625 | { |
| 3783 | struct x_output *x = f->output_data.x; | 3626 | struct x_output *x = f->output_data.x; |
| 3784 | 3627 | ||
| @@ -3799,10 +3642,7 @@ xg_create_tool_bar (f) | |||
| 3799 | Returns IMAGE if RTL is not found. */ | 3642 | Returns IMAGE if RTL is not found. */ |
| 3800 | 3643 | ||
| 3801 | static Lisp_Object | 3644 | static Lisp_Object |
| 3802 | find_rtl_image (f, image, rtl) | 3645 | find_rtl_image (FRAME_PTR f, Lisp_Object image, Lisp_Object rtl) |
| 3803 | FRAME_PTR f; | ||
| 3804 | Lisp_Object image; | ||
| 3805 | Lisp_Object rtl; | ||
| 3806 | { | 3646 | { |
| 3807 | int i; | 3647 | int i; |
| 3808 | Lisp_Object file, rtl_name; | 3648 | Lisp_Object file, rtl_name; |
| @@ -3955,8 +3795,7 @@ xg_show_toolbar_item (GtkToolItem *ti) | |||
| 3955 | extern Lisp_Object Qx_gtk_map_stock; | 3795 | extern Lisp_Object Qx_gtk_map_stock; |
| 3956 | 3796 | ||
| 3957 | void | 3797 | void |
| 3958 | update_frame_tool_bar (f) | 3798 | update_frame_tool_bar (FRAME_PTR f) |
| 3959 | FRAME_PTR f; | ||
| 3960 | { | 3799 | { |
| 3961 | int i; | 3800 | int i; |
| 3962 | GtkRequisition old_req, new_req; | 3801 | GtkRequisition old_req, new_req; |
| @@ -4237,8 +4076,7 @@ update_frame_tool_bar (f) | |||
| 4237 | Remove the tool bar. */ | 4076 | Remove the tool bar. */ |
| 4238 | 4077 | ||
| 4239 | void | 4078 | void |
| 4240 | free_frame_tool_bar (f) | 4079 | free_frame_tool_bar (FRAME_PTR f) |
| 4241 | FRAME_PTR f; | ||
| 4242 | { | 4080 | { |
| 4243 | struct x_output *x = f->output_data.x; | 4081 | struct x_output *x = f->output_data.x; |
| 4244 | 4082 | ||
| @@ -4269,7 +4107,7 @@ free_frame_tool_bar (f) | |||
| 4269 | Initializing | 4107 | Initializing |
| 4270 | ***********************************************************************/ | 4108 | ***********************************************************************/ |
| 4271 | void | 4109 | void |
| 4272 | xg_initialize () | 4110 | xg_initialize (void) |
| 4273 | { | 4111 | { |
| 4274 | GtkBindingSet *binding_set; | 4112 | GtkBindingSet *binding_set; |
| 4275 | 4113 | ||