20#define NK_UNDEFINED (-1.0f)
21#define NK_UTF_INVALID 0xFFFD
24 #define NK_INPUT_MAX 16
26#ifndef NK_MAX_NUMBER_BUFFER
27 #define NK_MAX_NUMBER_BUFFER 64
29#ifndef NK_SCROLLBAR_HIDING_TIMEOUT
30 #define NK_SCROLLBAR_HIDING_TIMEOUT 4.0f
42 #if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199409L))
43 #define NK_API static inline
44 #elif defined(__cplusplus)
45 #define NK_API static inline
61#define NK_INTERN static
62#define NK_STORAGE static
63#define NK_GLOBAL static
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)
73 #define NK_UNIQUE_NAME(name) NK_STRING_JOIN(name,__COUNTER__)
75 #define NK_UNIQUE_NAME(name) NK_STRING_JOIN(name,__LINE__)
78#ifndef NK_STATIC_ASSERT
79 #define NK_STATIC_ASSERT(exp) typedef char NK_UNIQUE_NAME(_dummy_array)[(exp)?1:-1]
84 #define NK_FILE_LINE __FILE__ ":" NK_MACRO_STRINGIFY(__COUNTER__)
86 #define NK_FILE_LINE __FILE__ ":" NK_MACRO_STRINGIFY(__LINE__)
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))
94#ifdef NK_INCLUDE_STANDARD_VARARGS
96 #if defined(_MSC_VER) && (_MSC_VER >= 1600)
98 #define NK_PRINTF_FORMAT_STRING _Printf_format_string_
100 #define NK_PRINTF_FORMAT_STRING
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)))
106 #define NK_PRINTF_VARARG_FUNC(fmtargnumber)
107 #define NK_PRINTF_VALIST_FUNC(fmtargnumber)
118 #ifdef NK_INCLUDE_FIXED_TYPES
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
130 #define NK_INT8 signed char
133 #define NK_UINT8 unsigned char
136 #define NK_INT16 signed short
139 #define NK_UINT16 unsigned short
142 #if defined(_MSC_VER)
143 #define NK_INT32 __int32
145 #define NK_INT32 signed int
149 #if defined(_MSC_VER)
150 #define NK_UINT32 unsigned __int32
152 #define NK_UINT32 unsigned int
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
168 #define NK_SIZE_TYPE unsigned int
171 #define NK_SIZE_TYPE unsigned long
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
187 #define NK_POINTER_TYPE unsigned int
190 #define NK_POINTER_TYPE unsigned long
197 #ifdef NK_INCLUDE_STANDARD_BOOL
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;
216typedef nk_uint nk_hash;
217typedef nk_uint nk_flags;
218typedef nk_uint nk_rune;
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));
242struct nk_draw_command;
250struct nk_draw_vertex_layout_element;
255struct nk_style_slide;
266enum {nk_false, nk_true};
273typedef char nk_glyph[NK_UTF_SIZE];
281NK_STATIC_ASSERT(!((nk_bool)0) == !(nk_false));
282NK_STATIC_ASSERT(!((nk_bool)1) == !(nk_true));
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
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};
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);
320typedef void(*nk_plugin_copy)(
nk_handle,
const char*,
int len);
324 nk_plugin_alloc alloc;
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,
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,
392#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
504#ifdef NK_INCLUDE_COMMAND_USERDATA
603 NK_KEY_TEXT_INSERT_MODE,
604 NK_KEY_TEXT_REPLACE_MODE,
605 NK_KEY_TEXT_RESET_MODE,
606 NK_KEY_TEXT_LINE_START,
607 NK_KEY_TEXT_LINE_END,
612 NK_KEY_TEXT_SELECT_ALL,
613 NK_KEY_TEXT_WORD_LEFT,
614 NK_KEY_TEXT_WORD_RIGHT,
656NK_API
void nk_input_begin(
struct nk_context*);
670NK_API
void nk_input_motion(
struct nk_context*,
int x,
int y);
684NK_API
void nk_input_key(
struct nk_context*,
enum nk_keys, nk_bool down);
700NK_API
void nk_input_button(
struct nk_context*,
enum nk_buttons,
int x,
int y, nk_bool down);
734NK_API
void nk_input_char(
struct nk_context*,
char);
749NK_API
void nk_input_glyph(
struct nk_context*,
const nk_glyph);
765NK_API
void nk_input_unicode(
struct nk_context*, nk_rune);
1011enum nk_anti_aliasing {NK_ANTI_ALIASING_OFF, NK_ANTI_ALIASING_ON};
1012enum nk_convert_result {
1013 NK_CONVERT_SUCCESS = 0,
1014 NK_CONVERT_INVALID_PARAM = 1,
1015 NK_CONVERT_COMMAND_BUFFER_FULL = NK_FLAG(1),
1016 NK_CONVERT_VERTEX_BUFFER_FULL = NK_FLAG(2),
1017 NK_CONVERT_ELEMENT_BUFFER_FULL = NK_FLAG(3)
1076#define nk_foreach(c, ctx) for((c) = nk__begin(ctx); (c) != 0; (c) = nk__next(ctx,c))
1078#ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT
1124NK_API
const struct nk_draw_command* nk__draw_begin(
const struct nk_context*,
const struct nk_buffer*);
1143NK_API
const struct nk_draw_command* nk__draw_end(
const struct nk_context*,
const struct nk_buffer*);
1162NK_API
const struct nk_draw_command* nk__draw_next(
const struct nk_draw_command*,
const struct nk_buffer*,
const struct nk_context*);
1179#define nk_draw_foreach(cmd,ctx, b) for((cmd)=nk__draw_begin(ctx, b); (cmd)!=0; (cmd)=nk__draw_next(cmd, b, ctx))
1335enum nk_panel_flags {
1336 NK_WINDOW_BORDER = NK_FLAG(0),
1337 NK_WINDOW_MOVABLE = NK_FLAG(1),
1338 NK_WINDOW_SCALABLE = NK_FLAG(2),
1339 NK_WINDOW_CLOSABLE = NK_FLAG(3),
1340 NK_WINDOW_MINIMIZABLE = NK_FLAG(4),
1341 NK_WINDOW_NO_SCROLLBAR = NK_FLAG(5),
1342 NK_WINDOW_TITLE = NK_FLAG(6),
1343 NK_WINDOW_SCROLL_AUTO_HIDE = NK_FLAG(7),
1344 NK_WINDOW_BACKGROUND = NK_FLAG(8),
1345 NK_WINDOW_SCALE_LEFT = NK_FLAG(9),
1346 NK_WINDOW_NO_INPUT = NK_FLAG(10)
1369NK_API nk_bool nk_begin(
struct nk_context *ctx,
const char *title,
struct nk_rect bounds, nk_flags flags);
1392NK_API nk_bool nk_begin_titled(
struct nk_context *ctx,
const char *name,
const char *title,
struct nk_rect bounds, nk_flags flags);
1501NK_API
float nk_window_get_width(
const struct nk_context *ctx);
1520NK_API
float nk_window_get_height(
const struct nk_context* ctx);
1562NK_API
struct nk_rect nk_window_get_content_region(const struct
nk_context* ctx);
1583NK_API
struct nk_vec2 nk_window_get_content_region_min(const struct
nk_context *ctx);
1604NK_API
struct nk_vec2 nk_window_get_content_region_max(const struct
nk_context *ctx);
1624NK_API
struct nk_vec2 nk_window_get_content_region_size(const struct
nk_context *ctx);
1661NK_API
void nk_window_get_scroll(
const struct nk_context *ctx, nk_uint *offset_x, nk_uint *offset_y);
1679NK_API nk_bool nk_window_has_focus(
const struct nk_context *ctx);
1697NK_API nk_bool nk_window_is_hovered(
const struct nk_context *ctx);
1715NK_API nk_bool nk_window_is_collapsed(
const struct nk_context *ctx,
const char *name);
1732NK_API nk_bool nk_window_is_closed(
const struct nk_context *ctx,
const char* name);
1749NK_API nk_bool nk_window_is_hidden(
const struct nk_context *ctx,
const char* name);
1765NK_API nk_bool nk_window_is_active(
const struct nk_context *ctx,
const char* name);
1780NK_API nk_bool nk_window_is_any_hovered(
const struct nk_context *ctx);
1798NK_API nk_bool nk_item_is_any_active(
const struct nk_context *ctx);
1814NK_API
void nk_window_set_bounds(
struct nk_context *ctx,
const char *name,
struct nk_rect bounds);
1830NK_API
void nk_window_set_position(
struct nk_context *ctx,
const char *name,
struct nk_vec2 pos);
1846NK_API
void nk_window_set_size(
struct nk_context *ctx,
const char *name,
struct nk_vec2 size);
1861NK_API
void nk_window_set_focus(
struct nk_context *ctx,
const char *name);
1879NK_API
void nk_window_set_scroll(
struct nk_context *ctx, nk_uint offset_x, nk_uint offset_y);
1894NK_API
void nk_window_close(
struct nk_context *ctx,
const char *name);
1910NK_API
void nk_window_collapse(
struct nk_context *ctx,
const char *name,
enum nk_collapse_states state);
1927NK_API
void nk_window_collapse_if(
struct nk_context *ctx,
const char *name,
enum nk_collapse_states state,
int cond);
1942NK_API
void nk_window_show(
struct nk_context *ctx,
const char *name,
enum nk_show_states state);
1959NK_API
void nk_window_show_if(
struct nk_context *ctx,
const char *name,
enum nk_show_states state,
int cond);
1974NK_API
void nk_rule_horizontal(
struct nk_context *ctx,
struct nk_color color, nk_bool rounding);
2248enum nk_widget_align {
2249 NK_WIDGET_ALIGN_LEFT = 0x01,
2250 NK_WIDGET_ALIGN_CENTERED = 0x02,
2251 NK_WIDGET_ALIGN_RIGHT = 0x04,
2252 NK_WIDGET_ALIGN_TOP = 0x08,
2253 NK_WIDGET_ALIGN_MIDDLE = 0x10,
2254 NK_WIDGET_ALIGN_BOTTOM = 0x20
2256enum nk_widget_alignment {
2257 NK_WIDGET_LEFT = NK_WIDGET_ALIGN_MIDDLE|NK_WIDGET_ALIGN_LEFT,
2258 NK_WIDGET_CENTERED = NK_WIDGET_ALIGN_MIDDLE|NK_WIDGET_ALIGN_CENTERED,
2259 NK_WIDGET_RIGHT = NK_WIDGET_ALIGN_MIDDLE|NK_WIDGET_ALIGN_RIGHT
2274NK_API
void nk_layout_set_min_row_height(
struct nk_context*,
float height);
2284NK_API
void nk_layout_reset_min_row_height(
struct nk_context*);
2313NK_API
float nk_layout_ratio_from_pixel(
const struct nk_context *ctx,
float pixel_width);
2329NK_API
void nk_layout_row_dynamic(
struct nk_context *ctx,
float height,
int cols);
2346NK_API
void nk_layout_row_static(
struct nk_context *ctx,
float height,
int item_width,
int cols);
2361NK_API
void nk_layout_row_begin(
struct nk_context *ctx,
enum nk_layout_format fmt,
float row_height,
int cols);
2374NK_API
void nk_layout_row_push(
struct nk_context*,
float value);
2386NK_API
void nk_layout_row_end(
struct nk_context*);
2401NK_API
void nk_layout_row(
struct nk_context*,
enum nk_layout_format,
float height,
int cols,
const float *ratio);
2415NK_API
void nk_layout_row_template_begin(
struct nk_context*,
float row_height);
2429NK_API
void nk_layout_row_template_push_dynamic(
struct nk_context*);
2443NK_API
void nk_layout_row_template_push_variable(
struct nk_context*,
float min_width);
2457NK_API
void nk_layout_row_template_push_static(
struct nk_context*,
float width);
2470NK_API
void nk_layout_row_template_end(
struct nk_context*);
2486NK_API
void nk_layout_space_begin(
struct nk_context*,
enum nk_layout_format,
float height,
int widget_count);
2513NK_API
void nk_layout_space_end(
struct nk_context*);
2606NK_API
void nk_spacer(
struct nk_context *ctx);
2713NK_API nk_bool nk_group_begin(
struct nk_context*,
const char *title, nk_flags);
2728NK_API nk_bool nk_group_begin_titled(
struct nk_context*,
const char *name,
const char *title, nk_flags);
2761NK_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);
2780NK_API nk_bool nk_group_scrolled_begin(
struct nk_context*,
struct nk_scroll *off,
const char *title, nk_flags);
2793NK_API
void nk_group_scrolled_end(
struct nk_context*);
2809NK_API
void nk_group_get_scroll(
struct nk_context*,
const char *
id, nk_uint *x_offset, nk_uint *y_offset);
2825NK_API
void nk_group_set_scroll(
struct nk_context*,
const char *
id, nk_uint x_offset, nk_uint y_offset);
2918#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__)
2937#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)
2959NK_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);
2982#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__)
3004#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)
3027NK_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);
3058NK_API nk_bool nk_tree_state_push(
struct nk_context*,
enum nk_tree_type,
const char *title,
enum nk_collapse_states *state);
3077NK_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);
3090NK_API
void nk_tree_state_pop(
struct nk_context*);
3092#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__)
3093#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)
3094NK_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);
3095NK_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);
3096NK_API
void nk_tree_element_pop(
struct nk_context*);
3105 int begin, end, count;
3109 nk_uint *scroll_pointer;
3110 nk_uint scroll_value;
3112NK_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);
3119enum nk_widget_layout_states {
3125enum nk_widget_states {
3126 NK_WIDGET_STATE_MODIFIED = NK_FLAG(1),
3127 NK_WIDGET_STATE_INACTIVE = NK_FLAG(2),
3128 NK_WIDGET_STATE_ENTERED = NK_FLAG(3),
3129 NK_WIDGET_STATE_HOVER = NK_FLAG(4),
3130 NK_WIDGET_STATE_ACTIVED = NK_FLAG(5),
3131 NK_WIDGET_STATE_LEFT = NK_FLAG(6),
3132 NK_WIDGET_STATE_HOVERED = NK_WIDGET_STATE_HOVER|NK_WIDGET_STATE_MODIFIED,
3133 NK_WIDGET_STATE_ACTIVE = NK_WIDGET_STATE_ACTIVED|NK_WIDGET_STATE_MODIFIED
3135NK_API
enum nk_widget_layout_states nk_widget(
struct nk_rect*,
const struct nk_context*);
3136#define nk_widget_fitting(bounds, ctx, padding) nk_widget(bounds, ctx)
3140NK_API
float nk_widget_width(
const struct nk_context*);
3141NK_API
float nk_widget_height(
const struct nk_context*);
3142NK_API nk_bool nk_widget_is_hovered(
const struct nk_context*);
3143NK_API nk_bool nk_widget_is_mouse_clicked(
const struct nk_context*,
enum nk_buttons);
3144NK_API nk_bool nk_widget_has_mouse_click_down(
const struct nk_context*,
enum nk_buttons, nk_bool down);
3145NK_API
void nk_spacing(
struct nk_context*,
int cols);
3146NK_API
void nk_widget_disable_begin(
struct nk_context* ctx);
3147NK_API
void nk_widget_disable_end(
struct nk_context* ctx);
3154 NK_TEXT_ALIGN_LEFT = 0x01,
3155 NK_TEXT_ALIGN_CENTERED = 0x02,
3156 NK_TEXT_ALIGN_RIGHT = 0x04,
3157 NK_TEXT_ALIGN_TOP = 0x08,
3158 NK_TEXT_ALIGN_MIDDLE = 0x10,
3159 NK_TEXT_ALIGN_BOTTOM = 0x20
3161enum nk_text_alignment {
3162 NK_TEXT_LEFT = NK_TEXT_ALIGN_MIDDLE|NK_TEXT_ALIGN_LEFT,
3163 NK_TEXT_CENTERED = NK_TEXT_ALIGN_MIDDLE|NK_TEXT_ALIGN_CENTERED,
3164 NK_TEXT_RIGHT = NK_TEXT_ALIGN_MIDDLE|NK_TEXT_ALIGN_RIGHT
3167NK_API
void nk_text_colored(
struct nk_context*,
const char*,
int, nk_flags,
struct nk_color);
3168NK_API
void nk_text_wrap(
struct nk_context*,
const char*,
int);
3169NK_API
void nk_text_wrap_colored(
struct nk_context*,
const char*,
int,
struct nk_color);
3170NK_API
void nk_label(
struct nk_context*,
const char*, nk_flags align);
3171NK_API
void nk_label_colored(
struct nk_context*,
const char*, nk_flags align,
struct nk_color);
3172NK_API
void nk_label_wrap(
struct nk_context*,
const char*);
3176#ifdef NK_INCLUDE_STANDARD_VARARGS
3177NK_API
void nk_labelf(
struct nk_context*, nk_flags, NK_PRINTF_FORMAT_STRING
const char*, ...) NK_PRINTF_VARARG_FUNC(3);
3178NK_API
void nk_labelf_colored(struct
nk_context*, nk_flags, struct
nk_color, NK_PRINTF_FORMAT_STRING const
char*,...) NK_PRINTF_VARARG_FUNC(4);
3179NK_API
void nk_labelf_wrap(struct
nk_context*, NK_PRINTF_FORMAT_STRING const
char*,...) NK_PRINTF_VARARG_FUNC(2);
3180NK_API
void nk_labelf_colored_wrap(struct
nk_context*, struct
nk_color, NK_PRINTF_FORMAT_STRING const
char*,...) NK_PRINTF_VARARG_FUNC(3);
3181NK_API
void nk_labelfv(struct
nk_context*, nk_flags, NK_PRINTF_FORMAT_STRING const
char*, va_list) NK_PRINTF_VALIST_FUNC(3);
3182NK_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);
3183NK_API
void nk_labelfv_wrap(struct
nk_context*, NK_PRINTF_FORMAT_STRING const
char*, va_list) NK_PRINTF_VALIST_FUNC(2);
3184NK_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);
3185NK_API
void nk_value_bool(struct
nk_context*, const
char *prefix,
int);
3186NK_API
void nk_value_int(struct
nk_context*, const
char *prefix,
int);
3187NK_API
void nk_value_uint(struct
nk_context*, const
char *prefix,
unsigned int);
3188NK_API
void nk_value_float(struct
nk_context*, const
char *prefix,
float);
3189NK_API
void nk_value_color_byte(struct
nk_context*, const
char *prefix, struct
nk_color);
3190NK_API
void nk_value_color_float(struct
nk_context*, const
char *prefix, struct
nk_color);
3191NK_API
void nk_value_color_hex(struct
nk_context*, const
char *prefix, struct
nk_color);
3198NK_API nk_bool nk_link_text(
struct nk_context*,
const char *title,
int len, nk_flags align);
3199NK_API nk_bool nk_link_label(
struct nk_context*,
const char *title, nk_flags align);
3200NK_API nk_bool nk_link_text_styled(
struct nk_context*,
const struct nk_style_link*,
const char *title,
int len, nk_flags align);
3201NK_API nk_bool nk_link_label_styled(
struct nk_context*,
const struct nk_style_link*,
const char *title, nk_flags align);
3202NK_API nk_bool nk_link_text_underline(
struct nk_context*,
const char *title,
int len, nk_flags align,
enum nk_link_underline);
3203NK_API nk_bool nk_link_label_underline(
struct nk_context*,
const char *title, nk_flags align,
enum nk_link_underline);
3204NK_API nk_bool nk_link_text_hover_underline(
struct nk_context*,
const char *title,
int len, nk_flags align);
3205NK_API nk_bool nk_link_label_hover_underline(
struct nk_context*,
const char *title, nk_flags align);
3206NK_API nk_bool nk_link_text_no_underline(
struct nk_context*,
const char *title,
int len, nk_flags align);
3207NK_API nk_bool nk_link_label_no_underline(
struct nk_context*,
const char *title, nk_flags align);
3208NK_API nk_bool nk_link_text_colored(
struct nk_context*,
const char *title,
int len, nk_flags align,
struct nk_color);
3209NK_API nk_bool nk_link_label_colored(
struct nk_context*,
const char *title, nk_flags align,
struct nk_color);
3215NK_API nk_bool nk_button_text(
struct nk_context*,
const char *title,
int len);
3216NK_API nk_bool nk_button_label(
struct nk_context*,
const char *title);
3218NK_API nk_bool nk_button_symbol(
struct nk_context*,
enum nk_symbol_type);
3220NK_API nk_bool nk_button_symbol_label(
struct nk_context*,
enum nk_symbol_type,
const char*, nk_flags text_alignment);
3221NK_API nk_bool nk_button_symbol_text(
struct nk_context*,
enum nk_symbol_type,
const char*,
int, nk_flags alignment);
3222NK_API nk_bool nk_button_image_label(
struct nk_context*,
struct nk_image img,
const char*, nk_flags text_alignment);
3223NK_API nk_bool nk_button_image_text(
struct nk_context*,
struct nk_image img,
const char*,
int, nk_flags alignment);
3228NK_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);
3229NK_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);
3232NK_API
void nk_button_set_behavior(
struct nk_context*,
enum nk_button_behavior);
3233NK_API nk_bool nk_button_push_behavior(
struct nk_context*,
enum nk_button_behavior);
3234NK_API nk_bool nk_button_pop_behavior(
struct nk_context*);
3240NK_API nk_bool nk_check_label(
struct nk_context*,
const char*, nk_bool active);
3241NK_API nk_bool nk_check_text(
struct nk_context*,
const char*,
int, nk_bool active);
3242NK_API nk_bool nk_check_text_align(
struct nk_context*,
const char*,
int, nk_bool active, nk_flags widget_alignment, nk_flags text_alignment);
3243NK_API
unsigned nk_check_flags_label(
struct nk_context*,
const char*,
unsigned int flags,
unsigned int value);
3244NK_API
unsigned nk_check_flags_text(
struct nk_context*,
const char*,
int,
unsigned int flags,
unsigned int value);
3245NK_API nk_bool nk_checkbox_label(
struct nk_context*,
const char*, nk_bool *active);
3246NK_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);
3247NK_API nk_bool nk_checkbox_text(
struct nk_context*,
const char*,
int, nk_bool *active);
3248NK_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);
3249NK_API nk_bool nk_checkbox_flags_label(
struct nk_context*,
const char*,
unsigned int *flags,
unsigned int value);
3250NK_API nk_bool nk_checkbox_flags_text(
struct nk_context*,
const char*,
int,
unsigned int *flags,
unsigned int value);
3256NK_API nk_bool nk_radio_label(
struct nk_context*,
const char*, nk_bool *active);
3257NK_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);
3258NK_API nk_bool nk_radio_text(
struct nk_context*,
const char*,
int, nk_bool *active);
3259NK_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);
3260NK_API nk_bool nk_option_label(
struct nk_context*,
const char*, nk_bool active);
3261NK_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);
3262NK_API nk_bool nk_option_text(
struct nk_context*,
const char*,
int, nk_bool active);
3263NK_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);
3269NK_API nk_bool nk_selectable_label(
struct nk_context*,
const char*, nk_flags align, nk_bool *value);
3270NK_API nk_bool nk_selectable_text(
struct nk_context*,
const char*,
int, nk_flags align, nk_bool *value);
3271NK_API nk_bool nk_selectable_image_label(
struct nk_context*,
struct nk_image,
const char*, nk_flags align, nk_bool *value);
3272NK_API nk_bool nk_selectable_image_text(
struct nk_context*,
struct nk_image,
const char*,
int, nk_flags align, nk_bool *value);
3273NK_API nk_bool nk_selectable_symbol_label(
struct nk_context*,
enum nk_symbol_type,
const char*, nk_flags align, nk_bool *value);
3274NK_API nk_bool nk_selectable_symbol_text(
struct nk_context*,
enum nk_symbol_type,
const char*,
int, nk_flags align, nk_bool *value);
3276NK_API nk_bool nk_select_label(
struct nk_context*,
const char*, nk_flags align, nk_bool value);
3277NK_API nk_bool nk_select_text(
struct nk_context*,
const char*,
int, nk_flags align, nk_bool value);
3278NK_API nk_bool nk_select_image_label(
struct nk_context*,
struct nk_image,
const char*, nk_flags align, nk_bool value);
3279NK_API nk_bool nk_select_image_text(
struct nk_context*,
struct nk_image,
const char*,
int, nk_flags align, nk_bool value);
3280NK_API nk_bool nk_select_symbol_label(
struct nk_context*,
enum nk_symbol_type,
const char*, nk_flags align, nk_bool value);
3281NK_API nk_bool nk_select_symbol_text(
struct nk_context*,
enum nk_symbol_type,
const char*,
int, nk_flags align, nk_bool value);
3288NK_API
float nk_slide_float(
struct nk_context*,
float min,
float val,
float max,
float step);
3289NK_API
int nk_slide_int(
struct nk_context*,
int min,
int val,
int max,
int step);
3290NK_API nk_bool nk_slider_float(
struct nk_context*,
float min,
float *val,
float max,
float step);
3291NK_API nk_bool nk_slider_int(
struct nk_context*,
int min,
int *val,
int max,
int step);
3298NK_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);
3299NK_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);
3306NK_API nk_bool nk_progress(
struct nk_context*, nk_size *cur, nk_size max, nk_bool modifyable);
3307NK_API nk_size nk_prog(
struct nk_context*, nk_size cur, nk_size max, nk_bool modifyable);
3414NK_API nk_bool nk_property_int(
struct nk_context*,
const char *name,
int min,
int *val,
int max,
int step,
float inc_per_pixel);
3438NK_API nk_bool nk_property_float(
struct nk_context*,
const char *name,
float min,
float *val,
float max,
float step,
float inc_per_pixel);
3462NK_API nk_bool nk_property_double(
struct nk_context*,
const char *name,
double min,
double *val,
double max,
double step,
float inc_per_pixel);
3484NK_API
int nk_propertyi(
struct nk_context*,
const char *name,
int min,
int val,
int max,
int step,
float inc_per_pixel);
3506NK_API
float nk_propertyf(
struct nk_context*,
const char *name,
float min,
float val,
float max,
float step,
float inc_per_pixel);
3528NK_API
double nk_propertyd(
struct nk_context*,
const char *name,
double min,
double val,
double max,
double step,
float inc_per_pixel);
3536 NK_EDIT_DEFAULT = 0,
3537 NK_EDIT_READ_ONLY = NK_FLAG(0),
3538 NK_EDIT_AUTO_SELECT = NK_FLAG(1),
3539 NK_EDIT_SIG_ENTER = NK_FLAG(2),
3540 NK_EDIT_ALLOW_TAB = NK_FLAG(3),
3541 NK_EDIT_NO_CURSOR = NK_FLAG(4),
3542 NK_EDIT_SELECTABLE = NK_FLAG(5),
3543 NK_EDIT_CLIPBOARD = NK_FLAG(6),
3544 NK_EDIT_CTRL_ENTER_NEWLINE = NK_FLAG(7),
3545 NK_EDIT_NO_HORIZONTAL_SCROLL = NK_FLAG(8),
3546 NK_EDIT_ALWAYS_INSERT_MODE = NK_FLAG(9),
3547 NK_EDIT_MULTILINE = NK_FLAG(10),
3548 NK_EDIT_GOTO_END_ON_ACTIVATE = NK_FLAG(11)
3551 NK_EDIT_SIMPLE = NK_EDIT_ALWAYS_INSERT_MODE,
3552 NK_EDIT_FIELD = NK_EDIT_SIMPLE|NK_EDIT_SELECTABLE|NK_EDIT_CLIPBOARD,
3553 NK_EDIT_BOX = NK_EDIT_ALWAYS_INSERT_MODE| NK_EDIT_SELECTABLE| NK_EDIT_MULTILINE|NK_EDIT_ALLOW_TAB|NK_EDIT_CLIPBOARD,
3554 NK_EDIT_EDITOR = NK_EDIT_SELECTABLE|NK_EDIT_MULTILINE|NK_EDIT_ALLOW_TAB| NK_EDIT_CLIPBOARD
3556enum nk_edit_events {
3557 NK_EDIT_ACTIVE = NK_FLAG(0),
3558 NK_EDIT_INACTIVE = NK_FLAG(1),
3559 NK_EDIT_ACTIVATED = NK_FLAG(2),
3560 NK_EDIT_DEACTIVATED = NK_FLAG(3),
3561 NK_EDIT_COMMITTED = NK_FLAG(4)
3564#define NK_EDIT_COMMITED NK_EDIT_COMMITTED
3566NK_API nk_flags nk_edit_string(
struct nk_context*, nk_flags,
char *buffer,
int *len,
int max, nk_plugin_filter);
3567NK_API nk_flags nk_edit_string_zero_terminated(
struct nk_context*, nk_flags,
char *buffer,
int max, nk_plugin_filter);
3569NK_API
void nk_edit_focus(
struct nk_context*, nk_flags flags);
3570NK_API
void nk_edit_unfocus(
struct nk_context*);
3576NK_API nk_bool nk_chart_begin(
struct nk_context*,
enum nk_chart_type,
int num,
float min,
float max);
3577NK_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);
3578NK_API
void nk_chart_add_slot(
struct nk_context *ctx,
const enum nk_chart_type,
int count,
float min_value,
float max_value);
3579NK_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);
3580NK_API nk_flags nk_chart_push(
struct nk_context*,
float);
3581NK_API nk_flags nk_chart_push_slot(
struct nk_context*,
float,
int);
3583NK_API
void nk_plot(
struct nk_context*,
enum nk_chart_type,
const float *values,
int count,
int offset);
3584NK_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);
3590NK_API nk_bool nk_popup_begin(
struct nk_context*,
enum nk_popup_type,
const char*, nk_flags,
struct nk_rect bounds);
3591NK_API
void nk_popup_close(
struct nk_context*);
3593NK_API
void nk_popup_get_scroll(
const struct nk_context*, nk_uint *offset_x, nk_uint *offset_y);
3594NK_API
void nk_popup_set_scroll(
struct nk_context*, nk_uint offset_x, nk_uint offset_y);
3600NK_API
int nk_combo(
struct nk_context*,
const char *
const *items,
int count,
int selected,
int item_height,
struct nk_vec2 size);
3601NK_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);
3602NK_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);
3603NK_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);
3604NK_API nk_bool nk_combobox(
struct nk_context*,
const char *
const *items,
int count,
int *selected,
int item_height,
struct nk_vec2 size);
3605NK_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);
3606NK_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);
3607NK_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);
3613NK_API nk_bool nk_combo_begin_text(
struct nk_context*,
const char *selected,
int,
struct nk_vec2 size);
3614NK_API nk_bool nk_combo_begin_label(
struct nk_context*,
const char *selected,
struct nk_vec2 size);
3616NK_API nk_bool nk_combo_begin_symbol(
struct nk_context*,
enum nk_symbol_type,
struct nk_vec2 size);
3617NK_API nk_bool nk_combo_begin_symbol_label(
struct nk_context*,
const char *selected,
enum nk_symbol_type,
struct nk_vec2 size);
3618NK_API nk_bool nk_combo_begin_symbol_text(
struct nk_context*,
const char *selected,
int,
enum nk_symbol_type,
struct nk_vec2 size);
3620NK_API nk_bool nk_combo_begin_image_label(
struct nk_context*,
const char *selected,
struct nk_image,
struct nk_vec2 size);
3621NK_API nk_bool nk_combo_begin_image_text(
struct nk_context*,
const char *selected,
int,
struct nk_image,
struct nk_vec2 size);
3622NK_API nk_bool nk_combo_item_label(
struct nk_context*,
const char*, nk_flags alignment);
3623NK_API nk_bool nk_combo_item_text(
struct nk_context*,
const char*,
int, nk_flags alignment);
3624NK_API nk_bool nk_combo_item_image_label(
struct nk_context*,
struct nk_image,
const char*, nk_flags alignment);
3625NK_API nk_bool nk_combo_item_image_text(
struct nk_context*,
struct nk_image,
const char*,
int,nk_flags alignment);
3626NK_API nk_bool nk_combo_item_symbol_label(
struct nk_context*,
enum nk_symbol_type,
const char*, nk_flags alignment);
3627NK_API nk_bool nk_combo_item_symbol_text(
struct nk_context*,
enum nk_symbol_type,
const char*,
int, nk_flags alignment);
3628NK_API
void nk_combo_close(
struct nk_context*);
3636NK_API nk_bool nk_contextual_item_text(
struct nk_context*,
const char*,
int,nk_flags align);
3637NK_API nk_bool nk_contextual_item_label(
struct nk_context*,
const char*, nk_flags align);
3638NK_API nk_bool nk_contextual_item_image_label(
struct nk_context*,
struct nk_image,
const char*, nk_flags alignment);
3639NK_API nk_bool nk_contextual_item_image_text(
struct nk_context*,
struct nk_image,
const char*,
int len, nk_flags alignment);
3640NK_API nk_bool nk_contextual_item_symbol_label(
struct nk_context*,
enum nk_symbol_type,
const char*, nk_flags alignment);
3641NK_API nk_bool nk_contextual_item_symbol_text(
struct nk_context*,
enum nk_symbol_type,
const char*,
int, nk_flags alignment);
3642NK_API
void nk_contextual_close(
struct nk_context*);
3643NK_API
void nk_contextual_end(
struct nk_context*);
3649NK_API
void nk_tooltip(
struct nk_context*,
const char*);
3650NK_API
void nk_tooltip_offset(
struct nk_context *ctx,
const char *text,
enum nk_tooltip_pos position,
struct nk_vec2 offset);
3652NK_API
void nk_do_tooltip_delay(
struct nk_context*,
const char*,
struct nk_rect,
float*);
3653NK_API
void nk_do_tooltip_delay_clicked(
struct nk_context*,
const char*,
struct nk_rect,
float* timer, nk_bool*);
3654#ifdef NK_INCLUDE_STANDARD_VARARGS
3655NK_API
void nk_tooltipf(
struct nk_context*, NK_PRINTF_FORMAT_STRING
const char*, ...) NK_PRINTF_VARARG_FUNC(2);
3656NK_API
void nk_tooltipfv(struct
nk_context*, NK_PRINTF_FORMAT_STRING const
char*, va_list) NK_PRINTF_VALIST_FUNC(2);
3657NK_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);
3658NK_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);
3660NK_API nk_bool nk_tooltip_begin(
struct nk_context*,
float width);
3661NK_API nk_bool nk_tooltip_begin_offset(
struct nk_context*,
float,
enum nk_tooltip_pos,
struct nk_vec2);
3662NK_API
void nk_tooltip_end(
struct nk_context*);
3668NK_API
void nk_menubar_begin(
struct nk_context*);
3669NK_API
void nk_menubar_end(
struct nk_context*);
3670NK_API nk_bool nk_menu_begin_text(
struct nk_context*,
const char* title,
int title_len, nk_flags align,
struct nk_vec2 size);
3671NK_API nk_bool nk_menu_begin_label(
struct nk_context*,
const char*, nk_flags align,
struct nk_vec2 size);
3673NK_API nk_bool nk_menu_begin_image_text(
struct nk_context*,
const char*,
int,nk_flags align,
struct nk_image,
struct nk_vec2 size);
3674NK_API nk_bool nk_menu_begin_image_label(
struct nk_context*,
const char*, nk_flags align,
struct nk_image,
struct nk_vec2 size);
3675NK_API nk_bool nk_menu_begin_symbol(
struct nk_context*,
const char*,
enum nk_symbol_type,
struct nk_vec2 size);
3676NK_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);
3677NK_API nk_bool nk_menu_begin_symbol_label(
struct nk_context*,
const char*, nk_flags align,
enum nk_symbol_type,
struct nk_vec2 size);
3678NK_API nk_bool nk_menu_item_text(
struct nk_context*,
const char*,
int,nk_flags align);
3679NK_API nk_bool nk_menu_item_label(
struct nk_context*,
const char*, nk_flags alignment);
3680NK_API nk_bool nk_menu_item_image_label(
struct nk_context*,
struct nk_image,
const char*, nk_flags alignment);
3681NK_API nk_bool nk_menu_item_image_text(
struct nk_context*,
struct nk_image,
const char*,
int len, nk_flags alignment);
3682NK_API nk_bool nk_menu_item_symbol_text(
struct nk_context*,
enum nk_symbol_type,
const char*,
int, nk_flags alignment);
3683NK_API nk_bool nk_menu_item_symbol_label(
struct nk_context*,
enum nk_symbol_type,
const char*, nk_flags alignment);
3684NK_API
void nk_menu_close(
struct nk_context*);
3692#define NK_WIDGET_DISABLED_FACTOR 0.5f
3694enum nk_style_colors {
3700 NK_COLOR_BUTTON_HOVER,
3701 NK_COLOR_BUTTON_ACTIVE,
3703 NK_COLOR_TOGGLE_HOVER,
3704 NK_COLOR_TOGGLE_CURSOR,
3706 NK_COLOR_SELECT_ACTIVE,
3708 NK_COLOR_SLIDER_CURSOR,
3709 NK_COLOR_SLIDER_CURSOR_HOVER,
3710 NK_COLOR_SLIDER_CURSOR_ACTIVE,
3713 NK_COLOR_EDIT_CURSOR,
3716 NK_COLOR_CHART_COLOR,
3717 NK_COLOR_CHART_COLOR_HIGHLIGHT,
3719 NK_COLOR_SCROLLBAR_CURSOR,
3720 NK_COLOR_SCROLLBAR_CURSOR_HOVER,
3721 NK_COLOR_SCROLLBAR_CURSOR_ACTIVE,
3722 NK_COLOR_TAB_HEADER,
3724 NK_COLOR_KNOB_CURSOR,
3725 NK_COLOR_KNOB_CURSOR_HOVER,
3726 NK_COLOR_KNOB_CURSOR_ACTIVE,
3729enum nk_style_cursor {
3733 NK_CURSOR_RESIZE_VERTICAL,
3734 NK_CURSOR_RESIZE_HORIZONTAL,
3735 NK_CURSOR_RESIZE_TOP_LEFT_DOWN_RIGHT,
3736 NK_CURSOR_RESIZE_TOP_RIGHT_DOWN_LEFT,
3739NK_API
void nk_style_default(
struct nk_context*);
3741NK_API
void nk_style_load_cursor(
struct nk_context*,
enum nk_style_cursor,
const struct nk_cursor*);
3743NK_API
const char* nk_style_get_color_by_name(
enum nk_style_colors);
3745NK_API nk_bool nk_style_set_cursor(
struct nk_context*,
enum nk_style_cursor);
3746NK_API
void nk_style_show_cursor(
struct nk_context*);
3747NK_API
void nk_style_hide_cursor(
struct nk_context*);
3750NK_API nk_bool nk_style_push_float(
struct nk_context*,
float*,
float);
3753NK_API nk_bool nk_style_push_flags(
struct nk_context*, nk_flags*, nk_flags);
3756NK_API nk_bool nk_style_pop_font(
struct nk_context*);
3757NK_API nk_bool nk_style_pop_float(
struct nk_context*);
3758NK_API nk_bool nk_style_pop_vec2(
struct nk_context*);
3759NK_API nk_bool nk_style_pop_style_item(
struct nk_context*);
3760NK_API nk_bool nk_style_pop_flags(
struct nk_context*);
3761NK_API nk_bool nk_style_pop_color(
struct nk_context*);
3767NK_API
struct nk_color nk_rgb(int r, int g, int b);
3768NK_API
struct nk_color nk_rgb_iv(const int *rgb);
3769NK_API
struct nk_color nk_rgb_bv(const nk_byte* rgb);
3770NK_API
struct nk_color nk_rgb_f(float r, float g, float b);
3771NK_API
struct nk_color nk_rgb_fv(const float *rgb);
3773NK_API
struct nk_color nk_rgb_hex(const char *rgb);
3776NK_API
struct nk_color nk_rgba(int r, int g, int b, int a);
3777NK_API
struct nk_color nk_rgba_u32(nk_uint);
3778NK_API
struct nk_color nk_rgba_iv(const int *rgba);
3779NK_API
struct nk_color nk_rgba_bv(const nk_byte *rgba);
3780NK_API
struct nk_color nk_rgba_f(float r, float g, float b, float a);
3781NK_API
struct nk_color nk_rgba_fv(const float *rgba);
3783NK_API
struct nk_color nk_rgba_hex(const char *rgb);
3785NK_API
struct nk_colorf nk_hsva_colorf(float h, float s, float v, float a);
3786NK_API
struct nk_colorf nk_hsva_colorfv(const float *c);
3787NK_API
void nk_colorf_hsva_f(
float *out_h,
float *out_s,
float *out_v,
float *out_a,
struct nk_colorf in);
3788NK_API
void nk_colorf_hsva_fv(
float *hsva,
struct nk_colorf in);
3790NK_API
struct nk_color nk_hsv(int h, int s, int v);
3791NK_API
struct nk_color nk_hsv_iv(const int *hsv);
3792NK_API
struct nk_color nk_hsv_bv(const nk_byte *hsv);
3793NK_API
struct nk_color nk_hsv_f(float h, float s, float v);
3794NK_API
struct nk_color nk_hsv_fv(const float *hsv);
3796NK_API
struct nk_color nk_hsva(int h, int s, int v, int a);
3797NK_API
struct nk_color nk_hsva_iv(const int *hsva);
3798NK_API
struct nk_color nk_hsva_bv(const nk_byte *hsva);
3799NK_API
struct nk_color nk_hsva_f(float h, float s, float v, float a);
3800NK_API
struct nk_color nk_hsva_fv(const float *hsva);
3803NK_API
void nk_color_f(
float *r,
float *g,
float *b,
float *a,
struct nk_color);
3804NK_API
void nk_color_fv(
float *rgba_out,
struct nk_color);
3806NK_API
void nk_color_d(
double *r,
double *g,
double *b,
double *a,
struct nk_color);
3807NK_API
void nk_color_dv(
double *rgba_out,
struct nk_color);
3809NK_API nk_uint nk_color_u32(
struct nk_color);
3810NK_API
void nk_color_hex_rgba(
char *output,
struct nk_color);
3811NK_API
void nk_color_hex_rgb(
char *output,
struct nk_color);
3813NK_API
void nk_color_hsv_i(
int *out_h,
int *out_s,
int *out_v,
struct nk_color);
3814NK_API
void nk_color_hsv_b(nk_byte *out_h, nk_byte *out_s, nk_byte *out_v,
struct nk_color);
3815NK_API
void nk_color_hsv_iv(
int *hsv_out,
struct nk_color);
3816NK_API
void nk_color_hsv_bv(nk_byte *hsv_out,
struct nk_color);
3817NK_API
void nk_color_hsv_f(
float *out_h,
float *out_s,
float *out_v,
struct nk_color);
3818NK_API
void nk_color_hsv_fv(
float *hsv_out,
struct nk_color);
3820NK_API
void nk_color_hsva_i(
int *h,
int *s,
int *v,
int *a,
struct nk_color);
3821NK_API
void nk_color_hsva_b(nk_byte *h, nk_byte *s, nk_byte *v, nk_byte *a,
struct nk_color);
3822NK_API
void nk_color_hsva_iv(
int *hsva_out,
struct nk_color);
3823NK_API
void nk_color_hsva_bv(nk_byte *hsva_out,
struct nk_color);
3824NK_API
void nk_color_hsva_f(
float *out_h,
float *out_s,
float *out_v,
float *out_a,
struct nk_color);
3825NK_API
void nk_color_hsva_fv(
float *hsva_out,
struct nk_color);
3834NK_API
struct nk_image nk_image_ptr(void*);
3835NK_API
struct nk_image nk_image_id(int);
3836NK_API nk_bool nk_image_is_subimage(
const struct nk_image* img);
3837NK_API
struct nk_image nk_subimage_ptr(void*, nk_ushort w, nk_ushort h,
struct nk_rect sub_region);
3838NK_API
struct nk_image nk_subimage_id(int, nk_ushort w, nk_ushort h, struct
nk_rect sub_region);
3845NK_API
struct nk_nine_slice nk_nine_slice_handle(
nk_handle, nk_ushort l, nk_ushort t, nk_ushort r, nk_ushort b);
3846NK_API
struct nk_nine_slice nk_nine_slice_ptr(void*, nk_ushort l, nk_ushort t, nk_ushort r, nk_ushort b);
3847NK_API
struct nk_nine_slice nk_nine_slice_id(int, nk_ushort l, nk_ushort t, nk_ushort r, nk_ushort b);
3848NK_API
int nk_nine_slice_is_sub9slice(
const struct nk_nine_slice* img);
3849NK_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);
3850NK_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);
3851NK_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);
3857NK_API nk_hash nk_murmur_hash(
const void *key,
int len, nk_hash seed);
3858NK_API
void nk_triangle_from_direction(
struct nk_vec2 *result,
struct nk_rect r,
float pad_x,
float pad_y,
enum nk_heading);
3862NK_API
struct nk_vec2 nk_vec2v(const float *xy);
3863NK_API
struct nk_vec2 nk_vec2iv(const int *xy);
3865NK_API
struct nk_rect nk_get_null_rect(void);
3866NK_API
struct nk_rect nk_rect(float x, float y, float w, float h);
3869NK_API
struct nk_rect nk_rectv(const float *xywh);
3870NK_API
struct nk_rect nk_rectiv(const int *xywh);
3878NK_API
int nk_strlen(
const char *str);
3879NK_API
int nk_stricmp(
const char *s1,
const char *s2);
3880NK_API
int nk_stricmpn(
const char *s1,
const char *s2,
int n);
3881NK_API
int nk_strtoi(
const char *str,
char **endptr);
3882NK_API
float nk_strtof(
const char *str,
char **endptr);
3884#define NK_STRTOD nk_strtod
3885#define NK_STRTOD_NEEDED
3886NK_API
double nk_strtod(
const char *str,
char **endptr);
3888NK_API
int nk_strfilter(
const char *text,
const char *regexp);
3889NK_API
int nk_strmatch_fuzzy_string(
char const *str,
char const *pattern,
int *out_score);
3890NK_API
int nk_strmatch_fuzzy_text(
const char *txt,
int txt_len,
const char *pattern,
int *out_score);
3896NK_API
int nk_utf_decode(
const char*, nk_rune*,
int);
3897NK_API
int nk_utf_encode(nk_rune,
char*,
int);
3898NK_API
int nk_utf_len(
const char*,
int byte_len);
3899NK_API
const char* nk_utf_at(
const char *buffer,
int length,
int index, nk_rune *unicode,
int *len);
4057struct nk_user_font_glyph;
4058typedef float(*nk_text_width_f)(
nk_handle,
float h,
const char*,
int len);
4059typedef void(*nk_query_font_glyph_f)(
nk_handle handle,
float font_height,
4060 struct nk_user_font_glyph *glyph,
4061 nk_rune codepoint, nk_rune next_codepoint);
4063#if defined(NK_INCLUDE_VERTEX_BUFFER_OUTPUT) || defined(NK_INCLUDE_SOFTWARE_FONT)
4064struct nk_user_font_glyph {
4067 float width, height;
4076#ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT
4077 nk_query_font_glyph_f query;
4082#ifdef NK_INCLUDE_FONT_BAKING
4083enum nk_font_coord_type {
4089struct nk_baked_font {
4093 nk_rune glyph_offset;
4094 nk_rune glyph_count;
4095 const nk_rune *ranges;
4098struct nk_font_config {
4099 struct nk_font_config *next;
4103 unsigned char ttf_data_owned_by_atlas;
4104 unsigned char merge_mode;
4105 unsigned char pixel_snap;
4106 unsigned char oversample_v, oversample_h;
4107 unsigned char padding[3];
4110 enum nk_font_coord_type coord_type;
4112 const nk_rune *range;
4113 struct nk_baked_font *font;
4114 nk_rune fallback_glyph;
4115 struct nk_font_config *n;
4116 struct nk_font_config *p;
4119struct nk_font_glyph {
4122 float x0, y0, x1, y1, w, h;
4123 float u0, v0, u1, v1;
4127 struct nk_font *next;
4129 struct nk_baked_font info;
4131 struct nk_font_glyph *glyphs;
4132 const struct nk_font_glyph *fallback;
4133 nk_rune fallback_codepoint;
4135 struct nk_font_config *config;
4138enum nk_font_atlas_format {
4139 NK_FONT_ATLAS_ALPHA8,
4140 NK_FONT_ATLAS_RGBA32
4143struct nk_font_atlas {
4152 struct nk_cursor cursors[NK_CURSOR_COUNT];
4155 struct nk_font_glyph *glyphs;
4156 struct nk_font *default_font;
4157 struct nk_font *fonts;
4158 struct nk_font_config *config;
4163NK_API
const nk_rune *nk_font_default_glyph_ranges(
void);
4164NK_API
const nk_rune *nk_font_chinese_glyph_ranges(
void);
4165NK_API
const nk_rune *nk_font_cyrillic_glyph_ranges(
void);
4166NK_API
const nk_rune *nk_font_korean_glyph_ranges(
void);
4168#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
4169NK_API
void nk_font_atlas_init_default(
struct nk_font_atlas*);
4171NK_API
void nk_font_atlas_init(
struct nk_font_atlas*,
const struct nk_allocator*);
4172NK_API
void nk_font_atlas_init_custom(
struct nk_font_atlas*,
const struct nk_allocator *persistent,
const struct nk_allocator *transient);
4173NK_API
void nk_font_atlas_begin(
struct nk_font_atlas*);
4174NK_API
struct nk_font_config nk_font_config(float pixel_height);
4175NK_API
struct nk_font *nk_font_atlas_add(
struct nk_font_atlas*,
const struct nk_font_config*);
4176#ifdef NK_INCLUDE_DEFAULT_FONT
4177NK_API
struct nk_font* nk_font_atlas_add_default(
struct nk_font_atlas*,
float height,
const struct nk_font_config*);
4179NK_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);
4180#ifdef NK_INCLUDE_STANDARD_IO
4181NK_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*);
4183NK_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*);
4184NK_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);
4185NK_API
const void* nk_font_atlas_bake(
struct nk_font_atlas*,
int *width,
int *height,
enum nk_font_atlas_format);
4187NK_API
const struct nk_font_glyph* nk_font_find_glyph(
const struct nk_font*, nk_rune unicode);
4188NK_API
void nk_font_atlas_cleanup(
struct nk_font_atlas *atlas);
4189NK_API
void nk_font_atlas_clear(
struct nk_font_atlas*);
4238enum nk_allocation_type {
4243enum nk_buffer_allocation_type {
4267#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
4268NK_API
void nk_buffer_init_default(
struct nk_buffer*);
4271NK_API
void nk_buffer_init_fixed(
struct nk_buffer*,
void *memory, nk_size size);
4273NK_API
void nk_buffer_push(
struct nk_buffer*,
enum nk_buffer_allocation_type type,
const void *memory, nk_size size, nk_size align);
4274NK_API
void nk_buffer_mark(
struct nk_buffer*,
enum nk_buffer_allocation_type type);
4275NK_API
void nk_buffer_reset(
struct nk_buffer*,
enum nk_buffer_allocation_type type);
4276NK_API
void nk_buffer_clear(
struct nk_buffer*);
4277NK_API
void nk_buffer_free(
struct nk_buffer*);
4278NK_API
void *nk_buffer_memory(
struct nk_buffer*);
4279NK_API
const void *nk_buffer_memory_const(
const struct nk_buffer*);
4280NK_API nk_size nk_buffer_total(
const struct nk_buffer*);
4297#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
4298NK_API
void nk_str_init_default(
struct nk_str*);
4302NK_API
void nk_str_clear(
struct nk_str*);
4303NK_API
void nk_str_free(
struct nk_str*);
4305NK_API
int nk_str_append_text_char(
struct nk_str*,
const char*,
int);
4306NK_API
int nk_str_append_str_char(
struct nk_str*,
const char*);
4307NK_API
int nk_str_append_text_utf8(
struct nk_str*,
const char*,
int);
4308NK_API
int nk_str_append_str_utf8(
struct nk_str*,
const char*);
4309NK_API
int nk_str_append_text_runes(
struct nk_str*,
const nk_rune*,
int);
4310NK_API
int nk_str_append_str_runes(
struct nk_str*,
const nk_rune*);
4312NK_API
int nk_str_insert_at_char(
struct nk_str*,
int pos,
const char*,
int);
4313NK_API
int nk_str_insert_at_rune(
struct nk_str*,
int pos,
const char*,
int);
4315NK_API
int nk_str_insert_text_char(
struct nk_str*,
int pos,
const char*,
int);
4316NK_API
int nk_str_insert_str_char(
struct nk_str*,
int pos,
const char*);
4317NK_API
int nk_str_insert_text_utf8(
struct nk_str*,
int pos,
const char*,
int);
4318NK_API
int nk_str_insert_str_utf8(
struct nk_str*,
int pos,
const char*);
4319NK_API
int nk_str_insert_text_runes(
struct nk_str*,
int pos,
const nk_rune*,
int);
4320NK_API
int nk_str_insert_str_runes(
struct nk_str*,
int pos,
const nk_rune*);
4322NK_API
void nk_str_remove_chars(
struct nk_str*,
int len);
4323NK_API
void nk_str_remove_runes(
struct nk_str *str,
int len);
4324NK_API
void nk_str_delete_chars(
struct nk_str*,
int pos,
int len);
4325NK_API
void nk_str_delete_runes(
struct nk_str*,
int pos,
int len);
4327NK_API
char *nk_str_at_char(
struct nk_str*,
int pos);
4328NK_API
char *nk_str_at_rune(
struct nk_str*,
int pos, nk_rune *unicode,
int *len);
4329NK_API nk_rune nk_str_rune_at(
const struct nk_str*,
int pos);
4330NK_API
const char *nk_str_at_char_const(
const struct nk_str*,
int pos);
4331NK_API
const char *nk_str_at_const(
const struct nk_str*,
int pos, nk_rune *unicode,
int *len);
4333NK_API
char *nk_str_get(
struct nk_str*);
4334NK_API
const char *nk_str_get_const(
const struct nk_str*);
4335NK_API
int nk_str_len(
const struct nk_str*);
4336NK_API
int nk_str_len_char(
const struct nk_str*);
4369#ifndef NK_TEXTEDIT_UNDOSTATECOUNT
4370#define NK_TEXTEDIT_UNDOSTATECOUNT 99
4373#ifndef NK_TEXTEDIT_UNDOCHARCOUNT
4374#define NK_TEXTEDIT_UNDOCHARCOUNT 999
4380 nk_plugin_paste paste;
4381 nk_plugin_copy copy;
4386 short insert_length;
4387 short delete_length;
4393 nk_rune undo_char[NK_TEXTEDIT_UNDOCHARCOUNT];
4396 short undo_char_point;
4397 short redo_char_point;
4400enum nk_text_edit_type {
4401 NK_TEXT_EDIT_SINGLE_LINE,
4402 NK_TEXT_EDIT_MULTI_LINE
4405enum nk_text_edit_mode {
4406 NK_TEXT_EDIT_MODE_VIEW,
4407 NK_TEXT_EDIT_MODE_INSERT,
4408 NK_TEXT_EDIT_MODE_REPLACE
4414 nk_plugin_filter filter;
4421 unsigned char cursor_at_end_of_line;
4422 unsigned char initialized;
4423 unsigned char has_preferred_x;
4424 unsigned char single_line;
4425 unsigned char active;
4426 unsigned char padding1;
4432NK_API nk_bool nk_filter_default(
const struct nk_text_edit*, nk_rune unicode);
4433NK_API nk_bool nk_filter_ascii(
const struct nk_text_edit*, nk_rune unicode);
4434NK_API nk_bool nk_filter_float(
const struct nk_text_edit*, nk_rune unicode);
4435NK_API nk_bool nk_filter_decimal(
const struct nk_text_edit*, nk_rune unicode);
4436NK_API nk_bool nk_filter_hex(
const struct nk_text_edit*, nk_rune unicode);
4437NK_API nk_bool nk_filter_oct(
const struct nk_text_edit*, nk_rune unicode);
4438NK_API nk_bool nk_filter_binary(
const struct nk_text_edit*, nk_rune unicode);
4441#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
4442NK_API
void nk_textedit_init_default(
struct nk_text_edit*);
4445NK_API
void nk_textedit_init_fixed(
struct nk_text_edit*,
void *memory, nk_size size);
4447NK_API
void nk_textedit_text(
struct nk_text_edit*,
const char*,
int total_len);
4448NK_API
void nk_textedit_delete(
struct nk_text_edit*,
int where,
int len);
4449NK_API
void nk_textedit_delete_selection(
struct nk_text_edit*);
4450NK_API
void nk_textedit_select_all(
struct nk_text_edit*);
4452NK_API nk_bool nk_textedit_paste(
struct nk_text_edit*,
char const*,
int len);
4510enum nk_command_type {
4516 NK_COMMAND_RECT_FILLED,
4517 NK_COMMAND_RECT_MULTI_COLOR,
4519 NK_COMMAND_CIRCLE_FILLED,
4521 NK_COMMAND_ARC_FILLED,
4522 NK_COMMAND_TRIANGLE,
4523 NK_COMMAND_TRIANGLE_FILLED,
4525 NK_COMMAND_POLYGON_FILLED,
4526 NK_COMMAND_POLYLINE,
4534 enum nk_command_type type;
4536#ifdef NK_INCLUDE_COMMAND_USERDATA
4544 unsigned short w, h;
4549 unsigned short line_thickness;
4557 unsigned short line_thickness;
4566 unsigned short rounding;
4567 unsigned short line_thickness;
4569 unsigned short w, h;
4575 unsigned short rounding;
4577 unsigned short w, h;
4584 unsigned short w, h;
4593 unsigned short line_thickness;
4611 unsigned short line_thickness;
4612 unsigned short w, h;
4619 unsigned short w, h;
4627 unsigned short line_thickness;
4643 unsigned short line_thickness;
4644 unsigned short point_count;
4651 unsigned short point_count;
4658 unsigned short line_thickness;
4659 unsigned short point_count;
4666 unsigned short w, h;
4671typedef void (*nk_command_custom_callback)(
void *canvas,
short x,
short y,
4672 unsigned short w,
unsigned short h,
nk_handle callback_data);
4676 unsigned short w, h;
4678 nk_command_custom_callback callback;
4687 unsigned short w, h;
4693enum nk_command_clipping {
4694 NK_CLIPPING_OFF = nk_false,
4695 NK_CLIPPING_ON = nk_true
4703 nk_size begin, end, last;
4707NK_API
void nk_stroke_line(
struct nk_command_buffer *b,
float x0,
float y0,
float x1,
float y1,
float line_thickness,
struct nk_color);
4708NK_API
void nk_stroke_curve(
struct nk_command_buffer*,
float,
float,
float,
float,
float,
float,
float,
float,
float line_thickness,
struct nk_color);
4711NK_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);
4712NK_API
void nk_stroke_triangle(
struct nk_command_buffer*,
float,
float,
float,
float,
float,
float,
float line_thichness,
struct nk_color);
4713NK_API
void nk_stroke_polyline(
struct nk_command_buffer*,
const float *points,
int point_count,
float line_thickness,
struct nk_color col);
4714NK_API
void nk_stroke_polygon(
struct nk_command_buffer*,
const float *points,
int point_count,
float line_thickness,
struct nk_color);
4720NK_API
void nk_fill_arc(
struct nk_command_buffer*,
float cx,
float cy,
float radius,
float a_min,
float a_max,
struct nk_color);
4721NK_API
void nk_fill_triangle(
struct nk_command_buffer*,
float x0,
float y0,
float x1,
float y1,
float x2,
float y2,
struct nk_color);
4738 unsigned int clicked;
4744#ifdef NK_BUTTON_TRIGGER_ON_RELEASE
4751 unsigned char grabbed;
4752 unsigned char ungrab;
4757 unsigned int clicked;
4760 struct nk_key keys[NK_KEY_MAX];
4761 char text[NK_INPUT_MAX];
4770NK_API nk_bool nk_input_has_mouse_click(
const struct nk_input*,
enum nk_buttons);
4771NK_API nk_bool nk_input_has_mouse_click_in_rect(
const struct nk_input*,
enum nk_buttons,
struct nk_rect);
4772NK_API nk_bool nk_input_has_mouse_click_in_button_rect(
const struct nk_input*,
enum nk_buttons,
struct nk_rect);
4773NK_API nk_bool nk_input_has_mouse_click_down_in_rect(
const struct nk_input*,
enum nk_buttons,
struct nk_rect, nk_bool down);
4774NK_API nk_bool nk_input_is_mouse_click_in_rect(
const struct nk_input*,
enum nk_buttons,
struct nk_rect);
4775NK_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);
4776NK_API nk_bool nk_input_any_mouse_click_in_rect(
const struct nk_input*,
struct nk_rect);
4777NK_API nk_bool nk_input_is_mouse_prev_hovering_rect(
const struct nk_input*,
struct nk_rect);
4778NK_API nk_bool nk_input_is_mouse_hovering_rect(
const struct nk_input*,
struct nk_rect);
4779NK_API nk_bool nk_input_is_mouse_hovering_still_rect(
const struct nk_input*,
struct nk_rect);
4780NK_API nk_bool nk_input_is_mouse_hovering_delay_rect(
const struct nk_context*,
struct nk_rect,
float*,
float);
4781NK_API nk_bool nk_input_is_mouse_hovering_still_delay_rect(
const struct nk_context*,
struct nk_rect,
float*,
float);
4782NK_API nk_bool nk_input_is_mouse_hovering_still_delay_clicked_rect(
const struct nk_context*,
struct nk_rect,
float*,
float, nk_bool*);
4783NK_API nk_bool nk_input_is_mouse_moved(
const struct nk_input*);
4784NK_API nk_bool nk_input_mouse_clicked(
const struct nk_input*,
enum nk_buttons,
struct nk_rect);
4785NK_API nk_bool nk_input_is_mouse_down(
const struct nk_input*,
enum nk_buttons);
4786NK_API nk_bool nk_input_is_mouse_pressed(
const struct nk_input*,
enum nk_buttons);
4787NK_API nk_bool nk_input_is_mouse_released(
const struct nk_input*,
enum nk_buttons);
4788NK_API nk_bool nk_input_is_key_pressed(
const struct nk_input*,
enum nk_keys);
4789NK_API nk_bool nk_input_is_key_released(
const struct nk_input*,
enum nk_keys);
4790NK_API nk_bool nk_input_is_key_down(
const struct nk_input*,
enum nk_keys);
4797#ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT
4814#ifdef NK_UINT_DRAW_INDEX
4815typedef nk_uint nk_draw_index;
4817typedef nk_ushort nk_draw_index;
4819enum nk_draw_list_stroke {
4820 NK_STROKE_OPEN = nk_false,
4821 NK_STROKE_CLOSED = nk_true
4824enum nk_draw_vertex_layout_attribute {
4828 NK_VERTEX_ATTRIBUTE_COUNT
4831enum nk_draw_vertex_layout_format {
4841NK_FORMAT_COLOR_BEGIN,
4842 NK_FORMAT_R8G8B8 = NK_FORMAT_COLOR_BEGIN,
4843 NK_FORMAT_R16G15B16,
4844 NK_FORMAT_R32G32B32,
4848 NK_FORMAT_R16G15B16A16,
4849 NK_FORMAT_R32G32B32A32,
4850 NK_FORMAT_R32G32B32A32_FLOAT,
4851 NK_FORMAT_R32G32B32A32_DOUBLE,
4855NK_FORMAT_COLOR_END = NK_FORMAT_RGBA32,
4859#define NK_VERTEX_LAYOUT_END NK_VERTEX_ATTRIBUTE_COUNT,NK_FORMAT_COUNT,0
4860struct nk_draw_vertex_layout_element {
4861 enum nk_draw_vertex_layout_attribute attribute;
4862 enum nk_draw_vertex_layout_format format;
4866struct nk_draw_command {
4867 unsigned int elem_count;
4870#ifdef NK_INCLUDE_COMMAND_USERDATA
4875struct nk_draw_list {
4877 struct nk_vec2 circle_vtx[12];
4884 unsigned int element_count;
4885 unsigned int vertex_count;
4886 unsigned int cmd_count;
4889 unsigned int path_count;
4890 unsigned int path_offset;
4892 enum nk_anti_aliasing line_AA;
4893 enum nk_anti_aliasing shape_AA;
4895#ifdef NK_INCLUDE_COMMAND_USERDATA
4901NK_API
void nk_draw_list_init(
struct nk_draw_list*);
4902NK_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);
4905#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))
4906NK_API
const struct nk_draw_command* nk__draw_list_begin(
const struct nk_draw_list*,
const struct nk_buffer*);
4907NK_API
const struct nk_draw_command* nk__draw_list_next(
const struct nk_draw_command*,
const struct nk_buffer*,
const struct nk_draw_list*);
4908NK_API
const struct nk_draw_command* nk__draw_list_end(
const struct nk_draw_list*,
const struct nk_buffer*);
4911NK_API
void nk_draw_list_path_clear(
struct nk_draw_list*);
4912NK_API
void nk_draw_list_path_line_to(
struct nk_draw_list*,
struct nk_vec2 pos);
4913NK_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);
4914NK_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);
4915NK_API
void nk_draw_list_path_rect_to(
struct nk_draw_list*,
struct nk_vec2 a,
struct nk_vec2 b,
float rounding);
4916NK_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);
4917NK_API
void nk_draw_list_path_fill(
struct nk_draw_list*,
struct nk_color);
4918NK_API
void nk_draw_list_path_stroke(
struct nk_draw_list*,
struct nk_color,
enum nk_draw_list_stroke closed,
float thickness);
4921NK_API
void nk_draw_list_stroke_line(
struct nk_draw_list*,
struct nk_vec2 a,
struct nk_vec2 b,
struct nk_color,
float thickness);
4922NK_API
void nk_draw_list_stroke_rect(
struct nk_draw_list*,
struct nk_rect rect,
struct nk_color,
float rounding,
float thickness);
4923NK_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);
4924NK_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);
4925NK_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);
4926NK_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);
4929NK_API
void nk_draw_list_fill_rect(
struct nk_draw_list*,
struct nk_rect rect,
struct nk_color,
float rounding);
4932NK_API
void nk_draw_list_fill_circle(
struct nk_draw_list*,
struct nk_vec2 center,
float radius,
struct nk_color col,
unsigned int segs);
4933NK_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);
4936NK_API
void nk_draw_list_add_image(
struct nk_draw_list*,
struct nk_image texture,
struct nk_rect rect,
struct nk_color);
4937NK_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);
4938#ifdef NK_INCLUDE_COMMAND_USERDATA
4939NK_API
void nk_draw_list_push_userdata(
struct nk_draw_list*,
nk_handle userdata);
4949enum nk_style_item_type {
4950 NK_STYLE_ITEM_COLOR,
4951 NK_STYLE_ITEM_IMAGE,
4952 NK_STYLE_ITEM_NINE_SLICE
4962 enum nk_style_item_type type;
4970 float disabled_factor;
4977 enum nk_link_underline underline;
4978 float underline_thickness;
4982 float disabled_factor;
4991 float color_factor_background;
4998 nk_flags text_alignment;
4999 float color_factor_text;
5007 float disabled_factor;
5031 nk_flags text_alignment;
5039 float disabled_factor;
5064 struct nk_color text_normal_active;
5066 struct nk_color text_pressed_active;
5068 nk_flags text_alignment;
5076 float disabled_factor;
5110 float disabled_factor;
5116 enum nk_symbol_type inc_symbol;
5117 enum nk_symbol_type dec_symbol;
5150 float disabled_factor;
5169 struct nk_color cursor_border_color;
5174 float cursor_border;
5175 float cursor_rounding;
5178 float disabled_factor;
5197 struct nk_color cursor_border_color;
5202 float border_cursor;
5203 float rounding_cursor;
5206 float disabled_factor;
5212 enum nk_symbol_type inc_symbol;
5213 enum nk_symbol_type dec_symbol;
5232 struct nk_color cursor_text_normal;
5243 struct nk_color selected_text_normal;
5244 struct nk_color selected_text_hover;
5250 struct nk_vec2 scrollbar_size;
5254 float disabled_factor;
5270 enum nk_symbol_type sym_left;
5271 enum nk_symbol_type sym_right;
5278 float disabled_factor;
5302 float disabled_factor;
5303 nk_bool show_markers;
5325 enum nk_symbol_type sym_normal;
5326 enum nk_symbol_type sym_hover;
5327 enum nk_symbol_type sym_active;
5332 struct nk_vec2 content_padding;
5333 struct nk_vec2 button_padding;
5336 float disabled_factor;
5350 enum nk_symbol_type sym_minimize;
5351 enum nk_symbol_type sym_maximize;
5360 float disabled_factor;
5363enum nk_style_header_align {
5376 enum nk_symbol_type close_symbol;
5377 enum nk_symbol_type minimize_symbol;
5378 enum nk_symbol_type maximize_symbol;
5386 enum nk_style_header_align align;
5398 struct nk_color popup_border_color;
5399 struct nk_color combo_border_color;
5400 struct nk_color contextual_border_color;
5402 struct nk_color group_border_color;
5403 struct nk_color tooltip_border_color;
5408 float contextual_border;
5411 float tooltip_border;
5413 float min_row_height_padding;
5417 struct nk_vec2 scrollbar_size;
5424 struct nk_vec2 contextual_padding;
5426 struct nk_vec2 tooltip_padding;
5428 enum nk_tooltip_pos tooltip_origin;
5429 struct nk_vec2 tooltip_offset;
5430 float tooltip_delay;
5435 const struct nk_cursor *cursors[NK_CURSOR_COUNT];
5469#ifndef NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS
5470#define NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS 16
5472#ifndef NK_CHART_MAX_SLOT
5473#define NK_CHART_MAX_SLOT 4
5478 NK_PANEL_WINDOW = NK_FLAG(0),
5479 NK_PANEL_GROUP = NK_FLAG(1),
5480 NK_PANEL_POPUP = NK_FLAG(2),
5481 NK_PANEL_CONTEXTUAL = NK_FLAG(4),
5482 NK_PANEL_COMBO = NK_FLAG(5),
5483 NK_PANEL_MENU = NK_FLAG(6),
5484 NK_PANEL_TOOLTIP = NK_FLAG(7)
5487 NK_PANEL_SET_NONBLOCK = NK_PANEL_CONTEXTUAL|NK_PANEL_COMBO|NK_PANEL_MENU|NK_PANEL_TOOLTIP,
5488 NK_PANEL_SET_POPUP = NK_PANEL_SET_NONBLOCK|NK_PANEL_POPUP,
5489 NK_PANEL_SET_SUB = NK_PANEL_SET_POPUP|NK_PANEL_GROUP
5493 enum nk_chart_type type;
5496 float min, max, range;
5500 nk_bool show_markers;
5509enum nk_panel_row_layout_type {
5510 NK_LAYOUT_DYNAMIC_FIXED = 0,
5511 NK_LAYOUT_DYNAMIC_ROW,
5512 NK_LAYOUT_DYNAMIC_FREE,
5514 NK_LAYOUT_STATIC_FIXED,
5515 NK_LAYOUT_STATIC_ROW,
5516 NK_LAYOUT_STATIC_FREE,
5522 enum nk_panel_row_layout_type type;
5534 float templates[NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS];
5551 enum nk_panel_type type;
5556 float at_x, at_y, max_x;
5557 float footer_height;
5558 float header_height;
5560 unsigned int has_scrolling;
5572#ifndef NK_WINDOW_MAX_NAME
5573#define NK_WINDOW_MAX_NAME 64
5577enum nk_window_flags {
5578 NK_WINDOW_PRIVATE = NK_FLAG(11),
5579 NK_WINDOW_DYNAMIC = NK_WINDOW_PRIVATE,
5580 NK_WINDOW_ROM = NK_FLAG(12),
5581 NK_WINDOW_NOT_INTERACTIVE = NK_WINDOW_ROM|NK_WINDOW_NO_INPUT,
5582 NK_WINDOW_HIDDEN = NK_FLAG(13),
5583 NK_WINDOW_CLOSED = NK_FLAG(14),
5584 NK_WINDOW_MINIMIZED = NK_FLAG(15),
5585 NK_WINDOW_REMOVE_ROM = NK_FLAG(16)
5590 enum nk_panel_type type;
5594 unsigned combo_count;
5595 unsigned con_count, con_old;
5596 unsigned active_con;
5610 unsigned char single_line;
5615 char buffer[NK_MAX_NUMBER_BUFFER];
5626 char prev_buffer[NK_MAX_NUMBER_BUFFER];
5633 char name_string[NK_WINDOW_MAX_NAME];
5640 float scrollbar_hiding_timer;
5646 unsigned int scrolled;
5647 nk_bool widgets_disabled;
5650 unsigned int table_count;
5688#ifndef NK_BUTTON_BEHAVIOR_STACK_SIZE
5689#define NK_BUTTON_BEHAVIOR_STACK_SIZE 8
5692#ifndef NK_FONT_STACK_SIZE
5693#define NK_FONT_STACK_SIZE 8
5696#ifndef NK_STYLE_ITEM_STACK_SIZE
5697#define NK_STYLE_ITEM_STACK_SIZE 16
5700#ifndef NK_FLOAT_STACK_SIZE
5701#define NK_FLOAT_STACK_SIZE 32
5704#ifndef NK_VECTOR_STACK_SIZE
5705#define NK_VECTOR_STACK_SIZE 16
5708#ifndef NK_FLAGS_STACK_SIZE
5709#define NK_FLAGS_STACK_SIZE 32
5712#ifndef NK_COLOR_STACK_SIZE
5713#define NK_COLOR_STACK_SIZE 32
5716#define NK_CONFIGURATION_STACK_TYPE(prefix, name, type)\
5717 struct nk_config_stack_##name##_element {\
5718 prefix##_##type *address;\
5719 prefix##_##type old_value;\
5721#define NK_CONFIG_STACK(type,size)\
5722 struct nk_config_stack_##type {\
5724 struct nk_config_stack_##type##_element elements[size];\
5727#define nk_float float
5728NK_CONFIGURATION_STACK_TYPE(
struct nk, style_item, style_item);
5729NK_CONFIGURATION_STACK_TYPE(nk ,
float,
float);
5730NK_CONFIGURATION_STACK_TYPE(
struct nk, vec2, vec2);
5731NK_CONFIGURATION_STACK_TYPE(nk ,flags, flags);
5732NK_CONFIGURATION_STACK_TYPE(
struct nk, color, color);
5733NK_CONFIGURATION_STACK_TYPE(
const struct nk, user_font, user_font*);
5734NK_CONFIGURATION_STACK_TYPE(
enum nk, button_behavior, button_behavior);
5736NK_CONFIG_STACK(style_item, NK_STYLE_ITEM_STACK_SIZE);
5737NK_CONFIG_STACK(
float, NK_FLOAT_STACK_SIZE);
5738NK_CONFIG_STACK(vec2, NK_VECTOR_STACK_SIZE);
5739NK_CONFIG_STACK(flags, NK_FLAGS_STACK_SIZE);
5740NK_CONFIG_STACK(color, NK_COLOR_STACK_SIZE);
5741NK_CONFIG_STACK(user_font, NK_FONT_STACK_SIZE);
5742NK_CONFIG_STACK(button_behavior, NK_BUTTON_BEHAVIOR_STACK_SIZE);
5745 struct nk_config_stack_style_item style_items;
5746 struct nk_config_stack_float floats;
5747 struct nk_config_stack_vec2 vectors;
5748 struct nk_config_stack_flags flags;
5749 struct nk_config_stack_color colors;
5750 struct nk_config_stack_user_font fonts;
5751 struct nk_config_stack_button_behavior button_behaviors;
5757#define NK_VALUE_PAGE_CAPACITY \
5758 (((NK_MAX(sizeof(struct nk_window),sizeof(struct nk_panel)) / sizeof(nk_uint))) / 2)
5763 nk_hash keys[NK_VALUE_PAGE_CAPACITY];
5764 nk_uint values[NK_VALUE_PAGE_CAPACITY];
5788 enum nk_allocation_type type;
5789 unsigned int page_count;
5803 nk_flags last_widget_state;
5804 enum nk_button_behavior button_behavior;
5806 float delta_time_seconds;
5811#ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT
5812 struct nk_draw_list draw_list;
5814#ifdef NK_INCLUDE_COMMAND_USERDATA
5841#define NK_PI 3.141592654f
5842#define NK_PI_HALF 1.570796326f
5843#define NK_UTF_INVALID 0xFFFD
5845#ifndef NK_MAX_FLOAT_PRECISION
5846#define NK_MAX_FLOAT_PRECISION 2
5849#define NK_UNUSED(x) ((void)(x))
5850#define NK_SATURATE(x) (NK_MAX(0, NK_MIN(1.0f, x)))
5851#define NK_LEN(a) (sizeof(a)/sizeof(a)[0])
5852#define NK_ABS(a) (((a) < 0) ? -(a) : (a))
5853#define NK_BETWEEN(x, a, b) ((a) <= (x) && (x) < (b))
5854#define NK_INBOX(px, py, x, y, w, h)\
5855 (NK_BETWEEN(px,x,x+w) && NK_BETWEEN(py,y,y+h))
5856#define NK_INTERSECT(x0, y0, w0, h0, x1, y1, w1, h1) \
5857 ((x1 < (x0 + w0)) && (x0 < (x1 + w1)) && \
5858 (y1 < (y0 + h0)) && (y0 < (y1 + h1)))
5859#define NK_CONTAINS(x, y, w, h, bx, by, bw, bh)\
5860 (NK_INBOX(x,y, bx, by, bw, bh) && NK_INBOX(x+w,y+h, bx, by, bw, bh))
5862#define nk_vec2_sub(a, b) nk_vec2((a).x - (b).x, (a).y - (b).y)
5863#define nk_vec2_add(a, b) nk_vec2((a).x + (b).x, (a).y + (b).y)
5864#define nk_vec2_len_sqr(a) ((a).x*(a).x+(a).y*(a).y)
5865#define nk_vec2_muls(a, t) nk_vec2((a).x * (t), (a).y * (t))
5867#define nk_ptr_add(t, p, i) ((t*)((void*)((nk_byte*)(p) + (i))))
5868#define nk_ptr_add_const(t, p, i) ((const t*)((const void*)((const nk_byte*)(p) + (i))))
5869#define nk_zero_struct(s) nk_zero(&s, sizeof(s))
5875#if defined(__PTRDIFF_TYPE__)
5876# define NK_UINT_TO_PTR(x) ((void*)(__PTRDIFF_TYPE__)(x))
5877# define NK_PTR_TO_UINT(x) ((nk_size)(__PTRDIFF_TYPE__)(x))
5878#elif !defined(__GNUC__)
5879# define NK_UINT_TO_PTR(x) ((void*)&((char*)0)[x])
5880# define NK_PTR_TO_UINT(x) ((nk_size)(((char*)x)-(char*)0))
5881#elif defined(NK_USE_FIXED_TYPES)
5882# define NK_UINT_TO_PTR(x) ((void*)(uintptr_t)(x))
5883# define NK_PTR_TO_UINT(x) ((uintptr_t)(x))
5885# define NK_UINT_TO_PTR(x) ((void*)(x))
5886# define NK_PTR_TO_UINT(x) ((nk_size)(x))
5889#define NK_ALIGN_PTR(x, mask)\
5890 (NK_UINT_TO_PTR((NK_PTR_TO_UINT((nk_byte*)(x) + (mask-1)) & ~(mask-1))))
5891#define NK_ALIGN_PTR_BACK(x, mask)\
5892 (NK_UINT_TO_PTR((NK_PTR_TO_UINT((nk_byte*)(x)) & ~(mask-1))))
5894#if ((defined(__GNUC__) && __GNUC__ >= 4) || defined(__clang__)) && !defined(__EMSCRIPTEN__)
5895#define NK_OFFSETOF(st,m) (__builtin_offsetof(st,m))
5897#define NK_OFFSETOF(st,m) ((nk_ptr)&(((st*)0)->m))
5905template<
typename T>
struct nk_alignof;
5906template<
typename T,
int size_diff>
struct nk_helper{
enum {value = size_diff};};
5907template<
typename T>
struct nk_helper<T,0>{
enum {value = nk_alignof<T>::value};};
5908template<
typename T>
struct nk_alignof{
struct Big {T x;
char c;};
enum {
5909 diff =
sizeof(Big) -
sizeof(T), value = nk_helper<Big, diff>::value};};
5910#define NK_ALIGNOF(t) (nk_alignof<t>::value)
5912#define NK_ALIGNOF(t) NK_OFFSETOF(struct {char c; t _h;}, _h)
5915#define NK_CONTAINER_OF(ptr,type,member)\
5916 (type*)((void*)((char*)(1 ? (ptr): &((type*)0)->member) - NK_OFFSETOF(type, member)))
struct nk_allocator pool
!< buffer marker to free a buffer to a certain offset
struct nk_memory memory
!< memory management type
enum nk_allocation_type type
!< allocator callback for dynamic buffers
nk_size needed
!< total amount of memory allocated
nk_size size
!< number of allocation calls
nk_size allocated
!< growing factor for dynamic memory management
float grow_factor
!< memory and size of the current memory block
nk_size calls
!< totally consumed memory given that enough memory is present
command base and header of every command inside the buffer
struct nk_text_edit text_edit
text editor objects are quite big because of an internal undo/redo stack.
struct nk_command_buffer overlay
draw buffer used for overlay drawing operation like cursor
enum nk_anti_aliasing shape_AA
!< line anti-aliasing flag can be turned off if you are tight on memory
enum nk_anti_aliasing line_AA
!< global alpha value
nk_size vertex_alignment
!< sizeof one vertex for vertex packing
nk_size vertex_size
!< describes the vertex output format and packing
const struct nk_draw_vertex_layout_element * vertex_layout
!< handle to texture with a white pixel for shape drawing
unsigned arc_segment_count
!< number of segments used for circles: default to 22
unsigned circle_segment_count
!< shape anti-aliasing flag can be turned off if you are tight on memory
unsigned curve_segment_count
!< number of segments used for arcs: default to 22
struct nk_draw_null_texture tex_null
!< number of segments used for curves: default to 22
struct nk_vec2 uv
!< texture handle to a texture with a white pixel
Basic string buffer which is only used in context with the text editor to manage and manipulate dynam...
nk_text_width_f width
!< max height of the font
float height
!< user provided font handle