Gorgon Game Engine
Layer Class Reference

Input layer allows mouse events to be handled. More...

Inheritance diagram for Layer:
[legend]

Protected Member Functions

virtual bool propagate_mouseevent (Input::Mouse::EventType event, Geometry::Point location, Input::Mouse::Button button, float amount, MouseHandler &handlers) override
 Propagates a mouse event. Some events will be called directly. More...
 
- Protected Member Functions inherited from Layer
virtual void added (Layer &layer)
 Will be called when a layer is added. More...
 
void dotransformandclip (bool inverse=false)
 Performs transformation and clipping. Use inverse for reverse mapping for mouse events. More...
 
virtual void located (Layer *parent)
 Will be called when this layer is added to another. More...
 
virtual void removed (Layer &layer)
 Will be called when a layer is removed. More...
 
void reverttransformandclip ()
 Reverts previously done transformation. More...
 

Protected Attributes

std::function< void(Layer &, Geometry::Point, Input::Mouse::Button)> click
 
std::function< void(Layer &, Geometry::Point, Input::Mouse::Button)> down
 
std::function< bool(Layer &, Geometry::Point)> hitcheck
 
std::function< bool(Layer &, Geometry::Point, float amount)> hscroll
 
std::function< void(Layer &, Geometry::Point)> move
 
Geometry::Transform3D mytransform
 
std::function< void(Layer &)> out
 
std::function< void(Layer &)> over
 
std::function< bool(Layer &, Geometry::Point, float amount)> rotate
 
std::function< void(Layer &, Geometry::Point, Input::Mouse::Button)> up
 
std::function< bool(Layer &, Geometry::Point, float amount)> vscroll
 
std::function< bool(Layer &, Geometry::Point, float amount)> zoom
 
- Protected Attributes inherited from Layer
Geometry::Bounds bounds
 Bounds of this layer. More...
 
Containers::Collection< Layerchildren
 Child layers that this layer holds, all child layers are considered to be above current layer. More...
 
bool isvisible
 Whether this layer is visible, invisible layers will not be drawn or receive any events. More...
 
std::string name
 For debugging. More...
 
Layerparent
 Parent layer, could be nullptr. More...
 

Mouse event handling

void SetHitCheck (std::function< bool(Layer &, Geometry::Point)> fn)
 Sets hit check function. More...
 
void SetHitCheck (std::function< bool(Geometry::Point)> fn)
 Sets hit check function. More...
 
template<class C_ >
void SetHitCheck (C_ &c, bool(C_::*fn)(Layer &, Geometry::Point))
 Sets hit check function. More...
 
template<class C_ >
void SetHitCheck (C_ &c, bool(C_::*fn)(Geometry::Point))
 Sets hit check function. More...
 
template<class C_ >
void SetHitCheck (C_ *my, bool(C_::*fn)(Layer &, Geometry::Point))
 Sets hit check function. More...
 
template<class C_ >
void SetHitCheck (C_ *my, bool(C_::*fn)(Geometry::Point))
 Sets hit check function. More...
 
void ResetHitCheck ()
 Removes hit check handler, default action for hit check is to return true. More...
 
void SetClick (std::function< void(Layer &, Geometry::Point, Input::Mouse::Button)> fn)
 Sets click handler. More...
 
void SetClick (std::function< void(Geometry::Point, Input::Mouse::Button)> fn)
 Sets click handler. More...
 
template<class C_ >
void SetClick (C_ &c, void(C_::*fn)(Layer &, Geometry::Point, Input::Mouse::Button))
 Sets click handler. More...
 
template<class C_ >
void SetClick (C_ &c, void(C_::*fn)(Geometry::Point, Input::Mouse::Button))
 Sets click handler. More...
 
template<class C_ >
void SetClick (C_ *my, void(C_::*fn)(Layer &, Geometry::Point, Input::Mouse::Button))
 Sets click handler. More...
 
template<class C_ >
void SetClick (C_ *my, void(C_::*fn)(Geometry::Point, Input::Mouse::Button))
 Sets click handler. More...
 
void SetClick (std::function< void(Layer &, Input::Mouse::Button)> fn)
 Sets click handler. More...
 
void SetClick (std::function< void(Input::Mouse::Button)> fn)
 Sets click handler. More...
 
template<class C_ >
void SetClick (C_ &c, void(C_::*fn)(Layer &, Input::Mouse::Button))
 Sets click handler. More...
 
template<class C_ >
void SetClick (C_ &c, void(C_::*fn)(Input::Mouse::Button))
 Sets click handler. More...
 
template<class C_ >
void SetClick (C_ *my, void(C_::*fn)(Layer &, Input::Mouse::Button))
 Sets click handler. More...
 
template<class C_ >
void SetClick (C_ *my, void(C_::*fn)(Input::Mouse::Button))
 Sets click handler. More...
 
void SetClick (std::function< void(Layer &, Geometry::Point)> fn, Input::Mouse::Button btn=Input::Mouse::Button::Left)
 Sets click handler. More...
 
void SetClick (std::function< void(Geometry::Point)> fn, Input::Mouse::Button btn=Input::Mouse::Button::Left)
 Sets click handler. More...
 
template<class C_ >
void SetClick (C_ &c, void(C_::*fn)(Layer &, Geometry::Point), Input::Mouse::Button btn=Input::Mouse::Button::Left)
 Sets click handler. More...
 
template<class C_ >
void SetClick (C_ &c, void(C_::*fn)(Geometry::Point), Input::Mouse::Button btn=Input::Mouse::Button::Left)
 Sets click handler. More...
 
template<class C_ >
void SetClick (C_ *my, void(C_::*fn)(Layer &, Geometry::Point), Input::Mouse::Button btn=Input::Mouse::Button::Left)
 Sets click handler. More...
 
template<class C_ >
void SetClick (C_ *my, void(C_::*fn)(Geometry::Point), Input::Mouse::Button btn=Input::Mouse::Button::Left)
 Sets click handler. More...
 
void SetClick (std::function< void(Layer &)> fn, Input::Mouse::Button btn=Input::Mouse::Button::Left)
 Sets click handler. More...
 
void SetClick (std::function< void()> fn, Input::Mouse::Button btn=Input::Mouse::Button::Left)
 Sets click handler. More...
 
template<class C_ >
void SetClick (C_ &c, void(C_::*fn)(Layer &), Input::Mouse::Button btn=Input::Mouse::Button::Left)
 Sets click handler. More...
 
template<class C_ >
void SetClick (C_ &c, std::function< void(C_ &)> fn, Input::Mouse::Button btn=Input::Mouse::Button::Left)
 Sets click handler. More...
 
template<class C_ >
void SetClick (C_ *my, void(C_::*fn)(Layer &), Input::Mouse::Button btn=Input::Mouse::Button::Left)
 Sets click handler. More...
 
template<class C_ >
void SetClick (C_ *my, std::function< void(C_ &)> fn, Input::Mouse::Button btn=Input::Mouse::Button::Left)
 Sets click handler. More...
 
void ResetClick ()
 Removes click handler. More...
 
void SetDown (std::function< void(Layer &, Geometry::Point, Input::Mouse::Button)> fn)
 Sets mouse down handler. More...
 
void SetDown (std::function< void(Geometry::Point, Input::Mouse::Button)> fn)
 Sets mouse down handler. More...
 
template<class C_ >
void SetDown (C_ &c, void(C_::*fn)(Layer &, Geometry::Point, Input::Mouse::Button))
 Sets mouse down handler. More...
 
template<class C_ >
void SetDown (C_ &c, void(C_::*fn)(Geometry::Point, Input::Mouse::Button))
 Sets mouse down handler. More...
 
template<class C_ >
void SetDown (C_ *my, void(C_::*fn)(Layer &, Geometry::Point, Input::Mouse::Button))
 Sets mouse down handler. More...
 
template<class C_ >
void SetDown (C_ *my, void(C_::*fn)(Geometry::Point, Input::Mouse::Button))
 Sets mouse down handler. More...
 
void SetDown (std::function< void(Layer &, Input::Mouse::Button)> fn)
 Sets mouse down handler. More...
 
void SetDown (std::function< void(Input::Mouse::Button)> fn)
 Sets mouse down handler. More...
 
template<class C_ >
void SetDown (C_ &c, void(C_::*fn)(Layer &, Input::Mouse::Button))
 Sets mouse down handler. More...
 
template<class C_ >
void SetDown (C_ &c, void(C_::*fn)(Input::Mouse::Button))
 Sets mouse down handler. More...
 
template<class C_ >
void SetDown (C_ *my, void(C_::*fn)(Layer &, Input::Mouse::Button))
 Sets mouse down handler. More...
 
template<class C_ >
void SetDown (C_ *my, void(C_::*fn)(Input::Mouse::Button))
 Sets mouse down handler. More...
 
void SetDown (std::function< void(Layer &, Geometry::Point)> fn, Input::Mouse::Button btn=Input::Mouse::Button::Left)
 Sets mouse down handler. More...
 
void SetDown (std::function< void(Geometry::Point)> fn, Input::Mouse::Button btn=Input::Mouse::Button::Left)
 Sets mouse down handler. More...
 
template<class C_ >
void SetDown (C_ &c, void(C_::*fn)(Layer &, Geometry::Point), Input::Mouse::Button btn=Input::Mouse::Button::Left)
 Sets mouse down handler. More...
 
template<class C_ >
void SetDown (C_ &c, void(C_::*fn)(Geometry::Point), Input::Mouse::Button btn=Input::Mouse::Button::Left)
 Sets mouse down handler. More...
 
template<class C_ >
void SetDown (C_ *my, void(C_::*fn)(Layer &, Geometry::Point), Input::Mouse::Button btn=Input::Mouse::Button::Left)
 Sets mouse down handler. More...
 
template<class C_ >
void SetDown (C_ *my, void(C_::*fn)(Geometry::Point), Input::Mouse::Button btn=Input::Mouse::Button::Left)
 Sets mouse down handler. More...
 
void SetDown (std::function< void(Layer &)> fn, Input::Mouse::Button btn=Input::Mouse::Button::Left)
 Sets mouse down handler. More...
 
void SetDown (std::function< void()> fn, Input::Mouse::Button btn=Input::Mouse::Button::Left)
 Sets mouse down handler. More...
 
template<class C_ >
void SetDown (C_ &c, void(C_::*fn)(Layer &), Input::Mouse::Button btn=Input::Mouse::Button::Left)
 Sets mouse down handler. More...
 
template<class C_ >
void SetDown (C_ &c, std::function< void(C_ &)> fn, Input::Mouse::Button btn=Input::Mouse::Button::Left)
 Sets mouse down handler. More...
 
template<class C_ >
void SetDown (C_ *my, void(C_::*fn)(Layer &), Input::Mouse::Button btn=Input::Mouse::Button::Left)
 Sets mouse down handler. More...
 
template<class C_ >
void SetDown (C_ *my, std::function< void(C_ &)> fn, Input::Mouse::Button btn=Input::Mouse::Button::Left)
 Sets mouse down handler. More...
 
void ResetDown ()
 Removes mouse down handler. More...
 
void SetUp (std::function< void(Layer &, Geometry::Point, Input::Mouse::Button)> fn)
 Sets mouse up handler. More...
 
void SetUp (std::function< void(Geometry::Point, Input::Mouse::Button)> fn)
 Sets mouse up handler. More...
 
template<class C_ >
void SetUp (C_ &c, void(C_::*fn)(Layer &, Geometry::Point, Input::Mouse::Button))
 Sets mouse up handler. More...
 
template<class C_ >
void SetUp (C_ &c, void(C_::*fn)(Geometry::Point, Input::Mouse::Button))
 Sets mouse up handler. More...
 
template<class C_ >
void SetUp (C_ *my, void(C_::*fn)(Layer &, Geometry::Point, Input::Mouse::Button))
 Sets mouse up handler. More...
 
template<class C_ >
void SetUp (C_ *my, void(C_::*fn)(Geometry::Point, Input::Mouse::Button))
 Sets mouse up handler. More...
 
void SetUp (std::function< void(Layer &, Input::Mouse::Button)> fn)
 Sets mouse up handler. More...
 
void SetUp (std::function< void(Input::Mouse::Button)> fn)
 Sets mouse up handler. More...
 
template<class C_ >
void SetUp (C_ &c, void(C_::*fn)(Layer &, Input::Mouse::Button))
 Sets mouse up handler. More...
 
template<class C_ >
void SetUp (C_ &c, void(C_::*fn)(Input::Mouse::Button))
 Sets mouse up handler. More...
 
template<class C_ >
void SetUp (C_ *my, void(C_::*fn)(Layer &, Input::Mouse::Button))
 Sets mouse up handler. More...
 
template<class C_ >
void SetUp (C_ *my, void(C_::*fn)(Input::Mouse::Button))
 Sets mouse up handler. More...
 
void SetUp (std::function< void(Layer &, Geometry::Point)> fn, Input::Mouse::Button btn=Input::Mouse::Button::Left)
 Sets mouse up handler. More...
 
void SetUp (std::function< void(Geometry::Point)> fn, Input::Mouse::Button btn=Input::Mouse::Button::Left)
 Sets mouse up handler. More...
 
template<class C_ >
void SetUp (C_ &c, void(C_::*fn)(Layer &, Geometry::Point), Input::Mouse::Button btn=Input::Mouse::Button::Left)
 Sets mouse up handler. More...
 
template<class C_ >
void SetUp (C_ &c, void(C_::*fn)(Geometry::Point), Input::Mouse::Button btn=Input::Mouse::Button::Left)
 Sets mouse up handler. More...
 
template<class C_ >
void SetUp (C_ *my, void(C_::*fn)(Layer &, Geometry::Point), Input::Mouse::Button btn=Input::Mouse::Button::Left)
 Sets mouse up handler. More...
 
template<class C_ >
void SetUp (C_ *my, void(C_::*fn)(Geometry::Point), Input::Mouse::Button btn=Input::Mouse::Button::Left)
 Sets mouse up handler. More...
 
void SetUp (std::function< void(Layer &)> fn, Input::Mouse::Button btn=Input::Mouse::Button::Left)
 Sets mouse up handler. More...
 
void SetUp (std::function< void()> fn, Input::Mouse::Button btn=Input::Mouse::Button::Left)
 Sets mouse up handler. More...
 
template<class C_ >
void SetUp (C_ &c, void(C_::*fn)(Layer &), Input::Mouse::Button btn=Input::Mouse::Button::Left)
 Sets mouse up handler. More...
 
template<class C_ >
void SetUp (C_ &c, std::function< void(C_ &)> fn, Input::Mouse::Button btn=Input::Mouse::Button::Left)
 Sets mouse up handler. More...
 
template<class C_ >
void SetUp (C_ *my, void(C_::*fn)(Layer &), Input::Mouse::Button btn=Input::Mouse::Button::Left)
 Sets mouse up handler. More...
 
template<class C_ >
void SetUp (C_ *my, std::function< void(C_ &)> fn, Input::Mouse::Button btn=Input::Mouse::Button::Left)
 Sets mouse up handler. More...
 
void ResetUp ()
 Removes mouse up handler. More...
 
void SetMove (std::function< void(Layer &, Geometry::Point)> fn)
 Sets mouse move handler. More...
 
void SetMove (std::function< void(Geometry::Point)> fn)
 Sets mouse move handler. More...
 
template<class C_ >
void SetMove (C_ &c, void(C_::*fn)(Layer &, Geometry::Point))
 Sets mouse move handler. More...
 
template<class C_ >
void SetMove (C_ &c, void(C_::*fn)(Geometry::Point))
 Sets mouse move handler. More...
 
template<class C_ >
void SetMove (C_ *my, void(C_::*fn)(Layer &, Geometry::Point))
 Sets mouse move handler. More...
 
template<class C_ >
void SetMove (C_ *my, void(C_::*fn)(Geometry::Point))
 Sets mouse move handler. More...
 
void ResetMove ()
 Removes mouse move handler. More...
 
void SetScroll (std::function< bool(Layer &, Geometry::Point, float)> fn)
 Sets scroll handler. More...
 
void SetScroll (std::function< bool(Geometry::Point, float)> fn)
 Sets scroll handler. More...
 
template<class C_ >
void SetScroll (C_ &c, bool(C_::*fn)(Layer &, Geometry::Point, float))
 Sets scroll handler. More...
 
template<class C_ >
void SetScroll (C_ &c, bool(C_::*fn)(Geometry::Point, float))
 Sets scroll handler. More...
 
template<class C_ >
void SetScroll (C_ *my, bool(C_::*fn)(Layer &, Geometry::Point, float))
 Sets scroll handler. More...
 
template<class C_ >
void SetScroll (C_ *my, bool(C_::*fn)(Geometry::Point, float))
 Sets scroll handler. More...
 
void SetScroll (std::function< bool(Layer &, float)> fn)
 Sets scroll handler. More...
 
void SetScroll (std::function< bool(float)> fn)
 Sets scroll handler. More...
 
template<class C_ >
void SetScroll (C_ &c, bool(C_::*fn)(Layer &, float))
 Sets scroll handler. More...
 
template<class C_ >
void SetScroll (C_ &c, bool(C_::*fn)(float))
 Sets scroll handler. More...
 
template<class C_ >
void SetScroll (C_ *my, bool(C_::*fn)(Layer &, float))
 Sets scroll handler. More...
 
template<class C_ >
void SetScroll (C_ *my, bool(C_::*fn)(float))
 Sets scroll handler. More...
 
void ResetScroll ()
 Removes scroll handler. More...
 
void SetHScroll (std::function< bool(Layer &, Geometry::Point, float)> fn)
 Sets horizontal scroll handler. More...
 
void SetHScroll (std::function< bool(Geometry::Point, float)> fn)
 Sets horizontal scroll handler. More...
 
template<class C_ >
void SetHScroll (C_ &c, bool(C_::*fn)(Layer &, Geometry::Point, float))
 Sets horizontal scroll handler. More...
 
template<class C_ >
void SetHScroll (C_ &c, bool(C_::*fn)(Geometry::Point, float))
 Sets horizontal scroll handler. More...
 
template<class C_ >
void SetHScroll (C_ *my, bool(C_::*fn)(Layer &, Geometry::Point, float))
 Sets horizontal scroll handler. More...
 
template<class C_ >
void SetHScroll (C_ *my, bool(C_::*fn)(Geometry::Point, float))
 Sets horizontal scroll handler. More...
 
void SetHScroll (std::function< bool(Layer &, float)> fn)
 Sets horizontal scroll handler. More...
 
void SetHScroll (std::function< bool(float)> fn)
 Sets horizontal scroll handler. More...
 
template<class C_ >
void SetHScroll (C_ &c, bool(C_::*fn)(Layer &, float))
 Sets horizontal scroll handler. More...
 
template<class C_ >
void SetHScroll (C_ &c, bool(C_::*fn)(float))
 Sets horizontal scroll handler. More...
 
template<class C_ >
void SetHScroll (C_ *my, bool(C_::*fn)(Layer &, float))
 Sets horizontal scroll handler. More...
 
template<class C_ >
void SetHScroll (C_ *my, bool(C_::*fn)(float))
 Sets horizontal scroll handler. More...
 
void ResetHScroll ()
 Removes horizontal scroll handler. More...
 
void SetZoom (std::function< bool(Layer &, Geometry::Point, float)> fn)
 Sets zoom handler. More...
 
void SetZoom (std::function< bool(Geometry::Point, float)> fn)
 Sets zoom handler. More...
 
template<class C_ >
void SetZoom (C_ &c, bool(C_::*fn)(Layer &, Geometry::Point, float))
 Sets zoom handler. More...
 
template<class C_ >
void SetZoom (C_ &c, bool(C_::*fn)(Geometry::Point, float))
 Sets zoom handler. More...
 
template<class C_ >
void SetZoom (C_ *my, bool(C_::*fn)(Layer &, Geometry::Point, float))
 Sets zoom handler. More...
 
template<class C_ >
void SetZoom (C_ *my, bool(C_::*fn)(Geometry::Point, float))
 Sets zoom handler. More...
 
void SetZoom (std::function< bool(Layer &, float)> fn)
 Sets zoom handler. More...
 
void SetZoom (std::function< bool(float)> fn)
 Sets zoom handler. More...
 
template<class C_ >
void SetZoom (C_ &c, bool(C_::*fn)(Layer &, float))
 Sets zoom handler. More...
 
template<class C_ >
void SetZoom (C_ &c, bool(C_::*fn)(float))
 Sets zoom handler. More...
 
template<class C_ >
void SetZoom (C_ *my, bool(C_::*fn)(Layer &, float))
 Sets zoom handler. More...
 
template<class C_ >
void SetZoom (C_ *my, bool(C_::*fn)(float))
 Sets zoom handler. More...
 
void ResetZoom ()
 Removes zoom handler. More...
 
void SetRotate (std::function< bool(Layer &, Geometry::Point, float)> fn)
 Sets rotate handler. More...
 
void SetRotate (std::function< bool(Geometry::Point, float)> fn)
 Sets rotate handler. More...
 
template<class C_ >
void SetRotate (C_ &c, bool(C_::*fn)(Layer &, Geometry::Point, float))
 Sets rotate handler. More...
 
template<class C_ >
void SetRotate (C_ &c, bool(C_::*fn)(Geometry::Point, float))
 Sets rotate handler. More...
 
template<class C_ >
void SetRotate (C_ *my, bool(C_::*fn)(Layer &, Geometry::Point, float))
 Sets rotate handler. More...
 
template<class C_ >
void SetRotate (C_ *my, bool(C_::*fn)(Geometry::Point, float))
 Sets rotate handler. More...
 
void SetRotate (std::function< bool(Layer &, float)> fn)
 Sets rotate handler. More...
 
void SetRotate (std::function< bool(float)> fn)
 Sets rotate handler. More...
 
template<class C_ >
void SetRotate (C_ &c, bool(C_::*fn)(Layer &, float))
 Sets rotate handler. More...
 
template<class C_ >
void SetRotate (C_ &c, bool(C_::*fn)(float))
 Sets rotate handler. More...
 
template<class C_ >
void SetRotate (C_ *my, bool(C_::*fn)(Layer &, float))
 Sets rotate handler. More...
 
template<class C_ >
void SetRotate (C_ *my, bool(C_::*fn)(float))
 Sets rotate handler. More...
 
void ResetRotate ()
 Removes rotate handler. More...
 
void SetOver (std::function< void(Layer &)> fn)
 Sets mouse over handler. More...
 
void SetOver (std::function< void()> fn)
 Sets mouse over handler. More...
 
template<class C_ >
void SetOver (C_ &c, void(C_::*fn)(Layer &))
 Sets mouse over handler. More...
 
template<class C_ >
void SetOver (C_ &c, std::function< void(C_ &)> fn)
 Sets mouse over handler. More...
 
template<class C_ >
void SetOver (C_ *my, void(C_::*fn)(Layer &))
 Sets mouse over handler. More...
 
template<class C_ >
void SetOver (C_ *my, std::function< void(C_ &)> fn)
 Sets mouse over handler. More...
 
void ResetOver ()
 Removes mouse over handler. More...
 
void SetOut (std::function< void(Layer &)> fn)
 Sets mouse out handler. More...
 
void SetOut (std::function< void()> fn)
 Sets mouse out handler. More...
 
template<class C_ >
void SetOut (C_ &c, void(C_::*fn)(Layer &))
 Sets mouse out handler. More...
 
template<class C_ >
void SetOut (C_ &c, std::function< void(C_ &)> fn)
 Sets mouse out handler. More...
 
template<class C_ >
void SetOut (C_ *my, void(C_::*fn)(Layer &))
 Sets mouse out handler. More...
 
template<class C_ >
void SetOut (C_ *my, std::function< void(C_ &)> fn)
 Sets mouse out handler. More...
 
void ResetOut ()
 Removes mouse out handler. More...
 
void FireClick (Geometry::Point location, Input::Mouse::Button button)
 Fires the click event manually, allowing both mouse up and click events to happen at the same time. More...
 

Additional Inherited Members

- Public Member Functions inherited from Layer
 Layer ()
 Constructor that sets the layer to cover entire parent, no matter how big it is. More...
 
 Layer (const Geometry::Bounds &bounds)
 Initializing constructor. More...
 
 Layer (const Geometry::Point &location)
 Constructor that places the layer to the given location. More...
 
 Layer (const Layer &)=delete
 Copy constructor is disabled. More...
 
 Layer (Layer &&other)
 Move constructor. More...
 
virtual ~Layer ()
 Destructor. More...
 
virtual void Hide ()
 Hides this layer. More...
 
virtual bool IsVisible () const
 Returns whether this layer is effectively visible. More...
 
Layeroperator= (const Layer &)=delete
 Copy assignment is deleted. More...
 
Layeroperator= (Layer &&other)
 Move assignment. More...
 
virtual void Render ()
 Renders the current layer, default handling is to pass the request to the sub-layers. Rendering is not thread safe. More...
 
virtual void Show ()
 Displays this layer. More...
 
void Swap (Layer &other)
 Swaps two layers, mostly used for move semantics. More...
 
void Add (Layer &layer)
 Adds the given layer as a child. More...
 
void Add (Layer *layer)
 Adds the given layer as a child. More...
 
void setname (std::string value)
 For debugging. More...
 
void Insert (Layer &layer, long under)
 Inserts the given layer before the given index. More...
 
void Insert (Layer *layer, long under)
 Inserts the given layer before the given index. More...
 
void Remove (Layer &layer)
 Removes the given layer. More...
 
void Remove (Layer *layer)
 Removes the given layer. More...
 
bool HasParent () const
 Returns whether this layer has a parent. More...
 
virtual LayerGetParent () const
 Returns the parent of this layer. More...
 
LayerGetTopLevel () const
 Returns the top level layer that contains this layer. More...
 
virtual Geometry::Point TranslateToTopLevel (Geometry::Point location={0, 0}) const
 Translates the given location to the top level. More...
 
LayerGetTopLevel ()
 
Containers::Collection< Layer >::ConstIterator begin () const
 An iterator pointing to the start of the children. More...
 
Containers::Collection< Layer >::ConstIterator end () const
 An iterator pointing to the end of the children. More...
 
Containers::Collection< Layer >::ConstIterator First () const
 An iterator pointing to the start of the children. More...
 
Containers::Collection< Layer >::ConstIterator Last () const
 An iterator pointing to the last item of the children. More...
 
void PlaceBefore (int before)
 Places this layer before the given index. More...
 
void PlaceToTop ()
 Places this layer to the top of the layer stack its in. More...
 
void PlaceToBottom ()
 Places this layer to the bottom of the layer stack. More...
 
int GetOrder () const
 Gets the current order of the stack. More...
 
virtual void Move (const Geometry::Point &location)
 Moves this layer to the given location. More...
 
virtual void Move (int x, int y)
 Moves this layer to the given location. More...
 
virtual void Resize (const Geometry::Size &size)
 Resizes the layer to the given size. More...
 
virtual void Resize (int width, int height)
 Resizes the layer to the given size. More...
 
void SetWidth (int width)
 Resizes the layer to the given size. More...
 
void SetHeight (int height)
 Resizes the layer to the given size. More...
 
void SetBounds (const Geometry::Bounds &bounds)
 Sets the boundaries of this layer. More...
 
Geometry::Size GetSize () const
 Returns the size of the layer. More...
 
Geometry::Size GetCalculatedSize () const
 Returns the size of the layer. More...
 
int GetWidth () const
 Returns the width of the layer. More...
 
int GetHeight () const
 Returns the height of the layer. More...
 
Geometry::Point GetLocation () const
 Returns the current location of the layer. More...
 
int GetLeft () const
 Returns the current location of the layer. More...
 
int GetTop () const
 Returns the current location of the layer. More...
 
Geometry::Bounds GetBounds () const
 Returns the boundaries of the layer. More...
 
Geometry::Bounds GetEffectiveBounds () const
 Returns the effective boundaries of the layer. More...
 
- Public Attributes inherited from Layer
const Containers::Collection< Layer > & Children
 Sub-layers that this layer holds, all the sub-layers are considered to be above current layer. More...
 
- Static Public Attributes inherited from Layer
static const Geometry::Bounds EntireRegion
 When used as layer bounds, represents the entire region its placed in. More...
 

Detailed Description

Input layer allows mouse events to be handled.

Location of mouse events are normalized to the layer. If hit check is not set, entire region of the layer is set to receive events. This means, if click is handled, any layer beneath this layer will not receive mouse down event prior to click event. All event functions may contain original layer, or that parameter can also be skipped. Handlers accept many different function signatures. For instance, if you want to handle left click event with member function of class Button you can register handler using the following line:

layer.SetClick(this,

The order of handlers is: out, over, move then others. When the mouse button is pressed over a layer, mouse move is always sent to that layer. During this operation, mouse over and out events are triggered.

Member Function Documentation

◆ FireClick()

void FireClick ( Geometry::Point  location,
Input::Mouse::Button  button 
)

Fires the click event manually, allowing both mouse up and click events to happen at the same time.

References Layer::click.

◆ propagate_mouseevent()

◆ ResetClick()

void ResetClick ( )

Removes click handler.

References Layer::click.

◆ ResetDown()

void ResetDown ( )

Removes mouse down handler.

References Layer::down.

◆ ResetHitCheck()

void ResetHitCheck ( )

Removes hit check handler, default action for hit check is to return true.

References Layer::hitcheck.

◆ ResetHScroll()

void ResetHScroll ( )

Removes horizontal scroll handler.

References Layer::hscroll.

◆ ResetMove()

void ResetMove ( )

Removes mouse move handler.

References Layer::move.

◆ ResetOut()

void ResetOut ( )

Removes mouse out handler.

References Layer::out.

◆ ResetOver()

void ResetOver ( )

Removes mouse over handler.

References Layer::over.

◆ ResetRotate()

void ResetRotate ( )

Removes rotate handler.

References Layer::rotate.

◆ ResetScroll()

void ResetScroll ( )

Removes scroll handler.

References Layer::vscroll.

◆ ResetUp()

void ResetUp ( )

Removes mouse up handler.

References Layer::up.

◆ ResetZoom()

void ResetZoom ( )

Removes zoom handler.

References Layer::zoom.

◆ SetClick() [1/24]

void SetClick ( C_ &  c,
std::function< void(C_ &)>  fn,
Input::Mouse::Button  btn = Input::Mouse::Button::Left 
)

Sets click handler.

If hit check function is set, this event is only called if hit check returns true. This variant accepts class member function.

References Layer::click.

◆ SetClick() [2/24]

void SetClick ( C_ &  c,
void(C_::*)(Geometry::Point fn,
Input::Mouse::Button  btn = Input::Mouse::Button::Left 
)

Sets click handler.

If hit check function is set, this event is only called if hit check returns true. This variant accepts class member function.

References Layer::click.

◆ SetClick() [3/24]

void SetClick ( C_ &  c,
void(C_::*)(Geometry::Point, Input::Mouse::Button fn 
)

Sets click handler.

If hit check function is set, this event is only called if hit check returns true. This variant accepts class member function.

References Layer::click.

◆ SetClick() [4/24]

void SetClick ( C_ &  c,
void(C_::*)(Input::Mouse::Button fn 
)

Sets click handler.

If hit check function is set, this event is only called if hit check returns true. This variant accepts class member function.

References Layer::click.

◆ SetClick() [5/24]

void SetClick ( C_ &  c,
void(C_::*)(Layer &)  fn,
Input::Mouse::Button  btn = Input::Mouse::Button::Left 
)

Sets click handler.

If hit check function is set, this event is only called if hit check returns true. This variant accepts class member function.

References Layer::click.

◆ SetClick() [6/24]

void SetClick ( C_ &  c,
void(C_::*)(Layer &, Geometry::Point fn,
Input::Mouse::Button  btn = Input::Mouse::Button::Left 
)

Sets click handler.

If hit check function is set, this event is only called if hit check returns true. This variant accepts class member function.

References Layer::click.

◆ SetClick() [7/24]

void SetClick ( C_ &  c,
void(C_::*)(Layer &, Geometry::Point, Input::Mouse::Button fn 
)

Sets click handler.

If hit check function is set, this event is only called if hit check returns true. This variant accepts class member function.

References Layer::click.

◆ SetClick() [8/24]

void SetClick ( C_ &  c,
void(C_::*)(Layer &, Input::Mouse::Button fn 
)

Sets click handler.

If hit check function is set, this event is only called if hit check returns true. This variant accepts class member function.

References Layer::click.

◆ SetClick() [9/24]

void SetClick ( C_ *  my,
std::function< void(C_ &)>  fn,
Input::Mouse::Button  btn = Input::Mouse::Button::Left 
)

Sets click handler.

If hit check function is set, this event is only called if hit check returns true. This variant accepts class member function.

References Layer::click.

◆ SetClick() [10/24]

void SetClick ( C_ *  my,
void(C_::*)(Geometry::Point fn,
Input::Mouse::Button  btn = Input::Mouse::Button::Left 
)

Sets click handler.

If hit check function is set, this event is only called if hit check returns true. This variant accepts class member function.

References Layer::click.

◆ SetClick() [11/24]

void SetClick ( C_ *  my,
void(C_::*)(Geometry::Point, Input::Mouse::Button fn 
)

Sets click handler.

If hit check function is set, this event is only called if hit check returns true. This variant accepts class member function.

References Layer::click.

◆ SetClick() [12/24]

void SetClick ( C_ *  my,
void(C_::*)(Input::Mouse::Button fn 
)

Sets click handler.

If hit check function is set, this event is only called if hit check returns true. This variant accepts class member function.

References Layer::click.

◆ SetClick() [13/24]

void SetClick ( C_ *  my,
void(C_::*)(Layer &)  fn,
Input::Mouse::Button  btn = Input::Mouse::Button::Left 
)

Sets click handler.

If hit check function is set, this event is only called if hit check returns true. This variant accepts class member function.

References Layer::click.

◆ SetClick() [14/24]

void SetClick ( C_ *  my,
void(C_::*)(Layer &, Geometry::Point fn,
Input::Mouse::Button  btn = Input::Mouse::Button::Left 
)

Sets click handler.

If hit check function is set, this event is only called if hit check returns true. This variant accepts class member function.

References Layer::click.

◆ SetClick() [15/24]

void SetClick ( C_ *  my,
void(C_::*)(Layer &, Geometry::Point, Input::Mouse::Button fn 
)

Sets click handler.

If hit check function is set, this event is only called if hit check returns true. This variant accepts class member function.

References Layer::click.

◆ SetClick() [16/24]

void SetClick ( C_ *  my,
void(C_::*)(Layer &, Input::Mouse::Button fn 
)

Sets click handler.

If hit check function is set, this event is only called if hit check returns true. This variant accepts class member function.

References Layer::click.

◆ SetClick() [17/24]

void SetClick ( std::function< void()>  fn,
Input::Mouse::Button  btn = Input::Mouse::Button::Left 
)

Sets click handler.

If hit check function is set, this event is only called if hit check returns true.

References Layer::click.

◆ SetClick() [18/24]

void SetClick ( std::function< void(Geometry::Point)>  fn,
Input::Mouse::Button  btn = Input::Mouse::Button::Left 
)

Sets click handler.

If hit check function is set, this event is only called if hit check returns true.

References Layer::click.

◆ SetClick() [19/24]

void SetClick ( std::function< void(Geometry::Point, Input::Mouse::Button)>  fn)

Sets click handler.

If hit check function is set, this event is only called if hit check returns true.

References Layer::click.

◆ SetClick() [20/24]

void SetClick ( std::function< void(Input::Mouse::Button)>  fn)

Sets click handler.

If hit check function is set, this event is only called if hit check returns true.

References Layer::click.

◆ SetClick() [21/24]

void SetClick ( std::function< void(Layer &)>  fn,
Input::Mouse::Button  btn = Input::Mouse::Button::Left 
)

Sets click handler.

If hit check function is set, this event is only called if hit check returns true.

References Layer::click.

◆ SetClick() [22/24]

void SetClick ( std::function< void(Layer &, Geometry::Point)>  fn,
Input::Mouse::Button  btn = Input::Mouse::Button::Left 
)

Sets click handler.

If hit check function is set, this event is only called if hit check returns true.

References Layer::click.

◆ SetClick() [23/24]

void SetClick ( std::function< void(Layer &, Geometry::Point, Input::Mouse::Button)>  fn)

Sets click handler.

If hit check function is set, this event is only called if hit check returns true.

References Layer::click.

◆ SetClick() [24/24]

void SetClick ( std::function< void(Layer &, Input::Mouse::Button)>  fn)

Sets click handler.

If hit check function is set, this event is only called if hit check returns true.

References Layer::click.

◆ SetDown() [1/24]

void SetDown ( C_ &  c,
std::function< void(C_ &)>  fn,
Input::Mouse::Button  btn = Input::Mouse::Button::Left 
)

Sets mouse down handler.

If hit check function is set, this event is only called if hit check returns true. This variant accepts class member function.

References Layer::down.

◆ SetDown() [2/24]

void SetDown ( C_ &  c,
void(C_::*)(Geometry::Point fn,
Input::Mouse::Button  btn = Input::Mouse::Button::Left 
)

Sets mouse down handler.

If hit check function is set, this event is only called if hit check returns true. This variant accepts class member function.

References Layer::down.

◆ SetDown() [3/24]

void SetDown ( C_ &  c,
void(C_::*)(Geometry::Point, Input::Mouse::Button fn 
)

Sets mouse down handler.

If hit check function is set, this event is only called if hit check returns true. This variant accepts class member function.

References Layer::down.

◆ SetDown() [4/24]

void SetDown ( C_ &  c,
void(C_::*)(Input::Mouse::Button fn 
)

Sets mouse down handler.

If hit check function is set, this event is only called if hit check returns true. This variant accepts class member function.

References Layer::down.

◆ SetDown() [5/24]

void SetDown ( C_ &  c,
void(C_::*)(Layer &)  fn,
Input::Mouse::Button  btn = Input::Mouse::Button::Left 
)

Sets mouse down handler.

If hit check function is set, this event is only called if hit check returns true. This variant accepts class member function.

References Layer::down.

◆ SetDown() [6/24]

void SetDown ( C_ &  c,
void(C_::*)(Layer &, Geometry::Point fn,
Input::Mouse::Button  btn = Input::Mouse::Button::Left 
)

Sets mouse down handler.

If hit check function is set, this event is only called if hit check returns true. This variant accepts class member function.

References Layer::down.

◆ SetDown() [7/24]

void SetDown ( C_ &  c,
void(C_::*)(Layer &, Geometry::Point, Input::Mouse::Button fn 
)

Sets mouse down handler.

If hit check function is set, this event is only called if hit check returns true. This variant accepts class member function.

References Layer::down.

◆ SetDown() [8/24]

void SetDown ( C_ &  c,
void(C_::*)(Layer &, Input::Mouse::Button fn 
)

Sets mouse down handler.

If hit check function is set, this event is only called if hit check returns true. This variant accepts class member function.

References Layer::down.

◆ SetDown() [9/24]

void SetDown ( C_ *  my,
std::function< void(C_ &)>  fn,
Input::Mouse::Button  btn = Input::Mouse::Button::Left 
)

Sets mouse down handler.

If hit check function is set, this event is only called if hit check returns true. This variant accepts class member function.

References Layer::down.

◆ SetDown() [10/24]

void SetDown ( C_ *  my,
void(C_::*)(Geometry::Point fn,
Input::Mouse::Button  btn = Input::Mouse::Button::Left 
)

Sets mouse down handler.

If hit check function is set, this event is only called if hit check returns true. This variant accepts class member function.

References Layer::down.

◆ SetDown() [11/24]

void SetDown ( C_ *  my,
void(C_::*)(Geometry::Point, Input::Mouse::Button fn 
)

Sets mouse down handler.

If hit check function is set, this event is only called if hit check returns true. This variant accepts class member function.

References Layer::down.

◆ SetDown() [12/24]

void SetDown ( C_ *  my,
void(C_::*)(Input::Mouse::Button fn 
)

Sets mouse down handler.

If hit check function is set, this event is only called if hit check returns true. This variant accepts class member function.

References Layer::down.

◆ SetDown() [13/24]

void SetDown ( C_ *  my,
void(C_::*)(Layer &)  fn,
Input::Mouse::Button  btn = Input::Mouse::Button::Left 
)

Sets mouse down handler.

If hit check function is set, this event is only called if hit check returns true. This variant accepts class member function.

References Layer::down.

◆ SetDown() [14/24]

void SetDown ( C_ *  my,
void(C_::*)(Layer &, Geometry::Point fn,
Input::Mouse::Button  btn = Input::Mouse::Button::Left 
)

Sets mouse down handler.

If hit check function is set, this event is only called if hit check returns true. This variant accepts class member function.

References Layer::down.

◆ SetDown() [15/24]

void SetDown ( C_ *  my,
void(C_::*)(Layer &, Geometry::Point, Input::Mouse::Button fn 
)

Sets mouse down handler.

If hit check function is set, this event is only called if hit check returns true. This variant accepts class member function.

References Layer::down.

◆ SetDown() [16/24]

void SetDown ( C_ *  my,
void(C_::*)(Layer &, Input::Mouse::Button fn 
)

Sets mouse down handler.

If hit check function is set, this event is only called if hit check returns true. This variant accepts class member function.

References Layer::down.

◆ SetDown() [17/24]

void SetDown ( std::function< void()>  fn,
Input::Mouse::Button  btn = Input::Mouse::Button::Left 
)

Sets mouse down handler.

If hit check function is set, this event is only called if hit check returns true.

References Layer::down.

◆ SetDown() [18/24]

void SetDown ( std::function< void(Geometry::Point)>  fn,
Input::Mouse::Button  btn = Input::Mouse::Button::Left 
)

Sets mouse down handler.

If hit check function is set, this event is only called if hit check returns true.

References Layer::down.

◆ SetDown() [19/24]

void SetDown ( std::function< void(Geometry::Point, Input::Mouse::Button)>  fn)

Sets mouse down handler.

If hit check function is set, this event is only called if hit check returns true.

References Layer::down.

◆ SetDown() [20/24]

void SetDown ( std::function< void(Input::Mouse::Button)>  fn)

Sets mouse down handler.

If hit check function is set, this event is only called if hit check returns true.

References Layer::down.

◆ SetDown() [21/24]

void SetDown ( std::function< void(Layer &)>  fn,
Input::Mouse::Button  btn = Input::Mouse::Button::Left 
)

Sets mouse down handler.

If hit check function is set, this event is only called if hit check returns true.

References Layer::down.

◆ SetDown() [22/24]

void SetDown ( std::function< void(Layer &, Geometry::Point)>  fn,
Input::Mouse::Button  btn = Input::Mouse::Button::Left 
)

Sets mouse down handler.

If hit check function is set, this event is only called if hit check returns true.

References Layer::down.

◆ SetDown() [23/24]

void SetDown ( std::function< void(Layer &, Geometry::Point, Input::Mouse::Button)>  fn)

Sets mouse down handler.

If hit check function is set, this event is only called if hit check returns true.

References Layer::down.

◆ SetDown() [24/24]

void SetDown ( std::function< void(Layer &, Input::Mouse::Button)>  fn)

Sets mouse down handler.

If hit check function is set, this event is only called if hit check returns true.

References Layer::down.

◆ SetHitCheck() [1/6]

void SetHitCheck ( C_ &  c,
bool(C_::*)(Geometry::Point fn 
)

Sets hit check function.

When set, events only occur if hit check returns true. Events follow hit check in a sequential manner, thus, if a handler is called, this means hit check has already succeeded in the current layout. This variant accepts class member function.

References Layer::hitcheck.

◆ SetHitCheck() [2/6]

void SetHitCheck ( C_ &  c,
bool(C_::*)(Layer &, Geometry::Point fn 
)

Sets hit check function.

When set, events only occur if hit check returns true. Events follow hit check in a sequential manner, thus, if a handler is called, this means hit check has already succeeded in the current layout. This variant accepts class member function.

References Layer::hitcheck.

◆ SetHitCheck() [3/6]

void SetHitCheck ( C_ *  my,
bool(C_::*)(Geometry::Point fn 
)

Sets hit check function.

When set, events only occur if hit check returns true. Events follow hit check in a sequential manner, thus, if a handler is called, this means hit check has already succeeded in the current layout. This variant accepts class member function.

References Layer::hitcheck.

◆ SetHitCheck() [4/6]

void SetHitCheck ( C_ *  my,
bool(C_::*)(Layer &, Geometry::Point fn 
)

Sets hit check function.

When set, events only occur if hit check returns true. Events follow hit check in a sequential manner, thus, if a handler is called, this means hit check has already succeeded in the current layout. This variant accepts class member function.

References Layer::hitcheck.

◆ SetHitCheck() [5/6]

void SetHitCheck ( std::function< bool(Geometry::Point)>  fn)

Sets hit check function.

When set, events only occur if hit check returns true. Events follow hit check in a sequential manner, thus, if a handler is called, this means hit check has already succeeded in the current layout.

References Layer::hitcheck.

◆ SetHitCheck() [6/6]

void SetHitCheck ( std::function< bool(Layer &, Geometry::Point)>  fn)

Sets hit check function.

When set, events only occur if hit check returns true. Events follow hit check in a sequential manner, thus, if a handler is called, this means hit check has already succeeded in the current layout.

References Layer::hitcheck.

◆ SetHScroll() [1/12]

void SetHScroll ( C_ &  c,
bool(C_::*)(float)  fn 
)

Sets horizontal scroll handler.

Scrolling right will give negative number while scrolling left will give a positive number. 1 means one full scroll. If the device supports smooth scrolling, partial values can be obtained. Not all devices support horizontal scrolling.

References Layer::hscroll.

◆ SetHScroll() [2/12]

void SetHScroll ( C_ &  c,
bool(C_::*)(Geometry::Point, float)  fn 
)

Sets horizontal scroll handler.

Scrolling right will give negative number while scrolling left will give a positive number. 1 means one full scroll. If the device supports smooth scrolling, partial values can be obtained. Not all devices support horizontal scrolling.

References Layer::hscroll.

◆ SetHScroll() [3/12]

void SetHScroll ( C_ &  c,
bool(C_::*)(Layer &, float)  fn 
)

Sets horizontal scroll handler.

Scrolling right will give negative number while scrolling left will give a positive number. 1 means one full scroll. If the device supports smooth scrolling, partial values can be obtained. Not all devices support horizontal scrolling.

References Layer::hscroll.

◆ SetHScroll() [4/12]

void SetHScroll ( C_ &  c,
bool(C_::*)(Layer &, Geometry::Point, float)  fn 
)

Sets horizontal scroll handler.

Scrolling right will give negative number while scrolling left will give a positive number. 1 means one full scroll. If the device supports smooth scrolling, partial values can be obtained. Not all devices support horizontal scrolling.

References Layer::hscroll.

◆ SetHScroll() [5/12]

void SetHScroll ( C_ *  my,
bool(C_::*)(float)  fn 
)

Sets horizontal scroll handler.

Scrolling right will give negative number while scrolling left will give a positive number. 1 means one full scroll. If the device supports smooth scrolling, partial values can be obtained. Not all devices support horizontal scrolling.

References Layer::hscroll.

◆ SetHScroll() [6/12]

void SetHScroll ( C_ *  my,
bool(C_::*)(Geometry::Point, float)  fn 
)

Sets horizontal scroll handler.

Scrolling right will give negative number while scrolling left will give a positive number. 1 means one full scroll. If the device supports smooth scrolling, partial values can be obtained. Not all devices support horizontal scrolling.

References Layer::hscroll.

◆ SetHScroll() [7/12]

void SetHScroll ( C_ *  my,
bool(C_::*)(Layer &, float)  fn 
)

Sets horizontal scroll handler.

Scrolling right will give negative number while scrolling left will give a positive number. 1 means one full scroll. If the device supports smooth scrolling, partial values can be obtained. Not all devices support horizontal scrolling.

References Layer::hscroll.

◆ SetHScroll() [8/12]

void SetHScroll ( C_ *  my,
bool(C_::*)(Layer &, Geometry::Point, float)  fn 
)

Sets horizontal scroll handler.

Scrolling right will give negative number while scrolling left will give a positive number. 1 means one full scroll. If the device supports smooth scrolling, partial values can be obtained. Not all devices support horizontal scrolling.

References Layer::hscroll.

◆ SetHScroll() [9/12]

void SetHScroll ( std::function< bool(float)>  fn)

Sets horizontal scroll handler.

Scrolling right will give negative number while scrolling left will give a positive number. 1 means one full scroll. If the device supports smooth scrolling, partial values can be obtained. Not all devices support horizontal scrolling.

References Layer::hscroll.

◆ SetHScroll() [10/12]

void SetHScroll ( std::function< bool(Geometry::Point, float)>  fn)

Sets horizontal scroll handler.

Scrolling right will give negative number while scrolling left will give a positive number. 1 means one full scroll. If the device supports smooth scrolling, partial values can be obtained. Not all devices support horizontal scrolling.

References Layer::hscroll.

◆ SetHScroll() [11/12]

void SetHScroll ( std::function< bool(Layer &, float)>  fn)

Sets horizontal scroll handler.

Scrolling right will give negative number while scrolling left will give a positive number. 1 means one full scroll. If the device supports smooth scrolling, partial values can be obtained. Not all devices support horizontal scrolling.

References Layer::hscroll.

◆ SetHScroll() [12/12]

void SetHScroll ( std::function< bool(Layer &, Geometry::Point, float)>  fn)

Sets horizontal scroll handler.

Scrolling right will give negative number while scrolling left will give a positive number. 1 means one full scroll. If the device supports smooth scrolling, partial values can be obtained. Not all devices support horizontal scrolling.

References Layer::hscroll.

◆ SetMove() [1/6]

void SetMove ( C_ &  c,
void(C_::*)(Geometry::Point fn 
)

Sets mouse move handler.

This function will be called every frame when the mouse is over the layer, even if the mouse does not move.

References Layer::move.

◆ SetMove() [2/6]

void SetMove ( C_ &  c,
void(C_::*)(Layer &, Geometry::Point fn 
)

Sets mouse move handler.

This function will be called every frame when the mouse is over the layer, even if the mouse does not move.

References Layer::move.

◆ SetMove() [3/6]

void SetMove ( C_ *  my,
void(C_::*)(Geometry::Point fn 
)

Sets mouse move handler.

This function will be called every frame when the mouse is over the layer, even if the mouse does not move.

References Layer::move.

◆ SetMove() [4/6]

void SetMove ( C_ *  my,
void(C_::*)(Layer &, Geometry::Point fn 
)

Sets mouse move handler.

This function will be called every frame when the mouse is over the layer, even if the mouse does not move.

References Layer::move.

◆ SetMove() [5/6]

void SetMove ( std::function< void(Geometry::Point)>  fn)

Sets mouse move handler.

This function will be called every frame when the mouse is over the layer, even if the mouse does not move.

References Layer::move.

◆ SetMove() [6/6]

void SetMove ( std::function< void(Layer &, Geometry::Point)>  fn)

Sets mouse move handler.

This function will be called every frame when the mouse is over the layer, even if the mouse does not move.

References Layer::move.

◆ SetOut() [1/6]

void SetOut ( C_ &  c,
std::function< void(C_ &)>  fn 
)

Sets mouse out handler.

References Layer::out.

◆ SetOut() [2/6]

void SetOut ( C_ &  c,
void(C_::*)(Layer &)  fn 
)

Sets mouse out handler.

References Layer::out.

◆ SetOut() [3/6]

void SetOut ( C_ *  my,
std::function< void(C_ &)>  fn 
)

Sets mouse out handler.

References Layer::out.

◆ SetOut() [4/6]

void SetOut ( C_ *  my,
void(C_::*)(Layer &)  fn 
)

Sets mouse out handler.

References Layer::out.

◆ SetOut() [5/6]

void SetOut ( std::function< void()>  fn)

Sets mouse out handler.

References Layer::out.

◆ SetOut() [6/6]

void SetOut ( std::function< void(Layer &)>  fn)

Sets mouse out handler.

References Layer::out.

◆ SetOver() [1/6]

void SetOver ( C_ &  c,
std::function< void(C_ &)>  fn 
)

Sets mouse over handler.

Mouse over occurs for parent layers of a layer as well. However, If two siblings overlap, only one will receive it.

References Layer::over.

◆ SetOver() [2/6]

void SetOver ( C_ &  c,
void(C_::*)(Layer &)  fn 
)

Sets mouse over handler.

Mouse over occurs for parent layers of a layer as well. However, If two siblings overlap, only one will receive it.

References Layer::over.

◆ SetOver() [3/6]

void SetOver ( C_ *  my,
std::function< void(C_ &)>  fn 
)

Sets mouse over handler.

Mouse over occurs for parent layers of a layer as well. However, If two siblings overlap, only one will receive it.

References Layer::over.

◆ SetOver() [4/6]

void SetOver ( C_ *  my,
void(C_::*)(Layer &)  fn 
)

Sets mouse over handler.

Mouse over occurs for parent layers of a layer as well. However, If two siblings overlap, only one will receive it.

References Layer::over.

◆ SetOver() [5/6]

void SetOver ( std::function< void()>  fn)

Sets mouse over handler.

Mouse over occurs for parent layers of a layer as well. However, If two siblings overlap, only one will receive it.

References Layer::over.

◆ SetOver() [6/6]

void SetOver ( std::function< void(Layer &)>  fn)

Sets mouse over handler.

Mouse over occurs for parent layers of a layer as well. However, If two siblings overlap, only one will receive it.

References Layer::over.

◆ SetRotate() [1/12]

void SetRotate ( C_ &  c,
bool(C_::*)(float)  fn 
)

Sets rotate handler.

Rotate amount is given in radians. Positive values should rotate counter clockwise. Not all devices support rotation gesture.

References Layer::rotate.

◆ SetRotate() [2/12]

void SetRotate ( C_ &  c,
bool(C_::*)(Geometry::Point, float)  fn 
)

Sets rotate handler.

Rotate amount is given in radians. Positive values should rotate counter clockwise. Not all devices support rotation gesture.

References Layer::rotate.

◆ SetRotate() [3/12]

void SetRotate ( C_ &  c,
bool(C_::*)(Layer &, float)  fn 
)

Sets rotate handler.

Rotate amount is given in radians. Positive values should rotate counter clockwise. Not all devices support rotation gesture.

References Layer::rotate.

◆ SetRotate() [4/12]

void SetRotate ( C_ &  c,
bool(C_::*)(Layer &, Geometry::Point, float)  fn 
)

Sets rotate handler.

Rotate amount is given in radians. Positive values should rotate counter clockwise. Not all devices support rotation gesture.

References Layer::rotate.

◆ SetRotate() [5/12]

void SetRotate ( C_ *  my,
bool(C_::*)(float)  fn 
)

Sets rotate handler.

Rotate amount is given in radians. Positive values should rotate counter clockwise. Not all devices support rotation gesture.

References Layer::rotate.

◆ SetRotate() [6/12]

void SetRotate ( C_ *  my,
bool(C_::*)(Geometry::Point, float)  fn 
)

Sets rotate handler.

Rotate amount is given in radians. Positive values should rotate counter clockwise. Not all devices support rotation gesture.

References Layer::rotate.

◆ SetRotate() [7/12]

void SetRotate ( C_ *  my,
bool(C_::*)(Layer &, float)  fn 
)

Sets rotate handler.

Rotate amount is given in radians. Positive values should rotate counter clockwise. Not all devices support rotation gesture.

References Layer::rotate.

◆ SetRotate() [8/12]

void SetRotate ( C_ *  my,
bool(C_::*)(Layer &, Geometry::Point, float)  fn 
)

Sets rotate handler.

Rotate amount is given in radians. Positive values should rotate counter clockwise. Not all devices support rotation gesture.

References Layer::rotate.

◆ SetRotate() [9/12]

void SetRotate ( std::function< bool(float)>  fn)

Sets rotate handler.

Rotate amount is given in radians. Positive values should rotate counter clockwise. Not all devices support rotation gesture.

References Layer::rotate.

◆ SetRotate() [10/12]

void SetRotate ( std::function< bool(Geometry::Point, float)>  fn)

Sets rotate handler.

Rotate amount is given in radians. Positive values should rotate counter clockwise. Not all devices support rotation gesture.

References Layer::rotate.

◆ SetRotate() [11/12]

void SetRotate ( std::function< bool(Layer &, float)>  fn)

Sets rotate handler.

Rotate amount is given in radians. Positive values should rotate counter clockwise. Not all devices support rotation gesture.

References Layer::rotate.

◆ SetRotate() [12/12]

void SetRotate ( std::function< bool(Layer &, Geometry::Point, float)>  fn)

Sets rotate handler.

Rotate amount is given in radians. Positive values should rotate counter clockwise. Not all devices support rotation gesture.

References Layer::rotate.

◆ SetScroll() [1/12]

void SetScroll ( C_ &  c,
bool(C_::*)(float)  fn 
)

Sets scroll handler.

Scrolling down will give negative number while scrolling up will give a positive number. 1 means one full scroll. If the device supports smooth scrolling, partial values can be obtained.

References Layer::vscroll.

◆ SetScroll() [2/12]

void SetScroll ( C_ &  c,
bool(C_::*)(Geometry::Point, float)  fn 
)

Sets scroll handler.

Scrolling down will give negative number while scrolling up will give a positive number. 1 means one full scroll. If the device supports smooth scrolling, partial values can be obtained.

References Layer::vscroll.

◆ SetScroll() [3/12]

void SetScroll ( C_ &  c,
bool(C_::*)(Layer &, float)  fn 
)

Sets scroll handler.

Scrolling down will give negative number while scrolling up will give a positive number. 1 means one full scroll. If the device supports smooth scrolling, partial values can be obtained.

References Layer::vscroll.

◆ SetScroll() [4/12]

void SetScroll ( C_ &  c,
bool(C_::*)(Layer &, Geometry::Point, float)  fn 
)

Sets scroll handler.

Scrolling down will give negative number while scrolling up will give a positive number. 1 means one full scroll. If the device supports smooth scrolling, partial values can be obtained.

References Layer::vscroll.

◆ SetScroll() [5/12]

void SetScroll ( C_ *  my,
bool(C_::*)(float)  fn 
)

Sets scroll handler.

Scrolling down will give negative number while scrolling up will give a positive number. 1 means one full scroll. If the device supports smooth scrolling, partial values can be obtained.

References Layer::vscroll.

◆ SetScroll() [6/12]

void SetScroll ( C_ *  my,
bool(C_::*)(Geometry::Point, float)  fn 
)

Sets scroll handler.

Scrolling down will give negative number while scrolling up will give a positive number. 1 means one full scroll. If the device supports smooth scrolling, partial values can be obtained.

References Layer::vscroll.

◆ SetScroll() [7/12]

void SetScroll ( C_ *  my,
bool(C_::*)(Layer &, float)  fn 
)

Sets scroll handler.

Scrolling down will give negative number while scrolling up will give a positive number. 1 means one full scroll. If the device supports smooth scrolling, partial values can be obtained.

References Layer::vscroll.

◆ SetScroll() [8/12]

void SetScroll ( C_ *  my,
bool(C_::*)(Layer &, Geometry::Point, float)  fn 
)

Sets scroll handler.

Scrolling down will give negative number while scrolling up will give a positive number. 1 means one full scroll. If the device supports smooth scrolling, partial values can be obtained.

References Layer::vscroll.

◆ SetScroll() [9/12]

void SetScroll ( std::function< bool(float)>  fn)

Sets scroll handler.

Scrolling down will give negative number while scrolling up will give a positive number. 1 means one full scroll. If the device supports smooth scrolling, partial values can be obtained.

References Layer::vscroll.

◆ SetScroll() [10/12]

void SetScroll ( std::function< bool(Geometry::Point, float)>  fn)

Sets scroll handler.

Scrolling down will give negative number while scrolling up will give a positive number. 1 means one full scroll. If the device supports smooth scrolling, partial values can be obtained.

References Layer::vscroll.

◆ SetScroll() [11/12]

void SetScroll ( std::function< bool(Layer &, float)>  fn)

Sets scroll handler.

Scrolling down will give negative number while scrolling up will give a positive number. 1 means one full scroll. If the device supports smooth scrolling, partial values can be obtained.

References Layer::vscroll.

◆ SetScroll() [12/12]

void SetScroll ( std::function< bool(Layer &, Geometry::Point, float)>  fn)

Sets scroll handler.

Scrolling down will give negative number while scrolling up will give a positive number. 1 means one full scroll. If the device supports smooth scrolling, partial values can be obtained.

References Layer::vscroll.

◆ SetUp() [1/24]

void SetUp ( C_ &  c,
std::function< void(C_ &)>  fn,
Input::Mouse::Button  btn = Input::Mouse::Button::Left 
)

Sets mouse up handler.

If hit check function is set, this event is only called if hit check returns true and mouse down is also handled. This variant accepts class member function.

References Layer::up.

◆ SetUp() [2/24]

void SetUp ( C_ &  c,
void(C_::*)(Geometry::Point fn,
Input::Mouse::Button  btn = Input::Mouse::Button::Left 
)

Sets mouse up handler.

If hit check function is set, this event is only called if hit check returns true and mouse down is also handled. This variant accepts class member function.

References Layer::up.

◆ SetUp() [3/24]

void SetUp ( C_ &  c,
void(C_::*)(Geometry::Point, Input::Mouse::Button fn 
)

Sets mouse up handler.

If hit check function is set, this event is only called if hit check returns true and mouse down is also handled. This variant accepts class member function.

References Layer::up.

◆ SetUp() [4/24]

void SetUp ( C_ &  c,
void(C_::*)(Input::Mouse::Button fn 
)

Sets mouse up handler.

If hit check function is set, this event is only called if hit check returns true and mouse down is also handled. This variant accepts class member function.

References Layer::up.

◆ SetUp() [5/24]

void SetUp ( C_ &  c,
void(C_::*)(Layer &)  fn,
Input::Mouse::Button  btn = Input::Mouse::Button::Left 
)

Sets mouse up handler.

If hit check function is set, this event is only called if hit check returns true and mouse down is also handled. This variant accepts class member function.

References Layer::up.

◆ SetUp() [6/24]

void SetUp ( C_ &  c,
void(C_::*)(Layer &, Geometry::Point fn,
Input::Mouse::Button  btn = Input::Mouse::Button::Left 
)

Sets mouse up handler.

If hit check function is set, this event is only called if hit check returns true and mouse down is also handled. This variant accepts class member function.

References Layer::up.

◆ SetUp() [7/24]

void SetUp ( C_ &  c,
void(C_::*)(Layer &, Geometry::Point, Input::Mouse::Button fn 
)

Sets mouse up handler.

If hit check function is set, this event is only called if hit check returns true and mouse down is also handled. This variant accepts class member function.

References Layer::up.

◆ SetUp() [8/24]

void SetUp ( C_ &  c,
void(C_::*)(Layer &, Input::Mouse::Button fn 
)

Sets mouse up handler.

If hit check function is set, this event is only called if hit check returns true and mouse down is also handled. This variant accepts class member function.

References Layer::up.

◆ SetUp() [9/24]

void SetUp ( C_ *  my,
std::function< void(C_ &)>  fn,
Input::Mouse::Button  btn = Input::Mouse::Button::Left 
)

Sets mouse up handler.

If hit check function is set, this event is only called if hit check returns true and mouse down is also handled. This variant accepts class member function.

References Layer::up.

◆ SetUp() [10/24]

void SetUp ( C_ *  my,
void(C_::*)(Geometry::Point fn,
Input::Mouse::Button  btn = Input::Mouse::Button::Left 
)

Sets mouse up handler.

If hit check function is set, this event is only called if hit check returns true and mouse down is also handled. This variant accepts class member function.

References Layer::up.

◆ SetUp() [11/24]

void SetUp ( C_ *  my,
void(C_::*)(Geometry::Point, Input::Mouse::Button fn 
)

Sets mouse up handler.

If hit check function is set, this event is only called if hit check returns true and mouse down is also handled. This variant accepts class member function.

References Layer::up.

◆ SetUp() [12/24]

void SetUp ( C_ *  my,
void(C_::*)(Input::Mouse::Button fn 
)

Sets mouse up handler.

If hit check function is set, this event is only called if hit check returns true and mouse down is also handled. This variant accepts class member function.

References Layer::up.

◆ SetUp() [13/24]

void SetUp ( C_ *  my,
void(C_::*)(Layer &)  fn,
Input::Mouse::Button  btn = Input::Mouse::Button::Left 
)

Sets mouse up handler.

If hit check function is set, this event is only called if hit check returns true and mouse down is also handled. This variant accepts class member function.

References Layer::up.

◆ SetUp() [14/24]

void SetUp ( C_ *  my,
void(C_::*)(Layer &, Geometry::Point fn,
Input::Mouse::Button  btn = Input::Mouse::Button::Left 
)

Sets mouse up handler.

If hit check function is set, this event is only called if hit check returns true and mouse down is also handled. This variant accepts class member function.

References Layer::up.

◆ SetUp() [15/24]

void SetUp ( C_ *  my,
void(C_::*)(Layer &, Geometry::Point, Input::Mouse::Button fn 
)

Sets mouse up handler.

If hit check function is set, this event is only called if hit check returns true and mouse down is also handled. This variant accepts class member function.

References Layer::up.

◆ SetUp() [16/24]

void SetUp ( C_ *  my,
void(C_::*)(Layer &, Input::Mouse::Button fn 
)

Sets mouse up handler.

If hit check function is set, this event is only called if hit check returns true and mouse down is also handled. This variant accepts class member function.

References Layer::up.

◆ SetUp() [17/24]

void SetUp ( std::function< void()>  fn,
Input::Mouse::Button  btn = Input::Mouse::Button::Left 
)

Sets mouse up handler.

If hit check function is set, this event is only called if hit check returns true and mouse down is also handled.

References Layer::up.

◆ SetUp() [18/24]

void SetUp ( std::function< void(Geometry::Point)>  fn,
Input::Mouse::Button  btn = Input::Mouse::Button::Left 
)

Sets mouse up handler.

If hit check function is set, this event is only called if hit check returns true and mouse down is also handled.

References Layer::up.

◆ SetUp() [19/24]

void SetUp ( std::function< void(Geometry::Point, Input::Mouse::Button)>  fn)

Sets mouse up handler.

If hit check function is set, this event is only called if hit check returns true and mouse down is also handled.

References Layer::up.

◆ SetUp() [20/24]

void SetUp ( std::function< void(Input::Mouse::Button)>  fn)

Sets mouse up handler.

If hit check function is set, this event is only called if hit check returns true and mouse down is also handled.

References Layer::up.

◆ SetUp() [21/24]

void SetUp ( std::function< void(Layer &)>  fn,
Input::Mouse::Button  btn = Input::Mouse::Button::Left 
)

Sets mouse up handler.

If hit check function is set, this event is only called if hit check returns true and mouse down is also handled.

References Layer::up.

◆ SetUp() [22/24]

void SetUp ( std::function< void(Layer &, Geometry::Point)>  fn,
Input::Mouse::Button  btn = Input::Mouse::Button::Left 
)

Sets mouse up handler.

If hit check function is set, this event is only called if hit check returns true and mouse down is also handled.

References Layer::up.

◆ SetUp() [23/24]

void SetUp ( std::function< void(Layer &, Geometry::Point, Input::Mouse::Button)>  fn)

Sets mouse up handler.

If hit check function is set, this event is only called if hit check returns true and mouse down is also handled.

References Layer::up.

◆ SetUp() [24/24]

void SetUp ( std::function< void(Layer &, Input::Mouse::Button)>  fn)

Sets mouse up handler.

If hit check function is set, this event is only called if hit check returns true and mouse down is also handled.

References Layer::up.

◆ SetZoom() [1/12]

void SetZoom ( C_ &  c,
bool(C_::*)(float)  fn 
)

Sets zoom handler.

Zoom amount is calculated as a ratio. 2 means, 2x zoom should be performed. Not all devices support zoom gesture.

References Layer::zoom.

◆ SetZoom() [2/12]

void SetZoom ( C_ &  c,
bool(C_::*)(Geometry::Point, float)  fn 
)

Sets zoom handler.

Zoom amount is calculated as a ratio. 2 means, 2x zoom should be performed. Not all devices support zoom gesture.

References Layer::zoom.

◆ SetZoom() [3/12]

void SetZoom ( C_ &  c,
bool(C_::*)(Layer &, float)  fn 
)

Sets zoom handler.

Zoom amount is calculated as a ratio. 2 means, 2x zoom should be performed. Not all devices support zoom gesture.

References Layer::zoom.

◆ SetZoom() [4/12]

void SetZoom ( C_ &  c,
bool(C_::*)(Layer &, Geometry::Point, float)  fn 
)

Sets zoom handler.

Zoom amount is calculated as a ratio. 2 means, 2x zoom should be performed. Not all devices support zoom gesture.

References Layer::zoom.

◆ SetZoom() [5/12]

void SetZoom ( C_ *  my,
bool(C_::*)(float)  fn 
)

Sets zoom handler.

Zoom amount is calculated as a ratio. 2 means, 2x zoom should be performed. Not all devices support zoom gesture.

References Layer::zoom.

◆ SetZoom() [6/12]

void SetZoom ( C_ *  my,
bool(C_::*)(Geometry::Point, float)  fn 
)

Sets zoom handler.

Zoom amount is calculated as a ratio. 2 means, 2x zoom should be performed. Not all devices support zoom gesture.

References Layer::zoom.

◆ SetZoom() [7/12]

void SetZoom ( C_ *  my,
bool(C_::*)(Layer &, float)  fn 
)

Sets zoom handler.

Zoom amount is calculated as a ratio. 2 means, 2x zoom should be performed. Not all devices support zoom gesture.

References Layer::zoom.

◆ SetZoom() [8/12]

void SetZoom ( C_ *  my,
bool(C_::*)(Layer &, Geometry::Point, float)  fn 
)

Sets zoom handler.

Zoom amount is calculated as a ratio. 2 means, 2x zoom should be performed. Not all devices support zoom gesture.

References Layer::zoom.

◆ SetZoom() [9/12]

void SetZoom ( std::function< bool(float)>  fn)

Sets zoom handler.

Zoom amount is calculated as a ratio. 2 means, 2x zoom should be performed. Not all devices support zoom gesture.

References Layer::zoom.

◆ SetZoom() [10/12]

void SetZoom ( std::function< bool(Geometry::Point, float)>  fn)

Sets zoom handler.

Zoom amount is calculated as a ratio. 2 means, 2x zoom should be performed. Not all devices support zoom gesture.

References Layer::zoom.

◆ SetZoom() [11/12]

void SetZoom ( std::function< bool(Layer &, float)>  fn)

Sets zoom handler.

Zoom amount is calculated as a ratio. 2 means, 2x zoom should be performed. Not all devices support zoom gesture.

References Layer::zoom.

◆ SetZoom() [12/12]

void SetZoom ( std::function< bool(Layer &, Geometry::Point, float)>  fn)

Sets zoom handler.

Zoom amount is calculated as a ratio. 2 means, 2x zoom should be performed. Not all devices support zoom gesture.

References Layer::zoom.

Member Data Documentation

◆ click

std::function<void(Layer &, Geometry::Point, Input::Mouse::Button)> click
protected

◆ down

std::function<void(Layer &, Geometry::Point, Input::Mouse::Button)> down
protected

◆ hitcheck

std::function<bool(Layer &, Geometry::Point)> hitcheck
protected

◆ hscroll

std::function<bool(Layer &, Geometry::Point, float amount)> hscroll
protected

◆ move

std::function<void(Layer &, Geometry::Point)> move
protected

◆ mytransform

Geometry::Transform3D mytransform
protected

◆ out

std::function<void(Layer &)> out
protected

◆ over

std::function<void(Layer &)> over
protected

◆ rotate

std::function<bool(Layer &, Geometry::Point, float amount)> rotate
protected

◆ up

std::function<void(Layer &, Geometry::Point, Input::Mouse::Button)> up
protected

◆ vscroll

std::function<bool(Layer &, Geometry::Point, float amount)> vscroll
protected

◆ zoom

std::function<bool(Layer &, Geometry::Point, float amount)> zoom
protected

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