Lines Matching defs:slot

5280     int slot;
24069 /* add first slot into chart */
24070 {struct nk_chart_slot *slot = &chart->slots[chart->slot++];
24071 slot->type = type;
24072 slot->count = count;
24073 slot->color = color;
24074 slot->highlight = highlight;
24075 slot->min = NK_MIN(min_value, max_value);
24076 slot->max = NK_MAX(min_value, max_value);
24077 slot->range = slot->max - slot->min;}
24105 NK_ASSERT(ctx->current->layout->chart.slot < NK_CHART_MAX_SLOT);
24107 if (ctx->current->layout->chart.slot >= NK_CHART_MAX_SLOT) return;
24109 /* add another slot into the graph */
24111 struct nk_chart_slot *slot = &chart->slots[chart->slot++];
24112 slot->type = type;
24113 slot->count = count;
24114 slot->color = color;
24115 slot->highlight = highlight;
24116 slot->min = NK_MIN(min_value, max_value);
24117 slot->max = NK_MAX(min_value, max_value);
24118 slot->range = slot->max - slot->min;}
24129 struct nk_chart *g, float value, int slot)
24143 NK_ASSERT(slot >= 0 && slot < NK_CHART_MAX_SLOT);
24144 step = g->w / (float)g->slots[slot].count;
24145 range = g->slots[slot].max - g->slots[slot].min;
24146 ratio = (value - g->slots[slot].min) / range;
24148 if (g->slots[slot].index == 0) {
24150 g->slots[slot].last.x = g->x;
24151 g->slots[slot].last.y = (g->y + g->h) - ratio * (float)g->h;
24153 bounds.x = g->slots[slot].last.x - 2;
24154 bounds.y = g->slots[slot].last.y - 2;
24157 color = g->slots[slot].color;
24159 NK_INBOX(i->mouse.pos.x,i->mouse.pos.y, g->slots[slot].last.x-3, g->slots[slot].last.y-3, 6, 6)){
24163 color = g->slots[slot].highlight;
24166 g->slots[slot].index += 1;
24171 color = g->slots[slot].color;
24172 cur.x = g->x + (float)(step * (float)g->slots[slot].index);
24174 nk_stroke_line(out, g->slots[slot].last.x, g->slots[slot].last.y, cur.x, cur.y, 1.0f, color);
24186 color = g->slots[slot].highlight;
24192 g->slots[slot].last.x = cur.x;
24193 g->slots[slot].last.y = cur.y;
24194 g->slots[slot].index += 1;
24199 struct nk_chart *chart, float value, int slot)
24210 NK_ASSERT(slot >= 0 && slot < NK_CHART_MAX_SLOT);
24211 if (chart->slots[slot].index >= chart->slots[slot].count)
24213 if (chart->slots[slot].count) {
24214 float padding = (float)(chart->slots[slot].count-1);
24215 item.w = (chart->w - padding) / (float)(chart->slots[slot].count);
24219 color = chart->slots[slot].color;;
24220 item.h = chart->h * NK_ABS((value/chart->slots[slot].range));
24222 ratio = (value + NK_ABS(chart->slots[slot].min)) / NK_ABS(chart->slots[slot].range);
24225 ratio = (value - chart->slots[slot].max) / chart->slots[slot].range;
24228 item.x = chart->x + ((float)chart->slots[slot].index * item.w);
24229 item.x = item.x + ((float)chart->slots[slot].index);
24237 color = chart->slots[slot].highlight;
24240 chart->slots[slot].index += 1;
24244 nk_chart_push_slot(struct nk_context *ctx, float value, int slot)
24251 NK_ASSERT(slot >= 0 && slot < NK_CHART_MAX_SLOT);
24252 NK_ASSERT(slot < ctx->current->layout->chart.slot);
24253 if (!ctx || !ctx->current || slot >= NK_CHART_MAX_SLOT) return nk_false;
24254 if (slot >= ctx->current->layout->chart.slot) return nk_false;
24257 if (win->layout->chart.slot < slot) return nk_false;
24258 switch (win->layout->chart.slots[slot].type) {
24260 flags = nk_chart_push_line(ctx, win, &win->layout->chart, value, slot); break;
24262 flags = nk_chart_push_column(ctx, win, &win->layout->chart, value, slot); break;