Nuklear
Minimal-state, immediate-mode graphical user interface toolkit written in ANSI C.
Loading...
Searching...
No Matches
nuklear.h
1
6#ifndef NK_NUKLEAR_H_
7#define NK_NUKLEAR_H_
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12/*
13 * ==============================================================
14 *
15 * CONSTANTS
16 *
17 * ===============================================================
18 */
19
20#define NK_UNDEFINED (-1.0f)
21#define NK_UTF_INVALID 0xFFFD
22#define NK_UTF_SIZE 4
23#ifndef NK_INPUT_MAX
24 #define NK_INPUT_MAX 16
25#endif
26#ifndef NK_MAX_NUMBER_BUFFER
27 #define NK_MAX_NUMBER_BUFFER 64
28#endif
29#ifndef NK_SCROLLBAR_HIDING_TIMEOUT
30 #define NK_SCROLLBAR_HIDING_TIMEOUT 4.0f
31#endif
32/*
33 * ==============================================================
34 *
35 * HELPER
36 *
37 * ===============================================================
38 */
39
40#ifndef NK_API
41 #ifdef NK_PRIVATE
42 #if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199409L))
43 #define NK_API static inline
44 #elif defined(__cplusplus)
45 #define NK_API static inline
46 #else
47 #define NK_API static
48 #endif
49 #else
50 #define NK_API extern
51 #endif
52#endif
53#ifndef NK_LIB
54 #ifdef NK_SINGLE_FILE
55 #define NK_LIB static
56 #else
57 #define NK_LIB extern
58 #endif
59#endif
60
61#define NK_INTERN static
62#define NK_STORAGE static
63#define NK_GLOBAL static
64
65#define NK_FLAG(x) (1 << (x))
66#define NK_STRINGIFY(x) #x
67#define NK_MACRO_STRINGIFY(x) NK_STRINGIFY(x)
68#define NK_STRING_JOIN_IMMEDIATE(arg1, arg2) arg1 ## arg2
69#define NK_STRING_JOIN_DELAY(arg1, arg2) NK_STRING_JOIN_IMMEDIATE(arg1, arg2)
70#define NK_STRING_JOIN(arg1, arg2) NK_STRING_JOIN_DELAY(arg1, arg2)
71
72#ifdef _MSC_VER
73 #define NK_UNIQUE_NAME(name) NK_STRING_JOIN(name,__COUNTER__)
74#else
75 #define NK_UNIQUE_NAME(name) NK_STRING_JOIN(name,__LINE__)
76#endif
77
78#ifndef NK_STATIC_ASSERT
79 #define NK_STATIC_ASSERT(exp) typedef char NK_UNIQUE_NAME(_dummy_array)[(exp)?1:-1]
80#endif
81
82#ifndef NK_FILE_LINE
83#ifdef _MSC_VER
84 #define NK_FILE_LINE __FILE__ ":" NK_MACRO_STRINGIFY(__COUNTER__)
85#else
86 #define NK_FILE_LINE __FILE__ ":" NK_MACRO_STRINGIFY(__LINE__)
87#endif
88#endif
89
90#define NK_MIN(a,b) ((a) < (b) ? (a) : (b))
91#define NK_MAX(a,b) ((a) < (b) ? (b) : (a))
92#define NK_CLAMP(i,v,x) (NK_MAX(NK_MIN(v,x), i))
93
94#ifdef NK_INCLUDE_STANDARD_VARARGS
95 #include <stdarg.h>
96 #if defined(_MSC_VER) && (_MSC_VER >= 1600) /* VS 2010 and above */
97 #include <sal.h>
98 #define NK_PRINTF_FORMAT_STRING _Printf_format_string_
99 #else
100 #define NK_PRINTF_FORMAT_STRING
101 #endif
102 #if defined(__GNUC__)
103 #define NK_PRINTF_VARARG_FUNC(fmtargnumber) __attribute__((format(__printf__, fmtargnumber, fmtargnumber+1)))
104 #define NK_PRINTF_VALIST_FUNC(fmtargnumber) __attribute__((format(__printf__, fmtargnumber, 0)))
105 #else
106 #define NK_PRINTF_VARARG_FUNC(fmtargnumber)
107 #define NK_PRINTF_VALIST_FUNC(fmtargnumber)
108 #endif
109#endif
110
111/*
112 * ===============================================================
113 *
114 * BASIC
115 *
116 * ===============================================================
117 */
118 #ifdef NK_INCLUDE_FIXED_TYPES
119 #include <stdint.h>
120 #define NK_INT8 int8_t
121 #define NK_UINT8 uint8_t
122 #define NK_INT16 int16_t
123 #define NK_UINT16 uint16_t
124 #define NK_INT32 int32_t
125 #define NK_UINT32 uint32_t
126 #define NK_SIZE_TYPE uintptr_t
127 #define NK_POINTER_TYPE uintptr_t
128#else
129 #ifndef NK_INT8
130 #define NK_INT8 signed char
131 #endif
132 #ifndef NK_UINT8
133 #define NK_UINT8 unsigned char
134 #endif
135 #ifndef NK_INT16
136 #define NK_INT16 signed short
137 #endif
138 #ifndef NK_UINT16
139 #define NK_UINT16 unsigned short
140 #endif
141 #ifndef NK_INT32
142 #if defined(_MSC_VER)
143 #define NK_INT32 __int32
144 #else
145 #define NK_INT32 signed int
146 #endif
147 #endif
148 #ifndef NK_UINT32
149 #if defined(_MSC_VER)
150 #define NK_UINT32 unsigned __int32
151 #else
152 #define NK_UINT32 unsigned int
153 #endif
154 #endif
155 #ifndef NK_SIZE_TYPE
156 #if defined(_WIN64) && defined(_MSC_VER)
157 #define NK_SIZE_TYPE unsigned __int64
158 #elif defined(_WIN64) && (defined(__MINGW64__) || defined(__clang__))
159 #define NK_SIZE_TYPE unsigned long long
160 #elif (defined(_WIN32) || defined(WIN32)) && defined(_MSC_VER)
161 #define NK_SIZE_TYPE unsigned __int32
162 #elif (defined(_WIN32) || defined(WIN32)) && (defined(__MINGW32__) || defined(__clang__))
163 #define NK_SIZE_TYPE unsigned long
164 #elif defined(__GNUC__) || defined(__clang__)
165 #if defined(__x86_64__) || defined(__ppc64__) || defined(__PPC64__) || defined(__aarch64__)
166 #define NK_SIZE_TYPE unsigned long
167 #else
168 #define NK_SIZE_TYPE unsigned int
169 #endif
170 #else
171 #define NK_SIZE_TYPE unsigned long
172 #endif
173 #endif
174 #ifndef NK_POINTER_TYPE
175 #if defined(_WIN64) && defined(_MSC_VER)
176 #define NK_POINTER_TYPE unsigned __int64
177 #elif defined(_WIN64) && (defined(__MINGW64__) || defined(__clang__))
178 #define NK_POINTER_TYPE unsigned long long
179 #elif (defined(_WIN32) || defined(WIN32)) && defined(_MSC_VER)
180 #define NK_POINTER_TYPE unsigned __int32
181 #elif (defined(_WIN32) || defined(WIN32)) && (defined(__MINGW32__) || defined(__clang__))
182 #define NK_POINTER_TYPE unsigned long
183 #elif defined(__GNUC__) || defined(__clang__)
184 #if defined(__x86_64__) || defined(__ppc64__) || defined(__PPC64__) || defined(__aarch64__)
185 #define NK_POINTER_TYPE unsigned long
186 #else
187 #define NK_POINTER_TYPE unsigned int
188 #endif
189 #else
190 #define NK_POINTER_TYPE unsigned long
191 #endif
192 #endif
193#endif
194
196#ifndef NK_BOOL
197 #ifdef NK_INCLUDE_STANDARD_BOOL
198 #include <stdbool.h>
199 #define NK_BOOL bool
200 #else
201 #define NK_BOOL int
202 #endif
203#endif
204
205typedef NK_INT8 nk_char;
206typedef NK_UINT8 nk_uchar;
207typedef NK_UINT8 nk_byte;
208typedef NK_INT16 nk_short;
209typedef NK_UINT16 nk_ushort;
210typedef NK_INT32 nk_int;
211typedef NK_UINT32 nk_uint;
212typedef NK_SIZE_TYPE nk_size;
213typedef NK_POINTER_TYPE nk_ptr;
214typedef NK_BOOL nk_bool;
215
216typedef nk_uint nk_hash;
217typedef nk_uint nk_flags;
218typedef nk_uint nk_rune;
219
220/* Make sure correct type size:
221 * This will fire with a negative subscript error if the type sizes
222 * are set incorrectly by the compiler, and compile out if not */
223NK_STATIC_ASSERT(sizeof(nk_short) == 2);
224NK_STATIC_ASSERT(sizeof(nk_ushort) == 2);
225NK_STATIC_ASSERT(sizeof(nk_uint) == 4);
226NK_STATIC_ASSERT(sizeof(nk_int) == 4);
227NK_STATIC_ASSERT(sizeof(nk_byte) == 1);
228NK_STATIC_ASSERT(sizeof(nk_flags) >= 4);
229NK_STATIC_ASSERT(sizeof(nk_rune) >= 4);
230NK_STATIC_ASSERT(sizeof(nk_size) >= sizeof(void*));
231NK_STATIC_ASSERT(sizeof(nk_ptr) >= sizeof(void*));
232NK_STATIC_ASSERT(sizeof(nk_bool) <= sizeof(int));
233
234/* ============================================================================
235 *
236 * API
237 *
238 * =========================================================================== */
239struct nk_buffer;
240struct nk_allocator;
241struct nk_command_buffer;
242struct nk_draw_command;
243struct nk_convert_config;
244struct nk_style_item;
245struct nk_text_edit;
246struct nk_draw_list;
247struct nk_user_font;
248struct nk_panel;
249struct nk_context;
250struct nk_draw_vertex_layout_element;
251struct nk_style_button;
252struct nk_style_link;
253struct nk_style_toggle;
255struct nk_style_slide;
256struct nk_style_progress;
257struct nk_style_scrollbar;
258struct nk_style_edit;
259struct nk_style_property;
260struct nk_style_chart;
261struct nk_style_combo;
262struct nk_style_tab;
264struct nk_style_window;
265
266enum {nk_false, nk_true};
267struct nk_color {nk_byte r,g,b,a;};
268struct nk_colorf {float r,g,b,a;};
269struct nk_vec2 {float x,y;};
270struct nk_vec2i {short x, y;};
271struct nk_rect {float x,y,w,h;};
272struct nk_recti {short x,y,w,h;};
273typedef char nk_glyph[NK_UTF_SIZE];
274typedef union {void *ptr; int id;} nk_handle;
275struct nk_image {nk_handle handle; nk_ushort w, h; nk_ushort region[4];};
276struct nk_nine_slice {struct nk_image img; nk_ushort l, t, r, b;};
277struct nk_cursor {struct nk_image img; struct nk_vec2 size, offset;};
278struct nk_scroll {nk_uint x, y;};
279
280/* Make sure the semantic of nk_true/nk_false is compatible with nk_bool */
281NK_STATIC_ASSERT(!((nk_bool)0) == !(nk_false));
282NK_STATIC_ASSERT(!((nk_bool)1) == !(nk_true));
283
284enum nk_heading {NK_UP, NK_RIGHT, NK_DOWN, NK_LEFT};
285enum nk_button_behavior {NK_BUTTON_DEFAULT, NK_BUTTON_REPEATER};
286enum nk_link_underline {
287 NK_LINK_UNDERLINE_NONE,
288 NK_LINK_UNDERLINE_HOVER,
289 NK_LINK_UNDERLINE_ALWAYS
290};
291enum nk_modify {NK_FIXED = nk_false, NK_MODIFIABLE = nk_true};
292enum nk_orientation {NK_VERTICAL, NK_HORIZONTAL};
293enum nk_collapse_states {NK_MINIMIZED = nk_false, NK_MAXIMIZED = nk_true};
294enum nk_show_states {NK_HIDDEN = nk_false, NK_SHOWN = nk_true};
295enum nk_chart_type {NK_CHART_LINES, NK_CHART_COLUMN, NK_CHART_MAX};
296enum nk_chart_event {NK_CHART_HOVERING = 0x01, NK_CHART_CLICKED = 0x02};
297enum nk_color_format {NK_RGB, NK_RGBA};
298enum nk_popup_type {NK_POPUP_STATIC, NK_POPUP_DYNAMIC};
299enum nk_layout_format {NK_DYNAMIC, NK_STATIC};
300enum nk_tree_type {NK_TREE_NODE, NK_TREE_TAB};
301
302enum nk_tooltip_pos {
303 NK_TOP_LEFT,
304 NK_TOP_CENTER,
305 NK_TOP_RIGHT,
306
307 NK_MIDDLE_LEFT,
308 NK_MIDDLE_CENTER,
309 NK_MIDDLE_RIGHT,
310
311 NK_BOTTOM_LEFT,
312 NK_BOTTOM_CENTER,
313 NK_BOTTOM_RIGHT
314};
315
316typedef void*(*nk_plugin_alloc)(nk_handle, void *old, nk_size);
317typedef void (*nk_plugin_free)(nk_handle, void *old);
318typedef nk_bool(*nk_plugin_filter)(const struct nk_text_edit*, nk_rune unicode);
319typedef void(*nk_plugin_paste)(nk_handle, struct nk_text_edit*);
320typedef void(*nk_plugin_copy)(nk_handle, const char*, int len);
321
323 nk_handle userdata;
324 nk_plugin_alloc alloc;
325 nk_plugin_free free;
326};
327enum nk_symbol_type {
328 NK_SYMBOL_NONE,
329 NK_SYMBOL_X,
330 NK_SYMBOL_UNDERSCORE,
331 NK_SYMBOL_CIRCLE_SOLID,
332 NK_SYMBOL_CIRCLE_OUTLINE,
333 NK_SYMBOL_RECT_SOLID,
334 NK_SYMBOL_RECT_OUTLINE,
335 NK_SYMBOL_TRIANGLE_UP,
336 NK_SYMBOL_TRIANGLE_DOWN,
337 NK_SYMBOL_TRIANGLE_LEFT,
338 NK_SYMBOL_TRIANGLE_RIGHT,
339 NK_SYMBOL_PLUS,
340 NK_SYMBOL_MINUS,
341 NK_SYMBOL_TRIANGLE_UP_OUTLINE,
342 NK_SYMBOL_TRIANGLE_DOWN_OUTLINE,
343 NK_SYMBOL_TRIANGLE_LEFT_OUTLINE,
344 NK_SYMBOL_TRIANGLE_RIGHT_OUTLINE,
345 NK_SYMBOL_CHEVRON_UP,
346 NK_SYMBOL_CHEVRON_RIGHT,
347 NK_SYMBOL_CHEVRON_DOWN,
348 NK_SYMBOL_CHEVRON_LEFT,
349 NK_SYMBOL_HAMBURGER,
350 NK_SYMBOL_MAX
351};
352/* =============================================================================
353 *
354 * CONTEXT
355 *
356 * =============================================================================*/
393
394#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
395
412NK_API nk_bool nk_init_default(struct nk_context*, const struct nk_user_font*);
413#endif
437NK_API nk_bool nk_init_fixed(struct nk_context*, void *memory, nk_size size, const struct nk_user_font*);
438
457NK_API nk_bool nk_init(struct nk_context*, const struct nk_allocator*, const struct nk_user_font*);
458
477NK_API nk_bool nk_init_custom(struct nk_context*, struct nk_buffer *cmds, struct nk_buffer *pool, const struct nk_user_font*);
478
492NK_API void nk_clear(struct nk_context*);
493
504NK_API void nk_free(struct nk_context*);
505
506#ifdef NK_INCLUDE_COMMAND_USERDATA
518NK_API void nk_set_user_data(struct nk_context*, nk_handle handle);
519#endif
520
544NK_API void nk_set_display_size(struct nk_context *ctx, float width, float height);
545
561NK_API void nk_set_display_bounds(struct nk_context *ctx, struct nk_rect bounds);
562/* =============================================================================
563 *
564 * INPUT
565 *
566 * =============================================================================*/
630
631enum nk_keys {
632 NK_KEY_NONE,
633 NK_KEY_SHIFT,
634 NK_KEY_CTRL,
635 NK_KEY_DEL,
636 NK_KEY_ENTER,
637 NK_KEY_TAB,
638 NK_KEY_BACKSPACE,
639 NK_KEY_COPY,
640 NK_KEY_CUT,
641 NK_KEY_PASTE,
642 NK_KEY_UP,
643 NK_KEY_DOWN,
644 NK_KEY_LEFT,
645 NK_KEY_RIGHT,
646 /* Shortcuts: text field */
647 NK_KEY_TEXT_INSERT_MODE,
648 NK_KEY_TEXT_REPLACE_MODE,
649 NK_KEY_TEXT_RESET_MODE,
650 NK_KEY_TEXT_LINE_START,
651 NK_KEY_TEXT_LINE_END,
652 NK_KEY_TEXT_START,
653 NK_KEY_TEXT_END,
654 NK_KEY_TEXT_UNDO,
655 NK_KEY_TEXT_REDO,
656 NK_KEY_TEXT_SELECT_ALL,
657 NK_KEY_TEXT_WORD_LEFT,
658 NK_KEY_TEXT_WORD_RIGHT,
659 /* Shortcuts: scrollbar */
660 NK_KEY_SCROLL_START,
661 NK_KEY_SCROLL_END,
662 NK_KEY_SCROLL_DOWN,
663 NK_KEY_SCROLL_UP,
664 NK_KEY_ALT,
665 NK_KEY_F1,
666 NK_KEY_F2,
667 NK_KEY_F3,
668 NK_KEY_F4,
669 NK_KEY_F5,
670 NK_KEY_F6,
671 NK_KEY_F7,
672 NK_KEY_F8,
673 NK_KEY_F9,
674 NK_KEY_F10,
675 NK_KEY_F11,
676 NK_KEY_F12,
677 NK_KEY_MAX
678};
679enum nk_buttons {
680 NK_BUTTON_LEFT,
681 NK_BUTTON_MIDDLE,
682 NK_BUTTON_RIGHT,
683 NK_BUTTON_DOUBLE, /* Double click of the Left mouse button. */
684 NK_BUTTON_X1, /* Commonly used for "Back" in UI navigation. Mouse Button 4. */
685 NK_BUTTON_X2, /* Commonly used for "Forward" in UI navigation. Mouse Button 5. */
686 NK_BUTTON_MAX
687};
688
700NK_API void nk_input_begin(struct nk_context*);
701
714NK_API void nk_input_motion(struct nk_context*, int x, int y);
715
728NK_API void nk_input_key(struct nk_context*, enum nk_keys, nk_bool down);
729
744NK_API void nk_input_button(struct nk_context*, enum nk_buttons, int x, int y, nk_bool down);
745
760NK_API void nk_input_scroll(struct nk_context*, struct nk_vec2 val);
761
778NK_API void nk_input_char(struct nk_context*, char);
779
793NK_API void nk_input_glyph(struct nk_context*, const nk_glyph);
794
809NK_API void nk_input_unicode(struct nk_context*, nk_rune);
810
822NK_API void nk_input_end(struct nk_context*);
823
824/* =============================================================================
825 *
826 * DRAWING
827 *
828 * =============================================================================*/
1054
1055enum nk_anti_aliasing {NK_ANTI_ALIASING_OFF, NK_ANTI_ALIASING_ON};
1056enum nk_convert_result {
1057 NK_CONVERT_SUCCESS = 0,
1058 NK_CONVERT_INVALID_PARAM = 1,
1059 NK_CONVERT_COMMAND_BUFFER_FULL = NK_FLAG(1),
1060 NK_CONVERT_VERTEX_BUFFER_FULL = NK_FLAG(2),
1061 NK_CONVERT_ELEMENT_BUFFER_FULL = NK_FLAG(3)
1062};
1064 nk_handle texture;
1065 struct nk_vec2 uv;
1066};
1068 float global_alpha;
1069 enum nk_anti_aliasing line_AA;
1070 enum nk_anti_aliasing shape_AA;
1075 const struct nk_draw_vertex_layout_element *vertex_layout;
1076 nk_size vertex_size;
1078};
1079
1093NK_API const struct nk_command* nk__begin(struct nk_context*);
1094
1108NK_API const struct nk_command* nk__next(struct nk_context*, const struct nk_command*);
1109
1120#define nk_foreach(c, ctx) for((c) = nk__begin(ctx); (c) != 0; (c) = nk__next(ctx,c))
1121
1122#ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT
1123
1153NK_API nk_flags nk_convert(struct nk_context*, struct nk_buffer *cmds, struct nk_buffer *vertices, struct nk_buffer *elements, const struct nk_convert_config*);
1154
1168NK_API const struct nk_draw_command* nk__draw_begin(const struct nk_context*, const struct nk_buffer*);
1169
1187NK_API const struct nk_draw_command* nk__draw_end(const struct nk_context*, const struct nk_buffer*);
1188
1206NK_API const struct nk_draw_command* nk__draw_next(const struct nk_draw_command*, const struct nk_buffer*, const struct nk_context*);
1207
1222
1223#define nk_draw_foreach(cmd,ctx, b) for((cmd)=nk__draw_begin(ctx, b); (cmd)!=0; (cmd)=nk__draw_next(cmd, b, ctx))
1224#endif
1225
1226/* =============================================================================
1227 *
1228 * WINDOW
1229 *
1230 * =============================================================================*/
1378
1379enum nk_panel_flags {
1380 NK_WINDOW_BORDER = NK_FLAG(0),
1381 NK_WINDOW_MOVABLE = NK_FLAG(1),
1382 NK_WINDOW_SCALABLE = NK_FLAG(2),
1383 NK_WINDOW_CLOSABLE = NK_FLAG(3),
1384 NK_WINDOW_MINIMIZABLE = NK_FLAG(4),
1385 NK_WINDOW_NO_SCROLLBAR = NK_FLAG(5),
1386 NK_WINDOW_TITLE = NK_FLAG(6),
1387 NK_WINDOW_SCROLL_AUTO_HIDE = NK_FLAG(7),
1388 NK_WINDOW_BACKGROUND = NK_FLAG(8),
1389 NK_WINDOW_SCALE_LEFT = NK_FLAG(9),
1390 NK_WINDOW_NO_INPUT = NK_FLAG(10)
1391};
1392
1413NK_API nk_bool nk_begin(struct nk_context *ctx, const char *title, struct nk_rect bounds, nk_flags flags);
1414
1436NK_API nk_bool nk_begin_titled(struct nk_context *ctx, const char *name, const char *title, struct nk_rect bounds, nk_flags flags);
1437
1452NK_API void nk_end(struct nk_context *ctx);
1453
1470NK_API struct nk_window *nk_window_find(const struct nk_context *ctx, const char *name);
1471
1489NK_API struct nk_rect nk_window_get_bounds(const struct nk_context *ctx);
1490
1508NK_API struct nk_vec2 nk_window_get_position(const struct nk_context *ctx);
1509
1527NK_API struct nk_vec2 nk_window_get_size(const struct nk_context *ctx);
1528
1545NK_API float nk_window_get_width(const struct nk_context *ctx);
1546
1564NK_API float nk_window_get_height(const struct nk_context* ctx);
1565
1585NK_API struct nk_panel* nk_window_get_panel(const struct nk_context* ctx);
1586
1606NK_API struct nk_rect nk_window_get_content_region(const struct nk_context* ctx);
1607
1627NK_API struct nk_vec2 nk_window_get_content_region_min(const struct nk_context *ctx);
1628
1648NK_API struct nk_vec2 nk_window_get_content_region_max(const struct nk_context *ctx);
1649
1668NK_API struct nk_vec2 nk_window_get_content_region_size(const struct nk_context *ctx);
1669
1687NK_API struct nk_command_buffer* nk_window_get_canvas(const struct nk_context* ctx);
1688
1705NK_API void nk_window_get_scroll(const struct nk_context *ctx, nk_uint *offset_x, nk_uint *offset_y);
1706
1723NK_API nk_bool nk_window_has_focus(const struct nk_context *ctx);
1724
1741NK_API nk_bool nk_window_is_hovered(const struct nk_context *ctx);
1742
1759NK_API nk_bool nk_window_is_collapsed(const struct nk_context *ctx, const char *name);
1760
1776NK_API nk_bool nk_window_is_closed(const struct nk_context *ctx, const char* name);
1777
1793NK_API nk_bool nk_window_is_hidden(const struct nk_context *ctx, const char* name);
1794
1809NK_API nk_bool nk_window_is_active(const struct nk_context *ctx, const char* name);
1810
1824NK_API nk_bool nk_window_is_any_hovered(const struct nk_context *ctx);
1825
1842NK_API nk_bool nk_item_is_any_active(const struct nk_context *ctx);
1843
1858NK_API void nk_window_set_bounds(struct nk_context *ctx, const char *name, struct nk_rect bounds);
1859
1874NK_API void nk_window_set_position(struct nk_context *ctx, const char *name, struct nk_vec2 pos);
1875
1890NK_API void nk_window_set_size(struct nk_context *ctx, const char *name, struct nk_vec2 size);
1891
1905NK_API void nk_window_set_focus(struct nk_context *ctx, const char *name);
1906
1923NK_API void nk_window_set_scroll(struct nk_context *ctx, nk_uint offset_x, nk_uint offset_y);
1924
1938NK_API void nk_window_close(struct nk_context *ctx, const char *name);
1939
1954NK_API void nk_window_collapse(struct nk_context *ctx, const char *name, enum nk_collapse_states state);
1955
1971NK_API void nk_window_collapse_if(struct nk_context *ctx, const char *name, enum nk_collapse_states state, int cond);
1972
1986NK_API void nk_window_show(struct nk_context *ctx, const char *name, enum nk_show_states state);
1987
2003NK_API void nk_window_show_if(struct nk_context *ctx, const char *name, enum nk_show_states state, int cond);
2004
2018NK_API void nk_rule_horizontal(struct nk_context *ctx, struct nk_color color, nk_bool rounding);
2019
2020/* =============================================================================
2021 *
2022 * LAYOUT
2023 *
2024 * =============================================================================*/
2289
2290
2291
2292enum nk_widget_align {
2293 NK_WIDGET_ALIGN_LEFT = 0x01,
2294 NK_WIDGET_ALIGN_CENTERED = 0x02,
2295 NK_WIDGET_ALIGN_RIGHT = 0x04,
2296 NK_WIDGET_ALIGN_TOP = 0x08,
2297 NK_WIDGET_ALIGN_MIDDLE = 0x10,
2298 NK_WIDGET_ALIGN_BOTTOM = 0x20
2299};
2300enum nk_widget_alignment {
2301 NK_WIDGET_LEFT = NK_WIDGET_ALIGN_MIDDLE|NK_WIDGET_ALIGN_LEFT,
2302 NK_WIDGET_CENTERED = NK_WIDGET_ALIGN_MIDDLE|NK_WIDGET_ALIGN_CENTERED,
2303 NK_WIDGET_RIGHT = NK_WIDGET_ALIGN_MIDDLE|NK_WIDGET_ALIGN_RIGHT
2304};
2305
2318NK_API void nk_layout_set_min_row_height(struct nk_context*, float height);
2319
2328NK_API void nk_layout_reset_min_row_height(struct nk_context*);
2329
2342NK_API struct nk_rect nk_layout_widget_bounds(const struct nk_context *ctx);
2343
2357NK_API float nk_layout_ratio_from_pixel(const struct nk_context *ctx, float pixel_width);
2358
2373NK_API void nk_layout_row_dynamic(struct nk_context *ctx, float height, int cols);
2374
2390NK_API void nk_layout_row_static(struct nk_context *ctx, float height, int item_width, int cols);
2391
2405NK_API void nk_layout_row_begin(struct nk_context *ctx, enum nk_layout_format fmt, float row_height, int cols);
2406
2418NK_API void nk_layout_row_push(struct nk_context*, float value);
2419
2430NK_API void nk_layout_row_end(struct nk_context*);
2431
2445NK_API void nk_layout_row(struct nk_context*, enum nk_layout_format, float height, int cols, const float *ratio);
2446
2459NK_API void nk_layout_row_template_begin(struct nk_context*, float row_height);
2460
2473NK_API void nk_layout_row_template_push_dynamic(struct nk_context*);
2474
2487NK_API void nk_layout_row_template_push_variable(struct nk_context*, float min_width);
2488
2501NK_API void nk_layout_row_template_push_static(struct nk_context*, float width);
2502
2514NK_API void nk_layout_row_template_end(struct nk_context*);
2515
2530NK_API void nk_layout_space_begin(struct nk_context*, enum nk_layout_format, float height, int widget_count);
2531
2544NK_API void nk_layout_space_push(struct nk_context*, struct nk_rect bounds);
2545
2557NK_API void nk_layout_space_end(struct nk_context*);
2558
2572NK_API struct nk_rect nk_layout_space_bounds(const struct nk_context *ctx);
2573
2588NK_API struct nk_vec2 nk_layout_space_to_screen(const struct nk_context* ctx, struct nk_vec2 vec);
2589
2604NK_API struct nk_vec2 nk_layout_space_to_local(const struct nk_context *ctx, struct nk_vec2 vec);
2605
2620NK_API struct nk_rect nk_layout_space_rect_to_screen(const struct nk_context *ctx, struct nk_rect bounds);
2621
2636NK_API struct nk_rect nk_layout_space_rect_to_local(const struct nk_context *ctx, struct nk_rect bounds);
2637
2650NK_API void nk_spacer(struct nk_context *ctx);
2651
2652
2653/* =============================================================================
2654 *
2655 * GROUP
2656 *
2657 * =============================================================================*/
2742
2757NK_API nk_bool nk_group_begin(struct nk_context*, const char *title, nk_flags);
2758
2772NK_API nk_bool nk_group_begin_titled(struct nk_context*, const char *name, const char *title, nk_flags);
2773
2785NK_API void nk_group_end(struct nk_context*);
2786
2805NK_API nk_bool nk_group_scrolled_offset_begin(struct nk_context*, nk_uint *x_offset, nk_uint *y_offset, const char *title, nk_flags flags);
2806
2824NK_API nk_bool nk_group_scrolled_begin(struct nk_context*, struct nk_scroll *off, const char *title, nk_flags);
2825
2837NK_API void nk_group_scrolled_end(struct nk_context*);
2838
2853NK_API void nk_group_get_scroll(struct nk_context*, const char *id, nk_uint *x_offset, nk_uint *y_offset);
2854
2869NK_API void nk_group_set_scroll(struct nk_context*, const char *id, nk_uint x_offset, nk_uint y_offset);
2870
2871/* =============================================================================
2872 *
2873 * TREE
2874 *
2875 * =============================================================================*/
2940
2962#define nk_tree_push(ctx, type, title, state) nk_tree_push_hashed(ctx, type, title, state, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),__LINE__)
2963
2981#define nk_tree_push_id(ctx, type, title, state, id) nk_tree_push_hashed(ctx, type, title, state, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),id)
2982
3003NK_API nk_bool nk_tree_push_hashed(struct nk_context*, enum nk_tree_type, const char *title, enum nk_collapse_states initial_state, const char *hash, int len,int seed);
3004
3026#define nk_tree_image_push(ctx, type, img, title, state) nk_tree_image_push_hashed(ctx, type, img, title, state, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),__LINE__)
3027
3048#define nk_tree_image_push_id(ctx, type, img, title, state, id) nk_tree_image_push_hashed(ctx, type, img, title, state, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),id)
3049
3071NK_API nk_bool nk_tree_image_push_hashed(struct nk_context*, enum nk_tree_type, struct nk_image, const char *title, enum nk_collapse_states initial_state, const char *hash, int len,int seed);
3072
3084NK_API void nk_tree_pop(struct nk_context*);
3085
3102NK_API nk_bool nk_tree_state_push(struct nk_context*, enum nk_tree_type, const char *title, enum nk_collapse_states *state);
3103
3121NK_API nk_bool nk_tree_state_image_push(struct nk_context*, enum nk_tree_type, struct nk_image, const char *title, enum nk_collapse_states *state);
3122
3134NK_API void nk_tree_state_pop(struct nk_context*);
3135
3136#define nk_tree_element_push(ctx, type, title, state, sel) nk_tree_element_push_hashed(ctx, type, title, state, sel, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),__LINE__)
3137#define nk_tree_element_push_id(ctx, type, title, state, sel, id) nk_tree_element_push_hashed(ctx, type, title, state, sel, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),id)
3138NK_API nk_bool nk_tree_element_push_hashed(struct nk_context*, enum nk_tree_type, const char *title, enum nk_collapse_states initial_state, nk_bool *selected, const char *hash, int len, int seed);
3139NK_API nk_bool nk_tree_element_image_push_hashed(struct nk_context*, enum nk_tree_type, struct nk_image, const char *title, enum nk_collapse_states initial_state, nk_bool *selected, const char *hash, int len,int seed);
3140NK_API void nk_tree_element_pop(struct nk_context*);
3141
3142/* =============================================================================
3143 *
3144 * LIST VIEW
3145 *
3146 * ============================================================================= */
3148/* public: */
3149 int begin, end, count;
3150/* private: */
3151 int total_height;
3152 struct nk_context *ctx;
3153 nk_uint *scroll_pointer;
3154 nk_uint scroll_value;
3155};
3156NK_API nk_bool nk_list_view_begin(struct nk_context*, struct nk_list_view *out, const char *id, nk_flags, int row_height, int row_count);
3157NK_API void nk_list_view_end(struct nk_list_view*);
3158/* =============================================================================
3159 *
3160 * WIDGET
3161 *
3162 * ============================================================================= */
3163enum nk_widget_layout_states {
3164 NK_WIDGET_INVALID,
3165 NK_WIDGET_VALID,
3166 NK_WIDGET_ROM,
3167 NK_WIDGET_DISABLED
3168};
3169enum nk_widget_states {
3170 NK_WIDGET_STATE_MODIFIED = NK_FLAG(1),
3171 NK_WIDGET_STATE_INACTIVE = NK_FLAG(2),
3172 NK_WIDGET_STATE_ENTERED = NK_FLAG(3),
3173 NK_WIDGET_STATE_HOVER = NK_FLAG(4),
3174 NK_WIDGET_STATE_ACTIVED = NK_FLAG(5),
3175 NK_WIDGET_STATE_LEFT = NK_FLAG(6),
3176 NK_WIDGET_STATE_HOVERED = NK_WIDGET_STATE_HOVER|NK_WIDGET_STATE_MODIFIED,
3177 NK_WIDGET_STATE_ACTIVE = NK_WIDGET_STATE_ACTIVED|NK_WIDGET_STATE_MODIFIED
3178};
3179NK_API enum nk_widget_layout_states nk_widget(struct nk_rect*, const struct nk_context*);
3180#define nk_widget_fitting(bounds, ctx, padding) nk_widget(bounds, ctx)
3181NK_API struct nk_rect nk_widget_bounds(const struct nk_context*);
3182NK_API struct nk_vec2 nk_widget_position(const struct nk_context*);
3183NK_API struct nk_vec2 nk_widget_size(const struct nk_context*);
3184NK_API float nk_widget_width(const struct nk_context*);
3185NK_API float nk_widget_height(const struct nk_context*);
3186NK_API nk_bool nk_widget_is_hovered(const struct nk_context*);
3187NK_API nk_bool nk_widget_is_mouse_clicked(const struct nk_context*, enum nk_buttons);
3188NK_API nk_bool nk_widget_has_mouse_click_down(const struct nk_context*, enum nk_buttons, nk_bool down);
3189NK_API void nk_spacing(struct nk_context*, int cols);
3190NK_API void nk_widget_disable_begin(struct nk_context* ctx);
3191NK_API void nk_widget_disable_end(struct nk_context* ctx);
3192/* =============================================================================
3193 *
3194 * TEXT
3195 *
3196 * ============================================================================= */
3197enum nk_text_align {
3198 NK_TEXT_ALIGN_LEFT = 0x01,
3199 NK_TEXT_ALIGN_CENTERED = 0x02,
3200 NK_TEXT_ALIGN_RIGHT = 0x04,
3201 NK_TEXT_ALIGN_TOP = 0x08,
3202 NK_TEXT_ALIGN_MIDDLE = 0x10,
3203 NK_TEXT_ALIGN_BOTTOM = 0x20
3204};
3205enum nk_text_alignment {
3206 NK_TEXT_LEFT = NK_TEXT_ALIGN_MIDDLE|NK_TEXT_ALIGN_LEFT,
3207 NK_TEXT_CENTERED = NK_TEXT_ALIGN_MIDDLE|NK_TEXT_ALIGN_CENTERED,
3208 NK_TEXT_RIGHT = NK_TEXT_ALIGN_MIDDLE|NK_TEXT_ALIGN_RIGHT
3209};
3210NK_API void nk_text(struct nk_context*, const char*, int, nk_flags);
3211NK_API void nk_text_colored(struct nk_context*, const char*, int, nk_flags, struct nk_color);
3212NK_API void nk_text_wrap(struct nk_context*, const char*, int);
3213NK_API void nk_text_wrap_colored(struct nk_context*, const char*, int, struct nk_color);
3214NK_API void nk_label(struct nk_context*, const char*, nk_flags align);
3215NK_API void nk_label_colored(struct nk_context*, const char*, nk_flags align, struct nk_color);
3216NK_API void nk_label_wrap(struct nk_context*, const char*);
3217NK_API void nk_label_colored_wrap(struct nk_context*, const char*, struct nk_color);
3218NK_API void nk_image(struct nk_context*, struct nk_image);
3219NK_API void nk_image_color(struct nk_context*, struct nk_image, struct nk_color);
3220#ifdef NK_INCLUDE_STANDARD_VARARGS
3221NK_API void nk_labelf(struct nk_context*, nk_flags, NK_PRINTF_FORMAT_STRING const char*, ...) NK_PRINTF_VARARG_FUNC(3);
3222NK_API void nk_labelf_colored(struct nk_context*, nk_flags, struct nk_color, NK_PRINTF_FORMAT_STRING const char*,...) NK_PRINTF_VARARG_FUNC(4);
3223NK_API void nk_labelf_wrap(struct nk_context*, NK_PRINTF_FORMAT_STRING const char*,...) NK_PRINTF_VARARG_FUNC(2);
3224NK_API void nk_labelf_colored_wrap(struct nk_context*, struct nk_color, NK_PRINTF_FORMAT_STRING const char*,...) NK_PRINTF_VARARG_FUNC(3);
3225NK_API void nk_labelfv(struct nk_context*, nk_flags, NK_PRINTF_FORMAT_STRING const char*, va_list) NK_PRINTF_VALIST_FUNC(3);
3226NK_API void nk_labelfv_colored(struct nk_context*, nk_flags, struct nk_color, NK_PRINTF_FORMAT_STRING const char*, va_list) NK_PRINTF_VALIST_FUNC(4);
3227NK_API void nk_labelfv_wrap(struct nk_context*, NK_PRINTF_FORMAT_STRING const char*, va_list) NK_PRINTF_VALIST_FUNC(2);
3228NK_API void nk_labelfv_colored_wrap(struct nk_context*, struct nk_color, NK_PRINTF_FORMAT_STRING const char*, va_list) NK_PRINTF_VALIST_FUNC(3);
3229NK_API void nk_value_bool(struct nk_context*, const char *prefix, int);
3230NK_API void nk_value_int(struct nk_context*, const char *prefix, int);
3231NK_API void nk_value_uint(struct nk_context*, const char *prefix, unsigned int);
3232NK_API void nk_value_float(struct nk_context*, const char *prefix, float);
3233NK_API void nk_value_color_byte(struct nk_context*, const char *prefix, struct nk_color);
3234NK_API void nk_value_color_float(struct nk_context*, const char *prefix, struct nk_color);
3235NK_API void nk_value_color_hex(struct nk_context*, const char *prefix, struct nk_color);
3236#endif
3237/* =============================================================================
3238 *
3239 * LINK
3240 *
3241 * ============================================================================= */
3242NK_API nk_bool nk_link_text(struct nk_context*, const char *title, int len, nk_flags align);
3243NK_API nk_bool nk_link_label(struct nk_context*, const char *title, nk_flags align);
3244NK_API nk_bool nk_link_text_styled(struct nk_context*, const struct nk_style_link*, const char *title, int len, nk_flags align);
3245NK_API nk_bool nk_link_label_styled(struct nk_context*, const struct nk_style_link*, const char *title, nk_flags align);
3246NK_API nk_bool nk_link_text_underline(struct nk_context*, const char *title, int len, nk_flags align, enum nk_link_underline);
3247NK_API nk_bool nk_link_label_underline(struct nk_context*, const char *title, nk_flags align, enum nk_link_underline);
3248NK_API nk_bool nk_link_text_hover_underline(struct nk_context*, const char *title, int len, nk_flags align);
3249NK_API nk_bool nk_link_label_hover_underline(struct nk_context*, const char *title, nk_flags align);
3250NK_API nk_bool nk_link_text_no_underline(struct nk_context*, const char *title, int len, nk_flags align);
3251NK_API nk_bool nk_link_label_no_underline(struct nk_context*, const char *title, nk_flags align);
3252NK_API nk_bool nk_link_text_colored(struct nk_context*, const char *title, int len, nk_flags align, struct nk_color);
3253NK_API nk_bool nk_link_label_colored(struct nk_context*, const char *title, nk_flags align, struct nk_color);
3254/* =============================================================================
3255 *
3256 * BUTTON
3257 *
3258 * ============================================================================= */
3259NK_API nk_bool nk_button_text(struct nk_context*, const char *title, int len);
3260NK_API nk_bool nk_button_label(struct nk_context*, const char *title);
3261NK_API nk_bool nk_button_color(struct nk_context*, struct nk_color);
3262NK_API nk_bool nk_button_symbol(struct nk_context*, enum nk_symbol_type);
3263NK_API nk_bool nk_button_image(struct nk_context*, struct nk_image img);
3264NK_API nk_bool nk_button_symbol_label(struct nk_context*, enum nk_symbol_type, const char*, nk_flags text_alignment);
3265NK_API nk_bool nk_button_symbol_text(struct nk_context*, enum nk_symbol_type, const char*, int, nk_flags alignment);
3266NK_API nk_bool nk_button_image_label(struct nk_context*, struct nk_image img, const char*, nk_flags text_alignment);
3267NK_API nk_bool nk_button_image_text(struct nk_context*, struct nk_image img, const char*, int, nk_flags alignment);
3268NK_API nk_bool nk_button_text_styled(struct nk_context*, const struct nk_style_button*, const char *title, int len);
3269NK_API nk_bool nk_button_label_styled(struct nk_context*, const struct nk_style_button*, const char *title);
3270NK_API nk_bool nk_button_symbol_styled(struct nk_context*, const struct nk_style_button*, enum nk_symbol_type);
3271NK_API nk_bool nk_button_image_styled(struct nk_context*, const struct nk_style_button*, struct nk_image img);
3272NK_API nk_bool nk_button_symbol_text_styled(struct nk_context*,const struct nk_style_button*, enum nk_symbol_type, const char*, int, nk_flags alignment);
3273NK_API nk_bool nk_button_symbol_label_styled(struct nk_context *ctx, const struct nk_style_button *style, enum nk_symbol_type symbol, const char *title, nk_flags align);
3274NK_API nk_bool nk_button_image_label_styled(struct nk_context*,const struct nk_style_button*, struct nk_image img, const char*, nk_flags text_alignment);
3275NK_API nk_bool nk_button_image_text_styled(struct nk_context*,const struct nk_style_button*, struct nk_image img, const char*, int, nk_flags alignment);
3276NK_API void nk_button_set_behavior(struct nk_context*, enum nk_button_behavior);
3277NK_API nk_bool nk_button_push_behavior(struct nk_context*, enum nk_button_behavior);
3278NK_API nk_bool nk_button_pop_behavior(struct nk_context*);
3279/* =============================================================================
3280 *
3281 * CHECKBOX
3282 *
3283 * ============================================================================= */
3284NK_API nk_bool nk_check_label(struct nk_context*, const char*, nk_bool active);
3285NK_API nk_bool nk_check_text(struct nk_context*, const char*, int, nk_bool active);
3286NK_API nk_bool nk_check_text_align(struct nk_context*, const char*, int, nk_bool active, nk_flags widget_alignment, nk_flags text_alignment);
3287NK_API unsigned nk_check_flags_label(struct nk_context*, const char*, unsigned int flags, unsigned int value);
3288NK_API unsigned nk_check_flags_text(struct nk_context*, const char*, int, unsigned int flags, unsigned int value);
3289NK_API nk_bool nk_checkbox_label(struct nk_context*, const char*, nk_bool *active);
3290NK_API nk_bool nk_checkbox_label_align(struct nk_context *ctx, const char *label, nk_bool *active, nk_flags widget_alignment, nk_flags text_alignment);
3291NK_API nk_bool nk_checkbox_text(struct nk_context*, const char*, int, nk_bool *active);
3292NK_API nk_bool nk_checkbox_text_align(struct nk_context *ctx, const char *text, int len, nk_bool *active, nk_flags widget_alignment, nk_flags text_alignment);
3293NK_API nk_bool nk_checkbox_flags_label(struct nk_context*, const char*, unsigned int *flags, unsigned int value);
3294NK_API nk_bool nk_checkbox_flags_text(struct nk_context*, const char*, int, unsigned int *flags, unsigned int value);
3295/* =============================================================================
3296 *
3297 * RADIO BUTTON
3298 *
3299 * ============================================================================= */
3300NK_API nk_bool nk_radio_label(struct nk_context*, const char*, nk_bool *active);
3301NK_API nk_bool nk_radio_label_align(struct nk_context *ctx, const char *label, nk_bool *active, nk_flags widget_alignment, nk_flags text_alignment);
3302NK_API nk_bool nk_radio_text(struct nk_context*, const char*, int, nk_bool *active);
3303NK_API nk_bool nk_radio_text_align(struct nk_context *ctx, const char *text, int len, nk_bool *active, nk_flags widget_alignment, nk_flags text_alignment);
3304NK_API nk_bool nk_option_label(struct nk_context*, const char*, nk_bool active);
3305NK_API nk_bool nk_option_label_align(struct nk_context *ctx, const char *label, nk_bool active, nk_flags widget_alignment, nk_flags text_alignment);
3306NK_API nk_bool nk_option_text(struct nk_context*, const char*, int, nk_bool active);
3307NK_API nk_bool nk_option_text_align(struct nk_context *ctx, const char *text, int len, nk_bool is_active, nk_flags widget_alignment, nk_flags text_alignment);
3308/* =============================================================================
3309 *
3310 * SELECTABLE
3311 *
3312 * ============================================================================= */
3313NK_API nk_bool nk_selectable_label(struct nk_context*, const char*, nk_flags align, nk_bool *value);
3314NK_API nk_bool nk_selectable_text(struct nk_context*, const char*, int, nk_flags align, nk_bool *value);
3315NK_API nk_bool nk_selectable_image_label(struct nk_context*,struct nk_image, const char*, nk_flags align, nk_bool *value);
3316NK_API nk_bool nk_selectable_image_text(struct nk_context*,struct nk_image, const char*, int, nk_flags align, nk_bool *value);
3317NK_API nk_bool nk_selectable_symbol_label(struct nk_context*,enum nk_symbol_type, const char*, nk_flags align, nk_bool *value);
3318NK_API nk_bool nk_selectable_symbol_text(struct nk_context*,enum nk_symbol_type, const char*, int, nk_flags align, nk_bool *value);
3319
3320NK_API nk_bool nk_select_label(struct nk_context*, const char*, nk_flags align, nk_bool value);
3321NK_API nk_bool nk_select_text(struct nk_context*, const char*, int, nk_flags align, nk_bool value);
3322NK_API nk_bool nk_select_image_label(struct nk_context*, struct nk_image,const char*, nk_flags align, nk_bool value);
3323NK_API nk_bool nk_select_image_text(struct nk_context*, struct nk_image,const char*, int, nk_flags align, nk_bool value);
3324NK_API nk_bool nk_select_symbol_label(struct nk_context*,enum nk_symbol_type, const char*, nk_flags align, nk_bool value);
3325NK_API nk_bool nk_select_symbol_text(struct nk_context*,enum nk_symbol_type, const char*, int, nk_flags align, nk_bool value);
3326
3327/* =============================================================================
3328 *
3329 * SLIDER
3330 *
3331 * ============================================================================= */
3332NK_API float nk_slide_float(struct nk_context*, float min, float val, float max, float step);
3333NK_API int nk_slide_int(struct nk_context*, int min, int val, int max, int step);
3334NK_API nk_bool nk_slider_float(struct nk_context*, float min, float *val, float max, float step);
3335NK_API nk_bool nk_slider_int(struct nk_context*, int min, int *val, int max, int step);
3336
3337/* =============================================================================
3338 *
3339 * KNOB
3340 *
3341 * ============================================================================= */
3342NK_API nk_bool nk_knob_float(struct nk_context*, float min, float *val, float max, float step, enum nk_heading zero_direction, float dead_zone_degrees);
3343NK_API nk_bool nk_knob_int(struct nk_context*, int min, int *val, int max, int step, enum nk_heading zero_direction, float dead_zone_degrees);
3344
3345/* =============================================================================
3346 *
3347 * PROGRESSBAR
3348 *
3349 * ============================================================================= */
3350NK_API nk_bool nk_progress(struct nk_context*, nk_size *cur, nk_size max, nk_bool modifyable);
3351NK_API nk_size nk_prog(struct nk_context*, nk_size cur, nk_size max, nk_bool modifyable);
3352
3353/* =============================================================================
3354 *
3355 * COLOR PICKER
3356 *
3357 * ============================================================================= */
3358NK_API struct nk_colorf nk_color_picker(struct nk_context*, struct nk_colorf, enum nk_color_format);
3359NK_API nk_bool nk_color_pick(struct nk_context*, struct nk_colorf*, enum nk_color_format);
3360/* =============================================================================
3361 *
3362 * PROPERTIES
3363 *
3364 * =============================================================================*/
3458NK_API nk_bool nk_property_int(struct nk_context*, const char *name, int min, int *val, int max, int step, float inc_per_pixel);
3459
3482NK_API nk_bool nk_property_float(struct nk_context*, const char *name, float min, float *val, float max, float step, float inc_per_pixel);
3483
3506NK_API nk_bool nk_property_double(struct nk_context*, const char *name, double min, double *val, double max, double step, float inc_per_pixel);
3507
3528NK_API int nk_propertyi(struct nk_context*, const char *name, int min, int val, int max, int step, float inc_per_pixel);
3529
3550NK_API float nk_propertyf(struct nk_context*, const char *name, float min, float val, float max, float step, float inc_per_pixel);
3551
3572NK_API double nk_propertyd(struct nk_context*, const char *name, double min, double val, double max, double step, float inc_per_pixel);
3573
3574/* =============================================================================
3575 *
3576 * TEXT EDIT
3577 *
3578 * ============================================================================= */
3579enum nk_edit_flags {
3580 NK_EDIT_DEFAULT = 0,
3581 NK_EDIT_READ_ONLY = NK_FLAG(0),
3582 NK_EDIT_AUTO_SELECT = NK_FLAG(1),
3583 NK_EDIT_SIG_ENTER = NK_FLAG(2),
3584 NK_EDIT_ALLOW_TAB = NK_FLAG(3),
3585 NK_EDIT_NO_CURSOR = NK_FLAG(4),
3586 NK_EDIT_SELECTABLE = NK_FLAG(5),
3587 NK_EDIT_CLIPBOARD = NK_FLAG(6),
3588 NK_EDIT_CTRL_ENTER_NEWLINE = NK_FLAG(7),
3589 NK_EDIT_NO_HORIZONTAL_SCROLL = NK_FLAG(8),
3590 NK_EDIT_ALWAYS_INSERT_MODE = NK_FLAG(9),
3591 NK_EDIT_MULTILINE = NK_FLAG(10),
3592 NK_EDIT_GOTO_END_ON_ACTIVATE = NK_FLAG(11)
3593};
3594enum nk_edit_types {
3595 NK_EDIT_SIMPLE = NK_EDIT_ALWAYS_INSERT_MODE,
3596 NK_EDIT_FIELD = NK_EDIT_SIMPLE|NK_EDIT_SELECTABLE|NK_EDIT_CLIPBOARD,
3597 NK_EDIT_BOX = NK_EDIT_ALWAYS_INSERT_MODE| NK_EDIT_SELECTABLE| NK_EDIT_MULTILINE|NK_EDIT_ALLOW_TAB|NK_EDIT_CLIPBOARD,
3598 NK_EDIT_EDITOR = NK_EDIT_SELECTABLE|NK_EDIT_MULTILINE|NK_EDIT_ALLOW_TAB| NK_EDIT_CLIPBOARD
3599};
3600enum nk_edit_events {
3601 NK_EDIT_ACTIVE = NK_FLAG(0),
3602 NK_EDIT_INACTIVE = NK_FLAG(1),
3603 NK_EDIT_ACTIVATED = NK_FLAG(2),
3604 NK_EDIT_DEACTIVATED = NK_FLAG(3),
3605 NK_EDIT_COMMITTED = NK_FLAG(4)
3606};
3607
3608#define NK_EDIT_COMMITED NK_EDIT_COMMITTED
3609
3610NK_API nk_flags nk_edit_string(struct nk_context*, nk_flags, char *buffer, int *len, int max, nk_plugin_filter);
3611NK_API nk_flags nk_edit_string_zero_terminated(struct nk_context*, nk_flags, char *buffer, int max, nk_plugin_filter);
3612NK_API nk_flags nk_edit_buffer(struct nk_context*, nk_flags, struct nk_text_edit*, nk_plugin_filter);
3613NK_API void nk_edit_focus(struct nk_context*, nk_flags flags);
3614NK_API void nk_edit_unfocus(struct nk_context*);
3615/* =============================================================================
3616 *
3617 * CHART
3618 *
3619 * ============================================================================= */
3620NK_API nk_bool nk_chart_begin(struct nk_context*, enum nk_chart_type, int num, float min, float max);
3621NK_API nk_bool nk_chart_begin_colored(struct nk_context*, enum nk_chart_type, struct nk_color, struct nk_color active, int num, float min, float max);
3622NK_API void nk_chart_add_slot(struct nk_context *ctx, const enum nk_chart_type, int count, float min_value, float max_value);
3623NK_API void nk_chart_add_slot_colored(struct nk_context *ctx, const enum nk_chart_type, struct nk_color, struct nk_color active, int count, float min_value, float max_value);
3624NK_API nk_flags nk_chart_push(struct nk_context*, float);
3625NK_API nk_flags nk_chart_push_slot(struct nk_context*, float, int);
3626NK_API void nk_chart_end(struct nk_context*);
3627NK_API void nk_plot(struct nk_context*, enum nk_chart_type, const float *values, int count, int offset);
3628NK_API void nk_plot_function(struct nk_context*, enum nk_chart_type, void *userdata, float(*value_getter)(void* user, int index), int count, int offset);
3629/* =============================================================================
3630 *
3631 * POPUP
3632 *
3633 * ============================================================================= */
3634NK_API nk_bool nk_popup_begin(struct nk_context*, enum nk_popup_type, const char*, nk_flags, struct nk_rect bounds);
3635NK_API void nk_popup_close(struct nk_context*);
3636NK_API void nk_popup_end(struct nk_context*);
3637NK_API void nk_popup_get_scroll(const struct nk_context*, nk_uint *offset_x, nk_uint *offset_y);
3638NK_API void nk_popup_set_scroll(struct nk_context*, nk_uint offset_x, nk_uint offset_y);
3639/* =============================================================================
3640 *
3641 * COMBOBOX
3642 *
3643 * ============================================================================= */
3644NK_API int nk_combo(struct nk_context*, const char *const *items, int count, int selected, int item_height, struct nk_vec2 size);
3645NK_API int nk_combo_separator(struct nk_context*, const char *items_separated_by_separator, int separator, int selected, int count, int item_height, struct nk_vec2 size);
3646NK_API int nk_combo_string(struct nk_context*, const char *items_separated_by_zeros, int selected, int count, int item_height, struct nk_vec2 size);
3647NK_API int nk_combo_callback(struct nk_context*, void(*item_getter)(void*, int, const char**), void *userdata, int selected, int count, int item_height, struct nk_vec2 size);
3648NK_API nk_bool nk_combobox(struct nk_context*, const char *const *items, int count, int *selected, int item_height, struct nk_vec2 size);
3649NK_API nk_bool nk_combobox_string(struct nk_context*, const char *items_separated_by_zeros, int *selected, int count, int item_height, struct nk_vec2 size);
3650NK_API nk_bool nk_combobox_separator(struct nk_context*, const char *items_separated_by_separator, int separator, int *selected, int count, int item_height, struct nk_vec2 size);
3651NK_API nk_bool nk_combobox_callback(struct nk_context*, void(*item_getter)(void*, int, const char**), void*, int *selected, int count, int item_height, struct nk_vec2 size);
3652/* =============================================================================
3653 *
3654 * ABSTRACT COMBOBOX
3655 *
3656 * ============================================================================= */
3657NK_API nk_bool nk_combo_begin_text(struct nk_context*, const char *selected, int, struct nk_vec2 size);
3658NK_API nk_bool nk_combo_begin_label(struct nk_context*, const char *selected, struct nk_vec2 size);
3659NK_API nk_bool nk_combo_begin_color(struct nk_context*, struct nk_color color, struct nk_vec2 size);
3660NK_API nk_bool nk_combo_begin_symbol(struct nk_context*, enum nk_symbol_type, struct nk_vec2 size);
3661NK_API nk_bool nk_combo_begin_symbol_label(struct nk_context*, const char *selected, enum nk_symbol_type, struct nk_vec2 size);
3662NK_API nk_bool nk_combo_begin_symbol_text(struct nk_context*, const char *selected, int, enum nk_symbol_type, struct nk_vec2 size);
3663NK_API nk_bool nk_combo_begin_image(struct nk_context*, struct nk_image img, struct nk_vec2 size);
3664NK_API nk_bool nk_combo_begin_image_label(struct nk_context*, const char *selected, struct nk_image, struct nk_vec2 size);
3665NK_API nk_bool nk_combo_begin_image_text(struct nk_context*, const char *selected, int, struct nk_image, struct nk_vec2 size);
3666NK_API nk_bool nk_combo_item_label(struct nk_context*, const char*, nk_flags alignment);
3667NK_API nk_bool nk_combo_item_text(struct nk_context*, const char*,int, nk_flags alignment);
3668NK_API nk_bool nk_combo_item_image_label(struct nk_context*, struct nk_image, const char*, nk_flags alignment);
3669NK_API nk_bool nk_combo_item_image_text(struct nk_context*, struct nk_image, const char*, int,nk_flags alignment);
3670NK_API nk_bool nk_combo_item_symbol_label(struct nk_context*, enum nk_symbol_type, const char*, nk_flags alignment);
3671NK_API nk_bool nk_combo_item_symbol_text(struct nk_context*, enum nk_symbol_type, const char*, int, nk_flags alignment);
3672NK_API void nk_combo_close(struct nk_context*);
3673NK_API void nk_combo_end(struct nk_context*);
3674/* =============================================================================
3675 *
3676 * CONTEXTUAL
3677 *
3678 * ============================================================================= */
3679NK_API nk_bool nk_contextual_begin(struct nk_context*, nk_flags, struct nk_vec2, struct nk_rect trigger_bounds);
3680NK_API nk_bool nk_contextual_item_text(struct nk_context*, const char*, int,nk_flags align);
3681NK_API nk_bool nk_contextual_item_label(struct nk_context*, const char*, nk_flags align);
3682NK_API nk_bool nk_contextual_item_image_label(struct nk_context*, struct nk_image, const char*, nk_flags alignment);
3683NK_API nk_bool nk_contextual_item_image_text(struct nk_context*, struct nk_image, const char*, int len, nk_flags alignment);
3684NK_API nk_bool nk_contextual_item_symbol_label(struct nk_context*, enum nk_symbol_type, const char*, nk_flags alignment);
3685NK_API nk_bool nk_contextual_item_symbol_text(struct nk_context*, enum nk_symbol_type, const char*, int, nk_flags alignment);
3686NK_API void nk_contextual_close(struct nk_context*);
3687NK_API void nk_contextual_end(struct nk_context*);
3688/* =============================================================================
3689 *
3690 * TOOLTIP
3691 *
3692 * ============================================================================= */
3693NK_API void nk_tooltip(struct nk_context*, const char*);
3694NK_API void nk_tooltip_offset(struct nk_context *ctx, const char *text, enum nk_tooltip_pos position, struct nk_vec2 offset);
3695NK_API void nk_do_tooltip(struct nk_context*, const char*, struct nk_rect);
3696NK_API void nk_do_tooltip_delay(struct nk_context*, const char*, struct nk_rect, float*);
3697NK_API void nk_do_tooltip_delay_clicked(struct nk_context*, const char*, struct nk_rect, float* timer, nk_bool*);
3698#ifdef NK_INCLUDE_STANDARD_VARARGS
3699NK_API void nk_tooltipf(struct nk_context*, NK_PRINTF_FORMAT_STRING const char*, ...) NK_PRINTF_VARARG_FUNC(2);
3700NK_API void nk_tooltipfv(struct nk_context*, NK_PRINTF_FORMAT_STRING const char*, va_list) NK_PRINTF_VALIST_FUNC(2);
3701NK_API void nk_tooltipf_offset(struct nk_context*, enum nk_tooltip_pos, struct nk_vec2, NK_PRINTF_FORMAT_STRING const char*, ...) NK_PRINTF_VARARG_FUNC(4);
3702NK_API void nk_tooltipfv_offset(struct nk_context*, enum nk_tooltip_pos, struct nk_vec2, NK_PRINTF_FORMAT_STRING const char*, va_list) NK_PRINTF_VALIST_FUNC(4);
3703#endif
3704NK_API nk_bool nk_tooltip_begin(struct nk_context*, float width);
3705NK_API nk_bool nk_tooltip_begin_offset(struct nk_context*, float, enum nk_tooltip_pos, struct nk_vec2);
3706NK_API void nk_tooltip_end(struct nk_context*);
3707/* =============================================================================
3708 *
3709 * MENU
3710 *
3711 * ============================================================================= */
3712NK_API void nk_menubar_begin(struct nk_context*);
3713NK_API void nk_menubar_end(struct nk_context*);
3714NK_API nk_bool nk_menu_begin_text(struct nk_context*, const char* title, int title_len, nk_flags align, struct nk_vec2 size);
3715NK_API nk_bool nk_menu_begin_label(struct nk_context*, const char*, nk_flags align, struct nk_vec2 size);
3716NK_API nk_bool nk_menu_begin_image(struct nk_context*, const char*, struct nk_image, struct nk_vec2 size);
3717NK_API nk_bool nk_menu_begin_image_text(struct nk_context*, const char*, int,nk_flags align,struct nk_image, struct nk_vec2 size);
3718NK_API nk_bool nk_menu_begin_image_label(struct nk_context*, const char*, nk_flags align,struct nk_image, struct nk_vec2 size);
3719NK_API nk_bool nk_menu_begin_symbol(struct nk_context*, const char*, enum nk_symbol_type, struct nk_vec2 size);
3720NK_API nk_bool nk_menu_begin_symbol_text(struct nk_context*, const char*, int,nk_flags align,enum nk_symbol_type, struct nk_vec2 size);
3721NK_API nk_bool nk_menu_begin_symbol_label(struct nk_context*, const char*, nk_flags align,enum nk_symbol_type, struct nk_vec2 size);
3722NK_API nk_bool nk_menu_item_text(struct nk_context*, const char*, int,nk_flags align);
3723NK_API nk_bool nk_menu_item_label(struct nk_context*, const char*, nk_flags alignment);
3724NK_API nk_bool nk_menu_item_image_label(struct nk_context*, struct nk_image, const char*, nk_flags alignment);
3725NK_API nk_bool nk_menu_item_image_text(struct nk_context*, struct nk_image, const char*, int len, nk_flags alignment);
3726NK_API nk_bool nk_menu_item_symbol_text(struct nk_context*, enum nk_symbol_type, const char*, int, nk_flags alignment);
3727NK_API nk_bool nk_menu_item_symbol_label(struct nk_context*, enum nk_symbol_type, const char*, nk_flags alignment);
3728NK_API void nk_menu_close(struct nk_context*);
3729NK_API void nk_menu_end(struct nk_context*);
3730/* =============================================================================
3731 *
3732 * STYLE
3733 *
3734 * ============================================================================= */
3735
3736#define NK_WIDGET_DISABLED_FACTOR 0.5f
3737
3738enum nk_style_colors {
3739 NK_COLOR_TEXT,
3740 NK_COLOR_WINDOW,
3741 NK_COLOR_HEADER,
3742 NK_COLOR_BORDER,
3743 NK_COLOR_BUTTON,
3744 NK_COLOR_BUTTON_HOVER,
3745 NK_COLOR_BUTTON_ACTIVE,
3746 NK_COLOR_TOGGLE,
3747 NK_COLOR_TOGGLE_HOVER,
3748 NK_COLOR_TOGGLE_CURSOR,
3749 NK_COLOR_SELECT,
3750 NK_COLOR_SELECT_ACTIVE,
3751 NK_COLOR_SLIDER,
3752 NK_COLOR_SLIDER_CURSOR,
3753 NK_COLOR_SLIDER_CURSOR_HOVER,
3754 NK_COLOR_SLIDER_CURSOR_ACTIVE,
3755 NK_COLOR_PROPERTY,
3756 NK_COLOR_EDIT,
3757 NK_COLOR_EDIT_CURSOR,
3758 NK_COLOR_COMBO,
3759 NK_COLOR_CHART,
3760 NK_COLOR_CHART_COLOR,
3761 NK_COLOR_CHART_COLOR_HIGHLIGHT,
3762 NK_COLOR_SCROLLBAR,
3763 NK_COLOR_SCROLLBAR_CURSOR,
3764 NK_COLOR_SCROLLBAR_CURSOR_HOVER,
3765 NK_COLOR_SCROLLBAR_CURSOR_ACTIVE,
3766 NK_COLOR_TAB_HEADER,
3767 NK_COLOR_KNOB,
3768 NK_COLOR_KNOB_CURSOR,
3769 NK_COLOR_KNOB_CURSOR_HOVER,
3770 NK_COLOR_KNOB_CURSOR_ACTIVE,
3771 NK_COLOR_COUNT
3772};
3773enum nk_style_cursor {
3774 NK_CURSOR_ARROW,
3775 NK_CURSOR_TEXT,
3776 NK_CURSOR_MOVE,
3777 NK_CURSOR_RESIZE_VERTICAL,
3778 NK_CURSOR_RESIZE_HORIZONTAL,
3779 NK_CURSOR_RESIZE_TOP_LEFT_DOWN_RIGHT,
3780 NK_CURSOR_RESIZE_TOP_RIGHT_DOWN_LEFT,
3781 NK_CURSOR_COUNT
3782};
3783NK_API void nk_style_default(struct nk_context*);
3784NK_API void nk_style_from_table(struct nk_context*, const struct nk_color*);
3785NK_API void nk_style_load_cursor(struct nk_context*, enum nk_style_cursor, const struct nk_cursor*);
3786NK_API void nk_style_load_all_cursors(struct nk_context*, const struct nk_cursor*);
3787NK_API const char* nk_style_get_color_by_name(enum nk_style_colors);
3788NK_API void nk_style_set_font(struct nk_context*, const struct nk_user_font*);
3789NK_API nk_bool nk_style_set_cursor(struct nk_context*, enum nk_style_cursor);
3790NK_API void nk_style_show_cursor(struct nk_context*);
3791NK_API void nk_style_hide_cursor(struct nk_context*);
3792
3793NK_API nk_bool nk_style_push_font(struct nk_context*, const struct nk_user_font*);
3794NK_API nk_bool nk_style_push_float(struct nk_context*, float*, float);
3795NK_API nk_bool nk_style_push_vec2(struct nk_context*, struct nk_vec2*, struct nk_vec2);
3796NK_API nk_bool nk_style_push_style_item(struct nk_context*, struct nk_style_item*, struct nk_style_item);
3797NK_API nk_bool nk_style_push_flags(struct nk_context*, nk_flags*, nk_flags);
3798NK_API nk_bool nk_style_push_color(struct nk_context*, struct nk_color*, struct nk_color);
3799
3800NK_API nk_bool nk_style_pop_font(struct nk_context*);
3801NK_API nk_bool nk_style_pop_float(struct nk_context*);
3802NK_API nk_bool nk_style_pop_vec2(struct nk_context*);
3803NK_API nk_bool nk_style_pop_style_item(struct nk_context*);
3804NK_API nk_bool nk_style_pop_flags(struct nk_context*);
3805NK_API nk_bool nk_style_pop_color(struct nk_context*);
3806/* =============================================================================
3807 *
3808 * COLOR
3809 *
3810 * ============================================================================= */
3811NK_API struct nk_color nk_rgb(int r, int g, int b);
3812NK_API struct nk_color nk_rgb_iv(const int *rgb);
3813NK_API struct nk_color nk_rgb_bv(const nk_byte* rgb);
3814NK_API struct nk_color nk_rgb_f(float r, float g, float b);
3815NK_API struct nk_color nk_rgb_fv(const float *rgb);
3816NK_API struct nk_color nk_rgb_cf(struct nk_colorf c);
3817NK_API struct nk_color nk_rgb_hex(const char *rgb);
3818NK_API struct nk_color nk_rgb_factor(struct nk_color col, float factor);
3819
3820NK_API struct nk_color nk_rgba(int r, int g, int b, int a);
3821NK_API struct nk_color nk_rgba_u32(nk_uint);
3822NK_API struct nk_color nk_rgba_iv(const int *rgba);
3823NK_API struct nk_color nk_rgba_bv(const nk_byte *rgba);
3824NK_API struct nk_color nk_rgba_f(float r, float g, float b, float a);
3825NK_API struct nk_color nk_rgba_fv(const float *rgba);
3826NK_API struct nk_color nk_rgba_cf(struct nk_colorf c);
3827NK_API struct nk_color nk_rgba_hex(const char *rgb);
3828
3829NK_API struct nk_colorf nk_hsva_colorf(float h, float s, float v, float a);
3830NK_API struct nk_colorf nk_hsva_colorfv(const float *c);
3831NK_API void nk_colorf_hsva_f(float *out_h, float *out_s, float *out_v, float *out_a, struct nk_colorf in);
3832NK_API void nk_colorf_hsva_fv(float *hsva, struct nk_colorf in);
3833
3834NK_API struct nk_color nk_hsv(int h, int s, int v);
3835NK_API struct nk_color nk_hsv_iv(const int *hsv);
3836NK_API struct nk_color nk_hsv_bv(const nk_byte *hsv);
3837NK_API struct nk_color nk_hsv_f(float h, float s, float v);
3838NK_API struct nk_color nk_hsv_fv(const float *hsv);
3839
3840NK_API struct nk_color nk_hsva(int h, int s, int v, int a);
3841NK_API struct nk_color nk_hsva_iv(const int *hsva);
3842NK_API struct nk_color nk_hsva_bv(const nk_byte *hsva);
3843NK_API struct nk_color nk_hsva_f(float h, float s, float v, float a);
3844NK_API struct nk_color nk_hsva_fv(const float *hsva);
3845
3846/* color (conversion nuklear --> user) */
3847NK_API void nk_color_f(float *r, float *g, float *b, float *a, struct nk_color);
3848NK_API void nk_color_fv(float *rgba_out, struct nk_color);
3849NK_API struct nk_colorf nk_color_cf(struct nk_color);
3850NK_API void nk_color_d(double *r, double *g, double *b, double *a, struct nk_color);
3851NK_API void nk_color_dv(double *rgba_out, struct nk_color);
3852
3853NK_API nk_uint nk_color_u32(struct nk_color);
3854NK_API void nk_color_hex_rgba(char *output, struct nk_color);
3855NK_API void nk_color_hex_rgb(char *output, struct nk_color);
3856
3857NK_API void nk_color_hsv_i(int *out_h, int *out_s, int *out_v, struct nk_color);
3858NK_API void nk_color_hsv_b(nk_byte *out_h, nk_byte *out_s, nk_byte *out_v, struct nk_color);
3859NK_API void nk_color_hsv_iv(int *hsv_out, struct nk_color);
3860NK_API void nk_color_hsv_bv(nk_byte *hsv_out, struct nk_color);
3861NK_API void nk_color_hsv_f(float *out_h, float *out_s, float *out_v, struct nk_color);
3862NK_API void nk_color_hsv_fv(float *hsv_out, struct nk_color);
3863
3864NK_API void nk_color_hsva_i(int *h, int *s, int *v, int *a, struct nk_color);
3865NK_API void nk_color_hsva_b(nk_byte *h, nk_byte *s, nk_byte *v, nk_byte *a, struct nk_color);
3866NK_API void nk_color_hsva_iv(int *hsva_out, struct nk_color);
3867NK_API void nk_color_hsva_bv(nk_byte *hsva_out, struct nk_color);
3868NK_API void nk_color_hsva_f(float *out_h, float *out_s, float *out_v, float *out_a, struct nk_color);
3869NK_API void nk_color_hsva_fv(float *hsva_out, struct nk_color);
3870/* =============================================================================
3871 *
3872 * IMAGE
3873 *
3874 * ============================================================================= */
3875NK_API nk_handle nk_handle_ptr(void*);
3876NK_API nk_handle nk_handle_id(int);
3877NK_API struct nk_image nk_image_handle(nk_handle);
3878NK_API struct nk_image nk_image_ptr(void*);
3879NK_API struct nk_image nk_image_id(int);
3880NK_API nk_bool nk_image_is_subimage(const struct nk_image* img);
3881NK_API struct nk_image nk_subimage_ptr(void*, nk_ushort w, nk_ushort h, struct nk_rect sub_region);
3882NK_API struct nk_image nk_subimage_id(int, nk_ushort w, nk_ushort h, struct nk_rect sub_region);
3883NK_API struct nk_image nk_subimage_handle(nk_handle, nk_ushort w, nk_ushort h, struct nk_rect sub_region);
3884/* =============================================================================
3885 *
3886 * 9-SLICE
3887 *
3888 * ============================================================================= */
3889NK_API struct nk_nine_slice nk_nine_slice_handle(nk_handle, nk_ushort l, nk_ushort t, nk_ushort r, nk_ushort b);
3890NK_API struct nk_nine_slice nk_nine_slice_ptr(void*, nk_ushort l, nk_ushort t, nk_ushort r, nk_ushort b);
3891NK_API struct nk_nine_slice nk_nine_slice_id(int, nk_ushort l, nk_ushort t, nk_ushort r, nk_ushort b);
3892NK_API int nk_nine_slice_is_sub9slice(const struct nk_nine_slice* img);
3893NK_API struct nk_nine_slice nk_sub9slice_ptr(void*, nk_ushort w, nk_ushort h, struct nk_rect sub_region, nk_ushort l, nk_ushort t, nk_ushort r, nk_ushort b);
3894NK_API struct nk_nine_slice nk_sub9slice_id(int, nk_ushort w, nk_ushort h, struct nk_rect sub_region, nk_ushort l, nk_ushort t, nk_ushort r, nk_ushort b);
3895NK_API struct nk_nine_slice nk_sub9slice_handle(nk_handle, nk_ushort w, nk_ushort h, struct nk_rect sub_region, nk_ushort l, nk_ushort t, nk_ushort r, nk_ushort b);
3896/* =============================================================================
3897 *
3898 * MATH
3899 *
3900 * ============================================================================= */
3901NK_API nk_hash nk_murmur_hash(const void *key, int len, nk_hash seed);
3902NK_API void nk_triangle_from_direction(struct nk_vec2 *result, struct nk_rect r, float pad_x, float pad_y, enum nk_heading);
3903
3904NK_API struct nk_vec2 nk_vec2(float x, float y);
3905NK_API struct nk_vec2 nk_vec2i(int x, int y);
3906NK_API struct nk_vec2 nk_vec2v(const float *xy);
3907NK_API struct nk_vec2 nk_vec2iv(const int *xy);
3908
3909NK_API struct nk_rect nk_get_null_rect(void);
3910NK_API struct nk_rect nk_rect(float x, float y, float w, float h);
3911NK_API struct nk_rect nk_recti(int x, int y, int w, int h);
3912NK_API struct nk_rect nk_recta(struct nk_vec2 pos, struct nk_vec2 size);
3913NK_API struct nk_rect nk_rectv(const float *xywh);
3914NK_API struct nk_rect nk_rectiv(const int *xywh);
3915NK_API struct nk_vec2 nk_rect_pos(struct nk_rect);
3916NK_API struct nk_vec2 nk_rect_size(struct nk_rect);
3917/* =============================================================================
3918 *
3919 * STRING
3920 *
3921 * ============================================================================= */
3922NK_API int nk_strlen(const char *str);
3923NK_API int nk_stricmp(const char *s1, const char *s2);
3924NK_API int nk_stricmpn(const char *s1, const char *s2, int n);
3925NK_API int nk_strtoi(const char *str, char **endptr);
3926NK_API float nk_strtof(const char *str, char **endptr);
3927#ifndef NK_STRTOD
3928#define NK_STRTOD nk_strtod
3929#define NK_STRTOD_NEEDED
3930NK_API double nk_strtod(const char *str, char **endptr);
3931#endif
3932NK_API int nk_strfilter(const char *text, const char *regexp);
3933NK_API int nk_strmatch_fuzzy_string(char const *str, char const *pattern, int *out_score);
3934NK_API int nk_strmatch_fuzzy_text(const char *txt, int txt_len, const char *pattern, int *out_score);
3935/* =============================================================================
3936 *
3937 * UTF-8
3938 *
3939 * ============================================================================= */
3940NK_API int nk_utf_decode(const char*, nk_rune*, int);
3941NK_API int nk_utf_encode(nk_rune, char*, int);
3942NK_API int nk_utf_len(const char*, int byte_len);
3943NK_API const char* nk_utf_at(const char *buffer, int length, int index, nk_rune *unicode, int *len);
3944/* ===============================================================
3945 *
3946 * FONT
3947 *
3948 * ===============================================================*/
4100
4101struct nk_user_font_glyph;
4102typedef float(*nk_text_width_f)(nk_handle, float h, const char*, int len);
4103typedef void(*nk_query_font_glyph_f)(nk_handle handle, float font_height,
4104 struct nk_user_font_glyph *glyph,
4105 nk_rune codepoint, nk_rune next_codepoint);
4106
4107#if defined(NK_INCLUDE_VERTEX_BUFFER_OUTPUT) || defined(NK_INCLUDE_SOFTWARE_FONT)
4108struct nk_user_font_glyph {
4109 struct nk_vec2 uv[2];
4110 struct nk_vec2 offset;
4111 float width, height;
4112 float xadvance;
4113};
4114#endif
4115
4117 nk_handle userdata;
4118 float height;
4119 nk_text_width_f width;
4120#ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT
4121 nk_query_font_glyph_f query;
4122 nk_handle texture;
4123#endif
4124};
4125
4126#ifdef NK_INCLUDE_FONT_BAKING
4127enum nk_font_coord_type {
4128 NK_COORD_UV,
4129 NK_COORD_PIXEL
4130};
4131
4132struct nk_font;
4133struct nk_baked_font {
4134 float height;
4135 float ascent;
4136 float descent;
4137 nk_rune glyph_offset;
4138 nk_rune glyph_count;
4139 const nk_rune *ranges;
4140};
4141
4142struct nk_font_config {
4143 struct nk_font_config *next;
4144 void *ttf_blob;
4145 nk_size ttf_size;
4146
4147 unsigned char ttf_data_owned_by_atlas;
4148 unsigned char merge_mode;
4149 unsigned char pixel_snap;
4150 unsigned char oversample_v, oversample_h;
4151 unsigned char padding[3];
4152
4153 float size;
4154 enum nk_font_coord_type coord_type;
4155 struct nk_vec2 spacing;
4156 const nk_rune *range;
4157 struct nk_baked_font *font;
4158 nk_rune fallback_glyph;
4159 struct nk_font_config *n;
4160 struct nk_font_config *p;
4161};
4162
4163struct nk_font_glyph {
4164 nk_rune codepoint;
4165 float xadvance;
4166 float x0, y0, x1, y1, w, h;
4167 float u0, v0, u1, v1;
4168};
4169
4170struct nk_font {
4171 struct nk_font *next;
4172 struct nk_user_font handle;
4173 struct nk_baked_font info;
4174 float scale;
4175 struct nk_font_glyph *glyphs;
4176 const struct nk_font_glyph *fallback;
4177 nk_rune fallback_codepoint;
4178 nk_handle texture;
4179 struct nk_font_config *config;
4180};
4181
4182enum nk_font_atlas_format {
4183 NK_FONT_ATLAS_ALPHA8,
4184 NK_FONT_ATLAS_RGBA32
4185};
4186
4187struct nk_font_atlas {
4188 void *pixel;
4189 int tex_width;
4190 int tex_height;
4191
4192 struct nk_allocator permanent;
4193 struct nk_allocator temporary;
4194
4195 struct nk_recti custom;
4196 struct nk_cursor cursors[NK_CURSOR_COUNT];
4197
4198 int glyph_count;
4199 struct nk_font_glyph *glyphs;
4200 struct nk_font *default_font;
4201 struct nk_font *fonts;
4202 struct nk_font_config *config;
4203 int font_num;
4204};
4205
4207NK_API const nk_rune *nk_font_default_glyph_ranges(void);
4208NK_API const nk_rune *nk_font_chinese_glyph_ranges(void);
4209NK_API const nk_rune *nk_font_cyrillic_glyph_ranges(void);
4210NK_API const nk_rune *nk_font_korean_glyph_ranges(void);
4211
4212#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
4213NK_API void nk_font_atlas_init_default(struct nk_font_atlas*);
4214#endif
4215NK_API void nk_font_atlas_init(struct nk_font_atlas*, const struct nk_allocator*);
4216NK_API void nk_font_atlas_init_custom(struct nk_font_atlas*, const struct nk_allocator *persistent, const struct nk_allocator *transient);
4217NK_API void nk_font_atlas_begin(struct nk_font_atlas*);
4218NK_API struct nk_font_config nk_font_config(float pixel_height);
4219NK_API struct nk_font *nk_font_atlas_add(struct nk_font_atlas*, const struct nk_font_config*);
4220#ifdef NK_INCLUDE_DEFAULT_FONT
4221NK_API struct nk_font* nk_font_atlas_add_default(struct nk_font_atlas*, float height, const struct nk_font_config*);
4222#endif
4223NK_API struct nk_font* nk_font_atlas_add_from_memory(struct nk_font_atlas *atlas, void *memory, nk_size size, float height, const struct nk_font_config *config);
4224#ifdef NK_INCLUDE_STANDARD_IO
4225NK_API struct nk_font* nk_font_atlas_add_from_file(struct nk_font_atlas *atlas, const char *file_path, float height, const struct nk_font_config*);
4226#endif
4227NK_API struct nk_font *nk_font_atlas_add_compressed(struct nk_font_atlas*, void *memory, nk_size size, float height, const struct nk_font_config*);
4228NK_API struct nk_font* nk_font_atlas_add_compressed_base85(struct nk_font_atlas*, const char *data, float height, const struct nk_font_config *config);
4229NK_API const void* nk_font_atlas_bake(struct nk_font_atlas*, int *width, int *height, enum nk_font_atlas_format);
4230NK_API void nk_font_atlas_end(struct nk_font_atlas*, nk_handle tex, struct nk_draw_null_texture*);
4231NK_API const struct nk_font_glyph* nk_font_find_glyph(const struct nk_font*, nk_rune unicode);
4232NK_API void nk_font_atlas_cleanup(struct nk_font_atlas *atlas);
4233NK_API void nk_font_atlas_clear(struct nk_font_atlas*);
4234
4235#endif
4236
4237/* ==============================================================
4238 *
4239 * MEMORY BUFFER
4240 *
4241 * ===============================================================*/
4272
4274 void *memory;
4275 unsigned int type;
4276 nk_size size;
4277 nk_size allocated;
4278 nk_size needed;
4279 nk_size calls;
4280};
4281
4282enum nk_allocation_type {
4283 NK_BUFFER_FIXED,
4284 NK_BUFFER_DYNAMIC
4285};
4286
4287enum nk_buffer_allocation_type {
4288 NK_BUFFER_FRONT,
4289 NK_BUFFER_BACK,
4290 NK_BUFFER_MAX
4291};
4292
4294 nk_bool active;
4295 nk_size offset;
4296};
4297
4298struct nk_memory {void *ptr;nk_size size;};
4300 struct nk_buffer_marker marker[NK_BUFFER_MAX];
4302 enum nk_allocation_type type;
4305 nk_size allocated;
4306 nk_size needed;
4307 nk_size calls;
4308 nk_size size;
4309};
4310
4311#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
4312NK_API void nk_buffer_init_default(struct nk_buffer*);
4313#endif
4314NK_API void nk_buffer_init(struct nk_buffer*, const struct nk_allocator*, nk_size size);
4315NK_API void nk_buffer_init_fixed(struct nk_buffer*, void *memory, nk_size size);
4316NK_API void nk_buffer_info(struct nk_memory_status*, const struct nk_buffer*);
4317NK_API void nk_buffer_push(struct nk_buffer*, enum nk_buffer_allocation_type type, const void *memory, nk_size size, nk_size align);
4318NK_API void nk_buffer_mark(struct nk_buffer*, enum nk_buffer_allocation_type type);
4319NK_API void nk_buffer_reset(struct nk_buffer*, enum nk_buffer_allocation_type type);
4320NK_API void nk_buffer_clear(struct nk_buffer*);
4321NK_API void nk_buffer_free(struct nk_buffer*);
4322NK_API void *nk_buffer_memory(struct nk_buffer*);
4323NK_API const void *nk_buffer_memory_const(const struct nk_buffer*);
4324NK_API nk_size nk_buffer_total(const struct nk_buffer*);
4325
4326/* ==============================================================
4327 *
4328 * STRING
4329 *
4330 * ===============================================================*/
4336struct nk_str {
4337 struct nk_buffer buffer;
4338 int len;
4339};
4340
4341#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
4342NK_API void nk_str_init_default(struct nk_str*);
4343#endif
4344NK_API void nk_str_init(struct nk_str*, const struct nk_allocator*, nk_size size);
4345NK_API void nk_str_init_fixed(struct nk_str*, void *memory, nk_size size);
4346NK_API void nk_str_clear(struct nk_str*);
4347NK_API void nk_str_free(struct nk_str*);
4348
4349NK_API int nk_str_append_text_char(struct nk_str*, const char*, int);
4350NK_API int nk_str_append_str_char(struct nk_str*, const char*);
4351NK_API int nk_str_append_text_utf8(struct nk_str*, const char*, int);
4352NK_API int nk_str_append_str_utf8(struct nk_str*, const char*);
4353NK_API int nk_str_append_text_runes(struct nk_str*, const nk_rune*, int);
4354NK_API int nk_str_append_str_runes(struct nk_str*, const nk_rune*);
4355
4356NK_API int nk_str_insert_at_char(struct nk_str*, int pos, const char*, int);
4357NK_API int nk_str_insert_at_rune(struct nk_str*, int pos, const char*, int);
4358
4359NK_API int nk_str_insert_text_char(struct nk_str*, int pos, const char*, int);
4360NK_API int nk_str_insert_str_char(struct nk_str*, int pos, const char*);
4361NK_API int nk_str_insert_text_utf8(struct nk_str*, int pos, const char*, int);
4362NK_API int nk_str_insert_str_utf8(struct nk_str*, int pos, const char*);
4363NK_API int nk_str_insert_text_runes(struct nk_str*, int pos, const nk_rune*, int);
4364NK_API int nk_str_insert_str_runes(struct nk_str*, int pos, const nk_rune*);
4365
4366NK_API void nk_str_remove_chars(struct nk_str*, int len);
4367NK_API void nk_str_remove_runes(struct nk_str *str, int len);
4368NK_API void nk_str_delete_chars(struct nk_str*, int pos, int len);
4369NK_API void nk_str_delete_runes(struct nk_str*, int pos, int len);
4370
4371NK_API char *nk_str_at_char(struct nk_str*, int pos);
4372NK_API char *nk_str_at_rune(struct nk_str*, int pos, nk_rune *unicode, int *len);
4373NK_API nk_rune nk_str_rune_at(const struct nk_str*, int pos);
4374NK_API const char *nk_str_at_char_const(const struct nk_str*, int pos);
4375NK_API const char *nk_str_at_const(const struct nk_str*, int pos, nk_rune *unicode, int *len);
4376
4377NK_API char *nk_str_get(struct nk_str*);
4378NK_API const char *nk_str_get_const(const struct nk_str*);
4379NK_API int nk_str_len(const struct nk_str*);
4380NK_API int nk_str_len_char(const struct nk_str*);
4381
4382/* ===============================================================
4383 *
4384 * TEXT EDITOR
4385 *
4386 * ===============================================================*/
4412
4413#ifndef NK_TEXTEDIT_UNDOSTATECOUNT
4414#define NK_TEXTEDIT_UNDOSTATECOUNT 99
4415#endif
4416
4417#ifndef NK_TEXTEDIT_UNDOCHARCOUNT
4418#define NK_TEXTEDIT_UNDOCHARCOUNT 999
4419#endif
4420
4421struct nk_text_edit;
4423 nk_handle userdata;
4424 nk_plugin_paste paste;
4425 nk_plugin_copy copy;
4426};
4427
4429 int where;
4430 short insert_length;
4431 short delete_length;
4432 short char_storage;
4433};
4434
4436 struct nk_text_undo_record undo_rec[NK_TEXTEDIT_UNDOSTATECOUNT];
4437 nk_rune undo_char[NK_TEXTEDIT_UNDOCHARCOUNT];
4438 short undo_point;
4439 short redo_point;
4440 short undo_char_point;
4441 short redo_char_point;
4442};
4443
4444enum nk_text_edit_type {
4445 NK_TEXT_EDIT_SINGLE_LINE,
4446 NK_TEXT_EDIT_MULTI_LINE
4447};
4448
4449enum nk_text_edit_mode {
4450 NK_TEXT_EDIT_MODE_VIEW,
4451 NK_TEXT_EDIT_MODE_INSERT,
4452 NK_TEXT_EDIT_MODE_REPLACE
4453};
4454
4456 struct nk_clipboard clip;
4457 struct nk_str string;
4458 nk_plugin_filter filter;
4459 struct nk_vec2 scrollbar;
4460
4461 int cursor;
4462 int select_start;
4463 int select_end;
4464 unsigned char mode;
4465 unsigned char cursor_at_end_of_line;
4466 unsigned char initialized;
4467 unsigned char has_preferred_x;
4468 unsigned char single_line;
4469 unsigned char active;
4470 unsigned char padding1;
4471 float preferred_x;
4472 struct nk_text_undo_state undo;
4473};
4474
4476NK_API nk_bool nk_filter_default(const struct nk_text_edit*, nk_rune unicode);
4477NK_API nk_bool nk_filter_ascii(const struct nk_text_edit*, nk_rune unicode);
4478NK_API nk_bool nk_filter_float(const struct nk_text_edit*, nk_rune unicode);
4479NK_API nk_bool nk_filter_decimal(const struct nk_text_edit*, nk_rune unicode);
4480NK_API nk_bool nk_filter_hex(const struct nk_text_edit*, nk_rune unicode);
4481NK_API nk_bool nk_filter_oct(const struct nk_text_edit*, nk_rune unicode);
4482NK_API nk_bool nk_filter_binary(const struct nk_text_edit*, nk_rune unicode);
4483
4485#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
4486NK_API void nk_textedit_init_default(struct nk_text_edit*);
4487#endif
4488NK_API void nk_textedit_init(struct nk_text_edit*, const struct nk_allocator*, nk_size size);
4489NK_API void nk_textedit_init_fixed(struct nk_text_edit*, void *memory, nk_size size);
4490NK_API void nk_textedit_free(struct nk_text_edit*);
4491NK_API void nk_textedit_text(struct nk_text_edit*, const char*, int total_len);
4492NK_API void nk_textedit_delete(struct nk_text_edit*, int where, int len);
4493NK_API void nk_textedit_delete_selection(struct nk_text_edit*);
4494NK_API void nk_textedit_select_all(struct nk_text_edit*);
4495NK_API nk_bool nk_textedit_cut(struct nk_text_edit*);
4496NK_API nk_bool nk_textedit_paste(struct nk_text_edit*, char const*, int len);
4497NK_API void nk_textedit_undo(struct nk_text_edit*);
4498NK_API void nk_textedit_redo(struct nk_text_edit*);
4499
4500/* ===============================================================
4501 *
4502 * DRAWING
4503 *
4504 * ===============================================================*/
4553
4554enum nk_command_type {
4555 NK_COMMAND_NOP,
4556 NK_COMMAND_SCISSOR,
4557 NK_COMMAND_LINE,
4558 NK_COMMAND_CURVE,
4559 NK_COMMAND_RECT,
4560 NK_COMMAND_RECT_FILLED,
4561 NK_COMMAND_RECT_MULTI_COLOR,
4562 NK_COMMAND_CIRCLE,
4563 NK_COMMAND_CIRCLE_FILLED,
4564 NK_COMMAND_ARC,
4565 NK_COMMAND_ARC_FILLED,
4566 NK_COMMAND_TRIANGLE,
4567 NK_COMMAND_TRIANGLE_FILLED,
4568 NK_COMMAND_POLYGON,
4569 NK_COMMAND_POLYGON_FILLED,
4570 NK_COMMAND_POLYLINE,
4571 NK_COMMAND_TEXT,
4572 NK_COMMAND_IMAGE,
4573 NK_COMMAND_CUSTOM
4574};
4575
4578 enum nk_command_type type;
4579 nk_size next;
4580#ifdef NK_INCLUDE_COMMAND_USERDATA
4581 nk_handle userdata;
4582#endif
4583};
4584
4586 struct nk_command header;
4587 short x, y;
4588 unsigned short w, h;
4589};
4590
4592 struct nk_command header;
4593 unsigned short line_thickness;
4594 struct nk_vec2i begin;
4595 struct nk_vec2i end;
4596 struct nk_color color;
4597};
4598
4600 struct nk_command header;
4601 unsigned short line_thickness;
4602 struct nk_vec2i begin;
4603 struct nk_vec2i end;
4604 struct nk_vec2i ctrl[2];
4605 struct nk_color color;
4606};
4607
4609 struct nk_command header;
4610 unsigned short rounding;
4611 unsigned short line_thickness;
4612 short x, y;
4613 unsigned short w, h;
4614 struct nk_color color;
4615};
4616
4618 struct nk_command header;
4619 unsigned short rounding;
4620 short x, y;
4621 unsigned short w, h;
4622 struct nk_color color;
4623};
4624
4626 struct nk_command header;
4627 short x, y;
4628 unsigned short w, h;
4629 struct nk_color left;
4630 struct nk_color top;
4631 struct nk_color bottom;
4632 struct nk_color right;
4633};
4634
4636 struct nk_command header;
4637 unsigned short line_thickness;
4638 struct nk_vec2i a;
4639 struct nk_vec2i b;
4640 struct nk_vec2i c;
4641 struct nk_color color;
4642};
4643
4645 struct nk_command header;
4646 struct nk_vec2i a;
4647 struct nk_vec2i b;
4648 struct nk_vec2i c;
4649 struct nk_color color;
4650};
4651
4653 struct nk_command header;
4654 short x, y;
4655 unsigned short line_thickness;
4656 unsigned short w, h;
4657 struct nk_color color;
4658};
4659
4661 struct nk_command header;
4662 short x, y;
4663 unsigned short w, h;
4664 struct nk_color color;
4665};
4666
4668 struct nk_command header;
4669 short cx, cy;
4670 unsigned short r;
4671 unsigned short line_thickness;
4672 float a[2];
4673 struct nk_color color;
4674};
4675
4677 struct nk_command header;
4678 short cx, cy;
4679 unsigned short r;
4680 float a[2];
4681 struct nk_color color;
4682};
4683
4685 struct nk_command header;
4686 struct nk_color color;
4687 unsigned short line_thickness;
4688 unsigned short point_count;
4689 struct nk_vec2i points[1];
4690};
4691
4693 struct nk_command header;
4694 struct nk_color color;
4695 unsigned short point_count;
4696 struct nk_vec2i points[1];
4697};
4698
4700 struct nk_command header;
4701 struct nk_color color;
4702 unsigned short line_thickness;
4703 unsigned short point_count;
4704 struct nk_vec2i points[1];
4705};
4706
4708 struct nk_command header;
4709 short x, y;
4710 unsigned short w, h;
4711 struct nk_image img;
4712 struct nk_color col;
4713};
4714
4715typedef void (*nk_command_custom_callback)(void *canvas, short x,short y,
4716 unsigned short w, unsigned short h, nk_handle callback_data);
4718 struct nk_command header;
4719 short x, y;
4720 unsigned short w, h;
4721 nk_handle callback_data;
4722 nk_command_custom_callback callback;
4723};
4724
4726 struct nk_command header;
4727 const struct nk_user_font *font;
4728 struct nk_color background;
4729 struct nk_color foreground;
4730 short x, y;
4731 unsigned short w, h;
4732 float height;
4733 int length;
4734 char string[2];
4735};
4736
4737enum nk_command_clipping {
4738 NK_CLIPPING_OFF = nk_false,
4739 NK_CLIPPING_ON = nk_true
4740};
4741
4743 struct nk_buffer *base;
4744 struct nk_rect clip;
4745 int use_clipping;
4746 nk_handle userdata;
4747 nk_size begin, end, last;
4748};
4749
4751NK_API void nk_stroke_line(struct nk_command_buffer *b, float x0, float y0, float x1, float y1, float line_thickness, struct nk_color);
4752NK_API void nk_stroke_curve(struct nk_command_buffer*, float, float, float, float, float, float, float, float, float line_thickness, struct nk_color);
4753NK_API void nk_stroke_rect(struct nk_command_buffer*, struct nk_rect, float rounding, float line_thickness, struct nk_color);
4754NK_API void nk_stroke_circle(struct nk_command_buffer*, struct nk_rect, float line_thickness, struct nk_color);
4755NK_API void nk_stroke_arc(struct nk_command_buffer*, float cx, float cy, float radius, float a_min, float a_max, float line_thickness, struct nk_color);
4756NK_API void nk_stroke_triangle(struct nk_command_buffer*, float, float, float, float, float, float, float line_thichness, struct nk_color);
4757NK_API void nk_stroke_polyline(struct nk_command_buffer*, const float *points, int point_count, float line_thickness, struct nk_color col);
4758NK_API void nk_stroke_polygon(struct nk_command_buffer*, const float *points, int point_count, float line_thickness, struct nk_color);
4759
4761NK_API void nk_fill_rect(struct nk_command_buffer*, struct nk_rect, float rounding, struct nk_color);
4762NK_API void nk_fill_rect_multi_color(struct nk_command_buffer*, struct nk_rect, struct nk_color left, struct nk_color top, struct nk_color right, struct nk_color bottom);
4763NK_API void nk_fill_circle(struct nk_command_buffer*, struct nk_rect, struct nk_color);
4764NK_API void nk_fill_arc(struct nk_command_buffer*, float cx, float cy, float radius, float a_min, float a_max, struct nk_color);
4765NK_API void nk_fill_triangle(struct nk_command_buffer*, float x0, float y0, float x1, float y1, float x2, float y2, struct nk_color);
4766NK_API void nk_fill_polygon(struct nk_command_buffer*, const float *points, int point_count, struct nk_color);
4767
4769NK_API void nk_draw_image(struct nk_command_buffer*, struct nk_rect, const struct nk_image*, struct nk_color);
4770NK_API void nk_draw_nine_slice(struct nk_command_buffer*, struct nk_rect, const struct nk_nine_slice*, struct nk_color);
4771NK_API void nk_draw_text(struct nk_command_buffer*, struct nk_rect, const char *text, int len, const struct nk_user_font*, struct nk_color, struct nk_color);
4772NK_API void nk_push_scissor(struct nk_command_buffer*, struct nk_rect);
4773NK_API void nk_push_custom(struct nk_command_buffer*, struct nk_rect, nk_command_custom_callback, nk_handle usr);
4774
4775/* ===============================================================
4776 *
4777 * INPUT
4778 *
4779 * ===============================================================*/
4781 nk_bool down;
4782 unsigned int clicked;
4783 struct nk_vec2 clicked_pos;
4784};
4785struct nk_mouse {
4786 struct nk_mouse_button buttons[NK_BUTTON_MAX];
4787 struct nk_vec2 pos;
4788#ifdef NK_BUTTON_TRIGGER_ON_RELEASE
4789 struct nk_vec2 down_pos;
4790#endif
4791 struct nk_vec2 prev;
4792 struct nk_vec2 delta;
4793 struct nk_vec2 scroll_delta;
4794 unsigned char grab;
4795 unsigned char grabbed;
4796 unsigned char ungrab;
4797};
4798
4799struct nk_key {
4800 nk_bool down;
4801 unsigned int clicked;
4802};
4804 struct nk_key keys[NK_KEY_MAX];
4805 char text[NK_INPUT_MAX];
4806 int text_len;
4807};
4808
4809struct nk_input {
4810 struct nk_keyboard keyboard;
4811 struct nk_mouse mouse;
4812};
4813
4814NK_API nk_bool nk_input_has_mouse_click(const struct nk_input*, enum nk_buttons);
4815NK_API nk_bool nk_input_has_mouse_click_in_rect(const struct nk_input*, enum nk_buttons, struct nk_rect);
4816NK_API nk_bool nk_input_has_mouse_click_in_button_rect(const struct nk_input*, enum nk_buttons, struct nk_rect);
4817NK_API nk_bool nk_input_has_mouse_click_down_in_rect(const struct nk_input*, enum nk_buttons, struct nk_rect, nk_bool down);
4818NK_API nk_bool nk_input_is_mouse_click_in_rect(const struct nk_input*, enum nk_buttons, struct nk_rect);
4819NK_API nk_bool nk_input_is_mouse_click_down_in_rect(const struct nk_input *i, enum nk_buttons id, struct nk_rect b, nk_bool down);
4820NK_API nk_bool nk_input_any_mouse_click_in_rect(const struct nk_input*, struct nk_rect);
4821NK_API nk_bool nk_input_is_mouse_prev_hovering_rect(const struct nk_input*, struct nk_rect);
4822NK_API nk_bool nk_input_is_mouse_hovering_rect(const struct nk_input*, struct nk_rect);
4823NK_API nk_bool nk_input_is_mouse_hovering_still_rect(const struct nk_input*, struct nk_rect);
4824NK_API nk_bool nk_input_is_mouse_hovering_delay_rect(const struct nk_context*, struct nk_rect, float*, float);
4825NK_API nk_bool nk_input_is_mouse_hovering_still_delay_rect(const struct nk_context*, struct nk_rect, float*, float);
4826NK_API nk_bool nk_input_is_mouse_hovering_still_delay_clicked_rect(const struct nk_context*, struct nk_rect, float*, float, nk_bool*);
4827NK_API nk_bool nk_input_is_mouse_moved(const struct nk_input*);
4828NK_API nk_bool nk_input_mouse_clicked(const struct nk_input*, enum nk_buttons, struct nk_rect);
4829NK_API nk_bool nk_input_is_mouse_down(const struct nk_input*, enum nk_buttons);
4830NK_API nk_bool nk_input_is_mouse_pressed(const struct nk_input*, enum nk_buttons);
4831NK_API nk_bool nk_input_is_mouse_released(const struct nk_input*, enum nk_buttons);
4832NK_API nk_bool nk_input_is_key_pressed(const struct nk_input*, enum nk_keys);
4833NK_API nk_bool nk_input_is_key_released(const struct nk_input*, enum nk_keys);
4834NK_API nk_bool nk_input_is_key_down(const struct nk_input*, enum nk_keys);
4835
4836/* ===============================================================
4837 *
4838 * DRAW LIST
4839 *
4840 * ===============================================================*/
4841#ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT
4857
4858#ifdef NK_UINT_DRAW_INDEX
4859typedef nk_uint nk_draw_index;
4860#else
4861typedef nk_ushort nk_draw_index;
4862#endif
4863enum nk_draw_list_stroke {
4864 NK_STROKE_OPEN = nk_false, /***< build up path has no connection back to the beginning */
4865 NK_STROKE_CLOSED = nk_true /***< build up path has a connection back to the beginning */
4866};
4867
4868enum nk_draw_vertex_layout_attribute {
4869 NK_VERTEX_POSITION,
4870 NK_VERTEX_COLOR,
4871 NK_VERTEX_TEXCOORD,
4872 NK_VERTEX_ATTRIBUTE_COUNT
4873};
4874
4875enum nk_draw_vertex_layout_format {
4876 NK_FORMAT_SCHAR,
4877 NK_FORMAT_SSHORT,
4878 NK_FORMAT_SINT,
4879 NK_FORMAT_UCHAR,
4880 NK_FORMAT_USHORT,
4881 NK_FORMAT_UINT,
4882 NK_FORMAT_FLOAT,
4883 NK_FORMAT_DOUBLE,
4884
4885NK_FORMAT_COLOR_BEGIN,
4886 NK_FORMAT_R8G8B8 = NK_FORMAT_COLOR_BEGIN,
4887 NK_FORMAT_R16G15B16,
4888 NK_FORMAT_R32G32B32,
4889
4890 NK_FORMAT_R8G8B8A8,
4891 NK_FORMAT_B8G8R8A8,
4892 NK_FORMAT_R16G15B16A16,
4893 NK_FORMAT_R32G32B32A32,
4894 NK_FORMAT_R32G32B32A32_FLOAT,
4895 NK_FORMAT_R32G32B32A32_DOUBLE,
4896
4897 NK_FORMAT_RGB32,
4898 NK_FORMAT_RGBA32,
4899NK_FORMAT_COLOR_END = NK_FORMAT_RGBA32,
4900 NK_FORMAT_COUNT
4901};
4902
4903#define NK_VERTEX_LAYOUT_END NK_VERTEX_ATTRIBUTE_COUNT,NK_FORMAT_COUNT,0
4904struct nk_draw_vertex_layout_element {
4905 enum nk_draw_vertex_layout_attribute attribute;
4906 enum nk_draw_vertex_layout_format format;
4907 nk_size offset;
4908};
4909
4910struct nk_draw_command {
4911 unsigned int elem_count;
4912 struct nk_rect clip_rect;
4913 nk_handle texture;
4914#ifdef NK_INCLUDE_COMMAND_USERDATA
4915 nk_handle userdata;
4916#endif
4917};
4918
4919struct nk_draw_list {
4920 struct nk_rect clip_rect;
4921 struct nk_vec2 circle_vtx[12];
4922 struct nk_convert_config config;
4923
4924 struct nk_buffer *buffer;
4925 struct nk_buffer *vertices;
4926 struct nk_buffer *elements;
4927
4928 unsigned int element_count;
4929 unsigned int vertex_count;
4930 unsigned int cmd_count;
4931 nk_size cmd_offset;
4932
4933 unsigned int path_count;
4934 unsigned int path_offset;
4935
4936 enum nk_anti_aliasing line_AA;
4937 enum nk_anti_aliasing shape_AA;
4938
4939#ifdef NK_INCLUDE_COMMAND_USERDATA
4940 nk_handle userdata;
4941#endif
4942};
4943
4944/* draw list */
4945NK_API void nk_draw_list_init(struct nk_draw_list*);
4946NK_API void nk_draw_list_setup(struct nk_draw_list*, const struct nk_convert_config*, struct nk_buffer *cmds, struct nk_buffer *vertices, struct nk_buffer *elements, enum nk_anti_aliasing line_aa,enum nk_anti_aliasing shape_aa);
4947
4948/* drawing */
4949#define nk_draw_list_foreach(cmd, can, b) for((cmd)=nk__draw_list_begin(can, b); (cmd)!=0; (cmd)=nk__draw_list_next(cmd, b, can))
4950NK_API const struct nk_draw_command* nk__draw_list_begin(const struct nk_draw_list*, const struct nk_buffer*);
4951NK_API const struct nk_draw_command* nk__draw_list_next(const struct nk_draw_command*, const struct nk_buffer*, const struct nk_draw_list*);
4952NK_API const struct nk_draw_command* nk__draw_list_end(const struct nk_draw_list*, const struct nk_buffer*);
4953
4954/* path */
4955NK_API void nk_draw_list_path_clear(struct nk_draw_list*);
4956NK_API void nk_draw_list_path_line_to(struct nk_draw_list*, struct nk_vec2 pos);
4957NK_API void nk_draw_list_path_arc_to_fast(struct nk_draw_list*, struct nk_vec2 center, float radius, int a_min, int a_max);
4958NK_API void nk_draw_list_path_arc_to(struct nk_draw_list*, struct nk_vec2 center, float radius, float a_min, float a_max, unsigned int segments);
4959NK_API void nk_draw_list_path_rect_to(struct nk_draw_list*, struct nk_vec2 a, struct nk_vec2 b, float rounding);
4960NK_API void nk_draw_list_path_curve_to(struct nk_draw_list*, struct nk_vec2 p2, struct nk_vec2 p3, struct nk_vec2 p4, unsigned int num_segments);
4961NK_API void nk_draw_list_path_fill(struct nk_draw_list*, struct nk_color);
4962NK_API void nk_draw_list_path_stroke(struct nk_draw_list*, struct nk_color, enum nk_draw_list_stroke closed, float thickness);
4963
4964/* stroke */
4965NK_API void nk_draw_list_stroke_line(struct nk_draw_list*, struct nk_vec2 a, struct nk_vec2 b, struct nk_color, float thickness);
4966NK_API void nk_draw_list_stroke_rect(struct nk_draw_list*, struct nk_rect rect, struct nk_color, float rounding, float thickness);
4967NK_API void nk_draw_list_stroke_triangle(struct nk_draw_list*, struct nk_vec2 a, struct nk_vec2 b, struct nk_vec2 c, struct nk_color, float thickness);
4968NK_API void nk_draw_list_stroke_circle(struct nk_draw_list*, struct nk_vec2 center, float radius, struct nk_color, unsigned int segs, float thickness);
4969NK_API void nk_draw_list_stroke_curve(struct nk_draw_list*, struct nk_vec2 p0, struct nk_vec2 cp0, struct nk_vec2 cp1, struct nk_vec2 p1, struct nk_color, unsigned int segments, float thickness);
4970NK_API void nk_draw_list_stroke_poly_line(struct nk_draw_list*, const struct nk_vec2 *pnts, const unsigned int cnt, struct nk_color, enum nk_draw_list_stroke, float thickness, enum nk_anti_aliasing);
4971
4972/* fill */
4973NK_API void nk_draw_list_fill_rect(struct nk_draw_list*, struct nk_rect rect, struct nk_color, float rounding);
4974NK_API void nk_draw_list_fill_rect_multi_color(struct nk_draw_list*, struct nk_rect rect, struct nk_color left, struct nk_color top, struct nk_color right, struct nk_color bottom);
4975NK_API void nk_draw_list_fill_triangle(struct nk_draw_list*, struct nk_vec2 a, struct nk_vec2 b, struct nk_vec2 c, struct nk_color);
4976NK_API void nk_draw_list_fill_circle(struct nk_draw_list*, struct nk_vec2 center, float radius, struct nk_color col, unsigned int segs);
4977NK_API void nk_draw_list_fill_poly_convex(struct nk_draw_list*, const struct nk_vec2 *points, const unsigned int count, struct nk_color, enum nk_anti_aliasing);
4978
4979/* misc */
4980NK_API void nk_draw_list_add_image(struct nk_draw_list*, struct nk_image texture, struct nk_rect rect, struct nk_color);
4981NK_API void nk_draw_list_add_text(struct nk_draw_list*, const struct nk_user_font*, struct nk_rect, const char *text, int len, float font_height, struct nk_color);
4982#ifdef NK_INCLUDE_COMMAND_USERDATA
4983NK_API void nk_draw_list_push_userdata(struct nk_draw_list*, nk_handle userdata);
4984#endif
4985
4986#endif
4987
4988/* ===============================================================
4989 *
4990 * GUI
4991 *
4992 * ===============================================================*/
4993enum nk_style_item_type {
4994 NK_STYLE_ITEM_COLOR,
4995 NK_STYLE_ITEM_IMAGE,
4996 NK_STYLE_ITEM_NINE_SLICE
4997};
4998
5000 struct nk_color color;
5001 struct nk_image image;
5002 struct nk_nine_slice slice;
5003};
5004
5006 enum nk_style_item_type type;
5007 union nk_style_item_data data;
5008};
5009
5011 struct nk_color color;
5012 struct nk_vec2 padding;
5013 float color_factor;
5014 float disabled_factor;
5015};
5016
5018 struct nk_color text_normal;
5019 struct nk_color text_hover;
5020 struct nk_color text_active;
5021 enum nk_link_underline underline;
5022 float underline_thickness;
5023 struct nk_vec2 padding;
5024 struct nk_vec2 touch_padding;
5025 float color_factor;
5026 float disabled_factor;
5027};
5028
5030 /* background */
5031 struct nk_style_item normal;
5032 struct nk_style_item hover;
5033 struct nk_style_item active;
5034 struct nk_color border_color;
5035 float color_factor_background;
5036
5037 /* text */
5038 struct nk_color text_background;
5039 struct nk_color text_normal;
5040 struct nk_color text_hover;
5041 struct nk_color text_active;
5042 nk_flags text_alignment;
5043 float color_factor_text;
5044
5045 /* properties */
5046 float border;
5047 float rounding;
5048 struct nk_vec2 padding;
5049 struct nk_vec2 image_padding;
5050 struct nk_vec2 touch_padding;
5051 float disabled_factor;
5052
5053 /* optional user callbacks */
5054 nk_handle userdata;
5055 void(*draw_begin)(struct nk_command_buffer*, nk_handle userdata);
5056 void(*draw_end)(struct nk_command_buffer*, nk_handle userdata);
5057};
5058
5060 /* background */
5061 struct nk_style_item normal;
5062 struct nk_style_item hover;
5063 struct nk_style_item active;
5064 struct nk_color border_color;
5065
5066 /* cursor */
5067 struct nk_style_item cursor_normal;
5068 struct nk_style_item cursor_hover;
5069
5070 /* text */
5071 struct nk_color text_normal;
5072 struct nk_color text_hover;
5073 struct nk_color text_active;
5074 struct nk_color text_background;
5075 nk_flags text_alignment;
5076
5077 /* properties */
5078 struct nk_vec2 padding;
5079 struct nk_vec2 touch_padding;
5080 float spacing;
5081 float border;
5082 float color_factor;
5083 float disabled_factor;
5084
5085 /* optional user callbacks */
5086 nk_handle userdata;
5087 void(*draw_begin)(struct nk_command_buffer*, nk_handle);
5088 void(*draw_end)(struct nk_command_buffer*, nk_handle);
5089};
5090
5092 /* background (inactive) */
5093 struct nk_style_item normal;
5094 struct nk_style_item hover;
5095 struct nk_style_item pressed;
5096
5097 /* background (active) */
5098 struct nk_style_item normal_active;
5099 struct nk_style_item hover_active;
5100 struct nk_style_item pressed_active;
5101
5102 /* text color (inactive) */
5103 struct nk_color text_normal;
5104 struct nk_color text_hover;
5105 struct nk_color text_pressed;
5106
5107 /* text color (active) */
5108 struct nk_color text_normal_active;
5109 struct nk_color text_hover_active;
5110 struct nk_color text_pressed_active;
5111 struct nk_color text_background;
5112 nk_flags text_alignment;
5113
5114 /* properties */
5115 float rounding;
5116 struct nk_vec2 padding;
5117 struct nk_vec2 touch_padding;
5118 struct nk_vec2 image_padding;
5119 float color_factor;
5120 float disabled_factor;
5121
5122 /* optional user callbacks */
5123 nk_handle userdata;
5124 void(*draw_begin)(struct nk_command_buffer*, nk_handle);
5125 void(*draw_end)(struct nk_command_buffer*, nk_handle);
5126};
5127
5129 /* background */
5130 struct nk_style_item normal;
5131 struct nk_style_item hover;
5132 struct nk_style_item active;
5133 struct nk_color border_color;
5134
5135 /* background bar */
5136 struct nk_color bar_normal;
5137 struct nk_color bar_hover;
5138 struct nk_color bar_active;
5139 struct nk_color bar_filled;
5140
5141 /* cursor */
5142 struct nk_style_item cursor_normal;
5143 struct nk_style_item cursor_hover;
5144 struct nk_style_item cursor_active;
5145
5146 /* properties */
5147 float border;
5148 float rounding;
5149 float bar_height;
5150 struct nk_vec2 padding;
5151 struct nk_vec2 spacing;
5152 struct nk_vec2 cursor_size; /* NOTE y has no effect on vertex buffer backends */
5153 float color_factor;
5154 float disabled_factor;
5155
5156 /* optional buttons */
5157 int show_buttons;
5158 struct nk_style_button inc_button;
5159 struct nk_style_button dec_button;
5160 enum nk_symbol_type inc_symbol;
5161 enum nk_symbol_type dec_symbol;
5162
5163 /* optional user callbacks */
5164 nk_handle userdata;
5165 void(*draw_begin)(struct nk_command_buffer*, nk_handle);
5166 void(*draw_end)(struct nk_command_buffer*, nk_handle);
5167};
5168
5170 /* background */
5171 struct nk_style_item normal;
5172 struct nk_style_item hover;
5173 struct nk_style_item active;
5174 struct nk_color border_color;
5175
5176 /* knob */
5177 struct nk_color knob_normal;
5178 struct nk_color knob_hover;
5179 struct nk_color knob_active;
5180 struct nk_color knob_border_color;
5181
5182 /* cursor */
5183 struct nk_color cursor_normal;
5184 struct nk_color cursor_hover;
5185 struct nk_color cursor_active;
5186
5187 /* properties */
5188 float border;
5189 float knob_border;
5190 struct nk_vec2 padding;
5191 struct nk_vec2 spacing;
5192 float cursor_width;
5193 float color_factor;
5194 float disabled_factor;
5195
5196 /* optional user callbacks */
5197 nk_handle userdata;
5198 void(*draw_begin)(struct nk_command_buffer*, nk_handle);
5199 void(*draw_end)(struct nk_command_buffer*, nk_handle);
5200};
5201
5203 /* background */
5204 struct nk_style_item normal;
5205 struct nk_style_item hover;
5206 struct nk_style_item active;
5207 struct nk_color border_color;
5208
5209 /* cursor */
5210 struct nk_style_item cursor_normal;
5211 struct nk_style_item cursor_hover;
5212 struct nk_style_item cursor_active;
5213 struct nk_color cursor_border_color;
5214
5215 /* properties */
5216 float rounding;
5217 float border;
5218 float cursor_border;
5219 float cursor_rounding;
5220 struct nk_vec2 padding;
5221 float color_factor;
5222 float disabled_factor;
5223
5224 /* optional user callbacks */
5225 nk_handle userdata;
5226 void(*draw_begin)(struct nk_command_buffer*, nk_handle);
5227 void(*draw_end)(struct nk_command_buffer*, nk_handle);
5228};
5229
5231 /* background */
5232 struct nk_style_item normal;
5233 struct nk_style_item hover;
5234 struct nk_style_item active;
5235 struct nk_color border_color;
5236
5237 /* cursor */
5238 struct nk_style_item cursor_normal;
5239 struct nk_style_item cursor_hover;
5240 struct nk_style_item cursor_active;
5241 struct nk_color cursor_border_color;
5242
5243 /* properties */
5244 float border;
5245 float rounding;
5246 float border_cursor;
5247 float rounding_cursor;
5248 struct nk_vec2 padding;
5249 float color_factor;
5250 float disabled_factor;
5251
5252 /* optional buttons */
5253 int show_buttons;
5254 struct nk_style_button inc_button;
5255 struct nk_style_button dec_button;
5256 enum nk_symbol_type inc_symbol;
5257 enum nk_symbol_type dec_symbol;
5258
5259 /* optional user callbacks */
5260 nk_handle userdata;
5261 void(*draw_begin)(struct nk_command_buffer*, nk_handle);
5262 void(*draw_end)(struct nk_command_buffer*, nk_handle);
5263};
5264
5266 /* background */
5267 struct nk_style_item normal;
5268 struct nk_style_item hover;
5269 struct nk_style_item active;
5270 struct nk_color border_color;
5271 struct nk_style_scrollbar scrollbar;
5272
5273 /* cursor */
5274 struct nk_color cursor_normal;
5275 struct nk_color cursor_hover;
5276 struct nk_color cursor_text_normal;
5277 struct nk_color cursor_text_hover;
5278
5279 /* text (unselected) */
5280 struct nk_color text_normal;
5281 struct nk_color text_hover;
5282 struct nk_color text_active;
5283
5284 /* text (selected) */
5285 struct nk_color selected_normal;
5286 struct nk_color selected_hover;
5287 struct nk_color selected_text_normal;
5288 struct nk_color selected_text_hover;
5289
5290 /* properties */
5291 float border;
5292 float rounding;
5293 float cursor_size;
5294 struct nk_vec2 scrollbar_size;
5295 struct nk_vec2 padding;
5296 float row_padding;
5297 float color_factor;
5298 float disabled_factor;
5299};
5300
5302 /* background */
5303 struct nk_style_item normal;
5304 struct nk_style_item hover;
5305 struct nk_style_item active;
5306 struct nk_color border_color;
5307
5308 /* text */
5309 struct nk_color label_normal;
5310 struct nk_color label_hover;
5311 struct nk_color label_active;
5312
5313 /* symbols */
5314 enum nk_symbol_type sym_left;
5315 enum nk_symbol_type sym_right;
5316
5317 /* properties */
5318 float border;
5319 float rounding;
5320 struct nk_vec2 padding;
5321 float color_factor;
5322 float disabled_factor;
5323
5324 struct nk_style_edit edit;
5325 struct nk_style_button inc_button;
5326 struct nk_style_button dec_button;
5327
5328 /* optional user callbacks */
5329 nk_handle userdata;
5330 void(*draw_begin)(struct nk_command_buffer*, nk_handle);
5331 void(*draw_end)(struct nk_command_buffer*, nk_handle);
5332};
5333
5335 /* colors */
5336 struct nk_style_item background;
5337 struct nk_color border_color;
5338 struct nk_color selected_color;
5339 struct nk_color color;
5340
5341 /* properties */
5342 float border;
5343 float rounding;
5344 struct nk_vec2 padding;
5345 float color_factor;
5346 float disabled_factor;
5347 nk_bool show_markers;
5348};
5349
5351 /* background */
5352 struct nk_style_item normal;
5353 struct nk_style_item hover;
5354 struct nk_style_item active;
5355 struct nk_color border_color;
5356
5357 /* label */
5358 struct nk_color label_normal;
5359 struct nk_color label_hover;
5360 struct nk_color label_active;
5361
5362 /* symbol */
5363 struct nk_color symbol_normal;
5364 struct nk_color symbol_hover;
5365 struct nk_color symbol_active;
5366
5367 /* button */
5368 struct nk_style_button button;
5369 enum nk_symbol_type sym_normal;
5370 enum nk_symbol_type sym_hover;
5371 enum nk_symbol_type sym_active;
5372
5373 /* properties */
5374 float border;
5375 float rounding;
5376 struct nk_vec2 content_padding;
5377 struct nk_vec2 button_padding;
5378 struct nk_vec2 spacing;
5379 float color_factor;
5380 float disabled_factor;
5381};
5382
5384 /* background */
5385 struct nk_style_item background;
5386 struct nk_color border_color;
5387 struct nk_color text;
5388
5389 /* button */
5390 struct nk_style_button tab_maximize_button;
5391 struct nk_style_button tab_minimize_button;
5392 struct nk_style_button node_maximize_button;
5393 struct nk_style_button node_minimize_button;
5394 enum nk_symbol_type sym_minimize;
5395 enum nk_symbol_type sym_maximize;
5396
5397 /* properties */
5398 float border;
5399 float rounding;
5400 float indent;
5401 struct nk_vec2 padding;
5402 struct nk_vec2 spacing;
5403 float color_factor;
5404 float disabled_factor;
5405};
5406
5407enum nk_style_header_align {
5408 NK_HEADER_LEFT,
5409 NK_HEADER_RIGHT
5410};
5412 /* background */
5413 struct nk_style_item normal;
5414 struct nk_style_item hover;
5415 struct nk_style_item active;
5416
5417 /* button */
5418 struct nk_style_button close_button;
5419 struct nk_style_button minimize_button;
5420 enum nk_symbol_type close_symbol;
5421 enum nk_symbol_type minimize_symbol;
5422 enum nk_symbol_type maximize_symbol;
5423
5424 /* title */
5425 struct nk_color label_normal;
5426 struct nk_color label_hover;
5427 struct nk_color label_active;
5428
5429 /* properties */
5430 enum nk_style_header_align align;
5431 struct nk_vec2 padding;
5432 struct nk_vec2 label_padding;
5433 struct nk_vec2 spacing;
5434};
5435
5437 struct nk_style_window_header header;
5438 struct nk_style_item fixed_background;
5439 struct nk_color background;
5440
5441 struct nk_color border_color;
5442 struct nk_color popup_border_color;
5443 struct nk_color combo_border_color;
5444 struct nk_color contextual_border_color;
5445 struct nk_color menu_border_color;
5446 struct nk_color group_border_color;
5447 struct nk_color tooltip_border_color;
5448 struct nk_style_item scaler;
5449
5450 float border;
5451 float combo_border;
5452 float contextual_border;
5453 float menu_border;
5454 float group_border;
5455 float tooltip_border;
5456 float popup_border;
5457 float min_row_height_padding;
5458
5459 float rounding;
5460 struct nk_vec2 spacing;
5461 struct nk_vec2 scrollbar_size;
5462 struct nk_vec2 min_size;
5463
5464 struct nk_vec2 padding;
5465 struct nk_vec2 group_padding;
5466 struct nk_vec2 popup_padding;
5467 struct nk_vec2 combo_padding;
5468 struct nk_vec2 contextual_padding;
5469 struct nk_vec2 menu_padding;
5470 struct nk_vec2 tooltip_padding;
5471
5472 enum nk_tooltip_pos tooltip_origin;
5473 struct nk_vec2 tooltip_offset;
5474 float tooltip_delay;
5475};
5476
5477struct nk_style {
5478 const struct nk_user_font *font;
5479 const struct nk_cursor *cursors[NK_CURSOR_COUNT];
5480 const struct nk_cursor *cursor_active;
5481 struct nk_cursor *cursor_last;
5482 int cursor_visible;
5483
5484 struct nk_style_text text;
5485 struct nk_style_link link;
5486 struct nk_style_button button;
5487 struct nk_style_button contextual_button;
5488 struct nk_style_button menu_button;
5489 struct nk_style_toggle option;
5490 struct nk_style_toggle checkbox;
5491 struct nk_style_selectable selectable;
5492 struct nk_style_slider slider;
5493 struct nk_style_knob knob;
5494 struct nk_style_progress progress;
5495 struct nk_style_property property;
5496 struct nk_style_edit edit;
5497 struct nk_style_chart chart;
5498 struct nk_style_scrollbar scrollh;
5499 struct nk_style_scrollbar scrollv;
5500 struct nk_style_tab tab;
5501 struct nk_style_combo combo;
5502 struct nk_style_window window;
5503};
5504
5505NK_API struct nk_style_item nk_style_item_color(struct nk_color);
5506NK_API struct nk_style_item nk_style_item_image(struct nk_image img);
5507NK_API struct nk_style_item nk_style_item_nine_slice(struct nk_nine_slice slice);
5508NK_API struct nk_style_item nk_style_item_hide(void);
5509
5510/*==============================================================
5511 * PANEL
5512 * =============================================================*/
5513#ifndef NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS
5514#define NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS 16
5515#endif
5516#ifndef NK_CHART_MAX_SLOT
5517#define NK_CHART_MAX_SLOT 4
5518#endif
5519
5520enum nk_panel_type {
5521 NK_PANEL_NONE = 0,
5522 NK_PANEL_WINDOW = NK_FLAG(0),
5523 NK_PANEL_GROUP = NK_FLAG(1),
5524 NK_PANEL_POPUP = NK_FLAG(2),
5525 NK_PANEL_CONTEXTUAL = NK_FLAG(4),
5526 NK_PANEL_COMBO = NK_FLAG(5),
5527 NK_PANEL_MENU = NK_FLAG(6),
5528 NK_PANEL_TOOLTIP = NK_FLAG(7)
5529};
5530enum nk_panel_set {
5531 NK_PANEL_SET_NONBLOCK = NK_PANEL_CONTEXTUAL|NK_PANEL_COMBO|NK_PANEL_MENU|NK_PANEL_TOOLTIP,
5532 NK_PANEL_SET_POPUP = NK_PANEL_SET_NONBLOCK|NK_PANEL_POPUP,
5533 NK_PANEL_SET_SUB = NK_PANEL_SET_POPUP|NK_PANEL_GROUP
5534};
5535
5537 enum nk_chart_type type;
5538 struct nk_color color;
5539 struct nk_color highlight;
5540 float min, max, range;
5541 int count;
5542 struct nk_vec2 last;
5543 int index;
5544 nk_bool show_markers;
5545};
5546
5547struct nk_chart {
5548 int slot;
5549 float x, y, w, h;
5550 struct nk_chart_slot slots[NK_CHART_MAX_SLOT];
5551};
5552
5553enum nk_panel_row_layout_type {
5554 NK_LAYOUT_DYNAMIC_FIXED = 0,
5555 NK_LAYOUT_DYNAMIC_ROW,
5556 NK_LAYOUT_DYNAMIC_FREE,
5557 NK_LAYOUT_DYNAMIC,
5558 NK_LAYOUT_STATIC_FIXED,
5559 NK_LAYOUT_STATIC_ROW,
5560 NK_LAYOUT_STATIC_FREE,
5561 NK_LAYOUT_STATIC,
5562 NK_LAYOUT_TEMPLATE,
5563 NK_LAYOUT_COUNT
5564};
5566 enum nk_panel_row_layout_type type;
5567 int index;
5568 float height;
5569 float min_height;
5570 int columns;
5571 const float *ratio;
5572 float item_width;
5573 float item_height;
5574 float item_offset;
5575 float filled;
5576 struct nk_rect item;
5577 int tree_depth;
5578 float templates[NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS];
5579};
5580
5582 nk_size begin;
5583 nk_size parent;
5584 nk_size last;
5585 nk_size end;
5586 nk_bool active;
5587};
5588
5590 float x, y, w, h;
5591 struct nk_scroll offset;
5592};
5593
5594struct nk_panel {
5595 enum nk_panel_type type;
5596 nk_flags flags;
5597 struct nk_rect bounds;
5598 nk_uint *offset_x;
5599 nk_uint *offset_y;
5600 float at_x, at_y, max_x;
5601 float footer_height;
5602 float header_height;
5603 float border;
5604 unsigned int has_scrolling;
5605 struct nk_rect clip;
5606 struct nk_menu_state menu;
5607 struct nk_row_layout row;
5608 struct nk_chart chart;
5609 struct nk_command_buffer *buffer;
5610 struct nk_panel *parent;
5611};
5612
5613/*==============================================================
5614 * WINDOW
5615 * =============================================================*/
5616#ifndef NK_WINDOW_MAX_NAME
5617#define NK_WINDOW_MAX_NAME 64
5618#endif
5619
5620struct nk_table;
5621enum nk_window_flags {
5622 NK_WINDOW_PRIVATE = NK_FLAG(11),
5623 NK_WINDOW_DYNAMIC = NK_WINDOW_PRIVATE,
5624 NK_WINDOW_ROM = NK_FLAG(12),
5625 NK_WINDOW_NOT_INTERACTIVE = NK_WINDOW_ROM|NK_WINDOW_NO_INPUT,
5626 NK_WINDOW_HIDDEN = NK_FLAG(13),
5627 NK_WINDOW_CLOSED = NK_FLAG(14),
5628 NK_WINDOW_MINIMIZED = NK_FLAG(15),
5629 NK_WINDOW_REMOVE_ROM = NK_FLAG(16)
5630};
5631
5633 struct nk_window *win;
5634 enum nk_panel_type type;
5635 struct nk_popup_buffer buf;
5636 nk_hash name;
5637 nk_bool active;
5638 unsigned combo_count;
5639 unsigned con_count, con_old;
5640 unsigned active_con;
5641 struct nk_rect header;
5642 float last_h;
5643 nk_bool pinned_up;
5644};
5645
5647 nk_hash name;
5648 unsigned int seq;
5649 unsigned int old;
5650 int active, prev;
5651 int cursor;
5652 int sel_start;
5653 int sel_end;
5654 struct nk_scroll scrollbar;
5655 unsigned char mode;
5656 unsigned char single_line;
5657};
5658
5660 int active, prev;
5661 char buffer[NK_MAX_NUMBER_BUFFER];
5662 int length;
5663 int cursor;
5664 int select_start;
5665 int select_end;
5666 nk_hash name;
5667 unsigned int seq;
5668 unsigned int old;
5669 int state;
5670 int prev_state;
5671 nk_hash prev_name;
5672 char prev_buffer[NK_MAX_NUMBER_BUFFER];
5673 int prev_length;
5674};
5675
5677 unsigned int seq;
5678 nk_hash name;
5679 char name_string[NK_WINDOW_MAX_NAME];
5680 nk_flags flags;
5681
5682 struct nk_rect bounds;
5683 struct nk_scroll scrollbar;
5684 struct nk_command_buffer buffer;
5685 struct nk_panel *layout;
5686 float scrollbar_hiding_timer;
5687
5688 /* persistent widget state */
5689 struct nk_property_state property;
5690 struct nk_popup_state popup;
5691 struct nk_edit_state edit;
5692 unsigned int scrolled;
5693 nk_bool widgets_disabled;
5694
5695 struct nk_table *tables;
5696 unsigned int table_count;
5697
5698 /* window list hooks */
5699 struct nk_window *next;
5700 struct nk_window *prev;
5701 struct nk_window *parent;
5702};
5703
5704/*==============================================================
5705 * STACK
5706 * =============================================================*/
5733
5734#ifndef NK_BUTTON_BEHAVIOR_STACK_SIZE
5735#define NK_BUTTON_BEHAVIOR_STACK_SIZE 8
5736#endif
5737
5738#ifndef NK_FONT_STACK_SIZE
5739#define NK_FONT_STACK_SIZE 8
5740#endif
5741
5742#ifndef NK_STYLE_ITEM_STACK_SIZE
5743#define NK_STYLE_ITEM_STACK_SIZE 16
5744#endif
5745
5746#ifndef NK_FLOAT_STACK_SIZE
5747#define NK_FLOAT_STACK_SIZE 32
5748#endif
5749
5750#ifndef NK_VECTOR_STACK_SIZE
5751#define NK_VECTOR_STACK_SIZE 16
5752#endif
5753
5754#ifndef NK_FLAGS_STACK_SIZE
5755#define NK_FLAGS_STACK_SIZE 32
5756#endif
5757
5758#ifndef NK_COLOR_STACK_SIZE
5759#define NK_COLOR_STACK_SIZE 32
5760#endif
5761
5762#define NK_CONFIGURATION_STACK_TYPE(prefix, name, type)\
5763 struct nk_config_stack_##name##_element {\
5764 prefix##_##type *address;\
5765 prefix##_##type old_value;\
5766 }
5767#define NK_CONFIG_STACK(type,size)\
5768 struct nk_config_stack_##type {\
5769 int head;\
5770 struct nk_config_stack_##type##_element elements[size];\
5771 }
5772
5773#define nk_float float
5774NK_CONFIGURATION_STACK_TYPE(struct nk, style_item, style_item);
5775NK_CONFIGURATION_STACK_TYPE(nk ,float, float);
5776NK_CONFIGURATION_STACK_TYPE(struct nk, vec2, vec2);
5777NK_CONFIGURATION_STACK_TYPE(nk ,flags, flags);
5778NK_CONFIGURATION_STACK_TYPE(struct nk, color, color);
5779NK_CONFIGURATION_STACK_TYPE(const struct nk, user_font, user_font*);
5780NK_CONFIGURATION_STACK_TYPE(enum nk, button_behavior, button_behavior);
5781
5782NK_CONFIG_STACK(style_item, NK_STYLE_ITEM_STACK_SIZE);
5783NK_CONFIG_STACK(float, NK_FLOAT_STACK_SIZE);
5784NK_CONFIG_STACK(vec2, NK_VECTOR_STACK_SIZE);
5785NK_CONFIG_STACK(flags, NK_FLAGS_STACK_SIZE);
5786NK_CONFIG_STACK(color, NK_COLOR_STACK_SIZE);
5787NK_CONFIG_STACK(user_font, NK_FONT_STACK_SIZE);
5788NK_CONFIG_STACK(button_behavior, NK_BUTTON_BEHAVIOR_STACK_SIZE);
5789
5791 struct nk_config_stack_style_item style_items;
5792 struct nk_config_stack_float floats;
5793 struct nk_config_stack_vec2 vectors;
5794 struct nk_config_stack_flags flags;
5795 struct nk_config_stack_color colors;
5796 struct nk_config_stack_user_font fonts;
5797 struct nk_config_stack_button_behavior button_behaviors;
5798};
5799
5800/*==============================================================
5801 * CONTEXT
5802 * =============================================================*/
5803#define NK_VALUE_PAGE_CAPACITY \
5804 (((NK_MAX(sizeof(struct nk_window),sizeof(struct nk_panel)) / sizeof(nk_uint))) / 2)
5805
5806struct nk_table {
5807 unsigned int seq;
5808 unsigned int size;
5809 nk_hash keys[NK_VALUE_PAGE_CAPACITY];
5810 nk_uint values[NK_VALUE_PAGE_CAPACITY];
5811 struct nk_table *next, *prev;
5812};
5813
5815 struct nk_table tbl;
5816 struct nk_panel pan;
5817 struct nk_window win;
5818};
5819
5821 union nk_page_data data;
5822 struct nk_page_element *next;
5823 struct nk_page_element *prev;
5824};
5825
5826struct nk_page {
5827 unsigned int size;
5828 struct nk_page *next;
5829 struct nk_page_element win[1];
5830};
5831
5832struct nk_pool {
5833 struct nk_allocator alloc;
5834 enum nk_allocation_type type;
5835 unsigned int page_count;
5836 struct nk_page *pages;
5837 struct nk_page_element *freelist;
5838 unsigned capacity;
5839 nk_size size;
5840 nk_size cap;
5841};
5842
5844/* public: can be accessed freely */
5845 struct nk_input input;
5846 struct nk_style style;
5847 struct nk_buffer memory;
5848 struct nk_clipboard clip;
5849 nk_flags last_widget_state;
5850 enum nk_button_behavior button_behavior;
5851 struct nk_configuration_stacks stacks;
5852 float delta_time_seconds;
5856
5857/* private:
5858 should only be accessed if you
5859 know what you are doing */
5860#ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT
5861 struct nk_draw_list draw_list;
5862#endif
5863#ifdef NK_INCLUDE_COMMAND_USERDATA
5864 nk_handle userdata;
5865#endif
5873
5876 int use_pool;
5877 struct nk_pool pool;
5878 struct nk_window *begin;
5879 struct nk_window *end;
5880 struct nk_window *active;
5881 struct nk_window *current;
5882 struct nk_page_element *freelist;
5883 unsigned int count;
5884 unsigned int seq;
5885};
5886
5887/* ==============================================================
5888 * MATH
5889 * =============================================================== */
5890#define NK_PI 3.141592654f
5891#define NK_PI_HALF 1.570796326f
5892#define NK_UTF_INVALID 0xFFFD
5893/* Digits after decimal for nk_property_float/double display. Overridable before include. */
5894#ifndef NK_MAX_FLOAT_PRECISION
5895#define NK_MAX_FLOAT_PRECISION 2
5896#endif
5897
5898#define NK_UNUSED(x) ((void)(x))
5899#define NK_SATURATE(x) (NK_MAX(0, NK_MIN(1.0f, x)))
5900#define NK_LEN(a) (sizeof(a)/sizeof(a)[0])
5901#define NK_ABS(a) (((a) < 0) ? -(a) : (a))
5902#define NK_BETWEEN(x, a, b) ((a) <= (x) && (x) < (b))
5903#define NK_INBOX(px, py, x, y, w, h)\
5904 (NK_BETWEEN(px,x,x+w) && NK_BETWEEN(py,y,y+h))
5905#define NK_INTERSECT(x0, y0, w0, h0, x1, y1, w1, h1) \
5906 ((x1 < (x0 + w0)) && (x0 < (x1 + w1)) && \
5907 (y1 < (y0 + h0)) && (y0 < (y1 + h1)))
5908#define NK_CONTAINS(x, y, w, h, bx, by, bw, bh)\
5909 (NK_INBOX(x,y, bx, by, bw, bh) && NK_INBOX(x+w,y+h, bx, by, bw, bh))
5910
5911#define nk_vec2_sub(a, b) nk_vec2((a).x - (b).x, (a).y - (b).y)
5912#define nk_vec2_add(a, b) nk_vec2((a).x + (b).x, (a).y + (b).y)
5913#define nk_vec2_len_sqr(a) ((a).x*(a).x+(a).y*(a).y)
5914#define nk_vec2_muls(a, t) nk_vec2((a).x * (t), (a).y * (t))
5915
5916#define nk_ptr_add(t, p, i) ((t*)((void*)((nk_byte*)(p) + (i))))
5917#define nk_ptr_add_const(t, p, i) ((const t*)((const void*)((const nk_byte*)(p) + (i))))
5918#define nk_zero_struct(s) nk_zero(&s, sizeof(s))
5919
5920/* ==============================================================
5921 * ALIGNMENT
5922 * =============================================================== */
5923/* Pointer to Integer type conversion for pointer alignment */
5924#if defined(__PTRDIFF_TYPE__) /* This case should work for GCC*/
5925# define NK_UINT_TO_PTR(x) ((void*)(__PTRDIFF_TYPE__)(x))
5926# define NK_PTR_TO_UINT(x) ((nk_size)(__PTRDIFF_TYPE__)(x))
5927#elif !defined(__GNUC__) /* works for compilers other than LLVM */
5928# define NK_UINT_TO_PTR(x) ((void*)&((char*)0)[x])
5929# define NK_PTR_TO_UINT(x) ((nk_size)(((char*)x)-(char*)0))
5930#elif defined(NK_USE_FIXED_TYPES) /* used if we have <stdint.h> */
5931# define NK_UINT_TO_PTR(x) ((void*)(uintptr_t)(x))
5932# define NK_PTR_TO_UINT(x) ((uintptr_t)(x))
5933#else /* generates warning but works */
5934# define NK_UINT_TO_PTR(x) ((void*)(x))
5935# define NK_PTR_TO_UINT(x) ((nk_size)(x))
5936#endif
5937
5938#define NK_ALIGN_PTR(x, mask)\
5939 (NK_UINT_TO_PTR((NK_PTR_TO_UINT((nk_byte*)(x) + (mask-1)) & ~(mask-1))))
5940#define NK_ALIGN_PTR_BACK(x, mask)\
5941 (NK_UINT_TO_PTR((NK_PTR_TO_UINT((nk_byte*)(x)) & ~(mask-1))))
5942
5943#if ((defined(__GNUC__) && __GNUC__ >= 4) || defined(__clang__)) && !defined(__EMSCRIPTEN__)
5944#define NK_OFFSETOF(st,m) (__builtin_offsetof(st,m))
5945#else
5946#define NK_OFFSETOF(st,m) ((nk_ptr)&(((st*)0)->m))
5947#endif
5948
5949#ifdef __cplusplus
5950}
5951#endif
5952
5953#ifdef __cplusplus
5954template<typename T> struct nk_alignof;
5955template<typename T, int size_diff> struct nk_helper{enum {value = size_diff};};
5956template<typename T> struct nk_helper<T,0>{enum {value = nk_alignof<T>::value};};
5957template<typename T> struct nk_alignof{struct Big {T x; char c;}; enum {
5958 diff = sizeof(Big) - sizeof(T), value = nk_helper<Big, diff>::value};};
5959#define NK_ALIGNOF(t) (nk_alignof<t>::value)
5960#else
5961#define NK_ALIGNOF(t) NK_OFFSETOF(struct {char c; t _h;}, _h)
5962#endif
5963
5964#define NK_CONTAINER_OF(ptr,type,member)\
5965 (type*)((void*)((char*)(1 ? (ptr): &((type*)0)->member) - NK_OFFSETOF(type, member)))
5966
5967
5968
5969#endif /* NK_NUKLEAR_H_ */
struct nk_allocator pool
!< buffer marker to free a buffer to a certain offset
Definition nuklear.h:4301
struct nk_memory memory
!< memory management type
Definition nuklear.h:4303
enum nk_allocation_type type
!< allocator callback for dynamic buffers
Definition nuklear.h:4302
nk_size needed
!< total amount of memory allocated
Definition nuklear.h:4306
nk_size size
!< number of allocation calls
Definition nuklear.h:4308
nk_size allocated
!< growing factor for dynamic memory management
Definition nuklear.h:4305
float grow_factor
!< memory and size of the current memory block
Definition nuklear.h:4304
nk_size calls
!< totally consumed memory given that enough memory is present
Definition nuklear.h:4307
command base and header of every command inside the buffer
Definition nuklear.h:4577
int build
windows
Definition nuklear.h:5875
struct nk_rect display_bounds
surface nuklear is drawn into, in widget/mouse space.
Definition nuklear.h:5855
struct nk_text_edit text_edit
text editor objects are quite big because of an internal undo/redo stack.
Definition nuklear.h:5870
struct nk_command_buffer overlay
draw buffer used for overlay drawing operation like cursor
Definition nuklear.h:5872
enum nk_anti_aliasing shape_AA
!< line anti-aliasing flag can be turned off if you are tight on memory
Definition nuklear.h:1070
enum nk_anti_aliasing line_AA
!< global alpha value
Definition nuklear.h:1069
nk_size vertex_alignment
!< sizeof one vertex for vertex packing
Definition nuklear.h:1077
nk_size vertex_size
!< describes the vertex output format and packing
Definition nuklear.h:1076
const struct nk_draw_vertex_layout_element * vertex_layout
!< handle to texture with a white pixel for shape drawing
Definition nuklear.h:1075
unsigned arc_segment_count
!< number of segments used for circles: default to 22
Definition nuklear.h:1072
unsigned circle_segment_count
!< shape anti-aliasing flag can be turned off if you are tight on memory
Definition nuklear.h:1071
unsigned curve_segment_count
!< number of segments used for arcs: default to 22
Definition nuklear.h:1073
struct nk_draw_null_texture tex_null
!< number of segments used for curves: default to 22
Definition nuklear.h:1074
struct nk_vec2 uv
!< texture handle to a texture with a white pixel
Definition nuklear.h:1065
float last_h
last frame's content height; used to flip without a gap
Definition nuklear.h:5642
nk_bool pinned_up
keep drop-up once chosen so expand/collapse does not jump
Definition nuklear.h:5643
Basic string buffer which is only used in context with the text editor to manage and manipulate dynam...
Definition nuklear.h:4336
nk_text_width_f width
!< max height of the font
Definition nuklear.h:4119
float height
!< user provided font handle
Definition nuklear.h:4118