Adiciona tinyblocks-environ e tela de Configuracoes (salvar/exportar CSV)

tinyblocks-environ (categoria "Ambiente"):
- blocos Environ.Get/Set/Has/Unset (store chave->valor; Get cai no getenv).
- API C enumeravel (count/key/value_at/get/has/set/unset) e
  tb_environ_export_csv(path) com escape de CSV; tb_environ_reset.
- library.toml com metadados; Makefile proprio (.a/.so).

Editor:
- biblioteca de settings no store da environ, com valores iniciais
  (autor, projeto, tema, escala, autosave).
- tela "Configurações" (botao Config no menu): lista as chaves, edita o
  valor da linha (Enter confirma, Esc cancela), "+ Nova" cria chave,
  Delete remove, campo de caminho + botoes "Salvar" e "Exportar CSV".
- Ctrl/scroll e foco de texto integrados ao mesmo fluxo do libman.

Build/testes:
- environ entra em CAT_LIBS (compila no editor, no harness e no libman).
- make test-environ (store, fallback getenv, escape CSV, blocos).
- harness: passo 18 cobre abrir Configuracoes, editar valor, salvar CSV
  e verificar o conteudo; Esc fecha.
This commit is contained in:
mguinhos committed 2026-10-20 20:36:14 -03:00
1 parent 3120d2d797
commit b29908e65b
9 files changed
+714 -7

No files matched your search

+17 -5
View File
@@ -18,6 +18,7 @@ VR_DIR := $(LIBDIR)/tinyblocks-variables
AP_DIR := $(LIBDIR)/tinyblocks-appearance
PN_DIR := $(LIBDIR)/tinyblocks-pen
FS_DIR := $(LIBDIR)/tinyblocks-fs
EN_DIR := $(LIBDIR)/tinyblocks-environ
TOML_DIR := $(LIBDIR)/tinyblocks-toml
JSON_DIR := $(LIBDIR)/tinyblocks-json
XML_DIR := $(LIBDIR)/tinyblocks-xml
@@ -57,7 +58,7 @@ SRCS := src/tinyblocks.c \
OBJS := $(patsubst src/%.c,$(BUILD)/%.o,$(SRCS))
OBJS_DBG := $(patsubst src/%.c,$(BUILD)/%-dbg.o,$(SRCS))
CAT_LIBS := events control operators variables appearance pen fs
CAT_LIBS := events control operators variables appearance pen fs environ
CAT_A := $(foreach l,$(CAT_LIBS),$(LIBDIR)/tinyblocks-$(l)/build/libtinyblocks-$(l).a)
CAT_LDFLAGS := $(foreach l,$(CAT_LIBS),-ltinyblocks-$(l))
CAT_INCS := $(foreach l,$(CAT_LIBS),-I$(LIBDIR)/tinyblocks-$(l)/include)
@@ -79,9 +80,10 @@ LIB_LDFLAGS := -L$(ED_DIR)/build -L$(GX_DIR)/build -L$(SD_DIR)/build \
test-toml test-plugin test-blueprint \
category-libs category-sos libs \
lib-events lib-control lib-operators lib-variables lib-appearance lib-pen lib-fs \
lib-environ \
lib-editor lib-graphics lib-sdl2 lib-python lib-mcp lib-toml \
lib-json lib-xml lib-csv lib-blueprint lib-api lib-libman \
test-libman
test-libman test-environ
all: static example ## Compila a biblioteca estática e o exemplo hello (padrão)
@@ -175,7 +177,7 @@ lib-mcp:
$(MAKE) -C $(MC_DIR)
libs: static lib-events lib-control lib-operators lib-variables \
lib-appearance lib-pen lib-fs lib-graphics lib-sdl2 lib-toml \
lib-appearance lib-pen lib-fs lib-environ lib-graphics lib-sdl2 lib-toml \
lib-json lib-xml lib-csv lib-blueprint lib-api lib-libman lib-editor
@echo "Libraries OK: category + graphics + sdl2 + toml + json + xml + csv + blueprint + api + libman + editor"
@@ -212,7 +214,7 @@ EDITOR_HDRS := $(EDITOR_SRC)/tb_stage_widget.h $(ED_DIR)/include/tb_editor.h $(G
$(BUILD)/editor: examples/editor/main.c static libs
$(CC) $(CFLAGS_REL) \
-I$(ED_DIR)/include -I$(GFX_INC) $(CAT_INCS) \
-I$(FS_DIR)/include -I$(TOML_DIR)/include \
-I$(FS_DIR)/include -I$(EN_DIR)/include -I$(TOML_DIR)/include \
-I$(JSON_DIR)/include -I$(XML_DIR)/include -I$(CSV_DIR)/include -I$(BP_DIR)/include \
-I$(API_DIR)/include -I$(LIBM_DIR)/include \
$< -o $@ \
@@ -287,7 +289,7 @@ $(BUILD)/editor_harness: tests/editor_harness.c $(SRCS) \
@mkdir -p $(BUILD)
$(CC) $(CFLAGS_DBG) \
-I$(ED_DIR)/include -I$(EDITOR_SRC) -I$(GFX_INC) $(CAT_INCS) -I$(BP_DIR)/include \
-I$(API_DIR)/include -I$(LIBM_DIR)/include -I$(TOML_DIR)/include \
-I$(API_DIR)/include -I$(LIBM_DIR)/include -I$(EN_DIR)/include -I$(TOML_DIR)/include \
$(SRCS) \
$(EDITOR_SRC)/tb_editor.c $(EDITOR_SRC)/tb_stage_widget.c \
$(GX_DIR)/src/tb_graphics.c \
@@ -338,6 +340,16 @@ $(BUILD)/libman_test: tests/libman_test.c \
test-libman: $(BUILD)/libman_test ## Roda o teste do libman/api (ASan/UBSan)
./$(BUILD)/libman_test
# -- Teste da library environ (store + blocos + CSV) ---
$(BUILD)/environ_test: tests/environ_test.c $(EN_DIR)/src/tb_environ.c static
@mkdir -p $(BUILD)
$(CC) $(CFLAGS_DBG) -I$(EN_DIR)/include $(EN_DIR)/src/tb_environ.c \
tests/environ_test.c -o $@ \
-Wl,--start-group $(LIB_A) -Wl,--end-group
test-environ: $(BUILD)/environ_test ## Roda o teste da environ (ASan/UBSan)
./$(BUILD)/environ_test
# -- Teste de plugin .so standalone ---
FS_SO := $(FS_DIR)/build/libtinyblocks-fs.so