MCRO
C++23 utilities for Unreal Engine.
Loading...
Searching...
No Matches
Mcro::Slate Namespace Reference

Data Structures

struct  TArgumentsOf_S
 
struct  TArgumentsOf_S< T >
 
struct  TSlots
 

Concepts

concept  CWidget
 
concept  CSlot
 
concept  CWidgetOrSlot
 
concept  CWidgetOrSlotArguments
 
concept  CWidgetArguments
 
concept  CSlotArguments
 
concept  CWidgetWithSlots
 

Typedefs

template<typename T >
using TArgumentsOf = typename TArgumentsOf_S<T>::Type
 
template<CWidgetOrSlot T>
using TAttributeBlock = TUniqueFunction<TArgumentsOf<T>&(TArgumentsOf<T>&)>
 
template<CWidgetOrSlot T>
using TAttributeBlockCopyable = TFunction<TArgumentsOf<T>&(TArgumentsOf<T>&)>
 

Functions

template<CWidgetOrSlotArguments Arguments, CFunctionLike AttrBlock>
requires ( TFunction_ArgCount<AttrBlock> == 1 && CSameAs<Arguments&, TFunction_Arg<AttrBlock, 0>> )
TFunction_Return< AttrBlock > operator/ (Arguments &args, const AttrBlock &attributes)
 
template<CWidgetOrSlotArguments Arguments, CFunctionLike AttrBlock>
requires ( TFunction_ArgCount<AttrBlock> == 1 && CSameAs<Arguments&, TFunction_Arg<AttrBlock, 0>> )
TFunction_Return< AttrBlock > operator/ (Arguments &&args, const AttrBlock &attributes)
 
template<CRange Range, CFunctionLike Transform, CFunctionLike OnEmpty, CSlotArguments SlotArguments, CWidgetArguments Arguments>
Arguments & operator+ (Arguments &args, TSlots< Range, Transform, OnEmpty, SlotArguments > &&slots)
 
MCRO_API EVisibility IsVisible (bool visible, EVisibility hiddenState=EVisibility::Collapsed)
 

Variables

template<CWidgetOrSlot T>
TAttributeBlock< T > InertAttributeBlock = [](TArgumentsOf<T>& args) -> auto& { return args; }
 

Detailed Description

Extra functionalities for general Slate programming chores, including enhancements of the Slate declarative syntax

Typedef Documentation

◆ TArgumentsOf

template<typename T >
using Mcro::Slate::TArgumentsOf = typename TArgumentsOf_S<T>::Type

Get the type of arguments from either a widget or a slot type (FArguments or FSlotArguments)

Definition at line 75 of file Slate.h.

◆ TAttributeBlock

template<CWidgetOrSlot T>
using Mcro::Slate::TAttributeBlock = TUniqueFunction<TArgumentsOf<T>&(TArgumentsOf<T>&)>

Alias for an attribute block function which takes in reference of FArguments or FSlotArguments and returns the same reference but presumably setting some Slate attributes before that. This is useful for modularizing the Slate declarative syntax.

Definition at line 83 of file Slate.h.

◆ TAttributeBlockCopyable

template<CWidgetOrSlot T>
using Mcro::Slate::TAttributeBlockCopyable = TFunction<TArgumentsOf<T>&(TArgumentsOf<T>&)>

Same as TAttributeBlock but allows to make copies of the functor

Definition at line 87 of file Slate.h.

Function Documentation

◆ IsVisible()

MCRO_API EVisibility Mcro::Slate::IsVisible ( bool visible,
EVisibility hiddenState = EVisibility::Collapsed )

◆ operator+()

template<CRange Range, CFunctionLike Transform, CFunctionLike OnEmpty, CSlotArguments SlotArguments, CWidgetArguments Arguments>
Arguments & Mcro::Slate::operator+ ( Arguments & args,
TSlots< Range, Transform, OnEmpty, SlotArguments > && slots )

Definition at line 232 of file Slate.h.

◆ operator/() [1/2]

template<CWidgetOrSlotArguments Arguments, CFunctionLike AttrBlock>
requires ( TFunction_ArgCount<AttrBlock> == 1 && CSameAs<Arguments&, TFunction_Arg<AttrBlock, 0>> )
TFunction_Return< AttrBlock > Mcro::Slate::operator/ ( Arguments && args,
const AttrBlock & attributes )

The "append attribute block" operator which allows pre-defined "blocks of slate attributes" naturally fit inside the Slate declarative syntax. Traditionally repeated structures in Slate were expressed as either explicit mutations on widgets after they were created or as entirely separate compound widgets. Either way breaks the flow of the declarative syntax and makes using Slate sometimes pretty clunky. This operator aims to make widget composition more comfortable.

Template Parameters
ArgumentsRight hand side FArguments or FSlotArguments
AttrBlockThe type of the attribute block function
Parameters
argsr-value reference right hand side FArguments or FSlotArguments
attributesAn attribute block function
Returns
The same reference as args or a new slot if that has been added inside the attribute block

Definition at line 134 of file Slate.h.

◆ operator/() [2/2]

template<CWidgetOrSlotArguments Arguments, CFunctionLike AttrBlock>
requires ( TFunction_ArgCount<AttrBlock> == 1 && CSameAs<Arguments&, TFunction_Arg<AttrBlock, 0>> )
TFunction_Return< AttrBlock > Mcro::Slate::operator/ ( Arguments & args,
const AttrBlock & attributes )

The "append attribute block" operator which allows pre-defined "blocks of slate attributes" naturally fit inside the Slate declarative syntax. Traditionally repeated structures in Slate were expressed as either explicit mutations on widgets after they were created or as entirely separate compound widgets. Either way breaks the flow of the declarative syntax and makes using Slate sometimes pretty clunky. This operator aims to make widget composition more comfortable.

Template Parameters
ArgumentsRight hand side FArguments or FSlotArguments
AttrBlockThe type of the attribute block function
Parameters
argsl-value reference right hand side FArguments or FSlotArguments
attributesAn attribute block function
Returns
The same reference as args or a new slot if that has been added inside the attribute block

Definition at line 111 of file Slate.h.

Variable Documentation

◆ InertAttributeBlock

template<CWidgetOrSlot T>
TAttributeBlock<T> Mcro::Slate::InertAttributeBlock = [](TArgumentsOf<T>& args) -> auto& { return args; }

An attribute block which does nothing

Definition at line 91 of file Slate.h.