[gobject-introspection] [girepository] Move GIRegisteredTypeInfo out of ginfo.ch



commit 553097d46144cef1b2e3a1315581c38d16fb73f4
Author: Johan Dahlin <johan gnome org>
Date:   Sun Jun 6 19:28:35 2010 -0300

    [girepository] Move GIRegisteredTypeInfo out of ginfo.ch

 girepository/Makefile.am            |    6 ++-
 girepository/ginfo.c                |   48 ----------------------
 girepository/giregisteredtypeinfo.c |   75 +++++++++++++++++++++++++++++++++++
 girepository/giregisteredtypeinfo.h |   51 +++++++++++++++++++++++
 girepository/girepository.h         |   14 +------
 5 files changed, 131 insertions(+), 63 deletions(-)
---
diff --git a/girepository/Makefile.am b/girepository/Makefile.am
index 8fccc93..34cdfab 100644
--- a/girepository/Makefile.am
+++ b/girepository/Makefile.am
@@ -7,6 +7,7 @@ girepo_HEADERS =				\
     gierrordomaininfo.h				\
     gifieldinfo.h				\
     gifunctioninfo.h				\
+    giregisteredtypeinfo.h			\
     girepository.h				\
     girffi.h					\
     gitypeinfo.h				\
@@ -27,15 +28,16 @@ libgirepository_1_0_la_SOURCES =		\
 	gifunctioninfo.c			\
 	ginfo.c                                 \
 	ginvoke.c				\
+	giregisteredtypeinfo.c			\
 	girepository.c				\
 	girepository-private.h			\
 	girffi.c                                \
 	girffi.h                                \
 	girffi-private.h                        \
-	glib-compat.h                           \
 	gitypeinfo.c				\
 	gitypelib.c				\
-	gitypelib-internal.h
+	gitypelib-internal.h			\
+	glib-compat.h
 
 libgirepository_1_0_la_CPPFLAGS = $(GIREPO_CFLAGS)
 libgirepository_1_0_la_LIBADD = $(GIREPO_LIBS)
diff --git a/girepository/ginfo.c b/girepository/ginfo.c
index 825ad5d..5048431 100644
--- a/girepository/ginfo.c
+++ b/girepository/ginfo.c
@@ -28,54 +28,6 @@
 #include "gitypelib-internal.h"
 #include "girepository-private.h"
 
-/* GIRegisteredTypeInfo functions */
-const gchar *
-g_registered_type_info_get_type_name (GIRegisteredTypeInfo *info)
-{
-  GIRealInfo *rinfo = (GIRealInfo *)info;
-  RegisteredTypeBlob *blob = (RegisteredTypeBlob *)&rinfo->typelib->data[rinfo->offset];
-
-  if (blob->gtype_name)
-    return g_typelib_get_string (rinfo->typelib, blob->gtype_name);
-
-  return NULL;
-}
-
-const gchar *
-g_registered_type_info_get_type_init (GIRegisteredTypeInfo *info)
-{
-  GIRealInfo *rinfo = (GIRealInfo *)info;
-  RegisteredTypeBlob *blob = (RegisteredTypeBlob *)&rinfo->typelib->data[rinfo->offset];
-
-  if (blob->gtype_init)
-    return g_typelib_get_string (rinfo->typelib, blob->gtype_init);
-
-  return NULL;
-}
-
-GType
-g_registered_type_info_get_g_type (GIRegisteredTypeInfo *info)
-{
-  const char *type_init;
-  GType (* get_type_func) (void);
-  GIRealInfo *rinfo = (GIRealInfo*)info;
-
-  type_init = g_registered_type_info_get_type_init (info);
-
-  if (type_init == NULL)
-    return G_TYPE_NONE;
-  else if (!strcmp (type_init, "intern"))
-    return G_TYPE_OBJECT;
-
-  get_type_func = NULL;
-  if (!g_typelib_symbol (rinfo->typelib,
-                         type_init,
-                         (void**) &get_type_func))
-    return G_TYPE_NONE;
-
-  return (* get_type_func) ();
-}
-
 /* GIStructInfo functions */
 gint
 g_struct_info_get_n_fields (GIStructInfo *info)
diff --git a/girepository/giregisteredtypeinfo.c b/girepository/giregisteredtypeinfo.c
new file mode 100644
index 0000000..944444f
--- /dev/null
+++ b/girepository/giregisteredtypeinfo.c
@@ -0,0 +1,75 @@
+/* GObject introspection: Registered Type implementation
+ *
+ * Copyright (C) 2005 Matthias Clasen
+ * Copyright (C) 2008,2009 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include <glib.h>
+
+#include <girepository.h>
+#include "girepository-private.h"
+#include "gitypelib-internal.h"
+#include "girffi.h"
+
+const gchar *
+g_registered_type_info_get_type_name (GIRegisteredTypeInfo *info)
+{
+  GIRealInfo *rinfo = (GIRealInfo *)info;
+  RegisteredTypeBlob *blob = (RegisteredTypeBlob *)&rinfo->typelib->data[rinfo->offset];
+
+  if (blob->gtype_name)
+    return g_typelib_get_string (rinfo->typelib, blob->gtype_name);
+
+  return NULL;
+}
+
+const gchar *
+g_registered_type_info_get_type_init (GIRegisteredTypeInfo *info)
+{
+  GIRealInfo *rinfo = (GIRealInfo *)info;
+  RegisteredTypeBlob *blob = (RegisteredTypeBlob *)&rinfo->typelib->data[rinfo->offset];
+
+  if (blob->gtype_init)
+    return g_typelib_get_string (rinfo->typelib, blob->gtype_init);
+
+  return NULL;
+}
+
+GType
+g_registered_type_info_get_g_type (GIRegisteredTypeInfo *info)
+{
+  const char *type_init;
+  GType (* get_type_func) (void);
+  GIRealInfo *rinfo = (GIRealInfo*)info;
+
+  type_init = g_registered_type_info_get_type_init (info);
+
+  if (type_init == NULL)
+    return G_TYPE_NONE;
+  else if (!strcmp (type_init, "intern"))
+    return G_TYPE_OBJECT;
+
+  get_type_func = NULL;
+  if (!g_typelib_symbol (rinfo->typelib,
+                         type_init,
+                         (void**) &get_type_func))
+    return G_TYPE_NONE;
+
+  return (* get_type_func) ();
+}
+
diff --git a/girepository/giregisteredtypeinfo.h b/girepository/giregisteredtypeinfo.h
new file mode 100644
index 0000000..8a63321
--- /dev/null
+++ b/girepository/giregisteredtypeinfo.h
@@ -0,0 +1,51 @@
+/* GObject introspection: Registered Type
+ *
+ * Copyright (C) 2005 Matthias Clasen
+ * Copyright (C) 2008,2009 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __GIREGISTEREDTYPEINFO_H__
+#define __GIREGISTEREDTYPEINFO_H__
+
+#if !defined (__GIREPOSITORY_H_INSIDE__) && !defined (GI_COMPILATION)
+#error "Only <girepository.h> can be included directly."
+#endif
+
+#include <glib-object.h>
+#include <gitypes.h>
+
+G_BEGIN_DECLS
+
+/* GIRegisteredTypeInfo */
+
+#define GI_IS_REGISTERED_TYPE_INFO(info) \
+    ((g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_ENUM) || \
+     (g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_INTERFACE) || \
+     (g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_OBJECT) || \
+     (g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_STRUCT) || \
+     (g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_UNION))
+
+const gchar *          g_registered_type_info_get_type_name (GIRegisteredTypeInfo *info);
+const gchar *          g_registered_type_info_get_type_init (GIRegisteredTypeInfo *info);
+GType                  g_registered_type_info_get_g_type    (GIRegisteredTypeInfo *info);
+
+G_END_DECLS
+
+
+#endif  /* __GIREGISTEREDTYPEINFO_H__ */
+
diff --git a/girepository/girepository.h b/girepository/girepository.h
index d038459..47d02b5 100644
--- a/girepository/girepository.h
+++ b/girepository/girepository.h
@@ -33,6 +33,7 @@
 #include <gierrordomaininfo.h>
 #include <gifieldinfo.h>
 #include <gifunctioninfo.h>
+#include <giregisteredtypeinfo.h>
 #include <gitypeinfo.h>
 #include <gitypelib.h>
 #include <gitypes.h>
@@ -191,19 +192,6 @@ gsize                  g_struct_info_get_alignment (GIStructInfo *info);
 gboolean               g_struct_info_is_gtype_struct (GIStructInfo *info);
 gboolean               g_struct_info_is_foreign    (GIStructInfo *info);
 
-/* GIRegisteredTypeInfo */
-
-#define GI_IS_REGISTERED_TYPE_INFO(info) \
-    ((g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_ENUM) || \
-     (g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_INTERFACE) || \
-     (g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_OBJECT) || \
-     (g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_STRUCT) || \
-     (g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_UNION))
-
-const gchar *          g_registered_type_info_get_type_name (GIRegisteredTypeInfo *info);
-const gchar *          g_registered_type_info_get_type_init (GIRegisteredTypeInfo *info);
-GType                  g_registered_type_info_get_g_type    (GIRegisteredTypeInfo *info);
-
 /* GIObjectInfo */
 
 #define GI_IS_OBJECT_INFO(info) \



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]