]> Dogcows Code - chaz/tint2/blob - src/taskbar/task.h
sample-task-align.patch, src-task-align.patch
[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 #include "timer.h"
15
16
17 enum { TASK_NORMAL, TASK_ACTIVE, TASK_ICONIFIED, TASK_URGENT, TASK_STATE_COUNT };
18 extern timeout* urgent_timeout;
19 extern GSList* urgent_list;
20
21 // --------------------------------------------------
22 // global task parameter
23 typedef struct {
24 Area area;
25
26 int text;
27 int icon;
28 int centered;
29 int align;
30
31 int icon_posy;
32 int icon_size1;
33 int maximum_width;
34 int maximum_height;
35 int alpha[TASK_STATE_COUNT];
36 int saturation[TASK_STATE_COUNT];
37 int brightness[TASK_STATE_COUNT];
38 int config_asb_mask;
39 Background* background[TASK_STATE_COUNT];
40 int config_background_mask;
41 // starting position for text ~ task_padding + task_border + icon_size
42 double text_posx, text_height;
43
44 int font_shadow;
45 PangoFontDescription *font_desc;
46 Color font[TASK_STATE_COUNT];
47 int config_font_mask;
48 int tooltip_enabled;
49 } Global_task;
50
51
52
53 typedef struct {
54 // always start with area
55 Area area;
56
57 // TODO: group task with list of windows here
58 Window win;
59 int desktop;
60 int current_state;
61 Imlib_Image icon[TASK_STATE_COUNT];
62 Pixmap state_pix[TASK_STATE_COUNT];
63 unsigned int icon_width;
64 unsigned int icon_height;
65 char *title;
66 int urgent_tick;
67 } Task;
68
69
70 Task *add_task (Window win);
71 void remove_task (Task *tsk);
72
73 void draw_task (void *obj, cairo_t *c);
74 void on_change_task (void *obj);
75
76 void get_icon (Task *tsk);
77 int get_title(Task *tsk);
78 void active_task();
79 void set_task_state(Task* tsk, int state);
80 void set_task_redraw(Task* tsk);
81
82 Task *find_active_task(Task *current_task, Task *active_task);
83 Task *next_task (Task *tsk);
84 Task *prev_task (Task *tsk);
85
86 void add_urgent(Task *tsk);
87 void del_urgent(Task *tsk);
88
89 #endif
90
This page took 0.035479 seconds and 4 git commands to generate.