]> Dogcows Code - chaz/tint2/blob - src/panel.h
*add* real transparency is now supported... most systray applications work out of...
[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 enum { BOTTOM_LAYER, NORMAL_LAYER, TOP_LAYER };
41 extern int panel_mode;
42 extern int wm_menu;
43 extern int panel_dock;
44 extern int panel_layer;
45
46 //panel position
47 enum { LEFT=0x01, RIGHT=0x02, CENTER=0X04, TOP=0X08, BOTTOM=0x10 };
48 extern int panel_position;
49 extern int panel_horizontal;
50
51 extern int panel_refresh;
52
53 extern Task *task_active;
54 extern Task *task_drag;
55 extern int max_tick_urgent;
56
57 extern Imlib_Image default_icon;
58
59
60 // tint2 use one panel per monitor and one taskbar per desktop.
61 typedef struct {
62 // always start with area
63 // area.list own all objects of the panel according to config file
64 Area area;
65
66 // --------------------------------------------------
67 // panel
68 Window main_win;
69 Pixmap temp_pmap;
70
71 // position relative to root window
72 int posx, posy;
73 int marginx, marginy;
74 int pourcentx, pourcenty;
75 // location of the panel (monitor number)
76 int monitor;
77
78 // --------------------------------------------------
79 // task and taskbar parameter per panel
80 Area g_taskbar;
81 Global_task g_task;
82
83 // --------------------------------------------------
84 // taskbar point to the first taskbar in panel.area.list.
85 // number of tasbar == nb_desktop. taskbar[i] is for desktop(i).
86 // taskbar[i] is used to loop over taskbar,
87 // while panel->area.list is used to loop over all panel's objects
88 Taskbar *taskbar;
89 int nb_desktop;
90
91 // --------------------------------------------------
92 // clock
93 Clock clock;
94
95 // --------------------------------------------------
96 // battery
97 #ifdef ENABLE_BATTERY
98 Battery battery;
99 #endif
100 } Panel;
101
102
103 extern Panel panel_config;
104 extern Panel *panel1;
105 extern int nb_panel;
106
107 // realloc panels according to number of monitor
108 // use panel_config as default value
109 void init_panel();
110
111 void init_panel_size_and_position(Panel *panel);
112 void cleanup_panel();
113 void resize_panel(void *obj);
114
115 void set_panel_properties(Panel *p);
116 void visible_object();
117
118 // draw background panel
119 void set_panel_background(Panel *p);
120
121 // detect witch panel
122 Panel *get_panel(Window win);
123
124 Taskbar *click_taskbar (Panel *panel, int x, int y);
125 Task *click_task (Panel *panel, int x, int y);
126 int click_padding(Panel *panel, int x, int y);
127 int click_clock(Panel *panel, int x, int y);
128 Area* click_area(Panel *panel, int x, int y);
129
130 #endif
This page took 0.039812 seconds and 5 git commands to generate.