3 #endif /* ifdef HAVE_CONFIG_H */
8 # define alloca __builtin_alloca
10 # define alloca __alloca
11 #elif defined _MSC_VER
13 # define alloca _alloca
14 #else /* ifdef HAVE_ALLOCA_H */
18 # endif /* ifdef __cplusplus */
20 #endif /* ifdef HAVE_ALLOCA_H */
25 #include "ecore_x_private.h"
27 #include "Ecore_X_Atoms.h"
28 #include "ecore_x_atoms_decl.h"
31 _ecore_x_atoms_init(void)
37 num = sizeof(atom_items) / sizeof(Atom_Item);
38 atoms = alloca(num * sizeof(Atom));
39 names = alloca(num * sizeof(char *));
40 for (i = 0; i < num; i++)
41 names[i] = (char *) atom_items[i].name;
42 XInternAtoms(_ecore_x_disp, names, num, False, atoms);
43 for (i = 0; i < num; i++)
44 *(atom_items[i].atom) = atoms[i];
48 * Retrieves the atom value associated with the given name.
49 * @param name The given name.
50 * @return Associated atom value.
53 ecore_x_atom_get(const char *name)
58 LOGFN(__FILE__, __LINE__, __FUNCTION__);
59 return XInternAtom(_ecore_x_disp, name, False);
63 ecore_x_atoms_get(const char **names,
73 LOGFN(__FILE__, __LINE__, __FUNCTION__);
74 atoms_int = alloca(num * sizeof(Atom));
75 XInternAtoms(_ecore_x_disp, (char **)names, num, False, atoms_int);
76 for (i = 0; i < num; i++)
77 atoms[i] = atoms_int[i];
81 ecore_x_atom_name_get(Ecore_X_Atom atom)
89 LOGFN(__FILE__, __LINE__, __FUNCTION__);
91 xname = XGetAtomName(_ecore_x_disp, atom);