Mercurial > emacs
comparison src/gtkutil.c @ 59411:ecb6689e04bf
* gtkutil.c (xg_gtk_scroll_destroy, xg_create_scroll_bar)
(xg_tool_bar_callback, xg_tool_bar_help_callback)
(update_frame_tool_bar): Cast to EMACS_INT to avoid compiler
warning.
* xselect.c (x_get_foreign_selection, x_fill_property_data)
(Fx_get_atom_name, Fx_send_client_event): Replace XFLOAT with
XFLOAT_DATA to get extract number from Lisp object.
author | Jan Djärv <jan.h.d@swipnet.se> |
---|---|
date | Fri, 07 Jan 2005 16:59:57 +0000 |
parents | 0096c58ce34a |
children | eb72706060ad |
comparison
equal
deleted
inserted
replaced
59410:ae92bd0348cd | 59411:ecb6689e04bf |
---|---|
2848 xg_gtk_scroll_destroy (widget, data) | 2848 xg_gtk_scroll_destroy (widget, data) |
2849 GtkWidget *widget; | 2849 GtkWidget *widget; |
2850 gpointer data; | 2850 gpointer data; |
2851 { | 2851 { |
2852 gpointer p; | 2852 gpointer p; |
2853 int id = (int)data; | 2853 int id = (int) (EMACS_INT) data; /* The EMACS_INT cast avoids a warning. */ |
2854 | 2854 |
2855 p = g_object_get_data (G_OBJECT (widget), XG_LAST_SB_DATA); | 2855 p = g_object_get_data (G_OBJECT (widget), XG_LAST_SB_DATA); |
2856 if (p) xfree (p); | 2856 if (p) xfree (p); |
2857 xg_remove_widget_from_map (id); | 2857 xg_remove_widget_from_map (id); |
2858 } | 2858 } |
2918 | 2918 |
2919 g_signal_connect (G_OBJECT (wscroll), | 2919 g_signal_connect (G_OBJECT (wscroll), |
2920 "value-changed", | 2920 "value-changed", |
2921 scroll_callback, | 2921 scroll_callback, |
2922 (gpointer) bar); | 2922 (gpointer) bar); |
2923 /* The EMACS_INT cast avoids a warning. */ | |
2923 g_signal_connect (G_OBJECT (wscroll), | 2924 g_signal_connect (G_OBJECT (wscroll), |
2924 "destroy", | 2925 "destroy", |
2925 G_CALLBACK (xg_gtk_scroll_destroy), | 2926 G_CALLBACK (xg_gtk_scroll_destroy), |
2926 (gpointer) scroll_id); | 2927 (gpointer) (EMACS_INT) scroll_id); |
2927 | 2928 |
2928 /* Connect to button press and button release to detect if any scroll bar | 2929 /* Connect to button press and button release to detect if any scroll bar |
2929 has the pointer. */ | 2930 has the pointer. */ |
2930 g_signal_connect (G_OBJECT (wscroll), | 2931 g_signal_connect (G_OBJECT (wscroll), |
2931 "button-press-event", | 2932 "button-press-event", |
3110 static void | 3111 static void |
3111 xg_tool_bar_callback (w, client_data) | 3112 xg_tool_bar_callback (w, client_data) |
3112 GtkWidget *w; | 3113 GtkWidget *w; |
3113 gpointer client_data; | 3114 gpointer client_data; |
3114 { | 3115 { |
3115 int idx = (int)client_data; | 3116 /* The EMACS_INT cast avoids a warning. */ |
3117 int idx = (int) (EMACS_INT) client_data; | |
3116 FRAME_PTR f = (FRAME_PTR) g_object_get_data (G_OBJECT (w), XG_FRAME_DATA); | 3118 FRAME_PTR f = (FRAME_PTR) g_object_get_data (G_OBJECT (w), XG_FRAME_DATA); |
3117 Lisp_Object key, frame; | 3119 Lisp_Object key, frame; |
3118 struct input_event event; | 3120 struct input_event event; |
3119 EVENT_INIT (event); | 3121 EVENT_INIT (event); |
3120 | 3122 |
3207 xg_tool_bar_help_callback (w, event, client_data) | 3209 xg_tool_bar_help_callback (w, event, client_data) |
3208 GtkWidget *w; | 3210 GtkWidget *w; |
3209 GdkEventCrossing *event; | 3211 GdkEventCrossing *event; |
3210 gpointer client_data; | 3212 gpointer client_data; |
3211 { | 3213 { |
3212 int idx = (int)client_data; | 3214 /* The EMACS_INT cast avoids a warning. */ |
3215 int idx = (int) (EMACS_INT) client_data; | |
3213 FRAME_PTR f = (FRAME_PTR) g_object_get_data (G_OBJECT (w), XG_FRAME_DATA); | 3216 FRAME_PTR f = (FRAME_PTR) g_object_get_data (G_OBJECT (w), XG_FRAME_DATA); |
3214 Lisp_Object help, frame; | 3217 Lisp_Object help, frame; |
3215 | 3218 |
3216 if (! GTK_IS_BUTTON (w)) | 3219 if (! GTK_IS_BUTTON (w)) |
3217 { | 3220 { |
3450 { | 3453 { |
3451 GtkWidget *w = xg_get_image_for_pixmap (f, img, x->widget, NULL); | 3454 GtkWidget *w = xg_get_image_for_pixmap (f, img, x->widget, NULL); |
3452 | 3455 |
3453 gtk_misc_set_padding (GTK_MISC (w), hmargin, vmargin); | 3456 gtk_misc_set_padding (GTK_MISC (w), hmargin, vmargin); |
3454 | 3457 |
3458 /* The EMACS_INT cast avoids a warning. */ | |
3455 gtk_toolbar_append_item (GTK_TOOLBAR (x->toolbar_widget), | 3459 gtk_toolbar_append_item (GTK_TOOLBAR (x->toolbar_widget), |
3456 0, 0, 0, | 3460 0, 0, 0, |
3457 w, | 3461 w, |
3458 GTK_SIGNAL_FUNC (xg_tool_bar_callback), | 3462 GTK_SIGNAL_FUNC (xg_tool_bar_callback), |
3459 (gpointer)i); | 3463 (gpointer) (EMACS_INT) i); |
3460 | 3464 |
3461 /* Save the image so we can see if an update is needed when | 3465 /* Save the image so we can see if an update is needed when |
3462 this function is called again. */ | 3466 this function is called again. */ |
3463 g_object_set_data (G_OBJECT (w), XG_TOOL_BAR_IMAGE_DATA, | 3467 g_object_set_data (G_OBJECT (w), XG_TOOL_BAR_IMAGE_DATA, |
3464 (gpointer)img->pixmap); | 3468 (gpointer)img->pixmap); |
3484 | 3488 |
3485 /* Use enter/leave notify to show help. We use the events | 3489 /* Use enter/leave notify to show help. We use the events |
3486 rather than the GtkButton specific signals "enter" and | 3490 rather than the GtkButton specific signals "enter" and |
3487 "leave", so we can have only one callback. The event | 3491 "leave", so we can have only one callback. The event |
3488 will tell us what kind of event it is. */ | 3492 will tell us what kind of event it is. */ |
3493 /* The EMACS_INT cast avoids a warning. */ | |
3489 g_signal_connect (G_OBJECT (w), | 3494 g_signal_connect (G_OBJECT (w), |
3490 "enter-notify-event", | 3495 "enter-notify-event", |
3491 G_CALLBACK (xg_tool_bar_help_callback), | 3496 G_CALLBACK (xg_tool_bar_help_callback), |
3492 (gpointer)i); | 3497 (gpointer) (EMACS_INT) i); |
3493 g_signal_connect (G_OBJECT (w), | 3498 g_signal_connect (G_OBJECT (w), |
3494 "leave-notify-event", | 3499 "leave-notify-event", |
3495 G_CALLBACK (xg_tool_bar_help_callback), | 3500 G_CALLBACK (xg_tool_bar_help_callback), |
3496 (gpointer)i); | 3501 (gpointer) (EMACS_INT) i); |
3497 } | 3502 } |
3498 } | 3503 } |
3499 else | 3504 else |
3500 { | 3505 { |
3501 /* The child of the tool bar is a button. Inside that button | 3506 /* The child of the tool bar is a button. Inside that button |