PNTK
|
#include <gui.h>
Public Member Functions | |
void | runloop () |
void | loop () |
bool | is_runloop_threaded () |
void | exitloop () |
void | doevents () |
void | init (int argc, char *argv []) |
bool | get_key (gui_key_codes key) |
gui_size | get_text_extent (gui_font *font, const std::string &text, int wrap_width=0) |
void | error_f (const char *format,...) |
void | error (std::string message) |
void | set_theme (const gui_theme &theme) |
gui_theme | get_theme () |
![]() | |
void | set_data (void *user_data) |
void * | get_data () |
virtual void | connect (gui_event_listener *call_back, void *data=nullptr, bool managed=false) |
virtual void | disconnect (gui_event_listener *call_back, void *data=nullptr) |
pntk::gui_listener_chain * | __internal_disconnect (pntk::gui_listener_chain *matching_chain) |
Static Public Member Functions | |
static gui * | instance () |
Additional Inherited Members | |
![]() | |
typedef std::map< gui_object *, gui_listener_chain * > | event_map |
![]() | |
static event_map | windowing_events |
A class that contains foundational gui functions.
void pntk::gui::doevents | ( | ) |
Runs a single cycle of event handling, and returns when no more events are pending.
void pntk::gui::error | ( | std::string | message | ) |
Reports an error with the given message. Exact behavior is platform specific.
void pntk::gui::error_f | ( | const char * | format, |
... | |||
) |
Alternate error reporting function that takes a formated string as an argument.
void pntk::gui::exitloop | ( | ) |
Exits the main gui runloop, allowing control to return to the calling function.
bool pntk::gui::get_key | ( | gui_key_codes | key | ) |
Returns whether a key is currently pressed
gui_size pntk::gui::get_text_extent | ( | gui_font * | font, |
const std::string & | text, | ||
int | wrap_width = 0 |
||
) |
Returns text extent without the use of a gui_context (generally performs slower). If font is nullptr, the system default will be used.
void pntk::gui::init | ( | int | argc, |
char * | argv[] | ||
) |
Initializes the library
bool pntk::gui::is_runloop_threaded | ( | ) |
Returns whether runloop will return immediately and thus usage in main() and immediately returning becomes a requirement (currently specific to Emscripten).
void pntk::gui::loop | ( | ) |
Called by gui::runloop() for every loop iteration.
void pntk::gui::runloop | ( | ) |
Executes the main gui runloop, allowing the toolkit to manage and dispatch events. Does not return until exitloop is called, or immediately if is_runloop_threaded() returns true.