mirror of
https://github.com/amiwm/amiwm.git
synced 2026-04-14 11:04:18 +00:00
Previously, adding a new atom into the code required: 1. In <icc.h>, add the line `extern Atom my_new_atom;` declaring the new atom. 2. In <icc.c>, add the line `Atom my_new_atom;` defining the new atom. 3. In <icc.c>, add the line `my_new_atom = XInternAtom(dpy, "MY_NEW_ATOM", False);` interning this new atom, and assigning the interned value to the variable. Now, just add a line with the atom's name in the X-MACRO in <icc.h>, and a XInternAtoms(3) and a set of macros will do the rest. All new atoms will be referred to as an entry in the ATOMS[] array. For example: ATOMS[MY_NEW_ATOM] The exception are for those REALLY OLD atoms that have already a dedicated compile-time-known value defined at <X11/Xatom.h>. Those do not need to be interned; and are referred to with a constant beginning with the `XA_` prefix. For example: XA_WM_CLASS
64 lines
1.3 KiB
C
64 lines
1.3 KiB
C
#ifndef ICC_H
|
|
#define ICC_H
|
|
|
|
#include <X11/Xlib.h>
|
|
#include <X11/Xatom.h>
|
|
#include "client.h"
|
|
|
|
extern void init_atoms(void);
|
|
extern void setsupports(Window, Window);
|
|
extern void sendcmessage(Window, Atom, long);
|
|
extern void getproto(Client *c);
|
|
extern void getwmstate(Client *c);
|
|
extern void setwmstate(Client *c);
|
|
extern void setstringprop(Window, Atom, char *);
|
|
extern void propertychange(Client *, Atom);
|
|
extern long _getprop(Window, Atom, Atom, long, char **);
|
|
extern void getwflags(Client *);
|
|
extern Window get_transient_for(Window);
|
|
|
|
#define Pdelete 1
|
|
#define Ptakefocus 2
|
|
#define Psizebottom 4
|
|
#define Psizeright 8
|
|
#define Psizetrans 16
|
|
|
|
#define mkcmessage(w, a, x, ...) (&(XEvent){.xclient = { \
|
|
.type = ClientMessage, \
|
|
.window = (w), \
|
|
.message_type = (a), \
|
|
.format = 32, \
|
|
.data.l = {(long)(x), CurrentTime, __VA_ARGS__}, \
|
|
}})
|
|
|
|
#define ATOMS_TABLE(X) \
|
|
X(AMIWM_APPICONMSG) \
|
|
X(AMIWM_APPWINDOWMSG) \
|
|
X(AMIWM_SCREEN) \
|
|
X(AMIWM_WFLAGS) \
|
|
X(UTF8_STRING) \
|
|
X(WM_CHANGE_STATE) \
|
|
X(WM_CLASS) \
|
|
X(WM_COLORMAP_WINDOWS) \
|
|
X(WM_DELETE_WINDOW) \
|
|
X(WM_PROTOCOLS) \
|
|
X(WM_STATE) \
|
|
X(WM_TAKE_FOCUS) \
|
|
X(_NET_SUPPORTED) \
|
|
X(_NET_SUPPORTING_WM_CHECK) \
|
|
X(_NET_WM_NAME) \
|
|
X(_NET_WM_STATE) \
|
|
X(_NET_WM_STATE_FULLSCREEN) \
|
|
X(__SWM_VROOT)
|
|
|
|
enum {
|
|
#define X(atom) atom,
|
|
ATOMS_TABLE(X)
|
|
NATOMS
|
|
#undef X
|
|
};
|
|
|
|
extern Atom ATOMS[NATOMS];
|
|
|
|
#endif
|