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

Go to the source code of this file.

Macros

#define ALLEGRO_UNSTABLE   1

Functions

static int colour_distance (ALLEGRO_COLOR a, ALLEGRO_COLOR b)
 how far a pixel is from another, summed over the three channels
static void expect_true (const char *what, int ok)
 record one check
static void ink (N_GUI_CTX *gui, int x0, int y0, int w, int h, int *bands, int *widest_gap, int *first_right)
 draw the context into a memory bitmap and describe the ink inside a rectangle: how many separate bands of rows have any, the tallest gap between two bands, and the rightmost inked column of the first band
int main (int argc, char **argv)
static int process_args (int argc, char **argv)
 parse -V LOG_LEVEL

Variables

static int failures = 0
static int log_level = 3

Macro Definition Documentation

◆ ALLEGRO_UNSTABLE

#define ALLEGRO_UNSTABLE   1

Definition at line 19 of file ex_gui_label_lines.c.

Function Documentation

◆ colour_distance()

int colour_distance ( ALLEGRO_COLOR a,
ALLEGRO_COLOR b )
static

how far a pixel is from another, summed over the three channels

Examples
ex_gui_label_lines.c.

Definition at line 60 of file ex_gui_label_lines.c.

Referenced by ink().

Here is the caller graph for this function:

◆ expect_true()

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

record one check

Definition at line 36 of file ex_gui_label_lines.c.

References failures, LOG_ERR, LOG_INFO, and n_log.

◆ ink()

void ink ( N_GUI_CTX * gui,
int x0,
int y0,
int w,
int h,
int * bands,
int * widest_gap,
int * first_right )
static

draw the context into a memory bitmap and describe the ink inside a rectangle: how many separate bands of rows have any, the tallest gap between two bands, and the rightmost inked column of the first band

Examples
ex_gui_label_lines.c.

Definition at line 70 of file ex_gui_label_lines.c.

References colour_distance(), gui, and n_gui_draw().

Referenced by _popup_draw(), and main().

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

◆ main()

◆ process_args()

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

parse -V LOG_LEVEL

Definition at line 46 of file ex_gui_label_lines.c.

References log_level.

Variable Documentation

◆ failures

int failures = 0
static

Definition at line 33 of file ex_gui_label_lines.c.

◆ log_level

int log_level = 3
static

Definition at line 32 of file ex_gui_label_lines.c.