2008-10-02 18:47:02 +00:00
|
|
|
/**************************************************************************
|
2009-01-20 21:16:54 +00:00
|
|
|
* Copyright (C) 2008 Pål Staurland (staura@gmail.com)
|
|
|
|
* Modified (C) 2008/2009 thierry lorthiois (lorthiois@bbsoft.fr)
|
|
|
|
*
|
|
|
|
* panel :
|
2008-10-02 18:47:02 +00:00
|
|
|
* - draw panel and all objects according to panel_layout
|
2009-01-20 21:16:54 +00:00
|
|
|
*
|
2008-10-02 18:47:02 +00:00
|
|
|
*
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
|
|
#ifndef PANEL_H
|
|
|
|
#define PANEL_H
|
|
|
|
|
|
|
|
#include <pango/pangocairo.h>
|
|
|
|
#include <sys/time.h>
|
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
#include "clock.h"
|
|
|
|
#include "task.h"
|
|
|
|
#include "taskbar.h"
|
2009-01-20 21:16:54 +00:00
|
|
|
#include "systraybar.h"
|
2008-10-02 18:47:02 +00:00
|
|
|
|
2009-06-18 20:26:40 +00:00
|
|
|
#ifdef ENABLE_BATTERY
|
|
|
|
#include "battery.h"
|
|
|
|
#endif
|
2008-10-02 18:47:02 +00:00
|
|
|
|
2009-02-07 23:28:13 +00:00
|
|
|
|
|
|
|
extern int signal_pending;
|
|
|
|
// --------------------------------------------------
|
|
|
|
// mouse events
|
|
|
|
extern int mouse_middle;
|
|
|
|
extern int mouse_right;
|
|
|
|
extern int mouse_scroll_up;
|
|
|
|
extern int mouse_scroll_down;
|
|
|
|
|
2008-10-02 18:47:02 +00:00
|
|
|
//panel mode
|
2009-06-08 16:50:14 +00:00
|
|
|
enum { SINGLE_DESKTOP=0, MULTI_DESKTOP };
|
2009-02-07 23:28:13 +00:00
|
|
|
extern int panel_mode;
|
2009-06-06 19:37:27 +00:00
|
|
|
extern int wm_menu;
|
2008-10-02 18:47:02 +00:00
|
|
|
|
2009-02-07 23:28:13 +00:00
|
|
|
//panel position
|
2008-10-02 18:47:02 +00:00
|
|
|
enum { LEFT=0x01, RIGHT=0x02, CENTER=0X04, TOP=0X08, BOTTOM=0x10 };
|
2009-02-07 23:28:13 +00:00
|
|
|
extern int panel_position;
|
|
|
|
|
|
|
|
extern int panel_refresh;
|
|
|
|
|
|
|
|
extern Task *task_active;
|
|
|
|
extern Task *task_drag;
|
2009-06-05 18:53:49 +00:00
|
|
|
extern Task *task_urgent;
|
2008-10-02 18:47:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
// always start with area
|
2009-02-13 21:54:42 +00:00
|
|
|
// area.list own all objects of the panel according to config file
|
2008-10-02 18:47:02 +00:00
|
|
|
Area area;
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// panel
|
2009-02-07 23:28:13 +00:00
|
|
|
Window main_win;
|
2009-02-13 21:54:42 +00:00
|
|
|
Pixmap temp_pmap;
|
|
|
|
|
2009-02-07 23:28:13 +00:00
|
|
|
// 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)
|
2008-10-02 18:47:02 +00:00
|
|
|
int monitor;
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
2009-02-10 23:16:10 +00:00
|
|
|
// task and taskbar parameter per panel
|
2009-02-07 23:28:13 +00:00
|
|
|
Area g_taskbar;
|
|
|
|
Global_task g_task;
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// taskbar point to the first taskbar in panel.area.list.
|
|
|
|
// number of tasbar == nb_desktop
|
2008-11-08 20:23:42 +00:00
|
|
|
Taskbar *taskbar;
|
2009-02-07 23:28:13 +00:00
|
|
|
int nb_desktop;
|
2009-01-20 21:16:54 +00:00
|
|
|
|
2008-10-02 18:47:02 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
// clock
|
|
|
|
Clock clock;
|
|
|
|
|
2009-05-15 20:44:42 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
// battery
|
2009-06-18 20:26:40 +00:00
|
|
|
#ifdef ENABLE_BATTERY
|
2009-05-15 20:44:42 +00:00
|
|
|
Battery battery;
|
2009-06-18 20:26:40 +00:00
|
|
|
#endif
|
2008-10-02 18:47:02 +00:00
|
|
|
} Panel;
|
|
|
|
|
|
|
|
|
2009-02-07 23:28:13 +00:00
|
|
|
extern Panel *panel1;
|
|
|
|
extern int nb_panel;
|
2008-10-02 18:47:02 +00:00
|
|
|
|
|
|
|
|
2009-02-07 23:28:13 +00:00
|
|
|
void init_panel();
|
|
|
|
void cleanup_panel();
|
2009-02-13 21:54:42 +00:00
|
|
|
void resize_panel(void *obj);
|
|
|
|
|
2009-02-07 23:28:13 +00:00
|
|
|
void set_panel_properties(Panel *p);
|
2008-11-08 20:23:42 +00:00
|
|
|
void visible_object();
|
2009-02-03 20:40:46 +00:00
|
|
|
|
|
|
|
// draw background panel
|
2009-02-07 23:28:13 +00:00
|
|
|
void set_panel_background(Panel *p);
|
2008-10-02 18:47:02 +00:00
|
|
|
|
2009-02-13 21:54:42 +00:00
|
|
|
// detect witch panel
|
2009-02-07 23:28:13 +00:00
|
|
|
Panel *get_panel(Window win);
|
2009-02-03 20:40:46 +00:00
|
|
|
|
2008-10-02 18:47:02 +00:00
|
|
|
#endif
|
2009-02-07 23:28:13 +00:00
|
|
|
|