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_VIEW_H_ | 5 #ifndef VIEWS_VIEW_H_ |
6 #define VIEWS_VIEW_H_ | 6 #define VIEWS_VIEW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <map> | 10 #include <map> |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
253 | 253 |
254 // Returns whether the view is enabled. | 254 // Returns whether the view is enabled. |
255 virtual bool IsEnabled() const; | 255 virtual bool IsEnabled() const; |
256 | 256 |
257 // This indicates that the view completely fills its bounds in an opaque | 257 // This indicates that the view completely fills its bounds in an opaque |
258 // color. | 258 // color. |
259 // This doesn't affect compositing but is a hint to the compositor to optimize | 259 // This doesn't affect compositing but is a hint to the compositor to optimize |
260 // painting. | 260 // painting. |
261 void SetFillsBoundsOpaquely(bool fills_bounds_opaquely); | 261 void SetFillsBoundsOpaquely(bool fills_bounds_opaquely); |
262 | 262 |
263 // Sets whether this view is painting. | |
sky
2011/08/17 16:39:42
Is this still needed? If so, what case does it cov
| |
264 void set_painting_enabled(bool enabled) { painting_enabled_ = enabled; } | |
265 | |
266 // Returns whether the view is painting. | |
267 bool painting_enabled() const { return painting_enabled_; } | |
268 | |
263 // Transformations ----------------------------------------------------------- | 269 // Transformations ----------------------------------------------------------- |
264 | 270 |
265 // Methods for setting transformations for a view (e.g. rotation, scaling). | 271 // Methods for setting transformations for a view (e.g. rotation, scaling). |
266 | 272 |
267 const ui::Transform& GetTransform() const; | 273 const ui::Transform& GetTransform() const; |
268 | 274 |
269 // Clipping parameters. Clipping happens from the right and/or bottom. The | 275 // Clipping parameters. Clipping happens from the right and/or bottom. The |
270 // clipping amount is in parent's coordinate system, as in, if the view is | 276 // clipping amount is in parent's coordinate system, as in, if the view is |
271 // rotated, then the clipping will be applied after the rotation (and other | 277 // rotated, then the clipping will be applied after the rotation (and other |
272 // transformations, if any). | 278 // transformations, if any). |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
456 | 462 |
457 // Mark all or part of the View's bounds as dirty (needing repaint). | 463 // Mark all or part of the View's bounds as dirty (needing repaint). |
458 // |r| is in the View's coordinates. | 464 // |r| is in the View's coordinates. |
459 // Rectangle |r| should be in the view's coordinate system. The | 465 // Rectangle |r| should be in the view's coordinate system. The |
460 // transformations are applied to it to convert it into the parent coordinate | 466 // transformations are applied to it to convert it into the parent coordinate |
461 // system before propagating SchedulePaint up the view hierarchy. | 467 // system before propagating SchedulePaint up the view hierarchy. |
462 // TODO(beng): Make protected. | 468 // TODO(beng): Make protected. |
463 virtual void SchedulePaint(); | 469 virtual void SchedulePaint(); |
464 virtual void SchedulePaintInRect(const gfx::Rect& r); | 470 virtual void SchedulePaintInRect(const gfx::Rect& r); |
465 | 471 |
472 virtual void ScheduleComposite(); | |
sky
2011/08/17 16:39:42
Description?
| |
473 | |
466 // Called by the framework to paint a View. Performs translation and clipping | 474 // Called by the framework to paint a View. Performs translation and clipping |
467 // for View coordinates and language direction as required, allows the View | 475 // for View coordinates and language direction as required, allows the View |
468 // to paint itself via the various OnPaint*() event handlers and then paints | 476 // to paint itself via the various OnPaint*() event handlers and then paints |
469 // the hierarchy beneath it. | 477 // the hierarchy beneath it. |
470 virtual void Paint(gfx::Canvas* canvas); | 478 virtual void Paint(gfx::Canvas* canvas); |
471 | 479 |
472 // The background object is owned by this object and may be NULL. | 480 // The background object is owned by this object and may be NULL. |
473 void set_background(Background* b) { background_.reset(b); } | 481 void set_background(Background* b) { background_.reset(b); } |
474 const Background* background() const { return background_.get(); } | 482 const Background* background() const { return background_.get(); } |
475 Background* background() { return background_.get(); } | 483 Background* background() { return background_.get(); } |
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1424 // Next view to be focused when the Shift-Tab key combination is pressed. | 1432 // Next view to be focused when the Shift-Tab key combination is pressed. |
1425 View* previous_focusable_view_; | 1433 View* previous_focusable_view_; |
1426 | 1434 |
1427 // Whether this view can be focused. | 1435 // Whether this view can be focused. |
1428 bool focusable_; | 1436 bool focusable_; |
1429 | 1437 |
1430 // Whether this view is focusable if the user requires full keyboard access, | 1438 // Whether this view is focusable if the user requires full keyboard access, |
1431 // even though it may not be normally focusable. | 1439 // even though it may not be normally focusable. |
1432 bool accessibility_focusable_; | 1440 bool accessibility_focusable_; |
1433 | 1441 |
1442 // Whether this view can be painted. Can be disabled during an animation. | |
1443 bool painting_enabled_; | |
1444 | |
1434 // Context menus ------------------------------------------------------------- | 1445 // Context menus ------------------------------------------------------------- |
1435 | 1446 |
1436 // The menu controller. | 1447 // The menu controller. |
1437 ContextMenuController* context_menu_controller_; | 1448 ContextMenuController* context_menu_controller_; |
1438 | 1449 |
1439 // Drag and drop ------------------------------------------------------------- | 1450 // Drag and drop ------------------------------------------------------------- |
1440 | 1451 |
1441 DragController* drag_controller_; | 1452 DragController* drag_controller_; |
1442 | 1453 |
1443 // Accessibility ------------------------------------------------------------- | 1454 // Accessibility ------------------------------------------------------------- |
1444 | 1455 |
1445 // The Windows-specific accessibility implementation for this view. | 1456 // The Windows-specific accessibility implementation for this view. |
1446 #if defined(OS_WIN) | 1457 #if defined(OS_WIN) |
1447 scoped_refptr<NativeViewAccessibilityWin> native_view_accessibility_win_; | 1458 scoped_refptr<NativeViewAccessibilityWin> native_view_accessibility_win_; |
1448 #endif | 1459 #endif |
1449 | 1460 |
1450 DISALLOW_COPY_AND_ASSIGN(View); | 1461 DISALLOW_COPY_AND_ASSIGN(View); |
1451 }; | 1462 }; |
1452 | 1463 |
1453 } // namespace views | 1464 } // namespace views |
1454 | 1465 |
1455 #endif // VIEWS_VIEW_H_ | 1466 #endif // VIEWS_VIEW_H_ |
OLD | NEW |