Lines Matching defs:len
487 typedef void(*nk_plugin_copy)(nk_handle, const char*, int len);
2879 /// int 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);
2894 NK_API int 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);
2942 /// int 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);
2958 NK_API int 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);
3017 NK_API int nk_tree_element_push_hashed(struct nk_context*, enum nk_tree_type, const char *title, enum nk_collapse_states initial_state, int *selected, const char *hash, int len, int seed);
3018 NK_API int 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, int *selected, const char *hash, int len,int seed);
3118 NK_API int nk_button_text(struct nk_context*, const char *title, int len);
3127 NK_API int nk_button_text_styled(struct nk_context*, const struct nk_style_button*, const char *title, int len);
3444 NK_API nk_flags nk_edit_string(struct nk_context*, nk_flags, char *buffer, int *len, int max, nk_plugin_filter);
3517 NK_API int nk_contextual_item_image_text(struct nk_context*, struct nk_image, const char*, int len, nk_flags alignment);
3552 NK_API int nk_menu_item_image_text(struct nk_context*, struct nk_image, const char*, int len, nk_flags alignment);
3708 NK_API nk_hash nk_murmur_hash(const void *key, int len, nk_hash seed);
3746 NK_API const char* nk_utf_at(const char *buffer, int length, int index, nk_rune *unicode, int *len);
3771 float your_text_width_calculation(nk_handle handle, float height, const char *text, int len)
3796 float your_text_width_calculation(nk_handle handle, float height, const char *text, int len)
3897 typedef float(*nk_text_width_f)(nk_handle, float h, const char*, int len);
4167 int len; /* in codepoints/runes/glyphs */
4195 NK_API void nk_str_remove_chars(struct nk_str*, int len);
4196 NK_API void nk_str_remove_runes(struct nk_str *str, int len);
4197 NK_API void nk_str_delete_chars(struct nk_str*, int pos, int len);
4198 NK_API void nk_str_delete_runes(struct nk_str*, int pos, int len);
4201 NK_API char *nk_str_at_rune(struct nk_str*, int pos, nk_rune *unicode, int *len);
4204 NK_API const char *nk_str_at_const(const struct nk_str*, int pos, nk_rune *unicode, int *len);
4318 NK_API void nk_textedit_delete(struct nk_text_edit*, int where, int len);
4322 NK_API int nk_textedit_paste(struct nk_text_edit*, char const*, int len);
4591 NK_API void nk_draw_text(struct nk_command_buffer*, struct nk_rect, const char *text, int len, const struct nk_user_font*, struct nk_color, struct nk_color);
4794 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);
5922 NK_LIB void nk_widget_text(struct nk_command_buffer *o, struct nk_rect b, const char *string, int len, const struct nk_text *t, nk_flags a, const struct nk_user_font *f);
5923 NK_LIB void nk_widget_text_wrap(struct nk_command_buffer *o, struct nk_rect b, const char *string, int len, const struct nk_text *t, const struct nk_user_font *f);
5929 NK_LIB void nk_draw_button_text(struct nk_command_buffer *out, const struct nk_rect *bounds, const struct nk_rect *content, nk_flags state, const struct nk_style_button *style, const char *txt, int len, nk_flags text_alignment, const struct nk_user_font *font);
5930 NK_LIB int nk_do_button_text(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, const char *string, int len, nk_flags align, enum nk_button_behavior behavior, const struct nk_style_button *style, const struct nk_input *in, const struct nk_user_font *font);
5935 NK_LIB void nk_draw_button_text_symbol(struct nk_command_buffer *out, const struct nk_rect *bounds, const struct nk_rect *label, const struct nk_rect *symbol, nk_flags state, const struct nk_style_button *style, const char *str, int len, enum nk_symbol_type type, const struct nk_user_font *font);
5936 NK_LIB int nk_do_button_text_symbol(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, enum nk_symbol_type symbol, const char *str, int len, nk_flags align, enum nk_button_behavior behavior, const struct nk_style_button *style, const struct nk_user_font *font, const struct nk_input *in);
5937 NK_LIB void nk_draw_button_text_image(struct nk_command_buffer *out, const struct nk_rect *bounds, const struct nk_rect *label, const struct nk_rect *image, nk_flags state, const struct nk_style_button *style, const char *str, int len, const struct nk_user_font *font, const struct nk_image *img);
5938 NK_LIB int nk_do_button_text_image(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, struct nk_image img, const char* str, int len, nk_flags align, enum nk_button_behavior behavior, const struct nk_style_button *style, const struct nk_user_font *font, const struct nk_input *in);
5946 NK_LIB void nk_draw_checkbox(struct nk_command_buffer *out, nk_flags state, const struct nk_style_toggle *style, int active, const struct nk_rect *label, const struct nk_rect *selector, const struct nk_rect *cursors, const char *string, int len, const struct nk_user_font *font);
5947 NK_LIB void nk_draw_option(struct nk_command_buffer *out, nk_flags state, const struct nk_style_toggle *style, int active, const struct nk_rect *label, const struct nk_rect *selector, const struct nk_rect *cursors, const char *string, int len, const struct nk_user_font *font);
5948 NK_LIB int nk_do_toggle(nk_flags *state, struct nk_command_buffer *out, struct nk_rect r, int *active, const char *str, int len, enum nk_toggle_type type, const struct nk_style_toggle *style, const struct nk_input *in, const struct nk_user_font *font);
5967 NK_LIB void nk_draw_selectable(struct nk_command_buffer *out, nk_flags state, const struct nk_style_selectable *style, int active, const struct nk_rect *bounds, const struct nk_rect *icon, const struct nk_image *img, enum nk_symbol_type sym, const char *string, int len, nk_flags align, const struct nk_user_font *font);
5968 NK_LIB int nk_do_selectable(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, const char *str, int len, nk_flags align, int *value, const struct nk_style_selectable *style, const struct nk_input *in, const struct nk_user_font *font);
5969 NK_LIB int nk_do_selectable_image(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, const char *str, int len, nk_flags align, int *value, const struct nk_image *img, const struct nk_style_selectable *style, const struct nk_input *in, const struct nk_user_font *font);
6013 NK_LIB void nk_draw_property(struct nk_command_buffer *out, const struct nk_style_property *style, const struct nk_rect *bounds, const struct nk_rect *label, nk_flags state, const char *name, int len, const struct nk_user_font *font);
6014 NK_LIB void nk_do_property(nk_flags *ws, struct nk_command_buffer *out, struct nk_rect property, const char *name, struct nk_property_variant *variant, float inc_per_pixel, char *buffer, int *len, int *state, int *cursor, int *select_begin, int *select_end, const struct nk_style_property *style, enum nk_property_filter filter, struct nk_input *in, const struct nk_user_font *font, struct nk_text_edit *text_edit, enum nk_button_behavior behavior);
6780 int len = nk_strlen(s);
6781 int end = len / 2;
6786 s[i] = s[len - 1 - i];
6787 s[len -1 - i] = t;
6917 int len = 0;
6924 for (iter = fmt; *iter && len < buf_size; iter++) {
6926 while (*iter && (*iter != '%') && (len < buf_size))
6927 buf[len++] = *iter++;
6928 if (!(*iter) || len >= buf_size) break;
6988 if (len < buf_size)
6989 buf[len++] = '%';
6998 while (str && *str && len < buf_size)
6999 buf[len++] = *str++;
7006 if (n) *n = len;
7035 while (padding-- > 0 && (len < buf_size)) {
7037 buf[len++] = '0';
7038 else buf[len++] = ' ';
7043 if ((flag & NK_ARG_FLAG_PLUS) && value >= 0 && len < buf_size)
7044 buf[len++] = '+';
7045 else if ((flag & NK_ARG_FLAG_SPACE) && value >= 0 && len < buf_size)
7046 buf[len++] = ' ';
7050 while (precision && (num_print > num_len) && (len < buf_size)) {
7051 buf[len++] = '0';
7057 while (precision && *num_iter && len < buf_size)
7058 buf[len++] = *num_iter++;
7062 while ((padding-- > 0) && (len < buf_size))
7063 buf[len++] = ' ';
7103 while ((padding-- > 0) && (len < buf_size)) {
7105 buf[len++] = '0';
7106 else buf[len++] = ' ';
7112 if ((*iter == 'o') && (len < buf_size)) {
7113 buf[len++] = '0';
7114 } else if ((*iter == 'x') && ((len+1) < buf_size)) {
7115 buf[len++] = '0';
7116 buf[len++] = 'x';
7117 } else if ((*iter == 'X') && ((len+1) < buf_size)) {
7118 buf[len++] = '0';
7119 buf[len++] = 'X';
7122 while (precision && (num_print > num_len) && (len < buf_size)) {
7123 buf[len++] = '0';
7129 if (precision && (len < buf_size))
7130 buf[len++] = number_buffer[num_len-1];
7136 while ((padding-- > 0) && (len < buf_size))
7137 buf[len++] = ' ';
7164 while (padding-- > 0 && (len < buf_size)) {
7166 buf[len++] = '0';
7167 else buf[len++] = ' ';
7173 if ((flag & NK_ARG_FLAG_PLUS) && (value >= 0) && (len < buf_size))
7174 buf[len++] = '+';
7175 else if ((flag & NK_ARG_FLAG_SPACE) && (value >= 0) && (len < buf_size))
7176 buf[len++] = ' ';
7179 if (len < buf_size)
7180 buf[len++] = *num_iter;
7188 if (!dot && len < buf_size) {
7189 buf[len++] = '.';
7192 if (len < buf_size)
7193 buf[len++] = '0';
7199 while ((padding-- > 0) && (len < buf_size))
7200 buf[len++] = ' ';
7208 buf[(len >= buf_size)?(buf_size-1):len] = 0;
7209 result = (len >= buf_size)?-1:len;
7231 nk_murmur_hash(const void * key, int len, nk_hash seed)
7242 const int nblocks = len/4;
7270 switch (len & 3) {
7283 h1 ^= (nk_uint)len;
7339 int len = 0;
7349 while (glyph_len && (width < space) && (len < text_len)) {
7350 len += glyph_len;
7351 s = font->width(font->userdata, font->height, text, len);
7356 sep_len = len;
7364 glyph_len = nk_utf_decode(&text[len], &unicode, text_len - len);
7367 if (len >= text_len) {
7370 return len;
7374 return (!sep_len) ? len: sep_len;
7451 int len = 0;
7452 while (len < length) {
7454 if (p[len] >= 'a' && p[len] <= 'f')
7455 i += ((p[len] - 'a') + 10);
7456 else if (p[len] >= 'A' && p[len] <= 'F')
7457 i += ((p[len] - 'A') + 10);
7458 else i += (p[len] - '0');
7459 len++;
7892 int i, j, len, type=0;
7902 udecoded = nk_utf_decode_byte(c[0], &len);
7903 if (!NK_BETWEEN(len, 1, NK_UTF_SIZE))
7906 for (i = 1, j = 1; i < clen && j < len; ++i, ++j) {
7911 if (j < len)
7914 nk_utf_validate(u, len);
7915 return len;
7925 int len, i;
7926 len = nk_utf_validate(&u, 0);
7927 if (clen < len || !len || len > NK_UTF_SIZE)
7930 for (i = len - 1; i != 0; --i) {
7934 c[0] = nk_utf_encode_byte(u, len);
7935 return len;
7938 nk_utf_len(const char *str, int len)
7948 if (!str || !len) return 0;
7951 text_len = len;
7953 while (glyph_len && src_len < len) {
7962 nk_rune *unicode, int *len)
7972 NK_ASSERT(len);
7974 if (!buffer || !unicode || !len) return 0;
7977 *len = 0;
7986 *len = glyph_len;
8294 str->len = 0;
8302 str->len = 0;
8308 str->len = 0;
8311 nk_str_append_text_char(struct nk_str *s, const char *str, int len)
8316 if (!s || !str || !len) return 0;
8317 mem = (char*)nk_buffer_alloc(&s->buffer, NK_BUFFER_FRONT, (nk_size)len * sizeof(char), 0);
8319 NK_MEMCPY(mem, str, (nk_size)len * sizeof(char));
8320 s->len += nk_utf_len(str, len);
8321 return len;
8329 nk_str_append_text_utf8(struct nk_str *str, const char *text, int len)
8334 if (!str || !text || !len) return 0;
8335 for (i = 0; i < len; ++i)
8338 return len;
8360 nk_str_append_text_runes(struct nk_str *str, const nk_rune *text, int len)
8367 if (!str || !text || !len) return 0;
8368 for (i = 0; i < len; ++i) {
8373 return len;
8391 nk_str_insert_at_char(struct nk_str *s, int pos, const char *str, int len)
8401 NK_ASSERT(len >= 0);
8402 if (!s || !str || !len || (nk_size)pos > s->buffer.allocated) return 0;
8403 if ((s->buffer.allocated + (nk_size)len >= s->buffer.memory.size) &&
8408 nk_str_append_text_char(s, str, len);
8411 mem = nk_buffer_alloc(&s->buffer, NK_BUFFER_FRONT, (nk_size)len * sizeof(char), 0);
8415 NK_ASSERT(((int)pos + (int)len + ((int)copylen - 1)) >= 0);
8417 dst = nk_ptr_add(char, s->buffer.memory.ptr, pos + len + (copylen - 1));
8421 NK_MEMCPY(mem, str, (nk_size)len * sizeof(char));
8422 s->len = nk_utf_len((char *)s->buffer.memory.ptr, (int)s->buffer.allocated);
8426 nk_str_insert_at_rune(struct nk_str *str, int pos, const char *cstr, int len)
8435 NK_ASSERT(len);
8436 if (!str || !cstr || !len) return 0;
8438 if (!str->len)
8439 return nk_str_append_text_char(str, cstr, len);
8442 return nk_str_insert_at_char(str, (int)(begin - buffer), cstr, len);
8445 nk_str_insert_text_char(struct nk_str *str, int pos, const char *text, int len)
8447 return nk_str_insert_text_utf8(str, pos, text, len);
8455 nk_str_insert_text_utf8(struct nk_str *str, int pos, const char *text, int len)
8463 if (!str || !text || !len) return 0;
8464 for (i = 0; i < len; ++i)
8467 return len;
8489 nk_str_insert_text_runes(struct nk_str *str, int pos, const nk_rune *runes, int len)
8496 if (!str || !runes || !len) return 0;
8497 for (i = 0; i < len; ++i) {
8502 return len;
8520 nk_str_remove_chars(struct nk_str *s, int len)
8523 NK_ASSERT(len >= 0);
8524 if (!s || len < 0 || (nk_size)len > s->buffer.allocated) return;
8525 NK_ASSERT(((int)s->buffer.allocated - (int)len) >= 0);
8526 s->buffer.allocated -= (nk_size)len;
8527 s->len = nk_utf_len((char *)s->buffer.memory.ptr, (int)s->buffer.allocated);
8530 nk_str_remove_runes(struct nk_str *str, int len)
8538 NK_ASSERT(len >= 0);
8539 if (!str || len < 0) return;
8540 if (len >= str->len) {
8541 str->len = 0;
8545 index = str->len - len;
8546 begin = nk_str_at_rune(str, index, &unicode, &len);
8551 nk_str_delete_chars(struct nk_str *s, int pos, int len)
8554 if (!s || !len || (nk_size)pos > s->buffer.allocated ||
8555 (nk_size)(pos + len) > s->buffer.allocated) return;
8557 if ((nk_size)(pos + len) < s->buffer.allocated) {
8560 char *src = nk_ptr_add(char, s->buffer.memory.ptr, pos + len);
8561 NK_MEMCPY(dst, src, s->buffer.allocated - (nk_size)(pos + len));
8562 NK_ASSERT(((int)s->buffer.allocated - (int)len) >= 0);
8563 s->buffer.allocated -= (nk_size)len;
8564 } else nk_str_remove_chars(s, len);
8565 s->len = nk_utf_len((char *)s->buffer.memory.ptr, (int)s->buffer.allocated);
8568 nk_str_delete_runes(struct nk_str *s, int pos, int len)
8577 NK_ASSERT(s->len >= pos + len);
8578 if (s->len < pos + len)
8579 len = NK_CLAMP(0, (s->len - pos), s->len);
8580 if (!len) return;
8586 end = nk_str_at_rune(s, len, &unicode, &unused);
8599 nk_str_at_rune(struct nk_str *str, int pos, nk_rune *unicode, int *len)
8609 NK_ASSERT(len);
8611 if (!str || !unicode || !len) return 0;
8614 *len = 0;
8623 *len = glyph_len;
8642 nk_str_at_const(const struct nk_str *str, int pos, nk_rune *unicode, int *len)
8652 NK_ASSERT(len);
8654 if (!str || !unicode || !len) return 0;
8657 *len = 0;
8666 *len = glyph_len;
8680 int len;
8682 nk_str_at_const(str, pos, &unicode, &len);
8689 if (!s || !s->len || !s->buffer.allocated) return 0;
8696 if (!s || !s->len || !s->buffer.allocated) return 0;
8703 if (!s || !s->len || !s->buffer.allocated) return 0;
8704 return s->len;
8710 if (!s || !s->len || !s->buffer.allocated) return 0;
8718 str->len = 0;
8725 str->len = 0;
9685 float len;
9688 len = nk_vec2_len_sqr(diff);
9689 if (len != 0.0f)
9690 len = nk_inv_sqrt(len);
9691 else len = 1.0f;
9693 diff = nk_vec2_muls(diff, len);
9836 float len;
9839 len = nk_vec2_len_sqr(diff);
9840 if (len != 0.0f)
9841 len = nk_inv_sqrt(len);
9842 else len = 1.0f;
9843 diff = nk_vec2_muls(diff, len);
9929 float len = nk_vec2_len_sqr(diff);
9930 if (len != 0.0f)
9931 len = nk_inv_sqrt(len);
9932 else len = 1.0f;
9933 diff = nk_vec2_muls(diff, len);
10340 struct nk_rect rect, const char *text, int len, float font_height,
10352 if (!list || !len || !text) return;
10358 glyph_len = nk_utf_decode(text, &unicode, len);
10363 while (text_len < len && glyph_len) {
10369 next_glyph_len = nk_utf_decode(text + text_len + glyph_len, &next, (int)len - text_len);
10863 nk_rp_qsort(struct nk_rp_rect *array, unsigned int len, int(*cmp)(const void*,const void*))
10868 unsigned seed = len/2 * 69069+1;
10870 for (; left+1 < len; len++) {
10872 if (pos == NK_MAX_SORT_STACK) len = stack[pos = 0];
10873 pivot = array[left+seed%(len-left)];
10875 stack[pos++] = len;
10878 while (cmp(&pivot, &array[--len]) < 0);
10879 if (right >= len) break;
10881 array[right] = array[len];
10882 array[len] = tmp;
10886 left = len;
10887 len = stack[--pos];
11701 nk_tt__fill_active_edges_new(float *scanline, float *scanline_fill, int len,
11712 if (x0 < len) {
11748 if (x_top >= 0 && x_bottom >= 0 && x_top < len && x_bottom < len)
11756 NK_ASSERT(x >= 0 && x < len);
11805 for (x=0; x < len; ++x)
13007 nk_font_text_width(nk_handle handle, float height, const char *text, int len)
13018 if (!font || !text || !len)
13022 glyph_len = text_len = nk_utf_decode(text, &unicode, (int)len);
13024 while (text_len <= (int)len && glyph_len) {
13033 glyph_len = nk_utf_decode(text + text_len, &unicode, (int)len - text_len);
14031 int len = 0;
14039 len = nk_utf_decode(glyph, &unicode, NK_UTF_SIZE);
14040 if (len && ((in->keyboard.text_len + len) < NK_INPUT_MAX)) {
14043 in->keyboard.text_len += len;
17125 nk_contextual_item_text(struct nk_context *ctx, const char *text, int len,
17148 text, len, alignment, NK_BUTTON_DEFAULT, &style->contextual_button, in, style->font)) {
17161 const char *text, int len, nk_flags align)
17183 img, text, len, align, NK_BUTTON_DEFAULT, &style->contextual_button, style->font, in)){
17197 const char *text, int len, nk_flags align)
17219 symbol, text, len, align, NK_BUTTON_DEFAULT, &style->contextual_button, style->font, in)) {
17389 nk_menu_begin_text(struct nk_context *ctx, const char *title, int len,
17409 title, len, align, NK_BUTTON_DEFAULT, &ctx->style.menu_button, in, ctx->style.font))
17469 nk_menu_begin_image_text(struct nk_context *ctx, const char *title, int len,
17489 header, img, title, len, align, NK_BUTTON_DEFAULT, &ctx->style.menu_button,
17501 nk_menu_begin_symbol_text(struct nk_context *ctx, const char *title, int len,
17522 header, sym, title, len, align, NK_BUTTON_DEFAULT, &ctx->style.menu_button,
17533 nk_menu_item_text(struct nk_context *ctx, const char *title, int len, nk_flags align)
17535 return nk_contextual_item_text(ctx, title, len, align);
17550 const char *text, int len, nk_flags align)
17552 return nk_contextual_item_image_text(ctx, img, text, len, align);
17555 const char *text, int len, nk_flags align)
17557 return nk_contextual_item_symbol_text(ctx, sym, text, len, align);
18460 const char *hash, int len, int line)
18471 } else tree_hash = nk_murmur_hash(hash, len, (nk_hash)line);
18513 const char *hash, int len, int line)
18515 return nk_tree_base(ctx, type, 0, title, initial_state, hash, len, line);
18520 const char *hash, int len,int seed)
18522 return nk_tree_base(ctx, type, &img, title, initial_state, hash, len, seed);
18643 int *selected, const char *hash, int len, int line)
18654 } else tree_hash = nk_murmur_hash(hash, len, (nk_hash)line);
18665 int *selected, const char *hash, int len, int seed)
18667 return nk_tree_element_base(ctx, type, 0, title, initial_state, selected, hash, len, seed);
18672 int *selected, const char *hash, int len,int seed)
18674 return nk_tree_element_base(ctx, type, &img, title, initial_state, selected, hash, len, seed);
19260 const char *string, int len, const struct nk_text *t,
19275 text_width = f->width(f->userdata, f->height, (const char*)string, len);
19301 nk_draw_text(o, label, (const char*)string, len, f, t->background, t->text);
19305 const char *string, int len, const struct nk_text *t,
19333 fitting = nk_text_clamp(f, string, len, line.w, &glyphs, &width, seperator,NK_LEN(seperator));
19334 while (done < len) {
19339 fitting = nk_text_clamp(f, &string[done], len - done, line.w, &glyphs, &width, seperator,NK_LEN(seperator));
19343 nk_text_colored(struct nk_context *ctx, const char *str, int len,
19367 nk_widget_text(&win->buffer, bounds, str, len, &text, alignment, style->font);
19371 int len, struct nk_color color)
19394 nk_widget_text_wrap(&win->buffer, bounds, str, len, &text, style->font);
19507 nk_text(struct nk_context *ctx, const char *str, int len, nk_flags alignment)
19511 nk_text_colored(ctx, str, len, alignment, ctx->style.text.color);
19514 nk_text_wrap(struct nk_context *ctx, const char *str, int len)
19518 nk_text_wrap_colored(ctx, str, len, ctx->style.text.color);
19820 const struct nk_style_button *style, const char *txt, int len,
19838 nk_widget_text(out, *content, txt, len, &text, text_alignment, font);
19843 const char *string, int len, nk_flags align, enum nk_button_behavior behavior,
19860 nk_draw_button_text(out, &bounds, &content, *state, style, string, len, align, font);
19947 const char *str, int len, enum nk_symbol_type type,
19974 nk_widget_text(out, *label, str, len, &text, NK_TEXT_CENTERED, font);
19979 enum nk_symbol_type symbol, const char *str, int len, nk_flags align,
20004 *state, style, str, len, symbol, font);
20012 const char *str, int len, const struct nk_user_font *font,
20030 nk_widget_text(out, *label, str, len, &text, NK_TEXT_CENTERED, font);
20036 struct nk_image img, const char* str, int len, nk_flags align,
20065 nk_draw_button_text_image(out, &bounds, &content, &icon, *state, style, str, len, font, &img);
20116 const struct nk_style_button *style, const char *title, int len)
20138 title, len, style->text_alignment, ctx->button_behavior,
20142 nk_button_text(struct nk_context *ctx, const char *title, int len)
20146 return nk_button_text_styled(ctx, &ctx->style.button, title, len);
20260 const char *text, int len, nk_flags align)
20282 symbol, text, len, align, ctx->button_behavior,
20287 const char* text, int len, nk_flags align)
20291 return nk_button_symbol_text_styled(ctx, &ctx->style.button, symbol, text, len, align);
20307 int len, nk_flags align)
20329 bounds, img, text, len, align, ctx->button_behavior,
20334 const char *text, int len, nk_flags align)
20336 return nk_button_image_text_styled(ctx, &ctx->style.button,img, text, len, align);
20378 const struct nk_rect *cursors, const char *string, int len,
20414 nk_widget_text(out, *label, string, len, &text, NK_TEXT_LEFT, font);
20420 const struct nk_rect *cursors, const char *string, int len,
20456 nk_widget_text(out, *label, string, len, &text, NK_TEXT_LEFT, font);
20461 int *active, const char *str, int len, enum nk_toggle_type type,
20512 nk_draw_checkbox(out, *state, style, *active, &label, &select, &cursor, str, len, font);
20514 nk_draw_option(out, *state, style, *active, &label, &select, &cursor, str, len, font);
20526 nk_check_text(struct nk_context *ctx, const char *text, int len, int active)
20550 text, len, NK_TOGGLE_CHECK, &style->checkbox, in, style->font);
20554 nk_check_flags_text(struct nk_context *ctx, const char *text, int len,
20562 if (nk_check_text(ctx, text, len, old_active))
20568 nk_checkbox_text(struct nk_context *ctx, const char *text, int len, int *active)
20576 *active = nk_check_text(ctx, text, len, *active);
20580 nk_checkbox_flags_text(struct nk_context *ctx, const char *text, int len,
20590 if (nk_checkbox_text(ctx, text, len, &active)) {
20621 nk_option_text(struct nk_context *ctx, const char *text, int len, int is_active)
20645 text, len, NK_TOGGLE_OPTION, &style->option, in, style->font);
20649 nk_radio_text(struct nk_context *ctx, const char *text, int len, int *active)
20657 *active = nk_option_text(ctx, text, len, old_value);
20685 const char *string, int len, nk_flags align, const struct nk_user_font *font)
20727 nk_widget_text(out, *bounds, string, len, &text, align, font);
20731 struct nk_rect bounds, const char *str, int len, nk_flags align, int *value,
20741 NK_ASSERT(len);
20746 if (!state || !out || !str || !len || !value || !style || !font) return 0;
20761 nk_draw_selectable(out, *state, style, *value, &bounds, 0,0,NK_SYMBOL_NONE, str, len, align, font);
20767 struct nk_rect bounds, const char *str, int len, nk_flags align, int *value,
20778 NK_ASSERT(len);
20783 if (!state || !out || !str || !len || !value || !style || !font) return 0;
20808 nk_draw_selectable(out, *state, style, *value, &bounds, &icon, img, NK_SYMBOL_NONE, str, len, align, font);
20814 struct nk_rect bounds, const char *str, int len, nk_flags align, int *value,
20825 NK_ASSERT(len);
20830 if (!state || !out || !str || !len || !value || !style || !font) return 0;
20855 nk_draw_selectable(out, *state, style, *value, &bounds, &icon, 0, sym, str, len, align, font);
20861 nk_selectable_text(struct nk_context *ctx, const char *str, int len,
20887 str, len, align, value, &style->selectable, in, style->font);
20891 const char *str, int len, nk_flags align, int *value)
20916 str, len, align, value, &img, &style->selectable, in, style->font);
20920 const char *str, int len, nk_flags align, int *value)
20945 str, len, align, value, sym, &style->selectable, in, style->font);
20953 NK_API int nk_select_text(struct nk_context *ctx, const char *str, int len,
20956 nk_selectable_text(ctx, str, len, align, &value);return value;
20977 const char *str, int len, nk_flags align, int value)
20979 nk_selectable_image_text(ctx, img, str, len, align, &value);return value;
21726 int len = 0;
21728 const char *str = nk_str_at_const(&edit->string, line_start + char_id, &unicode, &len);
21729 return font->width(font->userdata, font->height, str, len);
21739 int len = nk_str_len_char(&edit->string);
21740 const char *end = nk_str_get_const(&edit->string) + len;
21757 int n = edit->string.len;
21842 int z = state->string.len;
21895 int n = state->string.len;
21906 nk_textedit_delete(struct nk_text_edit *state, int where, int len)
21909 nk_textedit_makeundo_delete(state, where, len);
21910 nk_str_delete_runes(&state->string, where, len);
21967 int len;
21970 if (!nk_str_at_rune(&state->string, idx, &c, &len)) return 1;
21990 const int len = state->string.len;
21992 while( c < len && !nk_is_word_boundary(state, c))
21995 if( c > len )
21996 c = len;
22022 nk_textedit_paste(struct nk_text_edit *state, char const *ctext, int len)
22034 glyphs = nk_utf_len(ctext, len);
22035 if (nk_str_insert_text_char(&state->string, state->cursor, text, len)) {
22037 state->cursor += len;
22068 state->cursor < state->string.len)
22310 int n = state->string.len;
22346 state->cursor = state->select_end = state->string.len;
22349 state->cursor = state->string.len;
22360 if (state->string.len && state->cursor == state->string.len)
22368 if (state->string.len && state->cursor == state->string.len)
22709 state->select_end = state->string.len;
22921 edit->cursor = edit->string.len;
23037 int len = nk_str_len_char(&edit->string);
23074 if (text && len)
23084 glyph_len = nk_utf_decode(text, &unicode, len);
23089 while ((text_len < len) && glyph_len)
23150 glyph_len = nk_utf_decode(text + text_len, &unicode, len-text_len);
23159 glyph_len = nk_utf_decode(text + text_len, &unicode, len-text_len);
23167 if (!cursor_ptr && edit->cursor == edit->string.len) {
23289 selection_end < edit->string.len))
23400 char *memory, int *len, int max, nk_plugin_filter filter)
23409 NK_ASSERT(len);
23410 if (!ctx || !memory || !len)
23422 edit->cursor = nk_utf_len(memory, *len);
23438 *len = NK_MIN(*len, max-1);
23440 edit->string.buffer.allocated = (nk_size)*len;
23441 edit->string.len = nk_utf_len(memory, *len);
23443 *len = (int)edit->string.buffer.allocated;
23487 edit->cursor = edit->string.len;
23520 int len = nk_strlen(buffer);
23521 result = nk_edit_string(ctx, flags, buffer, &len, max, filter);
23522 buffer[NK_MIN(NK_MAX(max-1,0), len)] = '\0';
23596 const char *name, int len, const struct nk_user_font *font)
23625 nk_widget_text(out, *label, name, len, &text, NK_TEXT_CENTERED, font);
23631 float inc_per_pixel, char *buffer, int *len,
23678 size = font->width(font->userdata, font->height, buffer, *len);
23680 length = len;
23752 *len = *length;
23753 length = len;
23761 text_edit->string.len = *length;
23773 *length = text_edit->string.len;
23783 buffer[*len] = '\0';
23852 int *len = 0;
23886 len = &win->property.length;
23893 len = &dummy_length;
23906 variant, inc_per_pixel, buffer, len, state, cursor, select_begin,
23913 NK_MEMCPY(win->property.buffer, buffer, (nk_size)*len);
23914 win->property.length = *len;
24587 nk_combo_begin_text(struct nk_context *ctx, const char *selected, int len,
24666 nk_widget_text(&win->buffer, label, selected, len, &text,
24845 nk_combo_begin_symbol_text(struct nk_context *ctx, const char *selected, int len,
24936 nk_widget_text(&win->buffer, label, selected, len, &text, NK_TEXT_LEFT, style->font);
25018 nk_combo_begin_image_text(struct nk_context *ctx, const char *selected, int len,
25104 nk_widget_text(&win->buffer, label, selected, len, &text, NK_TEXT_LEFT, style->font);
25121 nk_combo_item_text(struct nk_context *ctx, const char *text, int len,nk_flags align)
25123 return nk_contextual_item_text(ctx, text, len, align);
25132 int len, nk_flags alignment)
25134 return nk_contextual_item_image_text(ctx, img, text, len, alignment);
25144 const char *text, int len, nk_flags alignment)
25146 return nk_contextual_item_symbol_text(ctx, sym, text, len, alignment);