| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 CHROME_BROWSER_UI_LIBGTK2UI_GTK2_UI_H_ | 5 #ifndef CHROME_BROWSER_UI_LIBGTK2UI_GTK2_UI_H_ |
| 6 #define CHROME_BROWSER_UI_LIBGTK2UI_GTK2_UI_H_ | 6 #define CHROME_BROWSER_UI_LIBGTK2UI_GTK2_UI_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
| 14 #include "chrome/browser/ui/libgtk2ui/gtk2_signal.h" | 14 #include "chrome/browser/ui/libgtk2ui/gtk2_signal.h" |
| 15 #include "chrome/browser/ui/libgtk2ui/gtk2_signal_registrar.h" | 15 #include "chrome/browser/ui/libgtk2ui/gtk2_signal_registrar.h" |
| 16 #include "chrome/browser/ui/libgtk2ui/libgtk2ui_export.h" | 16 #include "chrome/browser/ui/libgtk2ui/libgtk2ui_export.h" |
| 17 #include "chrome/browser/ui/libgtk2ui/owned_widget_gtk2.h" | 17 #include "chrome/browser/ui/libgtk2ui/owned_widget_gtk2.h" |
| 18 #include "ui/events/linux/text_edit_key_bindings_delegate_auralinux.h" | 18 #include "ui/events/linux/text_edit_key_bindings_delegate_auralinux.h" |
| 19 #include "ui/gfx/color_utils.h" | 19 #include "ui/gfx/color_utils.h" |
| 20 #include "ui/gfx/geometry/insets.h" | |
| 21 #include "ui/views/linux_ui/linux_ui.h" | 20 #include "ui/views/linux_ui/linux_ui.h" |
| 22 #include "ui/views/window/frame_buttons.h" | 21 #include "ui/views/window/frame_buttons.h" |
| 23 | 22 |
| 24 typedef struct _GdkColor GdkColor; | 23 typedef struct _GdkColor GdkColor; |
| 25 typedef struct _GtkBorder GtkBorder; | 24 typedef struct _GtkBorder GtkBorder; |
| 26 typedef struct _GtkStyle GtkStyle; | 25 typedef struct _GtkStyle GtkStyle; |
| 27 typedef struct _GtkWidget GtkWidget; | 26 typedef struct _GtkWidget GtkWidget; |
| 28 | 27 |
| 29 class SkBitmap; | 28 class SkBitmap; |
| 30 | 29 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 53 const std::vector<views::FrameButton>& leading_buttons, | 52 const std::vector<views::FrameButton>& leading_buttons, |
| 54 const std::vector<views::FrameButton>& trailing_buttons); | 53 const std::vector<views::FrameButton>& trailing_buttons); |
| 55 void SetNonClientMiddleClickAction(NonClientMiddleClickAction action); | 54 void SetNonClientMiddleClickAction(NonClientMiddleClickAction action); |
| 56 | 55 |
| 57 // Draws the GTK button border for state |gtk_state| onto a bitmap. | 56 // Draws the GTK button border for state |gtk_state| onto a bitmap. |
| 58 SkBitmap DrawGtkButtonBorder(int gtk_state, | 57 SkBitmap DrawGtkButtonBorder(int gtk_state, |
| 59 bool focused, | 58 bool focused, |
| 60 int width, | 59 int width, |
| 61 int height) const; | 60 int height) const; |
| 62 | 61 |
| 63 // Returns the current insets for a button. | |
| 64 gfx::Insets GetButtonInsets() const; | |
| 65 | |
| 66 // ui::LinuxInputMethodContextFactory: | 62 // ui::LinuxInputMethodContextFactory: |
| 67 virtual scoped_ptr<ui::LinuxInputMethodContext> CreateInputMethodContext( | 63 virtual scoped_ptr<ui::LinuxInputMethodContext> CreateInputMethodContext( |
| 68 ui::LinuxInputMethodContextDelegate* delegate) const OVERRIDE; | 64 ui::LinuxInputMethodContextDelegate* delegate) const OVERRIDE; |
| 69 | 65 |
| 70 // gfx::LinuxFontDelegate: | 66 // gfx::LinuxFontDelegate: |
| 71 virtual bool UseAntialiasing() const OVERRIDE; | 67 virtual bool UseAntialiasing() const OVERRIDE; |
| 72 virtual gfx::FontRenderParams::Hinting GetHintingStyle() const OVERRIDE; | 68 virtual gfx::FontRenderParams::Hinting GetHintingStyle() const OVERRIDE; |
| 73 virtual gfx::FontRenderParams::SubpixelRendering | 69 virtual gfx::FontRenderParams::SubpixelRendering |
| 74 GetSubpixelRenderingStyle() const OVERRIDE; | 70 GetSubpixelRenderingStyle() const OVERRIDE; |
| 75 virtual std::string GetDefaultFontName() const OVERRIDE; | 71 virtual std::string GetDefaultFontName() const OVERRIDE; |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 // background color. | 179 // background color. |
| 184 void GetNormalButtonTintHSL(color_utils::HSL* tint) const; | 180 void GetNormalButtonTintHSL(color_utils::HSL* tint) const; |
| 185 | 181 |
| 186 // Returns a tint that's the color of the current normal text in an entry. | 182 // Returns a tint that's the color of the current normal text in an entry. |
| 187 void GetNormalEntryForegroundHSL(color_utils::HSL* tint) const; | 183 void GetNormalEntryForegroundHSL(color_utils::HSL* tint) const; |
| 188 | 184 |
| 189 // Returns a tint that's the color of the current highlighted text in an | 185 // Returns a tint that's the color of the current highlighted text in an |
| 190 // entry. | 186 // entry. |
| 191 void GetSelectedEntryForegroundHSL(color_utils::HSL* tint) const; | 187 void GetSelectedEntryForegroundHSL(color_utils::HSL* tint) const; |
| 192 | 188 |
| 193 // Create a GTK window and button and queries what "default-border" is, which | |
| 194 // corresponds with our insets. | |
| 195 void UpdateButtonInsets(); | |
| 196 | |
| 197 // Frees all calculated images and color data. | 189 // Frees all calculated images and color data. |
| 198 void ClearAllThemeData(); | 190 void ClearAllThemeData(); |
| 199 | 191 |
| 200 // Handles signal from GTK that our theme has been changed. | 192 // Handles signal from GTK that our theme has been changed. |
| 201 CHROMEGTK_CALLBACK_1(Gtk2UI, void, OnStyleSet, GtkStyle*); | 193 CHROMEGTK_CALLBACK_1(Gtk2UI, void, OnStyleSet, GtkStyle*); |
| 202 | 194 |
| 203 GtkWidget* fake_window_; | 195 GtkWidget* fake_window_; |
| 204 GtkWidget* fake_frame_; | 196 GtkWidget* fake_frame_; |
| 205 OwnedWidgetGtk fake_label_; | 197 OwnedWidgetGtk fake_label_; |
| 206 OwnedWidgetGtk fake_entry_; | 198 OwnedWidgetGtk fake_entry_; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 222 // changes. | 214 // changes. |
| 223 SkColor focus_ring_color_; | 215 SkColor focus_ring_color_; |
| 224 SkColor thumb_active_color_; | 216 SkColor thumb_active_color_; |
| 225 SkColor thumb_inactive_color_; | 217 SkColor thumb_inactive_color_; |
| 226 SkColor track_color_; | 218 SkColor track_color_; |
| 227 SkColor active_selection_bg_color_; | 219 SkColor active_selection_bg_color_; |
| 228 SkColor active_selection_fg_color_; | 220 SkColor active_selection_fg_color_; |
| 229 SkColor inactive_selection_bg_color_; | 221 SkColor inactive_selection_bg_color_; |
| 230 SkColor inactive_selection_fg_color_; | 222 SkColor inactive_selection_fg_color_; |
| 231 | 223 |
| 232 gfx::Insets button_insets_; | |
| 233 | |
| 234 #if defined(USE_GCONF) | 224 #if defined(USE_GCONF) |
| 235 // Currently, the only source of window button configuration. This will | 225 // Currently, the only source of window button configuration. This will |
| 236 // change if we ever have to support XFCE's configuration system or KDE's. | 226 // change if we ever have to support XFCE's configuration system or KDE's. |
| 237 scoped_ptr<GConfListener> gconf_listener_; | 227 scoped_ptr<GConfListener> gconf_listener_; |
| 238 #endif // defined(USE_GCONF) | 228 #endif // defined(USE_GCONF) |
| 239 | 229 |
| 240 // If either of these vectors are non-empty, they represent the current | 230 // If either of these vectors are non-empty, they represent the current |
| 241 // window button configuration. | 231 // window button configuration. |
| 242 std::vector<views::FrameButton> leading_buttons_; | 232 std::vector<views::FrameButton> leading_buttons_; |
| 243 std::vector<views::FrameButton> trailing_buttons_; | 233 std::vector<views::FrameButton> trailing_buttons_; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 265 } // namespace libgtk2ui | 255 } // namespace libgtk2ui |
| 266 | 256 |
| 267 // Access point to the GTK2 desktop system. This should be the only symbol that | 257 // Access point to the GTK2 desktop system. This should be the only symbol that |
| 268 // is exported in the library; everything else should be used through the | 258 // is exported in the library; everything else should be used through the |
| 269 // interface, because eventually this .so will be loaded through dlopen at | 259 // interface, because eventually this .so will be loaded through dlopen at |
| 270 // runtime so our main binary can conditionally load GTK2 or GTK3 or EFL or | 260 // runtime so our main binary can conditionally load GTK2 or GTK3 or EFL or |
| 271 // QT or whatever. | 261 // QT or whatever. |
| 272 LIBGTK2UI_EXPORT views::LinuxUI* BuildGtk2UI(); | 262 LIBGTK2UI_EXPORT views::LinuxUI* BuildGtk2UI(); |
| 273 | 263 |
| 274 #endif // CHROME_BROWSER_UI_LIBGTK2UI_GTK2_UI_H_ | 264 #endif // CHROME_BROWSER_UI_LIBGTK2UI_GTK2_UI_H_ |
| OLD | NEW |