|
Blender V5.0
|
#include <GHOST_EventManager.hh>
Public Member Functions | |
| GHOST_EventManager () | |
| ~GHOST_EventManager () | |
| uint32_t | getNumEvents () |
| uint32_t | getNumEvents (GHOST_TEventType type) |
| GHOST_TSuccess | pushEvent (const GHOST_IEvent *event) |
| void | dispatchEvent (const GHOST_IEvent *event) |
| void | dispatchEvent () |
| void | dispatchEvents () |
| GHOST_TSuccess | addConsumer (GHOST_IEventConsumer *consumer) |
| GHOST_TSuccess | removeConsumer (GHOST_IEventConsumer *consumer) |
| void | removeWindowEvents (const GHOST_IWindow *window) |
| void | removeTypeEvents (GHOST_TEventType type, const GHOST_IWindow *window=nullptr) |
Protected Types | |
| using | TEventStack = std::deque<const GHOST_IEvent *> |
| using | TConsumerVector = std::vector<GHOST_IEventConsumer *> |
Protected Member Functions | |
| void | disposeEvents () |
Protected Attributes | |
| std::deque< const GHOST_IEvent * > | events_ |
| std::deque< const GHOST_IEvent * > | handled_events_ |
| TConsumerVector | consumers_ |
Manages an event stack and a list of event consumers. The stack works on a FIFO (First In First Out) basis. Events are pushed on the front of the stack and retrieved from the back. Ownership of the event is transferred to the event manager as soon as an event is pushed. Ownership of the event is transferred from the event manager as soon as an event is popped. Events can be dispatched to the event consumers.
Definition at line 25 of file GHOST_EventManager.hh.
|
protected |
A vector with event consumers.
Definition at line 118 of file GHOST_EventManager.hh.
|
protected |
A stack with events.
Definition at line 111 of file GHOST_EventManager.hh.
|
default |
Constructor.
Copyright (C) 2001 NaN Technologies B.V.
| GHOST_EventManager::~GHOST_EventManager | ( | ) |
Destructor.
Definition at line 19 of file GHOST_EventManager.cc.
References consumers_, and disposeEvents().
| GHOST_TSuccess GHOST_EventManager::addConsumer | ( | GHOST_IEventConsumer * | consumer | ) |
Adds a consumer to the list of event consumers.
| consumer | The consumer added to the list. |
Definition at line 89 of file GHOST_EventManager.cc.
References consumers_, GHOST_ASSERT, GHOST_kFailure, and GHOST_kSuccess.
| void GHOST_EventManager::dispatchEvent | ( | ) |
Dispatches the event at the back of the stack. The event will be removed from the stack.
Definition at line 71 of file GHOST_EventManager.cc.
References dispatchEvent(), events_, and handled_events_.
Referenced by dispatchEvent(), and dispatchEvents().
| void GHOST_EventManager::dispatchEvent | ( | const GHOST_IEvent * | event | ) |
Dispatches the given event directly, bypassing the event stack.
Definition at line 62 of file GHOST_EventManager.cc.
References consumers_.
| void GHOST_EventManager::dispatchEvents | ( | ) |
Dispatches all the events on the stack. The event stack will be empty afterwards.
Definition at line 80 of file GHOST_EventManager.cc.
References dispatchEvent(), disposeEvents(), and events_.
|
protected |
Removes all events from the stack.
Definition at line 171 of file GHOST_EventManager.cc.
References events_, GHOST_ASSERT, and handled_events_.
Referenced by dispatchEvents(), and ~GHOST_EventManager().
| uint32_t GHOST_EventManager::getNumEvents | ( | ) |
Returns the number of events currently on the stack.
Definition at line 31 of file GHOST_EventManager.cc.
References events_.
| uint32_t GHOST_EventManager::getNumEvents | ( | GHOST_TEventType | type | ) |
Returns the number of events of a certain type currently on the stack.
| type | The type of events to be counted. |
Definition at line 36 of file GHOST_EventManager.cc.
References events_.
| GHOST_TSuccess GHOST_EventManager::pushEvent | ( | const GHOST_IEvent * | event | ) |
Pushes an event on the stack. To dispatch it, call dispatchEvent() or dispatchEvents(). Do not delete the event!
| event | The event to push on the stack. |
Definition at line 48 of file GHOST_EventManager.cc.
References events_, GHOST_ASSERT, GHOST_kFailure, and GHOST_kSuccess.
| GHOST_TSuccess GHOST_EventManager::removeConsumer | ( | GHOST_IEventConsumer * | consumer | ) |
Removes a consumer from the list of event consumers.
| consumer | The consumer removed from the list. |
Definition at line 108 of file GHOST_EventManager.cc.
References consumers_, GHOST_ASSERT, GHOST_kFailure, and GHOST_kSuccess.
| void GHOST_EventManager::removeTypeEvents | ( | GHOST_TEventType | type, |
| const GHOST_IWindow * | window = nullptr ) |
Removes all events of a certain type from the stack. The window parameter is optional. If non-null, the routine will remove events only associated with that window.
| type | The type of events to be removed. |
| window | The window to remove the events for. |
Definition at line 149 of file GHOST_EventManager.cc.
References events_, and GHOST_PRINT.
Referenced by GHOST_SystemWin32::s_wndProc().
| void GHOST_EventManager::removeWindowEvents | ( | const GHOST_IWindow * | window | ) |
Removes all events for a window from the stack.
| window | The window to remove events for. |
Definition at line 127 of file GHOST_EventManager.cc.
References events_, and GHOST_PRINT.
|
protected |
The list with event consumers.
Definition at line 121 of file GHOST_EventManager.hh.
Referenced by addConsumer(), dispatchEvent(), removeConsumer(), and ~GHOST_EventManager().
|
protected |
The event stack.
Definition at line 114 of file GHOST_EventManager.hh.
Referenced by dispatchEvent(), dispatchEvents(), disposeEvents(), getNumEvents(), getNumEvents(), pushEvent(), removeTypeEvents(), and removeWindowEvents().
|
protected |
Definition at line 115 of file GHOST_EventManager.hh.
Referenced by dispatchEvent(), and disposeEvents().