diff options
Diffstat (limited to 'chromium/ui/base/gtk')
-rw-r--r-- | chromium/ui/base/gtk/event_synthesis_gtk.cc | 2 | ||||
-rw-r--r-- | chromium/ui/base/gtk/event_synthesis_gtk.h | 2 | ||||
-rw-r--r-- | chromium/ui/base/gtk/gdk_x_compat.h | 27 | ||||
-rw-r--r-- | chromium/ui/base/gtk/gtk_compat.h | 97 | ||||
-rw-r--r-- | chromium/ui/base/gtk/gtk_expanded_container.cc | 2 | ||||
-rw-r--r-- | chromium/ui/base/gtk/gtk_floating_container.cc | 2 | ||||
-rw-r--r-- | chromium/ui/base/gtk/gtk_im_context_util.cc | 2 | ||||
-rw-r--r-- | chromium/ui/base/gtk/gtk_windowing.cc | 2 | ||||
-rw-r--r-- | chromium/ui/base/gtk/scoped_gobject.h | 34 |
9 files changed, 6 insertions, 164 deletions
diff --git a/chromium/ui/base/gtk/event_synthesis_gtk.cc b/chromium/ui/base/gtk/event_synthesis_gtk.cc index bd3cb8aa220..ea56162dd22 100644 --- a/chromium/ui/base/gtk/event_synthesis_gtk.cc +++ b/chromium/ui/base/gtk/event_synthesis_gtk.cc @@ -4,7 +4,7 @@ #include "ui/base/gtk/event_synthesis_gtk.h" -#include "ui/base/keycodes/keyboard_code_conversion_gtk.h" +#include "ui/events/keycodes/keyboard_code_conversion_gtk.h" namespace ui { diff --git a/chromium/ui/base/gtk/event_synthesis_gtk.h b/chromium/ui/base/gtk/event_synthesis_gtk.h index 50dde0f08c5..1839e29949a 100644 --- a/chromium/ui/base/gtk/event_synthesis_gtk.h +++ b/chromium/ui/base/gtk/event_synthesis_gtk.h @@ -13,8 +13,8 @@ #include <gdk/gdkkeysyms.h> #include <vector> -#include "ui/base/keycodes/keyboard_codes.h" #include "ui/base/ui_export.h" +#include "ui/events/keycodes/keyboard_codes.h" namespace ui { diff --git a/chromium/ui/base/gtk/gdk_x_compat.h b/chromium/ui/base/gtk/gdk_x_compat.h deleted file mode 100644 index fd395c78f6a..00000000000 --- a/chromium/ui/base/gtk/gdk_x_compat.h +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef UI_BASE_GTK_GDK_X_COMPAT_H_ -#define UI_BASE_GTK_GDK_X_COMPAT_H_ - -#include <gtk/gtk.h> -#include <gdk/gdkx.h> - -// Google Chrome must depend on GTK 2.18, at least until the next LTS drops -// (and we might have to extend which version of GTK we want to target due to -// RHEL). To make our porting job for GTK3 easier, we define all the methods -// that replace deprecated APIs in this file and then include it everywhere. -// -// This file is organized first by version, and then with each version, -// alphabetically by method. - -#if !GTK_CHECK_VERSION(2, 24, 0) -inline GdkWindow* gdk_x11_window_lookup_for_display(GdkDisplay* display, - Window window) { - return static_cast<GdkWindow*>(gdk_xid_table_lookup_for_display(display, - window)); -} -#endif - -#endif // UI_BASE_GTK_GDK_X_COMPAT_H_ diff --git a/chromium/ui/base/gtk/gtk_compat.h b/chromium/ui/base/gtk/gtk_compat.h deleted file mode 100644 index 0518fad23f2..00000000000 --- a/chromium/ui/base/gtk/gtk_compat.h +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef UI_BASE_GTK_GTK_COMPAT_H_ -#define UI_BASE_GTK_GTK_COMPAT_H_ - -#include <gtk/gtk.h> - -// Google Chrome must depend on GTK 2.18, at least until the next LTS drops -// (and we might have to extend which version of GTK we want to target due to -// RHEL). To make our porting job for GTK3 easier, we define all the methods -// that replace deprecated APIs in this file and then include it everywhere. -// -// This file is organized first by version, and then with each version, -// alphabetically by method. -// -// For Google Chrome builds, we want to support RHEL 6, which uses GTK 2.18, -// but the official builder is Ubuntu Lucid with GTK 2.20. Thus for Google -// Chrome builds, we define the GTK 2.20.0 compatibility functions even though -// the system GTK provides the functions. - -#if !GTK_CHECK_VERSION(2, 20, 0) || defined(GOOGLE_CHROME_BUILD) -inline gboolean gtk_widget_get_mapped(GtkWidget* widget) { - return GTK_WIDGET_MAPPED(widget); -} - -inline gboolean gtk_widget_get_realized(GtkWidget* widget) { - return GTK_WIDGET_REALIZED(widget); -} - -inline gboolean gtk_widget_is_toplevel(GtkWidget* widget) { - return GTK_WIDGET_TOPLEVEL(widget); -} - -inline void gtk_widget_set_mapped(GtkWidget* widget, - gboolean mapped) { - if (mapped) - GTK_WIDGET_SET_FLAGS(widget, GTK_MAPPED); - else - GTK_WIDGET_UNSET_FLAGS(widget, GTK_MAPPED); -} - -inline void gtk_widget_set_realized(GtkWidget* widget, - gboolean realized) { - if (realized) - GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED); - else - GTK_WIDGET_UNSET_FLAGS(widget, GTK_REALIZED); -} - -inline void gtk_widget_style_attach(GtkWidget* widget) { - widget->style = gtk_style_attach(widget->style, widget->window); -} -#endif // !GTK_CHECK_VERSION(2, 20, 0) || defined(GOOGLE_CHROME_BUILD) - -#if !GTK_CHECK_VERSION(2, 22, 0) -inline GdkWindow* gdk_drag_context_get_source_window(GdkDragContext *context) { - return context->source_window; -} - -inline gint gdk_visual_get_depth(GdkVisual* visual) { - return visual->depth; -} - -inline GdkWindow* gtk_button_get_event_window(GtkButton* button) { - return button->event_window; -} -#endif // !GTK_CHECK_VERSION(2, 22, 0) - -#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 GdkDisplay* gdk_window_get_display(GdkWindow* window) { - return gdk_drawable_get_display(GDK_DRAWABLE(window)); -} - -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 // !GTK_CHECK_VERSION(2, 24, 0) - -#endif // UI_BASE_GTK_GTK_COMPAT_H_ diff --git a/chromium/ui/base/gtk/gtk_expanded_container.cc b/chromium/ui/base/gtk/gtk_expanded_container.cc index 30fc3db58b6..6b39821d806 100644 --- a/chromium/ui/base/gtk/gtk_expanded_container.cc +++ b/chromium/ui/base/gtk/gtk_expanded_container.cc @@ -8,7 +8,7 @@ #include <algorithm> -#include "ui/base/gtk/gtk_compat.h" +#include "ui/gfx/gtk_compat.h" namespace { diff --git a/chromium/ui/base/gtk/gtk_floating_container.cc b/chromium/ui/base/gtk/gtk_floating_container.cc index 929216eab22..dd1ac26b0a2 100644 --- a/chromium/ui/base/gtk/gtk_floating_container.cc +++ b/chromium/ui/base/gtk/gtk_floating_container.cc @@ -8,7 +8,7 @@ #include <algorithm> -#include "ui/base/gtk/gtk_compat.h" +#include "ui/gfx/gtk_compat.h" namespace { diff --git a/chromium/ui/base/gtk/gtk_im_context_util.cc b/chromium/ui/base/gtk/gtk_im_context_util.cc index b60856bf3f1..dfd5f3f9e8d 100644 --- a/chromium/ui/base/gtk/gtk_im_context_util.cc +++ b/chromium/ui/base/gtk/gtk_im_context_util.cc @@ -40,7 +40,7 @@ void ExtractCompositionTextFromGtkPreedit(const gchar* utf8_text, size_t cursor_offset = char16_offsets[std::max(0, std::min(char_length, cursor_position))]; - composition->selection = ui::Range(cursor_offset); + composition->selection = gfx::Range(cursor_offset); if (attrs) { int utf8_length = strlen(utf8_text); diff --git a/chromium/ui/base/gtk/gtk_windowing.cc b/chromium/ui/base/gtk/gtk_windowing.cc index 4ca4a1d2786..e378c8463ad 100644 --- a/chromium/ui/base/gtk/gtk_windowing.cc +++ b/chromium/ui/base/gtk/gtk_windowing.cc @@ -7,8 +7,8 @@ #include <gdk/gdkx.h> #include "base/logging.h" -#include "ui/base/gtk/gtk_compat.h" #include "ui/base/x/x11_util.h" +#include "ui/gfx/gtk_compat.h" namespace ui { diff --git a/chromium/ui/base/gtk/scoped_gobject.h b/chromium/ui/base/gtk/scoped_gobject.h deleted file mode 100644 index 2e62e8f2c83..00000000000 --- a/chromium/ui/base/gtk/scoped_gobject.h +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef UI_BASE_GTK_SCOPED_GOBJECT_H_ -#define UI_BASE_GTK_SCOPED_GOBJECT_H_ - -#include <glib-object.h> - -#include "base/memory/scoped_ptr.h" - -namespace ui { - -// It's not legal C++ to have a templatized typedefs, so we wrap it in a -// struct. When using this, you need to include ::Type. E.g., -// ScopedGObject<GdkPixbufLoader>::Type loader(gdk_pixbuf_loader_new()); -template<class T> -struct ScopedGObject { - // A helper class that will g_object_unref |p| when it goes out of scope. - // This never adds a ref, it only unrefs. - template<class U> - struct GObjectUnrefer { - void operator()(U* ptr) const { - if (ptr) - g_object_unref(ptr); - } - }; - - typedef scoped_ptr_malloc<T, GObjectUnrefer<T> > Type; -}; - -} // namespace ui - -#endif // UI_BASE_GTK_SCOPED_GOBJECT_H_ |