#ifndef COMET_DRAW_H #define COMET_DRAW_H #include #include #include #include "window.h" typedef struct { double r, g, b, a; } Color; // The one who draws ('o')7 typedef struct { PangoFontDescription *desc; PangoContext *ctx; int height; int width; int left_pad; int right_pad; int top_pad; int sep; Color background; GList *layouts; // Calculated by draw_compute_layout GList *layout_end[3]; int layout_bx[3]; int layout_width[3]; } Drawer; typedef struct { struct Button *btn; int x, y; int width, height; int text_w, text_h; int x_pad, y_pad; int line_w; PangoLayout *pl; GList *children; } Layout; Drawer *draw_create(const char *font, int height, int left_pad, int right_pad, int top_pad); // TODO: Rework the api so that we don't need to pass the window void draw_compute_layout(Drawer *draw, Window *win, GList *btns); void draw_paint(Drawer *draw, Window *win); void draw_set_background(Drawer *draw, Color background); void draw_set_separator(Drawer *draw, int sep); void draw_destroy(Drawer *draw); #endif // vim: ts=4 sw=4 et