3 #endif /* ifdef HAVE_CONFIG_H */
17 #include "ecore_x_private.h"
19 #include "Ecore_X_Atoms.h"
20 #include "ecore_x_atoms_decl.h"
23 _ecore_x_atoms_init(void)
29 num = sizeof(atom_items) / sizeof(Atom_Item);
30 atoms = alloca(num * sizeof(Atom));
31 names = alloca(num * sizeof(char *));
32 for (i = 0; i < num; i++)
33 names[i] = (char *) atom_items[i].name;
34 XInternAtoms(_ecore_x_disp, names, num, False, atoms);
35 for (i = 0; i < num; i++)
36 *(atom_items[i].atom) = atoms[i];
40 * Retrieves the atom value associated with the given name.
41 * @param name The given name.
42 * @return Associated atom value.
45 ecore_x_atom_get(const char *name)
49 LOGFN(__FILE__, __LINE__, __FUNCTION__);
50 EINA_SAFETY_ON_NULL_RETURN_VAL(_ecore_x_disp, 0);
51 atom = XInternAtom(_ecore_x_disp, name, False);
52 if (_ecore_xlib_sync) ecore_x_sync();
57 ecore_x_atoms_get(const char **names,
64 LOGFN(__FILE__, __LINE__, __FUNCTION__);
65 EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp);
66 atoms_int = alloca(num * sizeof(Atom));
67 XInternAtoms(_ecore_x_disp, (char **)names, num, False, atoms_int);
68 for (i = 0; i < num; i++)
69 atoms[i] = atoms_int[i];
70 if (_ecore_xlib_sync) ecore_x_sync();
74 ecore_x_atom_name_get(Ecore_X_Atom atom)
79 LOGFN(__FILE__, __LINE__, __FUNCTION__);
81 EINA_SAFETY_ON_NULL_RETURN_VAL(_ecore_x_disp, NULL);
83 xname = XGetAtomName(_ecore_x_disp, atom);
84 if (_ecore_xlib_sync) ecore_x_sync();