Nilorea Library
C utilities for networking, threading, graphics
Loading...
Searching...
No Matches
n_gui.h
Go to the documentation of this file.
1/*
2 * Nilorea Library
3 * Copyright (C) 2005-2026 Castagnier Mickael
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
14 * implied. See the License for the specific language governing
15 * permissions and limitations under the License.
16 *
17 * SPDX-License-Identifier: Apache-2.0
18 */
19
28#ifndef __NILOREA_GUI__
29#define __NILOREA_GUI__
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
71#include <stdio.h>
72#include <stdlib.h>
73#include <string.h>
74#include <ctype.h>
75#include <stdbool.h>
76
77#include <nilorea/n_allegro5.h>
78#include <nilorea/n_common.h>
79#include <nilorea/n_str.h>
80#include <nilorea/n_log.h>
81#include <nilorea/n_list.h>
82#include <nilorea/n_hash.h>
83
85#define N_GUI_ID_MAX 128
87#define N_GUI_TEXT_MAX 4096
88
89/* widget type enum */
91#define N_GUI_TYPE_BUTTON 1
93#define N_GUI_TYPE_SLIDER 2
95#define N_GUI_TYPE_TEXTAREA 3
97#define N_GUI_TYPE_CHECKBOX 4
99#define N_GUI_TYPE_SCROLLBAR 5
101#define N_GUI_TYPE_LISTBOX 6
103#define N_GUI_TYPE_RADIOLIST 7
105#define N_GUI_TYPE_COMBOBOX 8
107#define N_GUI_TYPE_IMAGE 9
109#define N_GUI_TYPE_LABEL 10
111#define N_GUI_TYPE_DROPMENU 11
113#define N_GUI_TYPE_SPLITPANE 12
115#define N_GUI_TYPE_HEXVIEW 13
117#define N_GUI_TYPE_SYNTAXVIEW 14
119#define N_GUI_TYPE_DATAGRID 15
120
122#define N_GUI_TYPE_PROGRESSBAR 16
123
125#define N_GUI_TYPE_CUSTOM 17
126
128#define N_GUI_SPLIT_VERTICAL 0
130#define N_GUI_SPLIT_HORIZONTAL 1
131
133#define N_GUI_SYNTAX_PLAIN 0
135#define N_GUI_SYNTAX_HTTP 1
137#define N_GUI_SYNTAX_JSON 2
139#define N_GUI_SYNTAX_XML 3
141#define N_GUI_SYNTAX_YAML 4
143#define N_GUI_SYNTAX_JS 5
144
145/* shape flags */
147#define N_GUI_SHAPE_RECT 0
149#define N_GUI_SHAPE_ROUNDED 1
151#define N_GUI_SHAPE_BITMAP 2
152
153/* slider mode */
155#define N_GUI_SLIDER_VALUE 0
157#define N_GUI_SLIDER_PERCENT 1
158
159/* slider orientation */
161#define N_GUI_SLIDER_H 0
163#define N_GUI_SLIDER_V 1
164
165/* scrollbar orientation */
167#define N_GUI_SCROLLBAR_H 0
169#define N_GUI_SCROLLBAR_V 1
170
171/* list selection modes */
173#define N_GUI_SELECT_NONE 0
175#define N_GUI_SELECT_SINGLE 1
177#define N_GUI_SELECT_MULTIPLE 2
178
179/* image scale modes */
181#define N_GUI_IMAGE_FIT 0
183#define N_GUI_IMAGE_STRETCH 1
185#define N_GUI_IMAGE_CENTER 2
186
187/* text alignment */
189#define N_GUI_ALIGN_LEFT 0
191#define N_GUI_ALIGN_CENTER 1
193#define N_GUI_ALIGN_RIGHT 2
195#define N_GUI_ALIGN_JUSTIFIED 3
196
197/* widget state flags */
199#define N_GUI_STATE_IDLE 0
201#define N_GUI_STATE_HOVER 1
203#define N_GUI_STATE_ACTIVE 2
205#define N_GUI_STATE_FOCUSED 4
207#define N_GUI_STATE_SCROLLBAR_DRAG 8
208
209/* window state flags */
211#define N_GUI_WIN_OPEN 1
213#define N_GUI_WIN_MINIMISED 2
215#define N_GUI_WIN_DRAGGING 4
217#define N_GUI_WIN_RESIZING 8
219#define N_GUI_WIN_VSCROLL_DRAG 16
221#define N_GUI_WIN_HSCROLL_DRAG 32
223#define N_GUI_WIN_MAXIMISED 64
224
225/* window feature flags (set via n_gui_window_set_flags) */
227#define N_GUI_WIN_AUTO_SCROLLBAR 16
229#define N_GUI_WIN_RESIZABLE 32
231#define N_GUI_WIN_FIXED_POSITION 64
233#define N_GUI_WIN_FRAMELESS 128
235#define N_GUI_WIN_BTN_MINIMIZE 256
237#define N_GUI_WIN_BTN_MAXIMIZE 512
239#define N_GUI_WIN_BTN_CLOSE 1024
241#define N_GUI_WIN_BTN_ALL (N_GUI_WIN_BTN_MINIMIZE | N_GUI_WIN_BTN_MAXIMIZE | N_GUI_WIN_BTN_CLOSE)
244#define N_GUI_WIN_NO_HSCROLL 2048
245
246/* native (detached) window options, passed to n_gui_window_detach */
248#define N_GUI_DETACH_NONE 0
250#define N_GUI_DETACH_RESIZABLE 1
256#define N_GUI_DETACH_SCALE_CONTENT 2
266#define N_GUI_DETACH_OWN_CHROME 4
267
268/* titlebar button indices */
270#define N_GUI_TB_BTN_NONE 0
272#define N_GUI_TB_BTN_MINIMIZE 1
274#define N_GUI_TB_BTN_MAXIMIZE 2
276#define N_GUI_TB_BTN_CLOSE 3
277
278/* context-level resize modes (set via n_gui_set_resize_mode) */
280#define N_GUI_RESIZE_VIRTUAL 0
282#define N_GUI_RESIZE_ADAPTIVE 1
283
284/* per-window resize policies (used in ADAPTIVE mode) */
286#define N_GUI_WIN_RESIZE_NONE 0
288#define N_GUI_WIN_RESIZE_MOVE 1
290#define N_GUI_WIN_RESIZE_SCALE 2
291
292/* dialog auto-adjust flags (set via n_gui_window_set_autofit) */
294#define N_GUI_AUTOFIT_W 1
296#define N_GUI_AUTOFIT_H 2
298#define N_GUI_AUTOFIT_WH 3
300#define N_GUI_AUTOFIT_EXPAND_LEFT 4
302#define N_GUI_AUTOFIT_EXPAND_UP 8
304#define N_GUI_AUTOFIT_CENTER 16
305
306/* window z-order modes */
308#define N_GUI_ZORDER_NORMAL 0
310#define N_GUI_ZORDER_ALWAYS_ON_TOP 1
312#define N_GUI_ZORDER_ALWAYS_BEHIND 2
319#define N_GUI_ZORDER_FIXED 3
326#define N_GUI_ZORDER_POPUP 4
327
328/* text dimension bounding box */
329
331typedef struct N_GUI_TEXT_DIMS {
332 int x;
333 int y;
334 int w;
335 int h;
337
338/* color theme */
339
341typedef struct N_GUI_THEME {
343 ALLEGRO_COLOR bg_normal;
345 ALLEGRO_COLOR bg_hover;
347 ALLEGRO_COLOR bg_active;
349 ALLEGRO_COLOR border_normal;
351 ALLEGRO_COLOR border_hover;
353 ALLEGRO_COLOR border_active;
355 ALLEGRO_COLOR text_normal;
357 ALLEGRO_COLOR text_hover;
359 ALLEGRO_COLOR text_active;
367 ALLEGRO_COLOR selection_color;
369
370/* button key modifier flags (use with n_gui_button_set_keycode) */
372#define N_GUI_KEY_MOD_MASK (ALLEGRO_KEYMOD_SHIFT | ALLEGRO_KEYMOD_CTRL | ALLEGRO_KEYMOD_ALT | ALLEGRO_KEYMOD_ALTGR)
373
375#define N_GUI_KEY_SOURCES_MAX 8
376
377/* per-widget data */
378
380typedef struct N_GUI_BUTTON_DATA {
384 ALLEGRO_BITMAP* bitmap;
386 ALLEGRO_BITMAP* bitmap_hover;
388 ALLEGRO_BITMAP* bitmap_active;
390 int shape;
415 void (*on_click)(int widget_id, void* user_data);
419
421typedef struct N_GUI_SLIDER_DATA {
423 double min_val;
425 double max_val;
427 double value;
429 double step;
431 int mode;
435 ALLEGRO_BITMAP* track_bitmap;
437 ALLEGRO_BITMAP* fill_bitmap;
439 ALLEGRO_BITMAP* handle_bitmap;
441 ALLEGRO_BITMAP* handle_hover_bitmap;
443 ALLEGRO_BITMAP* handle_active_bitmap;
445 void (*on_change)(int widget_id, double value, void* user_data);
452 char value_format[32];
459
461typedef struct N_GUI_TEXTAREA_DATA {
463 char* text;
465 size_t text_len;
476 size_t sel_start;
478 size_t sel_end;
482 float scroll_x;
488 ALLEGRO_BITMAP* bg_bitmap;
495 void (*on_change)(int widget_id, const char* text, void* user_data);
499
501typedef struct N_GUI_CHECKBOX_DATA {
507 ALLEGRO_BITMAP* box_bitmap;
509 ALLEGRO_BITMAP* box_checked_bitmap;
511 ALLEGRO_BITMAP* box_hover_bitmap;
513 void (*on_toggle)(int widget_id, int checked, void* user_data);
517
519typedef struct N_GUI_SCROLLBAR_DATA {
529 int shape;
531 ALLEGRO_BITMAP* track_bitmap;
533 ALLEGRO_BITMAP* thumb_bitmap;
535 ALLEGRO_BITMAP* thumb_hover_bitmap;
537 ALLEGRO_BITMAP* thumb_active_bitmap;
539 void (*on_scroll)(int widget_id, double scroll_pos, void* user_data);
543
551
553typedef struct N_GUI_LISTBOX_DATA {
557 size_t nb_items;
567 ALLEGRO_BITMAP* bg_bitmap;
569 ALLEGRO_BITMAP* item_bg_bitmap;
571 ALLEGRO_BITMAP* item_selected_bitmap;
573 void (*on_select)(int widget_id, int index, int selected, void* user_data);
581
583typedef struct N_GUI_SPLITPANE_DATA {
587 float ratio;
593 float divider;
595 void (*on_change)(int widget_id, float ratio, void* user_data);
599
601typedef struct N_GUI_HEXVIEW_DATA {
603 unsigned char* data;
605 size_t len;
611
637
647
649typedef struct N_GUI_DATAGRID_DATA {
653 size_t nb_cols;
655 size_t cols_cap;
658 size_t* col_order;
668 void (*on_columns_changed)(int widget_id, void* user_data);
670 char** cells;
672 size_t nb_rows;
674 size_t rows_cap;
684 unsigned char* row_sel;
688 ALLEGRO_COLOR* row_color;
691 unsigned char* row_has_color;
696 float h_scroll;
701 void (*on_select)(int widget_id, int row, void* user_data);
705 void (*on_context)(int widget_id, int row, int x, int y, void* user_data);
709
711typedef struct N_GUI_RADIOLIST_DATA {
715 size_t nb_items;
725 ALLEGRO_BITMAP* bg_bitmap;
727 ALLEGRO_BITMAP* item_bg_bitmap;
729 ALLEGRO_BITMAP* item_selected_bitmap;
731 void (*on_select)(int widget_id, int index, void* user_data);
735
736/* combobox feature flags */
738#define N_GUI_COMBOBOX_AUTO_WIDTH 1
743#define N_GUI_COMBOBOX_EXPAND_UP 2
744
746typedef struct N_GUI_COMBOBOX_DATA {
750 size_t nb_items;
769 ALLEGRO_BITMAP* bg_bitmap;
771 ALLEGRO_BITMAP* item_bg_bitmap;
773 ALLEGRO_BITMAP* item_selected_bitmap;
775 void (*on_select)(int widget_id, int index, void* user_data);
779 int flags;
781
783typedef struct N_GUI_IMAGE_DATA {
785 ALLEGRO_BITMAP* bitmap;
789
791typedef struct N_GUI_LABEL_DATA {
797 int align;
799 float scroll_y;
807 ALLEGRO_BITMAP* bg_bitmap;
809 void (*on_link_click)(int widget_id, const char* link, void* user_data);
813
821
823typedef struct N_GUI_DROPMENU_ENTRY {
829 int tag;
831 void (*on_click)(int widget_id, int entry_index, int tag, void* user_data);
835
836/* dropmenu feature flags */
840#define N_GUI_DROPMENU_EXPAND_UP 1
841
878
879/* widget */
880
882typedef struct N_GUI_WIDGET {
884 int id;
886 int type;
888 float x;
890 float y;
892 float w;
894 float h;
896 int state;
906 void* data;
909 char* tooltip;
916 float norm_x;
918 float norm_y;
920 float norm_w;
922 float norm_h;
924
934typedef void (*N_GUI_CUSTOM_DRAW)(N_GUI_WIDGET* widget, float x, float y, ALLEGRO_FONT* font, void* user_data);
935
943
944/* titlebar buttons state */
945
947typedef struct N_GUI_TB_BUTTONS {
965 ALLEGRO_BITMAP* minimize_bitmap;
967 ALLEGRO_BITMAP* minimize_hover_bitmap;
969 ALLEGRO_BITMAP* minimize_active_bitmap;
971 ALLEGRO_BITMAP* maximize_bitmap;
973 ALLEGRO_BITMAP* maximize_hover_bitmap;
975 ALLEGRO_BITMAP* maximize_active_bitmap;
977 ALLEGRO_BITMAP* close_bitmap;
979 ALLEGRO_BITMAP* close_hover_bitmap;
981 ALLEGRO_BITMAP* close_active_bitmap;
983 void (*on_minimize)(int window_id, void* user_data);
987 void (*on_maximize)(int window_id, void* user_data);
991 void (*on_close)(int window_id, void* user_data);
995
996/* pseudo window */
997
1141
1142/* global style (all configurable sizes, colors, paddings) */
1143
1147typedef struct N_GUI_STYLE {
1148 /* window chrome */
1159
1160 /* titlebar buttons */
1169
1170 /* window auto-scrollbar */
1183
1184 /* global display scrollbar */
1201
1202 /* resize grip */
1208 ALLEGRO_COLOR grip_color;
1209
1210 /* slider */
1225
1226 /* text area */
1231 ALLEGRO_COLOR tooltip_bg;
1233 ALLEGRO_COLOR tooltip_border;
1235 ALLEGRO_COLOR tooltip_fg;
1241
1242 /* checkbox */
1253
1254 /* radio list */
1263
1264 /* list items (shared by listbox, radiolist, combobox, dropmenu) */
1279
1280 /* dropdown arrow (combobox & dropmenu) */
1291
1298
1299 /* label */
1305 ALLEGRO_COLOR link_color_normal;
1307 ALLEGRO_COLOR link_color_hover;
1308
1309 /* scroll step */
1314
1315 /* combobox auto-width cap */
1318} N_GUI_STYLE;
1319
1320/* gui context */
1321
1324typedef struct N_GUI_PENDING_GEOM {
1326 float x;
1327 float y;
1328 float w;
1329 float h;
1330 int state;
1331 unsigned char consumed;
1333
1335#define N_GUI_PERSIST_MAX_COLS 64
1336
1352
1483
1484/* API */
1485
1486/* style helpers */
1487
1490
1491/* theme helpers */
1492
1501 ALLEGRO_COLOR bg,
1502 ALLEGRO_COLOR bg_hover,
1503 ALLEGRO_COLOR bg_active,
1504 ALLEGRO_COLOR border,
1505 ALLEGRO_COLOR border_hover,
1506 ALLEGRO_COLOR border_active,
1507 ALLEGRO_COLOR text,
1508 ALLEGRO_COLOR text_hover,
1509 ALLEGRO_COLOR text_active,
1510 float border_thickness,
1511 float corner_rx,
1512 float corner_ry);
1513
1525
1526/* text measurement */
1527
1530N_GUI_TEXT_DIMS n_gui_get_text_dims(ALLEGRO_FONT* font, const char* text);
1531
1532/* context */
1533
1535N_GUI_CTX* n_gui_new_ctx(ALLEGRO_FONT* default_font);
1537void n_gui_destroy_ctx(N_GUI_CTX** ctx);
1538
1539/* window management */
1540
1542int n_gui_add_window(N_GUI_CTX* ctx, const char* title, float x, float y, float w, float h);
1544int n_gui_add_window_auto(N_GUI_CTX* ctx, const char* title, float x, float y);
1546N_GUI_WINDOW* n_gui_get_window(N_GUI_CTX* ctx, int window_id);
1548void n_gui_close_window(N_GUI_CTX* ctx, int window_id);
1550void n_gui_open_window(N_GUI_CTX* ctx, int window_id);
1552void n_gui_toggle_window(N_GUI_CTX* ctx, int window_id);
1554int n_gui_window_is_open(N_GUI_CTX* ctx, int window_id);
1556void n_gui_minimize_window(N_GUI_CTX* ctx, int window_id);
1558void n_gui_restore_window(N_GUI_CTX* ctx, int window_id);
1560int n_gui_window_is_minimised(N_GUI_CTX* ctx, int window_id);
1562void n_gui_maximize_window(N_GUI_CTX* ctx, int window_id);
1564int n_gui_window_is_maximised(N_GUI_CTX* ctx, int window_id);
1565
1566/* native (detached) windows: promote a pop-up to a real OS window */
1567
1572void n_gui_set_event_queue(N_GUI_CTX* ctx, ALLEGRO_EVENT_QUEUE* queue);
1574ALLEGRO_EVENT_QUEUE* n_gui_get_event_queue(N_GUI_CTX* ctx);
1592int n_gui_window_detach(N_GUI_CTX* ctx, int window_id, int detach_flags);
1597int n_gui_window_attach(N_GUI_CTX* ctx, int window_id);
1599int n_gui_window_is_detached(N_GUI_CTX* ctx, int window_id);
1601ALLEGRO_DISPLAY* n_gui_window_get_display(N_GUI_CTX* ctx, int window_id);
1604int n_gui_window_from_display(N_GUI_CTX* ctx, ALLEGRO_DISPLAY* display);
1619int n_gui_window_set_native_icons(N_GUI_CTX* ctx, int window_id, ALLEGRO_BITMAP** icons, int num_icons);
1624int n_gui_window_native_is_hidden(N_GUI_CTX* ctx, int window_id);
1635void n_gui_window_set_close_callback(N_GUI_CTX* ctx, int window_id, void (*on_close)(int, void*), void* user_data);
1642void n_gui_window_set_content_draw_callback(N_GUI_CTX* ctx, int window_id, void (*on_content_draw)(int, void*), void* user_data);
1648void n_gui_window_set_minimize_callback(N_GUI_CTX* ctx, int window_id, void (*on_minimize)(int, void*), void* user_data);
1654void n_gui_window_set_maximize_callback(N_GUI_CTX* ctx, int window_id, void (*on_maximize)(int, void*), void* user_data);
1656void n_gui_window_set_tb_btn_theme(N_GUI_CTX* ctx, int window_id, N_GUI_THEME theme);
1658void n_gui_window_set_tb_close_theme(N_GUI_CTX* ctx, int window_id, N_GUI_THEME theme);
1666void n_gui_window_set_tb_button_bitmaps(N_GUI_CTX* ctx, int window_id, int btn_type, ALLEGRO_BITMAP* normal, ALLEGRO_BITMAP* hover, ALLEGRO_BITMAP* active);
1668void n_gui_raise_window(N_GUI_CTX* ctx, int window_id);
1670void n_gui_lower_window(N_GUI_CTX* ctx, int window_id);
1677void n_gui_focus_window(N_GUI_CTX* ctx, int window_id);
1683void n_gui_window_set_zorder(N_GUI_CTX* ctx, int window_id, int z_mode, int z_value);
1685int n_gui_window_get_zorder(N_GUI_CTX* ctx, int window_id);
1687int n_gui_window_get_zvalue(N_GUI_CTX* ctx, int window_id);
1692void n_gui_window_set_flags(N_GUI_CTX* ctx, int window_id, int flags);
1694int n_gui_window_get_flags(N_GUI_CTX* ctx, int window_id);
1696void n_gui_window_autosize(N_GUI_CTX* ctx, int window_id);
1702void n_gui_window_set_autofit(N_GUI_CTX* ctx, int window_id, int autofit_flags, float border);
1706void n_gui_window_apply_autofit(N_GUI_CTX* ctx, int window_id);
1707
1708/* resize mode */
1709
1711void n_gui_set_resize_mode(N_GUI_CTX* ctx, int mode);
1712
1715
1719void n_gui_window_set_resize_policy(N_GUI_CTX* ctx, int window_id, int policy);
1720
1722int n_gui_window_get_resize_policy(N_GUI_CTX* ctx, int window_id);
1723
1727void n_gui_window_update_normalized(N_GUI_CTX* ctx, int window_id);
1728
1733void n_gui_apply_adaptive_resize(N_GUI_CTX* ctx, float new_w, float new_h);
1734
1735/* widget creation (returns widget id) */
1736
1738int n_gui_add_button(N_GUI_CTX* ctx, int window_id, const char* label, float x, float y, float w, float h, int shape, void (*on_click)(int, void*), void* user_data);
1739
1741int n_gui_add_button_bitmap(N_GUI_CTX* ctx, int window_id, const char* label, float x, float y, float w, float h, ALLEGRO_BITMAP* normal, ALLEGRO_BITMAP* hover, ALLEGRO_BITMAP* active, void (*on_click)(int, void*), void* user_data);
1742
1744int n_gui_add_toggle_button(N_GUI_CTX* ctx, int window_id, const char* label, float x, float y, float w, float h, int shape, int initial_state, void (*on_click)(int, void*), void* user_data);
1745
1747int n_gui_button_is_toggled(N_GUI_CTX* ctx, int widget_id);
1748
1750void n_gui_button_set_label(N_GUI_CTX* ctx, int widget_id, const char* label);
1752void n_gui_button_set_state_bitmaps(N_GUI_CTX* ctx, int widget_id, ALLEGRO_BITMAP* normal, ALLEGRO_BITMAP* hover, ALLEGRO_BITMAP* active);
1754void n_gui_set_widget_tooltip(N_GUI_CTX* ctx, int widget_id, const char* text);
1758void n_gui_button_set_toggled(N_GUI_CTX* ctx, int widget_id, int toggled);
1760void n_gui_button_set_toggle_mode(N_GUI_CTX* ctx, int widget_id, int toggle_mode);
1761
1762/* button keyboard binding */
1775void n_gui_button_set_keycode(N_GUI_CTX* ctx, int widget_id, int keycode, int modifiers);
1776
1788void n_gui_button_set_keycode_focused(N_GUI_CTX* ctx, int widget_id, int keycode, int modifiers, const int* sources, int source_count);
1789
1791int n_gui_add_slider(N_GUI_CTX* ctx, int window_id, float x, float y, float w, float h, double min_val, double max_val, double initial, int mode, void (*on_change)(int, double, void*), void* user_data);
1792
1794int n_gui_add_vslider(N_GUI_CTX* ctx, int window_id, float x, float y, float w, float h, double min_val, double max_val, double initial, int mode, void (*on_change)(int, double, void*), void* user_data);
1795
1797int n_gui_add_textarea(N_GUI_CTX* ctx, int window_id, float x, float y, float w, float h, int multiline, size_t char_limit, void (*on_change)(int, const char*, void*), void* user_data);
1798
1800int n_gui_add_checkbox(N_GUI_CTX* ctx, int window_id, const char* label, float x, float y, float w, float h, int initial_checked, void (*on_toggle)(int, int, void*), void* user_data);
1801
1803int n_gui_add_scrollbar(N_GUI_CTX* ctx, int window_id, float x, float y, float w, float h, int orientation, int shape, double content_size, double viewport_size, void (*on_scroll)(int, double, void*), void* user_data);
1804
1805/* widget access */
1806
1808N_GUI_WIDGET* n_gui_get_widget(N_GUI_CTX* ctx, int widget_id);
1810void n_gui_set_widget_theme(N_GUI_CTX* ctx, int widget_id, N_GUI_THEME theme);
1814void n_gui_set_widget_visible(N_GUI_CTX* ctx, int widget_id, int visible);
1816void n_gui_set_widget_enabled(N_GUI_CTX* ctx, int widget_id, int enabled);
1818int n_gui_is_widget_enabled(N_GUI_CTX* ctx, int widget_id);
1822void n_gui_set_focus(N_GUI_CTX* ctx, int widget_id);
1823
1824/* slider helpers */
1826double n_gui_slider_get_value(N_GUI_CTX* ctx, int widget_id);
1828void n_gui_slider_set_value(N_GUI_CTX* ctx, int widget_id, double value);
1830void n_gui_slider_set_range(N_GUI_CTX* ctx, int widget_id, double min_val, double max_val);
1832void n_gui_slider_set_step(N_GUI_CTX* ctx, int widget_id, double step);
1838void n_gui_slider_set_value_format(N_GUI_CTX* ctx, int widget_id, const char* fmt);
1842void n_gui_slider_set_value_visible(N_GUI_CTX* ctx, int widget_id, int visible);
1843
1844/* textarea helpers */
1846const char* n_gui_textarea_get_text(N_GUI_CTX* ctx, int widget_id);
1848void n_gui_textarea_set_text(N_GUI_CTX* ctx, int widget_id, const char* text);
1850void n_gui_textarea_scroll_to_bottom(N_GUI_CTX* ctx, int widget_id);
1852void n_gui_textarea_set_selection(N_GUI_CTX* ctx, int widget_id, size_t start, size_t end);
1854void n_gui_textarea_scroll_to_offset(N_GUI_CTX* ctx, int widget_id, size_t byte_offset);
1856size_t n_gui_textarea_get_text_length(N_GUI_CTX* ctx, int widget_id);
1857
1858/* checkbox helpers */
1860int n_gui_checkbox_is_checked(N_GUI_CTX* ctx, int widget_id);
1862void n_gui_checkbox_set_checked(N_GUI_CTX* ctx, int widget_id, int checked);
1863
1864/* scrollbar helpers */
1866double n_gui_scrollbar_get_pos(N_GUI_CTX* ctx, int widget_id);
1868void n_gui_scrollbar_set_pos(N_GUI_CTX* ctx, int widget_id, double pos);
1870void n_gui_scrollbar_set_sizes(N_GUI_CTX* ctx, int widget_id, double content_size, double viewport_size);
1871
1872/* listbox */
1873
1875int n_gui_add_listbox(N_GUI_CTX* ctx, int window_id, float x, float y, float w, float h, int selection_mode, void (*on_select)(int, int, int, void*), void* user_data);
1877int n_gui_listbox_add_item(N_GUI_CTX* ctx, int widget_id, const char* text);
1879int n_gui_listbox_remove_item(N_GUI_CTX* ctx, int widget_id, int index);
1881void n_gui_listbox_clear(N_GUI_CTX* ctx, int widget_id);
1883int n_gui_listbox_get_count(N_GUI_CTX* ctx, int widget_id);
1885const char* n_gui_listbox_get_item_text(N_GUI_CTX* ctx, int widget_id, int index);
1887int n_gui_listbox_get_selected(N_GUI_CTX* ctx, int widget_id);
1889int n_gui_listbox_is_selected(N_GUI_CTX* ctx, int widget_id, int index);
1891void n_gui_listbox_set_selected(N_GUI_CTX* ctx, int widget_id, int index, int selected);
1893int n_gui_listbox_get_scroll_offset(N_GUI_CTX* ctx, int widget_id);
1895void n_gui_listbox_set_scroll_offset(N_GUI_CTX* ctx, int widget_id, int offset);
1896
1897/* split pane */
1898
1900int n_gui_add_splitpane(N_GUI_CTX* ctx, int window_id, float x, float y, float w, float h, int orientation, float ratio, void (*on_change)(int, float, void*), void* user_data);
1902float n_gui_splitpane_get_ratio(N_GUI_CTX* ctx, int widget_id);
1904void n_gui_splitpane_set_ratio(N_GUI_CTX* ctx, int widget_id, float ratio);
1906void n_gui_splitpane_set_limits(N_GUI_CTX* ctx, int widget_id, float min_ratio, float max_ratio);
1907
1908/* hex view */
1909
1911int n_gui_add_hexview(N_GUI_CTX* ctx, int window_id, float x, float y, float w, float h);
1913void n_gui_hexview_set_data(N_GUI_CTX* ctx, int widget_id, const unsigned char* data, size_t len);
1915size_t n_gui_hexview_get_length(N_GUI_CTX* ctx, int widget_id);
1916
1917/* syntax view */
1918
1920int n_gui_add_syntaxview(N_GUI_CTX* ctx, int window_id, float x, float y, float w, float h, int mode);
1922void n_gui_syntaxview_set_text(N_GUI_CTX* ctx, int widget_id, const char* text);
1924void n_gui_syntaxview_set_mode(N_GUI_CTX* ctx, int widget_id, int mode);
1926int n_gui_syntaxview_get_line_count(N_GUI_CTX* ctx, int widget_id);
1928const char* n_gui_syntaxview_get_text(N_GUI_CTX* ctx, int widget_id);
1931char* n_gui_syntaxview_get_selected_text(N_GUI_CTX* ctx, int widget_id);
1934void n_gui_syntaxview_set_selection(N_GUI_CTX* ctx, int widget_id, int start, int end);
1936void n_gui_syntaxview_select_all(N_GUI_CTX* ctx, int widget_id);
1938void n_gui_syntaxview_scroll_to_offset(N_GUI_CTX* ctx, int widget_id, int byte_offset);
1939
1940/* data grid */
1941
1943int n_gui_add_datagrid(N_GUI_CTX* ctx, int window_id, float x, float y, float w, float h, void (*on_select)(int, int, void*), void* user_data);
1945int n_gui_datagrid_add_column(N_GUI_CTX* ctx, int widget_id, const char* title, float width);
1947int n_gui_datagrid_add_row(N_GUI_CTX* ctx, int widget_id, const char** values);
1949void n_gui_datagrid_clear_rows(N_GUI_CTX* ctx, int widget_id);
1951int n_gui_datagrid_get_row_count(N_GUI_CTX* ctx, int widget_id);
1953const char* n_gui_datagrid_get_cell(N_GUI_CTX* ctx, int widget_id, int row, int col);
1955int n_gui_datagrid_get_selected(N_GUI_CTX* ctx, int widget_id);
1957void n_gui_datagrid_set_selected(N_GUI_CTX* ctx, int widget_id, int row);
1961void n_gui_datagrid_set_on_context(N_GUI_CTX* ctx, int widget_id, void (*on_context)(int, int, int, int, void*));
1963void n_gui_datagrid_sort(N_GUI_CTX* ctx, int widget_id, int col, int dir);
1968void n_gui_datagrid_set_multiselect(N_GUI_CTX* ctx, int widget_id, int enabled);
1970int n_gui_datagrid_is_row_selected(N_GUI_CTX* ctx, int widget_id, int row);
1974size_t n_gui_datagrid_get_selected_rows(N_GUI_CTX* ctx, int widget_id, int* out, size_t max);
1976void n_gui_datagrid_clear_selection(N_GUI_CTX* ctx, int widget_id);
1979void n_gui_datagrid_select_row(N_GUI_CTX* ctx, int widget_id, int row, int selected);
1980
1988void n_gui_datagrid_set_row_color(N_GUI_CTX* ctx, int widget_id, int row, ALLEGRO_COLOR color);
1990void n_gui_datagrid_clear_row_color(N_GUI_CTX* ctx, int widget_id, int row);
1993int n_gui_datagrid_get_row_color(N_GUI_CTX* ctx, int widget_id, int row, ALLEGRO_COLOR* out);
1995void n_gui_datagrid_clear_row_colors(N_GUI_CTX* ctx, int widget_id);
1999int n_gui_datagrid_get_scroll_offset(N_GUI_CTX* ctx, int widget_id);
2004void n_gui_datagrid_set_scroll_offset(N_GUI_CTX* ctx, int widget_id, int offset);
2008float n_gui_datagrid_get_h_scroll(N_GUI_CTX* ctx, int widget_id);
2012void n_gui_datagrid_set_h_scroll(N_GUI_CTX* ctx, int widget_id, float px);
2013
2015size_t n_gui_datagrid_get_column_count(N_GUI_CTX* ctx, int widget_id);
2017const char* n_gui_datagrid_get_column_title(N_GUI_CTX* ctx, int widget_id, int col);
2020void n_gui_datagrid_set_column_visible(N_GUI_CTX* ctx, int widget_id, int col, int visible);
2022int n_gui_datagrid_get_column_visible(N_GUI_CTX* ctx, int widget_id, int col);
2024void n_gui_datagrid_set_column_width(N_GUI_CTX* ctx, int widget_id, int col, float width);
2026float n_gui_datagrid_get_column_width(N_GUI_CTX* ctx, int widget_id, int col);
2028int n_gui_datagrid_display_to_physical(N_GUI_CTX* ctx, int widget_id, int display_pos);
2032void n_gui_datagrid_move_column(N_GUI_CTX* ctx, int widget_id, int from, int to);
2035void n_gui_datagrid_set_on_columns_changed(N_GUI_CTX* ctx, int widget_id, void (*cb)(int, void*));
2036
2037/* progress bar */
2038
2040int n_gui_add_progressbar(N_GUI_CTX* ctx, int window_id, float x, float y, float w, float h);
2042void n_gui_progressbar_set_value(N_GUI_CTX* ctx, int widget_id, float value);
2044float n_gui_progressbar_get_value(N_GUI_CTX* ctx, int widget_id);
2046void n_gui_progressbar_set_text(N_GUI_CTX* ctx, int widget_id, const char* text);
2047
2048/* custom (owner-draw) widget */
2049
2069int n_gui_add_custom(N_GUI_CTX* ctx, int window_id, float x, float y, float w, float h, N_GUI_CUSTOM_DRAW draw, void* user_data);
2070
2071/* radiolist */
2072
2074int n_gui_add_radiolist(N_GUI_CTX* ctx, int window_id, float x, float y, float w, float h, void (*on_select)(int, int, void*), void* user_data);
2076int n_gui_radiolist_add_item(N_GUI_CTX* ctx, int widget_id, const char* text);
2078void n_gui_radiolist_clear(N_GUI_CTX* ctx, int widget_id);
2080int n_gui_radiolist_get_selected(N_GUI_CTX* ctx, int widget_id);
2082void n_gui_radiolist_set_selected(N_GUI_CTX* ctx, int widget_id, int index);
2083
2084/* combobox */
2085
2087int n_gui_add_combobox(N_GUI_CTX* ctx, int window_id, float x, float y, float w, float h, void (*on_select)(int, int, void*), void* user_data);
2089int n_gui_combobox_add_item(N_GUI_CTX* ctx, int widget_id, const char* text);
2091void n_gui_combobox_clear(N_GUI_CTX* ctx, int widget_id);
2093int n_gui_combobox_get_selected(N_GUI_CTX* ctx, int widget_id);
2095const char* n_gui_combobox_get_item_text(N_GUI_CTX* ctx, int widget_id, int index);
2097void n_gui_combobox_set_selected(N_GUI_CTX* ctx, int widget_id, int index);
2098
2100void n_gui_combobox_set_flags(N_GUI_CTX* ctx, int widget_id, int flags);
2101
2102/* image */
2103
2105int n_gui_add_image(N_GUI_CTX* ctx, int window_id, float x, float y, float w, float h, ALLEGRO_BITMAP* bitmap, int scale_mode);
2107void n_gui_image_set_bitmap(N_GUI_CTX* ctx, int widget_id, ALLEGRO_BITMAP* bitmap);
2108
2109/* label (static text, optional hyperlink) */
2110
2112int n_gui_add_label(N_GUI_CTX* ctx, int window_id, const char* text, float x, float y, float w, float h, int align);
2114int n_gui_add_label_link(N_GUI_CTX* ctx, int window_id, const char* text, const char* link, float x, float y, float w, float h, int align, void (*on_link_click)(int, const char*, void*), void* user_data);
2116void n_gui_label_set_text(N_GUI_CTX* ctx, int widget_id, const char* text);
2118void n_gui_label_set_link(N_GUI_CTX* ctx, int widget_id, const char* link);
2119
2120/* dropdown menu */
2121
2133int n_gui_add_dropmenu(N_GUI_CTX* ctx, int window_id, const char* label, float x, float y, float w, float h, void (*on_open)(int, void*), void* on_open_user_data);
2135int n_gui_dropmenu_add_entry(N_GUI_CTX* ctx, int widget_id, const char* text, int tag, void (*on_click)(int, int, int, void*), void* user_data);
2137int n_gui_dropmenu_add_dynamic_entry(N_GUI_CTX* ctx, int widget_id, const char* text, int tag, void (*on_click)(int, int, int, void*), void* user_data);
2139void n_gui_dropmenu_clear_dynamic(N_GUI_CTX* ctx, int widget_id);
2141void n_gui_dropmenu_clear(N_GUI_CTX* ctx, int widget_id);
2143void n_gui_dropmenu_set_entry_text(N_GUI_CTX* ctx, int widget_id, int index, const char* text);
2145int n_gui_dropmenu_get_count(N_GUI_CTX* ctx, int widget_id);
2150float n_gui_dropmenu_panel_width(N_GUI_CTX* ctx, int widget_id);
2152void n_gui_dropmenu_set_flags(N_GUI_CTX* ctx, int widget_id, int flags);
2154void n_gui_dropmenu_set_label(N_GUI_CTX* ctx, int widget_id, const char* label);
2155
2156/* bitmap skinning */
2157
2167void n_gui_window_set_bitmaps(N_GUI_CTX* ctx, int window_id, ALLEGRO_BITMAP* bg, ALLEGRO_BITMAP* titlebar, int bg_scale_mode);
2168
2173void n_gui_slider_set_bitmaps(N_GUI_CTX* ctx, int widget_id, ALLEGRO_BITMAP* track, ALLEGRO_BITMAP* fill, ALLEGRO_BITMAP* handle, ALLEGRO_BITMAP* handle_hover, ALLEGRO_BITMAP* handle_active);
2174
2179void n_gui_scrollbar_set_bitmaps(N_GUI_CTX* ctx, int widget_id, ALLEGRO_BITMAP* track, ALLEGRO_BITMAP* thumb, ALLEGRO_BITMAP* thumb_hover, ALLEGRO_BITMAP* thumb_active);
2180
2185void n_gui_checkbox_set_bitmaps(N_GUI_CTX* ctx, int widget_id, ALLEGRO_BITMAP* box, ALLEGRO_BITMAP* box_checked, ALLEGRO_BITMAP* box_hover);
2186
2190void n_gui_textarea_set_bitmap(N_GUI_CTX* ctx, int widget_id, ALLEGRO_BITMAP* bg);
2191
2196void n_gui_textarea_set_mask_char(N_GUI_CTX* ctx, int widget_id, char mask);
2197
2204void n_gui_textarea_set_placeholder(N_GUI_CTX* ctx, int widget_id, const char* text);
2205
2210void n_gui_listbox_set_bitmaps(N_GUI_CTX* ctx, int widget_id, ALLEGRO_BITMAP* bg, ALLEGRO_BITMAP* item_bg, ALLEGRO_BITMAP* item_selected);
2211
2216void n_gui_radiolist_set_bitmaps(N_GUI_CTX* ctx, int widget_id, ALLEGRO_BITMAP* bg, ALLEGRO_BITMAP* item_bg, ALLEGRO_BITMAP* item_selected);
2217
2222void n_gui_combobox_set_bitmaps(N_GUI_CTX* ctx, int widget_id, ALLEGRO_BITMAP* bg, ALLEGRO_BITMAP* item_bg, ALLEGRO_BITMAP* item_selected);
2223
2228void n_gui_dropmenu_set_bitmaps(N_GUI_CTX* ctx, int widget_id, ALLEGRO_BITMAP* panel, ALLEGRO_BITMAP* item_hover);
2229
2233void n_gui_label_set_bitmap(N_GUI_CTX* ctx, int widget_id, ALLEGRO_BITMAP* bg);
2234
2235/* JSON theme I/O */
2236
2239int n_gui_save_theme_json(N_GUI_CTX* ctx, const char* filepath);
2240
2243int n_gui_load_theme_json(N_GUI_CTX* ctx, const char* filepath);
2244
2245/* JSON window layout I/O */
2246
2256int n_gui_save_layout_json(N_GUI_CTX* ctx, const char* filepath);
2257
2268int n_gui_load_layout_json(N_GUI_CTX* ctx, const char* filepath);
2269
2277void n_gui_widget_set_persist_key(N_GUI_CTX* ctx, int widget_id, const char* key);
2278
2280const char* n_gui_widget_get_persist_key(N_GUI_CTX* ctx, int widget_id);
2281
2282/* virtual canvas / display / DPI */
2283
2290void n_gui_set_virtual_size(N_GUI_CTX* ctx, float w, float h);
2291
2296
2304void n_gui_screen_to_virtual(const N_GUI_CTX* ctx, float sx, float sy, float* vx, float* vy);
2305
2309void n_gui_set_display_size(N_GUI_CTX* ctx, float w, float h);
2311void n_gui_set_display(N_GUI_CTX* ctx, ALLEGRO_DISPLAY* display);
2312
2314void n_gui_set_shape_mode(N_GUI_CTX* ctx, int shape_mode);
2315
2318
2321void n_gui_set_dpi_scale(N_GUI_CTX* ctx, float scale);
2322
2324float n_gui_get_dpi_scale(const N_GUI_CTX* ctx);
2325
2329float n_gui_detect_dpi_scale(N_GUI_CTX* ctx, ALLEGRO_DISPLAY* display);
2330
2331/* event processing & drawing */
2332
2334int n_gui_process_event(N_GUI_CTX* ctx, ALLEGRO_EVENT event);
2336void n_gui_draw(N_GUI_CTX* ctx);
2340
2345void n_gui_mark_dirty(N_GUI_CTX* ctx);
2346
2361
2363#define N_GUI_TAB_MAX 16
2364
2380
2382N_GUI_TAB_PANEL* n_gui_tab_create(N_GUI_CTX* ctx, int window_id, float x, float y, float button_w, float button_h, void (*on_tab_change)(int, void*), void* user_data);
2384int n_gui_tab_add(N_GUI_TAB_PANEL* panel, const char* label);
2386void n_gui_tab_set_content_window(N_GUI_TAB_PANEL* panel, int tab_index, int window_id);
2388void n_gui_tab_set_active(N_GUI_TAB_PANEL* panel, int index);
2390int n_gui_tab_get_active(const N_GUI_TAB_PANEL* panel);
2392void n_gui_tab_free(N_GUI_TAB_PANEL** panel);
2393
2395#define N_GUI_SECTIONLIST_MAX 16
2396
2398#define N_GUI_SECTION_WIDGETS_MAX 48
2399
2410
2428
2430N_GUI_SECTIONLIST* n_gui_sectionlist_create(N_GUI_CTX* ctx, int window_id, float x, float y0, float width, float header_h, float gap, void (*on_toggle)(int, int, void*), void* user_data);
2432int n_gui_sectionlist_add_section(N_GUI_SECTIONLIST* sl, const char* title, float header_y, int folded);
2434void n_gui_sectionlist_add_widget(N_GUI_SECTIONLIST* sl, int section_index, int widget_id);
2440void n_gui_sectionlist_set_folded(N_GUI_SECTIONLIST* sl, int section_index, int folded);
2442int n_gui_sectionlist_is_folded(const N_GUI_SECTIONLIST* sl, int section_index);
2449
2451#define N_GUI_TREE_MAX 2048
2452
2462
2464#define N_GUI_DROP_BEFORE 0
2465#define N_GUI_DROP_INTO 1
2466#define N_GUI_DROP_AFTER 2
2467
2474typedef int (*n_gui_tree_on_drop_t)(int src_node, int dst_node, int position, void* user_data);
2475
2500
2502N_GUI_TREE* n_gui_tree_create(N_GUI_CTX* ctx, int window_id, float x, float y, float w, float h, void (*on_select)(int, void*), void* user_data);
2504int n_gui_tree_add_node(N_GUI_TREE* tree, const char* label, int parent_index, void* user_data);
2506void n_gui_tree_clear(N_GUI_TREE* tree);
2510void n_gui_tree_remove_node(N_GUI_TREE* tree, int node_index);
2512void n_gui_tree_set_label(N_GUI_TREE* tree, int node_index, const char* new_label);
2519void n_gui_tree_set_selection(N_GUI_TREE* tree, int node_index);
2524int n_gui_tree_find_by_user_data(const N_GUI_TREE* tree, const void* ptr);
2526void n_gui_tree_toggle_expand(N_GUI_TREE* tree, int node_index);
2528void n_gui_tree_rebuild(N_GUI_TREE* tree);
2530void n_gui_tree_free(N_GUI_TREE** tree);
2531
2535 n_gui_tree_on_drop_t on_drop,
2536 void* user_data);
2537
2541void n_gui_tree_tick(N_GUI_TREE* tree);
2542
2547
2549#define N_GUI_KV_MAX 128
2550
2560
2587
2589N_GUI_KVTABLE* n_gui_kvtable_create(N_GUI_CTX* ctx, int window_id, float row_height, float padding, void (*on_remove)(int, void*), void* user_data);
2592 const char* key,
2593 const char* value,
2594 const char* description,
2595 int enabled);
2597void n_gui_kvtable_remove_row(N_GUI_KVTABLE* table, int row_index);
2608void n_gui_kvtable_set_columns(N_GUI_KVTABLE* table, int show_value, int show_desc, int show_enabled);
2612void n_gui_kvtable_set_placeholders(N_GUI_KVTABLE* table, const char* key_hint, const char* value_hint);
2616void n_gui_kvtable_set_top_offset(N_GUI_KVTABLE* table, float top_offset);
2618int n_gui_kvtable_get_count(const N_GUI_KVTABLE* table);
2624void n_gui_kvtable_free(N_GUI_KVTABLE** table);
2625
2630#ifdef __cplusplus
2631}
2632#endif
2633
2634#endif /* __NILOREA_GUI__ */
ALLEGRO_DISPLAY * display
Definition ex_fluid.c:54
void on_link_click(int widget_id, const char *link, void *user_data)
Definition ex_gui.c:177
void on_scroll(int widget_id, double pos, void *user_data)
Definition ex_gui.c:118
static int mode
char * key
char title[128]
column header title
Definition n_gui.h:641
char title[128]
window title
Definition n_gui.h:1003
ALLEGRO_BITMAP * thumb_bitmap
optional bitmap for the thumb/handle, normal state (NULL = color theme)
Definition n_gui.h:533
float h
height
Definition n_gui.h:894
float scroll_y
vertical scroll offset for overflowing text (pixels)
Definition n_gui.h:799
float scroll_y
vertical scroll offset for auto-scrollbar (pixels)
Definition n_gui.h:1033
int visible
visibility flag
Definition n_gui.h:898
ALLEGRO_BITMAP * panel_bitmap
optional bitmap for the dropdown panel background (NULL = color theme)
Definition n_gui.h:866
int saved_flags
embedded feature flags saved by n_gui_window_detach (a detached window is forced frameless because th...
Definition n_gui.h:1105
char * text
owned copy of the text, or NULL
Definition n_gui.h:615
size_t * col_order
display order: display_pos -> physical column index (sized cols_cap), or NULL when the display order ...
Definition n_gui.h:658
ALLEGRO_BITMAP * handle_hover_bitmap
optional bitmap for the handle on hover (NULL = fallback to handle_bitmap)
Definition n_gui.h:441
int window_id
owning window for coord math
Definition n_gui.h:2480
float button_h
height of each tab button
Definition n_gui.h:2376
int is_open
is dropdown currently open
Definition n_gui.h:756
int content_window_ids[16]
content window IDs (-1 = none)
Definition n_gui.h:2370
int w
bounding box width in pixels
Definition n_gui.h:334
int native_drag_wx
native window x at the drag grab, the move is native_drag_wx plus the desktop cursor travel since the...
Definition n_gui.h:1126
float gap
vertical gap between rows
Definition n_gui.h:2421
int open_combobox_id
id of the combobox whose dropdown is currently open, or -1
Definition n_gui.h:1390
ALLEGRO_COLOR scrollbar_track_color
scrollbar track colour
Definition n_gui.h:1180
int folded
1 = collapsed (members hidden), 0 = expanded
Definition n_gui.h:2407
int max_visible
max visible items in dropdown
Definition n_gui.h:767
int selected_index
currently selected index (-1 = none)
Definition n_gui.h:754
void(* on_remove)(int, void *)
callback on row removal
Definition n_gui.h:2578
ALLEGRO_BITMAP * minimize_active_bitmap
optional bitmap for minimize button active state
Definition n_gui.h:969
int sort_col
column index used for sorting, or -1
Definition n_gui.h:676
int scroll_offset
first visible row
Definition n_gui.h:609
size_t items_capacity
allocated capacity
Definition n_gui.h:559
ALLEGRO_COLOR grip_color
grip line colour
Definition n_gui.h:1208
float dropdown_border_thickness
dropdown panel border thickness
Definition n_gui.h:1290
char * text
text content (dynamically allocated, text_alloc bytes)
Definition n_gui.h:463
int nb_rows
total rows (including removed)
Definition n_gui.h:2566
float slider_handle_edge_offset
handle circle offset from edge
Definition n_gui.h:1220
int bytes_per_row
bytes shown per row
Definition n_gui.h:607
int selected_row
selected data row (the primary / last-clicked row), or -1
Definition n_gui.h:680
float widget_dy[48]
each member's y offset from the section content top, captured at add time
Definition n_gui.h:2405
int parent_index
parent node index, or -1 for root
Definition n_gui.h:2456
int shape
shape type: N_GUI_SHAPE_RECT or N_GUI_SHAPE_ROUNDED
Definition n_gui.h:529
float x
saved x (already display-scaled)
Definition n_gui.h:1326
float content_h
total content height computed from widgets (internal)
Definition n_gui.h:1037
float global_scrollbar_thumb_padding
global thumb inset from track edge
Definition n_gui.h:1190
char label[128]
menu label (shown on the button)
Definition n_gui.h:845
size_t items_capacity
allocated capacity
Definition n_gui.h:752
N_GUI_TREE_NODE nodes[2048]
node storage
Definition n_gui.h:2481
float x
position x on screen
Definition n_gui.h:1005
float scrollbar_size
scrollbar track width/height
Definition n_gui.h:1172
float norm_y
normalized position y (0.0-1.0 fraction of reference display height)
Definition n_gui.h:1063
void(* on_select)(int widget_id, int index, void *user_data)
callback on selection change (widget_id, selected_index, user_data)
Definition n_gui.h:731
float scrollbar_thumb_corner_r
thumb corner radius
Definition n_gui.h:1178
void(* on_change)(int widget_id, float ratio, void *user_data)
callback fired while the divider is dragged (widget_id, ratio, user_data)
Definition n_gui.h:595
int nb_widgets
number of member widgets
Definition n_gui.h:2406
int is_dynamic
is this entry dynamic (rebuilt via callback each time menu opens)
Definition n_gui.h:827
float title_padding
padding left of title text
Definition n_gui.h:1156
float min_win_h
minimum window height (for resize)
Definition n_gui.h:1154
float dropdown_arrow_half_w
horizontal half-extent of the arrow chevron
Definition n_gui.h:1288
int toggled
toggle state: 0 = off/unclicked, 1 = on/clicked (only used when toggle_mode=1)
Definition n_gui.h:394
char ** cells
row-major cell strings (nb_rows * nb_cols owned char*)
Definition n_gui.h:670
int lbl_enabled
label widget ID for "On" header
Definition n_gui.h:2576
ALLEGRO_BITMAP * item_bg_bitmap
optional bitmap for per-item background, normal state (NULL = color theme)
Definition n_gui.h:569
int scroll_offset
scroll offset in items
Definition n_gui.h:721
float ref_display_h
reference display height at the time normalized values were last captured
Definition n_gui.h:1436
float slider_track_corner_r
track corner radius
Definition n_gui.h:1214
int y
bounding box y offset from draw origin
Definition n_gui.h:333
float titlebar_h
title bar height
Definition n_gui.h:1013
ALLEGRO_BITMAP * handle_active_bitmap
optional bitmap for the handle while dragging (NULL = fallback to handle_bitmap)
Definition n_gui.h:443
void(* on_tab_change)(int, void *)
callback on tab switch (may be NULL)
Definition n_gui.h:2377
int selected_syntaxview_id
id of the syntax-view widget with the most recent text selection, or -1
Definition n_gui.h:1430
float top_offset
unscaled y offset of the header row from the window top (default 0), to reserve space above the table...
Definition n_gui.h:2585
float norm_y
normalized position y (fraction of parent window h, used for SCALE resize)
Definition n_gui.h:918
int dropmenu_max_visible
default max visible items for dropmenu panel
Definition n_gui.h:1272
float norm_x
normalized position x (0.0-1.0 fraction of reference display width)
Definition n_gui.h:1061
float textarea_padding
Definition n_gui.h:1236
int sel_start
selection start byte offset into text, or -1 when nothing is selected
Definition n_gui.h:623
ALLEGRO_BITMAP * bg_bitmap
optional bitmap for the label background (NULL = no background)
Definition n_gui.h:807
float item_height
item height
Definition n_gui.h:864
N_GUI_THEME theme
color theme for this widget
Definition n_gui.h:902
float title_max_w_reserve
pixels reserved right of title for truncation
Definition n_gui.h:1158
int multiselect
1 = multi-row selection enabled (Ctrl/Shift-click), 0 = single-select
Definition n_gui.h:682
double anim_until
deadline (al_get_time seconds) until which a transient animation is in progress (button key-press fla...
Definition n_gui.h:1478
size_t rows_cap
allocated row capacity (in rows)
Definition n_gui.h:674
int want_native
1 when the window should live in a native OS window: set by n_gui_window_detach and by a loaded layou...
Definition n_gui.h:1088
char text[128]
item display text
Definition n_gui.h:547
int nb_tabs
number of tabs
Definition n_gui.h:2371
int key_sources[8]
widget IDs that can trigger this focused key binding.
Definition n_gui.h:409
float checkbox_label_gap
gap between box and label text
Definition n_gui.h:1250
int open_dropmenu_id
id of the dropdown menu whose panel is currently open, or -1
Definition n_gui.h:1394
float global_scrollbar_thumb_corner_r
global thumb corner radius
Definition n_gui.h:1192
N_GUI_THEME default_theme
default theme (applied to new widgets/windows)
Definition n_gui.h:1366
int flags
bitmask of N_GUI_DROPMENU_* flags
Definition n_gui.h:876
float saved_y
embedded y saved by n_gui_window_detach, restored by n_gui_window_attach
Definition n_gui.h:1098
float dpi_scale
DPI scale factor (1.0 = normal, 1.25 = 125%, 2.0 = HiDPI, etc.)
Definition n_gui.h:1408
void * user_data
user data for callback
Definition n_gui.h:811
int scroll_from_wheel
set to 1 when scroll was changed by mouse wheel, cleared on key input
Definition n_gui.h:484
ALLEGRO_COLOR tooltip_fg
tooltip text color
Definition n_gui.h:1235
int btn_add
button widget ID for "+" add row
Definition n_gui.h:2577
ALLEGRO_BITMAP * bg_bitmap
optional bitmap for the window body background (NULL = color fill)
Definition n_gui.h:1045
float scrollbar_thumb_padding
thumb inset from track edge
Definition n_gui.h:1176
float w
width
Definition n_gui.h:892
ALLEGRO_COLOR text_normal
text normal
Definition n_gui.h:355
int remove_id
button widget ID for the remove action
Definition n_gui.h:2557
int pressed
which button is currently pressed (N_GUI_TB_BTN_*)
Definition n_gui.h:951
void * on_maximize_user_data
user data for on_maximize callback
Definition n_gui.h:989
int drop_position
N_GUI_DROP_BEFORE / INTO / AFTER.
Definition n_gui.h:2494
float w
window width
Definition n_gui.h:1009
int combobox_max_visible
default max visible items for combobox dropdown
Definition n_gui.h:1270
ALLEGRO_BITMAP * item_bg_bitmap
optional bitmap for per-item background, normal state (NULL = color theme)
Definition n_gui.h:771
float norm_h
normalized height (fraction of parent window h)
Definition n_gui.h:922
void * user_data
user data for callback
Definition n_gui.h:2486
int sel_dragging
1 while a mouse drag is extending the selection, 0 otherwise
Definition n_gui.h:627
void(* on_open)(int widget_id, void *user_data)
callback to rebuild dynamic entries each time the menu is opened.
Definition n_gui.h:872
size_t cols_cap
allocated column capacity
Definition n_gui.h:655
int mouse_b1_prev
previous mouse button 1 state
Definition n_gui.h:1376
int listbox_id
listbox widget ID
Definition n_gui.h:2479
float corner_rx
corner radius for rounded shapes
Definition n_gui.h:363
ALLEGRO_COLOR selection_color
text selection highlight colour (semi-transparent recommended)
Definition n_gui.h:367
int drag_hover_node
current hover node, or -1
Definition n_gui.h:2493
ALLEGRO_BITMAP * bitmap
optional bitmap for the button (NULL = color theme)
Definition n_gui.h:384
int flags
bitmask of N_GUI_COMBOBOX_* flags
Definition n_gui.h:779
float gui_offset_x
horizontal letterbox offset for virtual canvas
Definition n_gui.h:1416
int h_scroll_dragging
1 while the user is dragging the horizontal scrollbar thumb (so the shared scrollbar-drag handler rou...
Definition n_gui.h:699
int pending_layout_count
number of valid entries in pending_layout
Definition n_gui.h:1448
int state
saved minimised/maximised bits, applied on create
Definition n_gui.h:1330
float tooltip_delay
inner padding
Definition n_gui.h:1229
int key_focus_only
if 1, keycode fires only when the button itself or a source widget has focus.
Definition n_gui.h:406
int value_visible
draw the built-in value label next to/below the handle.
Definition n_gui.h:457
int ncols
column count (kind == DATAGRID)
Definition n_gui.h:1346
N_GUI_KV_ROW rows[128]
row storage
Definition n_gui.h:2565
char * tooltip
owned tooltip text shown after the pointer rests on the widget (NULL = none); heap-allocated with no ...
Definition n_gui.h:909
int type
widget type (N_GUI_TYPE_*)
Definition n_gui.h:886
int state
current state flags (N_GUI_STATE_*)
Definition n_gui.h:896
float scroll_step
pixels per mouse wheel notch for window auto-scroll
Definition n_gui.h:1311
int multiline
0 = single line, 1 = multiline
Definition n_gui.h:471
int lines_valid
0 when cached_nb_lines / cached_headers_end are stale (rebuild on next use).
Definition n_gui.h:631
int key_id
textarea widget ID for the key
Definition n_gui.h:2553
ALLEGRO_BITMAP * bitmap_hover
optional bitmap for hover state
Definition n_gui.h:386
int kind
N_GUI_TYPE_SPLITPANE or N_GUI_TYPE_DATAGRID.
Definition n_gui.h:1344
int button_ids[16]
toggle button widget IDs
Definition n_gui.h:2369
int max_visible
max visible items
Definition n_gui.h:862
float gui_bounds_w
total bounding box width of all windows (computed internally)
Definition n_gui.h:1404
double key_press_until
absolute al_get_time() deadline until which the button is rendered in its pressed (N_GUI_STATE_ACTIVE...
Definition n_gui.h:413
float x
position x relative to parent window
Definition n_gui.h:888
float drag_press_x
mouse x at press time
Definition n_gui.h:2496
float global_scrollbar_size
global scrollbar track width/height
Definition n_gui.h:1186
int highlight_index
open-panel navigation cursor for the wheel and Up/Down keys (-1 = none).
Definition n_gui.h:860
void(* on_toggle)(int, int, void *)
callback(section_index, folded, user_data) on a header click (may be NULL)
Definition n_gui.h:2425
float textarea_cursor_width
cursor width in pixels
Definition n_gui.h:1238
char text[4096]
text to display
Definition n_gui.h:793
void * user_data
user data for callback
Definition n_gui.h:2378
char title[128]
owning window title to match on
Definition n_gui.h:1342
float tb_btn_size
titlebar button size (0 = auto: titlebar_h - 4)
Definition n_gui.h:1162
float norm_h
normalized height (fraction of reference display height, used in SCALE mode)
Definition n_gui.h:1067
char value_format[32]
printf-style format string applied to the numeric value when the built-in readout draws.
Definition n_gui.h:452
float min_win_w
minimum window width (for resize)
Definition n_gui.h:1152
ALLEGRO_BITMAP * bg_bitmap
optional bitmap for the combobox background (NULL = color theme)
Definition n_gui.h:769
ALLEGRO_BITMAP * maximize_bitmap
optional bitmap for maximize button normal state (NULL = color theme)
Definition n_gui.h:971
void(* on_change)(int widget_id, double value, void *user_data)
callback on value change
Definition n_gui.h:445
float item_height
item height in pixels
Definition n_gui.h:723
int native_drag_wy
native window y at the drag grab (see native_drag_wx)
Definition n_gui.h:1128
float drag_ox
drag offset x (internal)
Definition n_gui.h:1025
void(* on_click)(int widget_id, void *user_data)
callback on click (widget_id passed)
Definition n_gui.h:415
float row_height
unscaled row height in pixels
Definition n_gui.h:2568
int expanded
1 if expanded
Definition n_gui.h:2457
N_GUI_LISTITEM * items
dynamic array of items
Definition n_gui.h:748
char label[128]
display text
Definition n_gui.h:2455
int mode
highlighting mode: N_GUI_SYNTAX_*
Definition n_gui.h:619
int drag_armed_node
pressed-but-not-yet-dragging
Definition n_gui.h:2492
ALLEGRO_BITMAP * close_hover_bitmap
optional bitmap for close button hover state
Definition n_gui.h:979
int show_enabled
1 to show the enabled-checkbox column (default 1)
Definition n_gui.h:2582
N_GUI_THEME theme
color theme for this window chrome
Definition n_gui.h:1021
int sel_end
selection end byte offset (tracks the cursor while a drag is in progress)
Definition n_gui.h:625
int id
unique widget id
Definition n_gui.h:884
int native_close_pending
1 when the native window must be released at the next safe point (an ALLEGRO_EVENT_DISPLAY_CLOSE arri...
Definition n_gui.h:1094
int sort_dir
sort direction: 1 ascending, -1 descending
Definition n_gui.h:678
float saved_w
embedded width saved by n_gui_window_detach, restored by n_gui_window_attach
Definition n_gui.h:1100
char title[64]
section title (header label minus the fold glyph)
Definition n_gui.h:2402
int desc_id
textarea widget ID for the description
Definition n_gui.h:2555
int widget_ids[48]
member widget ids
Definition n_gui.h:2404
float width
column width in pixels
Definition n_gui.h:643
int next_window_id
next window id to assign
Definition n_gui.h:1362
float item_selection_inset
item highlight inset from left/right edges
Definition n_gui.h:1276
int header_id
clickable header button widget id
Definition n_gui.h:2403
float saved_h
embedded height saved by n_gui_window_detach, restored by n_gui_window_attach
Definition n_gui.h:1102
ALLEGRO_COLOR border_normal
border normal
Definition n_gui.h:349
void(* on_click)(int widget_id, int entry_index, int tag, void *user_data)
callback when this entry is clicked (widget_id, entry_index, tag, user_data)
Definition n_gui.h:831
N_GUI_SECTION sections[16]
section storage
Definition n_gui.h:2422
void(* on_content_draw)(int window_id, void *user_data)
optional callback invoked during n_gui_draw immediately after this window's own content is drawn,...
Definition n_gui.h:1074
float init_win_w
parent window width at create time
Definition n_gui.h:2571
int has_children
1 if node has children
Definition n_gui.h:2459
N_GUI_THEME close_theme
theme for close button (defaults to red hover/active)
Definition n_gui.h:963
void * user_data
user data for callback
Definition n_gui.h:833
float value
progress fraction, clamped to 0.0 .
Definition n_gui.h:817
int scroll_offset
scroll offset
Definition n_gui.h:855
ALLEGRO_COLOR tooltip_bg
tooltip bubble background color
Definition n_gui.h:1231
ALLEGRO_COLOR text_hover
text hover
Definition n_gui.h:357
float restore_x
saved x position before maximise (for restore)
Definition n_gui.h:953
float dropdown_arrow_half_h
vertical half-extent of the arrow chevron
Definition n_gui.h:1286
int z_value
z-value for N_GUI_ZORDER_FIXED mode (lower = behind, higher = on top)
Definition n_gui.h:1043
ALLEGRO_BITMAP * item_bg_bitmap
optional bitmap for per-item background, normal state (NULL = color theme)
Definition n_gui.h:727
int highlight_index
open-panel navigation cursor for the wheel and Up/Down keys (-1 = none).
Definition n_gui.h:763
double cursor_time
timestamp of last cursor activity (for blink reset)
Definition n_gui.h:486
size_t entries_capacity
allocated capacity
Definition n_gui.h:851
int mouse_y
mouse state tracking
Definition n_gui.h:1372
float grip_line_thickness
grip line thickness
Definition n_gui.h:1206
int window_id
window holding the headers and members
Definition n_gui.h:2416
int lbl_key
label widget ID for "Key" header
Definition n_gui.h:2573
char key[128]
widget persist key to match on
Definition n_gui.h:1343
size_t sel_end
selection end position (tracks cursor during selection)
Definition n_gui.h:478
int resize_policy
per-window resize policy: N_GUI_WIN_RESIZE_NONE, _MOVE, or _SCALE
Definition n_gui.h:1059
N_GUI_THEME default_tb_close_theme
default theme for titlebar close button
Definition n_gui.h:1440
size_t nb_items
number of items
Definition n_gui.h:715
char persist_key[128]
optional stable key for persisting this widget's user-adjustable state (splitpane divider ratio,...
Definition n_gui.h:914
int native_drag_cx
desktop x of the mouse cursor when a native (N_GUI_DETACH_OWN_CHROME) title bar drag started.
Definition n_gui.h:1121
void(* on_close)(int window_id, void *user_data)
callback on close button click (NULL = default: clear N_GUI_WIN_OPEN)
Definition n_gui.h:991
char title[128]
window title to match on
Definition n_gui.h:1325
void * user_data
user data for callback
Definition n_gui.h:777
float first_inset
content-local left inset applied to the FIRST header only, so a button can sit before it on the same ...
Definition n_gui.h:2424
int cached_nb_lines
cached line count (matches _text_line_count), valid when lines_valid
Definition n_gui.h:633
float padding
unscaled padding in pixels
Definition n_gui.h:2569
unsigned char * data
owned copy of the bytes, or NULL
Definition n_gui.h:603
int detach_flags
options the window was detached with (N_GUI_DETACH_*), remembered so a close/open cycle and a restore...
Definition n_gui.h:1084
n_gui_tree_on_drop_t on_drop
drag-reorder state (managed by n_gui_tree_tick)
Definition n_gui.h:2489
void(* on_select)(int, void *)
selection callback
Definition n_gui.h:2485
int shape
shape type: N_GUI_SHAPE_RECT, N_GUI_SHAPE_ROUNDED, N_GUI_SHAPE_BITMAP
Definition n_gui.h:390
int z_order
z-order mode (N_GUI_ZORDER_NORMAL, _ALWAYS_ON_TOP, _ALWAYS_BEHIND, _FIXED)
Definition n_gui.h:1041
float max_ratio
upper clamp applied to ratio
Definition n_gui.h:591
int tag
user-defined tag for the entry (e.g.
Definition n_gui.h:829
int mouse_b1
mouse button 1 state
Definition n_gui.h:1374
float button_w
width of each tab button
Definition n_gui.h:2375
float display_w
display/viewport width (set via n_gui_set_display_size)
Definition n_gui.h:1396
int nb_sections
number of sections
Definition n_gui.h:2423
N_GUI_LISTITEM * items
dynamic array of items
Definition n_gui.h:713
float width
header width
Definition n_gui.h:2419
ALLEGRO_BITMAP * box_hover_bitmap
optional bitmap for the checkbox square on hover (NULL = fallback to box_bitmap/box_checked_bitmap)
Definition n_gui.h:511
int h
bounding box height in pixels
Definition n_gui.h:335
float grip_size
grip area size
Definition n_gui.h:1204
void * user_data
opaque user pointer handed back to the callback (not owned by n_gui)
Definition n_gui.h:941
float radio_label_gap
gap between circle and label text
Definition n_gui.h:1262
N_GUI_CTX * ctx
GUI context.
Definition n_gui.h:2478
ALLEGRO_DISPLAY * display
display pointer for clipboard operations (set via n_gui_set_display)
Definition n_gui.h:1426
void * drop_user_data
user data for on_drop
Definition n_gui.h:2490
float saved_x
embedded x saved by n_gui_window_detach, restored by n_gui_window_attach
Definition n_gui.h:1096
float norm_w
normalized width (fraction of reference display width, used in SCALE mode)
Definition n_gui.h:1065
float content_w
total content width computed from widgets (internal)
Definition n_gui.h:1039
N_GUI_PENDING_WIDGET * pending_widgets
saved widget state for keyed widgets that did NOT exist when the layout was loaded; n_gui_widget_set_...
Definition n_gui.h:1453
void * user_data
user data for this node
Definition n_gui.h:2460
float norm_x
normalized position x (fraction of parent window w, used for SCALE resize)
Definition n_gui.h:916
ALLEGRO_COLOR global_scrollbar_thumb_color
global scrollbar thumb colour
Definition n_gui.h:1198
int selected_label_id
id of the label widget with the most recent text selection, or -1
Definition n_gui.h:1428
float radio_inner_offset
inner filled circle shrink from outer
Definition n_gui.h:1260
float min_ratio
lower clamp applied to ratio
Definition n_gui.h:589
float min_w
minimum width
Definition n_gui.h:1029
unsigned char * row_sel
per-row selection flags (1 = selected), sized rows_cap; NULL until needed
Definition n_gui.h:684
int selected_index
currently selected index (-1 = none)
Definition n_gui.h:719
ALLEGRO_BITMAP * track_bitmap
optional bitmap for the track/rail background (NULL = color theme)
Definition n_gui.h:435
int mouse_x
mouse state tracking
Definition n_gui.h:1370
N_GUI_TB_BUTTONS tb_buttons
titlebar button state (minimize, maximize, close)
Definition n_gui.h:1069
int order[64]
display position -> physical column
Definition n_gui.h:1347
ALLEGRO_COLOR scrollbar_thumb_color
scrollbar thumb colour
Definition n_gui.h:1182
int active_tab
currently active tab index
Definition n_gui.h:2372
float y
saved y
Definition n_gui.h:1327
float native_h
last known native window height (see native_w)
Definition n_gui.h:1111
float checkbox_max_size
maximum box size
Definition n_gui.h:1244
size_t nb_entries
number of entries
Definition n_gui.h:849
int visible_map[2048]
visible row to node index
Definition n_gui.h:2483
int tooltip_anchor_x
pointer x when the tooltip was last armed (movement re-arms)
Definition n_gui.h:1386
float checkbox_mark_thickness
checkmark line thickness
Definition n_gui.h:1248
unsigned char * row_has_color
per-row tint flags (1 = row_color[row] is painted), sized rows_cap; NULL until a row color is set
Definition n_gui.h:691
ALLEGRO_BITMAP * close_bitmap
optional bitmap for close button normal state (NULL = color theme)
Definition n_gui.h:977
int sel_start
selection start byte offset (-1 = no selection)
Definition n_gui.h:801
ALLEGRO_BITMAP * bitmap
bitmap to display (not owned, not freed)
Definition n_gui.h:785
ALLEGRO_BITMAP * fill_bitmap
optional bitmap for the filled portion of the track (NULL = color theme)
Definition n_gui.h:437
ALLEGRO_COLOR tooltip_border
tooltip bubble border color
Definition n_gui.h:1233
void * on_close_user_data
user data for on_close callback
Definition n_gui.h:993
N_GUI_THEME default_tb_btn_theme
default theme for titlebar minimize/maximize buttons
Definition n_gui.h:1438
int tooltip_widget_id
widget the pointer is resting on for tooltip purposes (-1 = none)
Definition n_gui.h:1382
float header_height
unscaled column-header row height
Definition n_gui.h:2570
float global_scroll_step
pixels per mouse wheel notch for global scroll
Definition n_gui.h:1313
float h
window height
Definition n_gui.h:1011
float item_height
item height in dropdown
Definition n_gui.h:765
int hover_row
index of the row the mouse is currently over, or -1.
Definition n_gui.h:579
void * user_data
user data for callback
Definition n_gui.h:515
double scroll_pos
current scroll position
Definition n_gui.h:527
void(* on_change)(int widget_id, const char *text, void *user_data)
callback on text change
Definition n_gui.h:495
ALLEGRO_BITMAP * item_selected_bitmap
optional bitmap for per-item background, selected/highlighted (NULL = color theme)
Definition n_gui.h:773
void * user_data
user data for callback
Definition n_gui.h:447
float autofit_origin_y
original insertion point y for N_GUI_AUTOFIT_CENTER (set by n_gui_window_set_autofit)
Definition n_gui.h:1057
N_GUI_DATAGRID_COL * cols
column definitions (physical/storage order; cells are indexed by these)
Definition n_gui.h:651
int scroll_offset
scroll offset in items
Definition n_gui.h:563
int native_drag_cy
desktop y of the mouse cursor at the drag grab (see native_drag_cx)
Definition n_gui.h:1123
size_t len
number of bytes
Definition n_gui.h:605
int selected
selection state (for listbox)
Definition n_gui.h:549
ALLEGRO_BITMAP * minimize_hover_bitmap
optional bitmap for minimize button hover state
Definition n_gui.h:967
ALLEGRO_BITMAP * item_hover_bitmap
optional bitmap for the hovered entry background (NULL = color theme)
Definition n_gui.h:868
float virtual_h
virtual canvas height (0 = disabled / identity transform)
Definition n_gui.h:1412
int drag_active
1 once past threshold
Definition n_gui.h:2495
float y0
content-local y of the first header
Definition n_gui.h:2418
N_GUI_CTX * ctx
GUI context.
Definition n_gui.h:2563
int shape_mode
global widget shape override: N_GUI_SHAPE_ROUNDED forces a rounded GUI, N_GUI_SHAPE_RECT forces a squ...
Definition n_gui.h:1297
int visible
1 = drawn, 0 = hidden (kept in storage, skipped in the header and rows)
Definition n_gui.h:645
float global_scroll_x
global horizontal scroll offset (when GUI exceeds display)
Definition n_gui.h:1400
int cached_headers_end
cached first blank-line index (HTTP headers end), or INT_MAX; valid when lines_valid
Definition n_gui.h:635
int native_pos_x
last known native window position on the desktop, applied when the native window is re-created.
Definition n_gui.h:1114
float init_win_h
parent window height at create time
Definition n_gui.h:2572
float checkbox_mark_margin
checkmark inset from box edge
Definition n_gui.h:1246
ALLEGRO_BITMAP * track_bitmap
optional bitmap for the scrollbar track background (NULL = color theme)
Definition n_gui.h:531
ALLEGRO_DISPLAY * native
native OS window backing this pseudo-window, or NULL (the default) when the window is drawn as a pop-...
Definition n_gui.h:1081
float checkbox_label_offset
horizontal offset from box edge to label text
Definition n_gui.h:1252
N_GUI_CUSTOM_DRAW draw
paint callback invoked during n_gui_draw (NULL = draw nothing)
Definition n_gui.h:939
void(* on_columns_changed)(int widget_id, void *user_data)
callback fired after the user resizes a column by dragging its header border (widget_id,...
Definition n_gui.h:668
ALLEGRO_BITMAP * maximize_active_bitmap
optional bitmap for maximize button active state
Definition n_gui.h:975
ALLEGRO_BITMAP * titlebar_bitmap
optional bitmap for the titlebar background (NULL = color fill)
Definition n_gui.h:1047
int scroll_offset
scroll offset in dropdown
Definition n_gui.h:758
N_GUI_CTX * ctx
GUI context.
Definition n_gui.h:2367
int mouse_b1_prev
previous frame's b1 state
Definition n_gui.h:2498
void * data
widget-specific data (union via void pointer)
Definition n_gui.h:906
double value
current value (always snapped to step)
Definition n_gui.h:427
N_GUI_DROPMENU_ENTRY * entries
dynamic array of entries
Definition n_gui.h:847
float drag_oy
drag offset y (internal)
Definition n_gui.h:1027
float slider_track_border_thickness
track outline thickness
Definition n_gui.h:1216
int pending_widgets_count
number of valid entries in pending_widgets
Definition n_gui.h:1455
int nb_active
active row count
Definition n_gui.h:2567
ALLEGRO_COLOR link_color_normal
link colour (normal)
Definition n_gui.h:1305
float slider_handle_min_r
minimum handle circle radius
Definition n_gui.h:1218
int scale_mode
scale mode: N_GUI_IMAGE_FIT, N_GUI_IMAGE_STRETCH, N_GUI_IMAGE_CENTER
Definition n_gui.h:787
float restore_h
saved height before maximise (for restore)
Definition n_gui.h:959
ALLEGRO_BITMAP * item_selected_bitmap
optional bitmap for per-item background, selected/highlighted (NULL = color theme)
Definition n_gui.h:729
ALLEGRO_BITMAP * bg_bitmap
optional bitmap for the radiolist background (NULL = color theme)
Definition n_gui.h:725
float x
content-local x of every header and the layout origin
Definition n_gui.h:2417
int show_value
1 to show the Value column (default 1)
Definition n_gui.h:2580
ALLEGRO_BITMAP * box_bitmap
optional bitmap for the checkbox square, unchecked state (NULL = color theme)
Definition n_gui.h:507
void * on_open_user_data
user data for on_open callback
Definition n_gui.h:874
float drag_press_y
mouse y at press time
Definition n_gui.h:2497
int show_desc
1 to show the Description column (default 1)
Definition n_gui.h:2581
float y
y origin of tab button row
Definition n_gui.h:2374
float divider
divider thickness in pixels
Definition n_gui.h:593
float dropdown_arrow_reserve
horizontal space reserved for the arrow on the right
Definition n_gui.h:1282
ALLEGRO_BITMAP * close_active_bitmap
optional bitmap for close button active state
Definition n_gui.h:981
float y
position y relative to parent window
Definition n_gui.h:890
int lbl_desc
label widget ID for "Description" header
Definition n_gui.h:2575
int orientation
orientation: N_GUI_SLIDER_H or N_GUI_SLIDER_V
Definition n_gui.h:433
float global_scrollbar_border_thickness
global thumb border thickness
Definition n_gui.h:1194
int state
state flags (N_GUI_WIN_*)
Definition n_gui.h:1015
int visible[64]
per-physical-column visibility
Definition n_gui.h:1348
int flags
feature flags (N_GUI_WIN_AUTO_SCROLLBAR, N_GUI_WIN_RESIZABLE, etc.)
Definition n_gui.h:1017
int orientation
N_GUI_SPLIT_VERTICAL or N_GUI_SPLIT_HORIZONTAL.
Definition n_gui.h:585
void * user_data
user data for callback
Definition n_gui.h:541
int active
1 if active, 0 if removed
Definition n_gui.h:2558
double max_val
maximum value
Definition n_gui.h:425
HASH_TABLE * widgets_by_id
hash table for fast widget lookup by id
Definition n_gui.h:1358
float border_thickness
border thickness
Definition n_gui.h:361
float link_underline_thickness
link underline thickness
Definition n_gui.h:1303
ALLEGRO_BITMAP * box_checked_bitmap
optional bitmap for the checkbox square, checked state (NULL = color theme)
Definition n_gui.h:509
int autofit_flags
bitmask of N_GUI_AUTOFIT_* flags (0 = no auto-fitting)
Definition n_gui.h:1051
unsigned char consumed
1 once applied to a created window
Definition n_gui.h:1331
float ratio
divider position as a fraction of the widget extent (0..1)
Definition n_gui.h:587
int drag_source_node
node being dragged, or -1
Definition n_gui.h:2491
N_GUI_STYLE style
configurable style (sizes, colours, paddings)
Definition n_gui.h:1424
ALLEGRO_FONT * font
font for the title bar
Definition n_gui.h:1023
float col_resize_x0
cursor x at the start of a column-resize drag
Definition n_gui.h:662
char * key_placeholder
owned hint shown in each key textarea, or NULL
Definition n_gui.h:2583
void * user_data
user data for callback
Definition n_gui.h:497
N_GUI_THEME btn_theme
theme for minimize and maximize buttons
Definition n_gui.h:961
ALLEGRO_COLOR text_active
text active
Definition n_gui.h:359
float ref_display_w
reference display width at the time normalized values were last captured
Definition n_gui.h:1434
float restore_w
saved width before maximise (for restore)
Definition n_gui.h:957
int nb_nodes
number of nodes
Definition n_gui.h:2482
size_t items_capacity
allocated capacity
Definition n_gui.h:717
int parent_window_id
parent window for tab buttons
Definition n_gui.h:2368
double content_size
total content size
Definition n_gui.h:523
float autofit_origin_x
original insertion point x for N_GUI_AUTOFIT_CENTER (set by n_gui_window_set_autofit)
Definition n_gui.h:1055
void * user_data
user data for callback
Definition n_gui.h:575
double step
step increment (0 is treated as 1).
Definition n_gui.h:429
float global_scroll_y
global vertical scroll offset (when GUI exceeds display)
Definition n_gui.h:1402
int scrollbar_drag_widget_id
id of the widget whose scrollbar is being dragged, or -1
Definition n_gui.h:1392
ALLEGRO_BITMAP * maximize_hover_bitmap
optional bitmap for maximize button hover state
Definition n_gui.h:973
float min_h
minimum height
Definition n_gui.h:1031
float listbox_default_item_height
default item height for listbox
Definition n_gui.h:1266
void * user_data
user data for callback
Definition n_gui.h:707
size_t nb_cols
number of columns
Definition n_gui.h:653
ALLEGRO_COLOR global_scrollbar_thumb_border_color
global scrollbar thumb border colour
Definition n_gui.h:1200
float tb_btn_spacing
gap between titlebar buttons
Definition n_gui.h:1164
ALLEGRO_COLOR border_active
border active
Definition n_gui.h:353
float scroll_x
horizontal scroll offset for single-line text (pixels)
Definition n_gui.h:482
float label_padding
horizontal padding each side
Definition n_gui.h:1301
float titlebar_h
title bar height
Definition n_gui.h:1150
ALLEGRO_EVENT_QUEUE * event_queue
event queue the context registers native window event sources into (set via n_gui_set_event_queue).
Definition n_gui.h:1458
float ratio
divider ratio (kind == SPLITPANE)
Definition n_gui.h:1345
float gui_offset_y
vertical letterbox offset for virtual canvas
Definition n_gui.h:1418
int hovered
which button is currently hovered (N_GUI_TB_BTN_*)
Definition n_gui.h:949
ALLEGRO_BITMAP * item_selected_bitmap
optional bitmap for per-item background, selected/highlighted (NULL = color theme)
Definition n_gui.h:571
N_GUI_PENDING_GEOM * pending_layout
layout entries for windows that did NOT exist when the saved layout was loaded (lazily-created panels...
Definition n_gui.h:1446
void(* on_select)(int widget_id, int index, int selected, void *user_data)
callback on selection change (widget_id, item_index, selected, user_data)
Definition n_gui.h:573
float natural_h
stacked height of the members when expanded
Definition n_gui.h:2408
int scroll_offset
first visible line
Definition n_gui.h:621
float item_height
item height in pixels
Definition n_gui.h:565
void(* on_select)(int widget_id, int index, void *user_data)
callback on selection change (widget_id, selected_index, user_data)
Definition n_gui.h:775
int focused_widget_id
id of the widget that currently has focus, or -1
Definition n_gui.h:1368
float h_scroll
horizontal scroll offset in pixels: how far the columns are scrolled to the left when their total wid...
Definition n_gui.h:696
int id
unique window id
Definition n_gui.h:1001
int global_vscroll_drag
1 if global scrollbar vertical thumb is being dragged
Definition n_gui.h:1420
int sel_dragging
1 if mouse is actively dragging to select text
Definition n_gui.h:805
int nb_visible
number of visible rows
Definition n_gui.h:2484
ALLEGRO_COLOR global_scrollbar_track_color
global scrollbar track colour
Definition n_gui.h:1196
float item_height_pad
min padding added to font height for item height
Definition n_gui.h:1278
float display_h
display/viewport height
Definition n_gui.h:1398
size_t len
text length in bytes
Definition n_gui.h:617
N_GUI_LISTITEM * items
dynamic array of items
Definition n_gui.h:555
void * user_data
user data for callback
Definition n_gui.h:733
float corner_ry
corner radius Y for rounded shapes
Definition n_gui.h:365
int checked
checked state
Definition n_gui.h:505
int sel_end
selection end byte offset (-1 = no selection)
Definition n_gui.h:803
float width[64]
per-physical-column width
Definition n_gui.h:1349
int bg_scale_mode
scale mode for bg_bitmap: N_GUI_IMAGE_FIT, N_GUI_IMAGE_STRETCH, or N_GUI_IMAGE_CENTER
Definition n_gui.h:1049
size_t text_alloc
allocated buffer size (char_limit + 1)
Definition n_gui.h:467
ALLEGRO_DISPLAY * pass_display
display the pass currently being processed or drawn belongs to: NULL for the host's main display (and...
Definition n_gui.h:1465
ALLEGRO_COLOR bg_normal
background normal
Definition n_gui.h:343
ALLEGRO_BITMAP * handle_bitmap
optional bitmap for the draggable handle, normal state (NULL = color theme)
Definition n_gui.h:439
ALLEGRO_FONT * font
font used by this widget (NULL = context default)
Definition n_gui.h:904
float norm_w
normalized width (fraction of parent window w)
Definition n_gui.h:920
int resize_mode
context resize mode: N_GUI_RESIZE_VIRTUAL or N_GUI_RESIZE_ADAPTIVE
Definition n_gui.h:1432
float virtual_w
virtual canvas width (0 = disabled / identity transform)
Definition n_gui.h:1410
float radiolist_default_item_height
default item height for radiolist
Definition n_gui.h:1268
void * user_data
user data for the callback
Definition n_gui.h:2426
void(* on_minimize)(int window_id, void *user_data)
callback on minimize button click (NULL = default: toggle N_GUI_WIN_MINIMISED)
Definition n_gui.h:983
char label[128]
label displayed next to the checkbox
Definition n_gui.h:503
float slider_value_label_offset
gap between slider end and value label
Definition n_gui.h:1224
void(* on_context)(int widget_id, int row, int x, int y, void *user_data)
callback on right-click over a data row, for a context menu (widget_id, row, x, y,...
Definition n_gui.h:705
size_t nb_items
number of items
Definition n_gui.h:557
int depth
depth in tree (0 = root)
Definition n_gui.h:2458
float tb_btn_glyph_thickness
line thickness for titlebar button glyphs
Definition n_gui.h:1168
ALLEGRO_COLOR bg_active
background active/pressed
Definition n_gui.h:347
char mask_char
mask character for password fields (0 = no masking, e.g.
Definition n_gui.h:490
ALLEGRO_BITMAP * minimize_bitmap
optional bitmap for minimize button normal state (NULL = color theme)
Definition n_gui.h:965
int global_hscroll_drag
1 if global scrollbar horizontal thumb is being dragged
Definition n_gui.h:1422
float w
saved width (display-scaled), 0 when absent
Definition n_gui.h:1328
LIST * windows
ordered list of N_GUI_WINDOW* (back to front)
Definition n_gui.h:1356
char text[128]
display text
Definition n_gui.h:825
int scroll_y
scroll offset for long text
Definition n_gui.h:480
char text[4096]
optional centered overlay text (empty string = none)
Definition n_gui.h:819
void(* on_scroll)(int widget_id, double scroll_pos, void *user_data)
callback on scroll
Definition n_gui.h:539
int x
bounding box x offset from draw origin
Definition n_gui.h:332
float gui_bounds_h
total bounding box height of all windows (computed internally)
Definition n_gui.h:1406
double min_val
minimum value
Definition n_gui.h:423
float textarea_cursor_blink_period
cursor blink period in seconds (full cycle on+off)
Definition n_gui.h:1240
int lbl_value
label widget ID for "Value" header
Definition n_gui.h:2574
void(* on_toggle)(int widget_id, int checked, void *user_data)
callback on toggle
Definition n_gui.h:513
ALLEGRO_COLOR bg_hover
background hover
Definition n_gui.h:345
size_t sel_start
selection anchor position (where shift-click/shift-arrow started).
Definition n_gui.h:476
int window_id
parent window
Definition n_gui.h:2564
int cursor_shape
system mouse cursor currently applied to the display (an ALLEGRO_SYSTEM_MOUSE_CURSOR_* value),...
Definition n_gui.h:1380
void * on_content_draw_data
user data passed to on_content_draw
Definition n_gui.h:1076
float dropdown_arrow_thickness
arrow stroke thickness
Definition n_gui.h:1284
float tb_btn_right_margin
right margin from window edge to rightmost button
Definition n_gui.h:1166
void * user_data
user data for callback
Definition n_gui.h:2579
ALLEGRO_COLOR link_color_hover
link colour (hover)
Definition n_gui.h:1307
float radio_circle_min_r
minimum outer circle radius
Definition n_gui.h:1256
ALLEGRO_BITMAP * bg_bitmap
optional bitmap for the listbox background (NULL = color theme)
Definition n_gui.h:567
float item_text_padding
text padding inside list/combo/dropmenu items
Definition n_gui.h:1274
int next_widget_id
next widget id to assign
Definition n_gui.h:1360
int enabled_id
checkbox widget ID for the enabled toggle
Definition n_gui.h:2556
char * value_placeholder
owned hint shown in each value textarea, or NULL
Definition n_gui.h:2584
float autofit_border
padding/border around content for auto-fit (pixels, applied on each side)
Definition n_gui.h:1053
float gui_scale
computed uniform scale factor for virtual canvas
Definition n_gui.h:1414
int anchor_row
anchor row for Shift-click range selection, or -1
Definition n_gui.h:686
int native_drag_anchored
1 when the four native_drag_* fields hold a usable grab, that is when al_get_mouse_cursor_position wo...
Definition n_gui.h:1133
size_t cursor_pos
cursor position in text
Definition n_gui.h:473
float restore_y
saved y position before maximise (for restore)
Definition n_gui.h:955
int scroll_offset
first visible data row
Definition n_gui.h:693
void * user_data
user data for callback
Definition n_gui.h:417
int mode
mode: N_GUI_SLIDER_VALUE or N_GUI_SLIDER_PERCENT
Definition n_gui.h:431
int dirty
non-zero when the GUI's appearance may have changed since the last n_gui_draw.
Definition n_gui.h:1474
size_t char_limit
maximum character limit (0 = N_GUI_TEXT_MAX)
Definition n_gui.h:469
void(* on_select)(int widget_id, int row, void *user_data)
callback on row selection (widget_id, row, user_data)
Definition n_gui.h:701
int toggle_mode
toggle mode: 0 = momentary (default), 1 = toggle (stays clicked/unclicked)
Definition n_gui.h:392
int is_open
is the menu currently open
Definition n_gui.h:853
ALLEGRO_COLOR border_hover
border hover
Definition n_gui.h:351
N_GUI_CTX * ctx
GUI context.
Definition n_gui.h:2415
void * on_minimize_user_data
user data for on_minimize callback
Definition n_gui.h:985
float scrollbar_thumb_min
minimum thumb dimension
Definition n_gui.h:1174
int native_halted
1 while the native window's drawing is halted.
Definition n_gui.h:1139
int native_pos_y
last known native window y position (see native_pos_x)
Definition n_gui.h:1116
float x
x origin of first tab button
Definition n_gui.h:2373
ALLEGRO_BITMAP * thumb_hover_bitmap
optional bitmap for the thumb on hover (NULL = fallback to thumb_bitmap)
Definition n_gui.h:535
int value_id
textarea widget ID for the value
Definition n_gui.h:2554
char label[128]
label displayed on the button
Definition n_gui.h:382
ALLEGRO_BITMAP * bg_bitmap
optional bitmap for the text area background (NULL = color theme)
Definition n_gui.h:488
int align
text alignment: N_GUI_ALIGN_LEFT, N_GUI_ALIGN_CENTER, N_GUI_ALIGN_RIGHT
Definition n_gui.h:797
int prev_over_win
whether the pointer was over a window on the previous motion event, so a motion that leaves the GUI s...
Definition n_gui.h:1481
float native_w
last known native window width, 0 until the window is first detached.
Definition n_gui.h:1109
size_t nb_rows
number of rows
Definition n_gui.h:672
void(* on_maximize)(int window_id, void *user_data)
callback on maximize button click (NULL = default: toggle N_GUI_WIN_MAXIMISED)
Definition n_gui.h:987
size_t text_len
current text length
Definition n_gui.h:465
char link[4096]
optional hyperlink URL (empty string = no link)
Definition n_gui.h:795
int orientation
orientation: N_GUI_SCROLLBAR_H or N_GUI_SCROLLBAR_V
Definition n_gui.h:521
float global_scrollbar_thumb_min
global minimum thumb dimension
Definition n_gui.h:1188
double viewport_size
visible viewport size
Definition n_gui.h:525
int col_resize_col
physical column being resized by a header-border drag, or -1
Definition n_gui.h:660
unsigned char consumed
1 once applied
Definition n_gui.h:1350
void(* on_link_click)(int widget_id, const char *link, void *user_data)
callback when link is clicked (widget_id, link_url, user_data)
Definition n_gui.h:809
ALLEGRO_FONT * default_font
default font (must be set before adding widgets)
Definition n_gui.h:1364
float combobox_max_dropdown_width
maximum dropdown width for N_GUI_COMBOBOX_AUTO_WIDTH (0 = display width)
Definition n_gui.h:1317
int selection_mode
selection mode: N_GUI_SELECT_NONE, N_GUI_SELECT_SINGLE, N_GUI_SELECT_MULTIPLE
Definition n_gui.h:561
float h
saved height (display-scaled), 0 when absent
Definition n_gui.h:1329
size_t nb_items
number of items
Definition n_gui.h:750
int key_modifiers
required modifier key flags for the keybind (0 = no modifier requirement, matches any modifier state ...
Definition n_gui.h:403
ALLEGRO_COLOR * row_color
per-row background tint, sized rows_cap; NULL until a row color is set
Definition n_gui.h:688
float header_h
header button height
Definition n_gui.h:2420
LIST * widgets
list of N_GUI_WIDGET* contained in this window
Definition n_gui.h:1019
void * user_data
user data for callback
Definition n_gui.h:597
float y
position y on screen
Definition n_gui.h:1007
ALLEGRO_BITMAP * bitmap_active
optional bitmap for active/pressed state
Definition n_gui.h:388
int tooltip_anchor_y
pointer y when the tooltip was last armed
Definition n_gui.h:1388
double tooltip_armed_at
time the tooltip hover was (re)armed, from al_get_time()
Definition n_gui.h:1384
char * placeholder
optional placeholder/hint text drawn dimmed while the field is empty (NULL = none); cleared from view...
Definition n_gui.h:493
int enabled
enabled flag (1 = enabled, 0 = disabled: drawn dimmed and ignores input)
Definition n_gui.h:900
float radio_circle_border_thickness
outer circle border thickness
Definition n_gui.h:1258
float col_resize_w0
original width of the column at the start of a resize drag
Definition n_gui.h:664
int keycode
bound keyboard keycode (0 = none).
Definition n_gui.h:397
ALLEGRO_BITMAP * thumb_active_bitmap
optional bitmap for the thumb while dragging (NULL = fallback to thumb_bitmap)
Definition n_gui.h:537
float slider_track_size
track width (vertical) or height (horizontal)
Definition n_gui.h:1212
ALLEGRO_DISPLAY * active_display
display that last received input, used to pick the display for clipboard and mouse-cursor calls.
Definition n_gui.h:1468
float scroll_x
horizontal scroll offset for auto-scrollbar (pixels)
Definition n_gui.h:1035
float slider_handle_border_thickness
handle border thickness
Definition n_gui.h:1222
const char * n_gui_syntaxview_get_text(N_GUI_CTX *ctx, int widget_id)
get the text shown by a syntax view (borrowed pointer, do not free; NULL if empty)
Definition n_gui.c:3679
void n_gui_set_display_size(N_GUI_CTX *ctx, float w, float h)
set the display (viewport) size so global scrollbars can be computed.
Definition n_gui.c:9034
void n_gui_combobox_set_bitmaps(N_GUI_CTX *ctx, int widget_id, ALLEGRO_BITMAP *bg, ALLEGRO_BITMAP *item_bg, ALLEGRO_BITMAP *item_selected)
set optional bitmap overlays on a combobox widget.
Definition n_gui.c:4938
int n_gui_load_theme_json(N_GUI_CTX *ctx, const char *filepath)
Load a JSON theme file and apply it to the context.
Definition n_gui.c:12558
int n_gui_listbox_get_scroll_offset(N_GUI_CTX *ctx, int widget_id)
get the current scroll offset (in items)
Definition n_gui.c:3512
void n_gui_dropmenu_clear(N_GUI_CTX *ctx, int widget_id)
remove all entries
Definition n_gui.c:4723
void n_gui_sectionlist_set_folded(N_GUI_SECTIONLIST *sl, int section_index, int folded)
set a section's folded state and relayout; does NOT fire on_toggle (for programmatic restore)
Definition n_gui.c:14311
void n_gui_update_transform(N_GUI_CTX *ctx)
recalculate scale and offset from virtual canvas to display.
Definition n_gui.c:8849
int n_gui_add_hexview(N_GUI_CTX *ctx, int window_id, float x, float y, float w, float h)
add a read-only hex viewer; returns the widget id or -1
Definition n_gui.c:2707
int n_gui_button_is_toggled(N_GUI_CTX *ctx, int widget_id)
check if button is toggled
Definition n_gui.c:2209
void n_gui_datagrid_sort(N_GUI_CTX *ctx, int widget_id, int col, int dir)
sort the rows by a column (dir 1 ascending, -1 descending)
Definition n_gui.c:4176
float n_gui_detect_dpi_scale(N_GUI_CTX *ctx, ALLEGRO_DISPLAY *display)
detect and apply DPI scale from the given allegro display.
Definition n_gui.c:9113
float n_gui_splitpane_get_ratio(N_GUI_CTX *ctx, int widget_id)
get the current divider ratio (0..1), or 0.5 if the widget is invalid
Definition n_gui.c:3538
void n_gui_toggle_window(N_GUI_CTX *ctx, int window_id)
toggle window visibility (show/hide)
Definition n_gui.c:1950
void n_gui_datagrid_set_on_columns_changed(N_GUI_CTX *ctx, int widget_id, void(*cb)(int, void *))
set the callback fired after the user drags a column border to resize it, so the host can persist the...
Definition n_gui.c:4171
void n_gui_datagrid_set_selected(N_GUI_CTX *ctx, int widget_id, int row)
set the selected row index (fires the on_select callback)
Definition n_gui.c:3958
void n_gui_hexview_set_data(N_GUI_CTX *ctx, int widget_id, const unsigned char *data, size_t len)
set (copy) the bytes shown by a hex viewer; data may be NULL to clear
Definition n_gui.c:3588
#define N_GUI_TREE_MAX
maximum number of nodes in a tree view
Definition n_gui.h:2451
void n_gui_raise_window(N_GUI_CTX *ctx, int window_id)
raise a window to the top of the stack (respects z-order constraints)
Definition n_gui.c:1824
void n_gui_datagrid_clear_row_color(N_GUI_CTX *ctx, int widget_id, int row)
remove the background tint of data row row (it draws untinted again)
Definition n_gui.c:4051
int n_gui_add_slider(N_GUI_CTX *ctx, int window_id, float x, float y, float w, float h, double min_val, double max_val, double initial, int mode, void(*on_change)(int, double, void *), void *user_data)
add a horizontal slider widget
Definition n_gui.c:2442
void n_gui_combobox_set_flags(N_GUI_CTX *ctx, int widget_id, int flags)
set combobox feature flags (bitmask of N_GUI_COMBOBOX_* values)
Definition n_gui.c:2915
void n_gui_window_apply_autofit(N_GUI_CTX *ctx, int window_id)
trigger auto-fit recalculation for a window (call after adding/removing/resizing widgets)
Definition n_gui.c:2035
void n_gui_kvtable_set_top_offset(N_GUI_KVTABLE *table, float top_offset)
reserve top_offset unscaled pixels above the header row so other widgets (a toolbar,...
Definition n_gui.c:14166
int n_gui_needs_redraw(N_GUI_CTX *ctx)
Return non-zero if the GUI must be redrawn this frame, i.e.
Definition n_gui.c:978
int n_gui_datagrid_get_row_count(N_GUI_CTX *ctx, int widget_id)
get the number of rows in a data grid
Definition n_gui.c:3938
void n_gui_textarea_set_text(N_GUI_CTX *ctx, int widget_id, const char *text)
set text area content
Definition n_gui.c:3263
void n_gui_kvtable_relayout(N_GUI_KVTABLE *table)
re-apply layout to all KV table widgets (positions, sizes, normalized coords).
Definition n_gui.c:14176
int n_gui_save_layout_json(N_GUI_CTX *ctx, const char *filepath)
Save the geometry + persistent state of every window in the context to a JSON file.
Definition n_gui.c:12712
int n_gui_window_detach(N_GUI_CTX *ctx, int window_id, int detach_flags)
promote a pop-up window to a native OS window
Definition n_gui.c:1409
int n_gui_kvtable_get_count(const N_GUI_KVTABLE *table)
get the number of active rows
Definition n_gui.c:14172
double n_gui_scrollbar_get_pos(N_GUI_CTX *ctx, int widget_id)
get scrollbar position
Definition n_gui.c:3319
void n_gui_tree_set_label(N_GUI_TREE *tree, int node_index, const char *new_label)
change the display label of a node
Definition n_gui.c:13462
N_GUI_KVTABLE * n_gui_kvtable_create(N_GUI_CTX *ctx, int window_id, float row_height, float padding, void(*on_remove)(int, void *), void *user_data)
create a KV table in an existing window
Definition n_gui.c:14004
int n_gui_add_vslider(N_GUI_CTX *ctx, int window_id, float x, float y, float w, float h, double min_val, double max_val, double initial, int mode, void(*on_change)(int, double, void *), void *user_data)
add a vertical slider (same as n_gui_add_slider but oriented vertically)
Definition n_gui.c:2484
void n_gui_set_display(N_GUI_CTX *ctx, ALLEGRO_DISPLAY *display)
set the display pointer for clipboard operations (copy/paste)
Definition n_gui.c:9071
void n_gui_window_set_bitmaps(N_GUI_CTX *ctx, int window_id, ALLEGRO_BITMAP *bg, ALLEGRO_BITMAP *titlebar, int bg_scale_mode)
set optional bitmap overlays on a window's body and titlebar.
Definition n_gui.c:4797
void n_gui_set_widget_theme(N_GUI_CTX *ctx, int widget_id, N_GUI_THEME theme)
set the theme on a widget
Definition n_gui.c:3042
#define N_GUI_SECTIONLIST_MAX
maximum number of foldable sections in a section list
Definition n_gui.h:2395
const char * n_gui_datagrid_get_cell(N_GUI_CTX *ctx, int widget_id, int row, int col)
get a cell string by row and column, or NULL if out of range
Definition n_gui.c:3944
int n_gui_wants_mouse(N_GUI_CTX *ctx)
check if the mouse is currently over any open GUI window (use to prevent click-through to the game wo...
Definition n_gui.c:12337
int n_gui_dropmenu_get_count(N_GUI_CTX *ctx, int widget_id)
get number of entries
Definition n_gui.c:4748
int n_gui_radiolist_add_item(N_GUI_CTX *ctx, int widget_id, const char *text)
add an item to a radio list
Definition n_gui.c:4349
void n_gui_set_widget_tooltip(N_GUI_CTX *ctx, int widget_id, const char *text)
set (or clear with "" / NULL) the tooltip text shown after the pointer rests on a widget
Definition n_gui.c:2240
void n_gui_lower_window(N_GUI_CTX *ctx, int window_id)
lower a window to the bottom of the stack (respects z-order constraints)
Definition n_gui.c:1842
void n_gui_label_set_text(N_GUI_CTX *ctx, int widget_id, const char *text)
set label text content
Definition n_gui.c:4511
int n_gui_window_native_is_hidden(N_GUI_CTX *ctx, int window_id)
check whether a detached window's drawing is currently halted by the OS (Android surface loss) or the...
Definition n_gui.c:1644
size_t n_gui_datagrid_get_column_count(N_GUI_CTX *ctx, int widget_id)
number of columns in a data grid (physical), or 0
Definition n_gui.c:4115
int n_gui_add_listbox(N_GUI_CTX *ctx, int window_id, float x, float y, float w, float h, int selection_mode, void(*on_select)(int, int, int, void *), void *user_data)
add a listbox widget
Definition n_gui.c:2620
#define N_GUI_PERSIST_MAX_COLS
Maximum datagrid columns whose layout is persisted per widget.
Definition n_gui.h:1335
float n_gui_datagrid_get_h_scroll(N_GUI_CTX *ctx, int widget_id)
horizontal scroll offset in pixels (how far the columns are scrolled left when their total width exce...
Definition n_gui.c:4093
void n_gui_datagrid_set_row_color(N_GUI_CTX *ctx, int widget_id, int row, ALLEGRO_COLOR color)
paint data row row with a background tint (a per-row highlight, e.g.
Definition n_gui.c:4041
void n_gui_datagrid_set_scroll_offset(N_GUI_CTX *ctx, int widget_id, int offset)
set the first visible data row (clamped to the row count); the draw path re-clamps to the live viewpo...
Definition n_gui.c:4082
size_t n_gui_datagrid_get_selected_rows(N_GUI_CTX *ctx, int widget_id, int *out, size_t max)
fill out with the indices of the selected rows (ascending), up to max, and return the total number of...
Definition n_gui.c:3995
int n_gui_datagrid_get_scroll_offset(N_GUI_CTX *ctx, int widget_id)
first visible data row (the vertical scroll position), or 0.
Definition n_gui.c:4076
void n_gui_window_set_tb_button_bitmaps(N_GUI_CTX *ctx, int window_id, int btn_type, ALLEGRO_BITMAP *normal, ALLEGRO_BITMAP *hover, ALLEGRO_BITMAP *active)
set optional bitmap overlays on a titlebar button
Definition n_gui.c:1723
void n_gui_focus_window(N_GUI_CTX *ctx, int window_id)
give a window keyboard focus: raise it within its z-order group and focus its first focusable widget ...
Definition n_gui.c:1881
#define N_GUI_KV_MAX
maximum number of rows in a KV table
Definition n_gui.h:2549
int n_gui_process_event(N_GUI_CTX *ctx, ALLEGRO_EVENT event)
process an allegro event for the GUI
Definition n_gui.c:9836
int n_gui_window_get_flags(N_GUI_CTX *ctx, int window_id)
get feature flags of a window
Definition n_gui.c:1977
void n_gui_minimize_window(N_GUI_CTX *ctx, int window_id)
minimize a window (title bar only)
Definition n_gui.c:1224
int n_gui_add_label(N_GUI_CTX *ctx, int window_id, const char *text, float x, float y, float w, float h, int align)
add a text label widget
Definition n_gui.c:2966
void n_gui_set_widget_enabled(N_GUI_CTX *ctx, int widget_id, int enabled)
set widget enabled state (0 = disabled: drawn dimmed and ignores all input)
Definition n_gui.c:3084
int n_gui_add_radiolist(N_GUI_CTX *ctx, int window_id, float x, float y, float w, float h, void(*on_select)(int, int, void *), void *user_data)
add a radio list widget
Definition n_gui.c:2839
void n_gui_tab_free(N_GUI_TAB_PANEL **panel)
free a tab panel (does not destroy the N_GUI widgets)
Definition n_gui.c:13322
void n_gui_close_window(N_GUI_CTX *ctx, int window_id)
close (hide) a window
Definition n_gui.c:1191
void n_gui_maximize_window(N_GUI_CTX *ctx, int window_id)
toggle maximised state (full display or restore to previous size)
Definition n_gui.c:1267
void n_gui_listbox_set_bitmaps(N_GUI_CTX *ctx, int widget_id, ALLEGRO_BITMAP *bg, ALLEGRO_BITMAP *item_bg, ALLEGRO_BITMAP *item_selected)
set optional bitmap overlays on a listbox widget.
Definition n_gui.c:4906
void n_gui_label_set_link(N_GUI_CTX *ctx, int widget_id, const char *link)
set label hyperlink URL
Definition n_gui.c:4531
void n_gui_datagrid_set_on_context(N_GUI_CTX *ctx, int widget_id, void(*on_context)(int, int, int, int, void *))
set the right-click context callback; fired (with the cursor x/y in GUI coordinates) when a data row ...
Definition n_gui.c:3967
ALLEGRO_EVENT_QUEUE * n_gui_get_event_queue(N_GUI_CTX *ctx)
get the event queue previously given to n_gui_set_event_queue (NULL if none)
Definition n_gui.c:1365
void n_gui_kvtable_free(N_GUI_KVTABLE **table)
free a KV table (does not destroy the N_GUI widgets)
Definition n_gui.c:14180
void n_gui_window_set_resize_policy(N_GUI_CTX *ctx, int window_id, int policy)
set per-window resize policy (N_GUI_WIN_RESIZE_NONE / _MOVE / _SCALE).
Definition n_gui.c:8936
void n_gui_button_set_keycode_focused(N_GUI_CTX *ctx, int widget_id, int keycode, int modifiers, const int *sources, int source_count)
bind a keyboard key to a button that fires only when specific widgets have focus.
Definition n_gui.c:2421
void n_gui_radiolist_clear(N_GUI_CTX *ctx, int widget_id)
remove all items from a radio list
Definition n_gui.c:4370
void n_gui_kvtable_clear(N_GUI_KVTABLE *table)
remove every row at once.
Definition n_gui.c:14126
void n_gui_slider_set_value_format(N_GUI_CTX *ctx, int widget_id, const char *fmt)
Override the built-in value readout's printf format string.
Definition n_gui.c:3222
void n_gui_listbox_set_selected(N_GUI_CTX *ctx, int widget_id, int index, int selected)
set item selection state
Definition n_gui.c:3501
int(* n_gui_tree_on_drop_t)(int src_node, int dst_node, int position, void *user_data)
drag-reorder drop callback.
Definition n_gui.h:2474
int n_gui_add_window_auto(N_GUI_CTX *ctx, const char *title, float x, float y)
add a window that sizes itself automatically to fit its widgets (call n_gui_window_autosize after add...
Definition n_gui.c:1942
void n_gui_syntaxview_set_selection(N_GUI_CTX *ctx, int widget_id, int start, int end)
set the selection range (byte offsets into the text, clamped to its length); pass start == end to cle...
Definition n_gui.c:3719
double n_gui_slider_get_value(N_GUI_CTX *ctx, int widget_id)
get slider current value
Definition n_gui.c:3159
int n_gui_listbox_add_item(N_GUI_CTX *ctx, int widget_id, const char *text)
add an item to a listbox
Definition n_gui.c:3371
N_GUI_THEME n_gui_default_tb_btn_theme(void)
return the built-in default theme for titlebar minimize/maximize buttons
Definition n_gui.c:728
void n_gui_set_virtual_size(N_GUI_CTX *ctx, float w, float h)
set the virtual canvas size for resolution-independent scaling.
Definition n_gui.c:8831
int n_gui_tooltip_pending(N_GUI_CTX *ctx)
tooltip phase: 0 = none (or tooltips disabled via style.tooltip_delay <= 0), 1 = arming (hosts with c...
Definition n_gui.c:2323
int n_gui_datagrid_is_row_selected(N_GUI_CTX *ctx, int widget_id, int row)
report whether a given data row is selected (1) or not (0)
Definition n_gui.c:3986
float n_gui_get_dpi_scale(const N_GUI_CTX *ctx)
get current DPI scale factor
Definition n_gui.c:9089
void n_gui_tree_clear(N_GUI_TREE *tree)
remove all nodes and clear the backing listbox; tree object remains valid
Definition n_gui.c:13401
N_GUI_THEME n_gui_default_theme(void)
return the built-in default theme
Definition n_gui.c:651
void n_gui_window_set_zorder(N_GUI_CTX *ctx, int window_id, int z_mode, int z_value)
set window z-order mode and value
Definition n_gui.c:1903
int n_gui_radiolist_get_selected(N_GUI_CTX *ctx, int widget_id)
get the selected item index
Definition n_gui.c:4386
void n_gui_tab_set_content_window(N_GUI_TAB_PANEL *panel, int tab_index, int window_id)
associate a content window with a tab
Definition n_gui.c:13299
void n_gui_button_set_label(N_GUI_CTX *ctx, int widget_id, const char *label)
replace the label text drawn on a button
Definition n_gui.c:2221
void n_gui_button_set_state_bitmaps(N_GUI_CTX *ctx, int widget_id, ALLEGRO_BITMAP *normal, ALLEGRO_BITMAP *hover, ALLEGRO_BITMAP *active)
skin a button or toggle button with caller-owned per-state bitmaps (switches its shape to N_GUI_SHAPE...
Definition n_gui.c:2365
int n_gui_save_theme_json(N_GUI_CTX *ctx, const char *filepath)
Save the full theme (default_theme + style) to a JSON file.
Definition n_gui.c:12429
int n_gui_combobox_add_item(N_GUI_CTX *ctx, int widget_id, const char *text)
add an item to a combo box
Definition n_gui.c:4431
void n_gui_kvtable_set_placeholders(N_GUI_KVTABLE *table, const char *key_hint, const char *value_hint)
set the placeholder/hint text shown in each row's key (and value) textarea while it is empty.
Definition n_gui.c:14152
float n_gui_sectionlist_content_height(const N_GUI_SECTIONLIST *sl)
total content height in pixels under the current fold state, for sizing/scrolling the host window
Definition n_gui.c:14322
void n_gui_window_autosize(N_GUI_CTX *ctx, int window_id)
recompute and apply minimum-fit size for a window based on its current widgets
Definition n_gui.c:1987
int n_gui_syntaxview_get_line_count(N_GUI_CTX *ctx, int widget_id)
get the number of text lines in a syntax view
Definition n_gui.c:3667
#define N_GUI_SECTION_WIDGETS_MAX
maximum number of member widgets per section
Definition n_gui.h:2398
void n_gui_window_set_minimize_callback(N_GUI_CTX *ctx, int window_id, void(*on_minimize)(int, void *), void *user_data)
set the minimize button callback for a window (NULL = default: toggle minimised)
Definition n_gui.c:1681
int n_gui_add_splitpane(N_GUI_CTX *ctx, int window_id, float x, float y, float w, float h, int orientation, float ratio, void(*on_change)(int, float, void *), void *user_data)
add a split pane (draggable divider); returns the widget id or -1
Definition n_gui.c:2666
const char * n_gui_widget_get_persist_key(N_GUI_CTX *ctx, int widget_id)
Get a widget's persist key ("" when unset), or NULL when the widget is invalid.
Definition n_gui.c:2306
int n_gui_datagrid_add_column(N_GUI_CTX *ctx, int widget_id, const char *title, float width)
append a column with a header title and pixel width; returns the column index or -1
Definition n_gui.c:3805
void n_gui_set_focus(N_GUI_CTX *ctx, int widget_id)
set keyboard focus to a specific widget (-1 to clear focus)
Definition n_gui.c:3105
void n_gui_tree_rebuild(N_GUI_TREE *tree)
rebuild the listbox to reflect current tree state
Definition n_gui.c:13514
void n_gui_datagrid_set_h_scroll(N_GUI_CTX *ctx, int widget_id, float px)
set the horizontal scroll offset in pixels (clamped to >= 0; the draw path re-clamps to the live cont...
Definition n_gui.c:4099
void n_gui_datagrid_set_multiselect(N_GUI_CTX *ctx, int widget_id, int enabled)
enable (1) or disable (0) multi-row selection.
Definition n_gui.c:3973
void n_gui_textarea_set_selection(N_GUI_CTX *ctx, int widget_id, size_t start, size_t end)
set the text selection range (byte offsets into text content)
Definition n_gui.c:5258
void n_gui_scrollbar_set_bitmaps(N_GUI_CTX *ctx, int widget_id, ALLEGRO_BITMAP *track, ALLEGRO_BITMAP *thumb, ALLEGRO_BITMAP *thumb_hover, ALLEGRO_BITMAP *thumb_active)
set optional bitmap overlays on a scrollbar widget.
Definition n_gui.c:4830
void n_gui_set_shape_mode(N_GUI_CTX *ctx, int shape_mode)
set the global widget shape (N_GUI_SHAPE_ROUNDED for a round GUI, else square)
Definition n_gui.c:9054
int n_gui_add_combobox(N_GUI_CTX *ctx, int window_id, float x, float y, float w, float h, void(*on_select)(int, int, void *), void *user_data)
add a combo box widget
Definition n_gui.c:2874
void n_gui_syntaxview_set_mode(N_GUI_CTX *ctx, int widget_id, int mode)
set the highlighting mode (N_GUI_SYNTAX_*) of a syntax view
Definition n_gui.c:3655
void n_gui_button_set_toggled(N_GUI_CTX *ctx, int widget_id, int toggled)
set button toggled state
Definition n_gui.c:2379
void n_gui_progressbar_set_text(N_GUI_CTX *ctx, int widget_id, const char *text)
set the centered overlay text (NULL or "" clears it)
Definition n_gui.c:4297
void n_gui_tab_set_active(N_GUI_TAB_PANEL *panel, int index)
set the active tab (toggles buttons, opens/closes content windows)
Definition n_gui.c:13304
int n_gui_window_is_detached(N_GUI_CTX *ctx, int window_id)
check whether a window currently lives in a native OS window
Definition n_gui.c:1575
void n_gui_slider_set_step(N_GUI_CTX *ctx, int widget_id, double step)
set slider step increment (0 is treated as 1).
Definition n_gui.c:3211
int n_gui_add_toggle_button(N_GUI_CTX *ctx, int window_id, const char *label, float x, float y, float w, float h, int shape, int initial_state, void(*on_click)(int, void *), void *user_data)
toggle button creation (returns widget id)
Definition n_gui.c:2193
int n_gui_get_topmost_open_window(const N_GUI_CTX *ctx)
get the id of the frontmost open, non-minimized window (the last one in draw order),...
Definition n_gui.c:1861
void n_gui_kvtable_remove_row(N_GUI_KVTABLE *table, int row_index)
remove a row by index (hides widgets, marks inactive)
Definition n_gui.c:14112
int n_gui_add_label_link(N_GUI_CTX *ctx, int window_id, const char *text, const char *link, float x, float y, float w, float h, int align, void(*on_link_click)(int, const char *, void *), void *user_data)
add a text label with hyperlink
Definition n_gui.c:3007
void n_gui_textarea_set_mask_char(N_GUI_CTX *ctx, int widget_id, char mask)
set a mask character for password-style input (e.g.
Definition n_gui.c:4877
void n_gui_window_set_tb_close_theme(N_GUI_CTX *ctx, int window_id, N_GUI_THEME theme)
set the theme for the titlebar close button on a specific window
Definition n_gui.c:1713
void n_gui_window_set_tb_btn_theme(N_GUI_CTX *ctx, int window_id, N_GUI_THEME theme)
set the theme for titlebar minimize/maximize buttons on a specific window
Definition n_gui.c:1703
int n_gui_add_progressbar(N_GUI_CTX *ctx, int window_id, float x, float y, float w, float h)
add a horizontal progress bar (display only); returns the widget id or -1
Definition n_gui.c:4253
int n_gui_tab_get_active(const N_GUI_TAB_PANEL *panel)
get the active tab index
Definition n_gui.c:13318
size_t n_gui_hexview_get_length(N_GUI_CTX *ctx, int widget_id)
get the number of bytes currently held by a hex viewer
Definition n_gui.c:3610
int n_gui_listbox_get_selected(N_GUI_CTX *ctx, int widget_id)
get the first selected item index
Definition n_gui.c:3465
int n_gui_add_image(N_GUI_CTX *ctx, int window_id, float x, float y, float w, float h, ALLEGRO_BITMAP *bitmap, int scale_mode)
add an image widget
Definition n_gui.c:2937
void n_gui_widget_set_persist_key(N_GUI_CTX *ctx, int widget_id, const char *key)
Give a widget a stable key so its user-adjustable state (a splitpane's divider ratio,...
Definition n_gui.c:2293
void n_gui_label_set_bitmap(N_GUI_CTX *ctx, int widget_id, ALLEGRO_BITMAP *bg)
set optional background bitmap on a label widget.
Definition n_gui.c:4969
void n_gui_draw(N_GUI_CTX *ctx)
draw all visible GUI windows and widgets
Definition n_gui.c:8542
void n_gui_progressbar_set_value(N_GUI_CTX *ctx, int widget_id, float value)
set the progress fraction (clamped to 0.0 .
Definition n_gui.c:4279
int n_gui_tree_find_by_user_data(const N_GUI_TREE *tree, const void *ptr)
find the first node whose user_data pointer equals ptr, or -1.
Definition n_gui.c:13499
void n_gui_tree_set_selection(N_GUI_TREE *tree, int node_index)
programmatically select a node; ancestors are expanded so the node is visible, and the listbox scroll...
Definition n_gui.c:13477
int n_gui_tab_add(N_GUI_TAB_PANEL *panel, const char *label)
add a tab to the panel, returns tab index
Definition n_gui.c:13284
void n_gui_tree_set_on_drop(N_GUI_TREE *tree, n_gui_tree_on_drop_t on_drop, void *user_data)
install (or clear, with NULL) a drag-reorder drop callback.
Definition n_gui.c:13573
void n_gui_slider_set_bitmaps(N_GUI_CTX *ctx, int widget_id, ALLEGRO_BITMAP *track, ALLEGRO_BITMAP *fill, ALLEGRO_BITMAP *handle, ALLEGRO_BITMAP *handle_hover, ALLEGRO_BITMAP *handle_active)
set optional bitmap overlays on a slider widget.
Definition n_gui.c:4812
int n_gui_window_get_zorder(N_GUI_CTX *ctx, int window_id)
get window z-order mode
Definition n_gui.c:1921
void n_gui_tree_free(N_GUI_TREE **tree)
free a tree view (does not destroy the N_GUI listbox)
Definition n_gui.c:13562
N_GUI_SECTIONLIST * n_gui_sectionlist_create(N_GUI_CTX *ctx, int window_id, float x, float y0, float width, float header_h, float gap, void(*on_toggle)(int, int, void *), void *user_data)
create an empty section list anchored at (x,y0) in window_id; sections stack downward from y0
Definition n_gui.c:14219
void n_gui_datagrid_move_column(N_GUI_CTX *ctx, int widget_id, int from, int to)
move the column at display position from to display position to, shifting the columns in between (reo...
Definition n_gui.c:4156
int n_gui_window_get_resize_policy(N_GUI_CTX *ctx, int window_id)
get per-window resize policy
Definition n_gui.c:8949
void n_gui_checkbox_set_checked(N_GUI_CTX *ctx, int widget_id, int checked)
set checkbox checked state
Definition n_gui.c:3304
int n_gui_dropmenu_add_dynamic_entry(N_GUI_CTX *ctx, int widget_id, const char *text, int tag, void(*on_click)(int, int, int, void *), void *user_data)
add a dynamic entry (rebuilt each time menu opens)
Definition n_gui.c:4669
void n_gui_apply_adaptive_resize(N_GUI_CTX *ctx, float new_w, float new_h)
apply adaptive resize: reposition/resize all windows according to their policies for the new display ...
Definition n_gui.c:8978
int n_gui_tree_get_selection(N_GUI_TREE *tree)
get the index of the currently selected node, or -1 when nothing is selected or the selection points ...
Definition n_gui.c:13470
int n_gui_is_widget_enabled(N_GUI_CTX *ctx, int widget_id)
check if a widget is enabled
Definition n_gui.c:3093
void n_gui_button_set_keycode(N_GUI_CTX *ctx, int widget_id, int keycode, int modifiers)
bind a keyboard key with optional modifier requirements to a button.
Definition n_gui.c:2411
N_GUI_THEME n_gui_default_tb_close_theme(void)
return the built-in default theme for the titlebar close button (red hover/active)
Definition n_gui.c:751
char * n_gui_syntaxview_get_selected_text(N_GUI_CTX *ctx, int widget_id)
copy of the currently selected text in a syntax view, or NULL when nothing is selected.
Definition n_gui.c:3692
int n_gui_window_is_open(N_GUI_CTX *ctx, int window_id)
check if window is visible
Definition n_gui.c:1959
void n_gui_set_dpi_scale(N_GUI_CTX *ctx, float scale)
set DPI scale factor manually (default is 1.0).
Definition n_gui.c:9079
int n_gui_get_resize_mode(N_GUI_CTX *ctx)
get current resize mode
Definition n_gui.c:8926
N_GUI_WIDGET * n_gui_get_widget(N_GUI_CTX *ctx, int widget_id)
get a widget by id
Definition n_gui.c:3028
int n_gui_dropmenu_add_entry(N_GUI_CTX *ctx, int widget_id, const char *text, int tag, void(*on_click)(int, int, int, void *), void *user_data)
add a static entry to a dropdown menu
Definition n_gui.c:4646
int n_gui_datagrid_get_row_color(N_GUI_CTX *ctx, int widget_id, int row, ALLEGRO_COLOR *out)
report whether data row row carries a background tint (1) or not (0), and copy the tint into out when...
Definition n_gui.c:4059
N_GUI_WINDOW * n_gui_get_window(N_GUI_CTX *ctx, int window_id)
get a window by id
Definition n_gui.c:1182
int n_gui_add_syntaxview(N_GUI_CTX *ctx, int window_id, float x, float y, float w, float h, int mode)
add a read-only syntax-highlighted text view; returns the widget id or -1
Definition n_gui.c:2745
void n_gui_datagrid_clear_selection(N_GUI_CTX *ctx, int widget_id)
clear the entire selection (no row selected)
Definition n_gui.c:4016
void n_gui_dropmenu_set_bitmaps(N_GUI_CTX *ctx, int widget_id, ALLEGRO_BITMAP *panel, ALLEGRO_BITMAP *item_hover)
set optional bitmap overlays on a dropmenu widget.
Definition n_gui.c:4954
int n_gui_add_window(N_GUI_CTX *ctx, const char *title, float x, float y, float w, float h)
add a window to the GUI context
Definition n_gui.c:1063
void n_gui_slider_set_value_visible(N_GUI_CTX *ctx, int widget_id, int visible)
Toggle the built-in value label.
Definition n_gui.c:3234
int n_gui_window_attach(N_GUI_CTX *ctx, int window_id)
return a detached window to being an in-display pop-up
Definition n_gui.c:1542
void n_gui_datagrid_select_row(N_GUI_CTX *ctx, int widget_id, int row, int selected)
select (1) or deselect (0) a single row in a multi-select grid programmatically (e....
Definition n_gui.c:4025
void n_gui_draw_detached(N_GUI_CTX *ctx)
render and flip every detached window, and release the ones whose native window was closed.
Definition n_gui.c:8737
N_GUI_CTX * n_gui_new_ctx(ALLEGRO_FONT *default_font)
create a new GUI context
Definition n_gui.c:903
void n_gui_datagrid_clear_rows(N_GUI_CTX *ctx, int widget_id)
remove all rows from a data grid (columns are kept)
Definition n_gui.c:3920
void n_gui_slider_set_range(N_GUI_CTX *ctx, int widget_id, double min_val, double max_val)
set slider min/max range, clamping the current value if needed
Definition n_gui.c:3191
const char * n_gui_listbox_get_item_text(N_GUI_CTX *ctx, int widget_id, int index)
get item text by index
Definition n_gui.c:3448
void n_gui_radiolist_set_bitmaps(N_GUI_CTX *ctx, int widget_id, ALLEGRO_BITMAP *bg, ALLEGRO_BITMAP *item_bg, ALLEGRO_BITMAP *item_selected)
set optional bitmap overlays on a radiolist widget.
Definition n_gui.c:4922
N_GUI_TREE * n_gui_tree_create(N_GUI_CTX *ctx, int window_id, float x, float y, float w, float h, void(*on_select)(int, void *), void *user_data)
create a tree view in an existing window
Definition n_gui.c:13341
int n_gui_add_button_bitmap(N_GUI_CTX *ctx, int window_id, const char *label, float x, float y, float w, float h, ALLEGRO_BITMAP *normal, ALLEGRO_BITMAP *hover, ALLEGRO_BITMAP *active, void(*on_click)(int, void *), void *user_data)
add a bitmap-based button widget
Definition n_gui.c:2165
void n_gui_window_set_close_callback(N_GUI_CTX *ctx, int window_id, void(*on_close)(int, void *), void *user_data)
set the close button callback for a window (NULL = default: hide window)
Definition n_gui.c:1655
void n_gui_set_resize_mode(N_GUI_CTX *ctx, int mode)
set context-level resize mode: N_GUI_RESIZE_VIRTUAL (default) or N_GUI_RESIZE_ADAPTIVE
Definition n_gui.c:8897
void n_gui_button_set_toggle_mode(N_GUI_CTX *ctx, int widget_id, int toggle_mode)
set button toggle mode
Definition n_gui.c:2392
int n_gui_datagrid_display_to_physical(N_GUI_CTX *ctx, int widget_id, int display_pos)
physical column shown at display position display_pos, or -1 if out of range
Definition n_gui.c:4150
float n_gui_datagrid_get_column_width(N_GUI_CTX *ctx, int widget_id, int col)
current pixel width of physical column col, or 0 if out of range
Definition n_gui.c:4144
void n_gui_tree_toggle_expand(N_GUI_TREE *tree, int node_index)
toggle expand/collapse of a node
Definition n_gui.c:13507
void n_gui_textarea_scroll_to_offset(N_GUI_CTX *ctx, int widget_id, size_t byte_offset)
scroll a multiline textarea so that the given byte offset is vertically centered
Definition n_gui.c:5275
void n_gui_kvtable_set_columns(N_GUI_KVTABLE *table, int show_value, int show_desc, int show_enabled)
choose which optional columns are shown: Value, Description, and the enabled checkbox.
Definition n_gui.c:14144
const char * n_gui_datagrid_get_column_title(N_GUI_CTX *ctx, int widget_id, int col)
header title of physical column col, or "" if out of range
Definition n_gui.c:4120
void(* N_GUI_CUSTOM_DRAW)(N_GUI_WIDGET *widget, float x, float y, ALLEGRO_FONT *font, void *user_data)
Owner-draw callback for a custom widget (N_GUI_TYPE_CUSTOM).
Definition n_gui.h:934
void n_gui_textarea_set_bitmap(N_GUI_CTX *ctx, int widget_id, ALLEGRO_BITMAP *bg)
set optional background bitmap on a textarea widget.
Definition n_gui.c:4863
void n_gui_listbox_clear(N_GUI_CTX *ctx, int widget_id)
clear all items from a listbox
Definition n_gui.c:3418
float n_gui_dropmenu_panel_width(N_GUI_CTX *ctx, int widget_id)
width the open panel needs to show its entries without truncation: the larger of the collapsed button...
Definition n_gui.c:4771
int n_gui_add_scrollbar(N_GUI_CTX *ctx, int window_id, float x, float y, float w, float h, int orientation, int shape, double content_size, double viewport_size, void(*on_scroll)(int, double, void *), void *user_data)
add a scrollbar widget
Definition n_gui.c:2577
N_GUI_TEXT_DIMS n_gui_get_text_dims(ALLEGRO_FONT *font, const char *text)
get the bounding box dimensions of text rendered with the given font.
Definition n_gui.c:103
void n_gui_destroy_ctx(N_GUI_CTX **ctx)
destroy a GUI context and free all resources
Definition n_gui.c:995
int n_gui_window_is_minimised(N_GUI_CTX *ctx, int window_id)
check if a window is currently minimised
Definition n_gui.c:1255
void n_gui_restore_window(N_GUI_CTX *ctx, int window_id)
restore a minimised window to its full size
Definition n_gui.c:1242
const char * n_gui_textarea_get_text(N_GUI_CTX *ctx, int widget_id)
get text area content
Definition n_gui.c:3249
int n_gui_kvtable_add_row(N_GUI_KVTABLE *table, const char *key, const char *value, const char *description, int enabled)
add a row to the KV table
Definition n_gui.c:14053
int n_gui_get_shape_mode(N_GUI_CTX *ctx)
get the global widget shape (N_GUI_SHAPE_ROUNDED or N_GUI_SHAPE_RECT)
Definition n_gui.c:9064
void n_gui_checkbox_set_bitmaps(N_GUI_CTX *ctx, int widget_id, ALLEGRO_BITMAP *box, ALLEGRO_BITMAP *box_checked, ALLEGRO_BITMAP *box_hover)
set optional bitmap overlays on a checkbox widget.
Definition n_gui.c:4847
void n_gui_listbox_set_scroll_offset(N_GUI_CTX *ctx, int widget_id, int offset)
set the scroll offset (in items), clamps to valid range
Definition n_gui.c:3519
float n_gui_progressbar_get_value(N_GUI_CTX *ctx, int widget_id)
get the current progress fraction (0.0 on an invalid widget)
Definition n_gui.c:4290
int n_gui_sectionlist_get_count(const N_GUI_SECTIONLIST *sl)
number of sections in the list
Definition n_gui.c:14332
#define N_GUI_TEXT_MAX
maximum length for textarea content
Definition n_gui.h:87
void n_gui_textarea_scroll_to_bottom(N_GUI_CTX *ctx, int widget_id)
scroll a multiline textarea to the bottom
Definition n_gui.c:5236
size_t n_gui_textarea_get_text_length(N_GUI_CTX *ctx, int widget_id)
return the current text length in bytes (0 if widget is invalid)
Definition n_gui.c:5336
void n_gui_open_window(N_GUI_CTX *ctx, int window_id)
open (show) a window
Definition n_gui.c:1206
int n_gui_window_get_zvalue(N_GUI_CTX *ctx, int window_id)
get window z-value (for N_GUI_ZORDER_FIXED mode)
Definition n_gui.c:1931
ALLEGRO_DISPLAY * n_gui_window_get_display(N_GUI_CTX *ctx, int window_id)
get the native display backing a window, or NULL when it is a pop-up
Definition n_gui.c:1584
int n_gui_sectionlist_add_section(N_GUI_SECTIONLIST *sl, const char *title, float header_y, int folded)
add a section with a header button at header_y (members added next are captured relative to it); retu...
Definition n_gui.c:14238
void n_gui_dropmenu_set_entry_text(N_GUI_CTX *ctx, int widget_id, int index, const char *text)
update text of an existing entry by index
Definition n_gui.c:4734
void n_gui_window_set_content_draw_callback(N_GUI_CTX *ctx, int window_id, void(*on_content_draw)(int, void *), void *user_data)
set a content-draw callback for a window, invoked during n_gui_draw right after the window's own cont...
Definition n_gui.c:1670
int n_gui_tree_add_node(N_GUI_TREE *tree, const char *label, int parent_index, void *user_data)
add a node to the tree
Definition n_gui.c:13380
int n_gui_listbox_get_count(N_GUI_CTX *ctx, int widget_id)
get number of items in a listbox
Definition n_gui.c:3433
int n_gui_window_set_native_icons(N_GUI_CTX *ctx, int window_id, ALLEGRO_BITMAP **icons, int num_icons)
give a detached window's OS window a taskbar / title bar icon
Definition n_gui.c:1622
void n_gui_dropmenu_set_label(N_GUI_CTX *ctx, int widget_id, const char *label)
replace the button label shown on a dropmenu (NULL clears it)
Definition n_gui.c:4631
void n_gui_tree_draw_overlay(N_GUI_TREE *tree)
per-frame overlay drawing: draws the active drop-indicator on top of the listbox.
Definition n_gui.c:13730
const char * n_gui_combobox_get_item_text(N_GUI_CTX *ctx, int widget_id, int index)
get the text of the combobox item at index ("" if out of range / not a combobox)
Definition n_gui.c:4461
int n_gui_count_detached(N_GUI_CTX *ctx)
count the windows currently detached into native OS windows
Definition n_gui.c:1609
void n_gui_dropmenu_set_flags(N_GUI_CTX *ctx, int widget_id, int flags)
set dropmenu feature flags (bitmask of N_GUI_DROPMENU_* values)
Definition n_gui.c:4612
void n_gui_splitpane_set_ratio(N_GUI_CTX *ctx, int widget_id, float ratio)
set the divider ratio (clamped to the configured min/max)
Definition n_gui.c:3550
int n_gui_checkbox_is_checked(N_GUI_CTX *ctx, int widget_id)
check if checkbox is checked
Definition n_gui.c:3290
void n_gui_splitpane_set_limits(N_GUI_CTX *ctx, int widget_id, float min_ratio, float max_ratio)
set the minimum and maximum allowed divider ratio
Definition n_gui.c:3566
void n_gui_set_default_theme(N_GUI_CTX *ctx, N_GUI_THEME theme)
Set the default theme on a context and sync scrollbar style colors.
Definition n_gui.c:758
int n_gui_combobox_get_selected(N_GUI_CTX *ctx, int widget_id)
get the selected item index
Definition n_gui.c:4453
void n_gui_tree_remove_node(N_GUI_TREE *tree, int node_index)
remove a node and its entire subtree; remaining node indices are compacted (callers holding indices a...
Definition n_gui.c:13408
void n_gui_image_set_bitmap(N_GUI_CTX *ctx, int widget_id, ALLEGRO_BITMAP *bitmap)
set the bitmap on an image widget
Definition n_gui.c:4496
int n_gui_load_layout_json(N_GUI_CTX *ctx, const char *filepath)
Load a JSON window layout file and apply it to matching windows in the context.
Definition n_gui.c:12870
int n_gui_window_is_maximised(N_GUI_CTX *ctx, int window_id)
check if a window is currently maximised
Definition n_gui.c:1344
int n_gui_datagrid_add_row(N_GUI_CTX *ctx, int widget_id, const char **values)
append a row of cell strings (values must have one entry per column); returns the row index or -1
Definition n_gui.c:3862
void n_gui_syntaxview_set_text(N_GUI_CTX *ctx, int widget_id, const char *text)
set (copy) the text shown by a syntax view; text may be NULL to clear
Definition n_gui.c:3624
void n_gui_slider_set_value(N_GUI_CTX *ctx, int widget_id, double value)
set slider value
Definition n_gui.c:3173
int n_gui_sectionlist_is_folded(const N_GUI_SECTIONLIST *sl, int section_index)
query a section's folded state (1 = folded, 0 = expanded)
Definition n_gui.c:14317
void n_gui_datagrid_set_column_width(N_GUI_CTX *ctx, int widget_id, int col, float width)
set the pixel width of physical column col (clamped to a small minimum)
Definition n_gui.c:4138
void n_gui_syntaxview_scroll_to_offset(N_GUI_CTX *ctx, int widget_id, int byte_offset)
scroll a syntax view so the line holding the given byte offset is vertically centered
Definition n_gui.c:3751
void n_gui_sectionlist_add_widget(N_GUI_SECTIONLIST *sl, int section_index, int widget_id)
register an existing widget as a member of a section (captures its current y as the fold offset)
Definition n_gui.c:14255
void n_gui_datagrid_set_column_visible(N_GUI_CTX *ctx, int widget_id, int col, int visible)
show (1) or hide (0) physical column col; hidden columns keep their cells but are skipped in the head...
Definition n_gui.c:4126
void n_gui_sectionlist_set_first_inset(N_GUI_SECTIONLIST *sl, float inset)
set a left inset applied to the FIRST section's header only, so a caller can place a button before it...
Definition n_gui.c:14273
void n_gui_radiolist_set_selected(N_GUI_CTX *ctx, int widget_id, int index)
set the selected item index
Definition n_gui.c:4400
void n_gui_window_set_flags(N_GUI_CTX *ctx, int window_id, int flags)
set feature flags on a window (N_GUI_WIN_AUTO_SCROLLBAR, N_GUI_WIN_RESIZABLE, ...)
Definition n_gui.c:1968
void n_gui_set_widget_visible(N_GUI_CTX *ctx, int widget_id, int visible)
set widget visibility
Definition n_gui.c:3075
void n_gui_syntaxview_select_all(N_GUI_CTX *ctx, int widget_id)
select the entire text of a syntax view
Definition n_gui.c:3739
N_GUI_TAB_PANEL * n_gui_tab_create(N_GUI_CTX *ctx, int window_id, float x, float y, float button_w, float button_h, void(*on_tab_change)(int, void *), void *user_data)
create a tab panel in an existing window
Definition n_gui.c:13262
void n_gui_mark_dirty(N_GUI_CTX *ctx)
Mark the GUI as needing a redraw.
Definition n_gui.c:974
#define N_GUI_ID_MAX
maximum length for widget id/name strings
Definition n_gui.h:85
N_GUI_STYLE n_gui_default_style(void)
return the built-in default style
Definition n_gui.c:788
#define N_GUI_TAB_MAX
maximum number of tabs in a single tab panel
Definition n_gui.h:2363
void n_gui_datagrid_clear_row_colors(N_GUI_CTX *ctx, int widget_id)
remove every row background tint (the rows and cells are kept)
Definition n_gui.c:4069
void n_gui_window_set_maximize_callback(N_GUI_CTX *ctx, int window_id, void(*on_maximize)(int, void *), void *user_data)
set the maximize button callback for a window (NULL = default: toggle maximised)
Definition n_gui.c:1692
void n_gui_scrollbar_set_sizes(N_GUI_CTX *ctx, int widget_id, double content_size, double viewport_size)
set scrollbar content and viewport sizes
Definition n_gui.c:3350
int n_gui_window_from_display(N_GUI_CTX *ctx, ALLEGRO_DISPLAY *display)
find the window detached into a given display
Definition n_gui.c:1596
void n_gui_textarea_set_placeholder(N_GUI_CTX *ctx, int widget_id, const char *text)
set placeholder/hint text for a textarea, shown dimmed while the field is empty and cleared from view...
Definition n_gui.c:4889
int n_gui_add_textarea(N_GUI_CTX *ctx, int window_id, float x, float y, float w, float h, int multiline, size_t char_limit, void(*on_change)(int, const char *, void *), void *user_data)
add a text area widget
Definition n_gui.c:2498
void n_gui_sectionlist_free(N_GUI_SECTIONLIST **sl)
free the section list (does not destroy the N_GUI widgets or window)
Definition n_gui.c:14336
int n_gui_datagrid_get_selected(N_GUI_CTX *ctx, int widget_id)
get the selected row index, or -1 if none
Definition n_gui.c:3952
int n_gui_listbox_is_selected(N_GUI_CTX *ctx, int widget_id, int index)
check if an item is selected
Definition n_gui.c:3483
void n_gui_window_update_normalized(N_GUI_CTX *ctx, int window_id)
recapture normalized coordinates for a window from its current absolute position/size.
Definition n_gui.c:8962
int n_gui_add_checkbox(N_GUI_CTX *ctx, int window_id, const char *label, float x, float y, float w, float h, int initial_checked, void(*on_toggle)(int, int, void *), void *user_data)
add a checkbox widget
Definition n_gui.c:2543
void n_gui_combobox_clear(N_GUI_CTX *ctx, int widget_id)
remove all items from a combobox
Definition n_gui.c:4417
void n_gui_sectionlist_relayout(N_GUI_SECTIONLIST *sl)
re-stack all sections from y0 by current fold state: hide folded members, show and reposition expande...
Definition n_gui.c:14278
int n_gui_datagrid_get_column_visible(N_GUI_CTX *ctx, int widget_id, int col)
whether physical column col is visible (1) or hidden (0); 0 if out of range
Definition n_gui.c:4132
void n_gui_combobox_set_selected(N_GUI_CTX *ctx, int widget_id, int index)
set the selected item index
Definition n_gui.c:4478
int n_gui_listbox_remove_item(N_GUI_CTX *ctx, int widget_id, int index)
remove an item from a listbox by index
Definition n_gui.c:3394
N_GUI_THEME n_gui_make_theme(ALLEGRO_COLOR bg, ALLEGRO_COLOR bg_hover, ALLEGRO_COLOR bg_active, ALLEGRO_COLOR border, ALLEGRO_COLOR border_hover, ALLEGRO_COLOR border_active, ALLEGRO_COLOR text, ALLEGRO_COLOR text_hover, ALLEGRO_COLOR text_active, float border_thickness, float corner_rx, float corner_ry)
create a custom theme from individual colors and properties
Definition n_gui.c:685
int n_gui_add_dropmenu(N_GUI_CTX *ctx, int window_id, const char *label, float x, float y, float w, float h, void(*on_open)(int, void *), void *on_open_user_data)
add a dropdown menu widget (button that opens a menu panel with entries)
Definition n_gui.c:4568
int n_gui_add_datagrid(N_GUI_CTX *ctx, int window_id, float x, float y, float w, float h, void(*on_select)(int, int, void *), void *user_data)
add a sortable data grid; returns the widget id or -1
Definition n_gui.c:2787
void n_gui_screen_to_virtual(const N_GUI_CTX *ctx, float sx, float sy, float *vx, float *vy)
convert physical screen coordinates to virtual canvas coordinates.
Definition n_gui.c:8876
int n_gui_add_button(N_GUI_CTX *ctx, int window_id, const char *label, float x, float y, float w, float h, int shape, void(*on_click)(int, void *), void *user_data)
add a button widget
Definition n_gui.c:2124
void n_gui_set_event_queue(N_GUI_CTX *ctx, ALLEGRO_EVENT_QUEUE *queue)
give the context the event queue it registers native window event sources into
Definition n_gui.c:1356
int n_gui_add_custom(N_GUI_CTX *ctx, int window_id, float x, float y, float w, float h, N_GUI_CUSTOM_DRAW draw, void *user_data)
Add an owner-draw custom widget to a window.
Definition n_gui.c:4315
#define N_GUI_KEY_SOURCES_MAX
maximum number of source widgets for a focused key binding
Definition n_gui.h:375
void n_gui_tree_tick(N_GUI_TREE *tree)
per-frame poll: reads ctx->mouse_* to track drag state and fires the on_drop callback on release.
Definition n_gui.c:13668
void n_gui_reset_all_widget_themes(N_GUI_CTX *ctx)
reset all widget and window themes to ctx->default_theme
Definition n_gui.c:3056
void n_gui_window_set_autofit(N_GUI_CTX *ctx, int window_id, int autofit_flags, float border)
configure auto-fit behavior for a dialog window
Definition n_gui.c:2016
void n_gui_scrollbar_set_pos(N_GUI_CTX *ctx, int widget_id, double pos)
set scrollbar position
Definition n_gui.c:3333
void n_gui_dropmenu_clear_dynamic(N_GUI_CTX *ctx, int widget_id)
remove all dynamic entries (call from on_open callback before re-adding)
Definition n_gui.c:4694
button specific data
Definition n_gui.h:380
checkbox specific data
Definition n_gui.h:501
combo box specific data
Definition n_gui.h:746
The top-level GUI context that holds all windows.
Definition n_gui.h:1354
Owner-draw custom widget data: a paint callback plus its user pointer.
Definition n_gui.h:937
one data grid column definition
Definition n_gui.h:639
data grid specific data: a sortable column table
Definition n_gui.h:649
dropdown menu specific data
Definition n_gui.h:843
A single entry in a dropdown menu (static or dynamic)
Definition n_gui.h:823
hex viewer specific data: a read-only byte dump
Definition n_gui.h:601
image widget specific data
Definition n_gui.h:783
a single row in the KV table
Definition n_gui.h:2552
key-value table built from textareas, checkboxes, and buttons
Definition n_gui.h:2562
static text label specific data
Definition n_gui.h:791
listbox specific data
Definition n_gui.h:553
a single item in a list/radio/combo widget
Definition n_gui.h:545
A saved window position retained for a window not yet created at load time (see N_GUI_CTX::pending_la...
Definition n_gui.h:1324
Saved user-adjustable state for a keyed widget that did not exist when the layout was loaded (a lazil...
Definition n_gui.h:1341
Progress-bar widget data (display only).
Definition n_gui.h:815
radio list specific data
Definition n_gui.h:711
scrollbar specific data
Definition n_gui.h:519
a single foldable section: a clickable header plus the member widgets it shows/hides
Definition n_gui.h:2401
a vertical accordion of foldable sections inside one window; folding hides a section's widgets and re...
Definition n_gui.h:2414
slider specific data
Definition n_gui.h:421
split pane specific data: a draggable divider between two regions
Definition n_gui.h:583
Global style holding every configurable layout constant.
Definition n_gui.h:1147
syntax view specific data: read-only highlighted text
Definition n_gui.h:613
tab panel built from toggle buttons with content window management
Definition n_gui.h:2366
Titlebar button state for a window (minimize, maximize, close)
Definition n_gui.h:947
bounding box dimensions returned by n_gui_get_text_dims()
Definition n_gui.h:331
text area specific data
Definition n_gui.h:461
Color theme for a widget.
Definition n_gui.h:341
tree view built from an N_GUI listbox
Definition n_gui.h:2477
a single node in the tree view
Definition n_gui.h:2454
A single GUI widget.
Definition n_gui.h:882
A pseudo window that contains widgets.
Definition n_gui.h:999
structure of a hash table
Definition n_hash.h:138
Structure of a generic LIST container.
Definition n_list.h:59
Allegro5 helpers.
Common headers and low-level functions & define.
Hash functions and table.
List structures and definitions.
Generic log system.
N_STR and string function declaration.