15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
558537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)#ifndef UI_GFX_GDK_COMPAT_H_
658537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)#define UI_GFX_GDK_COMPAT_H_
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <gtk/gtk.h>
95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <gdk/gdkx.h>
105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Google Chrome must depend on GTK 2.18, at least until the next LTS drops
125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// (and we might have to extend which version of GTK we want to target due to
135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// RHEL). To make our porting job for GTK3 easier, we define all the methods
145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// that replace deprecated APIs in this file and then include it everywhere.
155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//
165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// This file is organized first by version, and then with each version,
175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// alphabetically by method.
185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#if !GTK_CHECK_VERSION(2, 24, 0)
205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)inline GdkWindow* gdk_x11_window_lookup_for_display(GdkDisplay* display,
215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                                                    Window window) {
225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  return static_cast<GdkWindow*>(gdk_xid_table_lookup_for_display(display,
235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                                                                  window));
245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}
255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif
265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2758537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)#endif  // UI_GFX_GDK_COMPAT_H_
28