Adiciona tinyblocks-blueprint e libraries json/xml/csv; abrir/salvar/exportar projeto
- tinyblocks-blueprint: dona do estado de edicao (abas, pool de blocos, vinculos parent/prel/next/sub/args, blocos compostos e variaveis) e da serializacao. JSON nativo (to/from) usando a AST JSON do core e export JSON/XML/CSV. Testado com round-trip (test-blueprint). - tinyblocks-json: lexer + parser + emissor JSON independentes. - tinyblocks-xml: lexer + parser de XML -> AST JSON do core + emissor. - tinyblocks-csv: divisor de linhas/campos + parser/emissor sobre a AST JSON. - Editor: botoes Abrir / Salvar / Exportar JSON XML CSV no menu; converte Ed <-> TbBlueprint; barra de caminho com modo; .json pode ser arrastado. - Variaveis: tb_variables_clear e tb_variables_set_text. - Harness: teste de salvar/abrir projeto; tests/blueprint_test.c.
This commit is contained in:
1 parent
dc23b92d15
commit
1199d2d7c7
39 files changed
+3462
-24
No files matched your search
@@ -19,6 +19,10 @@ AP_DIR := $(LIBDIR)/tinyblocks-appearance
|
||||
PN_DIR := $(LIBDIR)/tinyblocks-pen
|
||||
FS_DIR := $(LIBDIR)/tinyblocks-fs
|
||||
TOML_DIR := $(LIBDIR)/tinyblocks-toml
|
||||
JSON_DIR := $(LIBDIR)/tinyblocks-json
|
||||
XML_DIR := $(LIBDIR)/tinyblocks-xml
|
||||
CSV_DIR := $(LIBDIR)/tinyblocks-csv
|
||||
BP_DIR := $(LIBDIR)/tinyblocks-blueprint
|
||||
ED_DIR := $(LIBDIR)/tinyblocks-editor
|
||||
GX_DIR := $(LIBDIR)/tinyblocks-graphics
|
||||
SD_DIR := $(LIBDIR)/tinyblocks-sdl2
|
||||
@@ -59,15 +63,20 @@ ED_A := $(ED_DIR)/build/libtinyblocks-editor.a
|
||||
GX_A := $(GX_DIR)/build/libtinyblocks-graphics.a
|
||||
SD_A := $(SD_DIR)/build/libtinyblocks-sdl2.a
|
||||
TOML_A := $(TOML_DIR)/build/libtinyblocks-toml.a
|
||||
JSON_A := $(JSON_DIR)/build/libtinyblocks-json.a
|
||||
XML_A := $(XML_DIR)/build/libtinyblocks-xml.a
|
||||
CSV_A := $(CSV_DIR)/build/libtinyblocks-csv.a
|
||||
BP_A := $(BP_DIR)/build/libtinyblocks-blueprint.a
|
||||
LIB_LDFLAGS := -L$(ED_DIR)/build -L$(GX_DIR)/build -L$(SD_DIR)/build \
|
||||
$(foreach l,$(CAT_LIBS),-L$(LIBDIR)/tinyblocks-$(l)/build) -L$(BUILD)
|
||||
|
||||
.PHONY: all help debug release static shared example sdl2 clean run python-lib mcp-lib json \
|
||||
editor run-editor run-sdl2 mylib vector customappearance graphics sdl2-backend test-editor \
|
||||
test-toml test-plugin \
|
||||
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-editor lib-graphics lib-sdl2 lib-python lib-mcp lib-toml
|
||||
lib-editor lib-graphics lib-sdl2 lib-python lib-mcp lib-toml \
|
||||
lib-json lib-xml lib-csv lib-blueprint
|
||||
|
||||
all: static example ## Compila a biblioteca estática e o exemplo hello (padrão)
|
||||
|
||||
@@ -130,6 +139,18 @@ lib-editor:
|
||||
lib-toml:
|
||||
$(MAKE) -C $(TOML_DIR)
|
||||
|
||||
lib-json:
|
||||
$(MAKE) -C $(JSON_DIR)
|
||||
|
||||
lib-xml:
|
||||
$(MAKE) -C $(XML_DIR)
|
||||
|
||||
lib-csv:
|
||||
$(MAKE) -C $(CSV_DIR)
|
||||
|
||||
lib-blueprint:
|
||||
$(MAKE) -C $(BP_DIR)
|
||||
|
||||
lib-graphics:
|
||||
$(MAKE) -C $(GX_DIR)
|
||||
|
||||
@@ -143,8 +164,9 @@ 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-editor
|
||||
@echo "Libraries OK: category + graphics + sdl2 + toml + editor"
|
||||
lib-appearance lib-pen lib-fs lib-graphics lib-sdl2 lib-toml \
|
||||
lib-json lib-xml lib-csv lib-blueprint lib-editor
|
||||
@echo "Libraries OK: category + graphics + sdl2 + toml + json + xml + csv + blueprint + editor"
|
||||
|
||||
category-libs: static $(foreach l,$(CAT_LIBS),lib-$(l)) ## Compila as libraries de categoria (.a/.so)
|
||||
@echo "Build category libs OK"
|
||||
@@ -180,8 +202,9 @@ $(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$(JSON_DIR)/include -I$(XML_DIR)/include -I$(CSV_DIR)/include -I$(BP_DIR)/include \
|
||||
$< -o $@ \
|
||||
-Wl,--start-group $(ED_A) $(GX_A) $(SD_A) $(TOML_A) $(CAT_A) $(LIB_A) -Wl,--end-group \
|
||||
-Wl,--start-group $(ED_A) $(GX_A) $(SD_A) $(TOML_A) $(JSON_A) $(XML_A) $(CSV_A) $(BP_A) $(CAT_A) $(LIB_A) -Wl,--end-group \
|
||||
$(SDL2_LIBS) $(SDL2TTF_LIBS) -ldl -lm -rdynamic \
|
||||
'-Wl,-rpath,$$ORIGIN'
|
||||
|
||||
@@ -251,10 +274,11 @@ $(BUILD)/editor_harness: tests/editor_harness.c $(SRCS) \
|
||||
$(GX_DIR)/src/tb_graphics.c
|
||||
@mkdir -p $(BUILD)
|
||||
$(CC) $(CFLAGS_DBG) \
|
||||
-I$(ED_DIR)/include -I$(EDITOR_SRC) -I$(GFX_INC) $(CAT_INCS) \
|
||||
-I$(ED_DIR)/include -I$(EDITOR_SRC) -I$(GFX_INC) $(CAT_INCS) -I$(BP_DIR)/include \
|
||||
$(SRCS) \
|
||||
$(EDITOR_SRC)/tb_editor.c $(EDITOR_SRC)/tb_stage_widget.c \
|
||||
$(GX_DIR)/src/tb_graphics.c \
|
||||
$(BP_DIR)/src/blueprint.c $(BP_DIR)/src/serialize.c \
|
||||
$(foreach l,$(CAT_LIBS),$(LIBDIR)/tinyblocks-$(l)/src/tb_$(l).c) \
|
||||
tests/editor_harness.c -o $@ -ldl -lm
|
||||
|
||||
@@ -271,6 +295,17 @@ $(BUILD)/toml_test: tests/toml_test.c $(TOML_LIB_SRCS) $(TOML_DIR)/include/ast.h
|
||||
test-toml: $(BUILD)/toml_test ## Roda o teste do parser TOML (ASan/UBSan)
|
||||
./$(BUILD)/toml_test
|
||||
|
||||
# -- Teste da blueprint (modelo + serializacao) ---
|
||||
BP_LIB_SRCS := $(BP_DIR)/src/blueprint.c $(BP_DIR)/src/serialize.c
|
||||
|
||||
$(BUILD)/blueprint_test: tests/blueprint_test.c $(BP_LIB_SRCS) static
|
||||
@mkdir -p $(BUILD)
|
||||
$(CC) $(CFLAGS_DBG) -I$(BP_DIR)/include $(BP_LIB_SRCS) tests/blueprint_test.c -o $@ \
|
||||
-Wl,--start-group $(LIB_A) -Wl,--end-group
|
||||
|
||||
test-blueprint: $(BUILD)/blueprint_test ## Roda o teste da blueprint (ASan/UBSan)
|
||||
./$(BUILD)/blueprint_test
|
||||
|
||||
# -- Teste de plugin .so standalone ---
|
||||
FS_SO := $(FS_DIR)/build/libtinyblocks-fs.so
|
||||
|
||||
@@ -286,7 +321,8 @@ test-plugin: $(BUILD)/plugin_test ## Carrega library-fs .so via dlopen e testa
|
||||
clean: ## Remove os diretórios build/ (raiz e libraries)
|
||||
$(RM) -r $(BUILD)
|
||||
@for d in $(EV_DIR) $(CT_DIR) $(OP_DIR) $(VR_DIR) $(AP_DIR) $(PN_DIR) $(FS_DIR) \
|
||||
$(TOML_DIR) $(ED_DIR) $(GX_DIR) $(SD_DIR) $(PY_DIR) $(MC_DIR); do \
|
||||
$(TOML_DIR) $(JSON_DIR) $(XML_DIR) $(CSV_DIR) $(BP_DIR) \
|
||||
$(ED_DIR) $(GX_DIR) $(SD_DIR) $(PY_DIR) $(MC_DIR); do \
|
||||
$(MAKE) -C $$d clean >/dev/null 2>&1 || true; \
|
||||
done
|
||||
$(RM) $(MC_DIR)/src/tb_mcp_py.h
|
||||
Reference in new issue
Block a user