diff options
author | robert.bradford@intel.com <robert.bradford@intel.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-01 19:54:58 +0000 |
---|---|---|
committer | robert.bradford@intel.com <robert.bradford@intel.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-01 19:54:58 +0000 |
commit | 27197de0f56a27e665116caa4a18b45578fffe07 (patch) | |
tree | 5c986d864f666c2bfe93eb1ac584e71da8f25045 /ui/base | |
parent | c338a18f062731442b0bd1c7d4266a9169de04e2 (diff) | |
download | chromium_src-27197de0f56a27e665116caa4a18b45578fffe07.zip chromium_src-27197de0f56a27e665116caa4a18b45578fffe07.tar.gz chromium_src-27197de0f56a27e665116caa4a18b45578fffe07.tar.bz2 |
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
Diffstat (limited to 'ui/base')
-rw-r--r-- | ui/base/gtk/gtk_compat.h | 18 |
1 files changed, 18 insertions, 0 deletions
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_ |