36 lines
1.3 KiB
C
36 lines
1.3 KiB
C
/* Contexto de la aplicación: dueño de la configuración, rutas de usuario,
|
|
* bus de eventos y portapapeles de fotogramas.
|
|
* Orden de destrucción: destruye primero todos los tgb_document y
|
|
* gestores (recuperación, extensiones) y al final el contexto. */
|
|
#ifndef TAHGIBU_CONTEXT_H
|
|
#define TAHGIBU_CONTEXT_H
|
|
|
|
#include "tahgibu/error.h"
|
|
#include "tahgibu/events.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef struct tgb_context_config {
|
|
/* NULL = ubicación estándar del sistema (ver docs/ARCHITECTURE.md). */
|
|
const char *config_dir; /* configuración y registro de extensiones */
|
|
const char *data_dir; /* datos del usuario (extensiones instaladas, paletas) */
|
|
const char *cache_dir; /* caché y temporales de historial */
|
|
const char *state_dir; /* registros y archivos de recuperación */
|
|
} tgb_context_config;
|
|
|
|
/* config puede ser NULL. Crea las carpetas si no existen. */
|
|
tgb_status tgb_context_create(const tgb_context_config *config, tgb_context **out);
|
|
void tgb_context_destroy(tgb_context *ctx); /* acepta NULL */
|
|
|
|
const char *tgb_context_config_dir(const tgb_context *ctx);
|
|
const char *tgb_context_data_dir(const tgb_context *ctx);
|
|
const char *tgb_context_cache_dir(const tgb_context *ctx);
|
|
const char *tgb_context_state_dir(const tgb_context *ctx);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif
|