Lines Matching refs:cmd

40     struct nk_command *cmd;  in nk_command_buffer_push()  local
48 cmd = (struct nk_command*)nk_buffer_alloc(b->base,NK_BUFFER_FRONT,size,align); in nk_command_buffer_push()
49 if (!cmd) return 0; in nk_command_buffer_push()
52 b->last = (nk_size)((nk_byte*)cmd - (nk_byte*)b->base->memory.ptr); in nk_command_buffer_push()
53 unaligned = (nk_byte*)cmd + size; in nk_command_buffer_push()
57 NK_MEMSET(cmd, 0, size + alignment); in nk_command_buffer_push()
60 cmd->type = t; in nk_command_buffer_push()
61 cmd->next = b->base->allocated + alignment; in nk_command_buffer_push()
63 cmd->userdata = b->userdata; in nk_command_buffer_push()
65 b->end = cmd->next; in nk_command_buffer_push()
66 return cmd; in nk_command_buffer_push()
71 struct nk_command_scissor *cmd; in nk_push_scissor() local
79 cmd = (struct nk_command_scissor*) in nk_push_scissor()
80 nk_command_buffer_push(b, NK_COMMAND_SCISSOR, sizeof(*cmd)); in nk_push_scissor()
82 if (!cmd) return; in nk_push_scissor()
83 cmd->x = (short)r.x; in nk_push_scissor()
84 cmd->y = (short)r.y; in nk_push_scissor()
85 cmd->w = (unsigned short)NK_MAX(0, r.w); in nk_push_scissor()
86 cmd->h = (unsigned short)NK_MAX(0, r.h); in nk_push_scissor()
92 struct nk_command_line *cmd; in nk_stroke_line() local
95 cmd = (struct nk_command_line*) in nk_stroke_line()
96 nk_command_buffer_push(b, NK_COMMAND_LINE, sizeof(*cmd)); in nk_stroke_line()
97 if (!cmd) return; in nk_stroke_line()
98 cmd->line_thickness = (unsigned short)line_thickness; in nk_stroke_line()
99 cmd->begin.x = (short)x0; in nk_stroke_line()
100 cmd->begin.y = (short)y0; in nk_stroke_line()
101 cmd->end.x = (short)x1; in nk_stroke_line()
102 cmd->end.y = (short)y1; in nk_stroke_line()
103 cmd->color = c; in nk_stroke_line()
110 struct nk_command_curve *cmd; in nk_stroke_curve() local
114 cmd = (struct nk_command_curve*) in nk_stroke_curve()
115 nk_command_buffer_push(b, NK_COMMAND_CURVE, sizeof(*cmd)); in nk_stroke_curve()
116 if (!cmd) return; in nk_stroke_curve()
117 cmd->line_thickness = (unsigned short)line_thickness; in nk_stroke_curve()
118 cmd->begin.x = (short)ax; in nk_stroke_curve()
119 cmd->begin.y = (short)ay; in nk_stroke_curve()
120 cmd->ctrl[0].x = (short)ctrl0x; in nk_stroke_curve()
121 cmd->ctrl[0].y = (short)ctrl0y; in nk_stroke_curve()
122 cmd->ctrl[1].x = (short)ctrl1x; in nk_stroke_curve()
123 cmd->ctrl[1].y = (short)ctrl1y; in nk_stroke_curve()
124 cmd->end.x = (short)bx; in nk_stroke_curve()
125 cmd->end.y = (short)by; in nk_stroke_curve()
126 cmd->color = col; in nk_stroke_curve()
132 struct nk_command_rect *cmd; in nk_stroke_rect() local
140 cmd = (struct nk_command_rect*) in nk_stroke_rect()
141 nk_command_buffer_push(b, NK_COMMAND_RECT, sizeof(*cmd)); in nk_stroke_rect()
142 if (!cmd) return; in nk_stroke_rect()
143 cmd->rounding = (unsigned short)rounding; in nk_stroke_rect()
144 cmd->line_thickness = (unsigned short)line_thickness; in nk_stroke_rect()
145 cmd->x = (short)rect.x; in nk_stroke_rect()
146 cmd->y = (short)rect.y; in nk_stroke_rect()
147 cmd->w = (unsigned short)NK_MAX(0, rect.w); in nk_stroke_rect()
148 cmd->h = (unsigned short)NK_MAX(0, rect.h); in nk_stroke_rect()
149 cmd->color = c; in nk_stroke_rect()
155 struct nk_command_rect_filled *cmd; in nk_fill_rect() local
164 cmd = (struct nk_command_rect_filled*) in nk_fill_rect()
165 nk_command_buffer_push(b, NK_COMMAND_RECT_FILLED, sizeof(*cmd)); in nk_fill_rect()
166 if (!cmd) return; in nk_fill_rect()
167 cmd->rounding = (unsigned short)rounding; in nk_fill_rect()
168 cmd->x = (short)rect.x; in nk_fill_rect()
169 cmd->y = (short)rect.y; in nk_fill_rect()
170 cmd->w = (unsigned short)NK_MAX(0, rect.w); in nk_fill_rect()
171 cmd->h = (unsigned short)NK_MAX(0, rect.h); in nk_fill_rect()
172 cmd->color = c; in nk_fill_rect()
179 struct nk_command_rect_multi_color *cmd; in nk_fill_rect_multi_color() local
188 cmd = (struct nk_command_rect_multi_color*) in nk_fill_rect_multi_color()
189 nk_command_buffer_push(b, NK_COMMAND_RECT_MULTI_COLOR, sizeof(*cmd)); in nk_fill_rect_multi_color()
190 if (!cmd) return; in nk_fill_rect_multi_color()
191 cmd->x = (short)rect.x; in nk_fill_rect_multi_color()
192 cmd->y = (short)rect.y; in nk_fill_rect_multi_color()
193 cmd->w = (unsigned short)NK_MAX(0, rect.w); in nk_fill_rect_multi_color()
194 cmd->h = (unsigned short)NK_MAX(0, rect.h); in nk_fill_rect_multi_color()
195 cmd->left = left; in nk_fill_rect_multi_color()
196 cmd->top = top; in nk_fill_rect_multi_color()
197 cmd->right = right; in nk_fill_rect_multi_color()
198 cmd->bottom = bottom; in nk_fill_rect_multi_color()
204 struct nk_command_circle *cmd; in nk_stroke_circle() local
212 cmd = (struct nk_command_circle*) in nk_stroke_circle()
213 nk_command_buffer_push(b, NK_COMMAND_CIRCLE, sizeof(*cmd)); in nk_stroke_circle()
214 if (!cmd) return; in nk_stroke_circle()
215 cmd->line_thickness = (unsigned short)line_thickness; in nk_stroke_circle()
216 cmd->x = (short)r.x; in nk_stroke_circle()
217 cmd->y = (short)r.y; in nk_stroke_circle()
218 cmd->w = (unsigned short)NK_MAX(r.w, 0); in nk_stroke_circle()
219 cmd->h = (unsigned short)NK_MAX(r.h, 0); in nk_stroke_circle()
220 cmd->color = c; in nk_stroke_circle()
225 struct nk_command_circle_filled *cmd; in nk_fill_circle() local
234 cmd = (struct nk_command_circle_filled*) in nk_fill_circle()
235 nk_command_buffer_push(b, NK_COMMAND_CIRCLE_FILLED, sizeof(*cmd)); in nk_fill_circle()
236 if (!cmd) return; in nk_fill_circle()
237 cmd->x = (short)r.x; in nk_fill_circle()
238 cmd->y = (short)r.y; in nk_fill_circle()
239 cmd->w = (unsigned short)NK_MAX(r.w, 0); in nk_fill_circle()
240 cmd->h = (unsigned short)NK_MAX(r.h, 0); in nk_fill_circle()
241 cmd->color = c; in nk_fill_circle()
247 struct nk_command_arc *cmd; in nk_stroke_arc() local
249 cmd = (struct nk_command_arc*) in nk_stroke_arc()
250 nk_command_buffer_push(b, NK_COMMAND_ARC, sizeof(*cmd)); in nk_stroke_arc()
251 if (!cmd) return; in nk_stroke_arc()
252 cmd->line_thickness = (unsigned short)line_thickness; in nk_stroke_arc()
253 cmd->cx = (short)cx; in nk_stroke_arc()
254 cmd->cy = (short)cy; in nk_stroke_arc()
255 cmd->r = (unsigned short)radius; in nk_stroke_arc()
256 cmd->a[0] = a_min; in nk_stroke_arc()
257 cmd->a[1] = a_max; in nk_stroke_arc()
258 cmd->color = c; in nk_stroke_arc()
264 struct nk_command_arc_filled *cmd; in nk_fill_arc() local
267 cmd = (struct nk_command_arc_filled*) in nk_fill_arc()
268 nk_command_buffer_push(b, NK_COMMAND_ARC_FILLED, sizeof(*cmd)); in nk_fill_arc()
269 if (!cmd) return; in nk_fill_arc()
270 cmd->cx = (short)cx; in nk_fill_arc()
271 cmd->cy = (short)cy; in nk_fill_arc()
272 cmd->r = (unsigned short)radius; in nk_fill_arc()
273 cmd->a[0] = a_min; in nk_fill_arc()
274 cmd->a[1] = a_max; in nk_fill_arc()
275 cmd->color = c; in nk_fill_arc()
281 struct nk_command_triangle *cmd; in nk_stroke_triangle() local
292 cmd = (struct nk_command_triangle*) in nk_stroke_triangle()
293 nk_command_buffer_push(b, NK_COMMAND_TRIANGLE, sizeof(*cmd)); in nk_stroke_triangle()
294 if (!cmd) return; in nk_stroke_triangle()
295 cmd->line_thickness = (unsigned short)line_thickness; in nk_stroke_triangle()
296 cmd->a.x = (short)x0; in nk_stroke_triangle()
297 cmd->a.y = (short)y0; in nk_stroke_triangle()
298 cmd->b.x = (short)x1; in nk_stroke_triangle()
299 cmd->b.y = (short)y1; in nk_stroke_triangle()
300 cmd->c.x = (short)x2; in nk_stroke_triangle()
301 cmd->c.y = (short)y2; in nk_stroke_triangle()
302 cmd->color = c; in nk_stroke_triangle()
308 struct nk_command_triangle_filled *cmd; in nk_fill_triangle() local
320 cmd = (struct nk_command_triangle_filled*) in nk_fill_triangle()
321 nk_command_buffer_push(b, NK_COMMAND_TRIANGLE_FILLED, sizeof(*cmd)); in nk_fill_triangle()
322 if (!cmd) return; in nk_fill_triangle()
323 cmd->a.x = (short)x0; in nk_fill_triangle()
324 cmd->a.y = (short)y0; in nk_fill_triangle()
325 cmd->b.x = (short)x1; in nk_fill_triangle()
326 cmd->b.y = (short)y1; in nk_fill_triangle()
327 cmd->c.x = (short)x2; in nk_fill_triangle()
328 cmd->c.y = (short)y2; in nk_fill_triangle()
329 cmd->color = c; in nk_fill_triangle()
337 struct nk_command_polygon *cmd; in nk_stroke_polygon() local
341 size = sizeof(*cmd) + sizeof(short) * 2 * (nk_size)point_count; in nk_stroke_polygon()
342 cmd = (struct nk_command_polygon*) nk_command_buffer_push(b, NK_COMMAND_POLYGON, size); in nk_stroke_polygon()
343 if (!cmd) return; in nk_stroke_polygon()
344 cmd->color = col; in nk_stroke_polygon()
345 cmd->line_thickness = (unsigned short)line_thickness; in nk_stroke_polygon()
346 cmd->point_count = (unsigned short)point_count; in nk_stroke_polygon()
348 cmd->points[i].x = (short)points[i*2]; in nk_stroke_polygon()
349 cmd->points[i].y = (short)points[i*2+1]; in nk_stroke_polygon()
358 struct nk_command_polygon_filled *cmd; in nk_fill_polygon() local
362 size = sizeof(*cmd) + sizeof(short) * 2 * (nk_size)point_count; in nk_fill_polygon()
363 cmd = (struct nk_command_polygon_filled*) in nk_fill_polygon()
365 if (!cmd) return; in nk_fill_polygon()
366 cmd->color = col; in nk_fill_polygon()
367 cmd->point_count = (unsigned short)point_count; in nk_fill_polygon()
369 cmd->points[i].x = (short)points[i*2+0]; in nk_fill_polygon()
370 cmd->points[i].y = (short)points[i*2+1]; in nk_fill_polygon()
379 struct nk_command_polyline *cmd; in nk_stroke_polyline() local
383 size = sizeof(*cmd) + sizeof(short) * 2 * (nk_size)point_count; in nk_stroke_polyline()
384 cmd = (struct nk_command_polyline*) nk_command_buffer_push(b, NK_COMMAND_POLYLINE, size); in nk_stroke_polyline()
385 if (!cmd) return; in nk_stroke_polyline()
386 cmd->color = col; in nk_stroke_polyline()
387 cmd->point_count = (unsigned short)point_count; in nk_stroke_polyline()
388 cmd->line_thickness = (unsigned short)line_thickness; in nk_stroke_polyline()
390 cmd->points[i].x = (short)points[i*2]; in nk_stroke_polyline()
391 cmd->points[i].y = (short)points[i*2+1]; in nk_stroke_polyline()
398 struct nk_command_image *cmd; in nk_draw_image() local
407 cmd = (struct nk_command_image*) in nk_draw_image()
408 nk_command_buffer_push(b, NK_COMMAND_IMAGE, sizeof(*cmd)); in nk_draw_image()
409 if (!cmd) return; in nk_draw_image()
410 cmd->x = (short)r.x; in nk_draw_image()
411 cmd->y = (short)r.y; in nk_draw_image()
412 cmd->w = (unsigned short)NK_MAX(0, r.w); in nk_draw_image()
413 cmd->h = (unsigned short)NK_MAX(0, r.h); in nk_draw_image()
414 cmd->img = *img; in nk_draw_image()
415 cmd->col = col; in nk_draw_image()
421 struct nk_command_custom *cmd; in nk_push_custom() local
430 cmd = (struct nk_command_custom*) in nk_push_custom()
431 nk_command_buffer_push(b, NK_COMMAND_CUSTOM, sizeof(*cmd)); in nk_push_custom()
432 if (!cmd) return; in nk_push_custom()
433 cmd->x = (short)r.x; in nk_push_custom()
434 cmd->y = (short)r.y; in nk_push_custom()
435 cmd->w = (unsigned short)NK_MAX(0, r.w); in nk_push_custom()
436 cmd->h = (unsigned short)NK_MAX(0, r.h); in nk_push_custom()
437 cmd->callback_data = usr; in nk_push_custom()
438 cmd->callback = cb; in nk_push_custom()
446 struct nk_command_text *cmd; in nk_draw_text() local
466 cmd = (struct nk_command_text*) in nk_draw_text()
467 nk_command_buffer_push(b, NK_COMMAND_TEXT, sizeof(*cmd) + (nk_size)(length + 1)); in nk_draw_text()
468 if (!cmd) return; in nk_draw_text()
469 cmd->x = (short)r.x; in nk_draw_text()
470 cmd->y = (short)r.y; in nk_draw_text()
471 cmd->w = (unsigned short)r.w; in nk_draw_text()
472 cmd->h = (unsigned short)r.h; in nk_draw_text()
473 cmd->background = bg; in nk_draw_text()
474 cmd->foreground = fg; in nk_draw_text()
475 cmd->font = font; in nk_draw_text()
476 cmd->length = length; in nk_draw_text()
477 cmd->height = font->height; in nk_draw_text()
478 NK_MEMCPY(cmd->string, string, (nk_size)length); in nk_draw_text()
479 cmd->string[length] = '\0'; in nk_draw_text()