Nilorea Library
C utilities for networking, threading, graphics
Loading...
Searching...
No Matches
ex_gui_button_keys.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "nilorea/n_common.h"
#include "nilorea/n_log.h"
#include "nilorea/n_gui.h"
#include <allegro5/allegro_primitives.h>
Include dependency graph for ex_gui_button_keys.c:

Go to the source code of this file.

Macros

#define ALLEGRO_UNSTABLE   1

Functions

static void expect_true (const char *what, int ok)
 record one check
static void key (N_GUI_CTX *gui, int keycode, int modifiers, int repeat)
 one key as the keyboard sends it: a down, then a char
int main (int argc, char **argv)
static void on_click (int widget_id, void *user_data)
 a button's click: counted
static int process_args (int argc, char **argv)
 parse -V LOG_LEVEL

Variables

static int failures = 0
static int log_level = 3
static int pressed [64]
 presses per button, indexed by widget id

Macro Definition Documentation

◆ ALLEGRO_UNSTABLE

#define ALLEGRO_UNSTABLE   1

Definition at line 25 of file ex_gui_button_keys.c.

Function Documentation

◆ expect_true()

void expect_true ( const char * what,
int ok )
static

record one check

Definition at line 44 of file ex_gui_button_keys.c.

References failures, LOG_ERR, LOG_INFO, and n_log.

◆ key()

void key ( N_GUI_CTX * gui,
int keycode,
int modifiers,
int repeat )
static

one key as the keyboard sends it: a down, then a char

Definition at line 74 of file ex_gui_button_keys.c.

References gui, and n_gui_process_event().

Here is the call graph for this function:

◆ main()

◆ on_click()

void on_click ( int widget_id,
void * user_data )
static

a button's click: counted

Examples
ex_gui_button_keys.c, and ex_gui_hover.c.

Definition at line 68 of file ex_gui_button_keys.c.

References pressed.

Referenced by main(), n_gui_add_button(), n_gui_add_button_bitmap(), n_gui_add_toggle_button(), n_gui_dropmenu_add_dynamic_entry(), and n_gui_dropmenu_add_entry().

Here is the caller graph for this function:

◆ process_args()

int process_args ( int argc,
char ** argv )
static

parse -V LOG_LEVEL

Definition at line 54 of file ex_gui_button_keys.c.

References log_level.

Variable Documentation

◆ failures

int failures = 0
static

Definition at line 39 of file ex_gui_button_keys.c.

◆ log_level

int log_level = 3
static

Definition at line 38 of file ex_gui_button_keys.c.

◆ pressed

int pressed[64]
static

presses per button, indexed by widget id

Examples
ex_gui_button_keys.c.

Definition at line 41 of file ex_gui_button_keys.c.

Referenced by main(), and on_click().