OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 UI_VIEWS_VIEW_H_ | 5 #ifndef UI_VIEWS_VIEW_H_ |
6 #define UI_VIEWS_VIEW_H_ | 6 #define UI_VIEWS_VIEW_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "ui/compositor/layer_delegate.h" | 28 #include "ui/compositor/layer_delegate.h" |
29 #include "ui/compositor/layer_owner.h" | 29 #include "ui/compositor/layer_owner.h" |
30 #include "ui/compositor/paint_cache.h" | 30 #include "ui/compositor/paint_cache.h" |
31 #include "ui/events/event.h" | 31 #include "ui/events/event.h" |
32 #include "ui/events/event_target.h" | 32 #include "ui/events/event_target.h" |
33 #include "ui/gfx/geometry/insets.h" | 33 #include "ui/gfx/geometry/insets.h" |
34 #include "ui/gfx/geometry/point.h" | 34 #include "ui/gfx/geometry/point.h" |
35 #include "ui/gfx/geometry/rect.h" | 35 #include "ui/gfx/geometry/rect.h" |
36 #include "ui/gfx/geometry/vector2d.h" | 36 #include "ui/gfx/geometry/vector2d.h" |
37 #include "ui/gfx/native_widget_types.h" | 37 #include "ui/gfx/native_widget_types.h" |
| 38 #include "ui/gfx/path.h" |
38 #include "ui/views/view_targeter.h" | 39 #include "ui/views/view_targeter.h" |
39 #include "ui/views/views_export.h" | 40 #include "ui/views/views_export.h" |
40 | 41 |
41 #if defined(OS_WIN) | 42 #if defined(OS_WIN) |
42 #include "base/win/scoped_comptr.h" | 43 #include "base/win/scoped_comptr.h" |
43 #endif | 44 #endif |
44 | 45 |
45 using ui::OSExchangeData; | 46 using ui::OSExchangeData; |
46 | 47 |
47 namespace gfx { | 48 namespace gfx { |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 | 292 |
292 // Returns whether the view is enabled. | 293 // Returns whether the view is enabled. |
293 bool enabled() const { return enabled_; } | 294 bool enabled() const { return enabled_; } |
294 | 295 |
295 // Transformations ----------------------------------------------------------- | 296 // Transformations ----------------------------------------------------------- |
296 | 297 |
297 // Methods for setting transformations for a view (e.g. rotation, scaling). | 298 // Methods for setting transformations for a view (e.g. rotation, scaling). |
298 | 299 |
299 gfx::Transform GetTransform() const; | 300 gfx::Transform GetTransform() const; |
300 | 301 |
301 // Clipping parameters. Clipping is done relative to the view bounds. | 302 // Clipping is done relative to the view's local bounds. |
302 void set_clip_insets(gfx::Insets clip_insets) { clip_insets_ = clip_insets; } | 303 void set_clip_path(const gfx::Path& path) { clip_path_ = path; } |
303 | 304 |
304 // Sets the transform to the supplied transform. | 305 // Sets the transform to the supplied transform. |
305 void SetTransform(const gfx::Transform& transform); | 306 void SetTransform(const gfx::Transform& transform); |
306 | 307 |
307 // Sets whether this view paints to a layer. A view paints to a layer if | 308 // Sets whether this view paints to a layer. A view paints to a layer if |
308 // either of the following are true: | 309 // either of the following are true: |
309 // . the view has a non-identity transform. | 310 // . the view has a non-identity transform. |
310 // . SetPaintToLayer(true) has been invoked. | 311 // . SetPaintToLayer(true) has been invoked. |
311 // View creates the Layer only when it exists in a Widget with a non-NULL | 312 // View creates the Layer only when it exists in a Widget with a non-NULL |
312 // Compositor. | 313 // Compositor. |
(...skipping 1165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1478 | 1479 |
1479 // Whether or not RegisterViewForVisibleBoundsNotification on the RootView | 1480 // Whether or not RegisterViewForVisibleBoundsNotification on the RootView |
1480 // has been invoked. | 1481 // has been invoked. |
1481 bool registered_for_visible_bounds_notification_; | 1482 bool registered_for_visible_bounds_notification_; |
1482 | 1483 |
1483 // List of descendants wanting notification when their visible bounds change. | 1484 // List of descendants wanting notification when their visible bounds change. |
1484 scoped_ptr<Views> descendants_to_notify_; | 1485 scoped_ptr<Views> descendants_to_notify_; |
1485 | 1486 |
1486 // Transformations ----------------------------------------------------------- | 1487 // Transformations ----------------------------------------------------------- |
1487 | 1488 |
1488 // Clipping parameters. skia transformation matrix does not give us clipping. | 1489 // Painting will be clipped to this path. TODO(estade): this doesn't work for |
1489 // So we do it ourselves. | 1490 // layers. |
1490 gfx::Insets clip_insets_; | 1491 gfx::Path clip_path_; |
1491 | 1492 |
1492 // Layout -------------------------------------------------------------------- | 1493 // Layout -------------------------------------------------------------------- |
1493 | 1494 |
1494 // Whether the view needs to be laid out. | 1495 // Whether the view needs to be laid out. |
1495 bool needs_layout_; | 1496 bool needs_layout_; |
1496 | 1497 |
1497 // The View's LayoutManager defines the sizing heuristics applied to child | 1498 // The View's LayoutManager defines the sizing heuristics applied to child |
1498 // Views. The default is absolute positioning according to bounds_. | 1499 // Views. The default is absolute positioning according to bounds_. |
1499 scoped_ptr<LayoutManager> layout_manager_; | 1500 scoped_ptr<LayoutManager> layout_manager_; |
1500 | 1501 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1567 // Belongs to this view, but it's reference-counted on some platforms | 1568 // Belongs to this view, but it's reference-counted on some platforms |
1568 // so we can't use a scoped_ptr. It's dereferenced in the destructor. | 1569 // so we can't use a scoped_ptr. It's dereferenced in the destructor. |
1569 NativeViewAccessibility* native_view_accessibility_; | 1570 NativeViewAccessibility* native_view_accessibility_; |
1570 | 1571 |
1571 DISALLOW_COPY_AND_ASSIGN(View); | 1572 DISALLOW_COPY_AND_ASSIGN(View); |
1572 }; | 1573 }; |
1573 | 1574 |
1574 } // namespace views | 1575 } // namespace views |
1575 | 1576 |
1576 #endif // UI_VIEWS_VIEW_H_ | 1577 #endif // UI_VIEWS_VIEW_H_ |
OLD | NEW |