#ifndef THEME_H_
#define THEME_H_

/*
#define NK_INCLUDE_FIXED_TYPES
#define NK_INCLUDE_STANDARD_IO
#define NK_INCLUDE_STANDARD_VARARGS
#define NK_INCLUDE_DEFAULT_ALLOCATOR
#define NK_INCLUDE_VERTEX_BUFFER_OUTPUT
#define NK_INCLUDE_FONT_BAKING
#define NK_INCLUDE_DEFAULT_FONT
*/

#include "nuklear.h"

struct theme {
    struct nk_color base;
    struct nk_color foreground;
    struct nk_color background;
    struct nk_color menu_background;
    struct nk_color menu_unselected;
    struct nk_color selection;
    struct nk_color alternate;
    struct nk_color warning;
    struct nk_color error;
    struct nk_color offset;
    /* Toast */
    struct nk_color toast_bg;
    struct nk_color toast_border;
    struct nk_color toast_text;
    /* Modal overlay */
    struct nk_color modal_overlay;
    /* File browser */
    struct nk_color fb_file_color;
    struct nk_color fb_folder_color;
    /* Debugger */
    struct nk_color dbg_pc_highlight;
    /* Message icons */
    struct nk_color msg_warn_icon;
    struct nk_color msg_error_icon;
    /* Selection background */
    struct nk_color selection_bg;
    /* Tab bar */
    struct nk_color tab_indicator;
    /* Tab bar separator */
    struct nk_color tab_separator;
    /* Menu section title */
    struct nk_color menu_title;
    struct nk_font *font_icons;
    struct nk_font *font_normal;
    struct nk_font *font_small;
    struct nk_font *font_big;
    struct nk_font *font_atari;
    struct nk_rect selection_rect;
    struct nk_color all_colors[NK_COLOR_COUNT];
    int row_height;
    int menu_label_width;
    int menu_label_width_active;
    int select_label_width;
    int select_label_width_active;
    int menu_widget_min_width;
    int menu_widget_width_active;
    float font_scale;
    float columns[4];
    int row_height_eighth;              /* row_height / 8 */
    int row_height_half;                /* row_height / 2 */
    float row_height_1_5;               /* row_height * 1.5f */
    int row_height_double;              /* row_height * 2 */
    struct nk_color selection_active;   /* theme_get_active_color(selection) */
    struct nk_color selection_shifted;  /* theme_get_shifted_color(selection, 1) */
    struct nk_color fb_file_color_hover;
    struct nk_color fb_folder_color_hover;
    float last_font_height;             /* guard for early-out */
    int use_compact_menu;               /* 1 = hamburger mode (window too narrow for full tab bar) */
};

void theme_init(struct nk_context *ctx);
struct nk_color theme_get_active_color(struct nk_color col);
void theme_update_window_columns(int window_w);
void theme_calculate_selection_rect(struct nk_context *ctx);
void theme_update_dimensions(struct nk_context *ctx);
void theme_push_selected_button_color(struct nk_context *ctx);
void theme_pop_selected_button_color(struct nk_context *ctx);
struct nk_color theme_get_shifted_color(struct nk_color col, int shift);
struct nk_color theme_get_offset_color(struct nk_color base, int offset);

#endif
