Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: views/widget/widget_gtk.h

Issue 159046: Implementing accelerators for Linux toolkit_views (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « views/widget/accelerator_handler.cc ('k') | views/widget/widget_gtk.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 7
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 9
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 virtual Widget* GetRootWidget() const; 92 virtual Widget* GetRootWidget() const;
93 virtual bool IsVisible() const; 93 virtual bool IsVisible() const;
94 virtual bool IsActive() const; 94 virtual bool IsActive() const;
95 virtual void GenerateMousePressedForView(View* view, 95 virtual void GenerateMousePressedForView(View* view,
96 const gfx::Point& point); 96 const gfx::Point& point);
97 virtual TooltipManager* GetTooltipManager(); 97 virtual TooltipManager* GetTooltipManager();
98 virtual bool GetAccelerator(int cmd_id, Accelerator* accelerator); 98 virtual bool GetAccelerator(int cmd_id, Accelerator* accelerator);
99 virtual Window* GetWindow(); 99 virtual Window* GetWindow();
100 virtual const Window* GetWindow() const; 100 virtual const Window* GetWindow() const;
101 virtual ThemeProvider* GetThemeProvider() const; 101 virtual ThemeProvider* GetThemeProvider() const;
102 virtual FocusManager* GetFocusManager();
102 103
103 // MessageLoopForUI::Observer. 104 // MessageLoopForUI::Observer.
104 virtual void WillProcessEvent(GdkEvent* event) {} 105 virtual void WillProcessEvent(GdkEvent* event);
105 virtual void DidProcessEvent(GdkEvent* event); 106 virtual void DidProcessEvent(GdkEvent* event);
106 107
108 // Retrieves the WindowGtk associated with |widget|.
109 static WindowGtk* GetWindowForNative(GtkWidget* widget);
110
107 protected: 111 protected:
108 virtual void OnSizeAllocate(GtkWidget* widget, GtkAllocation* allocation); 112 virtual void OnSizeAllocate(GtkWidget* widget, GtkAllocation* allocation);
109 virtual void OnPaint(GtkWidget* widget, GdkEventExpose* event); 113 virtual void OnPaint(GtkWidget* widget, GdkEventExpose* event);
110 virtual gboolean OnEnterNotify(GtkWidget* widget, GdkEventCrossing* event); 114 virtual gboolean OnEnterNotify(GtkWidget* widget, GdkEventCrossing* event);
111 virtual gboolean OnLeaveNotify(GtkWidget* widget, GdkEventCrossing* event); 115 virtual gboolean OnLeaveNotify(GtkWidget* widget, GdkEventCrossing* event);
112 virtual gboolean OnMotionNotify(GtkWidget* widget, GdkEventMotion* event); 116 virtual gboolean OnMotionNotify(GtkWidget* widget, GdkEventMotion* event);
113 virtual gboolean OnButtonPress(GtkWidget* widget, GdkEventButton* event); 117 virtual gboolean OnButtonPress(GtkWidget* widget, GdkEventButton* event);
114 virtual gboolean OnButtonRelease(GtkWidget* widget, GdkEventButton* event); 118 virtual gboolean OnButtonRelease(GtkWidget* widget, GdkEventButton* event);
115 virtual gboolean OnFocusIn(GtkWidget* widget, GdkEventFocus* event) { 119 virtual gboolean OnFocusIn(GtkWidget* widget, GdkEventFocus* event) {
116 return false; 120 return false;
(...skipping 11 matching lines...) Expand all
128 return false; 132 return false;
129 } 133 }
130 virtual gboolean OnGrabBrokeEvent(GtkWidget* widget, GdkEvent* event); 134 virtual gboolean OnGrabBrokeEvent(GtkWidget* widget, GdkEvent* event);
131 virtual void OnGrabNotify(GtkWidget* widget, gboolean was_grabbed); 135 virtual void OnGrabNotify(GtkWidget* widget, gboolean was_grabbed);
132 virtual void OnDestroy(); 136 virtual void OnDestroy();
133 137
134 // Returns whether capture should be released on mouse release. The default 138 // Returns whether capture should be released on mouse release. The default
135 // is true. 139 // is true.
136 virtual bool ReleaseCaptureOnMouseReleased() { return true; } 140 virtual bool ReleaseCaptureOnMouseReleased() { return true; }
137 141
138 // Sets and retrieves the WidgetGtk in the userdata section of the widget. 142 // Sets the WindowGtk in the userdata section of the widget.
139 static WindowGtk* GetWindowForNative(GtkWidget* widget);
140 static void SetWindowForNative(GtkWidget* widget, WindowGtk* window); 143 static void SetWindowForNative(GtkWidget* widget, WindowGtk* window);
141 144
142 // Are we a subclass of WindowGtk? 145 // Are we a subclass of WindowGtk?
143 bool is_window_; 146 bool is_window_;
144 147
145 private: 148 private:
146 virtual RootView* CreateRootView(); 149 virtual RootView* CreateRootView();
147 150
148 void OnWindowPaint(GtkWidget* widget, GdkEventExpose* event); 151 void OnWindowPaint(GtkWidget* widget, GdkEventExpose* event);
149 152
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 // Child GtkWidgets created with no parent need to be parented to a valid top 211 // Child GtkWidgets created with no parent need to be parented to a valid top
209 // level window otherwise Gtk throws a fit. |null_parent_| is an invisible 212 // level window otherwise Gtk throws a fit. |null_parent_| is an invisible
210 // popup that such GtkWidgets are parented to. 213 // popup that such GtkWidgets are parented to.
211 static GtkWidget* null_parent_; 214 static GtkWidget* null_parent_;
212 215
213 // The TooltipManager. 216 // The TooltipManager.
214 // WARNING: RootView's destructor calls into the TooltipManager. As such, this 217 // WARNING: RootView's destructor calls into the TooltipManager. As such, this
215 // must be destroyed AFTER root_view_. 218 // must be destroyed AFTER root_view_.
216 scoped_ptr<TooltipManagerGtk> tooltip_manager_; 219 scoped_ptr<TooltipManagerGtk> tooltip_manager_;
217 220
221 // The focus manager keeping track of focus for this Widget and any of its
222 // children. NULL for non top-level widgets.
223 // WARNING: RootView's destructor calls into the FocusManager. As such, this
224 // must be destroyed AFTER root_view_.
225 scoped_ptr<FocusManager> focus_manager_;
226
218 // The root of the View hierarchy attached to this window. 227 // The root of the View hierarchy attached to this window.
219 scoped_ptr<RootView> root_view_; 228 scoped_ptr<RootView> root_view_;
220 229
221 // If true, the mouse is currently down. 230 // If true, the mouse is currently down.
222 bool is_mouse_down_; 231 bool is_mouse_down_;
223 232
224 // Have we done a mouse grab? 233 // Have we done a mouse grab?
225 bool has_capture_; 234 bool has_capture_;
226 235
227 // The following are used to detect duplicate mouse move events and not 236 // The following are used to detect duplicate mouse move events and not
(...skipping 17 matching lines...) Expand all
245 bool transparent_; 254 bool transparent_;
246 255
247 scoped_ptr<DefaultThemeProvider> default_theme_provider_; 256 scoped_ptr<DefaultThemeProvider> default_theme_provider_;
248 257
249 DISALLOW_COPY_AND_ASSIGN(WidgetGtk); 258 DISALLOW_COPY_AND_ASSIGN(WidgetGtk);
250 }; 259 };
251 260
252 } // namespace views 261 } // namespace views
253 262
254 #endif // VIEWS_WIDGET_WIDGET_GTK_H_ 263 #endif // VIEWS_WIDGET_WIDGET_GTK_H_
OLDNEW
« no previous file with comments | « views/widget/accelerator_handler.cc ('k') | views/widget/widget_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698