| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/active_window_watcher_x.h" | |
| 12 #include "app/gtk_signal.h" | |
| 13 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
| 14 #include "gfx/size.h" | 12 #include "gfx/size.h" |
| 13 #include "ui/base/gtk/gtk_signal.h" |
| 14 #include "ui/base/x/active_window_watcher_x.h" |
| 15 #include "views/focus/focus_manager.h" | 15 #include "views/focus/focus_manager.h" |
| 16 #include "views/widget/widget.h" | 16 #include "views/widget/widget.h" |
| 17 | 17 |
| 18 namespace gfx { | 18 namespace gfx { |
| 19 class Rect; | 19 class Rect; |
| 20 } | 20 } |
| 21 | 21 |
| 22 namespace ui { | 22 namespace ui { |
| 23 class OSExchangeData; | 23 class OSExchangeData; |
| 24 class OSExchangeDataProviderGtk; | 24 class OSExchangeDataProviderGtk; |
| 25 } | 25 } |
| 26 using ui::OSExchangeData; | 26 using ui::OSExchangeData; |
| 27 using ui::OSExchangeDataProviderGtk; | 27 using ui::OSExchangeDataProviderGtk; |
| 28 | 28 |
| 29 namespace views { | 29 namespace views { |
| 30 | 30 |
| 31 class DefaultThemeProvider; | 31 class DefaultThemeProvider; |
| 32 class DropTargetGtk; | 32 class DropTargetGtk; |
| 33 class FocusSearch; | 33 class FocusSearch; |
| 34 class TooltipManagerGtk; | 34 class TooltipManagerGtk; |
| 35 class View; | 35 class View; |
| 36 class WindowGtk; | 36 class WindowGtk; |
| 37 | 37 |
| 38 // Widget implementation for GTK. | 38 // Widget implementation for GTK. |
| 39 class WidgetGtk | 39 class WidgetGtk |
| 40 : public Widget, | 40 : public Widget, |
| 41 public FocusTraversable, | 41 public FocusTraversable, |
| 42 public ActiveWindowWatcherX::Observer { | 42 public ui::ActiveWindowWatcherX::Observer { |
| 43 public: | 43 public: |
| 44 // Type of widget. | 44 // Type of widget. |
| 45 enum Type { | 45 enum Type { |
| 46 // Used for popup type windows (bubbles, menus ...). | 46 // Used for popup type windows (bubbles, menus ...). |
| 47 // NOTE: on X windows of this type can NOT get focus. If you need a popup | 47 // NOTE: on X windows of this type can NOT get focus. If you need a popup |
| 48 // like widget that can be focused use TYPE_WINDOW and set the window type | 48 // like widget that can be focused use TYPE_WINDOW and set the window type |
| 49 // to WINDOW_TYPE_CHROME_INFO_BUBBLE. | 49 // to WINDOW_TYPE_CHROME_INFO_BUBBLE. |
| 50 TYPE_POPUP, | 50 TYPE_POPUP, |
| 51 | 51 |
| 52 // A top level window with no title or control buttons. | 52 // A top level window with no title or control buttons. |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 void ResetDropTarget(); | 151 void ResetDropTarget(); |
| 152 | 152 |
| 153 // Returns the RootView for |widget|. | 153 // Returns the RootView for |widget|. |
| 154 static RootView* GetRootViewForWidget(GtkWidget* widget); | 154 static RootView* GetRootViewForWidget(GtkWidget* widget); |
| 155 | 155 |
| 156 // Gets the requested size of the widget. This can be the size | 156 // Gets the requested size of the widget. This can be the size |
| 157 // stored in properties for a GtkViewsFixed, or in the requisitioned | 157 // stored in properties for a GtkViewsFixed, or in the requisitioned |
| 158 // size of other kinds of widgets. | 158 // size of other kinds of widgets. |
| 159 void GetRequestedSize(gfx::Size* out) const; | 159 void GetRequestedSize(gfx::Size* out) const; |
| 160 | 160 |
| 161 // Overriden from ActiveWindowWatcherX::Observer. | 161 // Overriden from ui::ActiveWindowWatcherX::Observer. |
| 162 virtual void ActiveWindowChanged(GdkWindow* active_window); | 162 virtual void ActiveWindowChanged(GdkWindow* active_window); |
| 163 | 163 |
| 164 // Overridden from Widget: | 164 // Overridden from Widget: |
| 165 virtual void Init(gfx::NativeView parent, const gfx::Rect& bounds); | 165 virtual void Init(gfx::NativeView parent, const gfx::Rect& bounds); |
| 166 virtual void InitWithWidget(Widget* parent, const gfx::Rect& bounds); | 166 virtual void InitWithWidget(Widget* parent, const gfx::Rect& bounds); |
| 167 virtual WidgetDelegate* GetWidgetDelegate(); | 167 virtual WidgetDelegate* GetWidgetDelegate(); |
| 168 virtual void SetWidgetDelegate(WidgetDelegate* delegate); | 168 virtual void SetWidgetDelegate(WidgetDelegate* delegate); |
| 169 virtual void SetContentsView(View* view); | 169 virtual void SetContentsView(View* view); |
| 170 virtual void GetBounds(gfx::Rect* out, bool including_frame) const; | 170 virtual void GetBounds(gfx::Rect* out, bool including_frame) const; |
| 171 virtual void SetBounds(const gfx::Rect& bounds); | 171 virtual void SetBounds(const gfx::Rect& bounds); |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 | 450 |
| 451 // Indicates if we should handle the upcoming Alt key release event. | 451 // Indicates if we should handle the upcoming Alt key release event. |
| 452 bool should_handle_menu_key_release_; | 452 bool should_handle_menu_key_release_; |
| 453 | 453 |
| 454 DISALLOW_COPY_AND_ASSIGN(WidgetGtk); | 454 DISALLOW_COPY_AND_ASSIGN(WidgetGtk); |
| 455 }; | 455 }; |
| 456 | 456 |
| 457 } // namespace views | 457 } // namespace views |
| 458 | 458 |
| 459 #endif // VIEWS_WIDGET_WIDGET_GTK_H_ | 459 #endif // VIEWS_WIDGET_WIDGET_GTK_H_ |
| OLD | NEW |