Files
gambling-curses/box.h

55 lines
956 B
C

/*
* Copyright (C) Artsiom D.
* Copyright (C) shit-co.de
*/
#pragma once
#include "ui.h"
enum box_type {
BOX_VERTICAL,
BOX_HORIZONTAL,
BOX_CHART,
BOX_BUTTON,
};
struct box {
enum box_type type;
enum ui_color color;
double fills;
union {
/* button */
char *name;
/* chart and vertical/horizontal box */
struct {
/* chart and vertical/horizontal box */
size_t length;
union {
/* vertical/horizontal box */
struct box **children;
/* chart */
double *prices;
};
};
};
};
struct box *new_button_box(char *name);
struct box *new_vertical_box(void);
struct box *new_horizontal_box(void);
struct box *new_chart_box(void);
void append_box(struct box *parent, struct box *child);
void draw_box(struct box *, double x, double y, double width, double height);