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