gdk_window_get_geometry (w, a, b, c, d, 0)
#define gdk_x11_window_lookup_for_display(d, w) \
gdk_xid_table_lookup_for_display (d, w)
+#ifndef GDK_KEY_g
#define GDK_KEY_g GDK_g
#endif
+#endif
#define XG_BIN_CHILD(x) gtk_bin_get_child (GTK_BIN (x))
hierarchy-changed. */
gtk_tooltip_set_custom (x->ttip_widget, widget);
- gtk_tooltip_set_text (x->ttip_widget, SDATA (encoded_string));
+ gtk_tooltip_set_text (x->ttip_widget, SSDATA (encoded_string));
gtk_widget_get_preferred_size (GTK_WIDGET (x->ttip_window), NULL, &req);
if (width) *width = req.width;
if (height) *height = req.height;
static void
xg_gtk_scroll_destroy (GtkWidget *widget, gpointer data)
{
- int id = (int) (EMACS_INT) data; /* The EMACS_INT cast avoids a warning. */
+ int id = (intptr_t) data;
xg_remove_widget_from_map (id);
}
{
GtkWidget *wscroll;
GtkWidget *webox;
- int scroll_id;
+ intptr_t scroll_id;
#ifdef HAVE_GTK3
GtkAdjustment *vadj;
#else
scroll_id = xg_store_widget_in_map (wscroll);
- /* The EMACS_INT cast avoids a warning. */
g_signal_connect (G_OBJECT (wscroll),
"destroy",
G_CALLBACK (xg_gtk_scroll_destroy),
- (gpointer) (EMACS_INT) scroll_id);
+ (gpointer) scroll_id);
g_signal_connect (G_OBJECT (wscroll),
"change-value",
scroll_callback,
gdouble shown;
gdouble top;
int size, value;
+ int old_size;
int new_step;
int changed = 0;
/* Assume all lines are of equal size. */
new_step = size / max (1, FRAME_LINES (f));
- if ((int) gtk_adjustment_get_page_size (adj) != size
- || (int) gtk_adjustment_get_step_increment (adj) != new_step)
- {
- gtk_adjustment_set_page_size (adj, size);
- gtk_adjustment_set_step_increment (adj, new_step);
- /* Assume a page increment is about 95% of the page size */
- gtk_adjustment_set_page_increment (adj,(int) (0.95*size));
- changed = 1;
- }
+ old_size = gtk_adjustment_get_page_size (adj);
+ if (old_size != size)
+ {
+ int old_step = gtk_adjustment_get_step_increment (adj);
+ if (old_step != new_step)
+ {
+ gtk_adjustment_set_page_size (adj, size);
+ gtk_adjustment_set_step_increment (adj, new_step);
+ /* Assume a page increment is about 95% of the page size */
+ gtk_adjustment_set_page_increment (adj,(int) (0.95*size));
+ changed = 1;
+ }
+ }
if (changed || int_gtk_range_get_value (GTK_RANGE (wscroll)) != value)
{
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;
+ intptr_t state = event->state;
+ gpointer ptr = (gpointer) state;
g_object_set_data (G_OBJECT (widget), XG_TOOL_BAR_LAST_MODIFIER, ptr);
return FALSE;
}
static void
xg_tool_bar_callback (GtkWidget *w, gpointer client_data)
{
- /* The EMACS_INT cast avoids a warning. */
- int idx = (int) (EMACS_INT) client_data;
+ intptr_t idx = (intptr_t) client_data;
gpointer gmod = g_object_get_data (G_OBJECT (w), XG_TOOL_BAR_LAST_MODIFIER);
- int mod = (int) (EMACS_INT) gmod;
+ intptr_t mod = (intptr_t) gmod;
FRAME_PTR f = (FRAME_PTR) g_object_get_data (G_OBJECT (w), XG_FRAME_DATA);
Lisp_Object key, frame;
GdkEventCrossing *event,
gpointer client_data)
{
- /* The EMACS_INT cast avoids a warning. */
- int idx = (int) (EMACS_INT) client_data;
+ intptr_t idx = (intptr_t) client_data;
FRAME_PTR f = (FRAME_PTR) g_object_get_data (G_OBJECT (w), XG_FRAME_DATA);
Lisp_Object help, frame;
if (wimage)
{
- /* The EMACS_INT cast avoids a warning. */
+ intptr_t ii = i;
+ gpointer gi = (gpointer) ii;
+
g_signal_connect (G_OBJECT (ti), "create-menu-proxy",
G_CALLBACK (xg_tool_bar_menu_proxy),
- (gpointer) (EMACS_INT) i);
+ gi);
g_signal_connect (G_OBJECT (wb), "clicked",
G_CALLBACK (xg_tool_bar_callback),
- (gpointer) (EMACS_INT) i);
+ gi);
g_object_set_data (G_OBJECT (weventbox), XG_FRAME_DATA, (gpointer)f);
g_signal_connect (G_OBJECT (weventbox),
"enter-notify-event",
G_CALLBACK (xg_tool_bar_help_callback),
- (gpointer) (EMACS_INT) i);
+ gi);
g_signal_connect (G_OBJECT (weventbox),
"leave-notify-event",
G_CALLBACK (xg_tool_bar_help_callback),
- (gpointer) (EMACS_INT) i);
+ gi);
}
if (wbutton) *wbutton = wb;