5 Struct N_GUI_TB_BUTTONS
gullradriel edited this page 2026-10-09 00:55:18 +02:00

N_GUI_TB_BUTTONS

Module: GUI: allegro5 widget system with pseudo-windows

Titlebar button state for a window (minimize, maximize, close).

#include "n_gui.h"

Public Attributes

Name
float restore_y
saved y position before maximise (for restore)
float restore_x
saved x position before maximise (for restore)
float restore_w
saved width before maximise (for restore)
float restore_h
saved height before maximise (for restore)
int pressed
which button is currently pressed (N_GUI_TB_BTN_*)
void * on_minimize_user_data
user data for on_minimize callback
void(*)(int window_id, void *user_data) on_minimize
callback on minimize button click (NULL = default: toggle N_GUI_WIN_MINIMISED)
void * on_maximize_user_data
user data for on_maximize callback
void(*)(int window_id, void *user_data) on_maximize
callback on maximize button click (NULL = default: toggle N_GUI_WIN_MAXIMISED)
void * on_close_user_data
user data for on_close callback
void(*)(int window_id, void *user_data) on_close
callback on close button click (NULL = default: clear N_GUI_WIN_OPEN)
ALLEGRO_BITMAP * minimize_hover_bitmap
optional bitmap for minimize button hover state
ALLEGRO_BITMAP * minimize_bitmap
optional bitmap for minimize button normal state (NULL = color theme)
ALLEGRO_BITMAP * minimize_active_bitmap
optional bitmap for minimize button active state
ALLEGRO_BITMAP * maximize_hover_bitmap
optional bitmap for maximize button hover state
ALLEGRO_BITMAP * maximize_bitmap
optional bitmap for maximize button normal state (NULL = color theme)
ALLEGRO_BITMAP * maximize_active_bitmap
optional bitmap for maximize button active state
int hovered
which button is currently hovered (N_GUI_TB_BTN_*)
N_GUI_THEME close_theme
theme for close button (defaults to red hover/active)
ALLEGRO_BITMAP * close_hover_bitmap
optional bitmap for close button hover state
ALLEGRO_BITMAP * close_bitmap
optional bitmap for close button normal state (NULL = color theme)
ALLEGRO_BITMAP * close_active_bitmap
optional bitmap for close button active state
N_GUI_THEME btn_theme
theme for minimize and maximize buttons

Public Attributes Documentation

variable restore_y

float restore_y;

saved y position before maximise (for restore)

variable restore_x

float restore_x;

saved x position before maximise (for restore)

variable restore_w

float restore_w;

saved width before maximise (for restore)

variable restore_h

float restore_h;

saved height before maximise (for restore)

variable pressed

int pressed;

which button is currently pressed (N_GUI_TB_BTN_*)

variable on_minimize_user_data

void * on_minimize_user_data;

user data for on_minimize callback

variable on_minimize

void(*)(int window_id, void *user_data) on_minimize;

callback on minimize button click (NULL = default: toggle N_GUI_WIN_MINIMISED)

variable on_maximize_user_data

void * on_maximize_user_data;

user data for on_maximize callback

variable on_maximize

void(*)(int window_id, void *user_data) on_maximize;

callback on maximize button click (NULL = default: toggle N_GUI_WIN_MAXIMISED)

variable on_close_user_data

void * on_close_user_data;

user data for on_close callback

variable on_close

void(*)(int window_id, void *user_data) on_close;

callback on close button click (NULL = default: clear N_GUI_WIN_OPEN)

variable minimize_hover_bitmap

ALLEGRO_BITMAP * minimize_hover_bitmap;

optional bitmap for minimize button hover state

variable minimize_bitmap

ALLEGRO_BITMAP * minimize_bitmap;

optional bitmap for minimize button normal state (NULL = color theme)

variable minimize_active_bitmap

ALLEGRO_BITMAP * minimize_active_bitmap;

optional bitmap for minimize button active state

variable maximize_hover_bitmap

ALLEGRO_BITMAP * maximize_hover_bitmap;

optional bitmap for maximize button hover state

variable maximize_bitmap

ALLEGRO_BITMAP * maximize_bitmap;

optional bitmap for maximize button normal state (NULL = color theme)

variable maximize_active_bitmap

ALLEGRO_BITMAP * maximize_active_bitmap;

optional bitmap for maximize button active state

variable hovered

int hovered;

which button is currently hovered (N_GUI_TB_BTN_*)

variable close_theme

N_GUI_THEME close_theme;

theme for close button (defaults to red hover/active)

variable close_hover_bitmap

ALLEGRO_BITMAP * close_hover_bitmap;

optional bitmap for close button hover state

variable close_bitmap

ALLEGRO_BITMAP * close_bitmap;

optional bitmap for close button normal state (NULL = color theme)

variable close_active_bitmap

ALLEGRO_BITMAP * close_active_bitmap;

optional bitmap for close button active state

variable btn_theme

N_GUI_THEME btn_theme;

theme for minimize and maximize buttons