Make UEFI boot-platform build again
[haiku.git] / headers / os / interface / Alignment.h
blob76dc30ef81255dd7b64c4f7265ff8f418a071341
1 /*
2 * Copyright 2006, Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef _ALIGNMENT_H
6 #define _ALIGNMENT_H
8 #include <InterfaceDefs.h>
10 class BAlignment {
11 public:
12 alignment horizontal;
13 vertical_alignment vertical;
15 inline BAlignment();
16 inline BAlignment(const BAlignment& other);
17 inline BAlignment(alignment horizontal,
18 vertical_alignment vertical);
20 inline alignment Horizontal() const;
21 inline vertical_alignment Vertical() const;
23 float RelativeHorizontal() const;
24 float RelativeVertical() const;
26 inline void SetHorizontal(alignment horizontal);
27 inline void SetVertical(vertical_alignment vertical);
29 inline bool IsHorizontalSet() const;
30 inline bool IsVerticalSet() const;
32 inline bool operator==(const BAlignment& other) const;
33 inline bool operator!=(const BAlignment& other) const;
35 inline BAlignment& operator=(const BAlignment& other);
39 // constructor
40 inline
41 BAlignment::BAlignment()
42 : horizontal(B_ALIGN_HORIZONTAL_UNSET),
43 vertical(B_ALIGN_VERTICAL_UNSET)
47 // copy constructor
48 inline
49 BAlignment::BAlignment(const BAlignment& other)
50 : horizontal(other.horizontal),
51 vertical(other.vertical)
55 // constructor
56 inline
57 BAlignment::BAlignment(alignment horizontal, vertical_alignment vertical)
58 : horizontal(horizontal),
59 vertical(vertical)
63 // Horizontal
64 inline alignment
65 BAlignment::Horizontal() const
67 return horizontal;
70 // Vertical
71 inline vertical_alignment
72 BAlignment::Vertical() const
74 return vertical;
77 // SetHorizontal
78 inline void
79 BAlignment::SetHorizontal(alignment horizontal)
81 this->horizontal = horizontal;
84 // SetVertical
85 inline void
86 BAlignment::SetVertical(vertical_alignment vertical)
88 this->vertical = vertical;
91 // IsHorizontalSet
92 inline bool
93 BAlignment::IsHorizontalSet() const
95 return (horizontal != B_ALIGN_HORIZONTAL_UNSET);
98 // IsVerticalSet
99 inline bool
100 BAlignment::IsVerticalSet() const
102 return (vertical != B_ALIGN_VERTICAL_UNSET);
105 // ==
106 inline bool
107 BAlignment::operator==(const BAlignment& other) const
109 return (horizontal == other.horizontal && vertical == other.vertical);
112 // !=
113 inline bool
114 BAlignment::operator!=(const BAlignment& other) const
116 return !(*this == other);
119 // =
120 inline BAlignment&
121 BAlignment::operator=(const BAlignment& other)
123 horizontal = other.horizontal;
124 vertical = other.vertical;
125 return *this;
128 #endif // _ALIGNMENT_H