6#ifndef EGT_WIDGETFLAGS_H
7#define EGT_WIDGETFLAGS_H
16#include <egt/bitfields.h>
17#include <egt/detail/enum.h>
18#include <egt/detail/meta.h>
30class HorizontalBitField;
31class VerticalBitField;
43 :
BitField(halign_mask, halign << halign_offset)
48 return static_cast<const BitField*
>(
this)->
operator==(rhs);
52 constexpr static const uint32_t halign_offset = 0;
53 constexpr static const uint32_t halign_mask = (0x3u << halign_offset);
74 :
BitField(valign_mask, valgin << valign_offset)
79 return static_cast<const BitField*
>(
this)->
operator==(rhs);
83 constexpr static const uint32_t valign_offset = 2;
84 constexpr static const uint32_t valign_mask = (0x3u << valign_offset);
110 return static_cast<const BitField*
>(
this)->
operator==(rhs);
114 constexpr static const uint32_t expand_offset = 4;
147 return static_cast<const BitField*
>(
this)->
operator==(rhs);
199 return static_cast<const BitField&
>(lhs).
operator | (rhs);
204 return static_cast<const BitField&
>(lhs).
operator | (rhs);
209 return static_cast<const BitField&
>(lhs).
operator | (rhs);
214 return static_cast<const BitField&
>(lhs).
operator | (rhs);
219 return static_cast<const BitField&
>(lhs).
operator | (rhs);
224 return static_cast<const BitField&
>(lhs).
operator | (rhs);
229 return static_cast<const BitField&
>(lhs).
operator | (rhs);
234 return static_cast<const BitField&
>(lhs).
operator | (rhs);
239 return static_cast<const BitField&
>(lhs).
operator | (rhs);
244 return static_cast<const BitField&
>(lhs).
operator | (rhs);
249 return static_cast<const BitField&
>(lhs).
operator | (rhs);
281 return static_cast<const BitField*
>(
this)->
operator==(rhs);
286 return static_cast<const BitField*
>(
this)->
operator==(rhs);
321 return static_cast<const BitField&
>(lhs).
operator | (rhs);
326 return static_cast<const BitField&
>(lhs).
operator | (rhs);
331 return static_cast<const BitField&
>(lhs).
operator | (rhs);
336 return static_cast<const BitField&
>(lhs).
operator | (rhs);
341 return static_cast<const BitField&
>(lhs).
operator | (rhs);
346 return static_cast<const BitField&
>(lhs).
operator | (rhs);
351 return static_cast<const BitField&
>(lhs).
operator | (rhs);
356 return static_cast<const BitField&
>(lhs).
operator | (rhs);
424const std::shared_ptr<T>&
center(
const std::shared_ptr<T>& widget)
433std::shared_ptr<T>&
center(std::shared_ptr<T>& widget)
450const std::shared_ptr<T>&
left(
const std::shared_ptr<T>& widget)
459std::shared_ptr<T>&
left(std::shared_ptr<T>& widget)
476const std::shared_ptr<T>&
right(
const std::shared_ptr<T>& widget)
485std::shared_ptr<T>&
right(std::shared_ptr<T>& widget)
502const std::shared_ptr<T>&
top(
const std::shared_ptr<T>& widget)
511std::shared_ptr<T>&
top(std::shared_ptr<T>& widget)
528const std::shared_ptr<T>&
bottom(
const std::shared_ptr<T>& widget)
537std::shared_ptr<T>&
bottom(std::shared_ptr<T>& widget)
606const std::shared_ptr<T>&
expand(
const std::shared_ptr<T>& widget)
615std::shared_ptr<T>&
expand(std::shared_ptr<T>& widget)
Definition widgetflags.h:253
constexpr bool equals(const AlignFlag &rhs) const
Definition widgetflags.h:284
constexpr AlignFlag(const VerticalBitField &field)
Definition widgetflags.h:259
static constexpr ExpandBitField expand
Definition widgetflags.h:301
friend constexpr AlignFlag operator|(const HorizontalBitField &lhs, const VExpandBitField &rhs)
Definition widgetflags.h:319
static constexpr HorizontalBitField center_horizontal
Definition widgetflags.h:289
static constexpr HorizontalBitField right
Definition widgetflags.h:291
static constexpr VerticalBitField bottom
Definition widgetflags.h:295
static constexpr HVBitField center
Definition widgetflags.h:297
static constexpr ExpandBitField expand_vertical
Definition widgetflags.h:300
constexpr bool operator==(const AlignFlag &rhs) const
Definition widgetflags.h:279
static constexpr VerticalBitField top
Definition widgetflags.h:294
constexpr AlignFlag(const HExpandBitField &field)
Definition widgetflags.h:271
constexpr AlignFlag(const ExpandBitField &field)
Definition widgetflags.h:263
static constexpr ExpandBitField expand_horizontal
Definition widgetflags.h:299
constexpr AlignFlag(const HorizontalBitField &field)
Definition widgetflags.h:255
constexpr AlignFlag(const VExpandBitField &field)
Definition widgetflags.h:275
static constexpr VerticalBitField center_vertical
Definition widgetflags.h:293
constexpr AlignFlag(const HVBitField &field)
Definition widgetflags.h:267
static constexpr HorizontalBitField left
Definition widgetflags.h:290
Alignment flags.
Definition widgetflags.h:379
constexpr AlignFlags(const ExpandBitField &field)
Definition widgetflags.h:391
constexpr AlignFlags(const VerticalBitField &field)
Definition widgetflags.h:387
constexpr AlignFlags(const BitFields< AlignFlag > &base)
Definition widgetflags.h:407
constexpr AlignFlags(const HExpandBitField &field)
Definition widgetflags.h:399
constexpr AlignFlags(const VExpandBitField &field)
Definition widgetflags.h:403
constexpr AlignFlags(const HorizontalBitField &field)
Definition widgetflags.h:383
constexpr AlignFlags(const HVBitField &field)
Definition widgetflags.h:395
Definition bitfields.h:31
Definition bitfields.h:65
constexpr BitFields() noexcept=default
Definition widgetflags.h:102
constexpr bool operator==(const ExpandBitField &rhs) const
Definition widgetflags.h:108
constexpr ExpandBitField(uint32_t expand)
Definition widgetflags.h:104
friend constexpr ExpandBitField operator|(const ExpandBitField &lhs, const ExpandBitField &rhs)
Definition widgetflags.h:197
Definition widgetflags.h:164
friend constexpr HExpandBitField operator|(const HorizontalBitField &lhs, const ExpandBitField &rhs)
Definition widgetflags.h:212
Definition widgetflags.h:138
constexpr bool operator==(const HVBitField &rhs) const
Definition widgetflags.h:145
constexpr HVBitField(uint32_t halign, uint32_t valign)
Definition widgetflags.h:140
friend constexpr HVBitField operator|(const HorizontalBitField &lhs, const VerticalBitField &rhs)
Definition widgetflags.h:202
Definition widgetflags.h:40
constexpr HorizontalBitField(uint32_t halign)
Definition widgetflags.h:42
friend constexpr HVBitField operator|(const HorizontalBitField &lhs, const VerticalBitField &rhs)
Definition widgetflags.h:202
constexpr bool operator==(const HorizontalBitField &rhs) const
Definition widgetflags.h:46
Definition widgetflags.h:181
friend constexpr VExpandBitField operator|(const VerticalBitField &lhs, const ExpandBitField &rhs)
Definition widgetflags.h:232
Definition widgetflags.h:71
constexpr VerticalBitField(uint32_t valgin)
Definition widgetflags.h:73
constexpr bool operator==(const VerticalBitField &rhs) const
Definition widgetflags.h:77
friend constexpr HVBitField operator|(const HorizontalBitField &lhs, const VerticalBitField &rhs)
Definition widgetflags.h:202
constexpr T bit(T n)
Utility to create a bit mask for the specified bit.
Definition meta.h:306
Justification
Generic justification of children flags.
Definition widgetflags.h:667
T & align(T &widget, const AlignFlags &a)
Helper to set alignment of a widget.
Definition widgetflags.h:624
WindowHint
Hint used for configuring Window backends.
Definition widgetflags.h:683
@ heo_overlay
Request specifically an HEO overlay plane.
@ automatic
Allow automatic detection of the window type to create.
@ overlay
Request an overlay plane.
@ cursor_overlay
Request a cursor overlay plane.
@ software
Request a software only implementation.
T & top(T &widget)
Helper to set alignment of a widget.
Definition widgetflags.h:494
T & right(T &widget)
Helper to set alignment of a widget.
Definition widgetflags.h:468
T & expand(T &widget)
Helper to set alignment of a widget.
Definition widgetflags.h:598
T & expand_horizontal(T &widget)
Helper to set alignment of a widget.
Definition widgetflags.h:546
T & expand_vertical(T &widget)
Helper to set alignment of a widget.
Definition widgetflags.h:572
T & left(T &widget)
Helper to set alignment of a widget.
Definition widgetflags.h:442
EGT_API std::ostream & operator<<(std::ostream &os, const Color &color)
Overloaded std::ostream insertion operator.
std::list< T > get(const BitFields< T > &fields)
T & center(T &widget)
Helper to set alignment of a widget.
Definition widgetflags.h:416
T & bottom(T &widget)
Helper to set alignment of a widget.
Definition widgetflags.h:520
Orientation
Generic orientation flags.
Definition widgetflags.h:652
Theme::BorderFlags operator|(Theme::BorderFlag lhs, Theme::BorderFlag rhs)
BorderFlags operator.
Definition theme.h:369
EGT framework namespace.
Definition animation.h:24
When using enum_to_string() and enum_from_string(), this type needs to be defined and specialized to ...
Definition enum.h:48