OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_BASE_GTK_GTK_COMPAT_H_ | 5 #ifndef UI_BASE_GTK_GTK_COMPAT_H_ |
6 #define UI_BASE_GTK_GTK_COMPAT_H_ | 6 #define UI_BASE_GTK_GTK_COMPAT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
10 #include <gdk/gdkx.h> | |
Elliot Glaysher
2011/11/29 22:54:15
Please move this and the copmat function to their
robert.bradford
2011/11/30 16:38:27
Done! Moved that function to a gdk_x_compat.h head
| |
10 | 11 |
11 // Google Chrome must depend on GTK 2.18, at least until the next LTS drops | 12 // Google Chrome must depend on GTK 2.18, at least until the next LTS drops |
12 // (and we might have to extend which version of GTK we want to target due to | 13 // (and we might have to extend which version of GTK we want to target due to |
13 // RHEL). To make our porting job for GTK3 easier, we define all the methods | 14 // RHEL). To make our porting job for GTK3 easier, we define all the methods |
14 // that replace deprecated APIs in this file and then include it everywhere. | 15 // that replace deprecated APIs in this file and then include it everywhere. |
15 // | 16 // |
16 // This file is organized first by version, and then with each version, | 17 // This file is organized first by version, and then with each version, |
17 // alphabetically by method. | 18 // alphabetically by method. |
18 | 19 |
19 #if !GTK_CHECK_VERSION(2, 20, 0) | 20 #if !GTK_CHECK_VERSION(2, 20, 0) |
20 inline gboolean gtk_widget_get_realized(GtkWidget* widget) { | 21 inline gboolean gtk_widget_get_realized(GtkWidget* widget) { |
21 return GTK_WIDGET_REALIZED(widget); | 22 return GTK_WIDGET_REALIZED(widget); |
22 } | 23 } |
23 | 24 |
24 inline gboolean gtk_widget_is_toplevel(GtkWidget* widget) { | 25 inline gboolean gtk_widget_is_toplevel(GtkWidget* widget) { |
25 return GTK_WIDGET_TOPLEVEL(widget); | 26 return GTK_WIDGET_TOPLEVEL(widget); |
26 } | 27 } |
27 #endif | 28 #endif |
28 | 29 |
29 #if !GTK_CHECK_VERSION(2, 24, 0) | 30 #if !GTK_CHECK_VERSION(2, 24, 0) |
30 inline void gdk_pixmap_get_size(GdkPixmap* pixmap, gint* width, gint* height) { | 31 inline void gdk_pixmap_get_size(GdkPixmap* pixmap, gint* width, gint* height) { |
31 gdk_drawable_get_size(GDK_DRAWABLE(pixmap), width, height); | 32 gdk_drawable_get_size(GDK_DRAWABLE(pixmap), width, height); |
32 } | 33 } |
33 | 34 |
34 inline GdkScreen* gdk_window_get_screen(GdkWindow* window) { | 35 inline GdkScreen* gdk_window_get_screen(GdkWindow* window) { |
35 return gdk_drawable_get_screen(GDK_DRAWABLE(window)); | 36 return gdk_drawable_get_screen(GDK_DRAWABLE(window)); |
36 } | 37 } |
38 | |
39 inline GdkWindow* gdk_x11_window_lookup_for_display(GdkDisplay* display, | |
40 Window window) { | |
41 return static_cast<GdkWindow*>(gdk_xid_table_lookup_for_display(display, | |
42 window)); | |
43 } | |
37 #endif | 44 #endif |
38 | 45 |
39 #endif // UI_BASE_GTK_GTK_COMPAT_H_ | 46 #endif // UI_BASE_GTK_GTK_COMPAT_H_ |
OLD | NEW |