|
|
452870 |
#ifndef GRAPH_H
|
|
|
452870 |
#define GRAPH_H
|
|
|
452870 |
|
|
|
452870 |
|
|
|
452870 |
#include "common.h"
|
|
|
452870 |
|
|
|
452870 |
|
|
|
d3e9d7 |
#define TL_MAXLEN 32
|
|
|
061fcf |
|
|
|
061fcf |
|
|
|
452870 |
typedef enum {
|
|
|
452870 |
GS_WINDOW,
|
|
|
452870 |
GS_BUTTON_INACTIVE,
|
|
|
452870 |
GS_BUTTON_ACTIVE,
|
|
|
452870 |
GS_TEXT_INACTIVE,
|
|
|
452870 |
GS_TEXT_ACTIVE } GraphStyle;
|
|
|
452870 |
enum {
|
|
|
452870 |
GS_COUNT = GS_TEXT_ACTIVE + 1 };
|
|
|
452870 |
|
|
|
452870 |
|
|
|
452870 |
typedef struct Graph {
|
|
|
452870 |
App *app;
|
|
|
452870 |
xcb_colormap_t cm;
|
|
|
63daec |
xcb_font_t font;
|
|
|
452870 |
xcb_gcontext_t gc[GS_COUNT];
|
|
|
452870 |
} Graph;
|
|
|
452870 |
|
|
|
452870 |
|
|
|
452870 |
typedef struct TextLayout {
|
|
|
452870 |
Graph *g;
|
|
|
061fcf |
int x, y, len;
|
|
|
061fcf |
xcb_char2b_t text[TL_MAXLEN];
|
|
|
452870 |
} TextLayout;
|
|
|
452870 |
|
|
|
452870 |
|
|
|
452870 |
|
|
|
452870 |
|
|
|
452870 |
int graphInit(Graph *g, App *app);
|
|
|
452870 |
void graphDeinit(Graph *g);
|
|
|
452870 |
void graphResize(Graph *g);
|
|
|
452870 |
void graphDrawBackgound(Graph *g, int x, int y, int w, int h);
|
|
|
452870 |
void graphDrawButton(Graph *g, int x, int y, int w, int h, int active);
|
|
|
452870 |
|
|
|
843e7a |
void textLayoutInit(TextLayout *tl, Graph *g, const char *text);
|
|
|
452870 |
void textLayoutDeinit(TextLayout *tl);
|
|
|
843e7a |
void textLayoutDraw(TextLayout *tl, int x, int y, int active);
|
|
|
452870 |
|
|
|
452870 |
|
|
|
452870 |
#endif
|