1.12
Public Member Functions | Protected Attributes | List of all members
Event Struct Reference

A single event that has information about the event and state for the event. More...

#include <event.h>

Inheritance diagram for Event:
Inheritance graph
[legend]

Public Member Functions

constexpr Event () noexcept=default
 
constexpr Event (EventId id) noexcept
 
constexpr Event (EventId id, const Key &key) noexcept
 
constexpr Event (EventId id, const Pointer &pointer) noexcept
 
void grab (Widget *widget)
 Grab any related following events to this one.
 
EGT_NODISCARD const EventId & id () const noexcept
 Get the id of the event.
 
void id (EventId id)
 Change the id of the event.
 
Key & key ()
 Get the Key event data.
 
EGT_NODISCARD const Key & key () const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
Pointer & pointer ()
 Get the Pointer event data.
 
EGT_NODISCARD const Pointer & pointer () const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void postpone_stop ()
 Stop the event from propagating but only after the current handle() completes.
 
EGT_NODISCARD bool postponed_quit () const
 Was the event scheduled to be stopped just after the latest handle() completes?
 
- Public Member Functions inherited from EventArg
EGT_NODISCARD bool quit () const
 Was the event stopped from propagating?
 
void stop ()
 Stop the event from propagating.
 

Protected Attributes

EventId m_id {EventId::none}
 The EventId.
 
Key m_key
 Key event data.
 
Pointer m_pointer
 Pointer event data.
 
bool m_postponed_stop {false}
 Stop has be rescheduled for after handle() completes.
 
- Protected Attributes inherited from EventArg
bool m_stop {false}
 Is the event stopped.
 

Detailed Description

A single event that has information about the event and state for the event.

Constructor & Destructor Documentation

◆ Event() [1/4]

constexpr Event ( )
constexprdefaultnoexcept

◆ Event() [2/4]

constexpr Event ( EventId  id)
inlineexplicitconstexprnoexcept
Parameters
[in]idEvent id.

◆ Event() [3/4]

constexpr Event ( EventId  id,
const Pointer &  pointer 
)
inlineconstexprnoexcept
Parameters
[in]idEvent id.
[in]pointerPointer data for the event.

◆ Event() [4/4]

constexpr Event ( EventId  id,
const Key &  key 
)
inlineconstexprnoexcept
Parameters
[in]idEvent id.
[in]keyKey data for the event.

Member Function Documentation

◆ grab()

void grab ( Widget *  widget)

Grab any related following events to this one.

Note
grab() implies stop().

◆ id() [1/2]

EGT_NODISCARD const EventId & id ( ) const
inlinenoexcept

Get the id of the event.

◆ id() [2/2]

void id ( EventId  id)
inline

Change the id of the event.

◆ key() [1/2]

Key & key ( )
inline

Get the Key event data.

Only valid with the following events:

◆ key() [2/2]

EGT_NODISCARD const Key & key ( ) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ pointer() [1/2]

Pointer & pointer ( )
inline

◆ pointer() [2/2]

EGT_NODISCARD const Pointer & pointer ( ) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ postpone_stop()

void postpone_stop ( )
inline

Stop the event from propagating but only after the current handle() completes.

◆ postponed_quit()

EGT_NODISCARD bool postponed_quit ( ) const
inline

Was the event scheduled to be stopped just after the latest handle() completes?

Member Data Documentation

◆ m_id

EventId m_id {EventId::none}
protected

The EventId.

◆ m_key

Key m_key
protected

Key event data.

◆ m_pointer

Pointer m_pointer
protected

Pointer event data.

◆ m_postponed_stop

bool m_postponed_stop {false}
protected

Stop has be rescheduled for after handle() completes.