]> Dogcows Code - chaz/tint2/blob - src/panel.h
sample-task-align.patch, src-task-align.patch
[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
24 #ifdef ENABLE_BATTERY
25 #include "battery.h"
26 #endif
27
28
29 extern int signal_pending;
30 // --------------------------------------------------
31 // mouse events
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;
38
39 //panel mode
40 enum { SINGLE_DESKTOP=0, MULTI_DESKTOP };
41 enum { BOTTOM_LAYER, NORMAL_LAYER, TOP_LAYER };
42 extern int panel_mode;
43 extern int wm_menu;
44 extern int panel_dock;
45 extern int panel_layer;
46
47 //panel position
48 enum { LEFT=0x01, RIGHT=0x02, CENTER=0X04, TOP=0X08, BOTTOM=0x10 };
49 extern int panel_position;
50 extern int panel_horizontal;
51
52 extern int panel_refresh;
53 extern int task_dragged;
54
55 //panel autohide
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;
62 extern char *panel_items_order;
63
64 // tasks alignment
65 enum { ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT };
66
67 extern int max_tick_urgent;
68
69 extern GArray* backgrounds;
70
71 extern Imlib_Image default_icon;
72
73
74 // tint2 use one panel per monitor and one taskbar per desktop.
75 typedef struct {
76 // always start with area
77 // area.list own all objects of the panel according to config file
78 Area area;
79
80 // --------------------------------------------------
81 // panel
82 Window main_win;
83 Pixmap temp_pmap;
84
85 // position relative to root window
86 int posx, posy;
87 int marginx, marginy;
88 int pourcentx, pourcenty;
89 // location of the panel (monitor number)
90 int monitor;
91
92 // --------------------------------------------------
93 // task and taskbar parameter per panel
94 Global_taskbar g_taskbar;
95 Global_task g_task;
96
97 // --------------------------------------------------
98 // taskbar point to the first taskbar in panel.area.list.
99 // number of tasbar == nb_desktop. taskbar[i] is for desktop(i).
100 // taskbar[i] is used to loop over taskbar,
101 // while panel->area.list is used to loop over all panel's objects
102 Taskbar *taskbar;
103 int nb_desktop;
104
105 // --------------------------------------------------
106 // clock
107 Clock clock;
108
109 // --------------------------------------------------
110 // battery
111 #ifdef ENABLE_BATTERY
112 Battery battery;
113 #endif
114
115 Launcher launcher;
116
117 // autohide
118 int is_hidden;
119 int hidden_width, hidden_height;
120 Pixmap hidden_pixmap;
121 timeout* autohide_timeout;
122 } Panel;
123
124
125 extern Panel panel_config;
126 extern Panel *panel1;
127 extern int nb_panel;
128
129
130 // default global data
131 void default_panel();
132
133 // freed memory
134 void cleanup_panel();
135
136 // realloc panels according to number of monitor
137 // use panel_config as default value
138 void init_panel();
139
140 void init_panel_size_and_position(Panel *panel);
141 int resize_panel(void *obj);
142
143 void set_panel_items_order(Panel *p);
144 void set_panel_properties(Panel *p);
145
146 // draw background panel
147 void set_panel_background(Panel *p);
148
149 // detect witch panel
150 Panel *get_panel(Window win);
151
152 Taskbar *click_taskbar (Panel *panel, int x, int y);
153 Task *click_task (Panel *panel, int x, int y);
154 Launcher *click_launcher (Panel *panel, int x, int y);
155 LauncherIcon *click_launcher_icon (Panel *panel, int x, int y);
156 int click_padding(Panel *panel, int x, int y);
157 int click_clock(Panel *panel, int x, int y);
158 Area* click_area(Panel *panel, int x, int y);
159
160 void autohide_show(void* p);
161 void autohide_hide(void* p);
162 void autohide_trigger_show(Panel* p);
163 void autohide_trigger_hide(Panel* p);
164
165 #endif
This page took 0.039867 seconds and 4 git commands to generate.