Moved atomnames.h to includes so can be included from display.h.

meta_display_get_atom: allow common atom retrieval via enum (to avoid interning
identical atoms at different places).
This commit is contained in:
Tomas Frydrych 2008-08-18 15:10:13 +01:00
parent 5ebaa15333
commit f7f696c310
3 changed files with 22 additions and 5 deletions

View File

@ -5183,3 +5183,10 @@ meta_display_get_shape_event_base (MetaDisplay *display)
}
#endif
#endif
Atom meta_display_get_atom (MetaDisplay *display, MetaAtom meta_atom)
{
Atom *atoms = & display->atom_WM_PROTOCOLS;
return atoms[meta_atom - 1];
}

View File

@ -42,7 +42,7 @@
#ifndef EWMH_ATOMS_ONLY
item(WM_PROTOCOLS)
item(WM_PROTOCOLS) /* MUST BE FIRST */
item(WM_TAKE_FOCUS)
item(WM_DELETE_WINDOW)
item(WM_STATE)
@ -122,6 +122,7 @@ item(_NET_WM_STRUT)
item(_NET_WM_STATE_HIDDEN)
item(_NET_WM_WINDOW_TYPE_UTILITY)
item(_NET_WM_WINDOW_TYPE_SPLASH)
item(_NET_WM_WINDOW_TYPE_DND)
item(_NET_WM_STATE_FULLSCREEN)
item(_NET_WM_PING)
item(_NET_WM_PID)

View File

@ -29,6 +29,14 @@
#define meta_XFree(p) do { if ((p)) XFree ((p)); } while (0)
typedef enum
{
META_ATOM_FIRST = 0,
#define item(x) META_ATOM_##x,
#include "atomnames.h"
#undef item
}MetaAtom;
void meta_display_get_compositor_version (MetaDisplay *display,
int *major,
int *minor);
@ -44,5 +52,6 @@ MetaWindow *meta_display_get_focus_window (MetaDisplay *display);
int meta_display_get_damage_event_base (MetaDisplay *display);
int meta_display_get_shape_event_base (MetaDisplay *display);
Atom meta_display_get_atom (MetaDisplay *display, MetaAtom meta_atom);
#endif