Adding upstream version 0.3.5.2+svn20080509.
[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
72 guint self_destroy : 1;
73 guint setdocktype : 1;
74 guint setstrut : 1;
75 guint round_corners : 1;
76 guint usefontcolor : 1;
77 guint transparent : 1;
78 guint background : 1;
79 guint spacing;
80
81 int desknum;
82 int curdesk;
83 guint32 *workarea;
84 int wa_len;
85
86 char* background_file;
87
88 int plug_num;
89 GList *plugins;
90
91 GSList* system_menus;
92
93 /* tooltip controller shared by many plugins */
94 GtkTooltips *tooltips;
95 GtkWidget* pref_dialog; /* preference dialog */
96};
97
98
99typedef struct {
100 unsigned int modal : 1;
101 unsigned int sticky : 1;
102 unsigned int maximized_vert : 1;
103 unsigned int maximized_horz : 1;
104 unsigned int shaded : 1;
105 unsigned int skip_taskbar : 1;
106 unsigned int skip_pager : 1;
107 unsigned int hidden : 1;
108 unsigned int fullscreen : 1;
109 unsigned int above : 1;
110 unsigned int below : 1;
111} NetWMState;
112
113typedef struct {
114 unsigned int desktop : 1;
115 unsigned int dock : 1;
116 unsigned int toolbar : 1;
117 unsigned int menu : 1;
118 unsigned int utility : 1;
119 unsigned int splash : 1;
120 unsigned int dialog : 1;
121 unsigned int normal : 1;
122} NetWMWindowType;
123
124typedef struct {
125 char *name;
126 char *disp_name;
127 void (*cmd)(void);
128} Command;
129
130extern Command commands[];
131
132extern gchar *cprofile;
133
134extern Atom a_UTF8_STRING;
135extern Atom a_XROOTPMAP_ID;
136
137extern Atom a_WM_STATE;
138extern Atom a_WM_CLASS;
139extern Atom a_WM_DELETE_WINDOW;
140extern Atom a_WM_PROTOCOLS;
141extern Atom a_NET_WORKAREA;
142extern Atom a_NET_CLIENT_LIST;
143extern Atom a_NET_CLIENT_LIST_STACKING;
144extern Atom a_NET_NUMBER_OF_DESKTOPS;
145extern Atom a_NET_CURRENT_DESKTOP;
146extern Atom a_NET_DESKTOP_VIEWPORT;
147extern Atom a_NET_DESKTOP_NAMES;
148extern Atom a_NET_ACTIVE_WINDOW;
149extern Atom a_NET_CLOSE_WINDOW;
150extern Atom a_NET_SUPPORTED;
151extern Atom a_NET_WM_STATE;
152extern Atom a_NET_WM_STATE_SKIP_TASKBAR;
153extern Atom a_NET_WM_STATE_SKIP_PAGER;
154extern Atom a_NET_WM_STATE_STICKY;
155extern Atom a_NET_WM_STATE_HIDDEN;
156extern Atom a_NET_WM_STATE_SHADED;
157
158#define a_NET_WM_STATE_REMOVE 0 /* remove/unset property */
159#define a_NET_WM_STATE_ADD 1 /* add/set property */
160#define a_NET_WM_STATE_TOGGLE 2 /* toggle property */
161
162extern Atom a_NET_WM_WINDOW_TYPE;
163extern Atom a_NET_WM_WINDOW_TYPE_DESKTOP;
164extern Atom a_NET_WM_WINDOW_TYPE_DOCK;
165extern Atom a_NET_WM_WINDOW_TYPE_TOOLBAR;
166extern Atom a_NET_WM_WINDOW_TYPE_MENU;
167extern Atom a_NET_WM_WINDOW_TYPE_UTILITY;
168extern Atom a_NET_WM_WINDOW_TYPE_SPLASH;
169extern Atom a_NET_WM_WINDOW_TYPE_DIALOG;
170extern Atom a_NET_WM_WINDOW_TYPE_NORMAL;
171
172extern Atom a_NET_WM_DESKTOP;
173extern Atom a_NET_WM_NAME;
174extern Atom a_NET_WM_VISIBLE_NAME;
175extern Atom a_NET_WM_STRUT;
176extern Atom a_NET_WM_STRUT_PARTIAL;
177extern Atom a_NET_WM_ICON;
178extern Atom a_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR;
179
180extern Atom a_LXPANEL_CMD; /* for private client message */
181
182extern int verbose;
183
184extern FbEv *fbev;
185
186#define FBPANEL_WIN(win) gdk_window_lookup(win)
187
188void panel_set_wm_strut(Panel *p);
189void panel_set_dock_type(Panel *p);
190void panel_set_orientation(Panel *p);
191void panel_update_background( Panel* p );
192
193extern const char* lxpanel_get_file_manager();
194extern const char* lxpanel_get_terminal();
195
196#endif