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

Side by Side Diff: ui/views/view.h

Issue 2648583003: Handle floating point coordinates from ozone to exosphere (Closed)
Patch Set: Handle floating point coordinates from ozone to exosphere Created 3 years, 11 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
OLDNEW
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 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 // right-to-left UI layout. 468 // right-to-left UI layout.
469 469
470 // Convert a point from the coordinate system of one View to another. 470 // Convert a point from the coordinate system of one View to another.
471 // 471 //
472 // |source| and |target| must be in the same widget, but doesn't need to be in 472 // |source| and |target| must be in the same widget, but doesn't need to be in
473 // the same view hierarchy. 473 // the same view hierarchy.
474 // Neither |source| nor |target| can be NULL. 474 // Neither |source| nor |target| can be NULL.
475 static void ConvertPointToTarget(const View* source, 475 static void ConvertPointToTarget(const View* source,
476 const View* target, 476 const View* target,
477 gfx::Point* point); 477 gfx::Point* point);
478 478 static void ConvertPointToTargetF(const View* source,
479 const View* target,
480 gfx::PointF* point);
479 // Convert |rect| from the coordinate system of |source| to the coordinate 481 // Convert |rect| from the coordinate system of |source| to the coordinate
480 // system of |target|. 482 // system of |target|.
481 // 483 //
482 // |source| and |target| must be in the same widget, but doesn't need to be in 484 // |source| and |target| must be in the same widget, but doesn't need to be in
483 // the same view hierarchy. 485 // the same view hierarchy.
484 // Neither |source| nor |target| can be NULL. 486 // Neither |source| nor |target| can be NULL.
485 static void ConvertRectToTarget(const View* source, 487 static void ConvertRectToTarget(const View* source,
486 const View* target, 488 const View* target,
487 gfx::RectF* rect); 489 gfx::RectF* rect);
488 490
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after
1341 // or NULL, |transform| is set to convert from root view coordinates to this. 1343 // or NULL, |transform| is set to convert from root view coordinates to this.
1342 bool GetTransformRelativeTo(const View* ancestor, 1344 bool GetTransformRelativeTo(const View* ancestor,
1343 gfx::Transform* transform) const; 1345 gfx::Transform* transform) const;
1344 1346
1345 // Coordinate conversion ----------------------------------------------------- 1347 // Coordinate conversion -----------------------------------------------------
1346 1348
1347 // Convert a point in the view's coordinate to an ancestor view's coordinate 1349 // Convert a point in the view's coordinate to an ancestor view's coordinate
1348 // system using necessary transformations. Returns whether the point was 1350 // system using necessary transformations. Returns whether the point was
1349 // successfully converted to the ancestor's coordinate system. 1351 // successfully converted to the ancestor's coordinate system.
1350 bool ConvertPointForAncestor(const View* ancestor, gfx::Point* point) const; 1352 bool ConvertPointForAncestor(const View* ancestor, gfx::Point* point) const;
1353 bool ConvertPointForAncestorF(const View* ancestor, gfx::PointF* point) const;
1351 1354
1352 // Convert a point in the ancestor's coordinate system to the view's 1355 // Convert a point in the ancestor's coordinate system to the view's
1353 // coordinate system using necessary transformations. Returns whether the 1356 // coordinate system using necessary transformations. Returns whether the
1354 // point was successfully converted from the ancestor's coordinate system 1357 // point was successfully converted from the ancestor's coordinate system
1355 // to the view's coordinate system. 1358 // to the view's coordinate system.
1356 bool ConvertPointFromAncestor(const View* ancestor, gfx::Point* point) const; 1359 bool ConvertPointFromAncestor(const View* ancestor, gfx::Point* point) const;
1360 bool ConvertPointFromAncestorF(const View* ancestor,
1361 gfx::PointF* point) const;
1357 1362
1358 // Convert a rect in the view's coordinate to an ancestor view's coordinate 1363 // Convert a rect in the view's coordinate to an ancestor view's coordinate
1359 // system using necessary transformations. Returns whether the rect was 1364 // system using necessary transformations. Returns whether the rect was
1360 // successfully converted to the ancestor's coordinate system. 1365 // successfully converted to the ancestor's coordinate system.
1361 bool ConvertRectForAncestor(const View* ancestor, gfx::RectF* rect) const; 1366 bool ConvertRectForAncestor(const View* ancestor, gfx::RectF* rect) const;
1362 1367
1363 // Convert a rect in the ancestor's coordinate system to the view's 1368 // Convert a rect in the ancestor's coordinate system to the view's
1364 // coordinate system using necessary transformations. Returns whether the 1369 // coordinate system using necessary transformations. Returns whether the
1365 // rect was successfully converted from the ancestor's coordinate system 1370 // rect was successfully converted from the ancestor's coordinate system
1366 // to the view's coordinate system. 1371 // to the view's coordinate system.
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
1613 // Observers ------------------------------------------------------------- 1618 // Observers -------------------------------------------------------------
1614 1619
1615 base::ObserverList<ViewObserver> observers_; 1620 base::ObserverList<ViewObserver> observers_;
1616 1621
1617 DISALLOW_COPY_AND_ASSIGN(View); 1622 DISALLOW_COPY_AND_ASSIGN(View);
1618 }; 1623 };
1619 1624
1620 } // namespace views 1625 } // namespace views
1621 1626
1622 #endif // UI_VIEWS_VIEW_H_ 1627 #endif // UI_VIEWS_VIEW_H_
OLDNEW
« ui/aura/window.cc ('K') | « ui/events/events_default.cc ('k') | ui/views/view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698