/* * Copyright (C) 2018-2019 - Vito Caputo - * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3 as published * by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef _STAGE_H #define _STAGE_H #define STAGE_NAME_MAX 16 #define STAGE_LAYERS_MAX 10 typedef struct stage_t stage_t; typedef void (stage_render_func_t)(const stage_t *stage, void *object, float alpha, void *render_ctxt); typedef void (stage_free_func_t)(const stage_t *stage, void *object); typedef stage_t * (stage_lookup_func_t)(const stage_t *stage, void *object, void *key); stage_t * stage_new(stage_t *parent, int layer, const char *name, void *object, stage_render_func_t *render_func, stage_free_func_t *free_func, stage_lookup_func_t *lookup_func); void stage_replace(stage_t *stage, const char *name, void *object, stage_render_func_t *render_func, stage_free_func_t *free_func, stage_lookup_func_t *lookup_func); stage_t * stage_free(stage_t *stage); void stage_render(const stage_t *stage, void *render_ctxt); void stage_clear(stage_t *stage); void stage_set_object(stage_t *stage, void *object); void * stage_get_object(const stage_t *stage); void stage_set_alpha(stage_t *stage, float alpha); float stage_get_alpha(const stage_t *stage); void stage_set_active(stage_t *stage, int active); int stage_get_active(const stage_t *stage); void stage_set_locked(stage_t *stage, int locked); int stage_get_locked(const stage_t *stage); void stage_set_layer(stage_t *stage, int layer); stage_t * stage_lookup_name(stage_t *stage, const char *name); stage_t * stage_lookup_key(stage_t *stage, void *key); #endif