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_WINDOW_WINDOW_GTK_H_ | 5 #ifndef VIEWS_WINDOW_WINDOW_GTK_H_ |
6 #define VIEWS_WINDOW_WINDOW_GTK_H_ | 6 #define VIEWS_WINDOW_WINDOW_GTK_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "views/widget/widget_gtk.h" | 10 #include "views/widget/widget_gtk.h" |
11 #include "views/window/native_window.h" | 11 #include "views/window/native_window.h" |
12 #include "views/window/window.h" | 12 #include "views/window/window.h" |
13 | 13 |
14 namespace gfx { | 14 namespace gfx { |
15 class Point; | 15 class Point; |
16 class Size; | 16 class Size; |
17 }; | 17 }; |
18 | 18 |
19 namespace views { | 19 namespace views { |
20 namespace internal { | 20 namespace internal { |
21 class NativeWindowDelegate; | 21 class NativeWindowDelegate; |
22 } | 22 } |
23 | 23 |
24 class Client; | 24 class Client; |
25 class WindowDelegate; | 25 class WindowDelegate; |
26 | 26 |
27 // Window implementation for GTK. | 27 // Window implementation for GTK. |
28 class WindowGtk : public WidgetGtk, public NativeWindow, public Window { | 28 class WindowGtk : public WidgetGtk, public NativeWindow { |
29 public: | 29 public: |
30 WindowGtk(); | 30 explicit WindowGtk(internal::NativeWindowDelegate* delegate); |
31 virtual ~WindowGtk(); | 31 virtual ~WindowGtk(); |
32 | 32 |
33 virtual Window* AsWindow(); | 33 virtual Window* GetWindow() OVERRIDE; |
34 virtual const Window* AsWindow() const; | 34 virtual const Window* GetWindow() const OVERRIDE; |
35 | 35 |
36 // Overridden from WidgetGtk: | 36 // Overridden from WidgetGtk: |
37 virtual gboolean OnButtonPress(GtkWidget* widget, GdkEventButton* event); | 37 virtual gboolean OnButtonPress(GtkWidget* widget, GdkEventButton* event); |
38 virtual gboolean OnConfigureEvent(GtkWidget* widget, | 38 virtual gboolean OnConfigureEvent(GtkWidget* widget, |
39 GdkEventConfigure* event); | 39 GdkEventConfigure* event); |
40 virtual gboolean OnMotionNotify(GtkWidget* widget, GdkEventMotion* event); | 40 virtual gboolean OnMotionNotify(GtkWidget* widget, GdkEventMotion* event); |
41 virtual void OnSizeAllocate(GtkWidget* widget, GtkAllocation* allocation); | 41 virtual void OnSizeAllocate(GtkWidget* widget, GtkAllocation* allocation); |
42 virtual gboolean OnWindowStateEvent(GtkWidget* widget, | 42 virtual gboolean OnWindowStateEvent(GtkWidget* widget, |
43 GdkEventWindowState* event); | 43 GdkEventWindowState* event); |
44 virtual gboolean OnLeaveNotify(GtkWidget* widget, GdkEventCrossing* event); | 44 virtual gboolean OnLeaveNotify(GtkWidget* widget, GdkEventCrossing* event); |
(...skipping 11 matching lines...) Expand all Loading... |
56 virtual void CenterWindow(const gfx::Size& size) OVERRIDE; | 56 virtual void CenterWindow(const gfx::Size& size) OVERRIDE; |
57 virtual void GetWindowBoundsAndMaximizedState(gfx::Rect* bounds, | 57 virtual void GetWindowBoundsAndMaximizedState(gfx::Rect* bounds, |
58 bool* maximized) const OVERRIDE; | 58 bool* maximized) const OVERRIDE; |
59 virtual void EnableClose(bool enable) OVERRIDE; | 59 virtual void EnableClose(bool enable) OVERRIDE; |
60 virtual void SetWindowTitle(const std::wstring& title) OVERRIDE; | 60 virtual void SetWindowTitle(const std::wstring& title) OVERRIDE; |
61 virtual void SetWindowIcons(const SkBitmap& window_icon, | 61 virtual void SetWindowIcons(const SkBitmap& window_icon, |
62 const SkBitmap& app_icon) OVERRIDE; | 62 const SkBitmap& app_icon) OVERRIDE; |
63 virtual void SetAccessibleName(const std::wstring& name) OVERRIDE; | 63 virtual void SetAccessibleName(const std::wstring& name) OVERRIDE; |
64 virtual void SetAccessibleRole(ui::AccessibilityTypes::Role role) OVERRIDE; | 64 virtual void SetAccessibleRole(ui::AccessibilityTypes::Role role) OVERRIDE; |
65 virtual void SetAccessibleState(ui::AccessibilityTypes::State state) OVERRIDE; | 65 virtual void SetAccessibleState(ui::AccessibilityTypes::State state) OVERRIDE; |
66 virtual Window* GetWindow() OVERRIDE; | |
67 virtual void SetWindowBounds(const gfx::Rect& bounds, | 66 virtual void SetWindowBounds(const gfx::Rect& bounds, |
68 gfx::NativeWindow other_window) OVERRIDE; | 67 gfx::NativeWindow other_window) OVERRIDE; |
69 virtual void HideWindow() OVERRIDE; | 68 virtual void HideWindow() OVERRIDE; |
70 virtual void Activate() OVERRIDE; | 69 virtual void Activate() OVERRIDE; |
71 virtual void Deactivate() OVERRIDE; | 70 virtual void Deactivate() OVERRIDE; |
72 virtual void Maximize() OVERRIDE; | 71 virtual void Maximize() OVERRIDE; |
73 virtual void Minimize() OVERRIDE; | 72 virtual void Minimize() OVERRIDE; |
74 virtual void Restore() OVERRIDE; | 73 virtual void Restore() OVERRIDE; |
75 virtual bool IsActive() const OVERRIDE; | 74 virtual bool IsActive() const OVERRIDE; |
76 virtual bool IsVisible() const OVERRIDE; | 75 virtual bool IsVisible() const OVERRIDE; |
77 virtual bool IsMaximized() const OVERRIDE; | 76 virtual bool IsMaximized() const OVERRIDE; |
78 virtual bool IsMinimized() const OVERRIDE; | 77 virtual bool IsMinimized() const OVERRIDE; |
79 virtual void SetFullscreen(bool fullscreen) OVERRIDE; | 78 virtual void SetFullscreen(bool fullscreen) OVERRIDE; |
80 virtual bool IsFullscreen() const OVERRIDE; | 79 virtual bool IsFullscreen() const OVERRIDE; |
81 virtual void SetAlwaysOnTop(bool always_on_top) OVERRIDE; | 80 virtual void SetAlwaysOnTop(bool always_on_top) OVERRIDE; |
82 virtual bool IsAppWindow() const OVERRIDE; | |
83 virtual void SetUseDragFrame(bool use_drag_frame) OVERRIDE; | 81 virtual void SetUseDragFrame(bool use_drag_frame) OVERRIDE; |
84 virtual NonClientFrameView* CreateFrameViewForWindow() OVERRIDE; | 82 virtual NonClientFrameView* CreateFrameViewForWindow() OVERRIDE; |
85 virtual void UpdateFrameAfterFrameChange() OVERRIDE; | 83 virtual void UpdateFrameAfterFrameChange() OVERRIDE; |
86 virtual gfx::NativeWindow GetNativeWindow() const OVERRIDE; | 84 virtual gfx::NativeWindow GetNativeWindow() const OVERRIDE; |
87 virtual bool ShouldUseNativeFrame() const OVERRIDE; | 85 virtual bool ShouldUseNativeFrame() const OVERRIDE; |
88 virtual void FrameTypeChanged() OVERRIDE; | 86 virtual void FrameTypeChanged() OVERRIDE; |
89 | 87 |
90 // For the constructor. | 88 // For the constructor. |
91 friend class Window; | 89 friend class Window; |
92 | 90 |
(...skipping 27 matching lines...) Expand all Loading... |
120 | 118 |
121 // Set to true if the window is in the process of closing. | 119 // Set to true if the window is in the process of closing. |
122 bool window_closed_; | 120 bool window_closed_; |
123 | 121 |
124 DISALLOW_COPY_AND_ASSIGN(WindowGtk); | 122 DISALLOW_COPY_AND_ASSIGN(WindowGtk); |
125 }; | 123 }; |
126 | 124 |
127 } // namespace views | 125 } // namespace views |
128 | 126 |
129 #endif // VIEWS_WINDOW_WINDOW_GTK_H_ | 127 #endif // VIEWS_WINDOW_WINDOW_GTK_H_ |
OLD | NEW |