#include <texture_view.h>

+ Inheritance diagram for clan::TextureView:

Public Member Functions

 TextureView (Canvas &canvas)
 
Rectf get_viewport () const
 Returns the position and size within the canvas. More...
 
void on_got_focus ()
 
void on_key_down (const clan::InputEvent &)
 
void on_key_up (const clan::InputEvent &)
 
void on_lost_focus ()
 
void on_mouse_dblclk (const clan::InputEvent &)
 
void on_mouse_down (const clan::InputEvent &)
 
void on_mouse_move (const clan::InputEvent &)
 
void on_mouse_up (const clan::InputEvent &)
 
void on_window_close ()
 User defined events. Call these if set_event_window() is not used. More...
 
void set_background_color (const Colorf &background_color=Colorf::transparent)
 
void set_clear_background (bool enable=true)
 
void set_cursor_window (const DisplayWindow &cursor_window)
 Set the window to use to automatically set the cursor (including mouse capture) More...
 
void set_event_window (const DisplayWindow &event_window, const Mat4f &transform_mouse_matrix=Mat4f::identity())
 Set the window to use to automatically handle window events. More...
 
void set_viewport (const Rectf &rect)
 Set position and size within the canvas. More...
 
void update ()
 
- Public Member Functions inherited from clan::View
 View ()
 
 ~View ()
 
void add_subview (const std::shared_ptr< View > &view)
 Add a child view. More...
 
void animate (float from, float to, const std::function< void(float)> &setter, int duration_ms=400, const std::function< float(float)> &easing=Easing::linear, std::function< void()> animation_end=std::function< void()>())
 Continously call an animation function for the specified duration. More...
 
void clear_exception_encountered ()
 
bool content_clipped () const
 Content clipping flag. More...
 
std::shared_ptr< Viewfind_view_at (const Pointf &pos) const
 Find descendant view at the specified content relative position. More...
 
FocusPolicy focus_policy () const
 Focus policy active for this view. More...
 
Viewfocus_view () const
 The view receiving keyboard events or nullptr if no view has the focus. More...
 
Pointf from_root_pos (const Pointf &pos)
 Map from root content to local content coordinates. More...
 
Pointf from_screen_pos (const Pointf &pos)
 Map from screen to local content coordinates. More...
 
const ViewGeometrygeometry () const
 Actual view position and size after layout. More...
 
Canvas get_canvas () const
 
virtual float get_first_baseline_offset (Canvas &canvas, float width)
 Calculates the offset to the first baseline. More...
 
virtual float get_last_baseline_offset (Canvas &canvas, float width)
 Calculates the offset to the last baseline. More...
 
virtual float get_preferred_height (Canvas &canvas, float width)
 Calculates the preferred height of this view. More...
 
virtual float get_preferred_width (Canvas &canvas)
 Calculates the preferred width of this view. More...
 
bool has_focus () const
 Test if this view is receiving keyboard input. More...
 
bool hidden () const
 Test if view is set to hidden. More...
 
bool is_static_position_and_visible () const
 Test if view should participate in static layout calculations (layout_subviews) More...
 
virtual void layout_subviews (Canvas &canvas)
 Sets the view geometry for all subviews of this view. More...
 
bool local_root () const
 Indicates if the view acts as a local root for layout and rendering. More...
 
bool needs_layout () const
 Test if view geometry needs to be recalculated. More...
 
void next_focus ()
 Give focus to the next view in the keyboard tab index order. More...
 
Viewowner_view () const
 View hierachy owner or nullptr if there is no owner. More...
 
void prev_focus ()
 Give focus to the previous view in the keyboard tab index order. More...
 
void remove_focus ()
 Remove focus from this view. More...
 
void remove_from_super ()
 Remove view from parent. More...
 
bool render_exception_encountered () const
 Test if this view generated an exception during rendering. More...
 
Viewroot_view ()
 
const Viewroot_view () const
 Root view in view hierachy. More...
 
void set_content_clipped (bool clipped)
 Specifies if content should be clipped during rendering. More...
 
void set_cursor (const CursorDescription &cursor)
 Set the cursor icon used when cursor is above this view. More...
 
void set_cursor (StandardCursor type)
 
void set_focus ()
 Set this view as the focused view. More...
 
void set_focus_policy (FocusPolicy policy)
 Set if this view automatically can gain focus. More...
 
void set_geometry (const ViewGeometry &geometry)
 
void set_hidden (bool value=true)
 Hides a view from layout and rendering. More...
 
void set_inherit_cursor ()
 Specify that the cursor icon is inherited from the super view. More...
 
void set_needs_layout ()
 Forces recalculation of view geometry before next rendering. More...
 
void set_needs_render ()
 Signals this view needs to be rendered again. More...
 
void set_state (const std::string &name, bool value)
 Set or clear style state. More...
 
void set_state_cascade (const std::string &name, bool value)
 Sets the state for this view and all siblings recursively, until a manually set state of the same name is found. More...
 
void set_tab_index (unsigned int index)
 Sets the tab index used for keyboard focus changes. More...
 
void set_view_transform (const Mat4f &transform)
 Specifies the view transform to be applied before its contents and children are rendered. More...
 
Signal< void(ActivationChangeEvent &)> & sig_activated (bool use_capture=false)
 Window activated event. More...
 
Signal< void(CloseEvent &)> & sig_close (bool use_capture=false)
 Window close button clicked event. More...
 
Signal< void(ActivationChangeEvent &)> & sig_deactivated (bool use_capture=false)
 Window deactivated event. More...
 
Signal< void(FocusChangeEvent &)> & sig_focus_gained (bool use_capture=false)
 View gained focus event. More...
 
Signal< void(FocusChangeEvent &)> & sig_focus_lost (bool use_capture=false)
 View lost focus event. More...
 
Signal< void(KeyEvent &)> & sig_key_press (bool use_capture=false)
 Key pressed event. More...
 
Signal< void(KeyEvent &)> & sig_key_release (bool use_capture=false)
 Key released event. More...
 
Signal< void(PointerEvent &)> & sig_pointer_double_click (bool use_capture=false)
 Pointer button double clicked event. More...
 
Signal< void(PointerEvent &)> & sig_pointer_enter (bool use_capture=false)
 Pointer entering view geometry event. More...
 
Signal< void(PointerEvent &)> & sig_pointer_leave (bool use_capture=false)
 Pointer leaving view geometry event. More...
 
Signal< void(PointerEvent &)> & sig_pointer_move (bool use_capture=false)
 Pointer moved above view event. More...
 
Signal< void(PointerEvent &)> & sig_pointer_press (bool use_capture=false)
 Pointer button pressed event. More...
 
Signal< void(PointerEvent &)> & sig_pointer_proximity_change (bool use_capture=false)
 Pointer proximity change event. More...
 
Signal< void(PointerEvent &)> & sig_pointer_release (bool use_capture=false)
 Pointer button released event. More...
 
Signal< void(ResizeEvent &)> & sig_resize (bool use_capture=false)
 Window resize event. More...
 
bool state (const std::string &name) const
 Test if a style state is currently set. More...
 
void stop_animations ()
 Stop all activate animation functions. More...
 
const std::shared_ptr< Style > & style (const std::string &state=std::string()) const
 Style properties for the specified state. More...
 
const StyleCascadestyle_cascade () const
 Style cascade currently active for this view. More...
 
const std::vector< std::shared_ptr< View > > & subviews () const
 List of all immediate child views. More...
 
Viewsuperview () const
 Parent view node or nullptr if the view is the current root node. More...
 
unsigned int tab_index () const
 Tab index for keyboard focus changes. More...
 
Pointf to_root_pos (const Pointf &pos)
 Map from local content to root content coordinates. More...
 
Pointf to_screen_pos (const Pointf &pos)
 Map from local content to screen coordinates. More...
 
void update_cursor (DisplayWindow &window)
 Update window cursor to the cursor used by this view. More...
 
const Mat4fview_transform () const
 Current view transform. More...
 

Protected Member Functions

Canvas get_root_canvas () const override
 
void layout_local () override
 Layout local root. More...
 
Pointf root_from_screen_pos (const Pointf &pos) override
 Map from screen to local content coordinates. More...
 
bool root_hidden () const override
 Test if view is set to hidden. More...
 
Pointf root_to_screen_pos (const Pointf &pos) override
 Map from local content to screen coordinates. More...
 
void set_root_hidden (bool value) override
 Hides a view from layout and rendering. More...
 
void set_root_needs_render () override
 Signals this view needs to be rendered again. More...
 
- Protected Member Functions inherited from clan::RootView
void dispatch_activation_change (ActivationChangeType type)
 Dispatch activation change event to all views. More...
 
void layout (Canvas &canvas)
 Layout root view. More...
 
void render (Canvas &canvas)
 Renders view into the specified canvas. More...
 
- Protected Member Functions inherited from clan::View
virtual void render_content (Canvas &canvas)
 Renders the content of a view. More...
 
virtual void subview_added (const std::shared_ptr< View > &view)
 Child view was added to this view. More...
 
virtual void subview_removed (const std::shared_ptr< View > &view)
 Child view was removed from this view. More...
 

Friends

class TextureView_Impl
 

Additional Inherited Members

- Static Public Member Functions inherited from clan::View
static void dispatch_event (View *target, EventUI *e, bool no_propagation=false)
 Dispatch event to signals listening for events. More...
 
- Public Attributes inherited from clan::View
SlotContainer slots
 Slot container helping with automatic disconnection of connected slots when the view is destroyed. More...
 

Constructor & Destructor Documentation

◆ TextureView()

clan::TextureView::TextureView ( Canvas canvas)

Member Function Documentation

◆ get_root_canvas()

Canvas clan::TextureView::get_root_canvas ( ) const
overrideprotectedvirtual

Gets the current canvas used to render this view

This function may return a null canvas if the view does not have a canvas attached to it yet.

Implements clan::RootView.

◆ get_viewport()

Rectf clan::TextureView::get_viewport ( ) const

Returns the position and size within the canvas.

◆ layout_local()

void clan::TextureView::layout_local ( )
overrideprotectedvirtual

Layout local root.

Implements clan::RootView.

◆ on_got_focus()

void clan::TextureView::on_got_focus ( )

◆ on_key_down()

void clan::TextureView::on_key_down ( const clan::InputEvent )

◆ on_key_up()

void clan::TextureView::on_key_up ( const clan::InputEvent )

◆ on_lost_focus()

void clan::TextureView::on_lost_focus ( )

◆ on_mouse_dblclk()

void clan::TextureView::on_mouse_dblclk ( const clan::InputEvent )

◆ on_mouse_down()

void clan::TextureView::on_mouse_down ( const clan::InputEvent )

◆ on_mouse_move()

void clan::TextureView::on_mouse_move ( const clan::InputEvent )

◆ on_mouse_up()

void clan::TextureView::on_mouse_up ( const clan::InputEvent )

◆ on_window_close()

void clan::TextureView::on_window_close ( )

User defined events. Call these if set_event_window() is not used.

◆ root_from_screen_pos()

Pointf clan::TextureView::root_from_screen_pos ( const Pointf pos)
overrideprotectedvirtual

Map from screen to local content coordinates.

Implements clan::RootView.

◆ root_hidden()

bool clan::TextureView::root_hidden ( ) const
overrideprotectedvirtual

Test if view is set to hidden.

Implements clan::RootView.

◆ root_to_screen_pos()

Pointf clan::TextureView::root_to_screen_pos ( const Pointf pos)
overrideprotectedvirtual

Map from local content to screen coordinates.

Implements clan::RootView.

◆ set_background_color()

void clan::TextureView::set_background_color ( const Colorf background_color = Colorf::transparent)

◆ set_clear_background()

void clan::TextureView::set_clear_background ( bool  enable = true)

◆ set_cursor_window()

void clan::TextureView::set_cursor_window ( const DisplayWindow cursor_window)

Set the window to use to automatically set the cursor (including mouse capture)

Default = Don't change the cursor

◆ set_event_window()

void clan::TextureView::set_event_window ( const DisplayWindow event_window,
const Mat4f transform_mouse_matrix = Mat4f::identity() 
)

Set the window to use to automatically handle window events.

Default = You need to call the user defined events instead (on_...)

Parameters
event_window= The window to use
transform_mouse_matrix= Matrix to use to transform the mouse coordinates

◆ set_root_hidden()

void clan::TextureView::set_root_hidden ( bool  value)
overrideprotectedvirtual

Hides a view from layout and rendering.

Implements clan::RootView.

◆ set_root_needs_render()

void clan::TextureView::set_root_needs_render ( )
overrideprotectedvirtual

Signals this view needs to be rendered again.

Implements clan::RootView.

◆ set_viewport()

void clan::TextureView::set_viewport ( const Rectf rect)

Set position and size within the canvas.

Parameters
rect= position and size.

◆ update()

void clan::TextureView::update ( )

Friends And Related Function Documentation

◆ TextureView_Impl

friend class TextureView_Impl
friend

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