diff options
| author | Jan D | 2010-07-05 11:17:12 +0200 |
|---|---|---|
| committer | Jan D | 2010-07-05 11:17:12 +0200 |
| commit | e4c8d29a32adbde811a109d5e19caa75fd9d042b (patch) | |
| tree | ffaa67180bd87eae947408a76cddecaaa1c227b0 /src | |
| parent | 898b4c5c2cb4b4ae2fa2cd1631db63a9acff787a (diff) | |
| download | emacs-e4c8d29a32adbde811a109d5e19caa75fd9d042b.tar.gz emacs-e4c8d29a32adbde811a109d5e19caa75fd9d042b.zip | |
Fix some bad prototypes and formatting after conversion from K&R declaration.
* lwlib/lwlib-Xaw.c: Include <ctype.h> for isdigit.
(fill_xft_data, set_text): Remove unused variable screen.
(draw_text): Cast bp to FcChar8*.
(find_xft_data): Return 0 if inst or xft_data is not set.
(wm_delete_window): Correct prototype. Initialize widget to 0
and return if widget is still 0 after loop.
* lwlib/xlwmenu.c (XlwMenuSetValues, XlwMenuInitialize): Correct prototype.
(display_menu_item): Remove unused variable gi.
(make_windows_if_needed): Remove unused variable screen.
(XlwMenuRedisplay): Remove unused variable i.
* src/gtkutil.c (xg_get_pixbuf_from_pix_and_mask)
(xg_get_image_for_pixmap, create_dialog)
(xg_get_file_with_selection, xg_get_file_name, update_cl_data)
(menuitem_highlight_callback, make_menu_item)
(xg_create_one_menuitem, create_menus, xg_update_menu_item)
(xg_create_scroll_bar, xg_update_scrollbar_pos)
(xg_set_toolkit_scroll_bar_thumb, xg_tool_bar_button_cb)
(xg_tool_bar_proxy_help_callback, xg_tool_bar_detach_callback)
(xg_tool_bar_attach_callback, xg_tool_bar_help_callback)
(xg_tool_bar_item_expose_callback): Reformat prototype.
(xg_update_menubar): GList *group => GSList *group.
(xg_modify_menubar_widgets): Initialize witem to 0, check witem != 0
before use.
(update_frame_tool_bar): 4:th param to xg_get_image_for_pixmap changed
to GTK_IMAGE (wimage).
* src/xsettings.c (something_changedCB, parse_settings)
(apply_xft_settings): Reformat prototype.
(something_changedCB, init_gconf): Remove unused variable i.
(read_settings): Remove unused variable long_len.
* src/xsmfns.c (SSDATA): New macro.
(smc_save_yourself_CB, x_session_initialize): Use SSDATA for strings
passed to strlen/strcpy/strcat.
(create_client_leader_window): Surround with #ifndef USE_GTK. Cast
7:th arg to XChangeProperty to (unsigned char *)
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 29 | ||||
| -rw-r--r-- | src/gtkutil.c | 136 | ||||
| -rw-r--r-- | src/xsettings.c | 16 | ||||
| -rw-r--r-- | src/xsmfns.c | 22 |
4 files changed, 143 insertions, 60 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 3bccc7179d5..0b23f0c4426 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,32 @@ | |||
| 1 | 2010-07-05 Jan Djärv <jan.h.d@swipnet.se> | ||
| 2 | |||
| 3 | * xsmfns.c (SSDATA): New macro. | ||
| 4 | (smc_save_yourself_CB, x_session_initialize): Use SSDATA for strings | ||
| 5 | passed to strlen/strcpy/strcat. | ||
| 6 | (create_client_leader_window): Surround with #ifndef USE_GTK. Cast | ||
| 7 | 7:th arg to XChangeProperty to (unsigned char *) | ||
| 8 | |||
| 9 | * xsettings.c (something_changedCB, parse_settings) | ||
| 10 | (apply_xft_settings): Reformat prototype. | ||
| 11 | (something_changedCB, init_gconf): Remove unused variable i. | ||
| 12 | (read_settings): Remove unused variable long_len. | ||
| 13 | |||
| 14 | * gtkutil.c (xg_get_pixbuf_from_pix_and_mask) | ||
| 15 | (xg_get_image_for_pixmap, create_dialog) | ||
| 16 | (xg_get_file_with_selection, xg_get_file_name, update_cl_data) | ||
| 17 | (menuitem_highlight_callback, make_menu_item) | ||
| 18 | (xg_create_one_menuitem, create_menus, xg_update_menu_item) | ||
| 19 | (xg_create_scroll_bar, xg_update_scrollbar_pos) | ||
| 20 | (xg_set_toolkit_scroll_bar_thumb, xg_tool_bar_button_cb) | ||
| 21 | (xg_tool_bar_proxy_help_callback, xg_tool_bar_detach_callback) | ||
| 22 | (xg_tool_bar_attach_callback, xg_tool_bar_help_callback) | ||
| 23 | (xg_tool_bar_item_expose_callback): Reformat prototype. | ||
| 24 | (xg_update_menubar): GList *group => GSList *group. | ||
| 25 | (xg_modify_menubar_widgets): Initialize witem to 0, check witem != 0 | ||
| 26 | before use. | ||
| 27 | (update_frame_tool_bar): 4:th param to xg_get_image_for_pixmap changed | ||
| 28 | to GTK_IMAGE (wimage). | ||
| 29 | |||
| 1 | 2010-07-05 Dan Nicolaescu <dann@ics.uci.edu> | 30 | 2010-07-05 Dan Nicolaescu <dann@ics.uci.edu> |
| 2 | 31 | ||
| 3 | * atimer.c: Use "" instead of <> for local includes for | 32 | * atimer.c: Use "" instead of <> for local includes for |
diff --git a/src/gtkutil.c b/src/gtkutil.c index 86bf03eed41..447d5642b79 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -231,7 +231,9 @@ xg_create_default_cursor (Display *dpy) | |||
| 231 | /* 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. */ |
| 232 | 232 | ||
| 233 | static GdkPixbuf * | 233 | static GdkPixbuf * |
| 234 | xg_get_pixbuf_from_pix_and_mask (GdkPixmap *gpix, GdkPixmap *gmask, GdkColormap *cmap) | 234 | xg_get_pixbuf_from_pix_and_mask (GdkPixmap *gpix, |
| 235 | GdkPixmap *gmask, | ||
| 236 | GdkColormap *cmap) | ||
| 235 | { | 237 | { |
| 236 | int width, height; | 238 | int width, height; |
| 237 | GdkPixbuf *icon_buf, *tmp_buf; | 239 | GdkPixbuf *icon_buf, *tmp_buf; |
| @@ -309,7 +311,10 @@ file_for_image (Lisp_Object image) | |||
| 309 | If OLD_WIDGET is not NULL, that widget is modified. */ | 311 | If OLD_WIDGET is not NULL, that widget is modified. */ |
| 310 | 312 | ||
| 311 | static GtkWidget * | 313 | static GtkWidget * |
| 312 | xg_get_image_for_pixmap (FRAME_PTR f, struct image *img, GtkWidget *widget, GtkImage *old_widget) | 314 | xg_get_image_for_pixmap (FRAME_PTR f, |
| 315 | struct image *img, | ||
| 316 | GtkWidget *widget, | ||
| 317 | GtkImage *old_widget) | ||
| 313 | { | 318 | { |
| 314 | GdkPixmap *gpix; | 319 | GdkPixmap *gpix; |
| 315 | GdkPixmap *gmask; | 320 | GdkPixmap *gmask; |
| @@ -1039,7 +1044,9 @@ dialog_delete_callback (GtkWidget *w, GdkEvent *event, gpointer user_data) | |||
| 1039 | Returns the GTK dialog widget. */ | 1044 | Returns the GTK dialog widget. */ |
| 1040 | 1045 | ||
| 1041 | static GtkWidget * | 1046 | static GtkWidget * |
| 1042 | create_dialog (widget_value *wv, GCallback select_cb, GCallback deactivate_cb) | 1047 | create_dialog (widget_value *wv, |
| 1048 | GCallback select_cb, | ||
| 1049 | GCallback deactivate_cb) | ||
| 1043 | { | 1050 | { |
| 1044 | char *title = get_dialog_title (wv->name[0]); | 1051 | char *title = get_dialog_title (wv->name[0]); |
| 1045 | int total_buttons = wv->name[1] - '0'; | 1052 | int total_buttons = wv->name[1] - '0'; |
| @@ -1459,12 +1466,11 @@ xg_get_file_name_from_selector (GtkWidget *w) | |||
| 1459 | Returns the created widget. */ | 1466 | Returns the created widget. */ |
| 1460 | 1467 | ||
| 1461 | static GtkWidget * | 1468 | static GtkWidget * |
| 1462 | xg_get_file_with_selection ( | 1469 | xg_get_file_with_selection (FRAME_PTR f, |
| 1463 | FRAME_PTR f, | 1470 | char *prompt, |
| 1464 | char *prompt, | 1471 | char *default_filename, |
| 1465 | char *default_filename, | 1472 | int mustmatch_p, int only_dir_p, |
| 1466 | int mustmatch_p, int only_dir_p, | 1473 | xg_get_file_func *func) |
| 1467 | xg_get_file_func *func) | ||
| 1468 | { | 1474 | { |
| 1469 | GtkWidget *filewin; | 1475 | GtkWidget *filewin; |
| 1470 | GtkFileSelection *filesel; | 1476 | GtkFileSelection *filesel; |
| @@ -1502,7 +1508,11 @@ xg_get_file_with_selection ( | |||
| 1502 | The returned string must be freed by the caller. */ | 1508 | The returned string must be freed by the caller. */ |
| 1503 | 1509 | ||
| 1504 | char * | 1510 | char * |
| 1505 | xg_get_file_name (FRAME_PTR f, char *prompt, char *default_filename, int mustmatch_p, int only_dir_p) | 1511 | xg_get_file_name (FRAME_PTR f, |
| 1512 | char *prompt, | ||
| 1513 | char *default_filename, | ||
| 1514 | int mustmatch_p, | ||
| 1515 | int only_dir_p) | ||
| 1506 | { | 1516 | { |
| 1507 | GtkWidget *w = 0; | 1517 | GtkWidget *w = 0; |
| 1508 | char *fn = 0; | 1518 | char *fn = 0; |
| @@ -1652,7 +1662,9 @@ make_cl_data (xg_menu_cb_data *cl_data, FRAME_PTR f, GCallback highlight_cb) | |||
| 1652 | creating the menu bar. */ | 1662 | creating the menu bar. */ |
| 1653 | 1663 | ||
| 1654 | static void | 1664 | static void |
| 1655 | update_cl_data (xg_menu_cb_data *cl_data, FRAME_PTR f, GCallback highlight_cb) | 1665 | update_cl_data (xg_menu_cb_data *cl_data, |
| 1666 | FRAME_PTR f, | ||
| 1667 | GCallback highlight_cb) | ||
| 1656 | { | 1668 | { |
| 1657 | if (cl_data) | 1669 | if (cl_data) |
| 1658 | { | 1670 | { |
| @@ -1723,7 +1735,9 @@ menuitem_destroy_callback (GtkWidget *w, gpointer client_data) | |||
| 1723 | Returns FALSE to tell GTK to keep processing this event. */ | 1735 | Returns FALSE to tell GTK to keep processing this event. */ |
| 1724 | 1736 | ||
| 1725 | static gboolean | 1737 | static gboolean |
| 1726 | menuitem_highlight_callback (GtkWidget *w, GdkEventCrossing *event, gpointer client_data) | 1738 | menuitem_highlight_callback (GtkWidget *w, |
| 1739 | GdkEventCrossing *event, | ||
| 1740 | gpointer client_data) | ||
| 1727 | { | 1741 | { |
| 1728 | GdkEvent ev; | 1742 | GdkEvent ev; |
| 1729 | GtkWidget *subwidget; | 1743 | GtkWidget *subwidget; |
| @@ -1800,7 +1814,10 @@ make_widget_for_menu_item (char *utf8_label, char *utf8_key) | |||
| 1800 | but the MacOS X version doesn't either, so I guess that is OK. */ | 1814 | but the MacOS X version doesn't either, so I guess that is OK. */ |
| 1801 | 1815 | ||
| 1802 | static GtkWidget * | 1816 | static GtkWidget * |
| 1803 | make_menu_item (char *utf8_label, char *utf8_key, widget_value *item, GSList **group) | 1817 | make_menu_item (char *utf8_label, |
| 1818 | char *utf8_key, | ||
| 1819 | widget_value *item, | ||
| 1820 | GSList **group) | ||
| 1804 | { | 1821 | { |
| 1805 | GtkWidget *w; | 1822 | GtkWidget *w; |
| 1806 | GtkWidget *wtoadd = 0; | 1823 | GtkWidget *wtoadd = 0; |
| @@ -1945,7 +1962,12 @@ tearoff_activate (GtkWidget *widget, gpointer client_data) | |||
| 1945 | Returns the created GtkWidget. */ | 1962 | Returns the created GtkWidget. */ |
| 1946 | 1963 | ||
| 1947 | static GtkWidget * | 1964 | static GtkWidget * |
| 1948 | xg_create_one_menuitem (widget_value *item, FRAME_PTR f, GCallback select_cb, GCallback highlight_cb, xg_menu_cb_data *cl_data, GSList **group) | 1965 | xg_create_one_menuitem (widget_value *item, |
| 1966 | FRAME_PTR f, | ||
| 1967 | GCallback select_cb, | ||
| 1968 | GCallback highlight_cb, | ||
| 1969 | xg_menu_cb_data *cl_data, | ||
| 1970 | GSList **group) | ||
| 1949 | { | 1971 | { |
| 1950 | char *utf8_label; | 1972 | char *utf8_label; |
| 1951 | char *utf8_key; | 1973 | char *utf8_key; |
| @@ -1988,10 +2010,6 @@ xg_create_one_menuitem (widget_value *item, FRAME_PTR f, GCallback select_cb, GC | |||
| 1988 | return w; | 2010 | return w; |
| 1989 | } | 2011 | } |
| 1990 | 2012 | ||
| 1991 | static GtkWidget *create_menus (widget_value *, FRAME_PTR, GCallback, | ||
| 1992 | GCallback, GCallback, int, int, int, | ||
| 1993 | GtkWidget *, xg_menu_cb_data *, char *); | ||
| 1994 | |||
| 1995 | /* Create a full menu tree specified by DATA. | 2013 | /* Create a full menu tree specified by DATA. |
| 1996 | F is the frame the created menu belongs to. | 2014 | F is the frame the created menu belongs to. |
| 1997 | SELECT_CB is the callback to use when a menu item is selected. | 2015 | SELECT_CB is the callback to use when a menu item is selected. |
| @@ -2015,19 +2033,17 @@ static GtkWidget *create_menus (widget_value *, FRAME_PTR, GCallback, | |||
| 2015 | This function calls itself to create submenus. */ | 2033 | This function calls itself to create submenus. */ |
| 2016 | 2034 | ||
| 2017 | static GtkWidget * | 2035 | static GtkWidget * |
| 2018 | create_menus (data, f, select_cb, deactivate_cb, highlight_cb, | 2036 | create_menus (widget_value *data, |
| 2019 | pop_up_p, menu_bar_p, add_tearoff_p, topmenu, cl_data, name) | 2037 | FRAME_PTR f, |
| 2020 | widget_value *data; | 2038 | GCallback select_cb, |
| 2021 | FRAME_PTR f; | 2039 | GCallback deactivate_cb, |
| 2022 | GCallback select_cb; | 2040 | GCallback highlight_cb, |
| 2023 | GCallback deactivate_cb; | 2041 | int pop_up_p, |
| 2024 | GCallback highlight_cb; | 2042 | int menu_bar_p, |
| 2025 | int pop_up_p; | 2043 | int add_tearoff_p, |
| 2026 | int menu_bar_p; | 2044 | GtkWidget *topmenu, |
| 2027 | int add_tearoff_p; | 2045 | xg_menu_cb_data *cl_data, |
| 2028 | GtkWidget *topmenu; | 2046 | char *name) |
| 2029 | xg_menu_cb_data *cl_data; | ||
| 2030 | char *name; | ||
| 2031 | { | 2047 | { |
| 2032 | widget_value *item; | 2048 | widget_value *item; |
| 2033 | GtkWidget *wmenu = topmenu; | 2049 | GtkWidget *wmenu = topmenu; |
| @@ -2397,7 +2413,7 @@ xg_update_menubar (GtkWidget *menubar, | |||
| 2397 | Insert X. */ | 2413 | Insert X. */ |
| 2398 | 2414 | ||
| 2399 | int nr = pos; | 2415 | int nr = pos; |
| 2400 | GList *group = 0; | 2416 | GSList *group = 0; |
| 2401 | GtkWidget *w = xg_create_one_menuitem (val, | 2417 | GtkWidget *w = xg_create_one_menuitem (val, |
| 2402 | f, | 2418 | f, |
| 2403 | select_cb, | 2419 | select_cb, |
| @@ -2456,7 +2472,11 @@ xg_update_menubar (GtkWidget *menubar, | |||
| 2456 | CL_DATA is the data to set in the widget for menu invocation. */ | 2472 | CL_DATA is the data to set in the widget for menu invocation. */ |
| 2457 | 2473 | ||
| 2458 | static void | 2474 | static void |
| 2459 | xg_update_menu_item (widget_value *val, GtkWidget *w, GCallback select_cb, GCallback highlight_cb, xg_menu_cb_data *cl_data) | 2475 | xg_update_menu_item (widget_value *val, |
| 2476 | GtkWidget *w, | ||
| 2477 | GCallback select_cb, | ||
| 2478 | GCallback highlight_cb, | ||
| 2479 | xg_menu_cb_data *cl_data) | ||
| 2460 | { | 2480 | { |
| 2461 | GtkWidget *wchild; | 2481 | GtkWidget *wchild; |
| 2462 | GtkLabel *wlbl = 0; | 2482 | GtkLabel *wlbl = 0; |
| @@ -2760,7 +2780,7 @@ xg_modify_menubar_widgets (menubar, f, val, deep_p, | |||
| 2760 | GList *iter; | 2780 | GList *iter; |
| 2761 | GtkWidget *sub = 0; | 2781 | GtkWidget *sub = 0; |
| 2762 | GtkWidget *newsub; | 2782 | GtkWidget *newsub; |
| 2763 | GtkMenuItem *witem; | 2783 | GtkMenuItem *witem = 0; |
| 2764 | 2784 | ||
| 2765 | /* Find sub menu that corresponds to val and update it. */ | 2785 | /* Find sub menu that corresponds to val and update it. */ |
| 2766 | for (iter = list ; iter; iter = g_list_next (iter)) | 2786 | for (iter = list ; iter; iter = g_list_next (iter)) |
| @@ -2783,7 +2803,7 @@ xg_modify_menubar_widgets (menubar, f, val, deep_p, | |||
| 2783 | /* sub may still be NULL. If we just updated non deep and added | 2803 | /* sub may still be NULL. If we just updated non deep and added |
| 2784 | a new menu bar item, it has no sub menu yet. So we set the | 2804 | a new menu bar item, it has no sub menu yet. So we set the |
| 2785 | newly created sub menu under witem. */ | 2805 | newly created sub menu under witem. */ |
| 2786 | if (newsub != sub) | 2806 | if (newsub != sub && witem != 0) |
| 2787 | { | 2807 | { |
| 2788 | xg_set_screen (newsub, f); | 2808 | xg_set_screen (newsub, f); |
| 2789 | gtk_menu_item_set_submenu (witem, newsub); | 2809 | gtk_menu_item_set_submenu (witem, newsub); |
| @@ -2976,7 +2996,11 @@ xg_gtk_scroll_destroy (GtkWidget *widget, gpointer data) | |||
| 2976 | to set resources for the widget. */ | 2996 | to set resources for the widget. */ |
| 2977 | 2997 | ||
| 2978 | void | 2998 | void |
| 2979 | xg_create_scroll_bar (FRAME_PTR f, struct scroll_bar *bar, GCallback scroll_callback, GCallback end_callback, char *scroll_bar_name) | 2999 | xg_create_scroll_bar (FRAME_PTR f, |
| 3000 | struct scroll_bar *bar, | ||
| 3001 | GCallback scroll_callback, | ||
| 3002 | GCallback end_callback, | ||
| 3003 | char *scroll_bar_name) | ||
| 2980 | { | 3004 | { |
| 2981 | GtkWidget *wscroll; | 3005 | GtkWidget *wscroll; |
| 2982 | GtkWidget *webox; | 3006 | GtkWidget *webox; |
| @@ -3047,7 +3071,12 @@ xg_remove_scroll_bar (FRAME_PTR f, int scrollbar_id) | |||
| 3047 | WIDTH, HEIGHT is the size in pixels the bar shall have. */ | 3071 | WIDTH, HEIGHT is the size in pixels the bar shall have. */ |
| 3048 | 3072 | ||
| 3049 | void | 3073 | void |
| 3050 | xg_update_scrollbar_pos (FRAME_PTR f, int scrollbar_id, int top, int left, int width, int height) | 3074 | xg_update_scrollbar_pos (FRAME_PTR f, |
| 3075 | int scrollbar_id, | ||
| 3076 | int top, | ||
| 3077 | int left, | ||
| 3078 | int width, | ||
| 3079 | int height) | ||
| 3051 | { | 3080 | { |
| 3052 | 3081 | ||
| 3053 | GtkWidget *wscroll = xg_get_widget_from_map (scrollbar_id); | 3082 | GtkWidget *wscroll = xg_get_widget_from_map (scrollbar_id); |
| @@ -3108,7 +3137,10 @@ xg_update_scrollbar_pos (FRAME_PTR f, int scrollbar_id, int top, int left, int w | |||
| 3108 | displaying PORTION out of a whole WHOLE, and our position POSITION. */ | 3137 | displaying PORTION out of a whole WHOLE, and our position POSITION. */ |
| 3109 | 3138 | ||
| 3110 | void | 3139 | void |
| 3111 | xg_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar, int portion, int position, int whole) | 3140 | xg_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar, |
| 3141 | int portion, | ||
| 3142 | int position, | ||
| 3143 | int whole) | ||
| 3112 | { | 3144 | { |
| 3113 | GtkWidget *wscroll = xg_get_widget_from_map (bar->x_window); | 3145 | GtkWidget *wscroll = xg_get_widget_from_map (bar->x_window); |
| 3114 | 3146 | ||
| @@ -3245,7 +3277,9 @@ xg_event_is_for_scrollbar (FRAME_PTR f, XEvent *event) | |||
| 3245 | tool bar. 0 is the first button. */ | 3277 | tool bar. 0 is the first button. */ |
| 3246 | 3278 | ||
| 3247 | static gboolean | 3279 | static gboolean |
| 3248 | xg_tool_bar_button_cb (GtkWidget *widget, GdkEventButton *event, gpointer user_data) | 3280 | xg_tool_bar_button_cb (GtkWidget *widget, |
| 3281 | GdkEventButton *event, | ||
| 3282 | gpointer user_data) | ||
| 3249 | { | 3283 | { |
| 3250 | /* Casts to avoid warnings when gpointer is 64 bits and int is 32 bits */ | 3284 | /* Casts to avoid warnings when gpointer is 64 bits and int is 32 bits */ |
| 3251 | gpointer ptr = (gpointer) (EMACS_INT) event->state; | 3285 | gpointer ptr = (gpointer) (EMACS_INT) event->state; |
| @@ -3326,7 +3360,9 @@ xg_tool_bar_help_callback (GtkWidget *w, | |||
| 3326 | the detached tool bar when the detached tool bar it is not expanded. */ | 3360 | the detached tool bar when the detached tool bar it is not expanded. */ |
| 3327 | 3361 | ||
| 3328 | static gboolean | 3362 | static gboolean |
| 3329 | xg_tool_bar_proxy_help_callback (GtkWidget *w, GdkEventCrossing *event, gpointer client_data) | 3363 | xg_tool_bar_proxy_help_callback (GtkWidget *w, |
| 3364 | GdkEventCrossing *event, | ||
| 3365 | gpointer client_data) | ||
| 3330 | { | 3366 | { |
| 3331 | GtkWidget *wbutton = GTK_WIDGET (g_object_get_data (G_OBJECT (w), | 3367 | GtkWidget *wbutton = GTK_WIDGET (g_object_get_data (G_OBJECT (w), |
| 3332 | XG_TOOL_BAR_PROXY_BUTTON)); | 3368 | XG_TOOL_BAR_PROXY_BUTTON)); |
| @@ -3462,7 +3498,9 @@ xg_tool_bar_menu_proxy (GtkToolItem *toolitem, gpointer user_data) | |||
| 3462 | CLIENT_DATA is a pointer to the frame the tool bar belongs to. */ | 3498 | CLIENT_DATA is a pointer to the frame the tool bar belongs to. */ |
| 3463 | 3499 | ||
| 3464 | static void | 3500 | static void |
| 3465 | xg_tool_bar_detach_callback (GtkHandleBox *wbox, GtkWidget *w, gpointer client_data) | 3501 | xg_tool_bar_detach_callback (GtkHandleBox *wbox, |
| 3502 | GtkWidget *w, | ||
| 3503 | gpointer client_data) | ||
| 3466 | { | 3504 | { |
| 3467 | FRAME_PTR f = (FRAME_PTR) client_data; | 3505 | FRAME_PTR f = (FRAME_PTR) client_data; |
| 3468 | extern int x_gtk_whole_detached_tool_bar; | 3506 | extern int x_gtk_whole_detached_tool_bar; |
| @@ -3490,7 +3528,9 @@ xg_tool_bar_detach_callback (GtkHandleBox *wbox, GtkWidget *w, gpointer client_d | |||
| 3490 | CLIENT_DATA is a pointer to the frame the tool bar belongs to. */ | 3528 | CLIENT_DATA is a pointer to the frame the tool bar belongs to. */ |
| 3491 | 3529 | ||
| 3492 | static void | 3530 | static void |
| 3493 | xg_tool_bar_attach_callback (GtkHandleBox *wbox, GtkWidget *w, gpointer client_data) | 3531 | xg_tool_bar_attach_callback (GtkHandleBox *wbox, |
| 3532 | GtkWidget *w, | ||
| 3533 | gpointer client_data) | ||
| 3494 | { | 3534 | { |
| 3495 | FRAME_PTR f = (FRAME_PTR) client_data; | 3535 | FRAME_PTR f = (FRAME_PTR) client_data; |
| 3496 | g_object_set (G_OBJECT (w), "show-arrow", TRUE, NULL); | 3536 | g_object_set (G_OBJECT (w), "show-arrow", TRUE, NULL); |
| @@ -3517,7 +3557,9 @@ xg_tool_bar_attach_callback (GtkHandleBox *wbox, GtkWidget *w, gpointer client_d | |||
| 3517 | Returns FALSE to tell GTK to keep processing this event. */ | 3557 | Returns FALSE to tell GTK to keep processing this event. */ |
| 3518 | 3558 | ||
| 3519 | static gboolean | 3559 | static gboolean |
| 3520 | xg_tool_bar_help_callback (GtkWidget *w, GdkEventCrossing *event, gpointer client_data) | 3560 | xg_tool_bar_help_callback (GtkWidget *w, |
| 3561 | GdkEventCrossing *event, | ||
| 3562 | gpointer client_data) | ||
| 3521 | { | 3563 | { |
| 3522 | /* The EMACS_INT cast avoids a warning. */ | 3564 | /* The EMACS_INT cast avoids a warning. */ |
| 3523 | int idx = (int) (EMACS_INT) client_data; | 3565 | int idx = (int) (EMACS_INT) client_data; |
| @@ -3556,7 +3598,9 @@ xg_tool_bar_help_callback (GtkWidget *w, GdkEventCrossing *event, gpointer clien | |||
| 3556 | Returns FALSE to tell GTK to keep processing this event. */ | 3598 | Returns FALSE to tell GTK to keep processing this event. */ |
| 3557 | 3599 | ||
| 3558 | static gboolean | 3600 | static gboolean |
| 3559 | xg_tool_bar_item_expose_callback (GtkWidget *w, GdkEventExpose *event, gpointer client_data) | 3601 | xg_tool_bar_item_expose_callback (GtkWidget *w, |
| 3602 | GdkEventExpose *event, | ||
| 3603 | gpointer client_data) | ||
| 3560 | { | 3604 | { |
| 3561 | gint width, height; | 3605 | gint width, height; |
| 3562 | 3606 | ||
| @@ -3849,7 +3893,6 @@ update_frame_tool_bar (FRAME_PTR f) | |||
| 3849 | GtkWidget *wbutton = NULL; | 3893 | GtkWidget *wbutton = NULL; |
| 3850 | GtkWidget *weventbox; | 3894 | GtkWidget *weventbox; |
| 3851 | Lisp_Object specified_file; | 3895 | Lisp_Object specified_file; |
| 3852 | Lisp_Object lbl = PROP (TOOL_BAR_ITEM_LABEL); | ||
| 3853 | char *label = SSDATA (PROP (TOOL_BAR_ITEM_LABEL)); | 3896 | char *label = SSDATA (PROP (TOOL_BAR_ITEM_LABEL)); |
| 3854 | 3897 | ||
| 3855 | ti = gtk_toolbar_get_nth_item (GTK_TOOLBAR (wtoolbar), i); | 3898 | ti = gtk_toolbar_get_nth_item (GTK_TOOLBAR (wtoolbar), i); |
| @@ -4020,7 +4063,8 @@ update_frame_tool_bar (FRAME_PTR f) | |||
| 4020 | } | 4063 | } |
| 4021 | else if (img && old_img != img->pixmap) | 4064 | else if (img && old_img != img->pixmap) |
| 4022 | { | 4065 | { |
| 4023 | (void) xg_get_image_for_pixmap (f, img, x->widget, wimage); | 4066 | (void) xg_get_image_for_pixmap (f, img, x->widget, |
| 4067 | GTK_IMAGE (wimage)); | ||
| 4024 | g_object_set_data (G_OBJECT (wimage), XG_TOOL_BAR_IMAGE_DATA, | 4068 | g_object_set_data (G_OBJECT (wimage), XG_TOOL_BAR_IMAGE_DATA, |
| 4025 | (gpointer)img->pixmap); | 4069 | (gpointer)img->pixmap); |
| 4026 | 4070 | ||
diff --git a/src/xsettings.c b/src/xsettings.c index e8aba9ef2d8..a8c89f5fb3d 100644 --- a/src/xsettings.c +++ b/src/xsettings.c | |||
| @@ -100,7 +100,10 @@ struct xsettings | |||
| 100 | that is SYSTEM_MONO_FONT. */ | 100 | that is SYSTEM_MONO_FONT. */ |
| 101 | 101 | ||
| 102 | static void | 102 | static void |
| 103 | something_changedCB (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data) | 103 | something_changedCB (GConfClient *client, |
| 104 | guint cnxn_id, | ||
| 105 | GConfEntry *entry, | ||
| 106 | gpointer user_data) | ||
| 104 | { | 107 | { |
| 105 | GConfValue *v = gconf_entry_get_value (entry); | 108 | GConfValue *v = gconf_entry_get_value (entry); |
| 106 | 109 | ||
| @@ -108,7 +111,6 @@ something_changedCB (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpoi | |||
| 108 | if (v->type == GCONF_VALUE_STRING) | 111 | if (v->type == GCONF_VALUE_STRING) |
| 109 | { | 112 | { |
| 110 | const char *value = gconf_value_get_string (v); | 113 | const char *value = gconf_value_get_string (v); |
| 111 | int i; | ||
| 112 | if (current_mono_font != NULL && strcmp (value, current_mono_font) == 0) | 114 | if (current_mono_font != NULL && strcmp (value, current_mono_font) == 0) |
| 113 | return; /* No change. */ | 115 | return; /* No change. */ |
| 114 | 116 | ||
| @@ -222,7 +224,9 @@ get_prop_window (struct x_display_info *dpyinfo) | |||
| 222 | */ | 224 | */ |
| 223 | 225 | ||
| 224 | static int | 226 | static int |
| 225 | parse_settings (unsigned char *prop, long unsigned int bytes, struct xsettings *settings) | 227 | parse_settings (unsigned char *prop, |
| 228 | long unsigned int bytes, | ||
| 229 | struct xsettings *settings) | ||
| 226 | { | 230 | { |
| 227 | Lisp_Object byteorder = Fbyteorder (); | 231 | Lisp_Object byteorder = Fbyteorder (); |
| 228 | int my_bo = XFASTINT (byteorder) == 'B' ? MSBFirst : LSBFirst; | 232 | int my_bo = XFASTINT (byteorder) == 'B' ? MSBFirst : LSBFirst; |
| @@ -394,7 +398,6 @@ parse_settings (unsigned char *prop, long unsigned int bytes, struct xsettings * | |||
| 394 | static int | 398 | static int |
| 395 | read_settings (struct x_display_info *dpyinfo, struct xsettings *settings) | 399 | read_settings (struct x_display_info *dpyinfo, struct xsettings *settings) |
| 396 | { | 400 | { |
| 397 | long long_len; | ||
| 398 | Atom act_type; | 401 | Atom act_type; |
| 399 | int act_form; | 402 | int act_form; |
| 400 | unsigned long nitems, bytes_after; | 403 | unsigned long nitems, bytes_after; |
| @@ -423,7 +426,9 @@ read_settings (struct x_display_info *dpyinfo, struct xsettings *settings) | |||
| 423 | 426 | ||
| 424 | 427 | ||
| 425 | static void | 428 | static void |
| 426 | apply_xft_settings (struct x_display_info *dpyinfo, int send_event_p, struct xsettings *settings) | 429 | apply_xft_settings (struct x_display_info *dpyinfo, |
| 430 | int send_event_p, | ||
| 431 | struct xsettings *settings) | ||
| 427 | { | 432 | { |
| 428 | #ifdef HAVE_XFT | 433 | #ifdef HAVE_XFT |
| 429 | FcPattern *pat; | 434 | FcPattern *pat; |
| @@ -620,7 +625,6 @@ static void | |||
| 620 | init_gconf (void) | 625 | init_gconf (void) |
| 621 | { | 626 | { |
| 622 | #if defined (HAVE_GCONF) && defined (HAVE_XFT) | 627 | #if defined (HAVE_GCONF) && defined (HAVE_XFT) |
| 623 | int i; | ||
| 624 | char *s; | 628 | char *s; |
| 625 | 629 | ||
| 626 | g_type_init (); | 630 | g_type_init (); |
diff --git a/src/xsmfns.c b/src/xsmfns.c index dbf52af92d5..2ebd4a45c41 100644 --- a/src/xsmfns.c +++ b/src/xsmfns.c | |||
| @@ -42,6 +42,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 42 | #include "termopts.h" | 42 | #include "termopts.h" |
| 43 | #include "xterm.h" | 43 | #include "xterm.h" |
| 44 | 44 | ||
| 45 | /* Avoid "differ in sign" warnings */ | ||
| 46 | #define SSDATA(x) ((char *) SDATA (x)) | ||
| 47 | |||
| 45 | /* The user login name. */ | 48 | /* The user login name. */ |
| 46 | 49 | ||
| 47 | extern Lisp_Object Vuser_login_name; | 50 | extern Lisp_Object Vuser_login_name; |
| @@ -219,7 +222,7 @@ smc_save_yourself_CB (SmcConn smcConn, | |||
| 219 | props[props_idx]->type = SmARRAY8; | 222 | props[props_idx]->type = SmARRAY8; |
| 220 | props[props_idx]->num_vals = 1; | 223 | props[props_idx]->num_vals = 1; |
| 221 | props[props_idx]->vals = &values[val_idx++]; | 224 | props[props_idx]->vals = &values[val_idx++]; |
| 222 | props[props_idx]->vals[0].length = strlen (SDATA (Vinvocation_name)); | 225 | props[props_idx]->vals[0].length = strlen (SSDATA (Vinvocation_name)); |
| 223 | props[props_idx]->vals[0].value = SDATA (Vinvocation_name); | 226 | props[props_idx]->vals[0].value = SDATA (Vinvocation_name); |
| 224 | ++props_idx; | 227 | ++props_idx; |
| 225 | 228 | ||
| @@ -263,7 +266,7 @@ smc_save_yourself_CB (SmcConn smcConn, | |||
| 263 | props[props_idx]->type = SmARRAY8; | 266 | props[props_idx]->type = SmARRAY8; |
| 264 | props[props_idx]->num_vals = 1; | 267 | props[props_idx]->num_vals = 1; |
| 265 | props[props_idx]->vals = &values[val_idx++]; | 268 | props[props_idx]->vals = &values[val_idx++]; |
| 266 | props[props_idx]->vals[0].length = strlen (SDATA (Vuser_login_name)); | 269 | props[props_idx]->vals[0].length = strlen (SSDATA (Vuser_login_name)); |
| 267 | props[props_idx]->vals[0].value = SDATA (Vuser_login_name); | 270 | props[props_idx]->vals[0].value = SDATA (Vuser_login_name); |
| 268 | ++props_idx; | 271 | ++props_idx; |
| 269 | 272 | ||
| @@ -388,6 +391,7 @@ ice_conn_watch_CB (IceConn iceConn, IcePointer clientData, int opening, IcePoint | |||
| 388 | 391 | ||
| 389 | /* Create the client leader window. */ | 392 | /* Create the client leader window. */ |
| 390 | 393 | ||
| 394 | #ifndef USE_GTK | ||
| 391 | static void | 395 | static void |
| 392 | create_client_leader_window (struct x_display_info *dpyinfo, char *client_id) | 396 | create_client_leader_window (struct x_display_info *dpyinfo, char *client_id) |
| 393 | { | 397 | { |
| @@ -407,10 +411,12 @@ create_client_leader_window (struct x_display_info *dpyinfo, char *client_id) | |||
| 407 | 411 | ||
| 408 | sm_id = XInternAtom (dpyinfo->display, "SM_CLIENT_ID", False); | 412 | sm_id = XInternAtom (dpyinfo->display, "SM_CLIENT_ID", False); |
| 409 | XChangeProperty (dpyinfo->display, w, sm_id, XA_STRING, 8, PropModeReplace, | 413 | XChangeProperty (dpyinfo->display, w, sm_id, XA_STRING, 8, PropModeReplace, |
| 410 | client_id, strlen (client_id)); | 414 | (unsigned char *)client_id, strlen (client_id)); |
| 411 | 415 | ||
| 412 | dpyinfo->client_leader_window = w; | 416 | dpyinfo->client_leader_window = w; |
| 413 | } | 417 | } |
| 418 | #endif /* ! USE_GTK */ | ||
| 419 | |||
| 414 | 420 | ||
| 415 | /* Try to open a connection to the session manager. */ | 421 | /* Try to open a connection to the session manager. */ |
| 416 | 422 | ||
| @@ -429,12 +435,12 @@ x_session_initialize (struct x_display_info *dpyinfo) | |||
| 429 | /* Check if we where started by the session manager. If so, we will | 435 | /* Check if we where started by the session manager. If so, we will |
| 430 | have a previous id. */ | 436 | have a previous id. */ |
| 431 | if (! EQ (Vx_session_previous_id, Qnil) && STRINGP (Vx_session_previous_id)) | 437 | if (! EQ (Vx_session_previous_id, Qnil) && STRINGP (Vx_session_previous_id)) |
| 432 | previous_id = SDATA (Vx_session_previous_id); | 438 | previous_id = SSDATA (Vx_session_previous_id); |
| 433 | 439 | ||
| 434 | /* Construct the path to the Emacs program. */ | 440 | /* Construct the path to the Emacs program. */ |
| 435 | if (! EQ (Vinvocation_directory, Qnil)) | 441 | if (! EQ (Vinvocation_directory, Qnil)) |
| 436 | name_len += strlen (SDATA (Vinvocation_directory)); | 442 | name_len += strlen (SSDATA (Vinvocation_directory)); |
| 437 | name_len += strlen (SDATA (Vinvocation_name)); | 443 | name_len += strlen (SSDATA (Vinvocation_name)); |
| 438 | 444 | ||
| 439 | /* This malloc will not be freed, but it is only done once, and hopefully | 445 | /* This malloc will not be freed, but it is only done once, and hopefully |
| 440 | not very large */ | 446 | not very large */ |
| @@ -442,8 +448,8 @@ x_session_initialize (struct x_display_info *dpyinfo) | |||
| 442 | emacs_program[0] = '\0'; | 448 | emacs_program[0] = '\0'; |
| 443 | 449 | ||
| 444 | if (! EQ (Vinvocation_directory, Qnil)) | 450 | if (! EQ (Vinvocation_directory, Qnil)) |
| 445 | strcpy (emacs_program, SDATA (Vinvocation_directory)); | 451 | strcpy (emacs_program, SSDATA (Vinvocation_directory)); |
| 446 | strcat (emacs_program, SDATA (Vinvocation_name)); | 452 | strcat (emacs_program, SSDATA (Vinvocation_name)); |
| 447 | 453 | ||
| 448 | /* The SM protocol says all callbacks are mandatory, so set up all | 454 | /* The SM protocol says all callbacks are mandatory, so set up all |
| 449 | here and in the mask passed to SmcOpenConnection. */ | 455 | here and in the mask passed to SmcOpenConnection. */ |