Adiciona tinyblocks-vg e tinyblocks-svg (rasterizador + parser SVG) e specs no editor

This commit is contained in:
mguinhos committed 2026-10-20 21:13:53 -03:00
1 parent f4e2556110
commit 714186a1a1
12 files changed
+1272 -6

No files matched your search

+35 -6
View File
@@ -30,6 +30,8 @@ PPM_DIR := $(LIBDIR)/tinyblocks-ppm
BMP_DIR := $(LIBDIR)/tinyblocks-bmp
PNG_DIR := $(LIBDIR)/tinyblocks-png
IMG_DIR := $(LIBDIR)/tinyblocks-image
VG_DIR := $(LIBDIR)/tinyblocks-vg
SVG_DIR := $(LIBDIR)/tinyblocks-svg
API_DIR := $(LIBDIR)/tinyblocks-api
LIBM_DIR := $(LIBDIR)/tinyblocks-libman
ED_DIR := $(LIBDIR)/tinyblocks-editor
@@ -85,12 +87,12 @@ LIB_LDFLAGS := -L$(ED_DIR)/build -L$(GX_DIR)/build -L$(SD_DIR)/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 \
appdir appimage run-appimage icon \
test-toml test-plugin test-blueprint test-base64 test-curves test-ppm test-bmp test-png test-image \
test-toml test-plugin test-blueprint test-base64 test-curves test-ppm test-bmp test-png test-image test-vg test-svg \
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-base64 lib-curves lib-ppm lib-bmp lib-png lib-image lib-api lib-libman \
lib-json lib-xml lib-csv lib-blueprint lib-base64 lib-curves lib-ppm lib-bmp lib-png lib-image lib-vg lib-svg lib-api lib-libman \
test-libman test-environ
all: static example ## Compila a biblioteca estática e o exemplo hello (padrão)
@@ -184,6 +186,12 @@ lib-png:
lib-image:
$(MAKE) -C $(IMG_DIR)
lib-vg:
$(MAKE) -C $(VG_DIR)
lib-svg: lib-vg lib-base64
$(MAKE) -C $(SVG_DIR)
lib-api:
$(MAKE) -C $(API_DIR)
@@ -204,8 +212,8 @@ lib-mcp:
libs: static lib-events lib-control lib-operators lib-variables \
lib-appearance lib-pen lib-fs lib-environ lib-graphics lib-sdl2 lib-toml \
lib-json lib-xml lib-csv lib-blueprint lib-base64 lib-curves lib-ppm lib-bmp lib-png lib-image lib-api lib-libman lib-editor
@echo "Libraries OK: category + graphics + sdl2 + toml + json + xml + csv + blueprint + base64 + curves + ppm + bmp + png + image + api + libman + editor"
lib-json lib-xml lib-csv lib-blueprint lib-base64 lib-curves lib-ppm lib-bmp lib-png lib-image lib-vg lib-svg lib-api lib-libman lib-editor
@echo "Libraries OK: category + graphics + sdl2 + toml + json + xml + csv + blueprint + base64 + curves + ppm + bmp + png + image + vg + svg + api + libman + editor"
category-libs: static $(foreach l,$(CAT_LIBS),lib-$(l)) ## Compila as libraries de categoria (.a/.so)
@echo "Build category libs OK"
@@ -256,7 +264,7 @@ run-editor: editor ## Compila e abre o editor visual
# ── Empacotamento AppImage ──────────────────────────────────────────────
# Libraries com blocos (categoria) que vao empacotadas como extensoes.
APPIMAGE_LIBS := $(CAT_LIBS) toml json xml csv blueprint base64 curves ppm bmp png image
APPIMAGE_LIBS := $(CAT_LIBS) toml json xml csv blueprint base64 curves ppm bmp png image vg svg
APP_NAME := TinyBlocks
APP_VER := 0.1.0
@@ -512,6 +520,27 @@ $(BUILD)/image_test: tests/image_test.c $(IMG_DIR)/src/tb_imglib.c $(PPM_DIR)/sr
test-image: $(BUILD)/image_test ## Roda o teste da image (ASan/UBSan)
./$(BUILD)/image_test
# -- Teste da library vg (vetorial + rasterizador) ---
$(BUILD)/vg_test: tests/vg_test.c $(VG_DIR)/src/tb_vg.c static
@mkdir -p $(BUILD)
$(CC) $(CFLAGS_DBG) -I$(VG_DIR)/include $(VG_DIR)/src/tb_vg.c \
tests/vg_test.c -o $@ \
-Wl,--start-group $(LIB_A) -Wl,--end-group -lm
test-vg: $(BUILD)/vg_test ## Roda o teste da vg (ASan/UBSan)
./$(BUILD)/vg_test
# -- Teste da library svg (parser + rasterizacao via vg + base64) ---
$(BUILD)/svg_test: tests/svg_test.c $(SVG_DIR)/src/tb_svg.c $(VG_DIR)/src/tb_vg.c $(B64_DIR)/src/tb_base64.c static
@mkdir -p $(BUILD)
$(CC) $(CFLAGS_DBG) -I$(SVG_DIR)/include -I$(VG_DIR)/include -I$(B64_DIR)/include \
$(SVG_DIR)/src/tb_svg.c $(VG_DIR)/src/tb_vg.c $(B64_DIR)/src/tb_base64.c \
tests/svg_test.c -o $@ \
-Wl,--start-group $(LIB_A) -Wl,--end-group -lm
test-svg: $(BUILD)/svg_test ## Roda o teste da svg (ASan/UBSan)
./$(BUILD)/svg_test
# -- Teste de plugin .so standalone ---
FS_SO := $(FS_DIR)/build/libtinyblocks-fs.so
@@ -528,7 +557,7 @@ 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) $(JSON_DIR) $(XML_DIR) $(CSV_DIR) $(BP_DIR) \
$(B64_DIR) $(CV_DIR) $(PPM_DIR) $(BMP_DIR) $(PNG_DIR) $(IMG_DIR) \
$(B64_DIR) $(CV_DIR) $(PPM_DIR) $(BMP_DIR) $(PNG_DIR) $(IMG_DIR) $(VG_DIR) $(SVG_DIR) \
$(API_DIR) $(LIBM_DIR) \
$(ED_DIR) $(GX_DIR) $(SD_DIR) $(PY_DIR) $(MC_DIR); do \
$(MAKE) -C $$d clean >/dev/null 2>&1 || true; \