| 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_WIDGET_GTK_H_ | 5 #ifndef VIEWS_WIDGET_WIDGET_GTK_H_ |
| 6 #define VIEWS_WIDGET_WIDGET_GTK_H_ | 6 #define VIEWS_WIDGET_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/message_loop.h" | 11 #include "base/message_loop.h" |
| 12 #include "ui/base/gtk/gtk_signal.h" | 12 #include "ui/base/gtk/gtk_signal.h" |
| 13 #include "ui/base/x/active_window_watcher_x.h" | 13 #include "ui/base/x/active_window_watcher_x.h" |
| 14 #include "ui/gfx/size.h" | 14 #include "ui/gfx/size.h" |
| 15 #include "views/focus/focus_manager.h" | 15 #include "views/focus/focus_manager.h" |
| 16 #include "views/ime/input_method_delegate.h" | |
| 17 #include "views/widget/native_widget.h" | 16 #include "views/widget/native_widget.h" |
| 18 #include "views/widget/widget.h" | 17 #include "views/widget/widget.h" |
| 19 | 18 |
| 20 namespace gfx { | 19 namespace gfx { |
| 21 class Rect; | 20 class Rect; |
| 22 } | 21 } |
| 23 | 22 |
| 24 namespace ui { | 23 namespace ui { |
| 25 class OSExchangeData; | 24 class OSExchangeData; |
| 26 class OSExchangeDataProviderGtk; | 25 class OSExchangeDataProviderGtk; |
| 27 } | 26 } |
| 28 using ui::OSExchangeData; | 27 using ui::OSExchangeData; |
| 29 using ui::OSExchangeDataProviderGtk; | 28 using ui::OSExchangeDataProviderGtk; |
| 30 | 29 |
| 31 namespace views { | 30 namespace views { |
| 32 | 31 |
| 33 class DropTargetGtk; | 32 class DropTargetGtk; |
| 34 class InputMethod; | |
| 35 class TooltipManagerGtk; | 33 class TooltipManagerGtk; |
| 36 class View; | 34 class View; |
| 37 class WindowGtk; | 35 class WindowGtk; |
| 38 | 36 |
| 39 namespace internal { | 37 namespace internal { |
| 40 class NativeWidgetDelegate; | 38 class NativeWidgetDelegate; |
| 41 } | 39 } |
| 42 | 40 |
| 43 // Widget implementation for GTK. | 41 // Widget implementation for GTK. |
| 44 class WidgetGtk : public Widget, | 42 class WidgetGtk : public Widget, |
| 45 public NativeWidget, | 43 public NativeWidget, |
| 46 public ui::ActiveWindowWatcherX::Observer, | 44 public ui::ActiveWindowWatcherX::Observer { |
| 47 public internal::InputMethodDelegate { | |
| 48 public: | 45 public: |
| 49 // Type of widget. | 46 // Type of widget. |
| 50 enum Type { | 47 enum Type { |
| 51 // Used for popup type windows (bubbles, menus ...). | 48 // Used for popup type windows (bubbles, menus ...). |
| 52 // NOTE: on X windows of this type can NOT get focus. If you need a popup | 49 // NOTE: on X windows of this type can NOT get focus. If you need a popup |
| 53 // like widget that can be focused use TYPE_WINDOW and set the window type | 50 // like widget that can be focused use TYPE_WINDOW and set the window type |
| 54 // to WINDOW_TYPE_CHROME_INFO_BUBBLE. | 51 // to WINDOW_TYPE_CHROME_INFO_BUBBLE. |
| 55 TYPE_POPUP, | 52 TYPE_POPUP, |
| 56 | 53 |
| 57 // A top level window with no title or control buttons. | 54 // A top level window with no title or control buttons. |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 class DropObserver; | 295 class DropObserver; |
| 299 friend class DropObserver; | 296 friend class DropObserver; |
| 300 | 297 |
| 301 // Overridden from Widget | 298 // Overridden from Widget |
| 302 virtual RootView* CreateRootView() OVERRIDE; | 299 virtual RootView* CreateRootView() OVERRIDE; |
| 303 | 300 |
| 304 // Overridden from NativeWidget | 301 // Overridden from NativeWidget |
| 305 virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE; | 302 virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE; |
| 306 | 303 |
| 307 // Overridden from internal::InputMethodDelegate | 304 // Overridden from internal::InputMethodDelegate |
| 308 virtual void DispatchKeyEventPostIME(const KeyEvent& key) OVERRIDE; | 305 virtual bool DispatchKeyEventPostIME(const KeyEvent& key) OVERRIDE; |
| 309 | 306 |
| 310 // This is called only when the window is transparent. | 307 // This is called only when the window is transparent. |
| 311 CHROMEGTK_CALLBACK_1(WidgetGtk, gboolean, OnWindowPaint, GdkEventExpose*); | 308 CHROMEGTK_CALLBACK_1(WidgetGtk, gboolean, OnWindowPaint, GdkEventExpose*); |
| 312 | 309 |
| 313 // Callbacks for expose event on child widgets. See the description of | 310 // Callbacks for expose event on child widgets. See the description of |
| 314 // RegisterChildChildExposeHandler. | 311 // RegisterChildChildExposeHandler. |
| 315 void OnChildExpose(GtkWidget* child); | 312 void OnChildExpose(GtkWidget* child); |
| 316 static gboolean ChildExposeHandler(GtkWidget* widget, GdkEventExpose* event); | 313 static gboolean ChildExposeHandler(GtkWidget* widget, GdkEventExpose* event); |
| 317 | 314 |
| 318 // Returns the first ancestor of |widget| that is a window. | 315 // Returns the first ancestor of |widget| that is a window. |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 bool painted_; | 428 bool painted_; |
| 432 | 429 |
| 433 scoped_ptr<InputMethod> input_method_; | 430 scoped_ptr<InputMethod> input_method_; |
| 434 | 431 |
| 435 DISALLOW_COPY_AND_ASSIGN(WidgetGtk); | 432 DISALLOW_COPY_AND_ASSIGN(WidgetGtk); |
| 436 }; | 433 }; |
| 437 | 434 |
| 438 } // namespace views | 435 } // namespace views |
| 439 | 436 |
| 440 #endif // VIEWS_WIDGET_WIDGET_GTK_H_ | 437 #endif // VIEWS_WIDGET_WIDGET_GTK_H_ |
| OLD | NEW |