ezgl
1.0.1
An Easy Graphics & GUI Library
|
A library for creating a graphical user interface. More...
Classes | |
class | application |
The core application. More... | |
class | camera |
Manages the transformations between coordinate systems. More... | |
class | canvas |
Responsible for creating, destroying, and maintaining the rendering context of a GtkWidget. More... | |
struct | color |
Represents a color as a mixture or red, green, and blue as well as the transparency level. More... | |
class | renderer |
Provides functions to draw primitives (e.g., lines, shapes) to a rendering context (the MainCanvas). More... | |
class | point2d |
Represents a two-dimensional point. More... | |
class | rectangle |
Represents a rectangle as two diagonally opposite points. More... | |
Typedefs | |
using | connect_g_objects_fn = void(*)(application *app) |
The signature of a function that connects GObject to functions via signals. More... | |
using | setup_callback_fn = void(*)(application *app, bool new_window) |
The signature of a setup callback function. | |
using | button_callback_fn = void(*)(GtkWidget *widget, application *app) |
The signature of a button callback function. | |
using | mouse_callback_fn = void(*)(application *app, GdkEventButton *event, double x, double y) |
The signature of a user-defined callback function for mouse events. | |
using | key_callback_fn = void(*)(application *app, GdkEventKey *event, char *key_name) |
The signature of a user-defined callback function for keyboard events. | |
using | combo_box_callback_fn = void(*)(GtkComboBoxText *self, application *app) |
The signature of a user-defined callback function for the combo-box "changed" signal. | |
using | dialog_callback_fn = void(*)(GtkDialog *self, gint response_id, application *app) |
The signature of a user-defined callback function for a dialog window. | |
using | draw_canvas_fn = void(*)(renderer *) |
The signature of a function that draws to an ezgl::canvas. | |
typedef cairo_surface_t | surface |
define ezgl::surface type used for drawing png bitmaps | |
Enumerations | |
enum | t_coordinate_system { WORLD , SCREEN } |
Available coordinate systems. More... | |
enum class | justification { center , left , right , top , bottom } |
Justification options used for text and surfaces. More... | |
enum class | font_slant : int { normal = CAIRO_FONT_SLANT_NORMAL , italic = CAIRO_FONT_SLANT_ITALIC , oblique = CAIRO_FONT_SLANT_OBLIQUE } |
The slant of the font. More... | |
enum class | font_weight : int { normal = CAIRO_FONT_WEIGHT_NORMAL , bold = CAIRO_FONT_WEIGHT_BOLD } |
The weight of the font. More... | |
enum class | line_cap : int { butt = CAIRO_LINE_CAP_BUTT , round = CAIRO_LINE_CAP_ROUND } |
The shape of a line's start and end point. More... | |
enum class | line_dash : int { none , asymmetric_5_3 } |
The dash style of a line. More... | |
Functions | |
void | set_disable_event_loop (bool new_setting) |
Set the disable_event_loop flag to new_setting Call with new_setting == true to make the event_loop immediately return. More... | |
gboolean | press_key (GtkWidget *widget, GdkEventKey *event, gpointer data) |
React to a keyboard press event. More... | |
gboolean | press_mouse (GtkWidget *widget, GdkEventButton *event, gpointer data) |
React to mouse click event More... | |
gboolean | release_mouse (GtkWidget *widget, GdkEventButton *event, gpointer data) |
React to mouse release event More... | |
gboolean | move_mouse (GtkWidget *widget, GdkEventButton *event, gpointer data) |
React to mouse release event More... | |
gboolean | scroll_mouse (GtkWidget *widget, GdkEvent *event, gpointer data) |
React to scroll_event event More... | |
gboolean | press_zoom_fit (GtkWidget *widget, gpointer data) |
React to the clicked zoom_fit button. More... | |
gboolean | press_zoom_in (GtkWidget *widget, gpointer data) |
React to the clicked zoom_in button. More... | |
gboolean | press_zoom_out (GtkWidget *widget, gpointer data) |
React to the clicked zoom_out button. More... | |
gboolean | press_up (GtkWidget *widget, gpointer data) |
React to the clicked up button. More... | |
gboolean | press_down (GtkWidget *widget, gpointer data) |
React to the clicked up button. More... | |
gboolean | press_left (GtkWidget *widget, gpointer data) |
React to the clicked up button. More... | |
gboolean | press_right (GtkWidget *widget, gpointer data) |
React to the clicked up button. More... | |
gboolean | press_proceed (GtkWidget *widget, gpointer data) |
React to the clicked proceed button. More... | |
void | zoom_in (canvas *cnv, double zoom_factor) |
Zoom in on the center of the currently visible world. | |
void | zoom_out (canvas *cnv, double zoom_factor) |
Zoom out from the center of the currently visible world. | |
void | zoom_in (canvas *cnv, point2d zoom_point, double zoom_factor) |
Zoom in on a specific point in the GTK widget. | |
void | zoom_out (canvas *cnv, point2d zoom_point, double zoom_factor) |
Zoom out from a specific point in GTK widget. | |
void | zoom_fit (canvas *cnv, rectangle region) |
Zoom in or out to fit an exact region of the world. | |
void | translate (canvas *cnv, double dx, double dy) |
Translate by delta x and delta y (dx, dy) | |
void | translate_up (canvas *cnv, double translate_factor) |
Translate up. | |
void | translate_down (canvas *cnv, double translate_factor) |
Translate down. | |
void | translate_left (canvas *cnv, double translate_factor) |
Translate left. | |
void | translate_right (canvas *cnv, double translate_factor) |
Translate right. | |
Variables | |
const bool | build_ui_from_file = false |
A library for creating a graphical user interface.
using ezgl::connect_g_objects_fn = typedef void (*)(application *app) |
The signature of a function that connects GObject to functions via signals.
|
strong |
|
strong |
|
strong |
Justification options used for text and surfaces.
|
strong |
|
strong |
Available coordinate systems.
gboolean ezgl::move_mouse | ( | GtkWidget * | widget, |
GdkEventButton * | event, | ||
gpointer | data | ||
) |
React to mouse release event
widget | The GUI widget where this event came from. |
event | The click event. |
data | A pointer to any user-specified data you passed in. |
gboolean ezgl::press_down | ( | GtkWidget * | widget, |
gpointer | data | ||
) |
React to the clicked up button.
widget | The GUI widget where this event came from. |
data | A pointer to any user-specified data you passed in. |
gboolean ezgl::press_key | ( | GtkWidget * | widget, |
GdkEventKey * | event, | ||
gpointer | data | ||
) |
React to a keyboard press event.
widget | The GUI widget where this event came from. |
event | The keyboard event. |
data | A pointer to any user-specified data you passed in. |
gboolean ezgl::press_left | ( | GtkWidget * | widget, |
gpointer | data | ||
) |
React to the clicked up button.
widget | The GUI widget where this event came from. |
data | A pointer to any user-specified data you passed in. |
gboolean ezgl::press_mouse | ( | GtkWidget * | widget, |
GdkEventButton * | event, | ||
gpointer | data | ||
) |
React to mouse click event
widget | The GUI widget where this event came from. |
event | The click event. |
data | A pointer to any user-specified data you passed in. |
gboolean ezgl::press_proceed | ( | GtkWidget * | widget, |
gpointer | data | ||
) |
React to the clicked proceed button.
widget | The GUI widget where this event came from. |
data | A pointer to any user-specified data you passed in. |
gboolean ezgl::press_right | ( | GtkWidget * | widget, |
gpointer | data | ||
) |
React to the clicked up button.
widget | The GUI widget where this event came from. |
data | A pointer to any user-specified data you passed in. |
gboolean ezgl::press_up | ( | GtkWidget * | widget, |
gpointer | data | ||
) |
React to the clicked up button.
widget | The GUI widget where this event came from. |
data | A pointer to any user-specified data you passed in. |
gboolean ezgl::press_zoom_fit | ( | GtkWidget * | widget, |
gpointer | data | ||
) |
React to the clicked zoom_fit button.
widget | The GUI widget where this event came from. |
data | A pointer to any user-specified data you passed in. |
gboolean ezgl::press_zoom_in | ( | GtkWidget * | widget, |
gpointer | data | ||
) |
React to the clicked zoom_in button.
widget | The GUI widget where this event came from. |
data | A pointer to any user-specified data you passed in. |
gboolean ezgl::press_zoom_out | ( | GtkWidget * | widget, |
gpointer | data | ||
) |
React to the clicked zoom_out button.
widget | The GUI widget where this event came from. |
data | A pointer to any user-specified data you passed in. |
gboolean ezgl::release_mouse | ( | GtkWidget * | widget, |
GdkEventButton * | event, | ||
gpointer | data | ||
) |
React to mouse release event
widget | The GUI widget where this event came from. |
event | The click event. |
data | A pointer to any user-specified data you passed in. |
gboolean ezgl::scroll_mouse | ( | GtkWidget * | widget, |
GdkEvent * | event, | ||
gpointer | data | ||
) |
React to scroll_event event
widget | The GUI widget where this event came from. |
event | The click event. |
data | A pointer to any user-specified data you passed in. |
void ezgl::set_disable_event_loop | ( | bool | new_setting | ) |
Set the disable_event_loop flag to new_setting Call with new_setting == true to make the event_loop immediately return.
This is useful for unit tests, to ensure the GUI doesn't wait for user input in an automatic test.
new_setting | The new state of disable_event_loop flag |