gnome-perl-introspection r21 - in trunk/Glib-Object-Introspection: . xs



Author: tsch
Date: Sun Nov  2 21:03:18 2008
New Revision: 21
URL: http://svn.gnome.org/viewvc/gnome-perl-introspection?rev=21&view=rev

Log:
Track the rename GMetadata => GTypelib.  Use g_typelib_new_from_const_memory
instead of g_typelib_new_from_memory.  In gperl_i11n_get_gtype simply use
g_registered_type_info_get_g_type.  Track API removals and additions in
g_irepository_*: don't wrap g_irepository_register, g_irepository_unregister,
and g_irepository_register_file; track the rename g_irepository_get_namespaces
=> g_irepository_get_loaded_namespaces; wrap g_irepository_require.


Added:
   trunk/Glib-Object-Introspection/xs/IdlTypelib.xs   (contents, props changed)
      - copied, changed from r17, /trunk/Glib-Object-Introspection/xs/IdlMetadata.xs
Removed:
   trunk/Glib-Object-Introspection/xs/IdlMetadata.xs
Modified:
   trunk/Glib-Object-Introspection/gobject-introspection-perl.h
   trunk/Glib-Object-Introspection/gobject-introspection.typemap
   trunk/Glib-Object-Introspection/xs/IdlRepository.xs

Modified: trunk/Glib-Object-Introspection/gobject-introspection-perl.h
==============================================================================
--- trunk/Glib-Object-Introspection/gobject-introspection-perl.h	(original)
+++ trunk/Glib-Object-Introspection/gobject-introspection-perl.h	Sun Nov  2 21:03:18 2008
@@ -79,7 +79,7 @@
 SV * newSVGIObjectInfo (GIObjectInfo *info);
 GIObjectInfo * SvGIObjectInfo (SV *info);
 
-SV * newSVGMetadata (GMetadata *metadata);
-GMetadata * SvGMetadata (SV *metadata);
+SV * newSVGTypelib (GTypelib *typelib);
+GTypelib * SvGTypelib (SV *typelib);
 
 #endif /* _GOBJECT_INTROSPECTION_PERL_H_ */

Modified: trunk/Glib-Object-Introspection/gobject-introspection.typemap
==============================================================================
--- trunk/Glib-Object-Introspection/gobject-introspection.typemap	(original)
+++ trunk/Glib-Object-Introspection/gobject-introspection.typemap	Sun Nov  2 21:03:18 2008
@@ -18,4 +18,4 @@
 GIValueInfo *		T_GPERL_GENERIC_WRAPPER
 GIVFuncInfo *		T_GPERL_GENERIC_WRAPPER
 
-GMetadata * 		T_GPERL_GENERIC_WRAPPER
+GTypelib * 		T_GPERL_GENERIC_WRAPPER

Modified: trunk/Glib-Object-Introspection/xs/IdlRepository.xs
==============================================================================
--- trunk/Glib-Object-Introspection/xs/IdlRepository.xs	(original)
+++ trunk/Glib-Object-Introspection/xs/IdlRepository.xs	Sun Nov  2 21:03:18 2008
@@ -25,30 +25,7 @@
 GType
 gperl_i11n_get_gtype (GIRegisteredTypeInfo *info)
 {
-	const gchar *symbol;
-	gpointer func;
-	ffi_type *return_type;
-	ffi_cif cif;
-	GType return_value = 0;
-
-	symbol = g_registered_type_info_get_type_init (
-			(GIRegisteredTypeInfo *) info);
-	func = dlsym (NULL, symbol);
-	if (!func)
-		croak ("Couldn't retrieve function pointer for %s: %s",
-		       symbol, dlerror ());
-
-	/* GType == gulong */
-	return_type = &ffi_type_ulong;
-
-	if (FFI_OK != ffi_prep_cif (&cif, FFI_DEFAULT_ABI, 0, return_type, NULL))
-		croak ("Couldn't prepare function call");
-
-	ffi_call (&cif, func, &return_value, NULL);
-	if (!return_value)
-		croak ("Couldn't retrieve type");
-
-	return return_value;
+	return g_registered_type_info_get_g_type (info);
 }
 
 MODULE = Glib::Object::Introspection::Repository	PACKAGE = Glib::Object::Introspection::Repository	PREFIX = g_irepository_
@@ -59,41 +36,45 @@
     C_ARGS:
 	/* void */
 
-void g_irepository_register (GIRepository *repository, GMetadata *metadata);
+# void g_irepository_prepend_search_path (const char *directory);
+
+# const char * g_irepository_load_typelib (GIRepository *repository, GTypelib *typelib, GIRepositoryLoadFlags flags, GError **error);
 
-void g_irepository_unregister (GIRepository *repository, const gchar *namespace);
+# gboolean g_irepository_is_registered (GIRepository *repository, const gchar *namespace, const gchar *version);
+
+GIBaseInfo * g_irepository_find_by_name (GIRepository *repository, const gchar  *namespace, const gchar  *name);
 
 =for apidoc __gerror__
 =cut
-# const gchar * g_irepository_register_file (GIRepository *repository, const gchar *filename, GError **error);
-const gchar *
-g_irepository_register_file (GIRepository *repository, const gchar *filename)
+# GTypelib * g_irepository_require (GIRepository *repository, const gchar *namespace, const gchar *version, GIRepositoryLoadFlags flags, GError **error);
+GTypelib *
+g_irepository_require (GIRepository *repository, const gchar *namespace, const gchar *version, GIRepositoryLoadFlags flags)
     PREINIT:
 	GError *error = NULL;
     CODE:
-	RETVAL = g_irepository_register_file (repository, filename, &error);
-	if (error)
+	RETVAL = g_irepository_require (repository, namespace, version, flags, &error);
+	if (error) {
 		gperl_croak_gerror (NULL, error);
+	}
     OUTPUT:
 	RETVAL
 
-GIBaseInfo * g_irepository_find_by_name (GIRepository *repository, const gchar  *namespace, const gchar  *name);
+# gchar ** g_irepository_get_dependencies (GIRepository *repository, const gchar *namespace);
 
-# gchar ** g_irepository_get_namespaces (GIRepository *repository);
+# gchar ** g_irepository_get_loaded_namespaces (GIRepository *repository);
 void
-g_irepository_get_namespaces (repository)
+g_irepository_get_loaded_namespaces (repository)
 	GIRepository *repository
     PREINIT:
 	gchar **namespaces = NULL;
 	gchar *namespace = NULL;
     PPCODE:
-	namespaces = g_irepository_get_namespaces (repository);
+	namespaces = g_irepository_get_loaded_namespaces (repository);
 	while ((namespace = *namespaces++)) {
 		XPUSHs (sv_2mortal (newSVGChar (namespace)));
 		g_free (namespace);
 	}
 
-# FIXME: Needed?
 # GIBaseInfo * g_irepository_find_by_gtype (GIRepository *repository, GType gtype);
 
 # gint g_irepository_get_n_infos (GIRepository *repository, const gchar *namespace);
@@ -111,6 +92,14 @@
 		PUSHs (sv_2mortal (newSVGIBaseInfo (
 		  g_irepository_get_info (repository, namespace, i))));
 
+# const gchar * g_irepository_get_typelib_path   (GIRepository *repository, const gchar  *namespace);
+
+# const gchar * g_irepository_get_shared_library (GIRepository *repository, const gchar  *namespace);
+
+# const gchar * g_irepository_get_version (GIRepository *repository, const gchar  *namespace);
+
+# --------------------------------------------------------------------------- #
+
 void
 register_types (repository, namespace, package)
 	GIRepository *repository

Copied: trunk/Glib-Object-Introspection/xs/IdlTypelib.xs (from r17, /trunk/Glib-Object-Introspection/xs/IdlMetadata.xs)
==============================================================================
--- /trunk/Glib-Object-Introspection/xs/IdlMetadata.xs	(original)
+++ trunk/Glib-Object-Introspection/xs/IdlTypelib.xs	Sun Nov  2 21:03:18 2008
@@ -21,42 +21,44 @@
 #include "gobject-introspection-perl.h"
 
 SV *
-newSVGMetadata (GMetadata *metadata)
+newSVGTypelib (GTypelib *typelib)
 {
         SV *sv = newSV (0);
 
-        return sv_setref_pv (sv, "Glib::Object::Introspection::Metadata", metadata);
+        return sv_setref_pv (sv, "Glib::Object::Introspection::Typelib", typelib);
 }
 
-GMetadata *
-SvGMetadata (SV *metadata)
+GTypelib *
+SvGTypelib (SV *typelib)
 {
-        return INT2PTR (GMetadata *, SvIV (SvRV (metadata)));
+        return INT2PTR (GTypelib *, SvIV (SvRV (typelib)));
 
 }
 
-MODULE = Glib::Object::Introspection::Metadata	PACKAGE = Glib::Object::Introspection::Metadata	PREFIX = g_metadata_
+MODULE = Glib::Object::Introspection::Typelib	PACKAGE = Glib::Object::Introspection::Typelib	PREFIX = g_typelib_
 
-# void g_metadata_free (GMetadata *metadata);
-# void
-# DESTROY (GMetadata *metadata)
-#     CODE:
-# 	g_metadata_free (metadata);
-
-# GMetadata * g_metadata_new_from_memory (guchar *memory, gsize len);
-# GMetadata * g_metadata_new_from_const_memory (const guchar *memory, gsize len);
-# GMetadata * g_metadata_new_from_mapped_file (GMappedFile  *mfile);
-GMetadata *
-g_metadata_new_from_memory (class, SV *scalar)
+# void g_typelib_free (GTypelib *typelib);
+void
+DESTROY (GTypelib *typelib)
+    CODE:
+	/* We don't own the typelib in most cases. */
+	PERL_UNUSED_VAR (typelib);
+	/* g_typelib_free (typelib); */
+
+# GTypelib * g_typelib_new_from_memory (guchar *memory, gsize len);
+# GTypelib * g_typelib_new_from_const_memory (const guchar *memory, gsize len);
+# GTypelib * g_typelib_new_from_mapped_file (GMappedFile  *mfile);
+GTypelib *
+g_typelib_new_from_memory (class, SV *scalar)
     PREINIT:
 	gchar *memory;
 	STRLEN length;
     CODE:
 	memory = SvPV (scalar, length);
-	RETVAL = g_metadata_new_from_memory ((guchar *) memory, length);
+	RETVAL = g_typelib_new_from_const_memory ((const guchar *) memory, length);
     OUTPUT:
 	RETVAL
 
-# void g_metadata_set_module (GMetadata *metadata, GModule *module);
+# gboolean g_typelib_symbol (GTypelib *typelib, const gchar *symbol_name, gpointer *symbol);
 
-const gchar * g_metadata_get_namespace (GMetadata *metadata);
+const gchar * g_typelib_get_namespace (GTypelib *typelib);



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