Lomse library. API documentation
0.30.0
|
#include <lomse_events.h>
EventMouse is an object holding information about a mouse interaction. The event type informs about the specific interaction.
Operating system raw mouse events should be passed to Lomse to be processed by the currently selected Task object (see Task objects). Once done, Lomse will generate relevant events of different type (normally EventMouse, EventControlPointMoved and EventUpdateUI events) with relevant information about affected Document objects or other. For instance, a mouse click interpreted as a 'select object' action will generate a EventUpdateUI event; or a mouse move could be interpreted as a View drag operation and will produce a change in the viewport origin and a EventPaint event for repainting the View.
In particular, EventMouse events generation and suggested processing is as follows:
Types k_mouse_in_event and k_mouse_out_event
They are generated in the following situations:
Type k_on_click_event
They are generated in the following situations:
Type k_link_clicked_event
This event type is generated to inform about a left mouse click on a link (ImoLink) object.
This event is generated when an EventMouse of type k_on_click_event is being processing by Lomse to determine possible actions to do before passing the event to the user application. When Lomse determines that it is a left click on an ImoLink object, the event is passed to the user as an event of type k_link_clicked_event instead of a generic k_on_click_event.
Type k_show_contextual_menu_event
An EventMouse of type k_show_contextual_menu_event informs about a mouse right button click on an ImoObj that has been interpreted by Lomse as a request for displaying its contextual menu (it is up to your application the decide what is this menu, if any, and what to do whit this event).
They are generated in the following situations:
Public Member Functions | |
EventMouse (EEventType type, WpInteractor wpInteractor, ImoId id, Pixels x, Pixels y, unsigned flags, WpDocument wpDoc) | |
ImoObj * | get_imo_object () |
Observable * | get_source () override |
ImoId | get_imo_id () |
Pixels | get_x () |
Pixels | get_y () |
unsigned | get_flags () |
Public Member Functions inherited from EventAction | |
virtual | ~EventAction () |
WpInteractor | get_interactor () |
WpDocument | get_document () |
bool | is_still_valid () |
Public Member Functions inherited from EventInfo | |
virtual | ~EventInfo () |
EEventType | get_event_type () |
bool | is_doc_modified_event () |
bool | is_update_window_event () |
bool | is_mouse_in_event () |
bool | is_mouse_out_event () |
bool | is_on_click_event () |
bool | is_link_clicked_event () |
bool | is_show_contextual_menu_event () |
bool | is_control_point_moved_event () |
bool | is_selection_set_change () |
bool | is_pointed_object_change () |
bool | is_do_play_score_event () |
bool | is_pause_score_event () |
bool | is_stop_playback_event () |
bool | is_tracking_event () |
bool | is_update_viewport_event () |
bool | is_end_of_playback_event () |
|
inline |
Constructor.
|
inline |
Returns a set of flags signaling the conditions at which the event took place. The different flags are described by enum EEventFlag
|
inline |
Returns the ID of the Document object (ImoObj) affected by the event. For instance, for a mouse click event this object will be the ID of the ImoObj pointed by the mouse.
ImoObj* EventMouse::get_imo_object | ( | ) |
Returns a pointer to the Document object (ImoObj) affected by the event. For instance, for a mouse click event this object will be the ImoObj pointed by the mouse.
|
overridevirtual |
Returns a pointer to the Observable object (an ImoContentObj) related to the event. It is either the mouse pointed object or the first ancestor of type ImoContentObj in the internal model hierarchy.
Reimplemented from EventInfo.
|
inline |
Returns the x coordinate (pixels relative to viewport origin) at which the event took place.
|
inline |
Returns the y coordinate (pixels relative to viewport origin) at which the event took place.