gdk: move GdkAtom boxed type registration to common code
This commit is contained in:
parent
779ff372ec
commit
8811f9398a
3 changed files with 31 additions and 26 deletions
25
gdk/gdk.c
25
gdk/gdk.c
|
|
@ -817,6 +817,31 @@ gdk_threads_add_timeout_seconds (guint interval,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static gpointer
|
||||||
|
gdk_atom_copy (gpointer atom)
|
||||||
|
{
|
||||||
|
return atom;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gdk_atom_free (gpointer atom)
|
||||||
|
{
|
||||||
|
/* GdkAtom values are interned and must not be freed. */
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
gdk_atom_get_type (void)
|
||||||
|
{
|
||||||
|
static GType our_type = 0;
|
||||||
|
|
||||||
|
if (our_type == 0)
|
||||||
|
our_type = g_boxed_type_register_static (g_intern_static_string ("GdkAtom"),
|
||||||
|
(GBoxedCopyFunc) gdk_atom_copy,
|
||||||
|
(GBoxedFreeFunc) gdk_atom_free);
|
||||||
|
|
||||||
|
return our_type;
|
||||||
|
}
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
gdk_get_program_class (void)
|
gdk_get_program_class (void)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -185,8 +185,13 @@ gdk_utf8_to_compound_text
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if IN_HEADER(__GDK_PROPERTY_H__)
|
#if IN_HEADER(__GDK_PROPERTY_H__)
|
||||||
#if IN_FILE(__GDK_PROPERTY_X11_C__)
|
#if IN_FILE(__GDK_C__)
|
||||||
gdk_atom_get_type G_GNUC_CONST
|
gdk_atom_get_type G_GNUC_CONST
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if IN_HEADER(__GDK_PROPERTY_H__)
|
||||||
|
#if IN_FILE(__GDK_PROPERTY_X11_C__)
|
||||||
gdk_atom_intern
|
gdk_atom_intern
|
||||||
gdk_atom_intern_static_string
|
gdk_atom_intern_static_string
|
||||||
gdk_atom_name
|
gdk_atom_name
|
||||||
|
|
|
||||||
|
|
@ -393,31 +393,6 @@ intern_atom (const gchar *atom_name,
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gpointer
|
|
||||||
gdk_atom_copy (gpointer atom)
|
|
||||||
{
|
|
||||||
return atom;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gdk_atom_free (gpointer atom)
|
|
||||||
{
|
|
||||||
/* GdkAtom values are interned and must not be freed. */
|
|
||||||
}
|
|
||||||
|
|
||||||
GType
|
|
||||||
gdk_atom_get_type (void)
|
|
||||||
{
|
|
||||||
static GType our_type = 0;
|
|
||||||
|
|
||||||
if (our_type == 0)
|
|
||||||
our_type = g_boxed_type_register_static (g_intern_static_string ("GdkAtom"),
|
|
||||||
(GBoxedCopyFunc) gdk_atom_copy,
|
|
||||||
(GBoxedFreeFunc) gdk_atom_free);
|
|
||||||
|
|
||||||
return our_type;
|
|
||||||
}
|
|
||||||
|
|
||||||
GdkAtom
|
GdkAtom
|
||||||
gdk_atom_intern (const gchar *atom_name,
|
gdk_atom_intern (const gchar *atom_name,
|
||||||
gboolean only_if_exists)
|
gboolean only_if_exists)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue