| 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 | 7 |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 | 9 |
| 10 #include "app/active_window_watcher_x.h" | 10 #include "app/active_window_watcher_x.h" |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 void set_mouse_down(bool mouse_down) { is_mouse_down_ = mouse_down; } | 263 void set_mouse_down(bool mouse_down) { is_mouse_down_ = mouse_down; } |
| 264 | 264 |
| 265 // Do we own the mouse grab? | 265 // Do we own the mouse grab? |
| 266 bool has_capture() const { return has_capture_; } | 266 bool has_capture() const { return has_capture_; } |
| 267 | 267 |
| 268 // Returns whether capture should be released on mouse release. The default | 268 // Returns whether capture should be released on mouse release. The default |
| 269 // is true. | 269 // is true. |
| 270 virtual bool ReleaseCaptureOnMouseReleased() { return true; } | 270 virtual bool ReleaseCaptureOnMouseReleased() { return true; } |
| 271 | 271 |
| 272 // Does a mouse grab on this widget. | 272 // Does a mouse grab on this widget. |
| 273 void DoGrab(); | 273 virtual void DoGrab(); |
| 274 | 274 |
| 275 // Releases a grab done by this widget. | 275 // Releases a grab done by this widget. |
| 276 virtual void ReleaseGrab(); | 276 virtual void ReleaseGrab(); |
| 277 | 277 |
| 278 // Invoked when input grab is stolen by other GtkWidget in the same |
| 279 // application. |
| 280 virtual void HandleGrabBroke(); |
| 281 |
| 278 // Are we a subclass of WindowGtk? | 282 // Are we a subclass of WindowGtk? |
| 279 bool is_window_; | 283 bool is_window_; |
| 280 | 284 |
| 281 // For test code to provide a customized focus manager. | 285 // For test code to provide a customized focus manager. |
| 282 void set_focus_manager(FocusManager* focus_manager) { | 286 void set_focus_manager(FocusManager* focus_manager) { |
| 283 delete focus_manager_; | 287 delete focus_manager_; |
| 284 focus_manager_ = focus_manager; | 288 focus_manager_ = focus_manager; |
| 285 } | 289 } |
| 286 | 290 |
| 287 private: | 291 private: |
| (...skipping 21 matching lines...) Expand all Loading... |
| 309 // Invoked from create widget to enable the various bits needed for a | 313 // Invoked from create widget to enable the various bits needed for a |
| 310 // transparent background. This is only invoked if MakeTransparent has been | 314 // transparent background. This is only invoked if MakeTransparent has been |
| 311 // invoked. | 315 // invoked. |
| 312 void ConfigureWidgetForTransparentBackground(GtkWidget* parent); | 316 void ConfigureWidgetForTransparentBackground(GtkWidget* parent); |
| 313 | 317 |
| 314 // Invoked from create widget to enable the various bits needed for a | 318 // Invoked from create widget to enable the various bits needed for a |
| 315 // window which doesn't receive events. This is only invoked if | 319 // window which doesn't receive events. This is only invoked if |
| 316 // MakeIgnoreEvents has been invoked. | 320 // MakeIgnoreEvents has been invoked. |
| 317 void ConfigureWidgetForIgnoreEvents(); | 321 void ConfigureWidgetForIgnoreEvents(); |
| 318 | 322 |
| 319 // TODO(sky): documentation | |
| 320 void HandleGrabBroke(); | |
| 321 | |
| 322 // A utility function to draw a transparent background onto the |widget|. | 323 // A utility function to draw a transparent background onto the |widget|. |
| 323 static void DrawTransparentBackground(GtkWidget* widget, | 324 static void DrawTransparentBackground(GtkWidget* widget, |
| 324 GdkEventExpose* event); | 325 GdkEventExpose* event); |
| 325 | 326 |
| 326 const Type type_; | 327 const Type type_; |
| 327 | 328 |
| 328 // Our native views. If we're a window/popup, then widget_ is the window and | 329 // Our native views. If we're a window/popup, then widget_ is the window and |
| 329 // window_contents_ is a GtkFixed. If we're not a window/popup, then widget_ | 330 // window_contents_ is a GtkFixed. If we're not a window/popup, then widget_ |
| 330 // and window_contents_ point to the same GtkFixed. | 331 // and window_contents_ point to the same GtkFixed. |
| 331 GtkWidget* widget_; | 332 GtkWidget* widget_; |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 // If true, we enable the content widget's double buffering. | 435 // If true, we enable the content widget's double buffering. |
| 435 // This is false by default. | 436 // This is false by default. |
| 436 bool is_double_buffered_; | 437 bool is_double_buffered_; |
| 437 | 438 |
| 438 DISALLOW_COPY_AND_ASSIGN(WidgetGtk); | 439 DISALLOW_COPY_AND_ASSIGN(WidgetGtk); |
| 439 }; | 440 }; |
| 440 | 441 |
| 441 } // namespace views | 442 } // namespace views |
| 442 | 443 |
| 443 #endif // VIEWS_WIDGET_WIDGET_GTK_H_ | 444 #endif // VIEWS_WIDGET_WIDGET_GTK_H_ |
| OLD | NEW |