#include #include #include #include #include "../src/ax.h" #include "../src/ctxt.h" #include "../src/backend.h" struct ax_ctxt* ax = NULL; static void cleanup() { ax_free(ax); ax = NULL; } static void sigint_handler(int signum) { printf("\nCaught interrupt.\n"); // cleanup(); exit(0); } static struct ax_theme* make_example_theme() { ax_begin_theme(ax); ax_set_theme_color(ax, "primary", 0x00ff00); ax_set_theme_font(ax, "default", "/usr/share/fonts/TTF/DejaVuSans.ttf", 0); ax_set_theme_font(ax, "h1", NULL, 95); return ax_end_theme(ax); } int main(void) { signal(SIGINT, sigint_handler); ax = ax_new(); ax_set_logger(ax, 0, false); struct ax_theme* thm = make_example_theme(); ax_theme_wait_until_loaded(ax, thm); printf("it loaded!\n"); usleep(1000 * 1000 * 2); /* struct ax_evt evt; for (;;) { ax_wait_evt_avail(ax); while (ax_poll_evt(ax, &evt)) { if (evt.ty == AX_EVT_THEME_LOADED && evt.arg.theme == thm) { printf("The font finished loading!\n"); } } } */ cleanup(); return 0; }