add set functions for all the client props that need em
[mikachu/openbox.git] / cwmcc / atom.c
1 #include "cwmcc_internal.h"
2 #include "atom.h"
3 #include <glib.h>
4
5 struct TypeAtoms cwmcc_atom_type;
6 struct ClientAtoms cwmcc_atom_client;
7 struct RootAtoms cwmcc_atom_root;
8 struct DataAtoms cwmcc_atom_data;
9
10 #define CREATE(type, var, name) (cwmcc_atom_##type.var = \
11                                  XInternAtom(cwmcc_display, name, FALSE))
12 #define SETVALUE(type, var, value) (cwmcc_atom_##type.var = value)
13
14 void atom_startup()
15 {
16     CREATE(type, cardinal, "CARDINAL");
17     CREATE(type, window, "WINDOW");
18     CREATE(type, pixmap, "PIXMAP");
19     CREATE(type, atom, "ATOM");
20     CREATE(type, string, "STRING");
21     CREATE(type, utf8, "UTF8_STRING");
22      
23     CREATE(client, wm_protocols, "WM_PROTOCOLS");
24     CREATE(client, wm_state, "WM_STATE");
25     CREATE(client, wm_name, "WM_NAME");
26     CREATE(client, wm_icon_name, "WM_ICON_NAME");
27     CREATE(client, wm_class, "WM_CLASS");
28     CREATE(client, wm_window_role, "WM_WINDOW_ROLE");
29     CREATE(client, motif_wm_hints, "_MOTIF_WM_HINTS");
30     CREATE(client, net_wm_name, "_NET_WM_NAME");
31     CREATE(client, net_wm_visible_name, "_NET_WM_VISIBLE_NAME");
32     CREATE(client, net_wm_icon_name, "_NET_WM_ICON_NAME");
33     CREATE(client, net_wm_visible_icon_name, "_NET_WM_VISIBLE_ICON_NAME");
34     CREATE(client, net_wm_desktop, "_NET_WM_DESKTOP");
35     CREATE(client, net_wm_window_type, "_NET_WM_WINDOW_TYPE");
36     CREATE(client, net_wm_state, "_NET_WM_STATE");
37     CREATE(client, net_wm_strut, "_NET_WM_STRUT");
38     CREATE(client, net_wm_icon, "_NET_WM_ICON");
39     CREATE(client, net_wm_allowed_actions, "_NET_WM_ALLOWED_ACTIONS");
40     CREATE(client, kwm_win_icon, "KWM_WIN_ICON");
41     CREATE(client, openbox_premax, "_OPENBOX_PREMAX");
42     
43     CREATE(root, net_supported, "_NET_SUPPORTED");
44     CREATE(root, net_client_list, "_NET_CLIENT_LIST");
45     CREATE(root, net_client_list_stacking, "_NET_CLIENT_LIST_STACKING");
46     CREATE(root, net_number_of_desktops, "_NET_NUMBER_OF_DESKTOPS");
47     CREATE(root, net_desktop_geometry, "_NET_DESKTOP_GEOMETRY");
48     CREATE(root, net_desktop_viewport, "_NET_DESKTOP_VIEWPORT");
49     CREATE(root, net_current_desktop, "_NET_CURRENT_DESKTOP");
50     CREATE(root, net_desktop_names, "_NET_DESKTOP_NAMES");
51     CREATE(root, net_active_window, "_NET_ACTIVE_WINDOW");
52     CREATE(root, net_workarea, "_NET_WORKAREA");
53     CREATE(root, net_supporting_wm_check, "_NET_SUPPORTING_WM_CHECK");
54     CREATE(root, net_desktop_layout, "_NET_DESKTOP_LAYOUT");
55     CREATE(root, net_showing_desktop, "_NET_SHOWING_DESKTOP");
56     CREATE(root, openbox_pid, "_OPENBOX_PID");
57
58     CREATE(data, wm_delete_window, "WM_DELETE_WINDOW");
59     CREATE(data, wm_take_focus, "WM_TAKE_FOCUS");
60     CREATE(data, wm_change_state, "WM_CHANGE_STATE");
61     CREATE(data, net_close_window, "_NET_CLOSE_WINDOW");
62     CREATE(data, net_wm_moveresize, "_NET_WM_MOVERESIZE");
63
64     CREATE(data, net_wm_window_type_desktop, "_NET_WM_WINDOW_TYPE_DESKTOP");
65     CREATE(data, net_wm_window_type_dock, "_NET_WM_WINDOW_TYPE_DOCK");
66     CREATE(data, net_wm_window_type_toolbar, "_NET_WM_WINDOW_TYPE_TOOLBAR");
67     CREATE(data, net_wm_window_type_menu, "_NET_WM_WINDOW_TYPE_MENU");
68     CREATE(data, net_wm_window_type_utility, "_NET_WM_WINDOW_TYPE_UTILITY");
69     CREATE(data, net_wm_window_type_splash, "_NET_WM_WINDOW_TYPE_SPLASH");
70     CREATE(data, net_wm_window_type_dialog, "_NET_WM_WINDOW_TYPE_DIALOG");
71     CREATE(data, net_wm_window_type_normal, "_NET_WM_WINDOW_TYPE_NORMAL");
72     CREATE(data, kde_net_wm_window_type_override,
73            "_KDE_NET_WM_WINDOW_TYPE_OVERRIDE");
74
75     SETVALUE(data, net_wm_moveresize_size_topleft, 0);
76     SETVALUE(data, net_wm_moveresize_size_topright, 2);
77     SETVALUE(data, net_wm_moveresize_size_bottomright, 4);
78     SETVALUE(data, net_wm_moveresize_size_bottomleft, 6);
79     SETVALUE(data, net_wm_moveresize_move, 8);
80
81     CREATE(data, net_wm_action_move, "_NET_WM_ACTION_MOVE");
82     CREATE(data, net_wm_action_resize, "_NET_WM_ACTION_RESIZE");
83     CREATE(data, net_wm_action_minimize, "_NET_WM_ACTION_MINIMIZE");
84     CREATE(data, net_wm_action_shade, "_NET_WM_ACTION_SHADE");
85     CREATE(data, net_wm_action_stick, "_NET_WM_ACTION_STICK");
86     CREATE(data, net_wm_action_maximize_horz, "_NET_WM_ACTION_MAXIMIZE_HORZ");
87     CREATE(data, net_wm_action_maximize_vert, "_NET_WM_ACTION_MAXIMIZE_VERT");
88     CREATE(data, net_wm_action_fullscreen, "_NET_WM_ACTION_FULLSCREEN");
89     CREATE(data, net_wm_action_change_desktop,"_NET_WM_ACTION_CHANGE_DESKTOP");
90     CREATE(data, net_wm_action_close, "_NET_WM_ACTION_CLOSE");
91
92     CREATE(data, net_wm_state_modal, "_NET_WM_STATE_MODAL");
93     CREATE(data, net_wm_state_sticky, "_NET_WM_STATE_STICKY");
94     CREATE(data, net_wm_state_maximized_vert, "_NET_WM_STATE_MAXIMIZED_VERT");
95     CREATE(data, net_wm_state_maximized_horz, "_NET_WM_STATE_MAXIMIZED_HORZ");
96     CREATE(data, net_wm_state_shaded, "_NET_WM_STATE_SHADED");
97     CREATE(data, net_wm_state_skip_taskbar, "_NET_WM_STATE_SKIP_TASKBAR");
98     CREATE(data, net_wm_state_skip_pager, "_NET_WM_STATE_SKIP_PAGER");
99     CREATE(data, net_wm_state_hidden, "_NET_WM_STATE_HIDDEN");
100     CREATE(data, net_wm_state_fullscreen, "_NET_WM_STATE_FULLSCREEN");
101     CREATE(data, net_wm_state_above, "_NET_WM_STATE_ABOVE");
102     CREATE(data, net_wm_state_below, "_NET_WM_STATE_BELOW");
103
104     SETVALUE(data, net_wm_state_remove, 0);
105     SETVALUE(data, net_wm_state_add, 1);
106     SETVALUE(data, net_wm_state_toggle, 2);
107
108     SETVALUE(data, net_wm_orientation_horz, 0);
109     SETVALUE(data, net_wm_orientation_vert, 1);
110     SETVALUE(data, net_wm_topleft, 0);
111     SETVALUE(data, net_wm_topright, 1);
112     SETVALUE(data, net_wm_bottomright, 2);
113     SETVALUE(data, net_wm_bottomleft, 3);
114 }