![]() |
Nilorea Library
C utilities for networking, threading, graphics
|
#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 int | click_and_report (N_GUI_CTX *gui, int x, int y) |
Press the primary button at (x, y) and report the double click. | |
| static void | click_at (N_GUI_CTX *gui, int x, int y) |
Press and release the primary button at (x, y). | |
| 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 left-button mouse event at (x, y). | |
Variables | |
| static int | failures = 0 |
| Count of failed assertions. | |
| #define ALLEGRO_UNSTABLE 1 |
Definition at line 38 of file ex_gui_double_click.c.
|
static |
Press the primary button at (x, y) and report the double click.
The release is sent afterwards, so the answer is read at the moment the press was processed, which is when a host would read it.
| gui | GUI context. |
| x | Cursor x. |
| y | Cursor y. |
Definition at line 105 of file ex_gui_double_click.c.
References gui, mouse_event(), n_gui_double_clicked_widget(), and n_gui_process_event().
Referenced by main().
|
static |
Press and release the primary button at (x, y).
| gui | GUI context. |
| x | Cursor x. |
| y | Cursor y. |
Definition at line 88 of file ex_gui_double_click.c.
References gui, mouse_event(), and n_gui_process_event().
|
static |
| int main | ( | void | ) |
Definition at line 115 of file ex_gui_double_click.c.
References click_and_report(), click_at(), expect_true(), failures, font, gui, LOG_ERR, LOG_NOTICE, mouse_event(), n_gui_add_button(), n_gui_add_window(), n_gui_destroy_ctx(), n_gui_double_clicked_widget(), n_gui_new_ctx(), n_gui_open_window(), n_gui_process_event(), n_gui_set_display_size(), n_gui_set_double_click_radius(), n_gui_set_double_click_time(), N_GUI_SHAPE_RECT, n_gui_was_double_click(), N_GUI_WIN_FRAMELESS, n_gui_window_set_flags(), n_log, and set_log_level().
|
static |
Build a left-button mouse event at (x, y).
| type | The ALLEGRO_EVENT_MOUSE_* type. |
| x | Cursor x. |
| y | Cursor y. |
Definition at line 72 of file ex_gui_double_click.c.
References type().
|
static |
Count of failed assertions.
Definition at line 49 of file ex_gui_double_click.c.