Adding debian version 0.4.1+svn20090524-2.
[debian/lxpanel.git] / src / panel.h
CommitLineData
6cc5e1a6
DB
1/**
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
19#ifndef PANEL_H
20#define PANEL_H
21
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 };
35enum {
36 ORIENT_NONE = -1,
37 ORIENT_VERT = GTK_ORIENTATION_VERTICAL,
38 ORIENT_HORIZ = GTK_ORIENTATION_HORIZONTAL
39};
40enum { POS_NONE, POS_START, POS_END };
41
42#define PANEL_HEIGHT_DEFAULT 26
43#define PANEL_HEIGHT_MAX 200
44#define PANEL_HEIGHT_MIN 16
45
10862fa6
DB
46/* to check if we are in LXDE */
47extern gboolean is_in_lxde;
48
6cc5e1a6
DB
49typedef struct _Panel Panel;
50
51struct _Panel{
52 char* name;
53 GtkWidget *topgwin; /* main panel window */
54 Window topxwin; /* and it X window */
55 GtkStyle *defstyle;
56 GtkWidget *box; /* primary layout box which contains all plugins */
10862fa6 57
6cc5e1a6
DB
58 GtkRequisition requisition;
59 GtkWidget *(*my_box_new) (gboolean, gint);
60 GtkWidget *(*my_separator_new) ();
61
62 FbBg *bg;
63 int alpha;
64 guint32 tintcolor;
65 guint32 fontcolor;
66 GdkColor gtintcolor;
67 GdkColor gfontcolor;
68
69 int ax, ay, aw, ah; /* prefferd allocation of a panel */
70 int cx, cy, cw, ch; /* current allocation (as reported by configure event) allocation */
71 int allign, edge, margin;
72 int orientation;
73 int widthtype, width;
74 int heighttype, height;
75
b3df3353 76 guint config_changed : 1;
6cc5e1a6
DB
77 guint self_destroy : 1;
78 guint setdocktype : 1;
79 guint setstrut : 1;
80 guint round_corners : 1;
81 guint usefontcolor : 1;
82 guint transparent : 1;
83 guint background : 1;
84 guint spacing;
85
86 int desknum;
87 int curdesk;
88 guint32 *workarea;
89 int wa_len;
90
91 char* background_file;
92
93 int plug_num;
94 GList *plugins;
95
96 GSList* system_menus;
97
6cc5e1a6
DB
98 GtkWidget* pref_dialog; /* preference dialog */
99};
100
101
102typedef struct {
103 unsigned int modal : 1;
104 unsigned int sticky : 1;
105 unsigned int maximized_vert : 1;
106 unsigned int maximized_horz : 1;
107 unsigned int shaded : 1;
108 unsigned int skip_taskbar : 1;
109 unsigned int skip_pager : 1;
110 unsigned int hidden : 1;
111 unsigned int fullscreen : 1;
112 unsigned int above : 1;
113 unsigned int below : 1;
114} NetWMState;
115
116typedef struct {
117 unsigned int desktop : 1;
118 unsigned int dock : 1;
119 unsigned int toolbar : 1;
120 unsigned int menu : 1;
121 unsigned int utility : 1;
122 unsigned int splash : 1;
123 unsigned int dialog : 1;
124 unsigned int normal : 1;
125} NetWMWindowType;
126
127typedef struct {
128 char *name;
129 char *disp_name;
130 void (*cmd)(void);
131} Command;
132
133extern Command commands[];
134
135extern gchar *cprofile;
136
137extern Atom a_UTF8_STRING;
138extern Atom a_XROOTPMAP_ID;
139
140extern Atom a_WM_STATE;
141extern Atom a_WM_CLASS;
142extern Atom a_WM_DELETE_WINDOW;
143extern Atom a_WM_PROTOCOLS;
144extern Atom a_NET_WORKAREA;
145extern Atom a_NET_CLIENT_LIST;
146extern Atom a_NET_CLIENT_LIST_STACKING;
147extern Atom a_NET_NUMBER_OF_DESKTOPS;
148extern Atom a_NET_CURRENT_DESKTOP;
149extern Atom a_NET_DESKTOP_VIEWPORT;
150extern Atom a_NET_DESKTOP_NAMES;
151extern Atom a_NET_ACTIVE_WINDOW;
152extern Atom a_NET_CLOSE_WINDOW;
153extern Atom a_NET_SUPPORTED;
154extern Atom a_NET_WM_STATE;
155extern Atom a_NET_WM_STATE_SKIP_TASKBAR;
156extern Atom a_NET_WM_STATE_SKIP_PAGER;
157extern Atom a_NET_WM_STATE_STICKY;
158extern Atom a_NET_WM_STATE_HIDDEN;
159extern Atom a_NET_WM_STATE_SHADED;
160
161#define a_NET_WM_STATE_REMOVE 0 /* remove/unset property */
162#define a_NET_WM_STATE_ADD 1 /* add/set property */
163#define a_NET_WM_STATE_TOGGLE 2 /* toggle property */
164
165extern Atom a_NET_WM_WINDOW_TYPE;
166extern Atom a_NET_WM_WINDOW_TYPE_DESKTOP;
167extern Atom a_NET_WM_WINDOW_TYPE_DOCK;
168extern Atom a_NET_WM_WINDOW_TYPE_TOOLBAR;
169extern Atom a_NET_WM_WINDOW_TYPE_MENU;
170extern Atom a_NET_WM_WINDOW_TYPE_UTILITY;
171extern Atom a_NET_WM_WINDOW_TYPE_SPLASH;
172extern Atom a_NET_WM_WINDOW_TYPE_DIALOG;
173extern Atom a_NET_WM_WINDOW_TYPE_NORMAL;
174
175extern Atom a_NET_WM_DESKTOP;
176extern Atom a_NET_WM_NAME;
177extern Atom a_NET_WM_VISIBLE_NAME;
178extern Atom a_NET_WM_STRUT;
179extern Atom a_NET_WM_STRUT_PARTIAL;
180extern Atom a_NET_WM_ICON;
181extern Atom a_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR;
182
183extern Atom a_LXPANEL_CMD; /* for private client message */
184
185extern int verbose;
186
187extern FbEv *fbev;
188
189#define FBPANEL_WIN(win) gdk_window_lookup(win)
190
10862fa6 191void panel_destroy(Panel *p);
6cc5e1a6
DB
192void panel_set_wm_strut(Panel *p);
193void panel_set_dock_type(Panel *p);
194void panel_set_orientation(Panel *p);
195void panel_update_background( Panel* p );
196
197extern const char* lxpanel_get_file_manager();
198extern const char* lxpanel_get_terminal();
199
200#endif