removed orphaned mkinstalldirs from distribution
[lxde/lxpanel.git] / src / panel.h
CommitLineData
239cb032 1/**
a99ee9e1
JH
2 * Copyright (c) 2006 LxDE Developers, see the file AUTHORS for details.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18
a52c2257
HJYP
19#ifndef PANEL_H
20#define PANEL_H
21
a52c2257
HJYP
22#include <X11/Xlib.h>
23#include <gtk/gtk.h>
24#include <gdk/gdk.h>
25
26#include "config.h"
27
28#include "bg.h"
29#include "ev.h"
30
31enum { ALLIGN_NONE, ALLIGN_LEFT, ALLIGN_CENTER, ALLIGN_RIGHT };
32enum { EDGE_NONE, EDGE_LEFT, EDGE_RIGHT, EDGE_TOP, EDGE_BOTTOM };
33enum { WIDTH_NONE, WIDTH_REQUEST, WIDTH_PIXEL, WIDTH_PERCENT };
34enum { HEIGHT_NONE, HEIGHT_PIXEL, HEIGHT_REQUEST };
a97d06a6
HJYP
35enum {
36 ORIENT_NONE = -1,
37 ORIENT_VERT = GTK_ORIENTATION_VERTICAL,
38 ORIENT_HORIZ = GTK_ORIENTATION_HORIZONTAL
39};
a52c2257
HJYP
40enum { POS_NONE, POS_START, POS_END };
41
9dd114c4 42#define PANEL_ICON_SIZE 24 /* Default size of panel icons */
43#define PANEL_HEIGHT_DEFAULT 26 /* Default height of horizontal panel */
44#define PANEL_WIDTH_DEFAULT 26 /* Default "height" of vertical panel: not yet finished, will be wide */
45#define PANEL_HEIGHT_MAX 200 /* Maximum height of panel */
46#define PANEL_HEIGHT_MIN 16 /* Minimum height of panel */
a52c2257 47
95095259
HJYP
48/* to check if we are in LXDE */
49extern gboolean is_in_lxde;
50
cf701cb7 51typedef struct _Panel Panel;
a52c2257 52
cf701cb7 53struct _Panel{
8110399f 54 char* name;
a52c2257
HJYP
55 GtkWidget *topgwin; /* main panel window */
56 Window topxwin; /* and it X window */
176fb687 57 GdkDisplay *display; /* Main panel's GdkDisplay */
fea7d894 58 GtkStyle *defstyle;
a97d06a6 59 GtkWidget *box; /* primary layout box which contains all plugins */
e2957bd2 60
a52c2257
HJYP
61 GtkRequisition requisition;
62 GtkWidget *(*my_box_new) (gboolean, gint);
63 GtkWidget *(*my_separator_new) ();
64
65 FbBg *bg;
66 int alpha;
67 guint32 tintcolor;
2de71c90 68 guint32 fontcolor;
a52c2257 69 GdkColor gtintcolor;
2de71c90 70 GdkColor gfontcolor;
bee4c26e 71
a52c2257
HJYP
72 int ax, ay, aw, ah; /* prefferd allocation of a panel */
73 int cx, cy, cw, ch; /* current allocation (as reported by configure event) allocation */
74 int allign, edge, margin;
75 int orientation;
76 int widthtype, width;
77 int heighttype, height;
d1d43629 78 gulong strut_size; /* Values for WM_STRUT_PARTIAL */
79 gulong strut_lower;
80 gulong strut_upper;
a52c2257 81
930af9fd 82 guint config_changed : 1;
4b93d81e
HJYP
83 guint self_destroy : 1;
84 guint setdocktype : 1;
85 guint setstrut : 1;
86 guint round_corners : 1;
87 guint usefontcolor : 1;
88 guint transparent : 1;
89 guint background : 1;
90 guint spacing;
bee4c26e 91
176fb687 92 guint autohide : 1;
93 guint visible : 1;
94 int height_when_hidden;
95 guint hide_timeout;
96
a52c2257
HJYP
97 int desknum;
98 int curdesk;
99 guint32 *workarea;
100 int wa_len;
101
2de71c90 102 char* background_file;
389975e0 103
a52c2257
HJYP
104 int plug_num;
105 GList *plugins;
e996608e 106
5297da29 107 GSList* system_menus;
239cb032 108
4b93d81e 109 GtkWidget* pref_dialog; /* preference dialog */
e7a42ecf 110 GtkWidget* margin_control; /* Margin control in preference dialog */
9dd114c4 111 GtkWidget* height_label; /* Label of height control */
112 GtkWidget* width_label; /* Label of width control */
113 GtkWidget* height_control; /* Height control in preference dialog */
cf701cb7 114};
a52c2257
HJYP
115
116
bee4c26e 117typedef struct {
a52c2257
HJYP
118 unsigned int modal : 1;
119 unsigned int sticky : 1;
120 unsigned int maximized_vert : 1;
121 unsigned int maximized_horz : 1;
122 unsigned int shaded : 1;
123 unsigned int skip_taskbar : 1;
124 unsigned int skip_pager : 1;
125 unsigned int hidden : 1;
126 unsigned int fullscreen : 1;
127 unsigned int above : 1;
128 unsigned int below : 1;
22242ed4 129} NetWMState;
a52c2257 130
bee4c26e 131typedef struct {
a52c2257
HJYP
132 unsigned int desktop : 1;
133 unsigned int dock : 1;
134 unsigned int toolbar : 1;
135 unsigned int menu : 1;
136 unsigned int utility : 1;
137 unsigned int splash : 1;
138 unsigned int dialog : 1;
139 unsigned int normal : 1;
22242ed4 140} NetWMWindowType;
a52c2257
HJYP
141
142typedef struct {
143 char *name;
08ea5341 144 char *disp_name;
a52c2257 145 void (*cmd)(void);
22242ed4 146} Command;
a52c2257 147
22242ed4 148extern Command commands[];
a52c2257
HJYP
149
150extern gchar *cprofile;
151
152extern Atom a_UTF8_STRING;
153extern Atom a_XROOTPMAP_ID;
154
155extern Atom a_WM_STATE;
156extern Atom a_WM_CLASS;
157extern Atom a_WM_DELETE_WINDOW;
158extern Atom a_WM_PROTOCOLS;
159extern Atom a_NET_WORKAREA;
160extern Atom a_NET_CLIENT_LIST;
161extern Atom a_NET_CLIENT_LIST_STACKING;
162extern Atom a_NET_NUMBER_OF_DESKTOPS;
163extern Atom a_NET_CURRENT_DESKTOP;
c0aed50f 164extern Atom a_NET_DESKTOP_VIEWPORT;
a52c2257
HJYP
165extern Atom a_NET_DESKTOP_NAMES;
166extern Atom a_NET_ACTIVE_WINDOW;
167extern Atom a_NET_CLOSE_WINDOW;
168extern Atom a_NET_SUPPORTED;
169extern Atom a_NET_WM_STATE;
170extern Atom a_NET_WM_STATE_SKIP_TASKBAR;
171extern Atom a_NET_WM_STATE_SKIP_PAGER;
172extern Atom a_NET_WM_STATE_STICKY;
173extern Atom a_NET_WM_STATE_HIDDEN;
174extern Atom a_NET_WM_STATE_SHADED;
175
176#define a_NET_WM_STATE_REMOVE 0 /* remove/unset property */
177#define a_NET_WM_STATE_ADD 1 /* add/set property */
178#define a_NET_WM_STATE_TOGGLE 2 /* toggle property */
179
180extern Atom a_NET_WM_WINDOW_TYPE;
181extern Atom a_NET_WM_WINDOW_TYPE_DESKTOP;
182extern Atom a_NET_WM_WINDOW_TYPE_DOCK;
183extern Atom a_NET_WM_WINDOW_TYPE_TOOLBAR;
184extern Atom a_NET_WM_WINDOW_TYPE_MENU;
185extern Atom a_NET_WM_WINDOW_TYPE_UTILITY;
186extern Atom a_NET_WM_WINDOW_TYPE_SPLASH;
187extern Atom a_NET_WM_WINDOW_TYPE_DIALOG;
188extern Atom a_NET_WM_WINDOW_TYPE_NORMAL;
bee4c26e 189
a52c2257
HJYP
190extern Atom a_NET_WM_DESKTOP;
191extern Atom a_NET_WM_NAME;
192extern Atom a_NET_WM_VISIBLE_NAME;
193extern Atom a_NET_WM_STRUT;
194extern Atom a_NET_WM_STRUT_PARTIAL;
195extern Atom a_NET_WM_ICON;
196extern Atom a_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR;
197
77886b88 198extern Atom a_LXPANEL_CMD; /* for private client message */
a52c2257
HJYP
199
200extern int verbose;
201
202extern FbEv *fbev;
203
204#define FBPANEL_WIN(win) gdk_window_lookup(win)
205
e7a42ecf 206void panel_apply_icon(GtkWindow *w);
47fddea1 207void panel_destroy(Panel *p);
9dd114c4 208void panel_adjust_geometry_terminology(Panel *p);
176fb687 209void panel_establish_autohide(Panel *p);
22242ed4
HJYP
210void panel_set_wm_strut(Panel *p);
211void panel_set_dock_type(Panel *p);
212void panel_set_orientation(Panel *p);
213void panel_update_background( Panel* p );
bee4c26e 214
cf701cb7
HJYP
215extern const char* lxpanel_get_file_manager();
216extern const char* lxpanel_get_terminal();
217
a52c2257 218#endif