1 #if !defined(_BOXIMPL_CORE_HPP_) 2 #define _BOXIMPL_CORE_HPP_ 4 #include <condition_variable> 5 #include <unordered_map> 13 #include "../module.hpp" 20 typedef void (*FnPtr)(
void*);
23 void operator ()()
const{
28 typedef void (*FnPtr)(
const SDL_Event &ev,
void *data);
31 void operator()(SDL_Event &ev)
const{
38 static bool is_running;
44 inline void on_dropev(
const SDL_Event &event);
45 inline void on_windowev(
const SDL_Event &event);
46 inline void on_keyboardev(
const SDL_Event &event);
47 inline void on_mousewheel(
const SDL_Event &event);
48 inline void on_mousemotion(
const SDL_Event &event);
49 inline void on_mousebutton(
const SDL_Event &event);
50 inline void on_textinput(
const SDL_Event &event);
52 void defer_call(
void(* fn)(
void*),
void *data =
nullptr);
57 std::unordered_map<Uint32,WindowImpl*> wins_map;
58 std::unordered_map<Uint32,EventHandler> evcbs_map;
59 std::recursive_mutex map_mtx;
60 Uint32 defer_call_ev_id;
61 Uint32 dispatch_ev_id;
64 bool (*handle_exception)(std::exception *) =
nullptr;
66 std::list<ExitHandler> atexit_handlers;
68 void atexit(
void (*fn)(
void *),
void *data);
69 void atexit(
void (*fn)());
71 void regiser_eventcb(Uint32 evid,EventHandler::FnPtr ptr,
void *data);
73 std::list<Module> modules_list;
82 BTKAPI
void Exit(
int code);
84 return *(System::instance);
89 #endif // _BOXIMPL_CORE_HPP_
This header include many useful containers.
Definition: async.hpp:7
BTKAPI void Exit(int code=EXIT_SUCCESS)
End the event loop.
Definition: core.cpp:402
BTKAPI int run()
Enter the EventLoop.
Definition: core.cpp:58
Definition: window.hpp:39