CYD-UI
A C++ library for building native graphic user interfaces
Loading...
Searching...
No Matches
component_types.cppm
Go to the documentation of this file.
1// Copyright (c) 2024, Víctor Castillo Agüero.
2// SPDX-License-Identifier: GPL-3.0-or-later
3
4export module cydui.components:type;
5
6import std;
7
8export import reflect;
9export import quantify;
10
11export import cydui.dimensions;
12
13export namespace cydui::components {
14 template<std::size_t N>
15 struct str_literal_t {
16 constexpr str_literal_t(const char (& str)[N]) {
17 std::copy_n(str, N, value);
18 }
19
20 char value[N];
21 };
22
23
25 using dimension_parameter_t = dimensions::parameter<dimensions::screen_measure>;
27
28 struct component_state_t;
29 using component_state_ref = std::shared_ptr<component_state_t>;
30 struct component_base_t;
31 struct event_handler_t;
32
33 template <typename EVH>
35 requires(EVH evh) { std::is_base_of_v<event_handler_t, EVH>; };
36
37 template <typename T>
38 struct component_t;
39
40 template <typename C>
41 concept ComponentConcept = requires(C c) {
42 requires std::
43 derived_from<std::remove_reference_t<C>, component_t<C>>;
44 typename C::props_t;
45 typename C::state_t;
46 typename C::event_handler_t;
47 };
48
49 struct internal_relations_t {
54 };
55
61 bool& fixed_w;
62 bool& fixed_h;
63
68
73
78 };
79} // namespace cydui::components
dimensions::context< dimensions::screen_measure > dimension_ctx_t
std::shared_ptr< component_state_t > component_state_ref
dimensions::dimension< dimensions::screen_measure > dimension_t
dimensions::parameter< dimensions::screen_measure > dimension_parameter_t
dimensions::dimension< dimensions::screen_measure > dimension_t
Definition @index.cppm:15
constexpr str_literal_t(const char(&str)[N])