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(_WIN32) || defined(WIN32)) && defined(_MSC_VER)
159 #define NK_SIZE_TYPE unsigned __int32
160 #elif defined(__GNUC__) || defined(__clang__)
161 #if defined(__x86_64__) || defined(__ppc64__) || defined(__PPC64__) || defined(__aarch64__)
162 #define NK_SIZE_TYPE unsigned long
164 #define NK_SIZE_TYPE unsigned int
167 #define NK_SIZE_TYPE unsigned long
170 #ifndef NK_POINTER_TYPE
171 #if defined(_WIN64) && defined(_MSC_VER)
172 #define NK_POINTER_TYPE unsigned __int64
173 #elif (defined(_WIN32) || defined(WIN32)) && defined(_MSC_VER)
174 #define NK_POINTER_TYPE unsigned __int32
175 #elif defined(__GNUC__) || defined(__clang__)
176 #if defined(__x86_64__) || defined(__ppc64__) || defined(__PPC64__) || defined(__aarch64__)
177 #define NK_POINTER_TYPE unsigned long
179 #define NK_POINTER_TYPE unsigned int
182 #define NK_POINTER_TYPE unsigned long
188 #ifdef NK_INCLUDE_STANDARD_BOOL
196 typedef NK_INT8 nk_char;
197 typedef NK_UINT8 nk_uchar;
198 typedef NK_UINT8 nk_byte;
199 typedef NK_INT16 nk_short;
200 typedef NK_UINT16 nk_ushort;
201 typedef NK_INT32 nk_int;
202 typedef NK_UINT32 nk_uint;
203 typedef NK_SIZE_TYPE nk_size;
204 typedef NK_POINTER_TYPE nk_ptr;
207 typedef nk_uint nk_hash;
208 typedef nk_uint nk_flags;
209 typedef nk_uint nk_rune;
214 NK_STATIC_ASSERT(
sizeof(nk_short) == 2);
215 NK_STATIC_ASSERT(
sizeof(nk_ushort) == 2);
216 NK_STATIC_ASSERT(
sizeof(nk_uint) == 4);
217 NK_STATIC_ASSERT(
sizeof(nk_int) == 4);
218 NK_STATIC_ASSERT(
sizeof(nk_byte) == 1);
219 NK_STATIC_ASSERT(
sizeof(nk_flags) >= 4);
220 NK_STATIC_ASSERT(
sizeof(nk_rune) >= 4);
221 NK_STATIC_ASSERT(
sizeof(nk_size) >=
sizeof(
void*));
222 NK_STATIC_ASSERT(
sizeof(nk_ptr) >=
sizeof(
void*));
223 #ifdef NK_INCLUDE_STANDARD_BOOL
224 NK_STATIC_ASSERT(
sizeof(nk_bool) ==
sizeof(
bool));
226 NK_STATIC_ASSERT(
sizeof(nk_bool) >= 2);
237 struct nk_draw_command;
245 struct nk_draw_vertex_layout_element;
249 struct nk_style_slide;
260 enum {nk_false, nk_true};
274 enum nk_heading {NK_UP, NK_RIGHT, NK_DOWN, NK_LEFT};
275 enum nk_button_behavior {NK_BUTTON_DEFAULT, NK_BUTTON_REPEATER};
276 enum nk_modify {NK_FIXED = nk_false, NK_MODIFIABLE = nk_true};
277 enum nk_orientation {NK_VERTICAL, NK_HORIZONTAL};
278 enum nk_collapse_states {NK_MINIMIZED = nk_false, NK_MAXIMIZED = nk_true};
279 enum nk_show_states {NK_HIDDEN = nk_false, NK_SHOWN = nk_true};
280 enum nk_chart_type {NK_CHART_LINES, NK_CHART_COLUMN, NK_CHART_MAX};
281 enum nk_chart_event {NK_CHART_HOVERING = 0x01, NK_CHART_CLICKED = 0x02};
282 enum nk_color_format {NK_RGB, NK_RGBA};
283 enum nk_popup_type {NK_POPUP_STATIC, NK_POPUP_DYNAMIC};
284 enum nk_layout_format {NK_DYNAMIC, NK_STATIC};
285 enum nk_tree_type {NK_TREE_NODE, NK_TREE_TAB};
287 typedef void*(*nk_plugin_alloc)(
nk_handle,
void *old, nk_size);
288 typedef void (*nk_plugin_free)(
nk_handle,
void *old);
289 typedef nk_bool(*nk_plugin_filter)(
const struct nk_text_edit*, nk_rune unicode);
291 typedef void(*nk_plugin_copy)(
nk_handle,
const char*,
int len);
295 nk_plugin_alloc alloc;
298 enum nk_symbol_type {
301 NK_SYMBOL_UNDERSCORE,
302 NK_SYMBOL_CIRCLE_SOLID,
303 NK_SYMBOL_CIRCLE_OUTLINE,
304 NK_SYMBOL_RECT_SOLID,
305 NK_SYMBOL_RECT_OUTLINE,
306 NK_SYMBOL_TRIANGLE_UP,
307 NK_SYMBOL_TRIANGLE_DOWN,
308 NK_SYMBOL_TRIANGLE_LEFT,
309 NK_SYMBOL_TRIANGLE_RIGHT,
312 NK_SYMBOL_TRIANGLE_UP_OUTLINE,
313 NK_SYMBOL_TRIANGLE_DOWN_OUTLINE,
314 NK_SYMBOL_TRIANGLE_LEFT_OUTLINE,
315 NK_SYMBOL_TRIANGLE_RIGHT_OUTLINE,
358 #ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
471 #ifdef NK_INCLUDE_COMMAND_USERDATA
570 NK_KEY_TEXT_INSERT_MODE,
571 NK_KEY_TEXT_REPLACE_MODE,
572 NK_KEY_TEXT_RESET_MODE,
573 NK_KEY_TEXT_LINE_START,
574 NK_KEY_TEXT_LINE_END,
579 NK_KEY_TEXT_SELECT_ALL,
580 NK_KEY_TEXT_WORD_LEFT,
581 NK_KEY_TEXT_WORD_RIGHT,
966 enum nk_anti_aliasing {NK_ANTI_ALIASING_OFF, NK_ANTI_ALIASING_ON};
967 enum nk_convert_result {
968 NK_CONVERT_SUCCESS = 0,
969 NK_CONVERT_INVALID_PARAM = 1,
970 NK_CONVERT_COMMAND_BUFFER_FULL = NK_FLAG(1),
971 NK_CONVERT_VERTEX_BUFFER_FULL = NK_FLAG(2),
972 NK_CONVERT_ELEMENT_BUFFER_FULL = NK_FLAG(3)
1031 #define nk_foreach(c, ctx) for((c) = nk__begin(ctx); (c) != 0; (c) = nk__next(ctx,c))
1033 #ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT
1079 NK_API
const struct nk_draw_command* nk__draw_begin(
const struct nk_context*,
const struct nk_buffer*);
1098 NK_API
const struct nk_draw_command* nk__draw_end(
const struct nk_context*,
const struct nk_buffer*);
1117 NK_API
const struct nk_draw_command* nk__draw_next(
const struct nk_draw_command*,
const struct nk_buffer*,
const struct nk_context*);
1134 #define nk_draw_foreach(cmd,ctx, b) for((cmd)=nk__draw_begin(ctx, b); (cmd)!=0; (cmd)=nk__draw_next(cmd, b, ctx))
1284 enum nk_panel_flags {
1285 NK_WINDOW_BORDER = NK_FLAG(0),
1286 NK_WINDOW_MOVABLE = NK_FLAG(1),
1287 NK_WINDOW_SCALABLE = NK_FLAG(2),
1288 NK_WINDOW_CLOSABLE = NK_FLAG(3),
1289 NK_WINDOW_MINIMIZABLE = NK_FLAG(4),
1290 NK_WINDOW_NO_SCROLLBAR = NK_FLAG(5),
1291 NK_WINDOW_TITLE = NK_FLAG(6),
1292 NK_WINDOW_SCROLL_AUTO_HIDE = NK_FLAG(7),
1293 NK_WINDOW_BACKGROUND = NK_FLAG(8),
1294 NK_WINDOW_SCALE_LEFT = NK_FLAG(9),
1295 NK_WINDOW_NO_INPUT = NK_FLAG(10)
2206 enum nk_widget_align {
2207 NK_WIDGET_ALIGN_LEFT = 0x01,
2208 NK_WIDGET_ALIGN_CENTERED = 0x02,
2209 NK_WIDGET_ALIGN_RIGHT = 0x04,
2210 NK_WIDGET_ALIGN_TOP = 0x08,
2211 NK_WIDGET_ALIGN_MIDDLE = 0x10,
2212 NK_WIDGET_ALIGN_BOTTOM = 0x20
2214 enum nk_widget_alignment {
2215 NK_WIDGET_LEFT = NK_WIDGET_ALIGN_MIDDLE|NK_WIDGET_ALIGN_LEFT,
2216 NK_WIDGET_CENTERED = NK_WIDGET_ALIGN_MIDDLE|NK_WIDGET_ALIGN_CENTERED,
2217 NK_WIDGET_RIGHT = NK_WIDGET_ALIGN_MIDDLE|NK_WIDGET_ALIGN_RIGHT
2360 NK_API
void nk_layout_row(
struct nk_context*,
enum nk_layout_format,
float height,
int cols,
const float *ratio);
2879 #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__)
2898 #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)
2920 NK_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);
2944 #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__)
2966 #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)
3054 #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__)
3055 #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)
3056 NK_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);
3057 NK_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);
3058 NK_API
void nk_tree_element_pop(
struct nk_context*);
3067 int begin, end, count;
3071 nk_uint *scroll_pointer;
3072 nk_uint scroll_value;
3074 NK_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);
3088 NK_WIDGET_STATE_MODIFIED = NK_FLAG(1),
3089 NK_WIDGET_STATE_INACTIVE = NK_FLAG(2),
3102 NK_API
float nk_widget_width(
const struct nk_context*);
3103 NK_API
float nk_widget_height(
const struct nk_context*);
3104 NK_API nk_bool nk_widget_is_hovered(
const struct nk_context*);
3105 NK_API nk_bool nk_widget_is_mouse_clicked(
const struct nk_context*,
enum nk_buttons);
3106 NK_API nk_bool nk_widget_has_mouse_click_down(
const struct nk_context*,
enum nk_buttons, nk_bool down);
3107 NK_API
void nk_spacing(
struct nk_context*,
int cols);
3108 NK_API
void nk_widget_disable_begin(
struct nk_context* ctx);
3109 NK_API
void nk_widget_disable_end(
struct nk_context* ctx);
3115 enum nk_text_align {
3116 NK_TEXT_ALIGN_LEFT = 0x01,
3117 NK_TEXT_ALIGN_CENTERED = 0x02,
3118 NK_TEXT_ALIGN_RIGHT = 0x04,
3119 NK_TEXT_ALIGN_TOP = 0x08,
3120 NK_TEXT_ALIGN_MIDDLE = 0x10,
3121 NK_TEXT_ALIGN_BOTTOM = 0x20
3123 enum nk_text_alignment {
3124 NK_TEXT_LEFT = NK_TEXT_ALIGN_MIDDLE|NK_TEXT_ALIGN_LEFT,
3125 NK_TEXT_CENTERED = NK_TEXT_ALIGN_MIDDLE|NK_TEXT_ALIGN_CENTERED,
3126 NK_TEXT_RIGHT = NK_TEXT_ALIGN_MIDDLE|NK_TEXT_ALIGN_RIGHT
3129 NK_API
void nk_text_colored(
struct nk_context*,
const char*,
int, nk_flags,
struct nk_color);
3130 NK_API
void nk_text_wrap(
struct nk_context*,
const char*,
int);
3131 NK_API
void nk_text_wrap_colored(
struct nk_context*,
const char*,
int,
struct nk_color);
3132 NK_API
void nk_label(
struct nk_context*,
const char*, nk_flags align);
3133 NK_API
void nk_label_colored(
struct nk_context*,
const char*, nk_flags align,
struct nk_color);
3134 NK_API
void nk_label_wrap(
struct nk_context*,
const char*);
3138 #ifdef NK_INCLUDE_STANDARD_VARARGS
3139 NK_API
void nk_labelf(
struct nk_context*, nk_flags, NK_PRINTF_FORMAT_STRING
const char*, ...) NK_PRINTF_VARARG_FUNC(3);
3140 NK_API
void nk_labelf_colored(struct
nk_context*, nk_flags, struct
nk_color, NK_PRINTF_FORMAT_STRING const
char*,...) NK_PRINTF_VARARG_FUNC(4);
3141 NK_API
void nk_labelf_wrap(struct
nk_context*, NK_PRINTF_FORMAT_STRING const
char*,...) NK_PRINTF_VARARG_FUNC(2);
3142 NK_API
void nk_labelf_colored_wrap(struct
nk_context*, struct
nk_color, NK_PRINTF_FORMAT_STRING const
char*,...) NK_PRINTF_VARARG_FUNC(3);
3143 NK_API
void nk_labelfv(struct
nk_context*, nk_flags, NK_PRINTF_FORMAT_STRING const
char*, va_list) NK_PRINTF_VALIST_FUNC(3);
3144 NK_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);
3145 NK_API
void nk_labelfv_wrap(struct
nk_context*, NK_PRINTF_FORMAT_STRING const
char*, va_list) NK_PRINTF_VALIST_FUNC(2);
3146 NK_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);
3147 NK_API
void nk_value_bool(struct
nk_context*, const
char *prefix,
int);
3148 NK_API
void nk_value_int(struct
nk_context*, const
char *prefix,
int);
3149 NK_API
void nk_value_uint(struct
nk_context*, const
char *prefix,
unsigned int);
3150 NK_API
void nk_value_float(struct
nk_context*, const
char *prefix,
float);
3151 NK_API
void nk_value_color_byte(struct
nk_context*, const
char *prefix, struct
nk_color);
3152 NK_API
void nk_value_color_float(struct
nk_context*, const
char *prefix, struct
nk_color);
3153 NK_API
void nk_value_color_hex(struct
nk_context*, const
char *prefix, struct
nk_color);
3160 NK_API nk_bool nk_button_text(
struct nk_context*,
const char *title,
int len);
3161 NK_API nk_bool nk_button_label(
struct nk_context*,
const char *title);
3163 NK_API nk_bool nk_button_symbol(
struct nk_context*,
enum nk_symbol_type);
3165 NK_API nk_bool nk_button_symbol_label(
struct nk_context*,
enum nk_symbol_type,
const char*, nk_flags text_alignment);
3166 NK_API nk_bool nk_button_symbol_text(
struct nk_context*,
enum nk_symbol_type,
const char*,
int, nk_flags alignment);
3167 NK_API nk_bool nk_button_image_label(
struct nk_context*,
struct nk_image img,
const char*, nk_flags text_alignment);
3168 NK_API nk_bool nk_button_image_text(
struct nk_context*,
struct nk_image img,
const char*,
int, nk_flags alignment);
3173 NK_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);
3174 NK_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);
3177 NK_API
void nk_button_set_behavior(
struct nk_context*,
enum nk_button_behavior);
3178 NK_API nk_bool nk_button_push_behavior(
struct nk_context*,
enum nk_button_behavior);
3179 NK_API nk_bool nk_button_pop_behavior(
struct nk_context*);
3185 NK_API nk_bool nk_check_label(
struct nk_context*,
const char*, nk_bool active);
3186 NK_API nk_bool nk_check_text(
struct nk_context*,
const char*,
int, nk_bool active);
3187 NK_API nk_bool nk_check_text_align(
struct nk_context*,
const char*,
int, nk_bool active, nk_flags widget_alignment, nk_flags text_alignment);
3188 NK_API
unsigned nk_check_flags_label(
struct nk_context*,
const char*,
unsigned int flags,
unsigned int value);
3189 NK_API
unsigned nk_check_flags_text(
struct nk_context*,
const char*,
int,
unsigned int flags,
unsigned int value);
3190 NK_API nk_bool nk_checkbox_label(
struct nk_context*,
const char*, nk_bool *active);
3191 NK_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);
3192 NK_API nk_bool nk_checkbox_text(
struct nk_context*,
const char*,
int, nk_bool *active);
3193 NK_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);
3194 NK_API nk_bool nk_checkbox_flags_label(
struct nk_context*,
const char*,
unsigned int *flags,
unsigned int value);
3195 NK_API nk_bool nk_checkbox_flags_text(
struct nk_context*,
const char*,
int,
unsigned int *flags,
unsigned int value);
3201 NK_API nk_bool nk_radio_label(
struct nk_context*,
const char*, nk_bool *active);
3202 NK_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);
3203 NK_API nk_bool nk_radio_text(
struct nk_context*,
const char*,
int, nk_bool *active);
3204 NK_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);
3205 NK_API nk_bool nk_option_label(
struct nk_context*,
const char*, nk_bool active);
3206 NK_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);
3207 NK_API nk_bool nk_option_text(
struct nk_context*,
const char*,
int, nk_bool active);
3208 NK_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);
3214 NK_API nk_bool nk_selectable_label(
struct nk_context*,
const char*, nk_flags align, nk_bool *value);
3215 NK_API nk_bool nk_selectable_text(
struct nk_context*,
const char*,
int, nk_flags align, nk_bool *value);
3216 NK_API nk_bool nk_selectable_image_label(
struct nk_context*,
struct nk_image,
const char*, nk_flags align, nk_bool *value);
3217 NK_API nk_bool nk_selectable_image_text(
struct nk_context*,
struct nk_image,
const char*,
int, nk_flags align, nk_bool *value);
3218 NK_API nk_bool nk_selectable_symbol_label(
struct nk_context*,
enum nk_symbol_type,
const char*, nk_flags align, nk_bool *value);
3219 NK_API nk_bool nk_selectable_symbol_text(
struct nk_context*,
enum nk_symbol_type,
const char*,
int, nk_flags align, nk_bool *value);
3221 NK_API nk_bool nk_select_label(
struct nk_context*,
const char*, nk_flags align, nk_bool value);
3222 NK_API nk_bool nk_select_text(
struct nk_context*,
const char*,
int, nk_flags align, nk_bool value);
3223 NK_API nk_bool nk_select_image_label(
struct nk_context*,
struct nk_image,
const char*, nk_flags align, nk_bool value);
3224 NK_API nk_bool nk_select_image_text(
struct nk_context*,
struct nk_image,
const char*,
int, nk_flags align, nk_bool value);
3225 NK_API nk_bool nk_select_symbol_label(
struct nk_context*,
enum nk_symbol_type,
const char*, nk_flags align, nk_bool value);
3226 NK_API nk_bool nk_select_symbol_text(
struct nk_context*,
enum nk_symbol_type,
const char*,
int, nk_flags align, nk_bool value);
3233 NK_API
float nk_slide_float(
struct nk_context*,
float min,
float val,
float max,
float step);
3234 NK_API
int nk_slide_int(
struct nk_context*,
int min,
int val,
int max,
int step);
3235 NK_API nk_bool nk_slider_float(
struct nk_context*,
float min,
float *val,
float max,
float step);
3236 NK_API nk_bool nk_slider_int(
struct nk_context*,
int min,
int *val,
int max,
int step);
3243 NK_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);
3244 NK_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);
3251 NK_API nk_bool nk_progress(
struct nk_context*, nk_size *cur, nk_size max, nk_bool modifyable);
3252 NK_API nk_size nk_prog(
struct nk_context*, nk_size cur, nk_size max, nk_bool modifyable);
3260 NK_API nk_bool nk_color_pick(
struct nk_context*,
struct nk_colorf*,
enum nk_color_format);
3358 NK_API
void nk_property_int(
struct nk_context*,
const char *name,
int min,
int *val,
int max,
int step,
float inc_per_pixel);
3381 NK_API
void nk_property_float(
struct nk_context*,
const char *name,
float min,
float *val,
float max,
float step,
float inc_per_pixel);
3404 NK_API
void nk_property_double(
struct nk_context*,
const char *name,
double min,
double *val,
double max,
double step,
float inc_per_pixel);
3427 NK_API
int nk_propertyi(
struct nk_context*,
const char *name,
int min,
int val,
int max,
int step,
float inc_per_pixel);
3450 NK_API
float nk_propertyf(
struct nk_context*,
const char *name,
float min,
float val,
float max,
float step,
float inc_per_pixel);
3473 NK_API
double nk_propertyd(
struct nk_context*,
const char *name,
double min,
double val,
double max,
double step,
float inc_per_pixel);
3480 enum nk_edit_flags {
3481 NK_EDIT_DEFAULT = 0,
3482 NK_EDIT_READ_ONLY = NK_FLAG(0),
3483 NK_EDIT_AUTO_SELECT = NK_FLAG(1),
3484 NK_EDIT_SIG_ENTER = NK_FLAG(2),
3485 NK_EDIT_ALLOW_TAB = NK_FLAG(3),
3486 NK_EDIT_NO_CURSOR = NK_FLAG(4),
3487 NK_EDIT_SELECTABLE = NK_FLAG(5),
3488 NK_EDIT_CLIPBOARD = NK_FLAG(6),
3489 NK_EDIT_CTRL_ENTER_NEWLINE = NK_FLAG(7),
3490 NK_EDIT_NO_HORIZONTAL_SCROLL = NK_FLAG(8),
3491 NK_EDIT_ALWAYS_INSERT_MODE = NK_FLAG(9),
3492 NK_EDIT_MULTILINE = NK_FLAG(10),
3493 NK_EDIT_GOTO_END_ON_ACTIVATE = NK_FLAG(11)
3495 enum nk_edit_types {
3496 NK_EDIT_SIMPLE = NK_EDIT_ALWAYS_INSERT_MODE,
3497 NK_EDIT_FIELD = NK_EDIT_SIMPLE|NK_EDIT_SELECTABLE|NK_EDIT_CLIPBOARD,
3498 NK_EDIT_BOX = NK_EDIT_ALWAYS_INSERT_MODE| NK_EDIT_SELECTABLE| NK_EDIT_MULTILINE|NK_EDIT_ALLOW_TAB|NK_EDIT_CLIPBOARD,
3499 NK_EDIT_EDITOR = NK_EDIT_SELECTABLE|NK_EDIT_MULTILINE|NK_EDIT_ALLOW_TAB| NK_EDIT_CLIPBOARD
3502 NK_EDIT_ACTIVE = NK_FLAG(0),
3508 NK_API nk_flags nk_edit_string(
struct nk_context*, nk_flags,
char *buffer,
int *len,
int max, nk_plugin_filter);
3509 NK_API nk_flags nk_edit_string_zero_terminated(
struct nk_context*, nk_flags,
char *buffer,
int max, nk_plugin_filter);
3511 NK_API
void nk_edit_focus(
struct nk_context*, nk_flags flags);
3512 NK_API
void nk_edit_unfocus(
struct nk_context*);
3518 NK_API nk_bool nk_chart_begin(
struct nk_context*,
enum nk_chart_type,
int num,
float min,
float max);
3519 NK_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);
3520 NK_API
void nk_chart_add_slot(
struct nk_context *ctx,
const enum nk_chart_type,
int count,
float min_value,
float max_value);
3521 NK_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);
3522 NK_API nk_flags nk_chart_push(
struct nk_context*,
float);
3523 NK_API nk_flags nk_chart_push_slot(
struct nk_context*,
float,
int);
3524 NK_API
void nk_chart_end(
struct nk_context*);
3525 NK_API
void nk_plot(
struct nk_context*,
enum nk_chart_type,
const float *values,
int count,
int offset);
3526 NK_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);
3532 NK_API nk_bool nk_popup_begin(
struct nk_context*,
enum nk_popup_type,
const char*, nk_flags,
struct nk_rect bounds);
3533 NK_API
void nk_popup_close(
struct nk_context*);
3534 NK_API
void nk_popup_end(
struct nk_context*);
3535 NK_API
void nk_popup_get_scroll(
const struct nk_context*, nk_uint *offset_x, nk_uint *offset_y);
3536 NK_API
void nk_popup_set_scroll(
struct nk_context*, nk_uint offset_x, nk_uint offset_y);
3542 NK_API
int nk_combo(
struct nk_context*,
const char *
const *items,
int count,
int selected,
int item_height,
struct nk_vec2 size);
3543 NK_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);
3544 NK_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);
3545 NK_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);
3546 NK_API
void nk_combobox(
struct nk_context*,
const char *
const *items,
int count,
int *selected,
int item_height,
struct nk_vec2 size);
3547 NK_API
void nk_combobox_string(
struct nk_context*,
const char *items_separated_by_zeros,
int *selected,
int count,
int item_height,
struct nk_vec2 size);
3548 NK_API
void 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);
3549 NK_API
void 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);
3555 NK_API nk_bool nk_combo_begin_text(
struct nk_context*,
const char *selected,
int,
struct nk_vec2 size);
3556 NK_API nk_bool nk_combo_begin_label(
struct nk_context*,
const char *selected,
struct nk_vec2 size);
3558 NK_API nk_bool nk_combo_begin_symbol(
struct nk_context*,
enum nk_symbol_type,
struct nk_vec2 size);
3559 NK_API nk_bool nk_combo_begin_symbol_label(
struct nk_context*,
const char *selected,
enum nk_symbol_type,
struct nk_vec2 size);
3560 NK_API nk_bool nk_combo_begin_symbol_text(
struct nk_context*,
const char *selected,
int,
enum nk_symbol_type,
struct nk_vec2 size);
3562 NK_API nk_bool nk_combo_begin_image_label(
struct nk_context*,
const char *selected,
struct nk_image,
struct nk_vec2 size);
3563 NK_API nk_bool nk_combo_begin_image_text(
struct nk_context*,
const char *selected,
int,
struct nk_image,
struct nk_vec2 size);
3564 NK_API nk_bool nk_combo_item_label(
struct nk_context*,
const char*, nk_flags alignment);
3565 NK_API nk_bool nk_combo_item_text(
struct nk_context*,
const char*,
int, nk_flags alignment);
3566 NK_API nk_bool nk_combo_item_image_label(
struct nk_context*,
struct nk_image,
const char*, nk_flags alignment);
3567 NK_API nk_bool nk_combo_item_image_text(
struct nk_context*,
struct nk_image,
const char*,
int,nk_flags alignment);
3568 NK_API nk_bool nk_combo_item_symbol_label(
struct nk_context*,
enum nk_symbol_type,
const char*, nk_flags alignment);
3569 NK_API nk_bool nk_combo_item_symbol_text(
struct nk_context*,
enum nk_symbol_type,
const char*,
int, nk_flags alignment);
3570 NK_API
void nk_combo_close(
struct nk_context*);
3571 NK_API
void nk_combo_end(
struct nk_context*);
3578 NK_API nk_bool nk_contextual_item_text(
struct nk_context*,
const char*,
int,nk_flags align);
3579 NK_API nk_bool nk_contextual_item_label(
struct nk_context*,
const char*, nk_flags align);
3580 NK_API nk_bool nk_contextual_item_image_label(
struct nk_context*,
struct nk_image,
const char*, nk_flags alignment);
3581 NK_API nk_bool nk_contextual_item_image_text(
struct nk_context*,
struct nk_image,
const char*,
int len, nk_flags alignment);
3582 NK_API nk_bool nk_contextual_item_symbol_label(
struct nk_context*,
enum nk_symbol_type,
const char*, nk_flags alignment);
3583 NK_API nk_bool nk_contextual_item_symbol_text(
struct nk_context*,
enum nk_symbol_type,
const char*,
int, nk_flags alignment);
3584 NK_API
void nk_contextual_close(
struct nk_context*);
3585 NK_API
void nk_contextual_end(
struct nk_context*);
3591 NK_API
void nk_tooltip(
struct nk_context*,
const char*);
3592 #ifdef NK_INCLUDE_STANDARD_VARARGS
3593 NK_API
void nk_tooltipf(
struct nk_context*, NK_PRINTF_FORMAT_STRING
const char*, ...) NK_PRINTF_VARARG_FUNC(2);
3594 NK_API
void nk_tooltipfv(struct
nk_context*, NK_PRINTF_FORMAT_STRING const
char*, va_list) NK_PRINTF_VALIST_FUNC(2);
3596 NK_API nk_bool nk_tooltip_begin(
struct nk_context*,
float width);
3597 NK_API
void nk_tooltip_end(
struct nk_context*);
3603 NK_API
void nk_menubar_begin(
struct nk_context*);
3604 NK_API
void nk_menubar_end(
struct nk_context*);
3605 NK_API nk_bool nk_menu_begin_text(
struct nk_context*,
const char* title,
int title_len, nk_flags align,
struct nk_vec2 size);
3606 NK_API nk_bool nk_menu_begin_label(
struct nk_context*,
const char*, nk_flags align,
struct nk_vec2 size);
3608 NK_API nk_bool nk_menu_begin_image_text(
struct nk_context*,
const char*,
int,nk_flags align,
struct nk_image,
struct nk_vec2 size);
3609 NK_API nk_bool nk_menu_begin_image_label(
struct nk_context*,
const char*, nk_flags align,
struct nk_image,
struct nk_vec2 size);
3610 NK_API nk_bool nk_menu_begin_symbol(
struct nk_context*,
const char*,
enum nk_symbol_type,
struct nk_vec2 size);
3611 NK_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);
3612 NK_API nk_bool nk_menu_begin_symbol_label(
struct nk_context*,
const char*, nk_flags align,
enum nk_symbol_type,
struct nk_vec2 size);
3613 NK_API nk_bool nk_menu_item_text(
struct nk_context*,
const char*,
int,nk_flags align);
3614 NK_API nk_bool nk_menu_item_label(
struct nk_context*,
const char*, nk_flags alignment);
3615 NK_API nk_bool nk_menu_item_image_label(
struct nk_context*,
struct nk_image,
const char*, nk_flags alignment);
3616 NK_API nk_bool nk_menu_item_image_text(
struct nk_context*,
struct nk_image,
const char*,
int len, nk_flags alignment);
3617 NK_API nk_bool nk_menu_item_symbol_text(
struct nk_context*,
enum nk_symbol_type,
const char*,
int, nk_flags alignment);
3618 NK_API nk_bool nk_menu_item_symbol_label(
struct nk_context*,
enum nk_symbol_type,
const char*, nk_flags alignment);
3619 NK_API
void nk_menu_close(
struct nk_context*);
3627 #define NK_WIDGET_DISABLED_FACTOR 0.5f
3629 enum nk_style_colors {
3635 NK_COLOR_BUTTON_HOVER,
3636 NK_COLOR_BUTTON_ACTIVE,
3638 NK_COLOR_TOGGLE_HOVER,
3639 NK_COLOR_TOGGLE_CURSOR,
3641 NK_COLOR_SELECT_ACTIVE,
3643 NK_COLOR_SLIDER_CURSOR,
3644 NK_COLOR_SLIDER_CURSOR_HOVER,
3645 NK_COLOR_SLIDER_CURSOR_ACTIVE,
3648 NK_COLOR_EDIT_CURSOR,
3651 NK_COLOR_CHART_COLOR,
3652 NK_COLOR_CHART_COLOR_HIGHLIGHT,
3654 NK_COLOR_SCROLLBAR_CURSOR,
3655 NK_COLOR_SCROLLBAR_CURSOR_HOVER,
3656 NK_COLOR_SCROLLBAR_CURSOR_ACTIVE,
3657 NK_COLOR_TAB_HEADER,
3659 NK_COLOR_KNOB_CURSOR,
3660 NK_COLOR_KNOB_CURSOR_HOVER,
3661 NK_COLOR_KNOB_CURSOR_ACTIVE,
3664 enum nk_style_cursor {
3668 NK_CURSOR_RESIZE_VERTICAL,
3669 NK_CURSOR_RESIZE_HORIZONTAL,
3670 NK_CURSOR_RESIZE_TOP_LEFT_DOWN_RIGHT,
3671 NK_CURSOR_RESIZE_TOP_RIGHT_DOWN_LEFT,
3674 NK_API
void nk_style_default(
struct nk_context*);
3676 NK_API
void nk_style_load_cursor(
struct nk_context*,
enum nk_style_cursor,
const struct nk_cursor*);
3678 NK_API
const char* nk_style_get_color_by_name(
enum nk_style_colors);
3680 NK_API nk_bool nk_style_set_cursor(
struct nk_context*,
enum nk_style_cursor);
3681 NK_API
void nk_style_show_cursor(
struct nk_context*);
3682 NK_API
void nk_style_hide_cursor(
struct nk_context*);
3685 NK_API nk_bool nk_style_push_float(
struct nk_context*,
float*,
float);
3688 NK_API nk_bool nk_style_push_flags(
struct nk_context*, nk_flags*, nk_flags);
3691 NK_API nk_bool nk_style_pop_font(
struct nk_context*);
3692 NK_API nk_bool nk_style_pop_float(
struct nk_context*);
3693 NK_API nk_bool nk_style_pop_vec2(
struct nk_context*);
3694 NK_API nk_bool nk_style_pop_style_item(
struct nk_context*);
3695 NK_API nk_bool nk_style_pop_flags(
struct nk_context*);
3696 NK_API nk_bool nk_style_pop_color(
struct nk_context*);
3702 NK_API
struct nk_color nk_rgb(int r, int g, int b);
3703 NK_API
struct nk_color nk_rgb_iv(const int *rgb);
3704 NK_API
struct nk_color nk_rgb_bv(const nk_byte* rgb);
3705 NK_API
struct nk_color nk_rgb_f(float r, float g, float b);
3706 NK_API
struct nk_color nk_rgb_fv(const float *rgb);
3708 NK_API
struct nk_color nk_rgb_hex(const char *rgb);
3711 NK_API
struct nk_color nk_rgba(int r, int g, int b, int a);
3712 NK_API
struct nk_color nk_rgba_u32(nk_uint);
3713 NK_API
struct nk_color nk_rgba_iv(const int *rgba);
3714 NK_API
struct nk_color nk_rgba_bv(const nk_byte *rgba);
3715 NK_API
struct nk_color nk_rgba_f(float r, float g, float b, float a);
3716 NK_API
struct nk_color nk_rgba_fv(const float *rgba);
3718 NK_API
struct nk_color nk_rgba_hex(const char *rgb);
3720 NK_API
struct nk_colorf nk_hsva_colorf(float h, float s, float v, float a);
3721 NK_API
struct nk_colorf nk_hsva_colorfv(const float *c);
3722 NK_API
void nk_colorf_hsva_f(
float *out_h,
float *out_s,
float *out_v,
float *out_a,
struct nk_colorf in);
3723 NK_API
void nk_colorf_hsva_fv(
float *hsva,
struct nk_colorf in);
3725 NK_API
struct nk_color nk_hsv(int h, int s, int v);
3726 NK_API
struct nk_color nk_hsv_iv(const int *hsv);
3727 NK_API
struct nk_color nk_hsv_bv(const nk_byte *hsv);
3728 NK_API
struct nk_color nk_hsv_f(float h, float s, float v);
3729 NK_API
struct nk_color nk_hsv_fv(const float *hsv);
3731 NK_API
struct nk_color nk_hsva(int h, int s, int v, int a);
3732 NK_API
struct nk_color nk_hsva_iv(const int *hsva);
3733 NK_API
struct nk_color nk_hsva_bv(const nk_byte *hsva);
3734 NK_API
struct nk_color nk_hsva_f(float h, float s, float v, float a);
3735 NK_API
struct nk_color nk_hsva_fv(const float *hsva);
3738 NK_API
void nk_color_f(
float *r,
float *g,
float *b,
float *a,
struct nk_color);
3739 NK_API
void nk_color_fv(
float *rgba_out,
struct nk_color);
3741 NK_API
void nk_color_d(
double *r,
double *g,
double *b,
double *a,
struct nk_color);
3742 NK_API
void nk_color_dv(
double *rgba_out,
struct nk_color);
3744 NK_API nk_uint nk_color_u32(
struct nk_color);
3745 NK_API
void nk_color_hex_rgba(
char *output,
struct nk_color);
3746 NK_API
void nk_color_hex_rgb(
char *output,
struct nk_color);
3748 NK_API
void nk_color_hsv_i(
int *out_h,
int *out_s,
int *out_v,
struct nk_color);
3749 NK_API
void nk_color_hsv_b(nk_byte *out_h, nk_byte *out_s, nk_byte *out_v,
struct nk_color);
3750 NK_API
void nk_color_hsv_iv(
int *hsv_out,
struct nk_color);
3751 NK_API
void nk_color_hsv_bv(nk_byte *hsv_out,
struct nk_color);
3752 NK_API
void nk_color_hsv_f(
float *out_h,
float *out_s,
float *out_v,
struct nk_color);
3753 NK_API
void nk_color_hsv_fv(
float *hsv_out,
struct nk_color);
3755 NK_API
void nk_color_hsva_i(
int *h,
int *s,
int *v,
int *a,
struct nk_color);
3756 NK_API
void nk_color_hsva_b(nk_byte *h, nk_byte *s, nk_byte *v, nk_byte *a,
struct nk_color);
3757 NK_API
void nk_color_hsva_iv(
int *hsva_out,
struct nk_color);
3758 NK_API
void nk_color_hsva_bv(nk_byte *hsva_out,
struct nk_color);
3759 NK_API
void nk_color_hsva_f(
float *out_h,
float *out_s,
float *out_v,
float *out_a,
struct nk_color);
3760 NK_API
void nk_color_hsva_fv(
float *hsva_out,
struct nk_color);
3769 NK_API
struct nk_image nk_image_ptr(void*);
3770 NK_API
struct nk_image nk_image_id(int);
3771 NK_API nk_bool nk_image_is_subimage(
const struct nk_image* img);
3772 NK_API
struct nk_image nk_subimage_ptr(void*, nk_ushort w, nk_ushort h,
struct nk_rect sub_region);
3773 NK_API
struct nk_image nk_subimage_id(int, nk_ushort w, nk_ushort h, struct
nk_rect sub_region);
3780 NK_API
struct nk_nine_slice nk_nine_slice_handle(
nk_handle, nk_ushort l, nk_ushort t, nk_ushort r, nk_ushort b);
3781 NK_API
struct nk_nine_slice nk_nine_slice_ptr(void*, nk_ushort l, nk_ushort t, nk_ushort r, nk_ushort b);
3782 NK_API
struct nk_nine_slice nk_nine_slice_id(int, nk_ushort l, nk_ushort t, nk_ushort r, nk_ushort b);
3783 NK_API
int nk_nine_slice_is_sub9slice(
const struct nk_nine_slice* img);
3784 NK_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);
3785 NK_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);
3786 NK_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);
3792 NK_API nk_hash nk_murmur_hash(
const void *key,
int len, nk_hash seed);
3793 NK_API
void nk_triangle_from_direction(
struct nk_vec2 *result,
struct nk_rect r,
float pad_x,
float pad_y,
enum nk_heading);
3797 NK_API
struct nk_vec2 nk_vec2v(const float *xy);
3798 NK_API
struct nk_vec2 nk_vec2iv(const int *xy);
3800 NK_API
struct nk_rect nk_get_null_rect(void);
3801 NK_API
struct nk_rect nk_rect(float x, float y, float w, float h);
3804 NK_API
struct nk_rect nk_rectv(const float *xywh);
3805 NK_API
struct nk_rect nk_rectiv(const int *xywh);
3813 NK_API
int nk_strlen(
const char *str);
3814 NK_API
int nk_stricmp(
const char *s1,
const char *s2);
3815 NK_API
int nk_stricmpn(
const char *s1,
const char *s2,
int n);
3816 NK_API
int nk_strtoi(
const char *str,
char **endptr);
3817 NK_API
float nk_strtof(
const char *str,
char **endptr);
3819 #define NK_STRTOD nk_strtod
3820 NK_API
double nk_strtod(
const char *str,
char **endptr);
3822 NK_API
int nk_strfilter(
const char *text,
const char *regexp);
3823 NK_API
int nk_strmatch_fuzzy_string(
char const *str,
char const *pattern,
int *out_score);
3824 NK_API
int nk_strmatch_fuzzy_text(
const char *txt,
int txt_len,
const char *pattern,
int *out_score);
3830 NK_API
int nk_utf_decode(
const char*, nk_rune*,
int);
3831 NK_API
int nk_utf_encode(nk_rune,
char*,
int);
3832 NK_API
int nk_utf_len(
const char*,
int byte_len);
3833 NK_API
const char* nk_utf_at(
const char *buffer,
int length,
int index, nk_rune *unicode,
int *len);
3991 struct nk_user_font_glyph;
3992 typedef float(*nk_text_width_f)(
nk_handle,
float h,
const char*,
int len);
3993 typedef void(*nk_query_font_glyph_f)(
nk_handle handle,
float font_height,
3994 struct nk_user_font_glyph *glyph,
3995 nk_rune codepoint, nk_rune next_codepoint);
3997 #if defined(NK_INCLUDE_VERTEX_BUFFER_OUTPUT) || defined(NK_INCLUDE_SOFTWARE_FONT)
3998 struct nk_user_font_glyph {
4001 float width, height;
4010 #ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT
4011 nk_query_font_glyph_f query;
4016 #ifdef NK_INCLUDE_FONT_BAKING
4017 enum nk_font_coord_type {
4023 struct nk_baked_font {
4027 nk_rune glyph_offset;
4028 nk_rune glyph_count;
4029 const nk_rune *ranges;
4032 struct nk_font_config {
4033 struct nk_font_config *next;
4037 unsigned char ttf_data_owned_by_atlas;
4038 unsigned char merge_mode;
4039 unsigned char pixel_snap;
4040 unsigned char oversample_v, oversample_h;
4041 unsigned char padding[3];
4044 enum nk_font_coord_type coord_type;
4046 const nk_rune *range;
4047 struct nk_baked_font *font;
4048 nk_rune fallback_glyph;
4049 struct nk_font_config *n;
4050 struct nk_font_config *p;
4053 struct nk_font_glyph {
4056 float x0, y0, x1, y1, w, h;
4057 float u0, v0, u1, v1;
4061 struct nk_font *next;
4063 struct nk_baked_font info;
4065 struct nk_font_glyph *glyphs;
4066 const struct nk_font_glyph *fallback;
4067 nk_rune fallback_codepoint;
4069 struct nk_font_config *config;
4072 enum nk_font_atlas_format {
4073 NK_FONT_ATLAS_ALPHA8,
4074 NK_FONT_ATLAS_RGBA32
4077 struct nk_font_atlas {
4086 struct nk_cursor cursors[NK_CURSOR_COUNT];
4089 struct nk_font_glyph *glyphs;
4090 struct nk_font *default_font;
4091 struct nk_font *fonts;
4092 struct nk_font_config *config;
4097 NK_API
const nk_rune *nk_font_default_glyph_ranges(
void);
4098 NK_API
const nk_rune *nk_font_chinese_glyph_ranges(
void);
4099 NK_API
const nk_rune *nk_font_cyrillic_glyph_ranges(
void);
4100 NK_API
const nk_rune *nk_font_korean_glyph_ranges(
void);
4102 #ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
4103 NK_API
void nk_font_atlas_init_default(
struct nk_font_atlas*);
4105 NK_API
void nk_font_atlas_init(
struct nk_font_atlas*,
const struct nk_allocator*);
4106 NK_API
void nk_font_atlas_init_custom(
struct nk_font_atlas*,
const struct nk_allocator *persistent,
const struct nk_allocator *
transient);
4107 NK_API
void nk_font_atlas_begin(
struct nk_font_atlas*);
4108 NK_API
struct nk_font_config nk_font_config(float pixel_height);
4109 NK_API
struct nk_font *nk_font_atlas_add(
struct nk_font_atlas*,
const struct nk_font_config*);
4110 #ifdef NK_INCLUDE_DEFAULT_FONT
4111 NK_API
struct nk_font* nk_font_atlas_add_default(
struct nk_font_atlas*,
float height,
const struct nk_font_config*);
4113 NK_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);
4114 #ifdef NK_INCLUDE_STANDARD_IO
4115 NK_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*);
4117 NK_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*);
4118 NK_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);
4119 NK_API
const void* nk_font_atlas_bake(
struct nk_font_atlas*,
int *width,
int *height,
enum nk_font_atlas_format);
4121 NK_API
const struct nk_font_glyph* nk_font_find_glyph(
const struct nk_font*, nk_rune unicode);
4122 NK_API
void nk_font_atlas_cleanup(
struct nk_font_atlas *atlas);
4123 NK_API
void nk_font_atlas_clear(
struct nk_font_atlas*);
4172 enum nk_allocation_type {
4177 enum nk_buffer_allocation_type {
4192 enum nk_allocation_type
type;
4201 #ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
4202 NK_API
void nk_buffer_init_default(
struct nk_buffer*);
4205 NK_API
void nk_buffer_init_fixed(
struct nk_buffer*,
void *memory, nk_size size);
4207 NK_API
void nk_buffer_push(
struct nk_buffer*,
enum nk_buffer_allocation_type type,
const void *memory, nk_size size, nk_size align);
4208 NK_API
void nk_buffer_mark(
struct nk_buffer*,
enum nk_buffer_allocation_type type);
4209 NK_API
void nk_buffer_reset(
struct nk_buffer*,
enum nk_buffer_allocation_type type);
4210 NK_API
void nk_buffer_clear(
struct nk_buffer*);
4211 NK_API
void nk_buffer_free(
struct nk_buffer*);
4212 NK_API
void *nk_buffer_memory(
struct nk_buffer*);
4213 NK_API
const void *nk_buffer_memory_const(
const struct nk_buffer*);
4214 NK_API nk_size nk_buffer_total(
const struct nk_buffer*);
4231 #ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
4232 NK_API
void nk_str_init_default(
struct nk_str*);
4236 NK_API
void nk_str_clear(
struct nk_str*);
4237 NK_API
void nk_str_free(
struct nk_str*);
4239 NK_API
int nk_str_append_text_char(
struct nk_str*,
const char*,
int);
4240 NK_API
int nk_str_append_str_char(
struct nk_str*,
const char*);
4241 NK_API
int nk_str_append_text_utf8(
struct nk_str*,
const char*,
int);
4242 NK_API
int nk_str_append_str_utf8(
struct nk_str*,
const char*);
4243 NK_API
int nk_str_append_text_runes(
struct nk_str*,
const nk_rune*,
int);
4244 NK_API
int nk_str_append_str_runes(
struct nk_str*,
const nk_rune*);
4246 NK_API
int nk_str_insert_at_char(
struct nk_str*,
int pos,
const char*,
int);
4247 NK_API
int nk_str_insert_at_rune(
struct nk_str*,
int pos,
const char*,
int);
4249 NK_API
int nk_str_insert_text_char(
struct nk_str*,
int pos,
const char*,
int);
4250 NK_API
int nk_str_insert_str_char(
struct nk_str*,
int pos,
const char*);
4251 NK_API
int nk_str_insert_text_utf8(
struct nk_str*,
int pos,
const char*,
int);
4252 NK_API
int nk_str_insert_str_utf8(
struct nk_str*,
int pos,
const char*);
4253 NK_API
int nk_str_insert_text_runes(
struct nk_str*,
int pos,
const nk_rune*,
int);
4254 NK_API
int nk_str_insert_str_runes(
struct nk_str*,
int pos,
const nk_rune*);
4256 NK_API
void nk_str_remove_chars(
struct nk_str*,
int len);
4257 NK_API
void nk_str_remove_runes(
struct nk_str *str,
int len);
4258 NK_API
void nk_str_delete_chars(
struct nk_str*,
int pos,
int len);
4259 NK_API
void nk_str_delete_runes(
struct nk_str*,
int pos,
int len);
4261 NK_API
char *nk_str_at_char(
struct nk_str*,
int pos);
4262 NK_API
char *nk_str_at_rune(
struct nk_str*,
int pos, nk_rune *unicode,
int *len);
4263 NK_API nk_rune nk_str_rune_at(
const struct nk_str*,
int pos);
4264 NK_API
const char *nk_str_at_char_const(
const struct nk_str*,
int pos);
4265 NK_API
const char *nk_str_at_const(
const struct nk_str*,
int pos, nk_rune *unicode,
int *len);
4267 NK_API
char *nk_str_get(
struct nk_str*);
4268 NK_API
const char *nk_str_get_const(
const struct nk_str*);
4269 NK_API
int nk_str_len(
const struct nk_str*);
4270 NK_API
int nk_str_len_char(
const struct nk_str*);
4303 #ifndef NK_TEXTEDIT_UNDOSTATECOUNT
4304 #define NK_TEXTEDIT_UNDOSTATECOUNT 99
4307 #ifndef NK_TEXTEDIT_UNDOCHARCOUNT
4308 #define NK_TEXTEDIT_UNDOCHARCOUNT 999
4314 nk_plugin_paste paste;
4315 nk_plugin_copy copy;
4320 short insert_length;
4321 short delete_length;
4327 nk_rune undo_char[NK_TEXTEDIT_UNDOCHARCOUNT];
4330 short undo_char_point;
4331 short redo_char_point;
4334 enum nk_text_edit_type {
4335 NK_TEXT_EDIT_SINGLE_LINE,
4336 NK_TEXT_EDIT_MULTI_LINE
4339 enum nk_text_edit_mode {
4340 NK_TEXT_EDIT_MODE_VIEW,
4341 NK_TEXT_EDIT_MODE_INSERT,
4342 NK_TEXT_EDIT_MODE_REPLACE
4348 nk_plugin_filter filter;
4355 unsigned char cursor_at_end_of_line;
4356 unsigned char initialized;
4357 unsigned char has_preferred_x;
4358 unsigned char single_line;
4359 unsigned char active;
4360 unsigned char padding1;
4367 NK_API nk_bool nk_filter_ascii(
const struct nk_text_edit*, nk_rune unicode);
4368 NK_API nk_bool nk_filter_float(
const struct nk_text_edit*, nk_rune unicode);
4369 NK_API nk_bool nk_filter_decimal(
const struct nk_text_edit*, nk_rune unicode);
4370 NK_API nk_bool nk_filter_hex(
const struct nk_text_edit*, nk_rune unicode);
4371 NK_API nk_bool nk_filter_oct(
const struct nk_text_edit*, nk_rune unicode);
4372 NK_API nk_bool nk_filter_binary(
const struct nk_text_edit*, nk_rune unicode);
4375 #ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
4376 NK_API
void nk_textedit_init_default(
struct nk_text_edit*);
4379 NK_API
void nk_textedit_init_fixed(
struct nk_text_edit*,
void *memory, nk_size size);
4381 NK_API
void nk_textedit_text(
struct nk_text_edit*,
const char*,
int total_len);
4382 NK_API
void nk_textedit_delete(
struct nk_text_edit*,
int where,
int len);
4383 NK_API
void nk_textedit_delete_selection(
struct nk_text_edit*);
4384 NK_API
void nk_textedit_select_all(
struct nk_text_edit*);
4386 NK_API nk_bool nk_textedit_paste(
struct nk_text_edit*,
char const*,
int len);
4444 enum nk_command_type {
4450 NK_COMMAND_RECT_FILLED,
4451 NK_COMMAND_RECT_MULTI_COLOR,
4453 NK_COMMAND_CIRCLE_FILLED,
4455 NK_COMMAND_ARC_FILLED,
4456 NK_COMMAND_TRIANGLE,
4457 NK_COMMAND_TRIANGLE_FILLED,
4459 NK_COMMAND_POLYGON_FILLED,
4460 NK_COMMAND_POLYLINE,
4468 enum nk_command_type type;
4470 #ifdef NK_INCLUDE_COMMAND_USERDATA
4478 unsigned short w, h;
4483 unsigned short line_thickness;
4491 unsigned short line_thickness;
4500 unsigned short rounding;
4501 unsigned short line_thickness;
4503 unsigned short w, h;
4509 unsigned short rounding;
4511 unsigned short w, h;
4518 unsigned short w, h;
4527 unsigned short line_thickness;
4545 unsigned short line_thickness;
4546 unsigned short w, h;
4553 unsigned short w, h;
4561 unsigned short line_thickness;
4577 unsigned short line_thickness;
4578 unsigned short point_count;
4585 unsigned short point_count;
4592 unsigned short line_thickness;
4593 unsigned short point_count;
4600 unsigned short w, h;
4605 typedef void (*nk_command_custom_callback)(
void *canvas,
short x,
short y,
4606 unsigned short w,
unsigned short h,
nk_handle callback_data);
4610 unsigned short w, h;
4612 nk_command_custom_callback callback;
4621 unsigned short w, h;
4627 enum nk_command_clipping {
4628 NK_CLIPPING_OFF = nk_false,
4629 NK_CLIPPING_ON = nk_true
4637 nk_size begin, end, last;
4642 NK_API
void nk_stroke_curve(
struct nk_command_buffer*,
float,
float,
float,
float,
float,
float,
float,
float,
float line_thickness,
struct nk_color);
4645 NK_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);
4646 NK_API
void nk_stroke_triangle(
struct nk_command_buffer*,
float,
float,
float,
float,
float,
float,
float line_thichness,
struct nk_color);
4647 NK_API
void nk_stroke_polyline(
struct nk_command_buffer*,
const float *points,
int point_count,
float line_thickness,
struct nk_color col);
4648 NK_API
void nk_stroke_polygon(
struct nk_command_buffer*,
const float *points,
int point_count,
float line_thickness,
struct nk_color);
4654 NK_API
void nk_fill_arc(
struct nk_command_buffer*,
float cx,
float cy,
float radius,
float a_min,
float a_max,
struct nk_color);
4655 NK_API
void nk_fill_triangle(
struct nk_command_buffer*,
float x0,
float y0,
float x1,
float y1,
float x2,
float y2,
struct nk_color);
4672 unsigned int clicked;
4678 #ifdef NK_BUTTON_TRIGGER_ON_RELEASE
4685 unsigned char grabbed;
4686 unsigned char ungrab;
4691 unsigned int clicked;
4694 struct nk_key keys[NK_KEY_MAX];
4695 char text[NK_INPUT_MAX];
4704 NK_API nk_bool nk_input_has_mouse_click(
const struct nk_input*,
enum nk_buttons);
4705 NK_API nk_bool nk_input_has_mouse_click_in_rect(
const struct nk_input*,
enum nk_buttons,
struct nk_rect);
4706 NK_API nk_bool nk_input_has_mouse_click_in_button_rect(
const struct nk_input*,
enum nk_buttons,
struct nk_rect);
4707 NK_API nk_bool nk_input_has_mouse_click_down_in_rect(
const struct nk_input*,
enum nk_buttons,
struct nk_rect, nk_bool down);
4708 NK_API nk_bool nk_input_is_mouse_click_in_rect(
const struct nk_input*,
enum nk_buttons,
struct nk_rect);
4709 NK_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);
4710 NK_API nk_bool nk_input_any_mouse_click_in_rect(
const struct nk_input*,
struct nk_rect);
4711 NK_API nk_bool nk_input_is_mouse_prev_hovering_rect(
const struct nk_input*,
struct nk_rect);
4712 NK_API nk_bool nk_input_is_mouse_hovering_rect(
const struct nk_input*,
struct nk_rect);
4713 NK_API nk_bool nk_input_mouse_clicked(
const struct nk_input*,
enum nk_buttons,
struct nk_rect);
4714 NK_API nk_bool nk_input_is_mouse_down(
const struct nk_input*,
enum nk_buttons);
4715 NK_API nk_bool nk_input_is_mouse_pressed(
const struct nk_input*,
enum nk_buttons);
4716 NK_API nk_bool nk_input_is_mouse_released(
const struct nk_input*,
enum nk_buttons);
4717 NK_API nk_bool nk_input_is_key_pressed(
const struct nk_input*,
enum nk_keys);
4718 NK_API nk_bool nk_input_is_key_released(
const struct nk_input*,
enum nk_keys);
4719 NK_API nk_bool nk_input_is_key_down(
const struct nk_input*,
enum nk_keys);
4726 #ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT
4743 #ifdef NK_UINT_DRAW_INDEX
4744 typedef nk_uint nk_draw_index;
4746 typedef nk_ushort nk_draw_index;
4748 enum nk_draw_list_stroke {
4749 NK_STROKE_OPEN = nk_false,
4750 NK_STROKE_CLOSED = nk_true
4753 enum nk_draw_vertex_layout_attribute {
4757 NK_VERTEX_ATTRIBUTE_COUNT
4760 enum nk_draw_vertex_layout_format {
4770 NK_FORMAT_COLOR_BEGIN,
4771 NK_FORMAT_R8G8B8 = NK_FORMAT_COLOR_BEGIN,
4772 NK_FORMAT_R16G15B16,
4773 NK_FORMAT_R32G32B32,
4777 NK_FORMAT_R16G15B16A16,
4778 NK_FORMAT_R32G32B32A32,
4779 NK_FORMAT_R32G32B32A32_FLOAT,
4780 NK_FORMAT_R32G32B32A32_DOUBLE,
4784 NK_FORMAT_COLOR_END = NK_FORMAT_RGBA32,
4788 #define NK_VERTEX_LAYOUT_END NK_VERTEX_ATTRIBUTE_COUNT,NK_FORMAT_COUNT,0
4789 struct nk_draw_vertex_layout_element {
4790 enum nk_draw_vertex_layout_attribute attribute;
4791 enum nk_draw_vertex_layout_format format;
4795 struct nk_draw_command {
4796 unsigned int elem_count;
4799 #ifdef NK_INCLUDE_COMMAND_USERDATA
4804 struct nk_draw_list {
4806 struct nk_vec2 circle_vtx[12];
4813 unsigned int element_count;
4814 unsigned int vertex_count;
4815 unsigned int cmd_count;
4818 unsigned int path_count;
4819 unsigned int path_offset;
4821 enum nk_anti_aliasing line_AA;
4822 enum nk_anti_aliasing shape_AA;
4824 #ifdef NK_INCLUDE_COMMAND_USERDATA
4830 NK_API
void nk_draw_list_init(
struct nk_draw_list*);
4831 NK_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);
4834 #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))
4835 NK_API
const struct nk_draw_command* nk__draw_list_begin(
const struct nk_draw_list*,
const struct nk_buffer*);
4836 NK_API
const struct nk_draw_command* nk__draw_list_next(
const struct nk_draw_command*,
const struct nk_buffer*,
const struct nk_draw_list*);
4837 NK_API
const struct nk_draw_command* nk__draw_list_end(
const struct nk_draw_list*,
const struct nk_buffer*);
4840 NK_API
void nk_draw_list_path_clear(
struct nk_draw_list*);
4841 NK_API
void nk_draw_list_path_line_to(
struct nk_draw_list*,
struct nk_vec2 pos);
4842 NK_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);
4843 NK_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);
4844 NK_API
void nk_draw_list_path_rect_to(
struct nk_draw_list*,
struct nk_vec2 a,
struct nk_vec2 b,
float rounding);
4845 NK_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);
4846 NK_API
void nk_draw_list_path_fill(
struct nk_draw_list*,
struct nk_color);
4847 NK_API
void nk_draw_list_path_stroke(
struct nk_draw_list*,
struct nk_color,
enum nk_draw_list_stroke closed,
float thickness);
4850 NK_API
void nk_draw_list_stroke_line(
struct nk_draw_list*,
struct nk_vec2 a,
struct nk_vec2 b,
struct nk_color,
float thickness);
4851 NK_API
void nk_draw_list_stroke_rect(
struct nk_draw_list*,
struct nk_rect rect,
struct nk_color,
float rounding,
float thickness);
4852 NK_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);
4853 NK_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);
4854 NK_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);
4855 NK_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);
4858 NK_API
void nk_draw_list_fill_rect(
struct nk_draw_list*,
struct nk_rect rect,
struct nk_color,
float rounding);
4861 NK_API
void nk_draw_list_fill_circle(
struct nk_draw_list*,
struct nk_vec2 center,
float radius,
struct nk_color col,
unsigned int segs);
4862 NK_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);
4865 NK_API
void nk_draw_list_add_image(
struct nk_draw_list*,
struct nk_image texture,
struct nk_rect rect,
struct nk_color);
4866 NK_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);
4867 #ifdef NK_INCLUDE_COMMAND_USERDATA
4868 NK_API
void nk_draw_list_push_userdata(
struct nk_draw_list*,
nk_handle userdata);
4878 enum nk_style_item_type {
4879 NK_STYLE_ITEM_COLOR,
4880 NK_STYLE_ITEM_IMAGE,
4881 NK_STYLE_ITEM_NINE_SLICE
4891 enum nk_style_item_type type;
4899 float disabled_factor;
4908 float color_factor_background;
4915 nk_flags text_alignment;
4916 float color_factor_text;
4924 float disabled_factor;
4948 nk_flags text_alignment;
4956 float disabled_factor;
4981 struct nk_color text_normal_active;
4983 struct nk_color text_pressed_active;
4985 nk_flags text_alignment;
4993 float disabled_factor;
5027 float disabled_factor;
5033 enum nk_symbol_type inc_symbol;
5034 enum nk_symbol_type dec_symbol;
5067 float disabled_factor;
5086 struct nk_color cursor_border_color;
5091 float cursor_border;
5092 float cursor_rounding;
5095 float disabled_factor;
5114 struct nk_color cursor_border_color;
5119 float border_cursor;
5120 float rounding_cursor;
5123 float disabled_factor;
5129 enum nk_symbol_type inc_symbol;
5130 enum nk_symbol_type dec_symbol;
5149 struct nk_color cursor_text_normal;
5160 struct nk_color selected_text_normal;
5161 struct nk_color selected_text_hover;
5167 struct nk_vec2 scrollbar_size;
5171 float disabled_factor;
5187 enum nk_symbol_type sym_left;
5188 enum nk_symbol_type sym_right;
5195 float disabled_factor;
5219 float disabled_factor;
5220 nk_bool show_markers;
5242 enum nk_symbol_type sym_normal;
5243 enum nk_symbol_type sym_hover;
5244 enum nk_symbol_type sym_active;
5249 struct nk_vec2 content_padding;
5250 struct nk_vec2 button_padding;
5253 float disabled_factor;
5267 enum nk_symbol_type sym_minimize;
5268 enum nk_symbol_type sym_maximize;
5277 float disabled_factor;
5280 enum nk_style_header_align {
5293 enum nk_symbol_type close_symbol;
5294 enum nk_symbol_type minimize_symbol;
5295 enum nk_symbol_type maximize_symbol;
5303 enum nk_style_header_align align;
5315 struct nk_color popup_border_color;
5316 struct nk_color combo_border_color;
5317 struct nk_color contextual_border_color;
5319 struct nk_color group_border_color;
5320 struct nk_color tooltip_border_color;
5325 float contextual_border;
5328 float tooltip_border;
5330 float min_row_height_padding;
5334 struct nk_vec2 scrollbar_size;
5341 struct nk_vec2 contextual_padding;
5343 struct nk_vec2 tooltip_padding;
5348 const struct nk_cursor *cursors[NK_CURSOR_COUNT];
5381 #ifndef NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS
5382 #define NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS 16
5384 #ifndef NK_CHART_MAX_SLOT
5385 #define NK_CHART_MAX_SLOT 4
5388 enum nk_panel_type {
5390 NK_PANEL_WINDOW = NK_FLAG(0),
5391 NK_PANEL_GROUP = NK_FLAG(1),
5392 NK_PANEL_POPUP = NK_FLAG(2),
5393 NK_PANEL_CONTEXTUAL = NK_FLAG(4),
5394 NK_PANEL_COMBO = NK_FLAG(5),
5395 NK_PANEL_MENU = NK_FLAG(6),
5396 NK_PANEL_TOOLTIP = NK_FLAG(7)
5399 NK_PANEL_SET_NONBLOCK = NK_PANEL_CONTEXTUAL|NK_PANEL_COMBO|NK_PANEL_MENU|NK_PANEL_TOOLTIP,
5400 NK_PANEL_SET_POPUP = NK_PANEL_SET_NONBLOCK|NK_PANEL_POPUP,
5401 NK_PANEL_SET_SUB = NK_PANEL_SET_POPUP|NK_PANEL_GROUP
5405 enum nk_chart_type type;
5408 float min, max, range;
5412 nk_bool show_markers;
5421 enum nk_panel_row_layout_type {
5422 NK_LAYOUT_DYNAMIC_FIXED = 0,
5423 NK_LAYOUT_DYNAMIC_ROW,
5424 NK_LAYOUT_DYNAMIC_FREE,
5426 NK_LAYOUT_STATIC_FIXED,
5427 NK_LAYOUT_STATIC_ROW,
5428 NK_LAYOUT_STATIC_FREE,
5434 enum nk_panel_row_layout_type type;
5446 float templates[NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS];
5463 enum nk_panel_type type;
5468 float at_x, at_y, max_x;
5469 float footer_height;
5470 float header_height;
5472 unsigned int has_scrolling;
5484 #ifndef NK_WINDOW_MAX_NAME
5485 #define NK_WINDOW_MAX_NAME 64
5490 NK_WINDOW_PRIVATE = NK_FLAG(11),
5502 enum nk_panel_type type;
5506 unsigned combo_count;
5507 unsigned con_count, con_old;
5508 unsigned active_con;
5522 unsigned char single_line;
5527 char buffer[NK_MAX_NUMBER_BUFFER];
5541 char name_string[NK_WINDOW_MAX_NAME];
5548 float scrollbar_hiding_timer;
5554 unsigned int scrolled;
5555 nk_bool widgets_disabled;
5558 unsigned int table_count;
5595 #ifndef NK_BUTTON_BEHAVIOR_STACK_SIZE
5596 #define NK_BUTTON_BEHAVIOR_STACK_SIZE 8
5599 #ifndef NK_FONT_STACK_SIZE
5600 #define NK_FONT_STACK_SIZE 8
5603 #ifndef NK_STYLE_ITEM_STACK_SIZE
5604 #define NK_STYLE_ITEM_STACK_SIZE 16
5607 #ifndef NK_FLOAT_STACK_SIZE
5608 #define NK_FLOAT_STACK_SIZE 32
5611 #ifndef NK_VECTOR_STACK_SIZE
5612 #define NK_VECTOR_STACK_SIZE 16
5615 #ifndef NK_FLAGS_STACK_SIZE
5616 #define NK_FLAGS_STACK_SIZE 32
5619 #ifndef NK_COLOR_STACK_SIZE
5620 #define NK_COLOR_STACK_SIZE 32
5623 #define NK_CONFIGURATION_STACK_TYPE(prefix, name, type)\
5624 struct nk_config_stack_##name##_element {\
5625 prefix##_##type *address;\
5626 prefix##_##type old_value;\
5628 #define NK_CONFIG_STACK(type,size)\
5629 struct nk_config_stack_##type {\
5631 struct nk_config_stack_##type##_element elements[size];\
5634 #define nk_float float
5635 NK_CONFIGURATION_STACK_TYPE(
struct nk, style_item, style_item);
5636 NK_CONFIGURATION_STACK_TYPE(nk ,
float,
float);
5637 NK_CONFIGURATION_STACK_TYPE(
struct nk, vec2, vec2);
5638 NK_CONFIGURATION_STACK_TYPE(nk ,flags, flags);
5639 NK_CONFIGURATION_STACK_TYPE(
struct nk, color, color);
5640 NK_CONFIGURATION_STACK_TYPE(
const struct nk, user_font, user_font*);
5641 NK_CONFIGURATION_STACK_TYPE(
enum nk, button_behavior, button_behavior);
5643 NK_CONFIG_STACK(style_item, NK_STYLE_ITEM_STACK_SIZE);
5644 NK_CONFIG_STACK(
float, NK_FLOAT_STACK_SIZE);
5645 NK_CONFIG_STACK(vec2, NK_VECTOR_STACK_SIZE);
5646 NK_CONFIG_STACK(flags, NK_FLAGS_STACK_SIZE);
5647 NK_CONFIG_STACK(color, NK_COLOR_STACK_SIZE);
5648 NK_CONFIG_STACK(user_font, NK_FONT_STACK_SIZE);
5649 NK_CONFIG_STACK(button_behavior, NK_BUTTON_BEHAVIOR_STACK_SIZE);
5652 struct nk_config_stack_style_item style_items;
5653 struct nk_config_stack_float floats;
5654 struct nk_config_stack_vec2 vectors;
5655 struct nk_config_stack_flags flags;
5656 struct nk_config_stack_color colors;
5657 struct nk_config_stack_user_font fonts;
5658 struct nk_config_stack_button_behavior button_behaviors;
5664 #define NK_VALUE_PAGE_CAPACITY \
5665 (((NK_MAX(sizeof(struct nk_window),sizeof(struct nk_panel)) / sizeof(nk_uint))) / 2)
5670 nk_hash keys[NK_VALUE_PAGE_CAPACITY];
5671 nk_uint values[NK_VALUE_PAGE_CAPACITY];
5695 enum nk_allocation_type type;
5696 unsigned int page_count;
5710 nk_flags last_widget_state;
5711 enum nk_button_behavior button_behavior;
5713 float delta_time_seconds;
5718 #ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT
5719 struct nk_draw_list draw_list;
5721 #ifdef NK_INCLUDE_COMMAND_USERDATA
5748 #define NK_PI 3.141592654f
5749 #define NK_PI_HALF 1.570796326f
5750 #define NK_UTF_INVALID 0xFFFD
5751 #define NK_MAX_FLOAT_PRECISION 2
5753 #define NK_UNUSED(x) ((void)(x))
5754 #define NK_SATURATE(x) (NK_MAX(0, NK_MIN(1.0f, x)))
5755 #define NK_LEN(a) (sizeof(a)/sizeof(a)[0])
5756 #define NK_ABS(a) (((a) < 0) ? -(a) : (a))
5757 #define NK_BETWEEN(x, a, b) ((a) <= (x) && (x) < (b))
5758 #define NK_INBOX(px, py, x, y, w, h)\
5759 (NK_BETWEEN(px,x,x+w) && NK_BETWEEN(py,y,y+h))
5760 #define NK_INTERSECT(x0, y0, w0, h0, x1, y1, w1, h1) \
5761 ((x1 < (x0 + w0)) && (x0 < (x1 + w1)) && \
5762 (y1 < (y0 + h0)) && (y0 < (y1 + h1)))
5763 #define NK_CONTAINS(x, y, w, h, bx, by, bw, bh)\
5764 (NK_INBOX(x,y, bx, by, bw, bh) && NK_INBOX(x+w,y+h, bx, by, bw, bh))
5766 #define nk_vec2_sub(a, b) nk_vec2((a).x - (b).x, (a).y - (b).y)
5767 #define nk_vec2_add(a, b) nk_vec2((a).x + (b).x, (a).y + (b).y)
5768 #define nk_vec2_len_sqr(a) ((a).x*(a).x+(a).y*(a).y)
5769 #define nk_vec2_muls(a, t) nk_vec2((a).x * (t), (a).y * (t))
5771 #define nk_ptr_add(t, p, i) ((t*)((void*)((nk_byte*)(p) + (i))))
5772 #define nk_ptr_add_const(t, p, i) ((const t*)((const void*)((const nk_byte*)(p) + (i))))
5773 #define nk_zero_struct(s) nk_zero(&s, sizeof(s))
5779 #if defined(__PTRDIFF_TYPE__)
5780 # define NK_UINT_TO_PTR(x) ((void*)(__PTRDIFF_TYPE__)(x))
5781 # define NK_PTR_TO_UINT(x) ((nk_size)(__PTRDIFF_TYPE__)(x))
5782 #elif !defined(__GNUC__)
5783 # define NK_UINT_TO_PTR(x) ((void*)&((char*)0)[x])
5784 # define NK_PTR_TO_UINT(x) ((nk_size)(((char*)x)-(char*)0))
5785 #elif defined(NK_USE_FIXED_TYPES)
5786 # define NK_UINT_TO_PTR(x) ((void*)(uintptr_t)(x))
5787 # define NK_PTR_TO_UINT(x) ((uintptr_t)(x))
5789 # define NK_UINT_TO_PTR(x) ((void*)(x))
5790 # define NK_PTR_TO_UINT(x) ((nk_size)(x))
5793 #define NK_ALIGN_PTR(x, mask)\
5794 (NK_UINT_TO_PTR((NK_PTR_TO_UINT((nk_byte*)(x) + (mask-1)) & ~(mask-1))))
5795 #define NK_ALIGN_PTR_BACK(x, mask)\
5796 (NK_UINT_TO_PTR((NK_PTR_TO_UINT((nk_byte*)(x)) & ~(mask-1))))
5798 #if ((defined(__GNUC__) && __GNUC__ >= 4) || defined(__clang__)) && !defined(EMSCRIPTEN)
5799 #define NK_OFFSETOF(st,m) (__builtin_offsetof(st,m))
5801 #define NK_OFFSETOF(st,m) ((nk_ptr)&(((st*)0)->m))
5809 template<
typename T>
struct nk_alignof;
5810 template<
typename T,
int size_diff>
struct nk_helper{
enum {value = size_diff};};
5811 template<
typename T>
struct nk_helper<T,0>{
enum {value = nk_alignof<T>::value};};
5812 template<
typename T>
struct nk_alignof{
struct Big {T x;
char c;};
enum {
5813 diff =
sizeof(Big) -
sizeof(T), value = nk_helper<Big, diff>::value};};
5814 #define NK_ALIGNOF(t) (nk_alignof<t>::value)
5816 #define NK_ALIGNOF(t) NK_OFFSETOF(struct {char c; t _h;}, _h)
5819 #define NK_CONTAINER_OF(ptr,type,member)\
5820 (type*)((void*)((char*)(1 ? (ptr): &((type*)0)->member) - NK_OFFSETOF(type, member)))
NK_API void nk_tree_pop(struct nk_context *)
NK_API void nk_free(struct nk_context *)
Frees all memory allocated by nuklear; Not needed if context was initialized with nk_init_fixed.
NK_API nk_bool nk_group_begin(struct nk_context *, const char *title, nk_flags)
Starts a new widget group.
NK_API struct nk_vec2 nk_window_get_content_region_max(const struct nk_context *ctx)
NK_API void nk_layout_row_end(struct nk_context *)
Finished previously started row.
NK_API void nk_input_end(struct nk_context *)
End the input mirroring process by resetting mouse grabbing state to ensure the mouse cursor is not g...
NK_API void nk_window_close(struct nk_context *ctx, const char *name)
NK_API void nk_spacer(struct nk_context *ctx)
NK_API void nk_input_begin(struct nk_context *)
Begins the input mirroring process by resetting text, scroll mouse, previous mouse position and movem...
NK_API float nk_propertyf(struct nk_context *, const char *name, float min, float val, float max, float step, float inc_per_pixel)
NK_API void nk_rule_horizontal(struct nk_context *ctx, struct nk_color color, nk_bool rounding)
NK_API void nk_layout_space_end(struct nk_context *)
NK_API nk_bool nk_init_fixed(struct nk_context *, void *memory, nk_size size, const struct nk_user_font *)
NK_API void nk_property_float(struct nk_context *, const char *name, float min, float *val, float max, float step, float inc_per_pixel)
@ NK_WINDOW_CLOSED
Directly closes and frees the window at the end of the frame.
@ NK_WINDOW_MINIMIZED
marks the window as minimized
@ NK_WINDOW_HIDDEN
Hides window and stops any window interaction and drawing.
@ NK_WINDOW_ROM
sets window widgets into a read only mode and does not allow input changes
@ NK_WINDOW_NOT_INTERACTIVE
prevents all interaction caused by input to either window or widgets inside
@ NK_WINDOW_DYNAMIC
special window type growing up in height while being filled to a certain maximum height
@ NK_WINDOW_REMOVE_ROM
Removes read only mode at the end of the window.
NK_API void nk_layout_row(struct nk_context *, enum nk_layout_format, float height, int cols, const float *ratio)
Specifies row columns in array as either window ratio or size.
NK_API void nk_draw_image(struct nk_command_buffer *, struct nk_rect, const struct nk_image *, struct nk_color)
misc
NK_API nk_bool nk_window_is_hovered(const struct nk_context *ctx)
NK_API void nk_window_collapse_if(struct nk_context *ctx, const char *name, enum nk_collapse_states state, int cond)
NK_API struct nk_vec2 nk_layout_space_to_screen(const struct nk_context *ctx, struct nk_vec2 vec)
#define NK_BOOL
could be char, use int for drop-in replacement backwards compatibility
NK_API nk_bool nk_init_custom(struct nk_context *, struct nk_buffer *cmds, struct nk_buffer *pool, const struct nk_user_font *)
Initializes a nk_context struct from two different either fixed or growing buffers.
NK_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)
NK_API void nk_window_set_scroll(struct nk_context *ctx, nk_uint offset_x, nk_uint offset_y)
NK_API void nk_group_scrolled_end(struct nk_context *)
NK_API struct nk_vec2 nk_window_get_size(const struct nk_context *ctx)
NK_API void nk_layout_row_template_push_dynamic(struct nk_context *)
NK_API nk_bool nk_window_is_active(const struct nk_context *ctx, const char *name)
NK_API void nk_group_get_scroll(struct nk_context *, const char *id, nk_uint *x_offset, nk_uint *y_offset)
NK_API struct nk_vec2 nk_layout_space_to_local(const struct nk_context *ctx, struct nk_vec2 vec)
NK_API void nk_window_set_focus(struct nk_context *ctx, const char *name)
NK_API nk_bool nk_item_is_any_active(const struct nk_context *ctx)
#define NK_UTF_SIZE
describes the number of bytes a glyph consists of
NK_API void nk_input_unicode(struct nk_context *, nk_rune)
Converts a unicode rune into UTF-8 and copies the result into an internal text buffer.
NK_API nk_bool nk_window_is_any_hovered(const struct nk_context *ctx)
NK_API nk_bool nk_window_is_hidden(const struct nk_context *ctx, const char *name)
NK_API void nk_input_key(struct nk_context *, enum nk_keys, nk_bool down)
Mirrors the state of a specific key to nuklear.
NK_API void nk_stroke_line(struct nk_command_buffer *b, float x0, float y0, float x1, float y1, float line_thickness, struct nk_color)
shape outlines
NK_API void nk_property_double(struct nk_context *, const char *name, double min, double *val, double max, double step, float inc_per_pixel)
NK_API void nk_fill_rect(struct nk_command_buffer *, struct nk_rect, float rounding, struct nk_color)
filled shades
NK_API void nk_layout_row_template_push_static(struct nk_context *, float width)
NK_API struct nk_vec2 nk_window_get_content_region_size(const struct nk_context *ctx)
NK_API void nk_window_get_scroll(const struct nk_context *ctx, nk_uint *offset_x, nk_uint *offset_y)
NK_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)
NK_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)
NK_API void nk_window_set_position(struct nk_context *ctx, const char *name, struct nk_vec2 pos)
NK_API void nk_window_show(struct nk_context *ctx, const char *name, enum nk_show_states state)
NK_API nk_bool nk_window_is_collapsed(const struct nk_context *ctx, const char *name)
NK_API struct nk_command_buffer * nk_window_get_canvas(const struct nk_context *ctx)
NK_API void nk_layout_row_dynamic(struct nk_context *ctx, float height, int cols)
Sets current row layout to share horizontal space between @cols number of widgets evenly.
NK_API void nk_window_collapse(struct nk_context *ctx, const char *name, enum nk_collapse_states state)
NK_API nk_bool nk_filter_default(const struct nk_text_edit *, nk_rune unicode)
filter function
NK_API const struct nk_command * nk__begin(struct nk_context *)
Returns a draw command list iterator to iterate all draw commands accumulated over one frame.
NK_API void nk_layout_row_template_end(struct nk_context *)
NK_API nk_bool nk_window_has_focus(const struct nk_context *ctx)
NK_API void nk_layout_reset_min_row_height(struct nk_context *)
Reset the currently used minimum row height back to font_height + text_padding + padding
@ NK_WIDGET_STATE_LEFT
!< widget is currently activated
@ NK_WIDGET_STATE_ACTIVED
!< widget is being hovered
@ NK_WIDGET_STATE_ENTERED
!< widget is neither active nor hovered
@ NK_WIDGET_STATE_HOVER
!< widget has been hovered on the current frame
@ NK_WIDGET_STATE_ACTIVE
!< widget is being hovered
@ NK_WIDGET_STATE_HOVERED
!< widget is from this frame on not hovered anymore
NK_API struct nk_rect nk_layout_space_rect_to_local(const struct nk_context *ctx, struct nk_rect bounds)
NK_API void nk_window_set_bounds(struct nk_context *ctx, const char *name, struct nk_rect bounds)
NK_API struct nk_rect nk_window_get_bounds(const struct nk_context *ctx)
NK_API nk_bool nk_tree_state_push(struct nk_context *, enum nk_tree_type, const char *title, enum nk_collapse_states *state)
NK_API struct nk_panel * nk_window_get_panel(const struct nk_context *ctx)
NK_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)
NK_API void nk_layout_set_min_row_height(struct nk_context *, float height)
Sets the currently used minimum row height.
NK_API void nk_window_show_if(struct nk_context *ctx, const char *name, enum nk_show_states state, int cond)
NK_API float nk_window_get_height(const struct nk_context *ctx)
NK_API void nk_layout_row_begin(struct nk_context *ctx, enum nk_layout_format fmt, float row_height, int cols)
Starts a new dynamic or fixed row with given height and columns.
NK_API nk_bool nk_group_begin_titled(struct nk_context *, const char *name, const char *title, nk_flags)
Starts a new widget group.
NK_API nk_bool nk_begin_titled(struct nk_context *ctx, const char *name, const char *title, struct nk_rect bounds, nk_flags flags)
NK_API void nk_layout_space_push(struct nk_context *, struct nk_rect bounds)
NK_API nk_bool nk_begin(struct nk_context *ctx, const char *title, struct nk_rect bounds, nk_flags flags)
NK_API void nk_window_set_size(struct nk_context *ctx, const char *name, struct nk_vec2 size)
NK_API void nk_input_button(struct nk_context *, enum nk_buttons, int x, int y, nk_bool down)
Mirrors the state of a specific mouse button to nuklear.
NK_API void nk_group_set_scroll(struct nk_context *, const char *id, nk_uint x_offset, nk_uint y_offset)
NK_API void nk_layout_row_template_begin(struct nk_context *, float row_height)
NK_API nk_bool nk_init(struct nk_context *, const struct nk_allocator *, const struct nk_user_font *)
NK_API float nk_layout_ratio_from_pixel(const struct nk_context *ctx, float pixel_width)
Utility functions to calculate window ratio from pixel size.
NK_API void nk_tree_state_pop(struct nk_context *)
NK_API void nk_layout_row_push(struct nk_context *, float value)
\breif Specifies either window ratio or width of a single column
NK_API struct nk_rect nk_layout_widget_bounds(const struct nk_context *ctx)
Returns the width of the next row allocate by one of the layouting functions.
NK_API struct nk_rect nk_layout_space_rect_to_screen(const struct nk_context *ctx, struct nk_rect bounds)
NK_API struct nk_vec2 nk_window_get_content_region_min(const struct nk_context *ctx)
NK_API void nk_input_char(struct nk_context *, char)
Copies a single ASCII character into an internal text buffer.
NK_API float nk_window_get_width(const struct nk_context *ctx)
nk_window_get_width
NK_API void nk_input_scroll(struct nk_context *, struct nk_vec2 val)
Copies the last mouse scroll value to nuklear.
@ NK_WIDGET_DISABLED
The widget is manually disabled and acts like NK_WIDGET_ROM.
@ NK_WIDGET_ROM
The widget is partially visible and cannot be updated.
@ NK_WIDGET_VALID
The widget is completely inside the window and can be updated and drawn.
@ NK_WIDGET_INVALID
The widget cannot be seen and is completely out of view.
NK_API double nk_propertyd(struct nk_context *, const char *name, double min, double val, double max, double step, float inc_per_pixel)
NK_API void nk_input_motion(struct nk_context *, int x, int y)
Mirrors current mouse position to nuklear.
NK_API void nk_layout_space_begin(struct nk_context *, enum nk_layout_format, float height, int widget_count)
NK_API struct nk_rect nk_layout_space_bounds(const struct nk_context *ctx)
NK_API struct nk_rect nk_window_get_content_region(const struct nk_context *ctx)
NK_API nk_bool nk_window_is_closed(const struct nk_context *ctx, const char *name)
NK_API const struct nk_command * nk__next(struct nk_context *, const struct nk_command *)
Returns draw command pointer pointing to the next command inside the draw command list.
NK_API void nk_clear(struct nk_context *)
Resets the context state at the end of the frame.
NK_API void nk_end(struct nk_context *ctx)
NK_API void nk_group_end(struct nk_context *)
NK_API void nk_layout_row_template_push_variable(struct nk_context *, float min_width)
NK_API struct nk_vec2 nk_window_get_position(const struct nk_context *ctx)
@ NK_EDIT_INACTIVE
!< edit widget is currently being modified
@ NK_EDIT_DEACTIVATED
!< edit widget went from state inactive to state active
@ NK_EDIT_COMMITED
!< edit widget went from state active to state inactive
@ NK_EDIT_ACTIVATED
!< edit widget is not active and is not being modified
NK_API int nk_propertyi(struct nk_context *, const char *name, int min, int val, int max, int step, float inc_per_pixel)
NK_API nk_bool nk_group_scrolled_begin(struct nk_context *, struct nk_scroll *off, const char *title, nk_flags)
NK_API void nk_input_glyph(struct nk_context *, const nk_glyph)
Converts an encoded unicode rune into UTF-8 and copies the result into an internal text buffer.
NK_API void nk_layout_row_static(struct nk_context *ctx, float height, int item_width, int cols)
Sets current row layout to fill @cols number of widgets in row with same @item_width horizontal size.
NK_API void nk_textedit_init(struct nk_text_edit *, const struct nk_allocator *, nk_size size)
text editor
NK_API struct nk_window * nk_window_find(const struct nk_context *ctx, const char *name)
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
==============================================================
nk_text_width_f width
!< max height of the font
float height
!< user provided font handle