#include "area.h"
typedef struct Battery {
- // always start with area
- Area area;
+ // always start with area
+ Area area;
- config_color font;
- int bat1_posy;
- int bat2_posy;
+ config_color font;
+ int bat1_posy;
+ int bat2_posy;
} Battery;
enum chargestate {
typedef struct Clock {
- // always start with area
- Area area;
+ // always start with area
+ Area area;
- config_color font;
- int time1_posy;
- int time2_posy;
+ config_color font;
+ int time1_posy;
+ int time2_posy;
} Clock;
typedef struct {
- // always start with area
- // area.list own all objects of the panel according to config file
- Area area;
+ // always start with area
+ // area.list own all objects of the panel according to config file
+ Area area;
- // --------------------------------------------------
- // panel
- Window main_win;
- Pixmap temp_pmap;
+ // --------------------------------------------------
+ // panel
+ Window main_win;
+ Pixmap temp_pmap;
- // position relative to root window
+ // position relative to root window
int posx, posy;
- int marginx, marginy;
- float initial_width, initial_height;
- int pourcentx, pourcenty;
- // location of the panel (monitor number)
- int monitor;
-
- // --------------------------------------------------
- // task and taskbar parameter per panel
+ int marginx, marginy;
+ float initial_width, initial_height;
+ int pourcentx, pourcenty;
+ // location of the panel (monitor number)
+ int monitor;
+
+ // --------------------------------------------------
+ // task and taskbar parameter per panel
Area g_taskbar;
Global_task g_task;
- // --------------------------------------------------
- // taskbar point to the first taskbar in panel.area.list.
- // number of tasbar == nb_desktop
+ // --------------------------------------------------
+ // taskbar point to the first taskbar in panel.area.list.
+ // number of tasbar == nb_desktop
// taskbar[i] is used to loop over taskbar,
// while panel->area.list is used to loop over all panel's objects
- Taskbar *taskbar;
- int nb_desktop;
+ Taskbar *taskbar;
+ int nb_desktop;
- // --------------------------------------------------
- // clock
- Clock clock;
+ // --------------------------------------------------
+ // clock
+ Clock clock;
// --------------------------------------------------
// battery
typedef struct {
- // always start with area
- Area area;
+ // always start with area
+ Area area;
GSList *list_icons;
int sort;
typedef struct
{
- Window id;
- int x, y;
- int width, height;
+ Window id;
+ int x, y;
+ int width, height;
int hide;
} TrayWindow;
typedef struct {
- // always start with area
- Area area;
+ // always start with area
+ Area area;
- int desktop;
+ int desktop;
- // task parameters
- int task_width;
- int task_modulo;
- int text_width;
+ // task parameters
+ int task_width;
+ int task_modulo;
+ int text_width;
} Taskbar;
// define menubar and toolbar
static const char *fallback_ui_file =
- "<ui>"
- " <menubar name='MenuBar'>"
- " <menu action='ThemeMenu'>"
- " <menuitem action='ThemeAdd'/>"
- " <menuitem action='ThemeSaveAs'/>"
- " <separator/>"
- " <menuitem action='ThemeProperties'/>"
- " <menuitem action='ThemeRename'/>"
- " <separator/>"
- " <menuitem action='ThemeDelete'/>"
- " <separator/>"
- " <menuitem action='ThemeQuit'/>"
- " </menu>"
- " <menu action='ViewMenu'>"
- " <menuitem action='ViewRefresh'/>"
- " <menuitem action='ViewRefreshAll'/>"
- " </menu>"
- " <menu action='HelpMenu'>"
- " <menuitem action='HelpAbout'/>"
- " </menu>"
- " </menubar>"
- " <toolbar name='ToolBar'>"
- " <toolitem action='ViewRefreshAll'/>"
- " <separator/>"
- " <toolitem action='ThemeProperties'/>"
- " <toolitem action='ViewApply'/>"
- " </toolbar>"
- "</ui>";
+ "<ui>"
+ " <menubar name='MenuBar'>"
+ " <menu action='ThemeMenu'>"
+ " <menuitem action='ThemeAdd'/>"
+ " <menuitem action='ThemeSaveAs'/>"
+ " <separator/>"
+ " <menuitem action='ThemeProperties'/>"
+ " <menuitem action='ThemeRename'/>"
+ " <separator/>"
+ " <menuitem action='ThemeDelete'/>"
+ " <separator/>"
+ " <menuitem action='ThemeQuit'/>"
+ " </menu>"
+ " <menu action='ViewMenu'>"
+ " <menuitem action='ViewRefresh'/>"
+ " <menuitem action='ViewRefreshAll'/>"
+ " </menu>"
+ " <menu action='HelpMenu'>"
+ " <menuitem action='HelpAbout'/>"
+ " </menu>"
+ " </menubar>"
+ " <toolbar name='ToolBar'>"
+ " <toolitem action='ViewRefreshAll'/>"
+ " <separator/>"
+ " <toolitem action='ThemeProperties'/>"
+ " <toolitem action='ViewApply'/>"
+ " </toolbar>"
+ "</ui>";
// define menubar and toolbar action
static GtkActionEntry entries[] = {
typedef struct
{
- double color[3];
- double alpha;
- int width;
- int rounded;
+ double color[3];
+ double alpha;
+ int width;
+ int rounded;
} Border;
typedef struct
{
- double color[3];
- double alpha;
+ double color[3];
+ double alpha;
} Color;
typedef struct
{
- Pixmap pmap;
- Color back;
- Border border;
+ Pixmap pmap;
+ Color back;
+ Border border;
} Pmap;
typedef struct {
- // absolute coordinate in panel
- int posx, posy;
- // width and height including border
- int width, height;
- Pmap pix;
- Pmap pix_active;
+ // absolute coordinate in panel
+ int posx, posy;
+ // width and height including border
+ int width, height;
+ Pmap pix;
+ Pmap pix_active;
- // list of child : Area object
- GSList *list;
+ // list of child : Area object
+ GSList *list;
int on_screen;
// need compute position and width
int resize;
- // need redraw Pixmap
- int redraw;
- int use_active, is_active;
- // paddingxlr = horizontal padding left/right
- // paddingx = horizontal padding between childs
- int paddingxlr, paddingx, paddingy;
- // parent Area
- void *parent;
- // panel
- void *panel;
-
- // each object can overwrite following function
- void (*_draw_foreground)(void *obj, cairo_t *c, int active);
- void (*_resize)(void *obj);
- void (*_add_child)(void *obj);
- int (*_remove_child)(void *obj);
+ // need redraw Pixmap
+ int redraw;
+ int use_active, is_active;
+ // paddingxlr = horizontal padding left/right
+ // paddingx = horizontal padding between childs
+ int paddingxlr, paddingx, paddingy;
+ // parent Area
+ void *parent;
+ // panel
+ void *panel;
+
+ // each object can overwrite following function
+ void (*_draw_foreground)(void *obj, cairo_t *c, int active);
+ void (*_resize)(void *obj);
+ void (*_add_child)(void *obj);
+ int (*_remove_child)(void *obj);
} Area;
typedef struct config_border
{
- double color[3];
- double alpha;
- int width;
- int rounded;
+ double color[3];
+ double alpha;
+ int width;
+ int rounded;
} config_border;
typedef struct config_color
{
- double color[3];
- double alpha;
+ double color[3];
+ double alpha;
} config_color;