Use the # directive to simplify defines.

This commit is contained in:
Mikael Magnusson 2008-01-20 17:41:22 +01:00 committed by Dana Jansens
parent 8b23b1a5b4
commit 90ca468efa

View file

@ -28,8 +28,10 @@
Atom prop_atoms[OBT_PROP_NUM_ATOMS];
gboolean prop_started = FALSE;
#define CREATE(var, name) (prop_atoms[OBT_PROP_##var] = \
XInternAtom((obt_display), (name), FALSE))
#define CREATE_NAME(var, name) (prop_atoms[OBT_PROP_##var] = \
XInternAtom((obt_display), (name), FALSE))
#define CREATE(var) CREATE_NAME(var, #var)
#define CREATE_(var) CREATE_NAME(var, "_" #var)
void obt_prop_startup()
{
@ -38,89 +40,89 @@ void obt_prop_startup()
g_assert(obt_display);
CREATE(CARDINAL, "CARDINAL");
CREATE(WINDOW, "WINDOW");
CREATE(PIXMAP, "PIXMAP");
CREATE(ATOM, "ATOM");
CREATE(STRING, "STRING");
CREATE(UTF8, "UTF8_STRING");
CREATE(CARDINAL);
CREATE(WINDOW);
CREATE(PIXMAP);
CREATE(ATOM);
CREATE(STRING);
CREATE_NAME(UTF8, "UTF8_STRING");
CREATE(MANAGER, "MANAGER");
CREATE(MANAGER);
CREATE(WM_COLORMAP_WINDOWS, "WM_COLORMAP_WINDOWS");
CREATE(WM_PROTOCOLS, "WM_PROTOCOLS");
CREATE(WM_STATE, "WM_STATE");
CREATE(WM_CHANGE_STATE, "WM_CHANGE_STATE");
CREATE(WM_DELETE_WINDOW, "WM_DELETE_WINDOW");
CREATE(WM_TAKE_FOCUS, "WM_TAKE_FOCUS");
CREATE(WM_NAME, "WM_NAME");
CREATE(WM_ICON_NAME, "WM_ICON_NAME");
CREATE(WM_CLASS, "WM_CLASS");
CREATE(WM_WINDOW_ROLE, "WM_WINDOW_ROLE");
CREATE(WM_CLIENT_MACHINE, "WM_CLIENT_MACHINE");
CREATE(WM_COMMAND, "WM_COMMAND");
CREATE(WM_CLIENT_LEADER, "WM_CLIENT_LEADER");
CREATE(MOTIF_WM_HINTS, "_MOTIF_WM_HINTS");
CREATE(WM_COLORMAP_WINDOWS);
CREATE(WM_PROTOCOLS);
CREATE(WM_STATE);
CREATE(WM_CHANGE_STATE);
CREATE(WM_DELETE_WINDOW);
CREATE(WM_TAKE_FOCUS);
CREATE(WM_NAME);
CREATE(WM_ICON_NAME);
CREATE(WM_CLASS);
CREATE(WM_WINDOW_ROLE);
CREATE(WM_CLIENT_MACHINE);
CREATE(WM_COMMAND);
CREATE(WM_CLIENT_LEADER);
CREATE_(MOTIF_WM_HINTS);
CREATE(SM_CLIENT_ID, "SM_CLIENT_ID");
CREATE(SM_CLIENT_ID);
CREATE(NET_WM_FULL_PLACEMENT, "_NET_WM_FULL_PLACEMENT");
CREATE_(NET_WM_FULL_PLACEMENT);
CREATE(NET_SUPPORTED, "_NET_SUPPORTED");
CREATE(NET_CLIENT_LIST, "_NET_CLIENT_LIST");
CREATE(NET_CLIENT_LIST_STACKING, "_NET_CLIENT_LIST_STACKING");
CREATE(NET_NUMBER_OF_DESKTOPS, "_NET_NUMBER_OF_DESKTOPS");
CREATE(NET_DESKTOP_GEOMETRY, "_NET_DESKTOP_GEOMETRY");
CREATE(NET_DESKTOP_VIEWPORT, "_NET_DESKTOP_VIEWPORT");
CREATE(NET_CURRENT_DESKTOP, "_NET_CURRENT_DESKTOP");
CREATE(NET_DESKTOP_NAMES, "_NET_DESKTOP_NAMES");
CREATE(NET_ACTIVE_WINDOW, "_NET_ACTIVE_WINDOW");
/* CREATE(NET_RESTACK_WINDOW, "_NET_RESTACK_WINDOW");*/
CREATE(NET_WORKAREA, "_NET_WORKAREA");
CREATE(NET_SUPPORTING_WM_CHECK, "_NET_SUPPORTING_WM_CHECK");
CREATE(NET_DESKTOP_LAYOUT, "_NET_DESKTOP_LAYOUT");
CREATE(NET_SHOWING_DESKTOP, "_NET_SHOWING_DESKTOP");
CREATE_(NET_SUPPORTED);
CREATE_(NET_CLIENT_LIST);
CREATE_(NET_CLIENT_LIST_STACKING);
CREATE_(NET_NUMBER_OF_DESKTOPS);
CREATE_(NET_DESKTOP_GEOMETRY);
CREATE_(NET_DESKTOP_VIEWPORT);
CREATE_(NET_CURRENT_DESKTOP);
CREATE_(NET_DESKTOP_NAMES);
CREATE_(NET_ACTIVE_WINDOW);
/* CREATE_(NET_RESTACK_WINDOW);*/
CREATE_(NET_WORKAREA);
CREATE_(NET_SUPPORTING_WM_CHECK);
CREATE_(NET_DESKTOP_LAYOUT);
CREATE_(NET_SHOWING_DESKTOP);
CREATE(NET_CLOSE_WINDOW, "_NET_CLOSE_WINDOW");
CREATE(NET_WM_MOVERESIZE, "_NET_WM_MOVERESIZE");
CREATE(NET_MOVERESIZE_WINDOW, "_NET_MOVERESIZE_WINDOW");
CREATE(NET_REQUEST_FRAME_EXTENTS, "_NET_REQUEST_FRAME_EXTENTS");
CREATE(NET_RESTACK_WINDOW, "_NET_RESTACK_WINDOW");
CREATE_(NET_CLOSE_WINDOW);
CREATE_(NET_WM_MOVERESIZE);
CREATE_(NET_MOVERESIZE_WINDOW);
CREATE_(NET_REQUEST_FRAME_EXTENTS);
CREATE_(NET_RESTACK_WINDOW);
CREATE(NET_STARTUP_ID, "_NET_STARTUP_ID");
CREATE_(NET_STARTUP_ID);
CREATE(NET_WM_NAME, "_NET_WM_NAME");
CREATE(NET_WM_VISIBLE_NAME, "_NET_WM_VISIBLE_NAME");
CREATE(NET_WM_ICON_NAME, "_NET_WM_ICON_NAME");
CREATE(NET_WM_VISIBLE_ICON_NAME, "_NET_WM_VISIBLE_ICON_NAME");
CREATE(NET_WM_DESKTOP, "_NET_WM_DESKTOP");
CREATE(NET_WM_WINDOW_TYPE, "_NET_WM_WINDOW_TYPE");
CREATE(NET_WM_STATE, "_NET_WM_STATE");
CREATE(NET_WM_STRUT, "_NET_WM_STRUT");
CREATE(NET_WM_STRUT_PARTIAL, "_NET_WM_STRUT_PARTIAL");
CREATE(NET_WM_ICON, "_NET_WM_ICON");
CREATE(NET_WM_ICON_GEOMETRY, "_NET_WM_ICON_GEOMETRY");
CREATE(NET_WM_PID, "_NET_WM_PID");
CREATE(NET_WM_ALLOWED_ACTIONS, "_NET_WM_ALLOWED_ACTIONS");
CREATE(NET_WM_USER_TIME, "_NET_WM_USER_TIME");
/* CREATE(NET_WM_USER_TIME_WINDOW, "_NET_WM_USER_TIME_WINDOW"); */
CREATE(KDE_NET_WM_FRAME_STRUT, "_KDE_NET_WM_FRAME_STRUT");
CREATE(NET_FRAME_EXTENTS, "_NET_FRAME_EXTENTS");
CREATE_(NET_WM_NAME);
CREATE_(NET_WM_VISIBLE_NAME);
CREATE_(NET_WM_ICON_NAME);
CREATE_(NET_WM_VISIBLE_ICON_NAME);
CREATE_(NET_WM_DESKTOP);
CREATE_(NET_WM_WINDOW_TYPE);
CREATE_(NET_WM_STATE);
CREATE_(NET_WM_STRUT);
CREATE_(NET_WM_STRUT_PARTIAL);
CREATE_(NET_WM_ICON);
CREATE_(NET_WM_ICON_GEOMETRY);
CREATE_(NET_WM_PID);
CREATE_(NET_WM_ALLOWED_ACTIONS);
CREATE_(NET_WM_USER_TIME);
/* CREATE_(NET_WM_USER_TIME_WINDOW); */
CREATE_(KDE_NET_WM_FRAME_STRUT);
CREATE_(NET_FRAME_EXTENTS);
CREATE(NET_WM_PING, "_NET_WM_PING");
CREATE_(NET_WM_PING);
#ifdef SYNC
CREATE(NET_WM_SYNC_REQUEST, "_NET_WM_SYNC_REQUEST");
CREATE(NET_WM_SYNC_REQUEST_COUNTER, "_NET_WM_SYNC_REQUEST_COUNTER");
CREATE_(NET_WM_SYNC_REQUEST);
CREATE_(NET_WM_SYNC_REQUEST_COUNTER);
#endif
CREATE(NET_WM_WINDOW_TYPE_DESKTOP, "_NET_WM_WINDOW_TYPE_DESKTOP");
CREATE(NET_WM_WINDOW_TYPE_DOCK, "_NET_WM_WINDOW_TYPE_DOCK");
CREATE(NET_WM_WINDOW_TYPE_TOOLBAR, "_NET_WM_WINDOW_TYPE_TOOLBAR");
CREATE(NET_WM_WINDOW_TYPE_MENU, "_NET_WM_WINDOW_TYPE_MENU");
CREATE(NET_WM_WINDOW_TYPE_UTILITY, "_NET_WM_WINDOW_TYPE_UTILITY");
CREATE(NET_WM_WINDOW_TYPE_SPLASH, "_NET_WM_WINDOW_TYPE_SPLASH");
CREATE(NET_WM_WINDOW_TYPE_DIALOG, "_NET_WM_WINDOW_TYPE_DIALOG");
CREATE(NET_WM_WINDOW_TYPE_NORMAL, "_NET_WM_WINDOW_TYPE_NORMAL");
CREATE_(NET_WM_WINDOW_TYPE_DESKTOP);
CREATE_(NET_WM_WINDOW_TYPE_DOCK);
CREATE_(NET_WM_WINDOW_TYPE_TOOLBAR);
CREATE_(NET_WM_WINDOW_TYPE_MENU);
CREATE_(NET_WM_WINDOW_TYPE_UTILITY);
CREATE_(NET_WM_WINDOW_TYPE_SPLASH);
CREATE_(NET_WM_WINDOW_TYPE_DIALOG);
CREATE_(NET_WM_WINDOW_TYPE_NORMAL);
prop_atoms[OBT_PROP_NET_WM_MOVERESIZE_SIZE_TOPLEFT] = 0;
prop_atoms[OBT_PROP_NET_WM_MOVERESIZE_SIZE_TOP] = 1;
@ -135,30 +137,30 @@ void obt_prop_startup()
prop_atoms[OBT_PROP_NET_WM_MOVERESIZE_MOVE_KEYBOARD] = 10;
prop_atoms[OBT_PROP_NET_WM_MOVERESIZE_CANCEL] = 11;
CREATE(NET_WM_ACTION_MOVE, "_NET_WM_ACTION_MOVE");
CREATE(NET_WM_ACTION_RESIZE, "_NET_WM_ACTION_RESIZE");
CREATE(NET_WM_ACTION_MINIMIZE, "_NET_WM_ACTION_MINIMIZE");
CREATE(NET_WM_ACTION_SHADE, "_NET_WM_ACTION_SHADE");
CREATE(NET_WM_ACTION_MAXIMIZE_HORZ, "_NET_WM_ACTION_MAXIMIZE_HORZ");
CREATE(NET_WM_ACTION_MAXIMIZE_VERT, "_NET_WM_ACTION_MAXIMIZE_VERT");
CREATE(NET_WM_ACTION_FULLSCREEN, "_NET_WM_ACTION_FULLSCREEN");
CREATE(NET_WM_ACTION_CHANGE_DESKTOP, "_NET_WM_ACTION_CHANGE_DESKTOP");
CREATE(NET_WM_ACTION_CLOSE, "_NET_WM_ACTION_CLOSE");
CREATE(NET_WM_ACTION_ABOVE, "_NET_WM_ACTION_ABOVE");
CREATE(NET_WM_ACTION_BELOW, "_NET_WM_ACTION_BELOW");
CREATE_(NET_WM_ACTION_MOVE);
CREATE_(NET_WM_ACTION_RESIZE);
CREATE_(NET_WM_ACTION_MINIMIZE);
CREATE_(NET_WM_ACTION_SHADE);
CREATE_(NET_WM_ACTION_MAXIMIZE_HORZ);
CREATE_(NET_WM_ACTION_MAXIMIZE_VERT);
CREATE_(NET_WM_ACTION_FULLSCREEN);
CREATE_(NET_WM_ACTION_CHANGE_DESKTOP);
CREATE_(NET_WM_ACTION_CLOSE);
CREATE_(NET_WM_ACTION_ABOVE);
CREATE_(NET_WM_ACTION_BELOW);
CREATE(NET_WM_STATE_MODAL, "_NET_WM_STATE_MODAL");
/* CREATE(NET_WM_STATE_STICKY, "_NET_WM_STATE_STICKY");*/
CREATE(NET_WM_STATE_MAXIMIZED_VERT, "_NET_WM_STATE_MAXIMIZED_VERT");
CREATE(NET_WM_STATE_MAXIMIZED_HORZ, "_NET_WM_STATE_MAXIMIZED_HORZ");
CREATE(NET_WM_STATE_SHADED, "_NET_WM_STATE_SHADED");
CREATE(NET_WM_STATE_SKIP_TASKBAR, "_NET_WM_STATE_SKIP_TASKBAR");
CREATE(NET_WM_STATE_SKIP_PAGER, "_NET_WM_STATE_SKIP_PAGER");
CREATE(NET_WM_STATE_HIDDEN, "_NET_WM_STATE_HIDDEN");
CREATE(NET_WM_STATE_FULLSCREEN, "_NET_WM_STATE_FULLSCREEN");
CREATE(NET_WM_STATE_ABOVE, "_NET_WM_STATE_ABOVE");
CREATE(NET_WM_STATE_BELOW, "_NET_WM_STATE_BELOW");
CREATE(NET_WM_STATE_DEMANDS_ATTENTION, "_NET_WM_STATE_DEMANDS_ATTENTION");
CREATE_(NET_WM_STATE_MODAL);
/* CREATE_(NET_WM_STATE_STICKY);*/
CREATE_(NET_WM_STATE_MAXIMIZED_VERT);
CREATE_(NET_WM_STATE_MAXIMIZED_HORZ);
CREATE_(NET_WM_STATE_SHADED);
CREATE_(NET_WM_STATE_SKIP_TASKBAR);
CREATE_(NET_WM_STATE_SKIP_PAGER);
CREATE_(NET_WM_STATE_HIDDEN);
CREATE_(NET_WM_STATE_FULLSCREEN);
CREATE_(NET_WM_STATE_ABOVE);
CREATE_(NET_WM_STATE_BELOW);
CREATE_(NET_WM_STATE_DEMANDS_ATTENTION);
prop_atoms[OBT_PROP_NET_WM_STATE_ADD] = 1;
prop_atoms[OBT_PROP_NET_WM_STATE_REMOVE] = 0;
@ -171,19 +173,19 @@ void obt_prop_startup()
prop_atoms[OBT_PROP_NET_WM_BOTTOMRIGHT] = 2;
prop_atoms[OBT_PROP_NET_WM_BOTTOMLEFT] = 3;
CREATE(KDE_WM_CHANGE_STATE, "_KDE_WM_CHANGE_STATE");
CREATE(KDE_NET_WM_WINDOW_TYPE_OVERRIDE,"_KDE_NET_WM_WINDOW_TYPE_OVERRIDE");
CREATE_(KDE_WM_CHANGE_STATE);
CREATE_(KDE_NET_WM_WINDOW_TYPE_OVERRIDE);
/*
CREATE(ROOTPMAPId, "_XROOTPMAP_ID");
CREATE(ESETROOTId, "ESETROOT_PMAP_ID");
CREATE_NAME(ROOTPMAPId, "_XROOTPMAP_ID");
CREATE_NAME(ESETROOTId, "ESETROOT_PMAP_ID");
*/
CREATE(OPENBOX_PID, "_OPENBOX_PID");
CREATE(OB_THEME, "_OB_THEME");
CREATE(OB_WM_ACTION_UNDECORATE, "_OB_WM_ACTION_UNDECORATE");
CREATE(OB_WM_STATE_UNDECORATED, "_OB_WM_STATE_UNDECORATED");
CREATE(OB_CONTROL, "_OB_CONTROL");
CREATE_(OPENBOX_PID);
CREATE_(OB_THEME);
CREATE_(OB_WM_ACTION_UNDECORATE);
CREATE_(OB_WM_STATE_UNDECORATED);
CREATE_(OB_CONTROL);
}
Atom obt_prop_atom(ObtPropAtom a)