Lines Matching defs:nk_size
406 typedef NK_SIZE_TYPE nk_size;
423 NK_STATIC_ASSERT(sizeof(nk_size) >= sizeof(void*));
483 typedef void*(*nk_plugin_alloc)(nk_handle, void *old, nk_size);
575 /// int nk_init_fixed(struct nk_context *ctx, void *memory, nk_size size, const struct nk_user_font *font);
590 NK_API int nk_init_fixed(struct nk_context*, void *memory, nk_size size, const struct nk_user_font*);
1164 nk_size vertex_size; /* sizeof one vertex for vertex packing */
1165 nk_size vertex_alignment; /* vertex alignment: Can be obtained by NK_ALIGNOF */
3193 NK_API int nk_progress(struct nk_context*, nk_size *cur, nk_size max, int modifyable);
3194 NK_API nk_size nk_prog(struct nk_context*, nk_size cur, nk_size max, int modifyable);
3956 nk_size ttf_size;
4046 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);
4050 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*);
4096 nk_size size;
4097 nk_size allocated;
4098 nk_size needed;
4099 nk_size calls;
4115 nk_size offset;
4118 struct nk_memory {void *ptr;nk_size size;};
4130 nk_size allocated;
4132 nk_size needed;
4134 nk_size calls;
4136 nk_size size;
4143 NK_API void nk_buffer_init(struct nk_buffer*, const struct nk_allocator*, nk_size size);
4144 NK_API void nk_buffer_init_fixed(struct nk_buffer*, void *memory, nk_size size);
4146 NK_API void nk_buffer_push(struct nk_buffer*, enum nk_buffer_allocation_type type, const void *memory, nk_size size, nk_size align);
4153 NK_API nk_size nk_buffer_total(struct nk_buffer*);
4173 NK_API void nk_str_init(struct nk_str*, const struct nk_allocator*, nk_size size);
4174 NK_API void nk_str_init_fixed(struct nk_str*, void *memory, nk_size size);
4314 NK_API void nk_textedit_init(struct nk_text_edit*, struct nk_allocator*, nk_size size);
4315 NK_API void nk_textedit_init_fixed(struct nk_text_edit*, void *memory, nk_size size);
4400 nk_size next;
4568 nk_size begin, end, last;
4717 nk_size offset;
4744 nk_size cmd_offset;
5314 nk_size begin;
5315 nk_size parent;
5316 nk_size last;
5317 nk_size end;
5566 nk_size size;
5567 nk_size cap;
5645 # define NK_PTR_TO_UINT(x) ((nk_size)(__PTRDIFF_TYPE__)(x))
5648 # define NK_PTR_TO_UINT(x) ((nk_size)(((char*)x)-(char*)0))
5654 # define NK_PTR_TO_UINT(x) ((nk_size)(x))
5770 NK_STATIC_ASSERT(sizeof(nk_size) >= sizeof(void*));
5817 NK_LIB void* nk_memcopy(void *dst, const void *src, nk_size n);
5818 NK_LIB void nk_memset(void *ptr, int c0, nk_size size);
5819 NK_LIB void nk_zero(void *ptr, nk_size size);
5829 NK_LIB char *nk_file_load(const char* path, nk_size* siz, struct nk_allocator *alloc);
5834 NK_LIB void* nk_malloc(nk_handle unused, void *old,nk_size size);
5837 NK_LIB void* nk_buffer_align(void *unaligned, nk_size align, nk_size *alignment, enum nk_buffer_allocation_type type);
5838 NK_LIB void* nk_buffer_alloc(struct nk_buffer *b, enum nk_buffer_allocation_type type, nk_size size, nk_size align);
5839 NK_LIB void* nk_buffer_realloc(struct nk_buffer *b, nk_size capacity, nk_size *size);
5844 NK_LIB void* nk_command_buffer_push(struct nk_command_buffer* b, enum nk_command_type t, nk_size size);
5876 NK_LIB void nk_pool_init_fixed(struct nk_pool *pool, void *memory, nk_size size);
5951 NK_LIB nk_size nk_progress_behavior(nk_flags *state, struct nk_input *in, struct nk_rect r, struct nk_rect cursor, nk_size max, nk_size value, int modifiable);
5952 NK_LIB void nk_draw_progress(struct nk_command_buffer *out, nk_flags state, const struct nk_style_progress *style, const struct nk_rect *bounds, const struct nk_rect *scursor, nk_size value, nk_size max);
5953 NK_LIB nk_size nk_do_progress(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, nk_size value, nk_size max, int modifiable, const struct nk_style_progress *style, struct nk_input *in);
6335 nk_memcopy(void *dst0, const void *src0, nk_size length)
6391 nk_memset(void *ptr, int c0, nk_size size)
6398 nk_size t = 0;
6442 nk_zero(void *ptr, nk_size size)
7221 result = NK_VSNPRINTF(buf, (nk_size)buf_size, fmt, args);
7296 nk_file_load(const char* path, nk_size* siz, struct nk_allocator *alloc)
7316 *siz = (nk_size)ret;
7324 *siz = (nk_size)fread(buf, 1,*siz, fd);
8009 nk_malloc(nk_handle unused, void *old,nk_size size)
8034 nk_size initial_size)
8050 nk_buffer_init_fixed(struct nk_buffer *b, void *m, nk_size size)
8065 nk_size align, nk_size *alignment,
8075 *alignment = (nk_size)((nk_byte*)memory - (nk_byte*)unaligned);
8084 *alignment = (nk_size)((nk_byte*)unaligned - (nk_byte*)memory);
8094 nk_buffer_realloc(struct nk_buffer *b, nk_size capacity, nk_size *size)
8097 nk_size buffer_size;
8122 nk_size back_size;
8133 nk_size size, nk_size align)
8136 nk_size alignment;
8157 nk_size capacity;
8165 capacity = (nk_size)((float)b->memory.size * b->grow_factor);
8185 const void *memory, nk_size size, nk_size align)
8268 NK_API nk_size
8299 nk_str_init(struct nk_str *str, const struct nk_allocator *alloc, nk_size size)
8305 nk_str_init_fixed(struct nk_str *str, void *memory, nk_size size)
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));
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) &&
8411 mem = nk_buffer_alloc(&s->buffer, NK_BUFFER_FRONT, (nk_size)len * sizeof(char), 0);
8421 NK_MEMCPY(mem, str, (nk_size)len * sizeof(char));
8524 if (!s || len < 0 || (nk_size)len > s->buffer.allocated) return;
8526 s->buffer.allocated -= (nk_size)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) {
8561 NK_MEMCPY(dst, src, s->buffer.allocated - (nk_size)(pos + len));
8563 s->buffer.allocated -= (nk_size)len;
8765 enum nk_command_type t, nk_size size)
8767 NK_STORAGE const nk_size align = NK_ALIGNOF(struct nk_command);
8769 nk_size alignment;
8780 b->last = (nk_size)((nk_byte*)cmd - (nk_byte*)b->base->memory.ptr);
8783 alignment = (nk_size)((nk_byte*)memory - (nk_byte*)unaligned);
9064 nk_size size = 0;
9069 size = sizeof(*cmd) + sizeof(short) * 2 * (nk_size)point_count;
9085 nk_size size = 0;
9090 size = sizeof(*cmd) + sizeof(short) * 2 * (nk_size)point_count;
9106 nk_size size = 0;
9111 size = sizeof(*cmd) + sizeof(short) * 2 * (nk_size)point_count;
9195 nk_command_buffer_push(b, NK_COMMAND_TEXT, sizeof(*cmd) + (nk_size)(length + 1));
9206 NK_MEMCPY(cmd->string, string, (nk_size)length);
9223 nk_size i = 0;
9265 nk_size offset;
9280 nk_size size;
9281 nk_size offset;
9315 NK_STORAGE const nk_size point_align = NK_ALIGNOF(struct nk_vec2);
9316 NK_STORAGE const nk_size point_size = sizeof(struct nk_vec2);
9319 point_size * (nk_size)count, point_align);
9344 NK_STORAGE const nk_size cmd_align = NK_ALIGNOF(struct nk_draw_command);
9345 NK_STORAGE const nk_size cmd_size = sizeof(struct nk_draw_command);
9355 nk_size total = nk_buffer_total(list->buffer);
9357 list->cmd_offset = (nk_size)(memory - (nk_byte*)cmd);
9375 nk_size size;
9427 nk_draw_list_alloc_vertices(struct nk_draw_list *list, nk_size count)
9451 nk_draw_list_alloc_elements(struct nk_draw_list *list, nk_size count)
9455 NK_STORAGE const nk_size elem_align = NK_ALIGNOF(nk_draw_index);
9456 NK_STORAGE const nk_size elem_size = sizeof(nk_draw_index);
9628 nk_size count;
9652 NK_STORAGE const nk_size pnt_align = NK_ALIGNOF(struct nk_vec2);
9653 NK_STORAGE const nk_size pnt_size = sizeof(struct nk_vec2);
9656 nk_size i1 = 0;
9657 nk_size vertex_offset;
9658 nk_size index = list->vertex_count;
9660 const nk_size idx_count = (thick_line) ? (count * 18) : (count * 12);
9661 const nk_size vtx_count = (thick_line) ? (points_count * 4): (points_count *3);
9666 nk_size size;
9671 vertex_offset = (nk_size)((nk_byte*)vtx - (nk_byte*)list->vertices->memory.ptr);
9683 const nk_size i2 = ((i1 + 1) == points_count) ? 0 : (i1 + 1);
9702 nk_size idx1, i;
9717 nk_size i2 = ((i1 + 1) == points_count) ? 0 : (i1 + 1);
9718 nk_size idx2 = ((i1+1) == points_count) ? index: (idx1 + 3);
9751 nk_size idx1, i;
9775 const nk_size i2 = ((i1+1) == points_count) ? 0: (i1 + 1);
9776 nk_size idx2 = ((i1+1) == points_count) ? index: (idx1 + 4);
9821 nk_size i1 = 0;
9822 nk_size idx = list->vertex_count;
9823 const nk_size idx_count = count * 6;
9824 const nk_size vtx_count = count * 4;
9832 const nk_size i2 = ((i1+1) == points_count) ? 0 : i1 + 1;
9871 NK_STORAGE const nk_size pnt_align = NK_ALIGNOF(struct nk_vec2);
9872 NK_STORAGE const nk_size pnt_size = sizeof(struct nk_vec2);
9886 nk_size i = 0;
9887 nk_size i0 = 0;
9888 nk_size i1 = 0;
9891 nk_size vertex_offset = 0;
9892 nk_size index = list->vertex_count;
9894 const nk_size idx_count = (points_count-2)*3 + points_count*6;
9895 const nk_size vtx_count = (points_count*2);
9900 nk_size size = 0;
9907 vertex_offset = (nk_size)((nk_byte*)vtx - (nk_byte*)list->vertices->memory.ptr);
9969 nk_size i = 0;
9970 nk_size index = list->vertex_count;
9971 const nk_size idx_count = (points_count-2)*3;
9972 const nk_size vtx_count = points_count;
10023 const struct nk_vec2 c = list->circle_vtx[(nk_size)a % NK_LEN(list->circle_vtx)];
11341 vertices = (struct nk_tt_vertex *)alloc->alloc(alloc->userdata, 0, (nk_size)m * sizeof(vertices[0]));
11514 (nk_size)(num_vertices+comp_num_verts)*sizeof(struct nk_tt_vertex));
11520 if (num_vertices > 0) NK_MEMCPY(tmp, vertices, (nk_size)num_vertices*sizeof(struct nk_tt_vertex));
11521 NK_MEMCPY(tmp+num_vertices, comp_verts, (nk_size)comp_num_verts*sizeof(struct nk_tt_vertex));
11611 nk_tt__hheap_alloc(struct nk_tt__hheap *hh, nk_size size)
11622 sizeof(struct nk_tt__hheap_chunk) + size * (nk_size)count);
11629 return (char *) (hh->head) + size * (nk_size)hh->num_remaining_in_head_chunk;
11875 scanline = (float *) alloc->alloc(alloc->userdata,0, (nk_size)(result->w*2+1) * sizeof(float));
11889 NK_MEMSET(scanline , 0, (nk_size)result->w*sizeof(scanline[0]));
11890 NK_MEMSET(scanline2, 0, (nk_size)(result->w+1)*sizeof(scanline[0]));
12061 alloc->alloc(alloc->userdata, 0,(sizeof(*e) * (nk_size)(n+1)));
12155 alloc->alloc(alloc->userdata,0, (sizeof(**contour_lengths) * (nk_size)n));
12167 alloc->alloc(alloc->userdata,0, (nk_size)num_points * sizeof(points[0]));
12264 alloc->alloc(alloc->userdata,0, (sizeof(*nodes ) * (nk_size)num_nodes));
12284 NK_MEMSET(pixels, 0, (nk_size)(pw*ph)); /* background of 0 around pixels */
12316 NK_MEMSET(buffer, 0, (nk_size)kernel_width);
12379 NK_MEMSET(buffer, 0, (nk_size)kernel_width);
12608 NK_GLOBAL const nk_size nk_rect_align = NK_ALIGNOF(struct nk_rp_rect);
12609 NK_GLOBAL const nk_size nk_range_align = NK_ALIGNOF(struct nk_tt_pack_range);
12610 NK_GLOBAL const nk_size nk_char_align = NK_ALIGNOF(struct nk_tt_packedchar);
12611 NK_GLOBAL const nk_size nk_build_align = NK_ALIGNOF(struct nk_font_bake_data);
12612 NK_GLOBAL const nk_size nk_baker_align = NK_ALIGNOF(struct nk_font_baker);
12681 nk_font_baker_memory(nk_size *temp, int *glyph_count,
12704 *temp = (nk_size)*glyph_count * sizeof(struct nk_rp_rect);
12705 *temp += (nk_size)total_range_count * sizeof(struct nk_tt_pack_range);
12706 *temp += (nk_size)*glyph_count * sizeof(struct nk_tt_packedchar);
12707 *temp += (nk_size)count * sizeof(struct nk_font_bake_data);
12728 nk_size *image_memory, int *width, int *height, struct nk_recti *custom,
12732 NK_STORAGE const nk_size max_height = 1024 * 32;
12837 *image_memory = (nk_size)(*width) * (nk_size)(*height);
12862 nk_zero(image_memory, (nk_size)((nk_size)width * (nk_size)height));
12880 do {nk_size i = 0;
13583 nk_size size, float height, const struct nk_font_config *config)
13610 nk_size size;
13634 void *compressed_data, nk_size compressed_size, float height,
13687 compressed_data = atlas->temporary.alloc(atlas->temporary.userdata,0, (nk_size)compressed_size);
13692 (nk_size)compressed_size, height, config);
13717 nk_size tmp_size, img_size;
13751 atlas->permanent.userdata,0, sizeof(struct nk_font_glyph)*(nk_size)atlas->glyph_count);
13778 (nk_size)(*width * *height * 4));
14991 nk_init_fixed(struct nk_context *ctx, void *memory, nk_size size,
15334 nk_pool_init_fixed(struct nk_pool *pool, void *memory, nk_size size)
15356 nk_size size = sizeof(struct nk_page);
15390 NK_STORAGE const nk_size size = sizeof(struct nk_page_element);
15391 NK_STORAGE const nk_size align = NK_ALIGNOF(struct nk_page_element);
16291 nk_size name_length = (nk_size)name_len;
16811 nk_size allocated;
21258 NK_LIB nk_size
21260 struct nk_rect r, struct nk_rect cursor, nk_size max, nk_size value, int modifiable)
21276 value = (nk_size)NK_CLAMP(0, (float)max * ratio, (float)max);
21291 const struct nk_rect *scursor, nk_size value, nk_size max)
21323 NK_LIB nk_size
21326 nk_size value, nk_size max, int modifiable,
21330 nk_size prog_value;
21355 nk_progress(struct nk_context *ctx, nk_size *cur, nk_size max, int is_modifyable)
21364 nk_size old_value;
21385 NK_API nk_size
21386 nk_prog(struct nk_context *ctx, nk_size cur, nk_size max, int modifyable)
22422 (nk_size)state->undo_char_point*sizeof(nk_rune));
22431 (nk_size)((nk_size)state->undo_point * sizeof(state->undo_rec[0])));
22441 nk_size num;
22449 num = (nk_size)(NK_TEXTEDIT_UNDOCHARCOUNT - state->redo_char_point);
22460 num = (nk_size)(NK_TEXTEDIT_UNDOSTATECOUNT - state->redo_point);
22674 nk_textedit_init_fixed(struct nk_text_edit *state, void *memory, nk_size size)
22684 nk_textedit_init(struct nk_text_edit *state, struct nk_allocator *alloc, nk_size size)
23439 nk_str_init_fixed(&edit->string, memory, (nk_size)max);
23440 edit->string.buffer.allocated = (nk_size)*len;
23750 NK_MEMCPY(buffer, dst, (nk_size)*length);
23765 text_edit->string.buffer.allocated = (nk_size)*length;
23913 NK_MEMCPY(win->property.buffer, buffer, (nk_size)*len);