Sparkle 0.0.1
Loading...
Searching...
No Matches
spk::Module::MouseModule Class Referencefinal

Dispatches mouse events to a bound widget and tracks mouse state. More...

#include <spk_mouse_module.hpp>

Inheritance diagram for spk::Module::MouseModule:
Inheritance graph
Collaboration diagram for spk::Module::MouseModule:
Collaboration graph

Public Member Functions

spk::Mousemouse ()
 Accesses the managed mouse state.
const spk::Mousemouse () const
 Accesses the managed mouse state.
Public Member Functions inherited from spk::Module::EventBasedModule< spk::MouseEvent >
EventBasedModuleoperator= (const EventBasedModule &)=delete
void setWidget (spk::Widget *p_widget)
 Binds the module to a widget that will receive callbacks.
spk::Widgetwidget () const
 Returns the currently bound widget.
void insertEvent (spk::MouseEvent &&p_ievent)
 Queues a new event to be processed later.
bool hasEvent () const
 Checks whether the module has pending events.
void treatEvents ()
 Processes all queued events by invoking _treatEvent.

Protected Member Functions

void _treatEvent (spk::MouseEvent &p_ievent) override
 Handles a single mouse event and forwards it to the widget.

Detailed Description

Dispatches mouse events to a bound widget and tracks mouse state.

See also
KeyboardModule, SystemModule
mouse.setWidget(&rootWidget);
// events are inserted externally then processed via treatEvents()
Dispatches mouse events to a bound widget and tracks mouse state.
Definition spk_mouse_module.hpp:23
spk::Mouse & mouse()
Accesses the managed mouse state.
Definition spk_mouse_module.cpp:54

Member Function Documentation

◆ _treatEvent()

void spk::Module::MouseModule::_treatEvent ( spk::MouseEvent & p_ievent)
overrideprotectedvirtual

Handles a single mouse event and forwards it to the widget.

Parameters
p_ieventEvent to treat.

Implements spk::Module::EventBasedModule< spk::MouseEvent >.

Here is the call graph for this function:

◆ mouse() [1/2]

spk::Mouse & spk::Module::MouseModule::mouse ( )

Accesses the managed mouse state.

Returns
Mutable mouse reference.
See also
mouse() const

◆ mouse() [2/2]

const spk::Mouse & spk::Module::MouseModule::mouse ( ) const

Accesses the managed mouse state.

Returns
Const mouse reference.
See also
mouse()

The documentation for this class was generated from the following files:
  • includes/structure/application/module/spk_mouse_module.hpp
  • srcs/structure/application/module/spk_mouse_module.cpp