Nilorea Library
C utilities for networking, threading, graphics
Loading...
Searching...
No Matches
ex_gui_slider_step.c File Reference
#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"
Include dependency graph for ex_gui_slider_step.c:

Go to the source code of this file.

Macros

#define ALLEGRO_UNSTABLE   1

Functions

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.

Variables

static int failures = 0
 Count of failed assertions.

Macro Definition Documentation

◆ ALLEGRO_UNSTABLE

#define ALLEGRO_UNSTABLE   1

Definition at line 42 of file ex_gui_slider_step.c.

Function Documentation

◆ expect_near()

void expect_near ( const char * label,
double got,
double want )
static

Assert two values are equal to within a tolerance.

Parameters
labelWhat is being checked.
gotThe value under test.
wantThe expected value.

Definition at line 76 of file ex_gui_slider_step.c.

References failures, LOG_ERR, LOG_INFO, and n_log.

◆ expect_true()

void expect_true ( const char * label,
int cond )
static

Assert a condition, logging which check failed.

Parameters
labelWhat is being checked.
condNon-zero to pass.

Definition at line 61 of file ex_gui_slider_step.c.

References failures, LOG_ERR, LOG_INFO, and n_log.

◆ key_event()

ALLEGRO_EVENT key_event ( int keycode)
static

Build a key event for keycode.

Parameters
keycodeAn ALLEGRO_KEY_* code.
Returns
The event, ready for n_gui_process_event.

Definition at line 90 of file ex_gui_slider_step.c.

◆ main()

◆ 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
typeThe ALLEGRO_EVENT_MOUSE_* type.
xCursor x.
yCursor y.
dzWheel notches.
Returns
The event.

Definition at line 106 of file ex_gui_slider_step.c.

References type().

Here is the call graph for this function:

Variable Documentation

◆ failures

int failures = 0
static

Count of failed assertions.

Definition at line 54 of file ex_gui_slider_step.c.