From 27197de0f56a27e665116caa4a18b45578fffe07 Mon Sep 17 00:00:00 2001 From: "robert.bradford@intel.com" Date: Thu, 1 Dec 2011 19:54:58 +0000 Subject: GTK: Port RenderWidgetHostViewGtk to latest GTK New API used: gtk_widget_get_window - replaces direct access gtk_widget_get_allocation - added in 2.18 - replaces direct access gdk_window_get_width / gdk_window_get_height added in 2.24 - replaces deprecated gdk_window_get_size so is added to ui/base/gtk/gtk_compat.h With these changes the file can be compiled with sealed structures and deprecated API disabled with the exception of the deprecated function gdk_bitmap_create_from_data used in the cursor creation. That will come in a separate change. BUG=79722 TEST=Compiles and chrome runs Review URL: http://codereview.chromium.org/8635018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112498 0039d316-1c4b-4281-b951-d872f2087c98 --- ui/base/gtk/gtk_compat.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'ui/base') diff --git a/ui/base/gtk/gtk_compat.h b/ui/base/gtk/gtk_compat.h index e6c119a..b9f7fd2 100644 --- a/ui/base/gtk/gtk_compat.h +++ b/ui/base/gtk/gtk_compat.h @@ -26,14 +26,32 @@ inline gboolean gtk_widget_is_toplevel(GtkWidget* widget) { } #endif +#if !GTK_CHECK_VERSION(2, 22, 0) +inline gint gdk_visual_get_depth(GdkVisual* visual) { + return visual->depth; +} +#endif + #if !GTK_CHECK_VERSION(2, 24, 0) inline void gdk_pixmap_get_size(GdkPixmap* pixmap, gint* width, gint* height) { gdk_drawable_get_size(GDK_DRAWABLE(pixmap), width, height); } +inline int gdk_window_get_height(GdkWindow* window) { + int height; + gdk_drawable_get_size(GDK_DRAWABLE(window), NULL, &height); + return height; +} + inline GdkScreen* gdk_window_get_screen(GdkWindow* window) { return gdk_drawable_get_screen(GDK_DRAWABLE(window)); } + +inline int gdk_window_get_width(GdkWindow* window) { + int width; + gdk_drawable_get_size(GDK_DRAWABLE(window), &width, NULL); + return width; +} #endif #endif // UI_BASE_GTK_GTK_COMPAT_H_ -- cgit v1.1