Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        comms.c e16-ecore_hints.c e16-ecore_hints.h hints.c hints.h 


Log Message:
Use XInternAtoms to speed up initial atom fetch.

===================================================================
RCS file: /cvs/e/e16/e/src/comms.c,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -3 -r1.87 -r1.88
--- comms.c     15 Dec 2007 12:36:58 -0000      1.87
+++ comms.c     23 Feb 2008 11:57:41 -0000      1.88
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various 
contributors
- * Copyright (C) 2004-2007 Kim Woelders
+ * Copyright (C) 2004-2008 Kim Woelders
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
@@ -23,6 +23,7 @@
  */
 #include "E.h"
 #include "comms.h"
+#include "hints.h"
 #include "ipc.h"
 #include "e16-ecore_hints.h"
 #include "e16-ecore_list.h"
@@ -45,9 +46,6 @@
 
 static Win          comms_win = NoWin;
 
-static Atom         XA_ENLIGHTENMENT_COMMS = 0;
-static Atom         XA_ENL_MSG = 0;
-
 static Client      *
 ClientCreate(Window xwin)
 {
@@ -165,7 +163,7 @@
 
    if ((!ev) || (!c))
       return NULL;
-   if (ev->message_type != XA_ENL_MSG)
+   if (ev->message_type != E16_ATOM_COMMS_MSG)
       return NULL;
 
    s[12] = 0;
@@ -304,12 +302,8 @@
    EventCallbackRegister(VRoot.win, 0, ClientHandleRootEvents, NULL);
 
    Esnprintf(s, sizeof(s), "WINID %8lx", WinGetXwin(comms_win));
-   XA_ENLIGHTENMENT_COMMS = XInternAtom(disp, "ENLIGHTENMENT_COMMS", False);
-   ecore_x_window_prop_string_set(WinGetXwin(comms_win), 
XA_ENLIGHTENMENT_COMMS,
-                                 s);
-   ecore_x_window_prop_string_set(VRoot.xwin, XA_ENLIGHTENMENT_COMMS, s);
-
-   XA_ENL_MSG = XInternAtom(disp, "ENL_MSG", False);
+   ecore_x_window_prop_string_set(WinGetXwin(comms_win), E16_ATOM_COMMS_WIN, 
s);
+   ecore_x_window_prop_string_set(VRoot.xwin, E16_ATOM_COMMS_WIN, s);
 }
 
 static void
@@ -327,7 +321,7 @@
    ev.xclient.serial = 0;
    ev.xclient.send_event = True;
    ev.xclient.window = win;
-   ev.xclient.message_type = XA_ENL_MSG;
+   ev.xclient.message_type = E16_ATOM_COMMS_MSG;
    ev.xclient.format = 8;
    for (i = 0; i < len + 1; i += 12)
      {
===================================================================
RCS file: /cvs/e/e16/e/src/e16-ecore_hints.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- e16-ecore_hints.c   11 Jul 2007 08:29:46 -0000      1.11
+++ e16-ecore_hints.c   23 Feb 2008 11:57:41 -0000      1.12
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004-2007 Kim Woelders
+ * Copyright (C) 2004-2008 Kim Woelders
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
@@ -33,9 +33,6 @@
 #include "config.h"
 #include "e16-ecore_hints.h"
 
-#define _ATOM_GET(name) \
-   XInternAtom(_ecore_x_disp, name, False)
-
 /* Window property change actions (must match _NET_WM_STATE_... ones) */
 #define ECORE_X_PROP_LIST_REMOVE    0
 #define ECORE_X_PROP_LIST_ADD       1
@@ -67,6 +64,14 @@
 
 #else /* USE_ECORE_X */
 
+#define DEBUG_CHECK 0
+#if DEBUG_CHECK
+#include <assert.h>
+#endif
+#include "hints.h"
+
+#define N_ITEMS(x) (sizeof(x)/sizeof(x[0]))
+
 /*
  * General stuff
  */
@@ -640,55 +645,37 @@
 /*
  * ICCCM stuff
  */
-Ecore_X_Atom        ECORE_X_ATOM_WM_STATE;
-Ecore_X_Atom        ECORE_X_ATOM_WM_NAME;
-Ecore_X_Atom        ECORE_X_ATOM_WM_ICON_NAME;
-Ecore_X_Atom        ECORE_X_ATOM_WM_CLASS;
-Ecore_X_Atom        ECORE_X_ATOM_WM_WINDOW_ROLE;
-Ecore_X_Atom        ECORE_X_ATOM_WM_NORMAL_HINTS;
-Ecore_X_Atom        ECORE_X_ATOM_WM_HINTS;
-Ecore_X_Atom        ECORE_X_ATOM_WM_COMMAND;
-Ecore_X_Atom        ECORE_X_ATOM_WM_CLIENT_MACHINE;
-Ecore_X_Atom        ECORE_X_ATOM_WM_CLIENT_LEADER;
-Ecore_X_Atom        ECORE_X_ATOM_WM_TRANSIENT_FOR;
-
-Ecore_X_Atom        ECORE_X_ATOM_WM_COLORMAP_WINDOWS;
-
-Ecore_X_Atom        ECORE_X_ATOM_WM_CHANGE_STATE;
-
-Ecore_X_Atom        ECORE_X_ATOM_WM_PROTOCOLS;
-Ecore_X_Atom        ECORE_X_ATOM_WM_DELETE_WINDOW;
-Ecore_X_Atom        ECORE_X_ATOM_WM_TAKE_FOCUS;
 
+static const char  *const atoms_icccm_names[] = {
+/* *INDENT-OFF* */
+
+   /* ICCCM */
+   "WM_STATE",
+   "WM_WINDOW_ROLE",
+   "WM_CLIENT_LEADER",
+   "WM_COLORMAP_WINDOWS",
+   "WM_CHANGE_STATE",
+   "WM_PROTOCOLS",
+   "WM_DELETE_WINDOW",
+   "WM_TAKE_FOCUS",
 #if 0
-Ecore_X_Atom        ECORE_X_ATOM_WM_SAVE_YOURSELF;
+   "WM_SAVE_YOURSELF",
 #endif
 
+   /* Misc. */
+   "UTF8_STRING",
+
+/* *INDENT-ON* */
+};
+unsigned int        atoms_icccm[CHECK_COUNT_ICCCM];
+
 void
 ecore_x_icccm_init(void)
 {
-   ECORE_X_ATOM_WM_STATE = _ATOM_GET("WM_STATE");
-   ECORE_X_ATOM_WM_NAME = XA_WM_NAME;
-   ECORE_X_ATOM_WM_ICON_NAME = XA_WM_ICON_NAME;
-   ECORE_X_ATOM_WM_CLASS = XA_WM_CLASS;
-   ECORE_X_ATOM_WM_WINDOW_ROLE = _ATOM_GET("WM_WINDOW_ROLE");
-   ECORE_X_ATOM_WM_NORMAL_HINTS = XA_WM_NORMAL_HINTS;
-   ECORE_X_ATOM_WM_HINTS = XA_WM_HINTS;
-   ECORE_X_ATOM_WM_COMMAND = XA_WM_COMMAND;
-   ECORE_X_ATOM_WM_CLIENT_MACHINE = XA_WM_CLIENT_MACHINE;
-   ECORE_X_ATOM_WM_CLIENT_LEADER = _ATOM_GET("WM_CLIENT_LEADER");
-   ECORE_X_ATOM_WM_TRANSIENT_FOR = XA_WM_TRANSIENT_FOR;
-
-   ECORE_X_ATOM_WM_COLORMAP_WINDOWS = _ATOM_GET("WM_COLORMAP_WINDOWS");
-
-   ECORE_X_ATOM_WM_CHANGE_STATE = _ATOM_GET("WM_CHANGE_STATE");
-
-   ECORE_X_ATOM_WM_PROTOCOLS = _ATOM_GET("WM_PROTOCOLS");
-   ECORE_X_ATOM_WM_DELETE_WINDOW = _ATOM_GET("WM_DELETE_WINDOW");
-   ECORE_X_ATOM_WM_TAKE_FOCUS = _ATOM_GET("WM_TAKE_FOCUS");
-#if 0
-   ECORE_X_ATOM_WM_SAVE_YOURSELF = _ATOM_GET("WM_SAVE_YOURSELF");
+#if DEBUG_CHECK
+   assert(CHECK_COUNT_ICCCM == N_ITEMS(atoms_icccm));
 #endif
+   AtomListIntern(atoms_icccm_names, N_ITEMS(atoms_icccm), atoms_icccm);
 }
 
 static void
@@ -801,229 +788,121 @@
 /*
  * _NET_WM hints (EWMH)
  */
-Ecore_X_Atom        ECORE_X_ATOM_UTF8_STRING;
 
-/* Window manager info */
-Ecore_X_Atom        ECORE_X_ATOM_NET_SUPPORTED;
-Ecore_X_Atom        ECORE_X_ATOM_NET_SUPPORTING_WM_CHECK;
-
-/* Desktop status/requests */
-Ecore_X_Atom        ECORE_X_ATOM_NET_NUMBER_OF_DESKTOPS;
-Ecore_X_Atom        ECORE_X_ATOM_NET_VIRTUAL_ROOTS;
-Ecore_X_Atom        ECORE_X_ATOM_NET_DESKTOP_NAMES;
-Ecore_X_Atom        ECORE_X_ATOM_NET_DESKTOP_GEOMETRY;
-Ecore_X_Atom        ECORE_X_ATOM_NET_WORKAREA;
-Ecore_X_Atom        ECORE_X_ATOM_NET_CURRENT_DESKTOP;
-Ecore_X_Atom        ECORE_X_ATOM_NET_DESKTOP_VIEWPORT;
-Ecore_X_Atom        ECORE_X_ATOM_NET_SHOWING_DESKTOP;
-
-Ecore_X_Atom        ECORE_X_ATOM_NET_ACTIVE_WINDOW;
-Ecore_X_Atom        ECORE_X_ATOM_NET_CLIENT_LIST;
-Ecore_X_Atom        ECORE_X_ATOM_NET_CLIENT_LIST_STACKING;
-
-/* Client window props/client messages */
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_NAME;
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_VISIBLE_NAME;
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_ICON_NAME;
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_VISIBLE_ICON_NAME;
-
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_DESKTOP;
-
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_WINDOW_TYPE;
-
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DESKTOP;
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DOCK;
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_WINDOW_TYPE_TOOLBAR;
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_WINDOW_TYPE_MENU;
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_WINDOW_TYPE_UTILITY;
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_WINDOW_TYPE_SPLASH;
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DIALOG;
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_WINDOW_TYPE_NORMAL;
-
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_STATE;
-
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_STATE_MODAL;
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_STATE_STICKY;
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_STATE_MAXIMIZED_VERT;
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_STATE_MAXIMIZED_HORZ;
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_STATE_SHADED;
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_STATE_SKIP_TASKBAR;
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_STATE_SKIP_PAGER;
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_STATE_HIDDEN;
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_STATE_FULLSCREEN;
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_STATE_ABOVE;
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_STATE_BELOW;
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_STATE_DEMANDS_ATTENTION;
-
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_ALLOWED_ACTIONS;
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_ACTION_MOVE;
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_ACTION_RESIZE;
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_ACTION_MINIMIZE;
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_ACTION_SHADE;
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_ACTION_STICK;
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_ACTION_MAXIMIZE_HORZ;
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_ACTION_MAXIMIZE_VERT;
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_ACTION_FULLSCREEN;
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_ACTION_CHANGE_DESKTOP;
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_ACTION_CLOSE;
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_ACTION_ABOVE;
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_ACTION_BELOW;
+static const char  *const atoms_netwm_names[] = {
+/* *INDENT-OFF* */
+
+   /* Window manager info */
+   "_NET_SUPPORTED",
+   "_NET_SUPPORTING_WM_CHECK",
+
+   /* Desktop status/requests */
+   "_NET_NUMBER_OF_DESKTOPS",
+   "_NET_VIRTUAL_ROOTS",
+   "_NET_DESKTOP_GEOMETRY",
+   "_NET_DESKTOP_NAMES",
+   "_NET_DESKTOP_VIEWPORT",
+   "_NET_WORKAREA",
+   "_NET_CURRENT_DESKTOP",
+   "_NET_SHOWING_DESKTOP",
+
+   "_NET_ACTIVE_WINDOW",
+   "_NET_CLIENT_LIST",
+   "_NET_CLIENT_LIST_STACKING",
+
+   /* Client window props/client messages */
+   "_NET_WM_NAME",
+   "_NET_WM_VISIBLE_NAME",
+   "_NET_WM_ICON_NAME",
+   "_NET_WM_VISIBLE_ICON_NAME",
+
+   "_NET_WM_DESKTOP",
+
+   "_NET_WM_WINDOW_TYPE",
+   "_NET_WM_WINDOW_TYPE_DESKTOP",
+   "_NET_WM_WINDOW_TYPE_DOCK",
+   "_NET_WM_WINDOW_TYPE_TOOLBAR",
+   "_NET_WM_WINDOW_TYPE_MENU",
+   "_NET_WM_WINDOW_TYPE_UTILITY",
+   "_NET_WM_WINDOW_TYPE_SPLASH",
+   "_NET_WM_WINDOW_TYPE_DIALOG",
+   "_NET_WM_WINDOW_TYPE_NORMAL",
+
+   "_NET_WM_STATE",
+   "_NET_WM_STATE_MODAL",
+   "_NET_WM_STATE_STICKY",
+   "_NET_WM_STATE_MAXIMIZED_VERT",
+   "_NET_WM_STATE_MAXIMIZED_HORZ",
+   "_NET_WM_STATE_SHADED",
+   "_NET_WM_STATE_SKIP_TASKBAR",
+   "_NET_WM_STATE_SKIP_PAGER",
+   "_NET_WM_STATE_HIDDEN",
+   "_NET_WM_STATE_FULLSCREEN",
+   "_NET_WM_STATE_ABOVE",
+   "_NET_WM_STATE_BELOW",
+   "_NET_WM_STATE_DEMANDS_ATTENTION",
+
+   "_NET_WM_ALLOWED_ACTIONS",
+   "_NET_WM_ACTION_MOVE",
+   "_NET_WM_ACTION_RESIZE",
+   "_NET_WM_ACTION_MINIMIZE",
+   "_NET_WM_ACTION_SHADE",
+   "_NET_WM_ACTION_STICK",
+   "_NET_WM_ACTION_MAXIMIZE_HORZ",
+   "_NET_WM_ACTION_MAXIMIZE_VERT",
+   "_NET_WM_ACTION_FULLSCREEN",
+   "_NET_WM_ACTION_CHANGE_DESKTOP",
+   "_NET_WM_ACTION_CLOSE",
+   "_NET_WM_ACTION_ABOVE",
+   "_NET_WM_ACTION_BELOW",
 
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_STRUT;
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_STRUT_PARTIAL;
+   "_NET_WM_STRUT",
+   "_NET_WM_STRUT_PARTIAL",
 
-Ecore_X_Atom        ECORE_X_ATOM_NET_FRAME_EXTENTS;
+   "_NET_FRAME_EXTENTS",
 
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_ICON;
+   "_NET_WM_ICON",
 
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_USER_TIME;
+   "_NET_WM_USER_TIME",
 
 #if 0                          /* Not used */
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_ICON_GEOMETRY;
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_PID;
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_HANDLED_ICONS;
+   "_NET_WM_ICON_GEOMETRY",
+   "_NET_WM_PID",
+   "_NET_WM_HANDLED_ICONS",
 
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_PING;
+   "_NET_WM_PING",
 #endif
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_SYNC_REQUEST;
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_SYNC_REQUEST_COUNTER;
+   "_NET_WM_SYNC_REQUEST",
+   "_NET_WM_SYNC_REQUEST_COUNTER",
 
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_WINDOW_OPACITY;
+   "_NET_WM_WINDOW_OPACITY",
 
-/* Misc window ops */
-Ecore_X_Atom        ECORE_X_ATOM_NET_CLOSE_WINDOW;
-Ecore_X_Atom        ECORE_X_ATOM_NET_MOVERESIZE_WINDOW;
-Ecore_X_Atom        ECORE_X_ATOM_NET_WM_MOVERESIZE;
-Ecore_X_Atom        ECORE_X_ATOM_NET_RESTACK_WINDOW;
+   /* Misc window ops */
+   "_NET_CLOSE_WINDOW",
+   "_NET_MOVERESIZE_WINDOW",
+   "_NET_WM_MOVERESIZE",
+   "_NET_RESTACK_WINDOW",
 
 #if 0                          /* Not yet implemented */
-Ecore_X_Atom        ECORE_X_ATOM_NET_REQUEST_FRAME_EXTENTS;
+   "_NET_REQUEST_FRAME_EXTENTS",
 #endif
 
-/* Startup notification */
-Ecore_X_Atom        ECORE_X_ATOM_NET_STARTUP_ID;
-Ecore_X_Atom        ECORE_X_ATOM_NET_STARTUP_INFO_BEGIN;
-Ecore_X_Atom        ECORE_X_ATOM_NET_STARTUP_INFO;
+   /* Startup notification */
+   "_NET_STARTUP_ID",
+   "_NET_STARTUP_INFO_BEGIN",
+   "_NET_STARTUP_INFO",
+
+/* *INDENT-ON* */
+};
+unsigned int        atoms_netwm[CHECK_COUNT_NETWM];
 
 void
 ecore_x_netwm_init(void)
 {
-   ECORE_X_ATOM_UTF8_STRING = _ATOM_GET("UTF8_STRING");
-
-   ECORE_X_ATOM_NET_SUPPORTED = _ATOM_GET("_NET_SUPPORTED");
-   ECORE_X_ATOM_NET_SUPPORTING_WM_CHECK = 
_ATOM_GET("_NET_SUPPORTING_WM_CHECK");
-
-   ECORE_X_ATOM_NET_NUMBER_OF_DESKTOPS = _ATOM_GET("_NET_NUMBER_OF_DESKTOPS");
-   ECORE_X_ATOM_NET_VIRTUAL_ROOTS = _ATOM_GET("_NET_VIRTUAL_ROOTS");
-   ECORE_X_ATOM_NET_DESKTOP_GEOMETRY = _ATOM_GET("_NET_DESKTOP_GEOMETRY");
-   ECORE_X_ATOM_NET_DESKTOP_NAMES = _ATOM_GET("_NET_DESKTOP_NAMES");
-   ECORE_X_ATOM_NET_DESKTOP_VIEWPORT = _ATOM_GET("_NET_DESKTOP_VIEWPORT");
-   ECORE_X_ATOM_NET_WORKAREA = _ATOM_GET("_NET_WORKAREA");
-   ECORE_X_ATOM_NET_CURRENT_DESKTOP = _ATOM_GET("_NET_CURRENT_DESKTOP");
-   ECORE_X_ATOM_NET_SHOWING_DESKTOP = _ATOM_GET("_NET_SHOWING_DESKTOP");
-
-   ECORE_X_ATOM_NET_ACTIVE_WINDOW = _ATOM_GET("_NET_ACTIVE_WINDOW");
-   ECORE_X_ATOM_NET_CLIENT_LIST = _ATOM_GET("_NET_CLIENT_LIST");
-   ECORE_X_ATOM_NET_CLIENT_LIST_STACKING =
-      _ATOM_GET("_NET_CLIENT_LIST_STACKING");
-
-   ECORE_X_ATOM_NET_WM_NAME = _ATOM_GET("_NET_WM_NAME");
-   ECORE_X_ATOM_NET_WM_VISIBLE_NAME = _ATOM_GET("_NET_WM_VISIBLE_NAME");
-   ECORE_X_ATOM_NET_WM_ICON_NAME = _ATOM_GET("_NET_WM_ICON_NAME");
-   ECORE_X_ATOM_NET_WM_VISIBLE_ICON_NAME =
-      _ATOM_GET("_NET_WM_VISIBLE_ICON_NAME");
-
-   ECORE_X_ATOM_NET_WM_DESKTOP = _ATOM_GET("_NET_WM_DESKTOP");
-
-   ECORE_X_ATOM_NET_WM_WINDOW_TYPE = _ATOM_GET("_NET_WM_WINDOW_TYPE");
-
-   ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DESKTOP =
-      _ATOM_GET("_NET_WM_WINDOW_TYPE_DESKTOP");
-   ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DOCK = 
_ATOM_GET("_NET_WM_WINDOW_TYPE_DOCK");
-   ECORE_X_ATOM_NET_WM_WINDOW_TYPE_TOOLBAR =
-      _ATOM_GET("_NET_WM_WINDOW_TYPE_TOOLBAR");
-   ECORE_X_ATOM_NET_WM_WINDOW_TYPE_MENU = 
_ATOM_GET("_NET_WM_WINDOW_TYPE_MENU");
-   ECORE_X_ATOM_NET_WM_WINDOW_TYPE_UTILITY =
-      _ATOM_GET("_NET_WM_WINDOW_TYPE_UTILITY");
-   ECORE_X_ATOM_NET_WM_WINDOW_TYPE_SPLASH =
-      _ATOM_GET("_NET_WM_WINDOW_TYPE_SPLASH");
-   ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DIALOG =
-      _ATOM_GET("_NET_WM_WINDOW_TYPE_DIALOG");
-   ECORE_X_ATOM_NET_WM_WINDOW_TYPE_NORMAL =
-      _ATOM_GET("_NET_WM_WINDOW_TYPE_NORMAL");
-
-   ECORE_X_ATOM_NET_WM_STATE = _ATOM_GET("_NET_WM_STATE");
-
-   ECORE_X_ATOM_NET_WM_STATE_MODAL = _ATOM_GET("_NET_WM_STATE_MODAL");
-   ECORE_X_ATOM_NET_WM_STATE_STICKY = _ATOM_GET("_NET_WM_STATE_STICKY");
-   ECORE_X_ATOM_NET_WM_STATE_MAXIMIZED_VERT =
-      _ATOM_GET("_NET_WM_STATE_MAXIMIZED_VERT");
-   ECORE_X_ATOM_NET_WM_STATE_MAXIMIZED_HORZ =
-      _ATOM_GET("_NET_WM_STATE_MAXIMIZED_HORZ");
-   ECORE_X_ATOM_NET_WM_STATE_SHADED = _ATOM_GET("_NET_WM_STATE_SHADED");
-   ECORE_X_ATOM_NET_WM_STATE_SKIP_TASKBAR =
-      _ATOM_GET("_NET_WM_STATE_SKIP_TASKBAR");
-   ECORE_X_ATOM_NET_WM_STATE_SKIP_PAGER = 
_ATOM_GET("_NET_WM_STATE_SKIP_PAGER");
-   ECORE_X_ATOM_NET_WM_STATE_HIDDEN = _ATOM_GET("_NET_WM_STATE_HIDDEN");
-   ECORE_X_ATOM_NET_WM_STATE_FULLSCREEN = 
_ATOM_GET("_NET_WM_STATE_FULLSCREEN");
-   ECORE_X_ATOM_NET_WM_STATE_ABOVE = _ATOM_GET("_NET_WM_STATE_ABOVE");
-   ECORE_X_ATOM_NET_WM_STATE_BELOW = _ATOM_GET("_NET_WM_STATE_BELOW");
-   ECORE_X_ATOM_NET_WM_STATE_DEMANDS_ATTENTION =
-      _ATOM_GET("_NET_WM_STATE_DEMANDS_ATTENTION");
-
-   ECORE_X_ATOM_NET_WM_ALLOWED_ACTIONS = _ATOM_GET("_NET_WM_ALLOWED_ACTIONS");
-   ECORE_X_ATOM_NET_WM_ACTION_MOVE = _ATOM_GET("_NET_WM_ACTION_MOVE");
-   ECORE_X_ATOM_NET_WM_ACTION_RESIZE = _ATOM_GET("_NET_WM_ACTION_RESIZE");
-   ECORE_X_ATOM_NET_WM_ACTION_MINIMIZE = _ATOM_GET("_NET_WM_ACTION_MINIMIZE");
-   ECORE_X_ATOM_NET_WM_ACTION_SHADE = _ATOM_GET("_NET_WM_ACTION_SHADE");
-   ECORE_X_ATOM_NET_WM_ACTION_STICK = _ATOM_GET("_NET_WM_ACTION_STICK");
-   ECORE_X_ATOM_NET_WM_ACTION_MAXIMIZE_HORZ =
-      _ATOM_GET("_NET_WM_ACTION_MAXIMIZE_HORZ");
-   ECORE_X_ATOM_NET_WM_ACTION_MAXIMIZE_VERT =
-      _ATOM_GET("_NET_WM_ACTION_MAXIMIZE_VERT");
-   ECORE_X_ATOM_NET_WM_ACTION_FULLSCREEN =
-      _ATOM_GET("_NET_WM_ACTION_FULLSCREEN");
-   ECORE_X_ATOM_NET_WM_ACTION_CHANGE_DESKTOP =
-      _ATOM_GET("_NET_WM_ACTION_CHANGE_DESKTOP");
-   ECORE_X_ATOM_NET_WM_ACTION_CLOSE = _ATOM_GET("_NET_WM_ACTION_CLOSE");
-   ECORE_X_ATOM_NET_WM_ACTION_ABOVE = _ATOM_GET("_NET_WM_ACTION_ABOVE");
-   ECORE_X_ATOM_NET_WM_ACTION_BELOW = _ATOM_GET("_NET_WM_ACTION_BELOW");
-
-   ECORE_X_ATOM_NET_WM_STRUT = _ATOM_GET("_NET_WM_STRUT");
-   ECORE_X_ATOM_NET_WM_STRUT_PARTIAL = _ATOM_GET("_NET_WM_STRUT_PARTIAL");
-
-   ECORE_X_ATOM_NET_FRAME_EXTENTS = _ATOM_GET("_NET_FRAME_EXTENTS");
-
-   ECORE_X_ATOM_NET_WM_ICON = _ATOM_GET("_NET_WM_ICON");
-
-   ECORE_X_ATOM_NET_WM_USER_TIME = _ATOM_GET("_NET_WM_USER_TIME");
-
-#if 0                          /* Not used */
-   ECORE_X_ATOM_NET_WM_ICON_GEOMETRY = _ATOM_GET("_NET_WM_ICON_GEOMETRY");
-   ECORE_X_ATOM_NET_WM_PID = _ATOM_GET("_NET_WM_PID");
-   ECORE_X_ATOM_NET_WM_HANDLED_ICONS = _ATOM_GET("_NET_WM_HANDLED_ICONS");
-
-   ECORE_X_ATOM_NET_WM_PING = _ATOM_GET("_NET_WM_PING");
+#if DEBUG_CHECK
+   assert(CHECK_COUNT_NETWM == N_ITEMS(atoms_netwm));
 #endif
-   ECORE_X_ATOM_NET_WM_SYNC_REQUEST = _ATOM_GET("_NET_WM_SYNC_REQUEST");
-   ECORE_X_ATOM_NET_WM_SYNC_REQUEST_COUNTER =
-      _ATOM_GET("_NET_WM_SYNC_REQUEST_COUNTER");
-
-   ECORE_X_ATOM_NET_WM_WINDOW_OPACITY = _ATOM_GET("_NET_WM_WINDOW_OPACITY");
-
-   ECORE_X_ATOM_NET_CLOSE_WINDOW = _ATOM_GET("_NET_CLOSE_WINDOW");
-   ECORE_X_ATOM_NET_MOVERESIZE_WINDOW = _ATOM_GET("_NET_MOVERESIZE_WINDOW");
-   ECORE_X_ATOM_NET_WM_MOVERESIZE = _ATOM_GET("_NET_WM_MOVERESIZE");
-   ECORE_X_ATOM_NET_RESTACK_WINDOW = _ATOM_GET("_NET_RESTACK_WINDOW");
-
-#if 0                          /* Not yet implemented */
-   ECORE_X_ATOM_NET_REQUEST_FRAME_EXTENTS =
-      _ATOM_GET("_NET_REQUEST_FRAME_EXTENTS");
-#endif
-
-   ECORE_X_ATOM_NET_STARTUP_ID = _ATOM_GET("_NET_STARTUP_ID");
-   ECORE_X_ATOM_NET_STARTUP_INFO_BEGIN = _ATOM_GET("_NET_STARTUP_INFO_BEGIN");
-   ECORE_X_ATOM_NET_STARTUP_INFO = _ATOM_GET("_NET_STARTUP_INFO");
+   AtomListIntern(atoms_netwm_names, N_ITEMS(atoms_netwm), atoms_netwm);
 }
 
 /*
===================================================================
RCS file: /cvs/e/e16/e/src/e16-ecore_hints.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- e16-ecore_hints.h   17 Apr 2007 21:20:34 -0000      1.6
+++ e16-ecore_hints.h   23 Feb 2008 11:57:41 -0000      1.7
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004-2007 Kim Woelders
+ * Copyright (C) 2004-2008 Kim Woelders
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
@@ -106,30 +106,31 @@
                                                   Ecore_X_Atom atom);
 
 /* Misc. */
-extern Ecore_X_Atom ECORE_X_ATOM_UTF8_STRING;
+#include "X11/Xatom.h"
+extern unsigned int atoms_icccm[];
 
-/* ICCCM */
-extern Ecore_X_Atom ECORE_X_ATOM_WM_STATE;
-extern Ecore_X_Atom ECORE_X_ATOM_WM_DELETE_WINDOW;
-extern Ecore_X_Atom ECORE_X_ATOM_WM_TAKE_FOCUS;
-extern Ecore_X_Atom ECORE_X_ATOM_WM_PROTOCOLS;
-extern Ecore_X_Atom ECORE_X_ATOM_WM_CLASS;
-extern Ecore_X_Atom ECORE_X_ATOM_WM_NAME;
-extern Ecore_X_Atom ECORE_X_ATOM_WM_COMMAND;
-extern Ecore_X_Atom ECORE_X_ATOM_WM_ICON_NAME;
-extern Ecore_X_Atom ECORE_X_ATOM_WM_CLIENT_MACHINE;
-extern Ecore_X_Atom ECORE_X_ATOM_WM_CHANGE_STATE;
-extern Ecore_X_Atom ECORE_X_ATOM_WM_COLORMAP_WINDOWS;
-extern Ecore_X_Atom ECORE_X_ATOM_WM_WINDOW_ROLE;
-extern Ecore_X_Atom ECORE_X_ATOM_WM_HINTS;
-extern Ecore_X_Atom ECORE_X_ATOM_WM_NORMAL_HINTS;
-extern Ecore_X_Atom ECORE_X_ATOM_WM_CLIENT_LEADER;
-extern Ecore_X_Atom ECORE_X_ATOM_WM_TRANSIENT_FOR;
-extern Ecore_X_Atom ECORE_X_ATOM_WM_SAVE_YOURSELF;
+#define ECORE_X_ATOM_UTF8_STRING               atoms_icccm[8]
 
-#if 0
-extern Ecore_X_Atom ECORE_X_ATOM_WM_SAVE_YOURSELF;
-#endif
+/* ICCCM */
+#define ECORE_X_ATOM_WM_STATE                  atoms_icccm[0]
+#define ECORE_X_ATOM_WM_WINDOW_ROLE            atoms_icccm[1]
+#define ECORE_X_ATOM_WM_CLIENT_LEADER          atoms_icccm[2]
+#define ECORE_X_ATOM_WM_COLORMAP_WINDOWS       atoms_icccm[3]
+#define ECORE_X_ATOM_WM_CHANGE_STATE           atoms_icccm[4]
+#define ECORE_X_ATOM_WM_PROTOCOLS              atoms_icccm[5]
+#define ECORE_X_ATOM_WM_DELETE_WINDOW          atoms_icccm[6]
+#define ECORE_X_ATOM_WM_TAKE_FOCUS             atoms_icccm[7]
+
+#define CHECK_COUNT_ICCCM 9
+
+#define ECORE_X_ATOM_WM_CLASS                  XA_WM_CLASS
+#define ECORE_X_ATOM_WM_NAME                   XA_WM_NAME
+#define ECORE_X_ATOM_WM_COMMAND                        XA_WM_COMMAND
+#define ECORE_X_ATOM_WM_ICON_NAME              XA_WM_ICON_NAME
+#define ECORE_X_ATOM_WM_CLIENT_MACHINE         XA_WM_CLIENT_MACHINE
+#define ECORE_X_ATOM_WM_HINTS                  XA_WM_HINTS
+#define ECORE_X_ATOM_WM_NORMAL_HINTS           XA_WM_NORMAL_HINTS
+#define ECORE_X_ATOM_WM_TRANSIENT_FOR          XA_WM_TRANSIENT_FOR
 
 void                ecore_x_icccm_init(void);
 
@@ -148,104 +149,109 @@
                                                 char **name, char **clss);
 
 /* NETWM (EWMH) */
-extern Ecore_X_Atom ECORE_X_ATOM_NET_SUPPORTED;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_SUPPORTING_WM_CHECK;
+extern unsigned int atoms_netwm[];
 
-extern Ecore_X_Atom ECORE_X_ATOM_NET_NUMBER_OF_DESKTOPS;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_VIRTUAL_ROOTS;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_DESKTOP_GEOMETRY;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_DESKTOP_NAMES;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_DESKTOP_VIEWPORT;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WORKAREA;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_CURRENT_DESKTOP;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_SHOWING_DESKTOP;
-
-extern Ecore_X_Atom ECORE_X_ATOM_NET_ACTIVE_WINDOW;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_CLIENT_LIST;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_CLIENT_LIST_STACKING;
-
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_NAME;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_VISIBLE_NAME;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_ICON_NAME;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_VISIBLE_ICON_NAME;
-
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_DESKTOP;
-
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_WINDOW_TYPE;
-
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DESKTOP;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DOCK;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_WINDOW_TYPE_TOOLBAR;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_WINDOW_TYPE_MENU;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_WINDOW_TYPE_UTILITY;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_WINDOW_TYPE_SPLASH;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DIALOG;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_WINDOW_TYPE_NORMAL;
-
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE;
-
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE_MODAL;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE_STICKY;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE_MAXIMIZED_VERT;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE_MAXIMIZED_HORZ;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE_SHADED;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE_SKIP_TASKBAR;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE_SKIP_PAGER;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE_HIDDEN;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE_FULLSCREEN;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE_ABOVE;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE_BELOW;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE_DEMANDS_ATTENTION;
-
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_ALLOWED_ACTIONS;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_ACTION_MOVE;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_ACTION_RESIZE;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_ACTION_MINIMIZE;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_ACTION_SHADE;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_ACTION_STICK;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_ACTION_MAXIMIZE_HORZ;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_ACTION_MAXIMIZE_VERT;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_ACTION_FULLSCREEN;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_ACTION_CHANGE_DESKTOP;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_ACTION_CLOSE;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_ACTION_ABOVE;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_ACTION_BELOW;
+/* Window manager info */
+#define ECORE_X_ATOM_NET_SUPPORTED                     atoms_netwm[0]
+#define ECORE_X_ATOM_NET_SUPPORTING_WM_CHECK           atoms_netwm[1]
+
+/* Desktop status/requests */
+#define ECORE_X_ATOM_NET_NUMBER_OF_DESKTOPS            atoms_netwm[2]
+#define ECORE_X_ATOM_NET_VIRTUAL_ROOTS                 atoms_netwm[3]
+#define ECORE_X_ATOM_NET_DESKTOP_GEOMETRY              atoms_netwm[4]
+#define ECORE_X_ATOM_NET_DESKTOP_NAMES                 atoms_netwm[5]
+#define ECORE_X_ATOM_NET_DESKTOP_VIEWPORT              atoms_netwm[6]
+#define ECORE_X_ATOM_NET_WORKAREA                      atoms_netwm[7]
+#define ECORE_X_ATOM_NET_CURRENT_DESKTOP               atoms_netwm[8]
+#define ECORE_X_ATOM_NET_SHOWING_DESKTOP               atoms_netwm[9]
+
+#define ECORE_X_ATOM_NET_ACTIVE_WINDOW                 atoms_netwm[10]
+#define ECORE_X_ATOM_NET_CLIENT_LIST                   atoms_netwm[11]
+#define ECORE_X_ATOM_NET_CLIENT_LIST_STACKING          atoms_netwm[12]
+
+/* Client window props/client messages */
+#define ECORE_X_ATOM_NET_WM_NAME                       atoms_netwm[13]
+#define ECORE_X_ATOM_NET_WM_VISIBLE_NAME               atoms_netwm[14]
+#define ECORE_X_ATOM_NET_WM_ICON_NAME                  atoms_netwm[15]
+#define ECORE_X_ATOM_NET_WM_VISIBLE_ICON_NAME          atoms_netwm[16]
+
+#define ECORE_X_ATOM_NET_WM_DESKTOP                    atoms_netwm[17]
+
+#define ECORE_X_ATOM_NET_WM_WINDOW_TYPE                        atoms_netwm[18]
+#define ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DESKTOP                atoms_netwm[19]
+#define ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DOCK           atoms_netwm[20]
+#define ECORE_X_ATOM_NET_WM_WINDOW_TYPE_TOOLBAR                atoms_netwm[21]
+#define ECORE_X_ATOM_NET_WM_WINDOW_TYPE_MENU           atoms_netwm[22]
+#define ECORE_X_ATOM_NET_WM_WINDOW_TYPE_UTILITY                atoms_netwm[23]
+#define ECORE_X_ATOM_NET_WM_WINDOW_TYPE_SPLASH         atoms_netwm[24]
+#define ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DIALOG         atoms_netwm[25]
+#define ECORE_X_ATOM_NET_WM_WINDOW_TYPE_NORMAL         atoms_netwm[26]
+
+#define ECORE_X_ATOM_NET_WM_STATE                      atoms_netwm[27]
+#define ECORE_X_ATOM_NET_WM_STATE_MODAL                        atoms_netwm[28]
+#define ECORE_X_ATOM_NET_WM_STATE_STICKY               atoms_netwm[29]
+#define ECORE_X_ATOM_NET_WM_STATE_MAXIMIZED_VERT       atoms_netwm[30]
+#define ECORE_X_ATOM_NET_WM_STATE_MAXIMIZED_HORZ       atoms_netwm[31]
+#define ECORE_X_ATOM_NET_WM_STATE_SHADED               atoms_netwm[32]
+#define ECORE_X_ATOM_NET_WM_STATE_SKIP_TASKBAR         atoms_netwm[33]
+#define ECORE_X_ATOM_NET_WM_STATE_SKIP_PAGER           atoms_netwm[34]
+#define ECORE_X_ATOM_NET_WM_STATE_HIDDEN               atoms_netwm[35]
+#define ECORE_X_ATOM_NET_WM_STATE_FULLSCREEN           atoms_netwm[36]
+#define ECORE_X_ATOM_NET_WM_STATE_ABOVE                        atoms_netwm[37]
+#define ECORE_X_ATOM_NET_WM_STATE_BELOW                        atoms_netwm[38]
+#define ECORE_X_ATOM_NET_WM_STATE_DEMANDS_ATTENTION    atoms_netwm[39]
+
+#define ECORE_X_ATOM_NET_WM_ALLOWED_ACTIONS            atoms_netwm[40]
+#define ECORE_X_ATOM_NET_WM_ACTION_MOVE                        atoms_netwm[41]
+#define ECORE_X_ATOM_NET_WM_ACTION_RESIZE              atoms_netwm[42]
+#define ECORE_X_ATOM_NET_WM_ACTION_MINIMIZE            atoms_netwm[43]
+#define ECORE_X_ATOM_NET_WM_ACTION_SHADE               atoms_netwm[44]
+#define ECORE_X_ATOM_NET_WM_ACTION_STICK               atoms_netwm[45]
+#define ECORE_X_ATOM_NET_WM_ACTION_MAXIMIZE_HORZ       atoms_netwm[46]
+#define ECORE_X_ATOM_NET_WM_ACTION_MAXIMIZE_VERT       atoms_netwm[47]
+#define ECORE_X_ATOM_NET_WM_ACTION_FULLSCREEN          atoms_netwm[48]
+#define ECORE_X_ATOM_NET_WM_ACTION_CHANGE_DESKTOP      atoms_netwm[49]
+#define ECORE_X_ATOM_NET_WM_ACTION_CLOSE               atoms_netwm[50]
+#define ECORE_X_ATOM_NET_WM_ACTION_ABOVE               atoms_netwm[51]
+#define ECORE_X_ATOM_NET_WM_ACTION_BELOW               atoms_netwm[52]
 
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_STRUT;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_STRUT_PARTIAL;
+#define ECORE_X_ATOM_NET_WM_STRUT                      atoms_netwm[53]
+#define ECORE_X_ATOM_NET_WM_STRUT_PARTIAL              atoms_netwm[54]
 
-extern Ecore_X_Atom ECORE_X_ATOM_NET_FRAME_EXTENTS;
+#define ECORE_X_ATOM_NET_FRAME_EXTENTS                 atoms_netwm[55]
 
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_ICON;
+#define ECORE_X_ATOM_NET_WM_ICON                       atoms_netwm[56]
 
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_USER_TIME;
+#define ECORE_X_ATOM_NET_WM_USER_TIME                  atoms_netwm[57]
 
 #if 0                          /* Not used */
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_ICON_GEOMETRY;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_PID;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_HANDLED_ICONS;
+#define ECORE_X_ATOM_NET_WM_ICON_GEOMETRY              atoms_netwm[0]
+#define ECORE_X_ATOM_NET_WM_PID                                atoms_netwm[0]
+#define ECORE_X_ATOM_NET_WM_HANDLED_ICONS              atoms_netwm[0]
 
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_PING;
+#define ECORE_X_ATOM_NET_WM_PING                       atoms_netwm[0]
 #endif
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_SYNC_REQUEST;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_SYNC_REQUEST_COUNTER;
+#define ECORE_X_ATOM_NET_WM_SYNC_REQUEST               atoms_netwm[58]
+#define ECORE_X_ATOM_NET_WM_SYNC_REQUEST_COUNTER       atoms_netwm[59]
 
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_WINDOW_OPACITY;
+#define ECORE_X_ATOM_NET_WM_WINDOW_OPACITY             atoms_netwm[60]
 
 /* Misc window ops */
-extern Ecore_X_Atom ECORE_X_ATOM_NET_CLOSE_WINDOW;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_MOVERESIZE_WINDOW;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_MOVERESIZE;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_RESTACK_WINDOW;
+#define ECORE_X_ATOM_NET_CLOSE_WINDOW                  atoms_netwm[61]
+#define ECORE_X_ATOM_NET_MOVERESIZE_WINDOW             atoms_netwm[62]
+#define ECORE_X_ATOM_NET_WM_MOVERESIZE                 atoms_netwm[63]
+#define ECORE_X_ATOM_NET_RESTACK_WINDOW                        atoms_netwm[64]
 
 #if 0                          /* Not yet implemented */
-extern Ecore_X_Atom ECORE_X_ATOM_NET_REQUEST_FRAME_EXTENTS;
+#define ECORE_X_ATOM_NET_REQUEST_FRAME_EXTENTS         atoms_netwm[0]
 #endif
 
 /* Startup notification */
-extern Ecore_X_Atom ECORE_X_ATOM_NET_STARTUP_ID;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_STARTUP_INFO_BEGIN;
-extern Ecore_X_Atom ECORE_X_ATOM_NET_STARTUP_INFO;
+#define ECORE_X_ATOM_NET_STARTUP_ID                    atoms_netwm[65]
+#define ECORE_X_ATOM_NET_STARTUP_INFO_BEGIN            atoms_netwm[66]
+#define ECORE_X_ATOM_NET_STARTUP_INFO                  atoms_netwm[67]
+
+#define CHECK_COUNT_NETWM 68
 
 void                ecore_x_netwm_init(void);
 
===================================================================
RCS file: /cvs/e/e16/e/src/hints.c,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -3 -r1.85 -r1.86
--- hints.c     3 Feb 2008 17:03:23 -0000       1.85
+++ hints.c     23 Feb 2008 11:57:41 -0000      1.86
@@ -33,33 +33,57 @@
 #include "xwin.h"
 #include <X11/Xatom.h>
 
-/* Misc atoms */
-Atom                E_XA_MANAGER = 0;
+#define N_ITEMS(x) (sizeof(x)/sizeof(x[0]))
 
-Atom                E_XROOTPMAP_ID;
-Atom                E_XROOTCOLOR_PIXEL;
+static const char  *const atoms_misc_names[] = {
+   /* Misc atoms */
+   "MANAGER",
 
-/* E16 atoms */
-static Ecore_X_Atom ENL_INTERNAL_AREA_DATA;
-static Ecore_X_Atom ENL_INTERNAL_DESK_DATA;
-static Ecore_X_Atom ENL_WIN_DATA;
-static Ecore_X_Atom ENL_WIN_BORDER;
+   /* Root background atoms */
+   "_XROOTPMAP_ID",
+   "_XROOTCOLOR_PIXEL",
+
+   /* E16 atoms */
+   "ENLIGHTENMENT_VERSION",
+
+   "ENLIGHTENMENT_COMMS",
+   "ENL_MSG",
+
+   "ENL_INTERNAL_AREA_DATA",
+   "ENL_INTERNAL_DESK_DATA",
+   "ENL_WIN_DATA",
+   "ENL_WIN_BORDER"
+};
+
+unsigned int        atoms_misc[10];
 
 void
-HintsInit(void)
+AtomListIntern(const char *const *names, unsigned int num, unsigned int *atoms)
 {
-   Atom                atom;
-   Window              win;
+#if SIZEOF_INT == SIZEOF_LONG
+   XInternAtoms(disp, (char **)names, num, False, (Atom *) atoms);
+#else
+   unsigned int        i;
+   Atom               *_atoms;
+
+   _atoms = EMALLOC(Atom, num);
+   if (!_atoms)
+      return;
+
+   XInternAtoms(disp, (char **)names, num, False, _atoms);
+   for (i = 0; i < num; i++)
+      atoms[i] = _atoms[i];
 
-   E_XA_MANAGER = XInternAtom(disp, "MANAGER", False);
+   Efree(_atoms);
+#endif
+}
 
-   E_XROOTPMAP_ID = XInternAtom(disp, "_XROOTPMAP_ID", False);
-   E_XROOTCOLOR_PIXEL = XInternAtom(disp, "_XROOTCOLOR_PIXEL", False);
+void
+HintsInit(void)
+{
+   Window              win;
 
-   ENL_INTERNAL_AREA_DATA = XInternAtom(disp, "ENL_INTERNAL_AREA_DATA", False);
-   ENL_INTERNAL_DESK_DATA = XInternAtom(disp, "ENL_INTERNAL_DESK_DATA", False);
-   ENL_WIN_DATA = XInternAtom(disp, "ENL_WIN_DATA", False);
-   ENL_WIN_BORDER = XInternAtom(disp, "ENL_WIN_BORDER", False);
+   AtomListIntern(atoms_misc_names, N_ITEMS(atoms_misc_names), atoms_misc);
 
    win = XCreateSimpleWindow(disp, VRoot.xwin, -200, -200, 5, 5, 0, 0, 0);
 
@@ -69,8 +93,8 @@
    GNOME_SetHints(win);
 #endif
    EWMH_Init(win);
-   atom = XInternAtom(disp, "ENLIGHTENMENT_VERSION", False);
-   ecore_x_window_prop_string_set(VRoot.xwin, atom, e_wm_version);
+
+   ecore_x_window_prop_string_set(VRoot.xwin, E16_ATOM_VERSION, e_wm_version);
 
    if (Mode.wm.window)
      {
@@ -374,10 +398,10 @@
    c[10] = ewin->save_fs.h;
    c[11] = ewin->save_fs.layer;
 
-   ecore_x_window_prop_card32_set(EwinGetClientXwin(ewin), ENL_WIN_DATA,
+   ecore_x_window_prop_card32_set(EwinGetClientXwin(ewin), E16_ATOM_WIN_DATA,
                                  (unsigned int *)c, ENL_DATA_ITEMS);
 
-   ecore_x_window_prop_string_set(EwinGetClientXwin(ewin), ENL_WIN_BORDER,
+   ecore_x_window_prop_string_set(EwinGetClientXwin(ewin), E16_ATOM_WIN_BORDER,
                                  ewin->normal_border->name);
 
    if (EDebug(EDBUG_TYPE_SNAPS))
@@ -398,8 +422,9 @@
    if (EwinIsInternal(ewin))
       return;
 
-   num = ecore_x_window_prop_card32_get(EwinGetClientXwin(ewin), ENL_WIN_DATA,
-                                       (unsigned int *)c, ENL_DATA_ITEMS + 1);
+   num =
+      ecore_x_window_prop_card32_get(EwinGetClientXwin(ewin), 
E16_ATOM_WIN_DATA,
+                                    (unsigned int *)c, ENL_DATA_ITEMS + 1);
    if (num < 0)
       return;
 
@@ -434,7 +459,8 @@
      }
 
    str =
-      ecore_x_window_prop_string_get(EwinGetClientXwin(ewin), ENL_WIN_BORDER);
+      ecore_x_window_prop_string_get(EwinGetClientXwin(ewin),
+                                    E16_ATOM_WIN_BORDER);
    if (str)
       EwinSetBorderByName(ewin, str);
    Efree(str);
@@ -469,11 +495,12 @@
        c[(i * 2) + 1] = ay;
      }
 
-   ecore_x_window_prop_card32_set(VRoot.xwin, ENL_INTERNAL_AREA_DATA,
+   ecore_x_window_prop_card32_set(VRoot.xwin, E16_ATOM_INTERNAL_AREA_DATA,
                                  c, 2 * n_desks);
 
    c[0] = DesksGetCurrentNum();
-   ecore_x_window_prop_card32_set(VRoot.xwin, ENL_INTERNAL_DESK_DATA, c, 1);
+   ecore_x_window_prop_card32_set(VRoot.xwin, E16_ATOM_INTERNAL_DESK_DATA, c,
+                                 1);
 
    Efree(c);
 
@@ -496,7 +523,7 @@
    if (!c)
       return;
 
-   num = ecore_x_window_prop_card32_get(VRoot.xwin, ENL_INTERNAL_AREA_DATA,
+   num = ecore_x_window_prop_card32_get(VRoot.xwin, 
E16_ATOM_INTERNAL_AREA_DATA,
                                        c, 2 * n_desks);
    if (num > 0)
      {
@@ -504,7 +531,7 @@
           DeskSetArea(DeskGet(i), c[(i * 2)], c[(i * 2) + 1]);
      }
 
-   num = ecore_x_window_prop_card32_get(VRoot.xwin, ENL_INTERNAL_DESK_DATA,
+   num = ecore_x_window_prop_card32_get(VRoot.xwin, 
E16_ATOM_INTERNAL_DESK_DATA,
                                        c, 1);
    if (num > 0)
      {
===================================================================
RCS file: /cvs/e/e16/e/src/hints.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -3 -r1.17 -r1.18
--- hints.h     5 Sep 2007 19:12:55 -0000       1.17
+++ hints.h     23 Feb 2008 11:57:41 -0000      1.18
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various 
contributors
- * Copyright (C) 2004-2007 Kim Woelders
+ * Copyright (C) 2004-2008 Kim Woelders
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
@@ -24,11 +24,30 @@
 #ifndef _HINTS_H_
 #define _HINTS_H_
 
+#include "etypes.h"
+#include "xwin.h"
+
+void                AtomListIntern(const char *const *names, unsigned int num,
+                                  unsigned int *atoms);
+
 /* Misc atoms */
-extern Atom         E_XA_MANAGER;
 
-extern Atom         E_XROOTPMAP_ID;
-extern Atom         E_XROOTCOLOR_PIXEL;
+extern unsigned int atoms_misc[];
+
+#define E_XA_MANAGER                   atoms_misc[0]
+
+#define E_XROOTPMAP_ID                 atoms_misc[1]
+#define E_XROOTCOLOR_PIXEL             atoms_misc[2]
+
+#define E16_ATOM_VERSION               atoms_misc[3]
+
+#define E16_ATOM_COMMS_WIN             atoms_misc[4]
+#define E16_ATOM_COMMS_MSG             atoms_misc[5]
+
+#define E16_ATOM_INTERNAL_AREA_DATA    atoms_misc[6]
+#define E16_ATOM_INTERNAL_DESK_DATA    atoms_misc[7]
+#define E16_ATOM_WIN_DATA              atoms_misc[8]
+#define E16_ATOM_WIN_BORDER            atoms_misc[9]
 
 /* ewmh.c */
 void                EWMH_Init(Window win_wm_check);



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to