2008-10-02 18:47:02 +00:00
|
|
|
/**************************************************************************
|
2009-01-17 14:07:56 +00:00
|
|
|
* task :
|
|
|
|
* -
|
2008-10-02 18:47:02 +00:00
|
|
|
*
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
|
|
#ifndef TASK_H
|
|
|
|
#define TASK_H
|
|
|
|
|
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#include <pango/pangocairo.h>
|
2009-08-28 12:14:45 +00:00
|
|
|
#include <Imlib2.h>
|
2008-10-02 18:47:02 +00:00
|
|
|
#include "common.h"
|
|
|
|
|
|
|
|
|
2010-01-09 00:11:01 +00:00
|
|
|
enum { TASK_NORMAL, TASK_ACTIVE, TASK_ICONIFIED, TASK_URGENT, TASK_STATE_COUNT };
|
|
|
|
|
2008-10-02 18:47:02 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
// global task parameter
|
|
|
|
typedef struct {
|
2009-07-26 13:46:50 +00:00
|
|
|
Area area;
|
|
|
|
|
|
|
|
int text;
|
|
|
|
int icon;
|
|
|
|
int centered;
|
|
|
|
|
|
|
|
int icon_posy;
|
|
|
|
int icon_size1;
|
|
|
|
int maximum_width;
|
|
|
|
int maximum_height;
|
2010-01-09 00:11:01 +00:00
|
|
|
int alpha[TASK_STATE_COUNT];
|
|
|
|
int saturation[TASK_STATE_COUNT];
|
|
|
|
int brightness[TASK_STATE_COUNT];
|
|
|
|
int config_asb_mask;
|
|
|
|
Background* background[TASK_STATE_COUNT];
|
|
|
|
int config_background_mask;
|
2009-07-26 13:46:50 +00:00
|
|
|
// starting position for text ~ task_padding + task_border + icon_size
|
|
|
|
double text_posx, text_posy;
|
|
|
|
|
|
|
|
int font_shadow;
|
|
|
|
PangoFontDescription *font_desc;
|
2010-01-09 00:11:01 +00:00
|
|
|
Color font[TASK_STATE_COUNT];
|
|
|
|
int config_font_mask;
|
2008-10-02 18:47:02 +00:00
|
|
|
} Global_task;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
2009-07-26 13:46:50 +00:00
|
|
|
// always start with area
|
|
|
|
Area area;
|
|
|
|
|
|
|
|
// TODO: group task with list of windows here
|
|
|
|
Window win;
|
|
|
|
int desktop;
|
2010-01-09 00:11:01 +00:00
|
|
|
int current_state;
|
|
|
|
Imlib_Image icon[TASK_STATE_COUNT];
|
2009-09-01 15:56:52 +00:00
|
|
|
unsigned int icon_width;
|
|
|
|
unsigned int icon_height;
|
2009-07-26 13:46:50 +00:00
|
|
|
char *title;
|
2009-12-29 19:55:25 +00:00
|
|
|
int urgent_tick;
|
2008-10-02 18:47:02 +00:00
|
|
|
} Task;
|
|
|
|
|
|
|
|
|
2009-06-29 19:50:29 +00:00
|
|
|
Task *add_task (Window win);
|
2008-10-02 18:47:02 +00:00
|
|
|
void remove_task (Task *tsk);
|
|
|
|
|
2010-01-09 00:11:01 +00:00
|
|
|
void draw_task (void *obj, cairo_t *c);
|
2008-10-02 18:47:02 +00:00
|
|
|
|
|
|
|
void get_icon (Task *tsk);
|
|
|
|
void get_title(Task *tsk);
|
2009-10-23 21:28:44 +00:00
|
|
|
void active_task();
|
2010-01-09 00:11:01 +00:00
|
|
|
void set_task_state(Task* tsk, int state);
|
2009-02-07 23:28:13 +00:00
|
|
|
|
2009-11-18 05:13:38 +00:00
|
|
|
Task *next_task (Task *tsk);
|
|
|
|
Task *prev_task (Task *tsk);
|
|
|
|
|
2009-11-11 20:09:34 +00:00
|
|
|
void add_urgent(Task *tsk);
|
|
|
|
void del_urgent(Task *tsk);
|
|
|
|
|
2008-10-02 18:47:02 +00:00
|
|
|
#endif
|
|
|
|
|