Mir
dimensions.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2012, 2016 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU Lesser General Public License version 2 or 3,
6  * as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Alan Griffiths <alan@octopull.co.uk>
17  */
18 
19 #ifndef MIR_GEOMETRY_DIMENSIONS_H_
20 #define MIR_GEOMETRY_DIMENSIONS_H_
21 
22 #include "dimensions_generic.h"
23 
24 #include <cstdint>
25 
26 namespace mir
27 {
30 namespace geometry
31 {
32 namespace detail
33 {
34 template<typename Tag>
35 class IntWrapper : public generic::Value<int>::Wrapper<Tag>
36 {
37 public:
38  template<typename OtherTag>
40 
42 
43  constexpr IntWrapper() {}
44 
45  constexpr uint32_t as_uint32_t() const // TODO: Deprecate this later
46  {
47  return (uint32_t)this->value;
48  }
49 };
50 } // namespace detail
51 
54 // Just to be clear, mir::geometry::Stride is the stride of the buffer in bytes
56 
61 }
62 }
63 
64 #endif /* MIR_GEOMETRY_DIMENSIONS_H_ */
Definition: dimensions.h:36
constexpr IntWrapper()
Definition: dimensions.h:43
constexpr uint32_t as_uint32_t() const
Definition: dimensions.h:45
detail::IntWrapper< DeltaYTag > DeltaY
Definition: dimensions.h:60
detail::IntWrapper< struct StrideTag > Stride
Definition: dimensions.h:55
detail::IntWrapper< YTag > Y
Definition: dimensions.h:58
detail::IntWrapper< DeltaXTag > DeltaX
Definition: dimensions.h:59
detail::IntWrapper< XTag > X
Definition: dimensions.h:57
detail::IntWrapper< HeightTag > Height
Definition: dimensions.h:53
detail::IntWrapper< WidthTag > Width
Definition: dimensions.h:52
Definition: splash_session.h:24
Wraps a geometry value and prevents it from being accidentally used for invalid operations (such as s...
Definition: dimensions_generic.h:60
T value
Definition: dimensions_generic.h:133
constexpr Wrapper() noexcept
Definition: dimensions_generic.h:77
Definition: dimensions_generic.h:53

Copyright © 2012-2022 Canonical Ltd.
Generated on Thu Mar 3 22:46:49 UTC 2022
This documentation is licensed under the GPL version 2 or 3.