wiRedPanda
Logic Circuit Simulator
Loading...
Searching...
No Matches
ElementMetadata Struct Reference

Compile-time-registered properties for one element type. More...

#include <ElementMetadata.h>

Public Attributes

QStringList alternativeAppearances
 User-selectable alternative appearance paths.
bool canChangeAppearance = false
 True if the user can choose a custom appearance.
QStringList defaultAppearances
 Built-in appearance resource paths.
ElementGroup group = ElementGroup::Unknown
 UI palette group this element belongs to.
bool hasAudio = false
 True if the element supports audio output.
bool hasAudioBox = false
 True if the element shows an audio selection box.
bool hasColors = false
 True if the element supports color selection.
bool hasDelay = false
 True if the element exposes a configurable clock phase delay.
bool hasFrequency = false
 True if the element exposes a configurable clock frequency.
bool hasLabel = false
 True if the element supports a user-editable label.
bool hasTrigger = false
 True if the element supports a keyboard trigger shortcut.
bool hasTruthTable = false
 True if the element has an editable truth table.
bool hasVolume = false
 True if the element supports volume control.
quint64 maxInputSize = 0
 Maximum number of input ports.
quint64 maxOutputSize = 0
 Maximum number of output ports.
quint64 minInputSize = 0
 Minimum number of input ports.
quint64 minOutputSize = 0
 Minimum number of output ports.
std::function< QString()> pixmapPath
 Callable returning the default pixmap resource path (lazily evaluated).
bool rotatesGraphic = true
 True if rotating/flipping re-orients the graphic itself; false keeps the icon fixed and only repositions ports.
const char * titleText = nullptr
 Untranslated title shown in the element palette (QT_TRANSLATE_NOOP).
const char * translatedName = nullptr
 Untranslated element name used for tooltips (QT_TRANSLATE_NOOP).
const char * trContext = nullptr
 Translation context string for QCoreApplication::translate().
ElementType type = ElementType::Unknown
 Unique element type identifier.

Detailed Description

Compile-time-registered properties for one element type.

Each element .cpp registers one instance via an ElementInfo<T> specialization. All fields are populated at static-initialization time (before QApplication) except pixmapPath, which is a callable invoked lazily at construction time.

Definition at line 27 of file ElementMetadata.h.

Member Data Documentation

◆ alternativeAppearances

QStringList ElementMetadata::alternativeAppearances

User-selectable alternative appearance paths.

Definition at line 48 of file ElementMetadata.h.

Referenced by GraphicElement::GraphicElement().

◆ canChangeAppearance

bool ElementMetadata::canChangeAppearance = false

True if the user can choose a custom appearance.

Definition at line 52 of file ElementMetadata.h.

Referenced by metadataFromConstraints().

◆ defaultAppearances

QStringList ElementMetadata::defaultAppearances

Built-in appearance resource paths.

Definition at line 47 of file ElementMetadata.h.

Referenced by GraphicElement::GraphicElement().

◆ group

ElementGroup ElementMetadata::group = ElementGroup::Unknown

UI palette group this element belongs to.

Definition at line 29 of file ElementMetadata.h.

Referenced by GraphicElement::GraphicElement(), and metadataFromConstraints().

◆ hasAudio

bool ElementMetadata::hasAudio = false

True if the element supports audio output.

Definition at line 54 of file ElementMetadata.h.

Referenced by metadataFromConstraints().

◆ hasAudioBox

bool ElementMetadata::hasAudioBox = false

True if the element shows an audio selection box.

Definition at line 55 of file ElementMetadata.h.

Referenced by metadataFromConstraints().

◆ hasColors

bool ElementMetadata::hasColors = false

True if the element supports color selection.

Definition at line 53 of file ElementMetadata.h.

Referenced by GraphicElement::GraphicElement(), and metadataFromConstraints().

◆ hasDelay

bool ElementMetadata::hasDelay = false

True if the element exposes a configurable clock phase delay.

Definition at line 58 of file ElementMetadata.h.

Referenced by metadataFromConstraints().

◆ hasFrequency

bool ElementMetadata::hasFrequency = false

True if the element exposes a configurable clock frequency.

Definition at line 57 of file ElementMetadata.h.

Referenced by metadataFromConstraints().

◆ hasLabel

bool ElementMetadata::hasLabel = false

True if the element supports a user-editable label.

Definition at line 59 of file ElementMetadata.h.

Referenced by GraphicElement::GraphicElement(), and metadataFromConstraints().

◆ hasTrigger

bool ElementMetadata::hasTrigger = false

True if the element supports a keyboard trigger shortcut.

Definition at line 56 of file ElementMetadata.h.

Referenced by metadataFromConstraints().

◆ hasTruthTable

bool ElementMetadata::hasTruthTable = false

True if the element has an editable truth table.

Definition at line 60 of file ElementMetadata.h.

Referenced by metadataFromConstraints().

◆ hasVolume

bool ElementMetadata::hasVolume = false

True if the element supports volume control.

Definition at line 61 of file ElementMetadata.h.

Referenced by metadataFromConstraints().

◆ maxInputSize

quint64 ElementMetadata::maxInputSize = 0

Maximum number of input ports.

Definition at line 41 of file ElementMetadata.h.

Referenced by GraphicElement::GraphicElement(), and metadataFromConstraints().

◆ maxOutputSize

quint64 ElementMetadata::maxOutputSize = 0

Maximum number of output ports.

Definition at line 43 of file ElementMetadata.h.

Referenced by GraphicElement::GraphicElement(), and metadataFromConstraints().

◆ minInputSize

quint64 ElementMetadata::minInputSize = 0

Minimum number of input ports.

Definition at line 40 of file ElementMetadata.h.

Referenced by GraphicElement::GraphicElement(), and metadataFromConstraints().

◆ minOutputSize

quint64 ElementMetadata::minOutputSize = 0

Minimum number of output ports.

Definition at line 42 of file ElementMetadata.h.

Referenced by GraphicElement::GraphicElement(), and metadataFromConstraints().

◆ pixmapPath

std::function<QString()> ElementMetadata::pixmapPath

Callable returning the default pixmap resource path (lazily evaluated).

Definition at line 33 of file ElementMetadata.h.

Referenced by GraphicElement::GraphicElement(), and ElementFactory::pixmap().

◆ rotatesGraphic

bool ElementMetadata::rotatesGraphic = true

True if rotating/flipping re-orients the graphic itself; false keeps the icon fixed and only repositions ports.

Definition at line 62 of file ElementMetadata.h.

Referenced by metadataFromConstraints().

◆ titleText

const char* ElementMetadata::titleText = nullptr

Untranslated title shown in the element palette (QT_TRANSLATE_NOOP).

Definition at line 34 of file ElementMetadata.h.

Referenced by GraphicElement::GraphicElement().

◆ translatedName

const char* ElementMetadata::translatedName = nullptr

Untranslated element name used for tooltips (QT_TRANSLATE_NOOP).

Definition at line 35 of file ElementMetadata.h.

Referenced by GraphicElement::GraphicElement().

◆ trContext

const char* ElementMetadata::trContext = nullptr

Translation context string for QCoreApplication::translate().

Definition at line 36 of file ElementMetadata.h.

Referenced by GraphicElement::GraphicElement().

◆ type

ElementType ElementMetadata::type = ElementType::Unknown

Unique element type identifier.

Definition at line 28 of file ElementMetadata.h.

Referenced by metadataFromConstraints(), and ElementMetadataRegistry::registerMetadata().


The documentation for this struct was generated from the following file: