Simulant  21.12-1292
A portable game engine for Windows, OSX, Linux, Dreamcast, and PSP
Public Member Functions | List of all members
smlt::ui::Keyboard Class Reference
Inheritance diagram for smlt::ui::Keyboard:
smlt::ui::Widget smlt::ContainerNode smlt::HasMutableRenderPriority smlt::ChainNameable< Widget > smlt::StageNode smlt::Nameable smlt::Loadable smlt::TransformListener smlt::TwoPhaseConstructed smlt::BoundableEntity smlt::Updateable smlt::Printable smlt::Nameable smlt::DestroyableObject smlt::generic::Identifiable< StageNodeID >

Public Member Functions

 S_DEFINE_STAGE_NODE_META (STAGE_NODE_TYPE_WIDGET_KEYBOARD, "keyboard")
 
 S_DEFINE_STAGE_NODE_PARAM (Keyboard, "mode", int, int(KEYBOARD_MODE_UPPERCASE), "The mode of the keyboard")
 
 S_DEFINE_CORE_WIDGET_PROPERTIES (Keyboard)
 
 Keyboard (Scene *owner)
 
void cursor_up ()
 
void cursor_down ()
 
void cursor_right ()
 
void cursor_left ()
 
bool cursor_to_char (uint16_t displayed_char)
 
void cursor_to_return ()
 
void cursor_to_case_toggle ()
 
void cursor_to_backspace ()
 
void cursor_to_ok ()
 
void cursor_to_space ()
 
void activate ()
 
void cancel ()
 
void set_mode (KeyboardMode mode)
 
KeyboardMode mode () const
 
bool is_keyboard_integration_enabled () const
 
void set_keyboard_integration_enabled (bool value)
 
void set_font (FontPtr font) override
 
TextEntryentry ()
 
void set_font (const std::string &family=DEFAULT_FONT_FAMILY, Rem size=Rem(1.0f), FontWeight weight=FONT_WEIGHT_NORMAL, FontStyle style=FONT_STYLE_NORMAL)
 
void set_font (const std::string &family=DEFAULT_FONT_FAMILY, Px size=DEFAULT_FONT_SIZE, FontWeight weight=FONT_WEIGHT_NORMAL, FontStyle style=FONT_STYLE_NORMAL)
 
virtual void set_font (FontPtr font)
 
- Public Member Functions inherited from smlt::ui::Widget
 Widget (Scene *owner, StageNodeType type)
 
virtual bool on_init () override
 
virtual void on_clean_up () override
 
bool on_create (Params params) override
 
void resize (Rem width, Px height)
 
void resize (Px width, Rem height)
 
void resize (Rem width, Rem height)
 
void resize (Px width, Px height)
 
void set_font (const std::string &family=DEFAULT_FONT_FAMILY, Rem size=Rem(1.0f), FontWeight weight=FONT_WEIGHT_NORMAL, FontStyle style=FONT_STYLE_NORMAL)
 
void set_font (const std::string &family=DEFAULT_FONT_FAMILY, Px size=DEFAULT_FONT_SIZE, FontWeight weight=FONT_WEIGHT_NORMAL, FontStyle style=FONT_STYLE_NORMAL)
 
bool is_focused () const
 
void set_focus_previous (WidgetPtr previous_widget)
 
void set_focus_next (WidgetPtr next_widget)
 
void focus ()
 
void blur ()
 
WidgetPtr next_in_focus_chain () const
 
WidgetPtr previous_in_focus_chain () const
 
void focus_next_in_chain (ChangeFocusBehaviour behaviour=FOCUS_THIS_IF_NONE_FOCUSED)
 
void focus_previous_in_chain (ChangeFocusBehaviour behaviour=FOCUS_THIS_IF_NONE_FOCUSED)
 
WidgetPtr first_in_focus_chain ()
 
WidgetPtr last_in_focus_chain ()
 
WidgetPtr focused_in_chain ()
 
void click ()
 
void set_text (const unicode &text)
 
void set_text_alignment (TextAlignment alignment)
 
TextAlignment text_alignment () const
 
void set_border_width (Px x)
 
Px border_width () const
 
void set_border_radius (Px x)
 
Px border_radius () const
 
void set_border_color (const Color &color)
 
void set_overflow (OverflowType type)
 
void set_padding (Px x)
 
void set_padding (Px left, Px right, Px bottom, Px top)
 
UInt4 padding () const
 
virtual bool set_resize_mode (ResizeMode resize_mode)
 
ResizeMode resize_mode () const
 
WrapMode wrap_mode () const
 
void set_wrap_mode (WrapMode mode)
 
bool has_background_image () const
 
bool has_foreground_image () const
 
void set_background_image (TexturePtr texture)
 
void set_background_image_source_rect (const UICoord &bottom_left, const UICoord &size)
 
void set_background_color (const Color &color)
 
void set_foreground_color (const Color &color)
 
void set_foreground_image (TexturePtr texture)
 
void set_foreground_image_source_rect (const UICoord &bottom_left, const UICoord &size)
 
void set_text_color (const Color &color)
 
Px requested_width () const
 
Px requested_height () const
 
Px content_width () const
 
Px content_height () const
 
Px outer_width () const
 
Px outer_height () const
 
const AABBaabb () const override
 
const unicodetext () const
 
void fingerdown (uint8_t finger_id)
 
void fingerup (uint8_t finger_id)
 
void fingerenter (uint8_t finger_id)
 
void fingermove (uint8_t finger_id)
 
void fingerleave (uint8_t finger_id)
 
bool is_pressed_by_finger (uint8_t finger_id)
 
bool is_pressed () const
 
void force_release ()
 
void set_anchor_point (RangeValue< 0, 1 > x, RangeValue< 0, 1 > y)
 
smlt::Vec2 anchor_point () const
 
void set_opacity (RangeValue< 0, 1 > alpha)
 
Px line_height () const
 
void set_precedence (int16_t precedence)
 
int16_t precedence () const
 
MaterialPtr border_material () const
 
MaterialPtr background_material () const
 
MaterialPtr foreground_material () const
 
- Public Member Functions inherited from smlt::ContainerNode
 ContainerNode (Scene *scene, StageNodeType node_type)
 
void do_generate_renderables (batcher::RenderQueue *, const Camera *, const Viewport *, const DetailLevel, Light **, const std::size_t) override
 
- Public Member Functions inherited from smlt::StageNode
std::vector< StageNode * > find_descendents_by_types (std::initializer_list< StageNodeType > type_list) const
 
StageNodefind_descendent_with_id (StageNodeID id)
 
const StageNodefind_descendent_with_id (StageNodeID id) const
 
bool is_root () const
 
StageNodePath node_path () const
 
StageNodefirst_sibling ()
 
const StageNodefirst_sibling () const
 
StageNodenext_sibling ()
 
const StageNodenext_sibling () const
 
StageNodeparent ()
 
const StageNodeparent () const
 
StageNodefirst_child ()
 
const StageNodefirst_child () const
 
StageNodelast_child ()
 
const StageNodelast_child () const
 
const StageNodechild_at (std::size_t i) const
 
std::size_t child_count () const
 
bool has_parent () const
 
void remove_from_parent ()
 
std::list< StageNode * > detach ()
 
void set_parent (StageNode *new_parent, TransformRetainMode transform_retain=TRANSFORM_RETAIN_MODE_LOSE)
 
template<typename T , typename... Args>
T * create_child (Args &&... args)
 
template<typename T >
T * create_child ()
 
template<typename T >
T * create_child (Params args)
 
void adopt_children (StageNode *node)
 
template<typename... Params>
void adopt_children (StageNode *node, Params... args)
 
template<typename T , typename... Args>
T * create_mixin (Args &&... args)
 
StageNodecreate_mixin (const std::string &node_name, const Params &params)
 
StageNodefind_mixin (const std::string &name) const
 
template<typename T >
T * find_mixin () const
 
std::size_t mixin_count () const
 
StageNodebase ()
 
const StageNodebase () const
 
bool is_mixin () const
 
bool generates_renderables_for_descendents () const
 
std::size_t generate_renderables (batcher::RenderQueue *render_queue, const Camera *, const Viewport *viewport, const DetailLevel detail_level, Light **lights, const std::size_t light_count)
 
void update (float dt) override final
 
void late_update (float dt) override final
 
void fixed_update (float step) override final
 
template<typename T >
size_t count_nodes_by_type (bool include_destroyed=false) const
 
bool is_part_of_active_pipeline () const
 
StageNodeload_tree (const Path &path, const TreeLoadOptions &opts=TreeLoadOptions())
 
AncestorIteratorPair each_ancestor ()
 
AncestorIteratorPair each_ancestor () const
 
DescendentIteratorPair each_descendent ()
 
DescendentIteratorPair each_descendent () const
 
SiblingIteratorPair each_sibling ()
 
SiblingIteratorPair each_sibling () const
 
ChildIteratorPair each_child ()
 
ChildIteratorPair each_child () const
 
std::string repr () const override
 
 StageNode (Scene *owner, StageNodeType node_type)
 
StageNodeType node_type () const
 
bool is_visible () const
 
bool is_intended_visible () const
 
void set_visible (bool visible)
 
smlt::Promise< void > destroy_after (const Seconds &seconds)
 
bool parent_is_scene () const
 
const AABB transformed_aabb () const override
 
ShadowCast shadow_cast () const
 
void set_shadow_cast (ShadowCast cast)
 
ShadowReceive shadow_receive () const
 
void set_shadow_receive (ShadowReceive receive)
 
StageNodefind_descendent_with_name (const std::string &name)
 
void set_cullable (bool v)
 
bool is_cullable () const
 
void set_precedence (int16_t precedence)
 
int16_t precedence () const
 
Transformget_transform () const
 
 S_DEFINE_PROPERTY (transform, &StageNode::get_transform)
 
- Public Member Functions inherited from smlt::generic::Identifiable< StageNodeID >
 Identifiable (StageNodeID id)
 
StageNodeID id () const
 
virtual bool operator== (const Identifiable< StageNodeID > &rhs) const
 
virtual bool operator< (const Identifiable< StageNodeID > &rhs) const
 
- Public Member Functions inherited from smlt::DestroyableObject
 DEFINE_SIGNAL (DestroyedSignal, signal_destroyed)
 
bool destroy ()
 
bool destroy_immediately ()
 
bool is_destroyed () const
 
- Public Member Functions inherited from smlt::Nameable
void set_name (const std::string &name)
 
const std::string & name () const
 
bool has_name () const
 
- Public Member Functions inherited from smlt::BoundableEntity
virtual const Vec3 center () const
 
- Public Member Functions inherited from smlt::Boundable
virtual float width () const
 
virtual float height () const
 
virtual float depth () const
 
virtual float half_width () const
 
virtual float half_height () const
 
virtual float half_depth () const
 
virtual float diameter () const
 
virtual float radius () const
 
- Public Member Functions inherited from smlt::TwoPhaseConstructed
bool init ()
 
void clean_up ()
 
- Public Member Functions inherited from smlt::HasMutableRenderPriority
void set_render_priority (RenderPriority priority)
 
virtual RenderPriority render_priority () const
 
- Public Member Functions inherited from smlt::ChainNameable< Widget >
Widget * set_name_and_get (const std::string &name)
 

Additional Inherited Members

- Public Types inherited from smlt::ui::Widget
typedef std::shared_ptr< Widgetptr
 
- Public Types inherited from smlt::generic::Identifiable< StageNodeID >
typedef StageNodeID id_type
 
- Public Attributes inherited from smlt::StageNode
Property< generic::DataCarrier StageNode::* > data
 
Property< Scene *StageNode::* > scene = {this, &StageNode::owner_}
 
- Protected Member Functions inherited from smlt::ui::Widget
void set_style (std::shared_ptr< WidgetStyle > style)
 
virtual void on_size_changed ()
 
void _recalc_active_layers ()
 
bool border_active () const
 
bool background_active () const
 
bool foreground_active () const
 
virtual WidgetBounds calculate_background_size (const UIDim &content_dimensions) const
 
virtual WidgetBounds calculate_foreground_size (const UIDim &content_dimensions) const
 
void apply_image_rect (SubMeshPtr submesh, TexturePtr image, ImageRect &rect)
 
SubMeshPtr new_rectangle (const std::string &name, WidgetBounds bounds, const smlt::Color &color, const Px &border_radius, const Vec2 *uvs=nullptr, float z_offset=0.0f)
 
void clear_mesh ()
 
bool is_initialized () const
 
MeshPtr mesh ()
 
virtual void render_text ()
 
virtual void render_border (const WidgetBounds &border_bounds)
 
virtual void render_background (const WidgetBounds &background_bounds)
 
virtual void render_foreground (const WidgetBounds &foreground_bounds)
 
WidgetPtr focused_in_chain_or_this ()
 
void on_transformation_change_attempted () override
 
void rebuild ()
 
virtual void prepare_build ()
 
virtual void finalize_render ()
 
virtual void finalize_build ()
 
void build_text_submeshes ()
 
FontPtr load_or_get_font (const std::string &family, const Px &size, const FontWeight &weight, const FontStyle &style)
 
- Protected Member Functions inherited from smlt::StageNode
virtual bool on_destroy () override
 
virtual void on_update (float dt) override
 
virtual void on_fixed_update (float step) override
 
virtual void on_late_update (float dt) override
 
void on_transformation_changed () override
 
template<typename N >
bool clean_params (Params &params)
 
Sceneget_scene () const
 
void recalc_bounds_if_necessary () const
 
void mark_transformed_aabb_dirty ()
 
- Protected Attributes inherited from smlt::ui::Widget
MeshPtr mesh_ = nullptr
 
UIConfig theme_
 
FontPtr font_ = nullptr
 
std::shared_ptr< WidgetStylestyle_
 
ResizeMode resize_mode_ = RESIZE_MODE_FIT_CONTENT
 
WrapMode wrap_mode_ = WRAP_MODE_WORD
 
Px text_width_ = Px(0)
 
Px text_height_ = Px(0)
 
Px requested_width_ = Px(-1)
 
Px requested_height_ = Px(-1)
 
Px content_width_ = Px(0)
 
Px content_height_ = Px(0)
 
unicode text_
 
bool is_focused_ = false
 
WidgetPtr focus_next_ = nullptr
 
WidgetPtr focus_previous_ = nullptr
 
smlt::Vec2 anchor_point_
 
bool anchor_point_dirty_ = true
 
uint16_t fingers_down_ = 0
 

Member Function Documentation

◆ activate()

void smlt::ui::Keyboard::activate ( )

Sends the key_pressed signal for the selected key


The documentation for this class was generated from the following files: