- tinyblocks-editor agora e um bundle: libraries privadas em
libraries/tinyblocks-editor-{widgets,image} (.a + .so), com library.toml
(bundle = tinyblocks-editor, private = true -> nao aparecem no libman).
- O editor carrega os modulos por dlopen via tinyblocks-api e chama tudo por
tabelas de ponteiros (tb_ed_w, tb_ed_img): da para recompilar so a parte que
mudou e o editor recarrega ao vivo (make ed-modules), sem reiniciar.
- tinyblocks-api ganhou modulos de codigo (tb_api_code_*) e watcher de
arquivos (inotify, com mtime como reserva).
- libman: entradas com bundle/private nao sao listadas como extensao.
- Aba de imagem: layout estilo Krita - ferramentas na esquerda, tela no meio,
roda de cores + paleta + camadas na coluna da direita; miniatura por camada
(como as fantasias do Scratch); rodape enxuto (Desfazer/Limpar/zoom).
- Ferramenta selecionar (mover/redimensionar/excluir pixels) e consertada a
geometria da folha (doc = area de desenho, zoom puro).
- Makefile: alvo ed-modules; AppImage empacota os .so do bundle.
- harness: testes de imagem atualizados + testes de cores na lateral.
79 lines
2.9 KiB
C
79 lines
2.9 KiB
C
/*
|
|
* TinyBlocks - tb_libman.h
|
|
* Library tinyblocks-libman: gestor/buscador de libraries.
|
|
*
|
|
* Varre diretorios em busca de arquivos "library.toml", le os metadados
|
|
* (usando tinyblocks-toml) e resolve os caminhos dos .so/.a. Sabe tambem
|
|
* se uma library ja esta carregada, consultando tinyblocks-api.
|
|
*
|
|
* NAO desenha UI: o editor e quem desenha a tela de escolha de extensao.
|
|
*/
|
|
#ifndef TINYBLOCKS_LIBMAN_H
|
|
#define TINYBLOCKS_LIBMAN_H
|
|
|
|
#include <stdbool.h>
|
|
#include <tinyblocks/tinyblocks.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#define TBLM_MAX_ENTRIES 128
|
|
#define TBLM_NAME_LEN 64
|
|
#define TBLM_DESC_LEN 200
|
|
#define TBLM_PATH_LEN 512
|
|
|
|
typedef struct TbLibmanEntry {
|
|
char name[TBLM_NAME_LEN];
|
|
char version[24];
|
|
char category[48];
|
|
char description[TBLM_DESC_LEN];
|
|
unsigned char color[4];
|
|
unsigned char dark[4];
|
|
char toml[TBLM_PATH_LEN]; /* caminho do library.toml */
|
|
char dir[TBLM_PATH_LEN]; /* diretorio da library */
|
|
char shared[TBLM_PATH_LEN]; /* caminho do .so (pode nao existir) */
|
|
char staticlib[TBLM_PATH_LEN]; /* caminho do .a */
|
|
char depends[160];
|
|
char bundle[48]; /* grupo (ex: "tinyblocks-editor") */
|
|
bool private_lib; /* library interna do bundle (nao listar)*/
|
|
} TbLibmanEntry;
|
|
|
|
/* -- Ciclo de vida --- */
|
|
TB_API bool tb_libman_init(TinyBlocks* rt); /* liga ao tinyblocks-api */
|
|
TB_API void tb_libman_shutdown(void);
|
|
TB_API const char* tb_libman_last_error(void);
|
|
|
|
/* -- Varredura --- */
|
|
TB_API void tb_libman_clear(void);
|
|
/* Varre 'root' recursivamente (ate max_depth niveis) procurando library.toml. */
|
|
TB_API int tb_libman_scan(const char* root, int max_depth);
|
|
/* Varre os diretorios padrao: "libraries", "./libraries" e
|
|
* "$HOME/.tinyblocks/libraries". */
|
|
TB_API int tb_libman_scan_defaults(void);
|
|
|
|
TB_API int tb_libman_count(void);
|
|
TB_API const TbLibmanEntry* tb_libman_entry(int i);
|
|
|
|
/* -- Estado / instalacao (via tinyblocks-api) --- */
|
|
TB_API bool tb_libman_loaded(int i);
|
|
TB_API int tb_libman_install(int i); /* tb_api_load(entry->shared) */
|
|
|
|
/* -- Filtros --- */
|
|
/* Preenche out[] com os indices cujo nome/categoria/descricao contem 'query'
|
|
* (case-insensitive) e cuja categoria casa com 'category' (NULL ou "" = todas).
|
|
* Retorna quantos indices foram escritos (ate 'max'). */
|
|
TB_API int tb_libman_search(const char* query, const char* category,
|
|
int* out, int max);
|
|
/* Igual, mas permite incluir as libraries privadas de bundle (private=true). */
|
|
TB_API int tb_libman_search_ex(const char* query, const char* category,
|
|
bool include_private, int* out, int max);
|
|
/* Categorias distintas encontradas (sem repeticao). Retorna n. */
|
|
TB_API int tb_libman_categories(char out[][48], int max);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* TINYBLOCKS_LIBMAN_H */
|