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_NATIVE_WINDOW_GTK_H_ | 5 #ifndef VIEWS_WINDOW_NATIVE_WINDOW_GTK_H_ |
6 #define VIEWS_WINDOW_NATIVE_WINDOW_GTK_H_ | 6 #define VIEWS_WINDOW_NATIVE_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/native_widget_gtk.h" | 10 #include "views/widget/native_widget_gtk.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 virtual Window* GetWindow() OVERRIDE; | 33 virtual Window* GetWindow() OVERRIDE; |
34 virtual const Window* GetWindow() const OVERRIDE; | 34 virtual const Window* GetWindow() const OVERRIDE; |
35 | 35 |
36 // Overridden from NativeWidgetGtk: | 36 // Overridden from NativeWidgetGtk: |
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 OnLeaveNotify(GtkWidget* widget, GdkEventCrossing* event); | 42 virtual gboolean OnLeaveNotify(GtkWidget* widget, GdkEventCrossing* event); |
43 virtual void IsActiveChanged(); | |
44 | 43 |
45 protected: | 44 protected: |
46 virtual void InitNativeWidget(const Widget::InitParams& params) OVERRIDE; | 45 virtual void InitNativeWidget(const Widget::InitParams& params) OVERRIDE; |
47 | 46 |
48 // Overridden from NativeWindow: | 47 // Overridden from NativeWindow: |
49 virtual NativeWidget* AsNativeWidget() OVERRIDE; | 48 virtual NativeWidget* AsNativeWidget() OVERRIDE; |
50 virtual const NativeWidget* AsNativeWidget() const OVERRIDE; | 49 virtual const NativeWidget* AsNativeWidget() const OVERRIDE; |
51 virtual gfx::Rect GetRestoredBounds() const OVERRIDE; | |
52 virtual void ShowNativeWindow(ShowState state) OVERRIDE; | |
53 virtual void BecomeModal() OVERRIDE; | 50 virtual void BecomeModal() OVERRIDE; |
54 virtual void EnableClose(bool enable) OVERRIDE; | |
55 | 51 |
56 // Overridden from NativeWidgetGtk: | 52 // Overridden from NativeWidgetGtk: |
57 virtual void Restore() OVERRIDE; | |
58 virtual gboolean OnWindowStateEvent(GtkWidget* widget, | 53 virtual gboolean OnWindowStateEvent(GtkWidget* widget, |
59 GdkEventWindowState* event) OVERRIDE; | 54 GdkEventWindowState* event) OVERRIDE; |
60 | 55 |
61 // For the constructor. | 56 // For the constructor. |
62 friend class Window; | 57 friend class Window; |
63 | 58 |
64 virtual void OnDestroy(GtkWidget* widget); | |
65 | |
66 private: | 59 private: |
67 static gboolean CallConfigureEvent(GtkWidget* widget, | 60 static gboolean CallConfigureEvent(GtkWidget* widget, |
68 GdkEventConfigure* event, | 61 GdkEventConfigure* event, |
69 NativeWindowGtk* window_gtk); | 62 NativeWindowGtk* window_gtk); |
70 | 63 |
71 // Asks the delegate if any to save the window's location and size. | 64 // Asks the delegate if any to save the window's location and size. |
72 void SaveWindowPosition(); | 65 void SaveWindowPosition(); |
73 | 66 |
74 // A delegate implementation that handles events received here. | 67 // A delegate implementation that handles events received here. |
75 internal::NativeWindowDelegate* delegate_; | 68 internal::NativeWindowDelegate* delegate_; |
76 | 69 |
77 // Our window delegate. | 70 // Our window delegate. |
78 WindowDelegate* window_delegate_; | 71 WindowDelegate* window_delegate_; |
79 | 72 |
80 // The View that provides the non-client area of the window (title bar, | 73 // The View that provides the non-client area of the window (title bar, |
81 // window controls, sizing borders etc). To use an implementation other than | 74 // window controls, sizing borders etc). To use an implementation other than |
82 // the default, this class must be subclassed and this value set to the | 75 // the default, this class must be subclassed and this value set to the |
83 // desired implementation before calling |Init|. | 76 // desired implementation before calling |Init|. |
84 NonClientView* non_client_view_; | 77 NonClientView* non_client_view_; |
85 | 78 |
86 // Set to true if the window is in the process of closing. | 79 // Set to true if the window is in the process of closing. |
87 bool window_closed_; | 80 bool window_closed_; |
88 | 81 |
89 DISALLOW_COPY_AND_ASSIGN(NativeWindowGtk); | 82 DISALLOW_COPY_AND_ASSIGN(NativeWindowGtk); |
90 }; | 83 }; |
91 | 84 |
92 } // namespace views | 85 } // namespace views |
93 | 86 |
94 #endif // VIEWS_WINDOW_NATIVE_WINDOW_GTK_H_ | 87 #endif // VIEWS_WINDOW_NATIVE_WINDOW_GTK_H_ |
OLD | NEW |