| 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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 class DropObserver; | 294 class DropObserver; |
| 298 friend class DropObserver; | 295 friend class DropObserver; |
| 299 | 296 |
| 300 // Overridden from Widget | 297 // Overridden from Widget |
| 301 virtual RootView* CreateRootView() OVERRIDE; | 298 virtual RootView* CreateRootView() OVERRIDE; |
| 302 | 299 |
| 303 // Overridden from NativeWidget | 300 // Overridden from NativeWidget |
| 304 virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE; | 301 virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE; |
| 305 | 302 |
| 306 // Overridden from internal::InputMethodDelegate | 303 // Overridden from internal::InputMethodDelegate |
| 307 virtual void DispatchKeyEventPostIME(const KeyEvent& key) OVERRIDE; | 304 virtual bool DispatchKeyEventPostIME(const KeyEvent& key) OVERRIDE; |
| 308 | 305 |
| 309 // This is called only when the window is transparent. | 306 // This is called only when the window is transparent. |
| 310 CHROMEGTK_CALLBACK_1(WidgetGtk, gboolean, OnWindowPaint, GdkEventExpose*); | 307 CHROMEGTK_CALLBACK_1(WidgetGtk, gboolean, OnWindowPaint, GdkEventExpose*); |
| 311 | 308 |
| 312 // Callbacks for expose event on child widgets. See the description of | 309 // Callbacks for expose event on child widgets. See the description of |
| 313 // RegisterChildChildExposeHandler. | 310 // RegisterChildChildExposeHandler. |
| 314 void OnChildExpose(GtkWidget* child); | 311 void OnChildExpose(GtkWidget* child); |
| 315 static gboolean ChildExposeHandler(GtkWidget* widget, GdkEventExpose* event); | 312 static gboolean ChildExposeHandler(GtkWidget* widget, GdkEventExpose* event); |
| 316 | 313 |
| 317 // Returns the first ancestor of |widget| that is a window. | 314 // Returns the first ancestor of |widget| that is a window. |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 bool painted_; | 427 bool painted_; |
| 431 | 428 |
| 432 scoped_ptr<InputMethod> input_method_; | 429 scoped_ptr<InputMethod> input_method_; |
| 433 | 430 |
| 434 DISALLOW_COPY_AND_ASSIGN(WidgetGtk); | 431 DISALLOW_COPY_AND_ASSIGN(WidgetGtk); |
| 435 }; | 432 }; |
| 436 | 433 |
| 437 } // namespace views | 434 } // namespace views |
| 438 | 435 |
| 439 #endif // VIEWS_WIDGET_WIDGET_GTK_H_ | 436 #endif // VIEWS_WIDGET_WIDGET_GTK_H_ |
| OLD | NEW |