1 /**************************************************************************
2 * Copyright (C) 2008 Pål Staurland (staura@gmail.com)
3 * Modified (C) 2008/2009 thierry lorthiois (lorthiois@bbsoft.fr)
6 * - draw panel and all objects according to panel_layout
9 **************************************************************************/
14 #include <pango/pangocairo.h>
21 #include "systraybar.h"
29 extern int signal_pending
;
30 // --------------------------------------------------
32 extern int mouse_middle
;
33 extern int mouse_right
;
34 extern int mouse_scroll_up
;
35 extern int mouse_scroll_down
;
36 extern int mouse_tilt_left
;
37 extern int mouse_tilt_right
;
40 enum { SINGLE_DESKTOP
=0, MULTI_DESKTOP
};
41 enum { BOTTOM_LAYER
, NORMAL_LAYER
, TOP_LAYER
};
42 extern int panel_mode
;
44 extern int panel_dock
;
45 extern int panel_layer
;
48 enum { LEFT
=0x01, RIGHT
=0x02, CENTER
=0X04, TOP
=0X08, BOTTOM
=0x10 };
49 extern int panel_position
;
50 extern int panel_horizontal
;
52 extern int panel_refresh
;
53 extern int task_dragged
;
56 enum { STRUT_MINIMUM
, STRUT_FOLLOW_SIZE
, STRUT_NONE
};
57 extern int panel_autohide
;
58 extern int panel_autohide_show_timeout
;
59 extern int panel_autohide_hide_timeout
;
60 extern int panel_autohide_height
; // for vertical panels this is of course the width
61 extern int panel_strut_policy
;
63 extern int max_tick_urgent
;
65 extern GArray
* backgrounds
;
67 extern Imlib_Image default_icon
;
70 // tint2 use one panel per monitor and one taskbar per desktop.
72 // always start with area
73 // area.list own all objects of the panel according to config file
76 // --------------------------------------------------
81 // position relative to root window
84 int pourcentx
, pourcenty
;
85 // location of the panel (monitor number)
88 // --------------------------------------------------
89 // task and taskbar parameter per panel
90 Global_taskbar g_taskbar
;
93 // --------------------------------------------------
94 // taskbar point to the first taskbar in panel.area.list.
95 // number of tasbar == nb_desktop. taskbar[i] is for desktop(i).
96 // taskbar[i] is used to loop over taskbar,
97 // while panel->area.list is used to loop over all panel's objects
101 // --------------------------------------------------
105 // --------------------------------------------------
107 #ifdef ENABLE_BATTERY
115 int hidden_width
, hidden_height
;
116 Pixmap hidden_pixmap
;
117 timeout
* autohide_timeout
;
121 extern Panel panel_config
;
122 extern Panel
*panel1
;
126 // default global data
127 void default_panel();
130 void cleanup_panel();
132 // realloc panels according to number of monitor
133 // use panel_config as default value
136 void init_panel_size_and_position(Panel
*panel
);
137 void resize_panel(void *obj
);
139 void set_panel_properties(Panel
*p
);
140 void visible_object();
142 // draw background panel
143 void set_panel_background(Panel
*p
);
145 // detect witch panel
146 Panel
*get_panel(Window win
);
148 Taskbar
*click_taskbar (Panel
*panel
, int x
, int y
);
149 Task
*click_task (Panel
*panel
, int x
, int y
);
150 Launcher
*click_launcher (Panel
*panel
, int x
, int y
);
151 LauncherIcon
*click_launcher_icon (Panel
*panel
, int x
, int y
);
152 int click_padding(Panel
*panel
, int x
, int y
);
153 int click_clock(Panel
*panel
, int x
, int y
);
154 Area
* click_area(Panel
*panel
, int x
, int y
);
156 void autohide_show(void* p
);
157 void autohide_hide(void* p
);
158 void autohide_trigger_show(Panel
* p
);
159 void autohide_trigger_hide(Panel
* p
);