]>
Dogcows Code - chaz/tint2/blob - src/util/area.h
1 /**************************************************************************
2 * Copyright (C) 2008 thierry lorthiois (lorthiois@bbsoft.fr)
4 * base class for all graphical objects (panel, taskbar, task, systray, clock, ...).
5 * Area is at the begining of each object (&object == &area).
7 * Area manage the background and border drawing, size and padding.
8 * Each Area have 2 Pixmap (pix and pix_active).
10 * Area manage the tree of all objects. Parent object drawn before child object.
11 * panel -> taskbars -> tasks
15 * draw_foreground(obj) and resize(obj) are virtual function.
17 **************************************************************************/
25 #include <cairo-xlib.h>
53 // absolute coordinate in panel
55 // width and height including border
60 // list of child : Area object
64 // need compute position and width
68 int use_active
, is_active
;
69 // paddingxlr = horizontal padding left/right
70 // paddingx = horizontal padding between childs
71 int paddingxlr
, paddingx
, paddingy
;
77 // each object can overwrite following function
78 void (*_draw_foreground
)(void *obj
, cairo_t
*c
, int active
);
79 void (*_resize
)(void *obj
);
80 void (*_add_child
)(void *obj
);
81 int (*_remove_child
)(void *obj
);
86 // draw background and foreground
87 void refresh (Area
*a
);
91 // set 'redraw' on an area and childs
92 void set_redraw (Area
*a
);
94 // draw pixmap and pixmap_active
95 void draw (Area
*a
, int active
);
96 void draw_background (Area
*a
, cairo_t
*c
, int active
);
98 void remove_area (Area
*a
);
99 void add_area (Area
*a
);
100 void free_area (Area
*a
);
102 // draw rounded rectangle
103 void draw_rect(cairo_t
*c
, double x
, double y
, double w
, double h
, double r
);
This page took 0.04127 seconds and 4 git commands to generate.