nsf / bmpanel

bmpanel - lightweight, netwm compliant, x11 panel with desktop switcher, taskbar, systray and clock

This URL has Read+Write access

bmpanel / src / bmpanel.h
100644 113 lines (98 sloc) 1.795 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/*
* Copyright (C) 2008 nsf
*/
 
#ifndef BMPANEL_BMPANEL_H
#define BMPANEL_BMPANEL_H
 
#include <X11/Xlib.h>
#include <X11/Xatom.h>
 
/* composite */
#if defined(WITH_COMPOSITE)
#include <X11/extensions/Xrender.h>
#endif
 
#include <Imlib2.h>
#include "common.h"
 
struct task {
struct task *next;
char *name;
Window win;
Imlib_Image icon;
int posx;
int width;
int desktop;
uint focused;
uint iconified;
};
 
struct desktop {
struct desktop *next;
char *name;
int posx;
int width;
uint focused;
};
 
struct tray {
struct tray *next;
Window win;
int x;
int y;
};
 
struct panel {
Window win;
struct task *tasks;
struct desktop *desktops;
struct theme *theme;
struct tray *trayicons;
Window trayselowner;
int width;
int x;
int y;
};
 
enum {
XATOM_WM_STATE,
XATOM_NET_DESKTOP_NAMES,
XATOM_NET_WM_STATE,
XATOM_NET_ACTIVE_WINDOW,
XATOM_NET_WM_NAME,
XATOM_NET_WM_ICON_NAME,
XATOM_NET_WM_VISIBLE_ICON_NAME,
XATOM_NET_WORKAREA,
XATOM_NET_WM_ICON,
XATOM_NET_WM_VISIBLE_NAME,
XATOM_NET_WM_STATE_SKIP_TASKBAR,
XATOM_NET_WM_STATE_SHADED,
XATOM_NET_WM_STATE_HIDDEN,
XATOM_NET_WM_DESKTOP,
XATOM_NET_MOVERESIZE_WINDOW,
XATOM_NET_WM_WINDOW_TYPE,
XATOM_NET_WM_WINDOW_TYPE_DOCK,
XATOM_NET_WM_WINDOW_TYPE_DESKTOP,
XATOM_NET_WM_STRUT,
XATOM_NET_WM_STRUT_PARTIAL,
XATOM_NET_CLIENT_LIST,
XATOM_NET_NUMBER_OF_DESKTOPS,
XATOM_NET_CURRENT_DESKTOP,
XATOM_NET_SYSTEM_TRAY_OPCODE,
XATOM_UTF8_STRING,
XATOM_MOTIF_WM_HINTS,
XATOM_XROOTPMAP_ID,
XATOM_COUNT
};
 
struct xinfo {
Display *display;
int screen;
int screen_width;
int screen_height;
 
int wa_x;
int wa_y;
int wa_w;
int wa_h;
 
Visual *visual;
Colormap colmap;
XSetWindowAttributes attrs;
uint32_t amask;
int depth;
 
Window root;
Pixmap rootpmap;
Atom atoms[XATOM_COUNT];
Atom trayselatom;
};
 
#endif