123456789101112131415161718192021222324252627282930313233343536 |
- #include <allegro5/allegro_color.h>
- #include "zori.h"
- #include "zori_style.h"
- static struct zori_style * the_default_style = NULL;
- /** Initialize the global default style. */
- zori_id zori_initialize_default_style(void) {
- the_default_style = calloc(1, sizeof(*the_default_style));
- if (!the_default_style) return ZORI_ID_ENOMEM;
-
- the_default_style->text.font = al_create_builtin_font();
- the_default_style->text.color = al_color_name("white");
- the_default_style->text.font_flags= ALLEGRO_ALIGN_LEFT;
- the_default_style->border.color = al_color_name("white");
- the_default_style->back.color = al_color_name("green");
- the_default_style->fore.color = al_color_name("white");
- the_default_style->mark.color = al_color_name("lightgreen");
- the_default_style->hover.color = al_color_name("yellowgreen");
- return ZORI_ID_OK;
- }
- /** Returns the golbal default style */
- struct zori_style * zori_get_default_style() {
- return the_default_style;
- }
- /** Destroys the global default style. */
- void zori_destroy_default_style(void) {
- free(the_default_style);
- the_default_style = NULL;
- }
|