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,5 +1,5 @@
|
||||
/*
|
||||
* TinyBlocks — tb_graphics.c
|
||||
* TinyBlocks - tb_graphics.c
|
||||
* Interface gráfica: escolha de backend, janelas, entrada e loop principal.
|
||||
*/
|
||||
#define _POSIX_C_SOURCE 200809L
|
||||
@@ -15,9 +15,9 @@
|
||||
#include <tb_sdl2.h>
|
||||
#endif
|
||||
|
||||
/* ══════════════════════════════════════════════════════════════════════════
|
||||
/* ===
|
||||
* Backend nulo (headless): janelas sem tela, entrada vazia, texto estimado
|
||||
* ══════════════════════════════════════════════════════════════════════════ */
|
||||
* === */
|
||||
typedef struct { int w, h; } NullWin;
|
||||
|
||||
static bool null_init(void) { return true; }
|
||||
@@ -52,9 +52,9 @@ static const TinyBlocks_GraphicsBackend s_null_backend = {
|
||||
|
||||
const TinyBlocks_GraphicsBackend* tb_graphics_null_backend(void) { return &s_null_backend; }
|
||||
|
||||
/* ══════════════════════════════════════════════════════════════════════════
|
||||
/* ===
|
||||
* Escolha do backend
|
||||
* ══════════════════════════════════════════════════════════════════════════ */
|
||||
* === */
|
||||
static const TinyBlocks_GraphicsBackend* s_backend = NULL;
|
||||
static bool s_backend_ready = false;
|
||||
static void* s_backend_dl = NULL;
|
||||
@@ -120,11 +120,11 @@ bool tb_graphics_load_backend(const char* so_path) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/* ══════════════════════════════════════════════════════════════════════════
|
||||
/* ===
|
||||
* Medição de texto
|
||||
* ══════════════════════════════════════════════════════════════════════════ */
|
||||
* === */
|
||||
|
||||
/* Larguras de avanço da DejaVu Sans, em em, para ASCII 32..126 — estimativa
|
||||
/* Larguras de avanço da DejaVu Sans, em em, para ASCII 32..126 - estimativa
|
||||
* usada quando o backend não sabe medir (ex: backend nulo). */
|
||||
static const float s_adv[95] = {
|
||||
.318f,.401f,.460f,.838f,.636f,.950f,.780f,.275f,.390f,.390f,.500f,.838f,.318f,.361f,.318f,.337f,
|
||||
@@ -150,9 +150,9 @@ float tb_graphics_measure_text(const char* text, float font_size) {
|
||||
return b->measure_text ? b->measure_text(text, font_size) : estimate_text(text, font_size);
|
||||
}
|
||||
|
||||
/* ══════════════════════════════════════════════════════════════════════════
|
||||
* Graphics.Input — estado de entrada de uma janela no frame
|
||||
* ══════════════════════════════════════════════════════════════════════════ */
|
||||
/* ===
|
||||
* Graphics.Input - estado de entrada de uma janela no frame
|
||||
* === */
|
||||
static const TinyBlocks_SlotDesc s_input_outs[GFX_IN_COUNT] = {
|
||||
{"mouse_x", TB_VALUE_REAL}, {"mouse_y", TB_VALUE_REAL},
|
||||
{"l_held", TB_VALUE_INTEGER}, {"r_held", TB_VALUE_INTEGER},
|
||||
@@ -206,12 +206,12 @@ static void input_push(TinyBlocks_Block* b, const TinyBlocks_GfxInput* in) {
|
||||
b->dirty = false;
|
||||
}
|
||||
|
||||
/* ══════════════════════════════════════════════════════════════════════════
|
||||
* Graphics.Window — uma janela do SO mostrando uma cena
|
||||
/* ===
|
||||
* Graphics.Window - uma janela do SO mostrando uma cena
|
||||
* inputs: 0 título, 1 largura, 2 altura, 3 cena(block), 4 entrada(block),
|
||||
* 5 principal(int: fechar esta janela encerra o loop; padrão 1)
|
||||
* output: 0 aberta(int)
|
||||
* ══════════════════════════════════════════════════════════════════════════ */
|
||||
* === */
|
||||
typedef struct { void* handle; uint64_t id; bool open; } WinState;
|
||||
|
||||
static int win_find(uint64_t id) {
|
||||
@@ -275,9 +275,9 @@ bool tb_graphics_window_is_open(TinyBlocks_Block* window) {
|
||||
return ((WinState*)window->userdata)->open;
|
||||
}
|
||||
|
||||
/* ══════════════════════════════════════════════════════════════════════════
|
||||
/* ===
|
||||
* Loop principal
|
||||
* ══════════════════════════════════════════════════════════════════════════ */
|
||||
* === */
|
||||
static void default_wait(void) {
|
||||
struct timespec ts = { 0, 16 * 1000000L };
|
||||
nanosleep(&ts, NULL);
|
||||
@@ -340,9 +340,9 @@ static void eval_run(TinyBlocks_Block* self, TinyBlocks* rt) {
|
||||
tb_graphics_run(rt);
|
||||
}
|
||||
|
||||
/* ══════════════════════════════════════════════════════════════════════════
|
||||
/* ===
|
||||
* Registro da library
|
||||
* ══════════════════════════════════════════════════════════════════════════ */
|
||||
* === */
|
||||
static bool graphics_lib_init(TinyBlocks* rt, TinyBlocks_LibraryBlock* lib) {
|
||||
TinyBlocks_TypeBlock* t;
|
||||
|
||||
|
||||
Reference in new issue
Block a user