CYD-UI
A C++ library for building native graphic user interfaces
Loading...
Searching...
No Matches
component_macros.h File Reference
#include <SDL3/SDL_keycode.h>
#include <cyd_fabric_modules/headers/macros/async_events.h>
#include "./component_event_macros.h"
+ Include dependency graph for component_macros.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define STATE
 
#define EXTENDS(...)
 
#define COMPONENT_DECL(NAME, ...)
 
#define COMPONENT_IMPL(NAME)
 
#define COMPONENT(NAME, ...)
 
#define TCOMPONENT(NAME, ...)
 
#define CYDUI_INTERNAL_EV_HANDLER_IMPL(NAME)
 
#define CYDUI_INTERNAL_EV_HANDLER_IMPL_W_RET(NAME)
 
#define ON_REDRAW   CYDUI_INTERNAL_EV_HANDLER_IMPL_W_RET(redraw)
 
#define CHILDREN   CYDUI_INTERNAL_EV_HANDLER_IMPL_W_RET(redraw)
 
#define ON_BUTTON_PRESS   CYDUI_INTERNAL_EV_HANDLER_IMPL(button_press)
 
#define ON_BUTTON_RELEASE   CYDUI_INTERNAL_EV_HANDLER_IMPL(button_release)
 
#define ON_MOUSE_ENTER   CYDUI_INTERNAL_EV_HANDLER_IMPL(mouse_enter)
 
#define ON_MOUSE_EXIT   CYDUI_INTERNAL_EV_HANDLER_IMPL(mouse_exit)
 
#define ON_MOUSE_MOTION   CYDUI_INTERNAL_EV_HANDLER_IMPL(mouse_motion)
 
#define ON_SCROLL   CYDUI_INTERNAL_EV_HANDLER_IMPL(scroll)
 
#define ON_KEY_PRESS   CYDUI_INTERNAL_EV_HANDLER_IMPL(key_press)
 
#define ON_KEY_RELEASE   CYDUI_INTERNAL_EV_HANDLER_IMPL(key_release)
 
#define ON_FOCUS_CHANGED   CYDUI_INTERNAL_EV_HANDLER_IMPL(focus_changed)
 
#define ON_TEXT_INPUT
 
#define ON_EVENT(EVENT, ...)
 
#define FRAGMENT   void draw_fragment CYDUI_INTERNAL_EV_fragment_ARGS
 
#define SIGNAL(NAME, ...)
 
#define ATTRIBUTE(NAME, ...)
 
#define STYLE   struct style_type: cydui::components::style_base_t
 
#define ANONYMOUS_STRUCT(...)
 ANIMATIONS.
 
#define KEYFRAME(POS, ...)
 
#define AUTO_KEYFRAME(POS, ...)
 

Macro Definition Documentation

◆ ANONYMOUS_STRUCT

#define ANONYMOUS_STRUCT ( ...)
Value:
decltype([&] { \
struct _anon_ __VA_ARGS__; \
return _anon_{}; \
}())

ANIMATIONS.

Definition at line 169 of file component_macros.h.

◆ ATTRIBUTE

#define ATTRIBUTE ( NAME,
... )
Value:
public: \
auto& NAME(const __VA_ARGS__& value) { \
NAME##_ = value; \
return *this; \
} \
\
private: \
__VA_ARGS__ NAME##_

Definition at line 154 of file component_macros.h.

◆ AUTO_KEYFRAME

#define AUTO_KEYFRAME ( POS,
... )
Value:
#define ANONYMOUS_STRUCT(...)
static keyframe make(float position, PropertiesType value={})

Definition at line 176 of file component_macros.h.

◆ CHILDREN

#define CHILDREN   CYDUI_INTERNAL_EV_HANDLER_IMPL_W_RET(redraw)

Definition at line 115 of file component_macros.h.

◆ COMPONENT

#define COMPONENT ( NAME,
... )
Value:
COMPONENT_DECL(NAME, __VA_ARGS__); \
COMPONENT_IMPL(NAME)
#define COMPONENT_DECL(NAME,...)

Definition at line 63 of file component_macros.h.

◆ COMPONENT_DECL

#define COMPONENT_DECL ( NAME,
... )

Definition at line 19 of file component_macros.h.

◆ COMPONENT_IMPL

#define COMPONENT_IMPL ( NAME)
Value:

Definition at line 60 of file component_macros.h.

◆ CYDUI_INTERNAL_EV_HANDLER_IMPL

#define CYDUI_INTERNAL_EV_HANDLER_IMPL ( NAME)
Value:
void on_##NAME CYDUI_INTERNAL_EV_##NAME##_ARGS

Definition at line 109 of file component_macros.h.

◆ CYDUI_INTERNAL_EV_HANDLER_IMPL_W_RET

#define CYDUI_INTERNAL_EV_HANDLER_IMPL_W_RET ( NAME)
Value:
CYDUI_INTERNAL_EV_##NAME##_RETURN on_##NAME CYDUI_INTERNAL_EV_##NAME##_ARGS

Definition at line 111 of file component_macros.h.

◆ EXTENDS

#define EXTENDS ( ...)
Value:
, __VA_ARGS__

Definition at line 17 of file component_macros.h.

◆ FRAGMENT

#define FRAGMENT   void draw_fragment CYDUI_INTERNAL_EV_fragment_ARGS

Definition at line 142 of file component_macros.h.

◆ KEYFRAME

#define KEYFRAME ( POS,
... )
Value:
cydui::keyframe::make(POS, __VA_ARGS__)

Definition at line 175 of file component_macros.h.

◆ ON_BUTTON_PRESS

#define ON_BUTTON_PRESS   CYDUI_INTERNAL_EV_HANDLER_IMPL(button_press)

Definition at line 116 of file component_macros.h.

◆ ON_BUTTON_RELEASE

#define ON_BUTTON_RELEASE   CYDUI_INTERNAL_EV_HANDLER_IMPL(button_release)

Definition at line 117 of file component_macros.h.

◆ ON_EVENT

#define ON_EVENT ( EVENT,
... )
Value:
&this->window, \
[&](const EVENT& event) -> fabric::task<> { \
__VA_ARGS__; \
co_return; \
}, \
[&]() -> fabric::task<> { \
this->state.force_redraw(); \
co_return; \
} \
};
EVENT(RedrawEvent)

Definition at line 129 of file component_macros.h.

◆ ON_FOCUS_CHANGED

#define ON_FOCUS_CHANGED   CYDUI_INTERNAL_EV_HANDLER_IMPL(focus_changed)

Definition at line 124 of file component_macros.h.

◆ ON_KEY_PRESS

#define ON_KEY_PRESS   CYDUI_INTERNAL_EV_HANDLER_IMPL(key_press)

Definition at line 122 of file component_macros.h.

◆ ON_KEY_RELEASE

#define ON_KEY_RELEASE   CYDUI_INTERNAL_EV_HANDLER_IMPL(key_release)

Definition at line 123 of file component_macros.h.

◆ ON_MOUSE_ENTER

#define ON_MOUSE_ENTER   CYDUI_INTERNAL_EV_HANDLER_IMPL(mouse_enter)

Definition at line 118 of file component_macros.h.

◆ ON_MOUSE_EXIT

#define ON_MOUSE_EXIT   CYDUI_INTERNAL_EV_HANDLER_IMPL(mouse_exit)

Definition at line 119 of file component_macros.h.

◆ ON_MOUSE_MOTION

#define ON_MOUSE_MOTION   CYDUI_INTERNAL_EV_HANDLER_IMPL(mouse_motion)

Definition at line 120 of file component_macros.h.

◆ ON_REDRAW

#define ON_REDRAW   CYDUI_INTERNAL_EV_HANDLER_IMPL_W_RET(redraw)

Definition at line 114 of file component_macros.h.

◆ ON_SCROLL

#define ON_SCROLL   CYDUI_INTERNAL_EV_HANDLER_IMPL(scroll)

Definition at line 121 of file component_macros.h.

◆ ON_TEXT_INPUT

#define ON_TEXT_INPUT
Value:
static constexpr bool handles_text_input = true; \
CYDUI_INTERNAL_EV_HANDLER_IMPL(text_input)

Definition at line 125 of file component_macros.h.

◆ SIGNAL

#define SIGNAL ( NAME,
... )
Value:
private: \
fabric::wiring::signal<__VA_ARGS__> NAME{}; \
\
public: \
auto& on_##NAME(auto&& fun) { \
NAME.connect(fun); \
return *this; \
}

Definition at line 144 of file component_macros.h.

◆ STATE

#define STATE
Value:

Definition at line 11 of file component_macros.h.

◆ STYLE

#define STYLE   struct style_type: cydui::components::style_base_t

Definition at line 164 of file component_macros.h.

◆ TCOMPONENT

#define TCOMPONENT ( NAME,
... )

Definition at line 68 of file component_macros.h.