PNTK
Public Member Functions | Static Public Member Functions | List of all members
pntk::gui Class Reference

#include <gui.h>

Inheritance diagram for pntk::gui:
pntk::gui_object

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 ()
 
- Public Member Functions inherited from pntk::gui_object
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 guiinstance ()
 

Additional Inherited Members

- Public Types inherited from pntk::gui_object
typedef std::map< gui_object *, gui_listener_chain * > event_map
 
- Static Public Attributes inherited from pntk::gui_object
static event_map windowing_events
 

Detailed Description

A class that contains foundational gui functions.

Member Function Documentation

◆ doevents()

void pntk::gui::doevents ( )

Runs a single cycle of event handling, and returns when no more events are pending.

◆ error()

void pntk::gui::error ( std::string  message)

Reports an error with the given message. Exact behavior is platform specific.

◆ error_f()

void pntk::gui::error_f ( const char *  format,
  ... 
)

Alternate error reporting function that takes a formated string as an argument.

◆ exitloop()

void pntk::gui::exitloop ( )

Exits the main gui runloop, allowing control to return to the calling function.

◆ get_key()

bool pntk::gui::get_key ( gui_key_codes  key)

Returns whether a key is currently pressed

◆ get_text_extent()

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.

◆ init()

void pntk::gui::init ( int  argc,
char *  argv[] 
)

Initializes the library

◆ is_runloop_threaded()

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).

◆ loop()

void pntk::gui::loop ( )

Called by gui::runloop() for every loop iteration.

◆ runloop()

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.


The documentation for this class was generated from the following file: