]> Dogcows Code - chaz/tint2/blob - src/panel.h
cleanup
[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
23 #ifdef ENABLE_BATTERY
24 #include "battery.h"
25 #endif
26
27
28 extern int signal_pending;
29 // --------------------------------------------------
30 // mouse events
31 extern int mouse_middle;
32 extern int mouse_right;
33 extern int mouse_scroll_up;
34 extern int mouse_scroll_down;
35 extern int mouse_tilt_left;
36 extern int mouse_tilt_right;
37
38 //panel mode
39 enum { SINGLE_DESKTOP=0, MULTI_DESKTOP };
40 extern int panel_mode;
41 extern int wm_menu;
42 extern int panel_dock;
43
44 //panel position
45 enum { LEFT=0x01, RIGHT=0x02, CENTER=0X04, TOP=0X08, BOTTOM=0x10 };
46 extern int panel_position;
47 extern int panel_horizontal;
48
49 extern int panel_refresh;
50
51 extern Task *task_active;
52 extern Task *task_drag;
53 extern Task *task_urgent;
54 extern int tick_urgent;
55 extern int max_tick_urgent;
56
57
58 typedef struct {
59 // always start with area
60 // area.list own all objects of the panel according to config file
61 Area area;
62
63 // --------------------------------------------------
64 // panel
65 Window main_win;
66 Pixmap temp_pmap;
67
68 // position relative to root window
69 int posx, posy;
70 int marginx, marginy;
71 float initial_width, initial_height;
72 int pourcentx, pourcenty;
73 // location of the panel (monitor number)
74 int monitor;
75
76 // --------------------------------------------------
77 // task and taskbar parameter per panel
78 Area g_taskbar;
79 Global_task g_task;
80
81 // --------------------------------------------------
82 // taskbar point to the first taskbar in panel.area.list.
83 // number of tasbar == nb_desktop
84 // taskbar[i] is used to loop over taskbar,
85 // while panel->area.list is used to loop over all panel's objects
86 Taskbar *taskbar;
87 int nb_desktop;
88
89 // --------------------------------------------------
90 // clock
91 Clock clock;
92
93 // --------------------------------------------------
94 // battery
95 #ifdef ENABLE_BATTERY
96 Battery battery;
97 #endif
98 } Panel;
99
100
101 extern Panel *panel1;
102 extern int nb_panel;
103
104
105 void init_panel();
106 void cleanup_panel();
107 void resize_panel(void *obj);
108
109 void set_panel_properties(Panel *p);
110 void visible_object();
111
112 // draw background panel
113 void set_panel_background(Panel *p);
114
115 // detect witch panel
116 Panel *get_panel(Window win);
117
118 #endif
119
This page took 0.038495 seconds and 5 git commands to generate.