Converte símbolos Unicode decorativos dos comentários para ASCII
Substitui barras de caixa (─ ═ │ ┌ ┐ └ ┘ ├ ┤ ┬ ┴), travessões (—), setas (→ ←), reticências (…), bullets (•), multiplicação (×) e guillemets (› ‹) por equivalentes ASCII. Acentos portugueses são preservados.
This commit is contained in:
1 parent
1cc0ff9d02
commit
90d47bf8a0
36 files changed
+327
-327
No files matched your search
@@ -1,13 +1,13 @@
|
||||
/*
|
||||
* customappearance.c — Demonstração de on_draw (aparência personalizada de bloco).
|
||||
* customappearance.c - Demonstração de on_draw (aparência personalizada de bloco).
|
||||
*
|
||||
* Blocos:
|
||||
* Viz.ColorSwatch — inputs: r, g, b, a (0..1) → mostra quadrado colorido
|
||||
* Viz.Gauge — inputs: value (0..1), r, g, b → barra de progresso
|
||||
* Viz.Star — inputs: r, g, b, a → estrela de 5 pontas (contorno)
|
||||
* Viz.BarChart — inputs: a, b, c, d (reais) → mini gráfico de barras
|
||||
* Viz.ColorSwatch - inputs: r, g, b, a (0..1) -> mostra quadrado colorido
|
||||
* Viz.Gauge - inputs: value (0..1), r, g, b -> barra de progresso
|
||||
* Viz.Star - inputs: r, g, b, a -> estrela de 5 pontas (contorno)
|
||||
* Viz.BarChart - inputs: a, b, c, d (reais) -> mini gráfico de barras
|
||||
*
|
||||
* make customappearance → build/customappearance.so
|
||||
* make customappearance -> build/customappearance.so
|
||||
*/
|
||||
|
||||
#define _POSIX_C_SOURCE 200809L
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <tinyblocks/tinyblocks.h>
|
||||
#include <tinyblocks/tb_renderable_block.h>
|
||||
|
||||
/* ── Helpers ─────────────────────────────────────────────────────────────── */
|
||||
/* -- Helpers --- */
|
||||
static float gf(TinyBlocks_Block* self, TinyBlocks* rt, uint32_t idx) {
|
||||
TinyBlocks_Value v = tb_block_get_input(self, rt, idx);
|
||||
if (v.kind == TB_VALUE_REAL) return (float)v.as.real;
|
||||
@@ -32,9 +32,9 @@ static float out_f(TinyBlocks_Block* self, uint32_t idx) {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
/* ══════════════════════════════════════════════════════════════════════════
|
||||
/* ===
|
||||
* Viz.ColorSwatch
|
||||
* ══════════════════════════════════════════════════════════════════════════ */
|
||||
* === */
|
||||
static void eval_color_swatch(TinyBlocks_Block* self, TinyBlocks* rt) {
|
||||
for (uint32_t i = 0; i < 4 && i < self->output_count; i++)
|
||||
tb_block_set_output(self, i, tb_value_real((double)gf(self, rt, i)));
|
||||
@@ -76,9 +76,9 @@ static bool draw_color_swatch(TinyBlocks_Block* self, TinyBlocks* rt,
|
||||
return true;
|
||||
}
|
||||
|
||||
/* ══════════════════════════════════════════════════════════════════════════
|
||||
/* ===
|
||||
* Viz.Gauge
|
||||
* ══════════════════════════════════════════════════════════════════════════ */
|
||||
* === */
|
||||
static void eval_gauge(TinyBlocks_Block* self, TinyBlocks* rt) {
|
||||
for (uint32_t i = 0; i < 4 && i < self->output_count; i++)
|
||||
tb_block_set_output(self, i, tb_value_real((double)gf(self, rt, i)));
|
||||
@@ -116,9 +116,9 @@ static bool draw_gauge(TinyBlocks_Block* self, TinyBlocks* rt,
|
||||
return true;
|
||||
}
|
||||
|
||||
/* ══════════════════════════════════════════════════════════════════════════
|
||||
/* ===
|
||||
* Viz.Star
|
||||
* ══════════════════════════════════════════════════════════════════════════ */
|
||||
* === */
|
||||
static void eval_star(TinyBlocks_Block* self, TinyBlocks* rt) {
|
||||
for (uint32_t i = 0; i < 4 && i < self->output_count; i++)
|
||||
tb_block_set_output(self, i, tb_value_real((double)gf(self, rt, i)));
|
||||
@@ -166,9 +166,9 @@ static bool draw_star(TinyBlocks_Block* self, TinyBlocks* rt,
|
||||
return true;
|
||||
}
|
||||
|
||||
/* ══════════════════════════════════════════════════════════════════════════
|
||||
/* ===
|
||||
* Viz.BarChart
|
||||
* ══════════════════════════════════════════════════════════════════════════ */
|
||||
* === */
|
||||
static void eval_barchart(TinyBlocks_Block* self, TinyBlocks* rt) {
|
||||
for (uint32_t i = 0; i < 4 && i < self->output_count; i++)
|
||||
tb_block_set_output(self, i, tb_value_real((double)gf(self, rt, i)));
|
||||
@@ -218,9 +218,9 @@ static bool draw_barchart(TinyBlocks_Block* self, TinyBlocks* rt,
|
||||
return true;
|
||||
}
|
||||
|
||||
/* ══════════════════════════════════════════════════════════════════════════
|
||||
/* ===
|
||||
* Descritores de slots
|
||||
* ══════════════════════════════════════════════════════════════════════════ */
|
||||
* === */
|
||||
static const TinyBlocks_SlotDesc rgba_in[] = {
|
||||
{"r", TB_VALUE_REAL}, {"g", TB_VALUE_REAL},
|
||||
{"b", TB_VALUE_REAL}, {"a", TB_VALUE_REAL}
|
||||
@@ -246,9 +246,9 @@ static const TinyBlocks_SlotDesc chart_out[] = {
|
||||
{"c", TB_VALUE_REAL}, {"d", TB_VALUE_REAL}
|
||||
};
|
||||
|
||||
/* ══════════════════════════════════════════════════════════════════════════
|
||||
/* ===
|
||||
* Registro
|
||||
* ══════════════════════════════════════════════════════════════════════════ */
|
||||
* === */
|
||||
static bool ca_init(TinyBlocks* rt, TinyBlocks_LibraryBlock* lib) {
|
||||
TinyBlocks_TypeBlock* t;
|
||||
|
||||
|
||||
Reference in new issue
Block a user