]> Dogcows Code - chaz/tint2/blob - src/taskbar/task.h
*fix* only redraw task on state change, if not already drawn
[chaz/tint2] / src / taskbar / task.h
1 /**************************************************************************
2 * task :
3 * -
4 *
5 **************************************************************************/
6
7 #ifndef TASK_H
8 #define TASK_H
9
10 #include <X11/Xlib.h>
11 #include <pango/pangocairo.h>
12 #include <Imlib2.h>
13 #include "common.h"
14
15
16 enum { TASK_NORMAL, TASK_ACTIVE, TASK_ICONIFIED, TASK_URGENT, TASK_STATE_COUNT };
17
18 // --------------------------------------------------
19 // global task parameter
20 typedef struct {
21 Area area;
22
23 int text;
24 int icon;
25 int centered;
26
27 int icon_posy;
28 int icon_size1;
29 int maximum_width;
30 int maximum_height;
31 int alpha[TASK_STATE_COUNT];
32 int saturation[TASK_STATE_COUNT];
33 int brightness[TASK_STATE_COUNT];
34 int config_asb_mask;
35 Background* background[TASK_STATE_COUNT];
36 int config_background_mask;
37 // starting position for text ~ task_padding + task_border + icon_size
38 double text_posx, text_posy;
39
40 int font_shadow;
41 PangoFontDescription *font_desc;
42 Color font[TASK_STATE_COUNT];
43 int config_font_mask;
44 } Global_task;
45
46
47
48 typedef struct {
49 // always start with area
50 Area area;
51
52 // TODO: group task with list of windows here
53 Window win;
54 int desktop;
55 int current_state;
56 Imlib_Image icon[TASK_STATE_COUNT];
57 Pixmap state_pix[TASK_STATE_COUNT];
58 unsigned int icon_width;
59 unsigned int icon_height;
60 char *title;
61 int urgent_tick;
62 } Task;
63
64
65 Task *add_task (Window win);
66 void remove_task (Task *tsk);
67
68 void draw_task (void *obj, cairo_t *c);
69
70 void get_icon (Task *tsk);
71 void get_title(Task *tsk);
72 void active_task();
73 void set_task_state(Task* tsk, int state);
74 void set_task_redraw(Task* tsk);
75
76 Task *next_task (Task *tsk);
77 Task *prev_task (Task *tsk);
78
79 void add_urgent(Task *tsk);
80 void del_urgent(Task *tsk);
81
82 #endif
83
This page took 0.038621 seconds and 5 git commands to generate.