GlistEngine
Loading...
Searching...
No Matches
gEvent.h File Reference
#include <functional>
Include dependency graph for gEvent.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  gEvent
class  gEventDispatcher

Macros

#define BIT(x)
#define G_EVENT_CLASS_TYPE(type)
#define G_EVENT_CLASS_CATEGORY(category)
#define G_BIND_FUNCTION(fn)
#define G_BIND_GLOBAL_FUNCTION(fn)

Typedefs

typedef std::function< void(gEvent &)> EventHandlerFn

Enumerations

enum  EventCategory {
  EVENTCATEGORY_APP = BIT(0) , EVENTCATEGORY_INPUT = BIT(1) , EVENTCATEGORY_KEYBOARD = BIT(2) , EVENTCATEGORY_MOUSE = BIT(3) ,
  EVENTCATEGORY_MOUSE_BUTTON = BIT(4) , EVENTCATEGORY_JOYSTICK = BIT(5) , EVENTCATEGORY_TOUCHSCREEN = BIT(6) , EVENTCATEGORY_RENDERER = BIT(7) ,
  EVENTCATEGORY_CUSTOM = BIT(8)
}

Macro Definition Documentation

◆ BIT

#define BIT ( x)
Value:
(1 << x)

◆ G_BIND_FUNCTION

#define G_BIND_FUNCTION ( fn)
Value:
[this](auto&&... args) -> decltype(auto) { return this->fn(std::forward<decltype(args)>(args)...); }

◆ G_BIND_GLOBAL_FUNCTION

#define G_BIND_GLOBAL_FUNCTION ( fn)
Value:
[](auto&&... args) -> decltype(auto) { return fn(std::forward<decltype(args)>(args)...); }

◆ G_EVENT_CLASS_CATEGORY

#define G_EVENT_CLASS_CATEGORY ( category)
Value:
virtual int getCategoryFlags() const override { return category; }

◆ G_EVENT_CLASS_TYPE

#define G_EVENT_CLASS_TYPE ( type)
Value:
static size_t getStaticType() { return typeid(type).hash_code(); } \
virtual size_t getEventType() const override { return getStaticType(); } \
virtual const char* getEventName() const override { return #type; }

Typedef Documentation

◆ EventHandlerFn

typedef std::function<void(gEvent&)> EventHandlerFn

Enumeration Type Documentation

◆ EventCategory

Enumerator
EVENTCATEGORY_APP 
EVENTCATEGORY_INPUT 
EVENTCATEGORY_KEYBOARD 
EVENTCATEGORY_MOUSE 
EVENTCATEGORY_MOUSE_BUTTON 
EVENTCATEGORY_JOYSTICK 
EVENTCATEGORY_TOUCHSCREEN 
EVENTCATEGORY_RENDERER 
EVENTCATEGORY_CUSTOM