-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1858: Floating point geometry r=AlanGriffiths a=wmww Will address #1829 when complete. Adds a new `geometry::generic::Wrapper` class and changes the ABI-stable `IntWrapper` to inherit from it. Only minor issue is that to be generic, operations need to return `generic::Wrapper<Tag, int>` instead of `IntWrapper<Tag>`. The two can be implicitly converted between, but this can cause a problem in some cases. For example, if `std::max()` is called on an `IntWrapper` and a `generic::Wrapper`, it needs an explicit type to cast to. When we break ABI, I would like to drop `IntWrapper` and make `Width`, `Height`, `X`, etc typedefs of the `generic::Type<int>`. This would fix those problems. Co-authored-by: William Wold <wm@wmww.sh>
- Loading branch information
Showing
22 changed files
with
1,204 additions
and
559 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright © 2020 Canonical Ltd. | ||
* | ||
* This program is free software: you can redistribute it and/or modify it | ||
* under the terms of the GNU Lesser General Public License version 2 or 3, | ||
* as published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* Authored by: William Wold <william.wold@canonical.com> | ||
*/ | ||
|
||
#ifndef MIR_GEOMETRY_DIMENSIONS_F_H_ | ||
#define MIR_GEOMETRY_DIMENSIONS_F_H_ | ||
|
||
#include "dimensions_generic.h" | ||
|
||
namespace mir | ||
{ | ||
namespace geometry | ||
{ | ||
using WidthF = generic::Width<float>; | ||
using HeightF = generic::Height<float>; | ||
using XF = generic::X<float>; | ||
using YF = generic::Y<float>; | ||
using DeltaXF = generic::DeltaX<float>; | ||
using DeltaYF = generic::DeltaY<float>; | ||
} | ||
} | ||
|
||
#endif // MIR_GEOMETRY_DIMENSIONS_F_H_ |
Oops, something went wrong.