![]() |
Nilorea Library
C utilities for networking, threading, graphics
|
#include <math.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include "nilorea/n_common.h"#include "nilorea/n_gui.h"#include "nilorea/n_log.h"Go to the source code of this file.
Macros | |
| #define | ALLEGRO_UNSTABLE 1 |
Functions | |
| static void | drag_right (N_GUI_CTX *gui, int x, int y, int step) |
Press at (x, y), move right in three steps of step with the button held, and release where the pointer ended. | |
| static void | expect_true (const char *label, int cond) |
| Assert a condition, logging which check failed. | |
| int | main (void) |
| static ALLEGRO_EVENT | mouse_event (int type, int x, int y) |
Build a mouse event at (x, y). | |
| static void | on_slider (int id, double value, void *data) |
| Slider callback: counts the changes it is told about. | |
Variables | |
| static int | failures = 0 |
| Count of failed assertions. | |
| static int | slider_changes = 0 |
| How many times the slider's callback fired. | |
| #define ALLEGRO_UNSTABLE 1 |
Definition at line 41 of file ex_gui_frameless_drag.c.
|
static |
Press at (x, y), move right in three steps of step with the button held, and release where the pointer ended.
| gui | The context. |
| x | Press x. |
| y | Press y. |
| step | Pixels per motion event. |
Definition at line 110 of file ex_gui_frameless_drag.c.
References gui, mouse_event(), and n_gui_process_event().
Referenced by main().
|
static |
| int main | ( | void | ) |
Definition at line 120 of file ex_gui_frameless_drag.c.
References drag_right(), expect_true(), failures, font, gui, LOG_ERR, LOG_NOTICE, n_gui_add_image(), n_gui_add_slider(), n_gui_add_window(), n_gui_destroy_ctx(), n_gui_get_window(), N_GUI_IMAGE_FIT, n_gui_new_ctx(), n_gui_open_window(), n_gui_set_display_size(), n_gui_slider_get_value(), n_gui_slider_set_value(), N_GUI_SLIDER_VALUE, N_GUI_WIN_FRAMELESS, n_gui_window_set_flags(), n_log, on_slider(), set_log_level(), slider_changes, N_GUI_WINDOW::x, and N_GUI_WINDOW::y.
|
static |
Build a mouse event at (x, y).
| type | The ALLEGRO_EVENT_MOUSE_* type. |
| x | Cursor x. |
| y | Cursor y. |
Definition at line 92 of file ex_gui_frameless_drag.c.
References type().
|
static |
Slider callback: counts the changes it is told about.
| id | Widget id, unused. |
| value | New value, unused. |
| data | Unused. |
Definition at line 78 of file ex_gui_frameless_drag.c.
References slider_changes.
Referenced by main().
|
static |
Count of failed assertions.
Definition at line 53 of file ex_gui_frameless_drag.c.
|
static |
How many times the slider's callback fired.
Definition at line 56 of file ex_gui_frameless_drag.c.
Referenced by main(), and on_slider().