Nilorea Library
C utilities for networking, threading, graphics
Loading...
Searching...
No Matches
ex_gui_tooltip.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 dependency graph for ex_gui_tooltip.c:

Go to the source code of this file.

Macros

#define ALLEGRO_UNSTABLE   1
#define PANEL_W   80.0f
#define PANEL_X   10.0f
#define SPLIT_H   120.0f
#define SPLIT_W   200.0f
#define SPLIT_X   400.0f
#define SPLIT_Y   100.0f
#define TT_H   400
#define TT_W   1200

Functions

static int bubble_width (ALLEGRO_BITMAP *a, ALLEGRO_BITMAP *b)
static void expect_true (const char *label, int cond)
static int hover_tooltip_at (N_GUI_CTX *gui, int x, int y)
int main (int argc, char **argv)
static void process_args (int argc, char **argv)
static void render (N_GUI_CTX *gui, ALLEGRO_BITMAP *target, int armed, int widget_id)
static void usage (void)

Variables

static int failures = 0

Macro Definition Documentation

◆ ALLEGRO_UNSTABLE

#define ALLEGRO_UNSTABLE   1

Definition at line 29 of file ex_gui_tooltip.c.

◆ PANEL_W

#define PANEL_W   80.0f

◆ PANEL_X

#define PANEL_X   10.0f
Examples
ex_gui_tooltip.c.

Definition at line 46 of file ex_gui_tooltip.c.

Referenced by main().

◆ SPLIT_H

#define SPLIT_H   120.0f
Examples
ex_gui_tooltip.c.

Definition at line 53 of file ex_gui_tooltip.c.

Referenced by main().

◆ SPLIT_W

#define SPLIT_W   200.0f
Examples
ex_gui_tooltip.c.

Definition at line 52 of file ex_gui_tooltip.c.

Referenced by main().

◆ SPLIT_X

#define SPLIT_X   400.0f
Examples
ex_gui_tooltip.c.

Definition at line 50 of file ex_gui_tooltip.c.

Referenced by main().

◆ SPLIT_Y

#define SPLIT_Y   100.0f
Examples
ex_gui_tooltip.c.

Definition at line 51 of file ex_gui_tooltip.c.

Referenced by main().

◆ TT_H

#define TT_H   400
Examples
ex_gui_tooltip.c.

Definition at line 42 of file ex_gui_tooltip.c.

Referenced by bubble_width(), and main().

◆ TT_W

#define TT_W   1200
Examples
ex_gui_tooltip.c.

Definition at line 41 of file ex_gui_tooltip.c.

Referenced by bubble_width(), and main().

Function Documentation

◆ bubble_width()

int bubble_width ( ALLEGRO_BITMAP * a,
ALLEGRO_BITMAP * b )
static
Examples
ex_gui_tooltip.c.

Definition at line 127 of file ex_gui_tooltip.c.

References TT_H, and TT_W.

Referenced by main().

Here is the caller graph for this function:

◆ expect_true()

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

Definition at line 57 of file ex_gui_tooltip.c.

References failures, LOG_ERR, and n_log.

◆ hover_tooltip_at()

int hover_tooltip_at ( N_GUI_CTX * gui,
int x,
int y )
static
Examples
ex_gui_tooltip.c.

Definition at line 153 of file ex_gui_tooltip.c.

References gui, and n_gui_process_event().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ main()

◆ process_args()

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

Definition at line 73 of file ex_gui_tooltip.c.

References getoptret, LOG_DEBUG, LOG_ERR, LOG_INFO, log_level, LOG_NOTICE, LOG_NULL, set_log_level(), and usage().

Here is the call graph for this function:

◆ render()

void render ( N_GUI_CTX * gui,
ALLEGRO_BITMAP * target,
int armed,
int widget_id )
static
Examples
ex_gui_tooltip.c.

Definition at line 114 of file ex_gui_tooltip.c.

References gui, and n_gui_draw().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ usage()

void usage ( void )
static

Definition at line 64 of file ex_gui_tooltip.c.

Variable Documentation

◆ failures

int failures = 0
static

Definition at line 55 of file ex_gui_tooltip.c.