]> Dogcows Code - chaz/tint2/blob - src/panel.h
*fix* finish dnd problems and autohide
[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 extern int task_dragged;
53
54 //panel autohide
55 enum { STRUT_MINIMUM, STRUT_FOLLOW_SIZE, STRUT_NONE };
56 extern int panel_autohide;
57 extern int panel_autohide_show_timeout;
58 extern int panel_autohide_hide_timeout;
59 extern int panel_autohide_height; // for vertical panels this is of course the width
60 extern int panel_strut_policy;
61
62 extern int max_tick_urgent;
63
64 extern GArray* backgrounds;
65
66 extern Imlib_Image default_icon;
67
68
69 // tint2 use one panel per monitor and one taskbar per desktop.
70 typedef struct {
71 // always start with area
72 // area.list own all objects of the panel according to config file
73 Area area;
74
75 // --------------------------------------------------
76 // panel
77 Window main_win;
78 Pixmap temp_pmap;
79
80 // position relative to root window
81 int posx, posy;
82 int marginx, marginy;
83 int pourcentx, pourcenty;
84 // location of the panel (monitor number)
85 int monitor;
86
87 // --------------------------------------------------
88 // task and taskbar parameter per panel
89 Global_taskbar g_taskbar;
90 Global_task g_task;
91
92 // --------------------------------------------------
93 // taskbar point to the first taskbar in panel.area.list.
94 // number of tasbar == nb_desktop. taskbar[i] is for desktop(i).
95 // taskbar[i] is used to loop over taskbar,
96 // while panel->area.list is used to loop over all panel's objects
97 Taskbar *taskbar;
98 int nb_desktop;
99
100 // --------------------------------------------------
101 // clock
102 Clock clock;
103
104 // --------------------------------------------------
105 // battery
106 #ifdef ENABLE_BATTERY
107 Battery battery;
108 #endif
109
110 // autohide
111 int is_hidden;
112 int hidden_width, hidden_height;
113 Pixmap hidden_pixmap;
114 timeout* autohide_timeout;
115 } Panel;
116
117
118 extern Panel panel_config;
119 extern Panel *panel1;
120 extern int nb_panel;
121
122
123 // default global data
124 void default_panel();
125
126 // freed memory
127 void cleanup_panel();
128
129 // realloc panels according to number of monitor
130 // use panel_config as default value
131 void init_panel();
132
133 void init_panel_size_and_position(Panel *panel);
134 void resize_panel(void *obj);
135
136 void set_panel_properties(Panel *p);
137 void visible_object();
138
139 // draw background panel
140 void set_panel_background(Panel *p);
141
142 // detect witch panel
143 Panel *get_panel(Window win);
144
145 Taskbar *click_taskbar (Panel *panel, int x, int y);
146 Task *click_task (Panel *panel, int x, int y);
147 int click_padding(Panel *panel, int x, int y);
148 int click_clock(Panel *panel, int x, int y);
149 Area* click_area(Panel *panel, int x, int y);
150
151 void autohide_show(void* p);
152 void autohide_hide(void* p);
153 void autohide_trigger_show(Panel* p);
154 void autohide_trigger_hide(Panel* p);
155
156 #endif
This page took 0.047633 seconds and 5 git commands to generate.