From 3258af741efd7c2995f729d8053d09fb81af2e48 Mon Sep 17 00:00:00 2001 From: Kristian Rietveld Date: Tue, 19 Oct 2010 10:37:15 +0200 Subject: [PATCH] Use gdk_window_ accessors instead of gdk_drawable_ accessors if possible The gdk_drawable_ accessors were deprecated. Removes a lot of compile-time warnings and eventually also makes things work again on Mac (miscompile due to the missing prototypes). --- gtk/gtkcombo.c | 2 +- gtk/gtkdnd-quartz.c | 8 +++++--- gtk/gtkentry.c | 30 +++++++++++++++++++----------- gtk/gtkfilechooserentry.c | 2 +- gtk/gtkhandlebox.c | 12 ++++++++---- gtk/gtkhsv.c | 2 +- gtk/gtkiconview.c | 4 ++-- gtk/gtkimcontextsimple.c | 4 ++-- gtk/gtkimmodule.c | 2 +- gtk/gtkimmulticontext.c | 2 +- gtk/gtkmain.c | 4 ++-- gtk/gtkmenu.c | 35 +++++++++++++++++++++++------------ gtk/gtknotebook.c | 10 ++++++---- gtk/gtkoffscreenwindow.c | 2 ++ gtk/gtkplug.c | 3 ++- gtk/gtkruler.c | 2 ++ gtk/gtksettings.c | 2 +- gtk/gtkspinbutton.c | 3 ++- gtk/gtktextview.c | 7 ++++--- gtk/gtktoolitemgroup.c | 2 +- gtk/gtktoolpalette.c | 2 +- gtk/gtktooltip.c | 4 ++-- gtk/gtktreeview.c | 38 ++++++++++++++++++-------------------- gtk/gtktreeviewcolumn.c | 2 +- gtk/gtkwidget.c | 15 ++++++++------- gtk/gtkwindow.c | 6 +++--- 26 files changed, 119 insertions(+), 86 deletions(-) diff --git a/gtk/gtkcombo.c b/gtk/gtkcombo.c index 5cbc61db0d..d1616995b5 100644 --- a/gtk/gtkcombo.c +++ b/gtk/gtkcombo.c @@ -615,7 +615,7 @@ popup_grab_on_window (GdkWindow *window, return TRUE; else { - gdk_display_pointer_ungrab (gdk_drawable_get_display (window), + gdk_display_pointer_ungrab (gdk_window_get_display (window), activate_time); return FALSE; } diff --git a/gtk/gtkdnd-quartz.c b/gtk/gtkdnd-quartz.c index 244015faf5..8dd47b9f7d 100644 --- a/gtk/gtkdnd-quartz.c +++ b/gtk/gtkdnd-quartz.c @@ -368,7 +368,8 @@ gtk_drag_highlight_expose (GtkWidget *widget, { x = 0; y = 0; - gdk_drawable_get_size (widget->window, &width, &height); + width = gdk_window_get_width (widget->window); + height = gdk_window_get_height (widget->window); } gtk_paint_shadow (widget->style, widget->window, @@ -715,7 +716,8 @@ gtk_drag_find_widget (GtkWidget *widget, { GdkRectangle window_rect = { 0, 0, 0, 0 }; - gdk_drawable_get_size (window, &window_rect.width, &window_rect.height); + window_rect.width = gdk_window_get_width (window); + window_rect.height = gdk_window_get_height (window); gdk_rectangle_intersect (&new_allocation, &window_rect, &new_allocation); @@ -1782,7 +1784,7 @@ gtk_drag_set_icon_name (GdkDragContext *context, g_return_if_fail (context->is_source); g_return_if_fail (icon_name != NULL); - screen = gdk_drawable_get_screen (context->source_window); + screen = gdk_window_get_screen (context->source_window); g_return_if_fail (screen != NULL); settings = gtk_settings_get_for_screen (screen); diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index 2875c4ffce..8c83fe1df0 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -3220,7 +3220,8 @@ draw_icon (GtkWidget *widget, if (icon_info->pixbuf == NULL) return; - gdk_drawable_get_size (icon_info->window, &width, &height); + width = gdk_window_get_width (icon_info->window); + height = gdk_window_get_height (icon_info->window); /* size_allocate hasn't been called yet. These are the default values. */ @@ -3286,7 +3287,8 @@ gtk_entry_draw_frame (GtkWidget *widget, gboolean state_hint; GtkStateType state; - gdk_drawable_get_size (widget->window, &width, &height); + width = gdk_window_get_width (widget->window); + height = gdk_window_get_height (widget->window); /* Fix a problem with some themes which assume that entry->text_area's * width equals widget->window's width */ @@ -3374,7 +3376,8 @@ get_progress_area (GtkWidget *widget, *x = progress_border.left; *y = progress_border.top; - gdk_drawable_get_size (widget->window, width, height); + *width = gdk_window_get_width (widget->window); + *height = gdk_window_get_height (widget->window); *width -= progress_border.left + progress_border.right; *height -= progress_border.top + progress_border.bottom; @@ -3475,7 +3478,8 @@ gtk_entry_expose (GtkWidget *widget, { gint width, height; - gdk_drawable_get_size (entry->text_area, &width, &height); + width = gdk_window_get_width (entry->text_area); + height = gdk_window_get_height (entry->text_area); gtk_paint_flat_box (widget->style, entry->text_area, state, GTK_SHADOW_NONE, @@ -3507,7 +3511,8 @@ gtk_entry_expose (GtkWidget *widget, { gint width, height; - gdk_drawable_get_size (icon_info->window, &width, &height); + width = gdk_window_get_width (icon_info->window); + height = gdk_window_get_height (icon_info->window); gtk_paint_flat_box (widget->style, icon_info->window, gtk_widget_get_state (widget), GTK_SHADOW_NONE, @@ -3854,7 +3859,8 @@ gtk_entry_button_release (GtkWidget *widget, { gint width, height; - gdk_drawable_get_size (icon_info->window, &width, &height); + width = gdk_window_get_width (icon_info->window); + height = gdk_window_get_height (icon_info->window); icon_info->pressed = FALSE; @@ -4007,7 +4013,8 @@ gtk_entry_motion_notify (GtkWidget *widget, else { gint height; - gdk_drawable_get_size (entry->text_area, NULL, &height); + + height = gdk_window_get_height (entry->text_area); if (event->y < 0) tmp_pos = 0; @@ -5619,7 +5626,8 @@ gtk_entry_draw_text (GtkEntry *entry) } else { - gdk_drawable_get_size (entry->text_area, &width, &height); + width = gdk_window_get_width (entry->text_area); + height = gdk_window_get_height (entry->text_area); cairo_rectangle (cr, 0, 0, width, height); cairo_clip (cr); @@ -5697,7 +5705,7 @@ gtk_entry_draw_cursor (GtkEntry *entry, xoffset = inner_border.left - entry->scroll_offset; - gdk_drawable_get_size (entry->text_area, NULL, &text_area_height); + text_area_height = gdk_window_get_height (entry->text_area); layout = gtk_entry_ensure_layout (entry, TRUE); text = pango_layout_get_text (layout); @@ -5969,7 +5977,7 @@ gtk_entry_adjust_scroll (GtkEntry *entry) _gtk_entry_effective_inner_border (entry, &inner_border); - gdk_drawable_get_size (entry->text_area, &text_area_width, NULL); + text_area_width = gdk_window_get_width (entry->text_area); text_area_width -= inner_border.left + inner_border.right; if (text_area_width < 0) text_area_width = 0; @@ -8641,7 +8649,7 @@ popup_position_func (GtkMenu *menu, gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor); gtk_widget_size_request (entry->popup_menu, &menu_req); - gdk_drawable_get_size (entry->text_area, NULL, &height); + height = gdk_window_get_height (entry->text_area); gtk_entry_get_cursor_locations (entry, CURSOR_STANDARD, &strong_x, NULL); _gtk_entry_effective_inner_border (entry, &inner_border); diff --git a/gtk/gtkfilechooserentry.c b/gtk/gtkfilechooserentry.c index 3619c65863..5cd8747d6e 100644 --- a/gtk/gtkfilechooserentry.c +++ b/gtk/gtkfilechooserentry.c @@ -908,7 +908,7 @@ set_invisible_mouse_cursor (GdkWindow *window) GdkDisplay *display; GdkCursor *cursor; - display = gdk_drawable_get_display (window); + display = gdk_window_get_display (window); cursor = gdk_cursor_new_for_display (display, GDK_BLANK_CURSOR); gdk_window_set_cursor (window, cursor); diff --git a/gtk/gtkhandlebox.c b/gtk/gtkhandlebox.c index 43434c44e2..667371fc94 100644 --- a/gtk/gtkhandlebox.c +++ b/gtk/gtkhandlebox.c @@ -885,7 +885,8 @@ gtk_handle_box_paint (GtkWidget *widget, handle_position = effective_handle_position (hb); - gdk_drawable_get_size (hb->bin_window, &width, &height); + width = gdk_window_get_width (hb->bin_window); + height = gdk_window_get_height (hb->bin_window); if (!event) gtk_paint_box (widget->style, @@ -1083,7 +1084,8 @@ gtk_handle_box_button_press (GtkWidget *widget, gtk_widget_get_screen (GTK_WIDGET (hb))); gdk_window_get_deskrelative_origin (hb->bin_window, &desk_x, &desk_y); gdk_window_get_origin (hb->bin_window, &root_x, &root_y); - gdk_drawable_get_size (hb->bin_window, &width, &height); + width = gdk_window_get_width (hb->bin_window); + height = gdk_window_get_height (hb->bin_window); private->orig_x = event->x_root; private->orig_y = event->y_root; @@ -1099,7 +1101,8 @@ gtk_handle_box_button_press (GtkWidget *widget, if (gdk_window_is_viewable (widget->window)) { gdk_window_get_origin (widget->window, &root_x, &root_y); - gdk_drawable_get_size (widget->window, &width, &height); + width = gdk_window_get_width (widget->window); + height = gdk_window_get_height (widget->window); hb->attach_allocation.x = root_x; hb->attach_allocation.y = root_y; @@ -1276,7 +1279,8 @@ gtk_handle_box_motion (GtkWidget *widget, { gint width, height; - gdk_drawable_get_size (hb->float_window, &width, &height); + width = gdk_window_get_width (hb->float_window); + height = gdk_window_get_height (hb->float_window); new_x += hb->deskoff_x; new_y += hb->deskoff_y; diff --git a/gtk/gtkhsv.c b/gtk/gtkhsv.c index 16733c52c9..a906f03969 100644 --- a/gtk/gtkhsv.c +++ b/gtk/gtkhsv.c @@ -829,7 +829,7 @@ gtk_hsv_button_release (GtkWidget *widget, } else g_assert_not_reached (); - gdk_display_pointer_ungrab (gdk_drawable_get_display (event->window), + gdk_display_pointer_ungrab (gdk_window_get_display (event->window), event->time); return TRUE; } diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c index e0a398c967..20d5d349ed 100644 --- a/gtk/gtkiconview.c +++ b/gtk/gtkiconview.c @@ -4467,8 +4467,8 @@ gtk_icon_view_scroll_to_item (GtkIconView *icon_view, "focus-line-width", &focus_width, NULL); - gdk_drawable_get_size (GDK_DRAWABLE (icon_view->priv->bin_window), - &width, &height); + width = gdk_window_get_width (icon_view->priv->bin_window); + height = gdk_window_get_height (icon_view->priv->bin_window); gdk_window_get_position (icon_view->priv->bin_window, &x, &y); if (y + item->y - focus_width < 0) diff --git a/gtk/gtkimcontextsimple.c b/gtk/gtkimcontextsimple.c index 2f4ddd0e66..9ef18a9b8b 100644 --- a/gtk/gtkimcontextsimple.c +++ b/gtk/gtkimcontextsimple.c @@ -669,7 +669,7 @@ beep_window (GdkWindow *window) } else { - GdkScreen *screen = gdk_drawable_get_screen (GDK_DRAWABLE (window)); + GdkScreen *screen = gdk_window_get_screen (window); gboolean beep; g_object_get (gtk_settings_get_for_screen (screen), @@ -744,7 +744,7 @@ is_hex_keyval (guint keyval) static guint canonical_hex_keyval (GdkEventKey *event) { - GdkKeymap *keymap = gdk_keymap_get_for_display (gdk_drawable_get_display (event->window)); + GdkKeymap *keymap = gdk_keymap_get_for_display (gdk_window_get_display (event->window)); guint keyval; guint *keyvals = NULL; gint n_vals = 0; diff --git a/gtk/gtkimmodule.c b/gtk/gtkimmodule.c index 97967d45fe..f1da8752ae 100644 --- a/gtk/gtkimmodule.c +++ b/gtk/gtkimmodule.c @@ -684,7 +684,7 @@ _gtk_im_module_get_default_context_id (GdkWindow *client_window) */ if (GDK_IS_DRAWABLE (client_window)) { - screen = gdk_drawable_get_screen (GDK_DRAWABLE (client_window)); + screen = gdk_window_get_screen (client_window); settings = gtk_settings_get_for_screen (screen); g_object_get (G_OBJECT (settings), "gtk-im-module", &tmp, NULL); if (tmp) diff --git a/gtk/gtkimmulticontext.c b/gtk/gtkimmulticontext.c index 6ba5a98934..61856679a0 100644 --- a/gtk/gtkimmulticontext.c +++ b/gtk/gtkimmulticontext.c @@ -277,7 +277,7 @@ gtk_im_multicontext_set_client_window (GtkIMContext *context, if (window) { - screen = gdk_drawable_get_screen (GDK_DRAWABLE (window)); + screen = gdk_window_get_screen (window); settings = gtk_settings_get_for_screen (screen); connected = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (settings), diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c index 57888a0046..ea3234702d 100644 --- a/gtk/gtkmain.c +++ b/gtk/gtkmain.c @@ -1438,7 +1438,7 @@ rewrite_event_for_grabs (GdkEvent *event) case GDK_MOTION_NOTIFY: case GDK_PROXIMITY_IN: case GDK_PROXIMITY_OUT: - display = gdk_drawable_get_display (event->proximity.window); + display = gdk_window_get_display (event->proximity.window); if (!gdk_pointer_grab_info_libgtk_only (display, &grab_window, &owner_events) || !owner_events) return NULL; @@ -1446,7 +1446,7 @@ rewrite_event_for_grabs (GdkEvent *event) case GDK_KEY_PRESS: case GDK_KEY_RELEASE: - display = gdk_drawable_get_display (event->key.window); + display = gdk_window_get_display (event->key.window); if (!gdk_keyboard_grab_info_libgtk_only (display, &grab_window, &owner_events) || !owner_events) return NULL; diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c index 9a9ff3827b..c44cf8687d 100644 --- a/gtk/gtkmenu.c +++ b/gtk/gtkmenu.c @@ -1350,7 +1350,8 @@ gtk_menu_tearoff_bg_copy (GtkMenu *menu) menu->tearoff_active = FALSE; menu->saved_scroll_offset = menu->scroll_offset; - gdk_drawable_get_size (menu->tearoff_window->window, &width, &height); + width = gdk_window_get_width (menu->tearoff_window->window); + height = gdk_window_get_height (menu->tearoff_window->window); pixmap = gdk_pixmap_new (menu->tearoff_window->window, width, @@ -1391,7 +1392,7 @@ popup_grab_on_window (GdkWindow *window, return TRUE; else { - gdk_display_pointer_ungrab (gdk_drawable_get_display (window), + gdk_display_pointer_ungrab (gdk_window_get_display (window), activate_time); return FALSE; } @@ -2054,7 +2055,9 @@ gtk_menu_set_tearoff_state (GtkMenu *menu, menu->tearoff_hbox = gtk_hbox_new (FALSE, FALSE); gtk_container_add (GTK_CONTAINER (menu->tearoff_window), menu->tearoff_hbox); - gdk_drawable_get_size (GTK_WIDGET (menu)->window, &width, &height); + width = gdk_window_get_width (GTK_WIDGET (menu)->window); + height = gdk_window_get_height (GTK_WIDGET (menu)->window); + menu->tearoff_adjustment = GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, @@ -2079,7 +2082,7 @@ gtk_menu_set_tearoff_state (GtkMenu *menu, gtk_menu_reparent (menu, menu->tearoff_hbox, FALSE); - gdk_drawable_get_size (GTK_WIDGET (menu)->window, &width, NULL); + width = gdk_window_get_width (GTK_WIDGET (menu)->window); /* Update menu->requisition */ @@ -2714,7 +2717,8 @@ get_arrows_visible_area (GtkMenu *menu, border->x = GTK_CONTAINER (widget)->border_width + widget->style->xthickness + horizontal_padding; border->y = GTK_CONTAINER (widget)->border_width + widget->style->ythickness + vertical_padding; - gdk_drawable_get_size (widget->window, &border->width, &border->height); + border->width = gdk_window_get_width (widget->window); + border->height = gdk_window_get_height (widget->window); switch (arrow_placement) { @@ -3206,7 +3210,8 @@ definitely_within_item (GtkWidget *widget, GdkWindow *window = GTK_MENU_ITEM (widget)->event_window; int w, h; - gdk_drawable_get_size (window, &w, &h); + w = gdk_window_get_width (window); + h = gdk_window_get_height (window); return check_threshold (widget, 0, 0, x, y) && @@ -3294,7 +3299,8 @@ gtk_menu_motion_notify (GtkWidget *widget, menu_shell->ignore_enter = FALSE; - gdk_drawable_get_size (event->window, &width, &height); + width = gdk_window_get_width (event->window); + height = gdk_window_get_height (event->window); if (event->x >= 0 && event->x < width && event->y >= 0 && event->y < height) { @@ -3375,7 +3381,8 @@ gtk_menu_scroll_by (GtkMenu *menu, if ((menu->scroll_offset >= 0) && (offset < 0)) offset = 0; - gdk_drawable_get_size (widget->window, &view_width, &view_height); + view_width = gdk_window_get_width (widget->window); + view_height = gdk_window_get_height (widget->window); if (menu->scroll_offset == 0 && view_height >= widget->requisition.height) @@ -3517,7 +3524,8 @@ get_arrows_sensitive_area (GtkMenu *menu, gint scroll_arrow_height; GtkArrowPlacement arrow_placement; - gdk_drawable_get_size (GTK_WIDGET (menu)->window, &width, &height); + width = gdk_window_get_width (GTK_WIDGET (menu)->window); + height = gdk_window_get_height (GTK_WIDGET (menu)->window); gtk_widget_style_get (GTK_WIDGET (menu), "vertical-padding", &vertical_padding, @@ -4081,12 +4089,14 @@ gtk_menu_set_submenu_navigation_region (GtkMenu *menu, event_widget = gtk_get_event_widget ((GdkEvent*) event); gdk_window_get_origin (menu_item->submenu->window, &submenu_left, &submenu_top); - gdk_drawable_get_size (menu_item->submenu->window, &width, &height); + width = gdk_window_get_width (menu_item->submenu->window); + height = gdk_window_get_height (menu_item->submenu->window); submenu_right = submenu_left + width; submenu_bottom = submenu_top + height; - gdk_drawable_get_size (event_widget->window, &width, &height); + width = gdk_window_get_width (event_widget->window); + height = gdk_window_get_height (event_widget->window); if (event->x >= 0 && event->x < width) { @@ -4659,7 +4669,8 @@ gtk_menu_scroll_item_visible (GtkMenuShell *menu_shell, gboolean double_arrows; y = menu->scroll_offset; - gdk_drawable_get_size (GTK_WIDGET (menu)->window, &width, &height); + width = gdk_window_get_width (GTK_WIDGET (menu)->window); + height = gdk_window_get_height (GTK_WIDGET (menu)->window); gtk_widget_style_get (GTK_WIDGET (menu), "vertical-padding", &vertical_padding, diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index 4306672d6c..2780e2bff5 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -2327,8 +2327,8 @@ gtk_notebook_expose (GtkWidget *widget, cairo_paint (cr); cairo_destroy (cr); - gdk_drawable_get_size (priv->drag_window, - &area.width, &area.height); + area.width = gdk_window_get_width (priv->drag_window); + area.height = gdk_window_get_height (priv->drag_window); gtk_notebook_draw_tab (notebook, notebook->cur_page, &area); @@ -3046,7 +3046,8 @@ get_pointer_position (GtkNotebook *notebook) return POINTER_BETWEEN; gdk_window_get_position (notebook->event_window, &wx, &wy); - gdk_drawable_get_size (GDK_DRAWABLE (notebook->event_window), &width, &height); + width = gdk_window_get_width (notebook->event_window); + height = gdk_window_get_height (notebook->event_window); if (notebook->tab_pos == GTK_POS_TOP || notebook->tab_pos == GTK_POS_BOTTOM) @@ -3127,7 +3128,8 @@ check_threshold (GtkNotebook *notebook, dnd_threshold *= DND_THRESHOLD_MULTIPLIER; gdk_window_get_position (notebook->event_window, &rectangle.x, &rectangle.y); - gdk_drawable_get_size (GDK_DRAWABLE (notebook->event_window), &rectangle.width, &rectangle.height); + rectangle.width = gdk_window_get_width (notebook->event_window); + rectangle.height = gdk_window_get_height (notebook->event_window); rectangle.x -= dnd_threshold; rectangle.width += 2 * dnd_threshold; diff --git a/gtk/gtkoffscreenwindow.c b/gtk/gtkoffscreenwindow.c index 0633a787a3..2b4207ab5a 100644 --- a/gtk/gtkoffscreenwindow.c +++ b/gtk/gtkoffscreenwindow.c @@ -18,6 +18,8 @@ * Alexander Larsson */ +#undef GDK_DISABLE_DEPRECATED /* We need gdk_drawable_get_size() */ + #include "gtkoffscreenwindow.h" #include "gtkalias.h" diff --git a/gtk/gtkplug.c b/gtk/gtkplug.c index 52d2b925f9..0a31d2223d 100644 --- a/gtk/gtkplug.c +++ b/gtk/gtkplug.c @@ -351,7 +351,8 @@ _gtk_plug_add_to_socket (GtkPlug *plug, if (gtk_widget_get_realized (widget)) { - gdk_drawable_get_size (GDK_DRAWABLE (widget->window), &w, &h); + w = gdk_window_get_width (widget->window); + h = gdk_window_get_height (widget->window); gdk_window_reparent (widget->window, plug->socket_window, -w, -h); } diff --git a/gtk/gtkruler.c b/gtk/gtkruler.c index 36111a4c26..b34391b14b 100644 --- a/gtk/gtkruler.c +++ b/gtk/gtkruler.c @@ -29,6 +29,8 @@ #include #include +#undef GDK_DISABLE_DEPRECATED /* We need gdk_drawable_get_size() */ + #include "gtkorientable.h" #include "gtkruler.h" #include "gtkprivate.h" diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c index a7ca546a08..774de1947e 100644 --- a/gtk/gtksettings.c +++ b/gtk/gtksettings.c @@ -1943,7 +1943,7 @@ _gtk_settings_handle_event (GdkEventSetting *event) GParamSpec *pspec; guint property_id; - settings = gtk_settings_get_for_screen (gdk_drawable_get_screen (event->window)); + settings = gtk_settings_get_for_screen (gdk_window_get_screen (event->window)); pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (settings), event->name); if (pspec) diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c index 23288c78ae..c51a3cc3ac 100644 --- a/gtk/gtkspinbutton.c +++ b/gtk/gtkspinbutton.c @@ -752,7 +752,8 @@ gtk_spin_button_expose (GtkWidget *widget, else state = GTK_STATE_NORMAL; - gdk_drawable_get_size (spin->panel, &width, &height); + width = gdk_window_get_width (spin->panel); + height = gdk_window_get_height (spin->panel); gtk_paint_box (widget->style, spin->panel, state, shadow_type, diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index e5c740cb5b..cd9af07bc7 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -4046,7 +4046,7 @@ set_invisible_cursor (GdkWindow *window) GdkDisplay *display; GdkCursor *cursor; - display = gdk_drawable_get_display (window); + display = gdk_window_get_display (window); cursor = gdk_cursor_new_for_display (display, GDK_BLANK_CURSOR); gdk_window_set_cursor (window, cursor); @@ -6078,7 +6078,8 @@ drag_scan_timeout (gpointer data) text_view = GTK_TEXT_VIEW (data); get_iter_at_pointer (text_view, &newplace, &x, &y); - gdk_drawable_get_size (text_view->text_window->bin_window, &width, &height); + width = gdk_window_get_width (text_view->text_window->bin_window); + height = gdk_window_get_height (text_view->text_window->bin_window); gtk_text_buffer_move_mark (get_buffer (text_view), text_view->dnd_mark, @@ -8148,7 +8149,7 @@ text_window_realize (GtkTextWindow *win, if (gtk_widget_is_sensitive (widget)) { /* I-beam cursor */ - cursor = gdk_cursor_new_for_display (gdk_drawable_get_display (widget->window), + cursor = gdk_cursor_new_for_display (gdk_window_get_display (widget->window), GDK_XTERM); gdk_window_set_cursor (win->bin_window, cursor); gdk_cursor_unref (cursor); diff --git a/gtk/gtktoolitemgroup.c b/gtk/gtktoolitemgroup.c index 4b4e2aaf9b..833c99b6dd 100644 --- a/gtk/gtktoolitemgroup.c +++ b/gtk/gtktoolitemgroup.c @@ -1181,7 +1181,7 @@ gtk_tool_item_group_realize (GtkWidget *widget) widget->window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask); - display = gdk_drawable_get_display (widget->window); + display = gdk_window_get_display (widget->window); if (gdk_display_supports_composite (display)) gdk_window_set_composited (widget->window, TRUE); diff --git a/gtk/gtktoolpalette.c b/gtk/gtktoolpalette.c index fa37edcc56..507af9dace 100644 --- a/gtk/gtktoolpalette.c +++ b/gtk/gtktoolpalette.c @@ -621,7 +621,7 @@ gtk_tool_palette_expose_event (GtkWidget *widget, cairo_t *cr; guint i; - display = gdk_drawable_get_display (widget->window); + display = gdk_window_get_display (widget->window); if (!gdk_display_supports_composite (display)) return FALSE; diff --git a/gtk/gtktooltip.c b/gtk/gtktooltip.c index 5be59f9df8..62811c3ff9 100644 --- a/gtk/gtktooltip.c +++ b/gtk/gtktooltip.c @@ -1298,7 +1298,7 @@ tooltips_enabled (GdkWindow *window) GdkScreen *screen; GtkSettings *settings; - screen = gdk_drawable_get_screen (window); + screen = gdk_window_get_screen (window); settings = gtk_settings_get_for_screen (screen); g_object_get (settings, @@ -1323,7 +1323,7 @@ _gtk_tooltip_handle_event (GdkEvent *event) /* Returns coordinates relative to has_tooltip_widget's allocation. */ has_tooltip_widget = find_topmost_widget_coords_from_event (event, &x, &y); - display = gdk_drawable_get_display (event->any.window); + display = gdk_window_get_display (event->any.window); current_tooltip = g_object_get_data (G_OBJECT (display), "gdk-display-current-tooltip"); diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index 16c4356912..71efa08993 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -2282,9 +2282,8 @@ gtk_tree_view_size_allocate_columns (GtkWidget *widget, if (column == tree_view->priv->drag_column) { GtkAllocation drag_allocation; - gdk_drawable_get_size (tree_view->priv->drag_window, - &(drag_allocation.width), - &(drag_allocation.height)); + drag_allocation.width = gdk_window_get_width (tree_view->priv->drag_window); + drag_allocation.height = gdk_window_get_height (tree_view->priv->drag_window); drag_allocation.x = 0; drag_allocation.y = 0; gtk_widget_size_allocate (tree_view->priv->drag_column->button, @@ -3027,7 +3026,7 @@ gtk_tree_view_button_release_column_resize (GtkWidget *widget, GTK_TREE_VIEW_UNSET_FLAG (tree_view, GTK_TREE_VIEW_IN_COLUMN_RESIZE); gtk_grab_remove (widget); - gdk_display_pointer_ungrab (gdk_drawable_get_display (event->window), + gdk_display_pointer_ungrab (gdk_window_get_display (event->window), event->time); return TRUE; } @@ -4184,7 +4183,8 @@ invalidate_empty_focus (GtkTreeView *tree_view) area.x = 0; area.y = 0; - gdk_drawable_get_size (tree_view->priv->bin_window, &area.width, &area.height); + area.width = gdk_window_get_width (tree_view->priv->bin_window); + area.height = gdk_window_get_height (tree_view->priv->bin_window); gdk_window_invalidate_rect (tree_view->priv->bin_window, &area, FALSE); } @@ -4200,7 +4200,8 @@ draw_empty_focus (GtkTreeView *tree_view, GdkRectangle *clip_area) if (!gtk_widget_has_focus (widget)) return; - gdk_drawable_get_size (tree_view->priv->bin_window, &w, &h); + w = gdk_window_get_width (tree_view->priv->bin_window); + h = gdk_window_get_height (tree_view->priv->bin_window); w -= 2; h -= 2; @@ -4377,8 +4378,8 @@ gtk_tree_view_bin_expose (GtkWidget *widget, if (new_y < 0) new_y = 0; y_offset = -_gtk_rbtree_find_offset (tree_view->priv->tree, new_y, &tree, &node); - gdk_drawable_get_size (tree_view->priv->bin_window, - &bin_window_width, &bin_window_height); + bin_window_width = gdk_window_get_width (tree_view->priv->bin_window); + bin_window_height = gdk_window_get_height (tree_view->priv->bin_window); if (tree_view->priv->height < bin_window_height) { @@ -4882,8 +4883,7 @@ gtk_tree_view_bin_expose (GtkWidget *widget, if (tree == NULL) break; - gdk_drawable_get_size (tree_view->priv->bin_window, - &width, NULL); + width = gdk_window_get_width (tree_view->priv->bin_window); if (row_ending_details) gtk_paint_focus (widget->style, @@ -4938,8 +4938,7 @@ gtk_tree_view_bin_expose (GtkWidget *widget, (flags & GTK_CELL_RENDERER_INSENSITIVE ? GTK_STATE_INSENSITIVE : GTK_STATE_NORMAL)); - gdk_drawable_get_size (tree_view->priv->bin_window, - &width, NULL); + width = gdk_window_get_width (tree_view->priv->bin_window); if (draw_hgrid_lines) { @@ -9315,7 +9314,7 @@ gtk_tree_view_set_column_drag_info (GtkTreeView *tree_view, { gint width; - gdk_drawable_get_size (tree_view->priv->header_window, &width, NULL); + width = gdk_window_get_width (tree_view->priv->header_window); reorder->right_align = width + TREE_VIEW_COLUMN_DRAG_DEAD_MULTIPLIER (tree_view); } } @@ -9409,7 +9408,8 @@ _gtk_tree_view_column_start_drag (GtkTreeView *tree_view, gdk_window_show (tree_view->priv->drag_window); gdk_window_get_origin (tree_view->priv->header_window, &x, &y); - gdk_drawable_get_size (tree_view->priv->header_window, &width, &height); + width = gdk_window_get_width (tree_view->priv->header_window); + height = gdk_window_get_height (tree_view->priv->header_window); gtk_widget_grab_focus (GTK_WIDGET (tree_view)); while (gtk_events_pending ()) @@ -13793,8 +13793,7 @@ gtk_tree_view_create_row_drag_icon (GtkTreeView *tree_view, background_area.y = y; background_area.height = ROW_HEIGHT (tree_view, BACKGROUND_HEIGHT (node)); - gdk_drawable_get_size (tree_view->priv->bin_window, - &bin_window_width, NULL); + bin_window_width = gdk_window_get_width (tree_view->priv->bin_window); drawable = gdk_pixmap_new (tree_view->priv->bin_window, bin_window_width + 2, @@ -14235,7 +14234,7 @@ gtk_tree_view_search_position_func (GtkTreeView *tree_view, gint tree_x, tree_y; gint tree_width, tree_height; GdkWindow *tree_window = GTK_WIDGET (tree_view)->window; - GdkScreen *screen = gdk_drawable_get_screen (tree_window); + GdkScreen *screen = gdk_window_get_screen (tree_window); GtkRequisition requisition; gint monitor_num; GdkRectangle monitor; @@ -14246,9 +14245,8 @@ gtk_tree_view_search_position_func (GtkTreeView *tree_view, gtk_widget_realize (search_dialog); gdk_window_get_origin (tree_window, &tree_x, &tree_y); - gdk_drawable_get_size (tree_window, - &tree_width, - &tree_height); + tree_width = gdk_window_get_width (tree_window); + tree_height = gdk_window_get_height (tree_window); gtk_widget_size_request (search_dialog, &requisition); if (tree_x + tree_width > gdk_screen_get_width (screen)) diff --git a/gtk/gtktreeviewcolumn.c b/gtk/gtktreeviewcolumn.c index 348a9df98a..aa93ee3afd 100644 --- a/gtk/gtktreeviewcolumn.c +++ b/gtk/gtktreeviewcolumn.c @@ -1293,7 +1293,7 @@ _gtk_tree_view_column_realize_button (GtkTreeViewColumn *column) GDK_POINTER_MOTION_HINT_MASK | GDK_KEY_PRESS_MASK); attributes_mask = GDK_WA_CURSOR | GDK_WA_X | GDK_WA_Y; - attr.cursor = gdk_cursor_new_for_display (gdk_drawable_get_display (tree_view->priv->header_window), + attr.cursor = gdk_cursor_new_for_display (gdk_window_get_display (tree_view->priv->header_window), GDK_SB_H_DOUBLE_ARROW); attr.y = 0; attr.width = TREE_VIEW_DRAG_WIDTH; diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 5c74f7bbd7..6482031795 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -3644,7 +3644,8 @@ gtk_widget_queue_draw_area (GtkWidget *widget, x -= wx - widget->allocation.x; y -= wy - widget->allocation.y; - gdk_drawable_get_size (widget->window, &wwidth, &wheight); + wwidth = gdk_window_get_width (widget->window); + wheight = gdk_window_get_height (widget->window); if (x + width <= 0 || y + height <= 0 || x >= wwidth || y >= wheight) @@ -8957,7 +8958,7 @@ _gtk_widget_set_pointer_window (GtkWidget *widget, if (gtk_widget_get_realized (widget)) { - GdkScreen *screen = gdk_drawable_get_screen (widget->window); + GdkScreen *screen = gdk_window_get_screen (widget->window); g_object_set_qdata (G_OBJECT (screen), quark_pointer_window, pointer_window); @@ -8978,7 +8979,7 @@ _gtk_widget_get_pointer_window (GtkWidget *widget) if (gtk_widget_get_realized (widget)) { - GdkScreen *screen = gdk_drawable_get_screen (widget->window); + GdkScreen *screen = gdk_window_get_screen (widget->window); return g_object_get_qdata (G_OBJECT (screen), quark_pointer_window); } @@ -9554,9 +9555,8 @@ expose_window (GdkWindow *window) event.expose.count = 0; event.expose.area.x = 0; event.expose.area.y = 0; - gdk_drawable_get_size (GDK_DRAWABLE (window), - &event.expose.area.width, - &event.expose.area.height); + event.expose.area.width = gdk_window_get_width (window); + event.expose.area.height = gdk_window_get_height (window); event.expose.region = gdk_region_rectangle (&event.expose.area); /* If this is not double buffered, force a double buffer so that @@ -9657,7 +9657,8 @@ gtk_widget_get_snapshot (GtkWidget *widget, continue; windows = g_list_prepend (windows, subwin); gdk_window_get_position (subwin, &wx, &wy); - gdk_drawable_get_size (subwin, &ww, &wh); + ww = gdk_window_get_width (subwin); + wh = gdk_window_get_height (subwin); /* grow snapshot rectangle by extra widget sub window */ if (wx < x) { diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index ed4dad2a92..afa9249f7c 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -3110,7 +3110,7 @@ get_pixmap_and_mask (GdkWindow *window, GdkPixmap **pmap_return, GdkBitmap **mask_return) { - GdkScreen *screen = gdk_drawable_get_screen (window); + GdkScreen *screen = gdk_window_get_screen (window); ScreenIconInfo *default_icon_info = get_screen_icon_info (screen); GdkPixbuf *best_icon; GList *tmp_list; @@ -4101,8 +4101,8 @@ gtk_window_get_size (GtkWindow *window, if (gtk_widget_get_mapped (GTK_WIDGET (window))) { - gdk_drawable_get_size (GTK_WIDGET (window)->window, - &w, &h); + w = gdk_window_get_width (GTK_WIDGET (window)->window); + h = gdk_window_get_height (GTK_WIDGET (window)->window); } else {