]>
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 also manage the tree of visible objects. Parent object drawn before child object.
11 * panel -> taskbars -> tasks
15 * draw_foreground(obj) is virtual function.
18 * resize_width(obj, width) = 0 : fonction virtuelle à redéfinir
19 * recalcule la largeur de l'objet (car la hauteur est fixe)
20 * - taille systray calculée à partir de la liste des icones
21 * - taille clock calculée à partir de l'heure
22 * - taille d'une tache calculée à partir de la taskbar (ajout, suppression, taille)
23 * - taille d'une taskbar calculée à partir de la taille du panel et des autres objets
25 * voir resize_taskbar(), resize_clock() et resize_tasks()
26 * voir config(obj) configure un objet (définie les positions verticales)
28 **************************************************************************/
36 #include <cairo-xlib.h>
64 // absolute coordinate in panel
70 // list of child : Area object
73 // need compute position and width
77 int use_active
, is_active
;
78 // paddingxlr = horizontal padding left/right
79 // paddingx = horizontal padding between childs
80 int paddingxlr
, paddingx
, paddingy
;
86 // each object can overwrite following function
87 void (*_draw_foreground
)(void *obj
, cairo_t
*c
, int active
);
88 void (*_resize
)(void *obj
);
89 void (*_add_child
)(void *obj
);
90 int (*_remove_child
)(void *obj
);
95 // draw background and foreground
96 void refresh (Area
*a
);
98 // set 'redraw' on an area and childs
99 void set_redraw (Area
*a
);
101 // draw pixmap and pixmap_active
102 void draw (Area
*a
, int active
);
103 void draw_background (Area
*a
, cairo_t
*c
, int active
);
105 void remove_area (Area
*a
);
106 void add_area (Area
*a
);
107 void free_area (Area
*a
);
109 // draw rounded rectangle
110 void draw_rect(cairo_t
*c
, double x
, double y
, double w
, double h
, double r
);
This page took 0.041293 seconds and 4 git commands to generate.