#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.
|
| static void | expect_near (const char *label, double got, double want) |
| | Assert two values are equal to within a tolerance.
|
| static void | expect_true (const char *label, int cond) |
| | Assert a condition, logging which check failed.
|
| static ALLEGRO_EVENT | key_event (int keycode) |
| | Build a key event for keycode.
|
| int | main (void) |
| static ALLEGRO_EVENT | mouse_event (int type, int x, int y, int dz) |
| | Build a mouse event at (x, y) with a wheel delta.
|
|
| static int | failures = 0 |
| | Count of failed assertions.
|
◆ ALLEGRO_UNSTABLE
| #define ALLEGRO_UNSTABLE 1 |
◆ expect_near()
| void expect_near |
( |
const char * | label, |
|
|
double | got, |
|
|
double | want ) |
|
static |
◆ expect_true()
| void expect_true |
( |
const char * | label, |
|
|
int | cond ) |
|
static |
◆ key_event()
| ALLEGRO_EVENT key_event |
( |
int | keycode | ) |
|
|
static |
Build a key event for keycode.
- Parameters
-
| keycode | An ALLEGRO_KEY_* code. |
- Returns
- The event, ready for n_gui_process_event.
Definition at line 90 of file ex_gui_slider_step.c.
◆ main()
Definition at line 117 of file ex_gui_slider_step.c.
References expect_near(), expect_true(), failures, font, gui, key_event(), LOG_ERR, LOG_NOTICE, mouse_event(), n_gui_add_label(), n_gui_add_slider(), n_gui_add_window(), N_GUI_ALIGN_LEFT, n_gui_destroy_ctx(), n_gui_new_ctx(), n_gui_open_window(), n_gui_process_event(), n_gui_set_display_size(), n_gui_set_focus(), n_gui_slider_get_key_step(), n_gui_slider_get_value(), n_gui_slider_set_key_step(), n_gui_slider_set_step(), n_gui_slider_set_value(), N_GUI_SLIDER_VALUE, N_GUI_WIN_FRAMELESS, n_gui_window_set_flags(), n_log, and set_log_level().
◆ mouse_event()
| ALLEGRO_EVENT mouse_event |
( |
int | type, |
|
|
int | x, |
|
|
int | y, |
|
|
int | dz ) |
|
static |
Build a mouse event at (x, y) with a wheel delta.
- Parameters
-
| type | The ALLEGRO_EVENT_MOUSE_* type. |
| x | Cursor x. |
| y | Cursor y. |
| dz | Wheel notches. |
- Returns
- The event.
Definition at line 106 of file ex_gui_slider_step.c.
References type().
◆ failures