Files
gambling-curses/box.h

45 lines
639 B
C
Raw Normal View History

2025-10-17 13:41:37 +02:00
/*
* Copyright (C) Artsiom D.
* Copyright (C) shit-co.de
*/
2025-10-17 13:41:37 +02:00
#pragma once
2025-10-17 13:41:37 +02:00
#include "ui.h"
2025-10-17 13:41:37 +02:00
enum box_type {
BOX_VERTICAL,
BOX_HORIZONTAL,
BOX_BUTTON,
};
2025-10-17 13:41:37 +02:00
struct box {
enum box_type type;
enum ui_color color;
double fills;
union {
/* button */
struct {
char *name;
};
/* container boxes */
struct {
struct box **children;
size_t length;
};
};
};
2025-10-17 13:41:37 +02:00
struct box *new_button_box(char *name);
struct box *new_vertical_box(void);
struct box *new_horizontal_box(void);
void draw_box(struct box *, size_t x, size_t y, size_t width, size_t height);