]>
Dogcows Code - chaz/tint2/blob - area.h
b016674ed4f3c97f602addd00252e5a42e42b506
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 has one Pixmap (pix).
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>
50 // way to calculate the size
51 // SIZE_BY_LAYOUT objects : taskbar and task
52 // SIZE_BY_CONTENT objects : clock, battery, launcher, systray
53 enum { SIZE_BY_LAYOUT
, SIZE_BY_CONTENT
};
56 // coordinate relative to panel window
58 // width and height including border
63 // list of child : Area object
66 // object visible on screen
68 // way to calculate the size (SIZE_BY_CONTENT or SIZE_BY_LAYOUT)
70 // need to calculate position and width
74 // paddingxlr = horizontal padding left/right
75 // paddingx = horizontal padding between childs
76 int paddingxlr
, paddingx
, paddingy
;
82 // each object can overwrite following function
83 void (*_draw_foreground
)(void *obj
, cairo_t
*c
);
84 // calculate size. return '1' if size changed, '0' otherwise.
85 int (*_resize
)(void *obj
);
86 void (*_add_child
)(void *obj
);
87 int (*_remove_child
)(void *obj
);
88 const char* (*_get_tooltip_text
)(void *obj
);
92 void rendering(void *panel
);
93 void size_by_content (Area
*a
);
94 void size_by_layout (Area
*a
, int pos
, int level
);
95 // draw background and foreground
96 void refresh (Area
*a
);
98 // set 'redraw' on an area and childs
99 void set_redraw (Area
*a
);
103 void draw_background (Area
*a
, cairo_t
*c
);
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
);
112 // clear pixmap with transparent color
113 void clear_pixmap(Pixmap p
, int x
, int y
, int w
, int h
);
This page took 0.036521 seconds and 3 git commands to generate.