Initial import.
[lxde/lxpanel.git] / src / panel.h
CommitLineData
a52c2257
HJYP
1#ifndef PANEL_H
2#define PANEL_H
3
4
5#include <X11/Xlib.h>
6#include <gtk/gtk.h>
7#include <gdk/gdk.h>
8
9#include "config.h"
10
11#include "bg.h"
12#include "ev.h"
13
14enum { ALLIGN_NONE, ALLIGN_LEFT, ALLIGN_CENTER, ALLIGN_RIGHT };
15enum { EDGE_NONE, EDGE_LEFT, EDGE_RIGHT, EDGE_TOP, EDGE_BOTTOM };
16enum { WIDTH_NONE, WIDTH_REQUEST, WIDTH_PIXEL, WIDTH_PERCENT };
17enum { HEIGHT_NONE, HEIGHT_PIXEL, HEIGHT_REQUEST };
18enum { ORIENT_NONE, ORIENT_VERT, ORIENT_HORIZ };
19enum { POS_NONE, POS_START, POS_END };
20
21#define PANEL_HEIGHT_DEFAULT 26
22#define PANEL_HEIGHT_MAX 200
23#define PANEL_HEIGHT_MIN 16
24
25
26typedef struct {
27
28 GtkWidget *topgwin; /* main panel window */
29 Window topxwin; /* and it X window */
30 GtkWidget *lbox; /* primary layout box */
31 GtkWidget *bbox; /* backgound box for box */
32 GtkWidget *box; /* box that contains all plugins */
33 GtkRequisition requisition;
34 GtkWidget *(*my_box_new) (gboolean, gint);
35 GtkWidget *(*my_separator_new) ();
36
37 FbBg *bg;
38 int alpha;
39 guint32 tintcolor;
40 GdkColor gtintcolor;
41
42 int ax, ay, aw, ah; /* prefferd allocation of a panel */
43 int cx, cy, cw, ch; /* current allocation (as reported by configure event) allocation */
44 int allign, edge, margin;
45 int orientation;
46 int widthtype, width;
47 int heighttype, height;
48
49 int self_destroy : 1;
50 int setdocktype : 1;
51 int setstrut : 1;
52 int round_corners : 1;
53 int transparent : 1;
54 int spacing;
55
56 int desknum;
57 int curdesk;
58 guint32 *workarea;
59 int wa_len;
60
61 int plug_num;
62 GList *plugins;
63
64} panel;
65
66
67typedef struct {
68 unsigned int modal : 1;
69 unsigned int sticky : 1;
70 unsigned int maximized_vert : 1;
71 unsigned int maximized_horz : 1;
72 unsigned int shaded : 1;
73 unsigned int skip_taskbar : 1;
74 unsigned int skip_pager : 1;
75 unsigned int hidden : 1;
76 unsigned int fullscreen : 1;
77 unsigned int above : 1;
78 unsigned int below : 1;
79} net_wm_state;
80
81typedef struct {
82 unsigned int desktop : 1;
83 unsigned int dock : 1;
84 unsigned int toolbar : 1;
85 unsigned int menu : 1;
86 unsigned int utility : 1;
87 unsigned int splash : 1;
88 unsigned int dialog : 1;
89 unsigned int normal : 1;
90} net_wm_window_type;
91
92typedef struct {
93 char *name;
94 void (*cmd)(void);
95} command;
96
97extern command commands[];
98
99extern gchar *cprofile;
100
101extern Atom a_UTF8_STRING;
102extern Atom a_XROOTPMAP_ID;
103
104extern Atom a_WM_STATE;
105extern Atom a_WM_CLASS;
106extern Atom a_WM_DELETE_WINDOW;
107extern Atom a_WM_PROTOCOLS;
108extern Atom a_NET_WORKAREA;
109extern Atom a_NET_CLIENT_LIST;
110extern Atom a_NET_CLIENT_LIST_STACKING;
111extern Atom a_NET_NUMBER_OF_DESKTOPS;
112extern Atom a_NET_CURRENT_DESKTOP;
113extern Atom a_NET_DESKTOP_NAMES;
114extern Atom a_NET_ACTIVE_WINDOW;
115extern Atom a_NET_CLOSE_WINDOW;
116extern Atom a_NET_SUPPORTED;
117extern Atom a_NET_WM_STATE;
118extern Atom a_NET_WM_STATE_SKIP_TASKBAR;
119extern Atom a_NET_WM_STATE_SKIP_PAGER;
120extern Atom a_NET_WM_STATE_STICKY;
121extern Atom a_NET_WM_STATE_HIDDEN;
122extern Atom a_NET_WM_STATE_SHADED;
123
124#define a_NET_WM_STATE_REMOVE 0 /* remove/unset property */
125#define a_NET_WM_STATE_ADD 1 /* add/set property */
126#define a_NET_WM_STATE_TOGGLE 2 /* toggle property */
127
128extern Atom a_NET_WM_WINDOW_TYPE;
129extern Atom a_NET_WM_WINDOW_TYPE_DESKTOP;
130extern Atom a_NET_WM_WINDOW_TYPE_DOCK;
131extern Atom a_NET_WM_WINDOW_TYPE_TOOLBAR;
132extern Atom a_NET_WM_WINDOW_TYPE_MENU;
133extern Atom a_NET_WM_WINDOW_TYPE_UTILITY;
134extern Atom a_NET_WM_WINDOW_TYPE_SPLASH;
135extern Atom a_NET_WM_WINDOW_TYPE_DIALOG;
136extern Atom a_NET_WM_WINDOW_TYPE_NORMAL;
137
138extern Atom a_NET_WM_DESKTOP;
139extern Atom a_NET_WM_NAME;
140extern Atom a_NET_WM_VISIBLE_NAME;
141extern Atom a_NET_WM_STRUT;
142extern Atom a_NET_WM_STRUT_PARTIAL;
143extern Atom a_NET_WM_ICON;
144extern Atom a_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR;
145
146
147extern int verbose;
148
149extern FbEv *fbev;
150
151#define FBPANEL_WIN(win) gdk_window_lookup(win)
152
153#endif