| 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 VIEWS_WIDGET_NATIVE_WIDGET_GTK_H_ | 5 #ifndef VIEWS_WIDGET_NATIVE_WIDGET_GTK_H_ |
| 6 #define VIEWS_WIDGET_NATIVE_WIDGET_GTK_H_ | 6 #define VIEWS_WIDGET_NATIVE_WIDGET_GTK_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
| 10 | 10 |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 13 #include "ui/base/gtk/gtk_signal.h" | 13 #include "ui/base/gtk/gtk_signal.h" |
| 14 #include "ui/base/x/active_window_watcher_x.h" | 14 #include "ui/base/x/active_window_watcher_x.h" |
| 15 #include "ui/gfx/compositor/compositor.h" |
| 15 #include "ui/gfx/size.h" | 16 #include "ui/gfx/size.h" |
| 16 #include "views/focus/focus_manager.h" | 17 #include "views/focus/focus_manager.h" |
| 17 #include "views/widget/native_widget_private.h" | 18 #include "views/widget/native_widget_private.h" |
| 18 #include "views/widget/widget.h" | 19 #include "views/widget/widget.h" |
| 19 | 20 |
| 20 namespace gfx { | 21 namespace gfx { |
| 21 class Rect; | 22 class Rect; |
| 22 } | 23 } |
| 23 | 24 |
| 24 namespace ui { | 25 namespace ui { |
| 25 class OSExchangeData; | 26 class OSExchangeData; |
| 26 class OSExchangeDataProviderGtk; | 27 class OSExchangeDataProviderGtk; |
| 27 } | 28 } |
| 28 using ui::OSExchangeData; | 29 using ui::OSExchangeData; |
| 29 using ui::OSExchangeDataProviderGtk; | 30 using ui::OSExchangeDataProviderGtk; |
| 30 | 31 |
| 31 namespace views { | 32 namespace views { |
| 32 | 33 |
| 33 class DropTargetGtk; | 34 class DropTargetGtk; |
| 34 class InputMethod; | 35 class InputMethod; |
| 35 class TooltipManagerGtk; | 36 class TooltipManagerGtk; |
| 36 class View; | 37 class View; |
| 37 | 38 |
| 38 namespace internal { | 39 namespace internal { |
| 39 class NativeWidgetDelegate; | 40 class NativeWidgetDelegate; |
| 40 } | 41 } |
| 41 | 42 |
| 42 // Widget implementation for GTK. | 43 // Widget implementation for GTK. |
| 43 class VIEWS_EXPORT NativeWidgetGtk : public internal::NativeWidgetPrivate, | 44 class VIEWS_EXPORT NativeWidgetGtk : public internal::NativeWidgetPrivate, |
| 45 public ui::CompositorDelegate, |
| 44 public ui::ActiveWindowWatcherX::Observer { | 46 public ui::ActiveWindowWatcherX::Observer { |
| 45 public: | 47 public: |
| 46 explicit NativeWidgetGtk(internal::NativeWidgetDelegate* delegate); | 48 explicit NativeWidgetGtk(internal::NativeWidgetDelegate* delegate); |
| 47 virtual ~NativeWidgetGtk(); | 49 virtual ~NativeWidgetGtk(); |
| 48 | 50 |
| 49 // Returns the transient parent. See make_transient_to_parent for details on | 51 // Returns the transient parent. See make_transient_to_parent for details on |
| 50 // what the transient parent is. | 52 // what the transient parent is. |
| 51 GtkWindow* GetTransientParent() const; | 53 GtkWindow* GetTransientParent() const; |
| 52 | 54 |
| 53 // Makes the background of the window totally transparent. This must be | 55 // Makes the background of the window totally transparent. This must be |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 // application. | 292 // application. |
| 291 virtual void HandleGtkGrabBroke(); | 293 virtual void HandleGtkGrabBroke(); |
| 292 | 294 |
| 293 const internal::NativeWidgetDelegate* delegate() const { return delegate_; } | 295 const internal::NativeWidgetDelegate* delegate() const { return delegate_; } |
| 294 internal::NativeWidgetDelegate* delegate() { return delegate_; } | 296 internal::NativeWidgetDelegate* delegate() { return delegate_; } |
| 295 | 297 |
| 296 private: | 298 private: |
| 297 class DropObserver; | 299 class DropObserver; |
| 298 friend class DropObserver; | 300 friend class DropObserver; |
| 299 | 301 |
| 302 // Overridden from ui::CompositorDelegate |
| 303 virtual void ScheduleCompositorPaint(); |
| 304 |
| 300 // Overridden from internal::InputMethodDelegate | 305 // Overridden from internal::InputMethodDelegate |
| 301 virtual void DispatchKeyEventPostIME(const KeyEvent& key) OVERRIDE; | 306 virtual void DispatchKeyEventPostIME(const KeyEvent& key) OVERRIDE; |
| 302 | 307 |
| 303 void SetInitParams(const Widget::InitParams& params); | 308 void SetInitParams(const Widget::InitParams& params); |
| 304 | 309 |
| 305 // This is called only when the window is transparent. | 310 // This is called only when the window is transparent. |
| 306 CHROMEGTK_CALLBACK_1(NativeWidgetGtk, gboolean, OnWindowPaint, | 311 CHROMEGTK_CALLBACK_1(NativeWidgetGtk, gboolean, OnWindowPaint, |
| 307 GdkEventExpose*); | 312 GdkEventExpose*); |
| 308 | 313 |
| 309 // Callbacks for expose event on child widgets. See the description of | 314 // Callbacks for expose event on child widgets. See the description of |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 | 452 |
| 448 // If we were created for a menu. | 453 // If we were created for a menu. |
| 449 bool is_menu_; | 454 bool is_menu_; |
| 450 | 455 |
| 451 DISALLOW_COPY_AND_ASSIGN(NativeWidgetGtk); | 456 DISALLOW_COPY_AND_ASSIGN(NativeWidgetGtk); |
| 452 }; | 457 }; |
| 453 | 458 |
| 454 } // namespace views | 459 } // namespace views |
| 455 | 460 |
| 456 #endif // VIEWS_WIDGET_NATIVE_WIDGET_GTK_H_ | 461 #endif // VIEWS_WIDGET_NATIVE_WIDGET_GTK_H_ |
| OLD | NEW |