]> Dogcows Code - chaz/tint2/blob - src/panel.h
add missing battery config CPP guard
[chaz/tint2] / src / panel.h
1 /**************************************************************************
2 * Copyright (C) 2008 Pål Staurland (staura@gmail.com)
3 * Modified (C) 2008/2009 thierry lorthiois (lorthiois@bbsoft.fr)
4 *
5 * panel :
6 * - draw panel and all objects according to panel_layout
7 *
8 *
9 **************************************************************************/
10
11 #ifndef PANEL_H
12 #define PANEL_H
13
14 #include <pango/pangocairo.h>
15 #include <sys/time.h>
16
17 #include "common.h"
18 #include "clock.h"
19 #include "task.h"
20 #include "taskbar.h"
21 #include "systraybar.h"
22 #include "launcher.h"
23 #include "freespace.h"
24
25 #ifdef ENABLE_BATTERY
26 #include "battery.h"
27 #endif
28
29
30 extern int signal_pending;
31 // --------------------------------------------------
32 // mouse events
33 extern int mouse_middle;
34 extern int mouse_right;
35 extern int mouse_scroll_up;
36 extern int mouse_scroll_down;
37 extern int mouse_tilt_left;
38 extern int mouse_tilt_right;
39
40 //panel mode
41 enum { SINGLE_DESKTOP=0, MULTI_DESKTOP };
42 enum { BOTTOM_LAYER, NORMAL_LAYER, TOP_LAYER };
43 extern int panel_mode;
44 extern int wm_menu;
45 extern int panel_dock;
46 extern int panel_layer;
47
48 //panel position
49 enum { LEFT=0x01, RIGHT=0x02, CENTER=0X04, TOP=0X08, BOTTOM=0x10 };
50 extern int panel_position;
51 extern int panel_horizontal;
52
53 extern int panel_refresh;
54 extern int task_dragged;
55
56 //panel autohide
57 enum { STRUT_MINIMUM, STRUT_FOLLOW_SIZE, STRUT_NONE };
58 extern int panel_autohide;
59 extern int panel_autohide_show_timeout;
60 extern int panel_autohide_hide_timeout;
61 extern int panel_autohide_height; // for vertical panels this is of course the width
62 extern int panel_strut_policy;
63 extern char *panel_items_order;
64
65 // tasks alignment
66 enum { ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT };
67
68 extern int max_tick_urgent;
69
70 extern GArray* backgrounds;
71
72 extern Imlib_Image default_icon;
73
74
75 // tint2 use one panel per monitor and one taskbar per desktop.
76 typedef struct {
77 // always start with area
78 // area.list own all objects of the panel according to config file
79 Area area;
80
81 // --------------------------------------------------
82 // panel
83 Window main_win;
84 Pixmap temp_pmap;
85
86 // position relative to root window
87 int posx, posy;
88 int marginx, marginy;
89 int pourcentx, pourcenty;
90 // location of the panel (monitor number)
91 int monitor;
92
93 // --------------------------------------------------
94 // task and taskbar parameter per panel
95 Global_taskbar g_taskbar;
96 Global_task g_task;
97
98 // --------------------------------------------------
99 // taskbar point to the first taskbar in panel.area.list.
100 // number of tasbar == nb_desktop. taskbar[i] is for desktop(i).
101 // taskbar[i] is used to loop over taskbar,
102 // while panel->area.list is used to loop over all panel's objects
103 Taskbar *taskbar;
104 int nb_desktop;
105
106 // --------------------------------------------------
107 // clock
108 Clock clock;
109
110 // --------------------------------------------------
111 // battery
112 #ifdef ENABLE_BATTERY
113 Battery battery;
114 #endif
115
116 Launcher launcher;
117
118 FreeSpace freespace;
119
120 // autohide
121 int is_hidden;
122 int hidden_width, hidden_height;
123 Pixmap hidden_pixmap;
124 timeout* autohide_timeout;
125 } Panel;
126
127
128 extern Panel panel_config;
129 extern Panel *panel1;
130 extern int nb_panel;
131
132
133 // default global data
134 void default_panel();
135
136 // freed memory
137 void cleanup_panel();
138
139 // realloc panels according to number of monitor
140 // use panel_config as default value
141 void init_panel();
142
143 void init_panel_size_and_position(Panel *panel);
144 int resize_panel(void *obj);
145
146 void set_panel_items_order(Panel *p);
147 void set_panel_properties(Panel *p);
148
149 // draw background panel
150 void set_panel_background(Panel *p);
151
152 // detect witch panel
153 Panel *get_panel(Window win);
154
155 Taskbar *click_taskbar (Panel *panel, int x, int y);
156 Task *click_task (Panel *panel, int x, int y);
157 Launcher *click_launcher (Panel *panel, int x, int y);
158 LauncherIcon *click_launcher_icon (Panel *panel, int x, int y);
159 int click_padding(Panel *panel, int x, int y);
160 int click_clock(Panel *panel, int x, int y);
161 Area* click_area(Panel *panel, int x, int y);
162
163 void autohide_show(void* p);
164 void autohide_hide(void* p);
165 void autohide_trigger_show(Panel* p);
166 void autohide_trigger_hide(Panel* p);
167
168 #endif
This page took 0.03527 seconds and 4 git commands to generate.