]> Dogcows Code - chaz/tint2/blob - src/util/area.h
fixed decorated window with compiz
[chaz/tint2] / src / util / area.h
1 /**************************************************************************
2 * Copyright (C) 2008 thierry lorthiois (lorthiois@bbsoft.fr)
3 *
4 * base class for all graphical objects (panel, taskbar, task, systray, clock, ...).
5 * Area is at the begining of each graphical object so &object == &area.
6 *
7 * Area manage the background and border drawing, size and padding.
8 * Area also manage the tree of visible objects
9 * panel -> taskbars -> tasks
10 * -> systray -> icons
11 * -> clock
12 *
13 * draw_foreground(obj) and draw(obj) are virtual function.
14 *
15 * resize_width(obj, width) = 0 : fonction virtuelle à redéfinir
16 * recalcule la largeur de l'objet (car la hauteur est fixe)
17 * - taille systray calculée à partir de la liste des icones
18 * - taille clock calculée à partir de l'heure
19 * - taille d'une tache calculée à partir de la taskbar (ajout, suppression, taille)
20 * - taille d'une taskbar calculée à partir de la taille du panel et des autres objets
21 *
22 * voir resize_taskbar(), resize_clock() et resize_tasks()
23 * variable widthChanged ou bien emission d'un signal ???
24 * voir config(obj) configure un objet (définie les positions verticales)
25 *
26 **************************************************************************/
27
28 #ifndef AREA_H
29 #define AREA_H
30
31 #include <X11/Xlib.h>
32 #include <pango/pangocairo.h>
33
34 #include "common.h"
35
36
37
38 typedef struct
39 {
40 double color[3];
41 double alpha;
42 int width;
43 int rounded;
44 } Border;
45
46
47 typedef struct
48 {
49 double color[3];
50 double alpha;
51 } Color;
52
53
54 typedef struct {
55 // TODO: isoler 'draw' de 'refresh'
56 // TODO: isoler les données locales des données communes aux freres
57 // absolute coordinate in panel
58 int posx, posy;
59 int width, height;
60 Pixmap pmap;
61
62 // list of child : Area object
63 GSList *list;
64
65 // need redraw Pixmap
66 int redraw;
67 int paddingx, paddingy;
68 // parent Area
69 void *parent;
70
71 Color back;
72 Border border;
73
74 // each object can overwrite following function
75 void (*draw)(void *obj);
76 void (*draw_foreground)(void *obj, cairo_t *c);
77 void (*add_child)(void *obj);
78 int (*remove_child)(void *obj);
79 } Area;
80
81
82
83 // draw background and foreground
84 void refresh (Area *a);
85
86 // set 'redraw' on an area and childs
87 void set_redraw (Area *a);
88 void draw (Area *a);
89 void draw_background (Area *a, cairo_t *c);
90
91 void remove_area (Area *a);
92 void add_area (Area *a);
93 void free_area (Area *a);
94
95 #endif
96
This page took 0.039086 seconds and 5 git commands to generate.