gobject-introspection r466 - in trunk: . tests/scanner



Author: johan
Date: Sat Aug 23 12:59:04 2008
New Revision: 466
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=466&view=rev

Log:
2008-08-23  Johan Dahlin  <johan gnome org>

    * tests/scanner/Makefile.am:
    * tests/scanner/annotation-expected.gir:
    * tests/scanner/drawable-expected.gir:
    Avoid duplication in the Makefile, regenerate with new
    namespaces (same as the filename)



Modified:
   trunk/ChangeLog
   trunk/tests/scanner/   (props changed)
   trunk/tests/scanner/Makefile.am
   trunk/tests/scanner/annotation-expected.gir
   trunk/tests/scanner/drawable-expected.gir
   trunk/tests/scanner/drawable.h

Modified: trunk/tests/scanner/Makefile.am
==============================================================================
--- trunk/tests/scanner/Makefile.am	(original)
+++ trunk/tests/scanner/Makefile.am	Sat Aug 23 12:59:04 2008
@@ -1,97 +1,57 @@
-CLEANFILES = 
-EXTRA_DIST =
-
 # We need to build a shared library, which can be dlopened
 # it does not work with noinst_LTLIBRARIES
-testlib_LTLIBRARIES = 		\
-	libannotation.la 	\
-	libdrawable.la 		\
-	libfoo.la 		\
+testlib_LTLIBRARIES = \
+	libannotation.la \
+	libdrawable.la \
+	libfoo.la \
 	libutility.la
 testlibdir = $(prefix)/unused
 install-testlibLTLIBRARIES: # prevent it from being installed
 
-libannotation_la_SOURCES = $(srcdir)/annotation.c $(srcdir)/annotation.h
-libannotation_la_CFLAGS = $(GOBJECT_CFLAGS)
-libannotation_la_LDFLAGS = -module -avoid-version
-libannotation_la_LIBADD = $(GOBJECT_LIBS)
+AM_CFLAGS = $(GOBJECT_CFLAGS)
+AM_LDFLAGS = -module -avoid-version
+LIBS = $(GOBJECT_LIBS)
 
+libannotation_la_SOURCES = $(srcdir)/annotation.c $(srcdir)/annotation.h
 libdrawable_la_SOURCES = $(srcdir)/drawable.c $(srcdir)/drawable.h
-libdrawable_la_CFLAGS = $(GOBJECT_CFLAGS)
-libdrawable_la_LDFLAGS = -module -avoid-version
-libdrawable_la_LIBADD = $(GOBJECT_LIBS)
-
 libfoo_la_SOURCES = $(srcdir)/foo.c $(srcdir)/foo.h
-libfoo_la_CFLAGS = $(GOBJECT_CFLAGS)
-libfoo_la_LDFLAGS = -module -avoid-version
-libfoo_la_LIBADD = $(GOBJECT_LIBS)
-
 libutility_la_SOURCES = $(srcdir)/utility.c $(srcdir)/utility.h
-libutility_la_CFLAGS = $(GOBJECT_CFLAGS)
-libutility_la_LDFLAGS = -module -avoid-version
-libutility_la_LIBADD = $(GOBJECT_LIBS)
-
-GIRS = utility.gir annotation.gir foo.gir
-EXTRA_DIST += $(GIRS:.gir=-expected.gir)
 
+GIRS =
 SCANNER = $(top_srcdir)/tools/g-ir-scanner
 SCANNER_LIBS = \
 	$(top_srcdir)/giscanner/*.py \
 	$(top_builddir)/giscanner/libgiscanner.la
+TYPELIBS = $(GIRS:.gir=.typelib)
+TXMLS = $(GIRS:.gir=.gir.txml)
+CHECKGIRS = $(GIRS:.gir=.gir.check)
+CLEANFILES = $(TYPELIBS) $(TXMLS) $(GIRS)
+BUILT_SOURCES = $(TYPELIBS) $(TXMLS) $(GIRS)
 
-annotation.gir: libannotation.la annotation.h $(SCANNER) $(SCANNER_LIBS)
-	$(CHECK_DEBUG) $(SCANNER) -v \
-	--include=$(top_srcdir)/gir/GLib.gir \
-	--include=$(top_srcdir)/gir/GObject.gir \
-	--library=libannotation.la \
-	--namespace=test \
-	--pkg gobject-2.0 \
-	$(libannotation_la_SOURCES) \
-	 --output $@
-
-drawable.gir: libdrawable.la drawable.h $(SCANNER) $(SCANNER_LIBS)
-	$(CHECK_DEBUG) $(SCANNER) -v \
-	--include=$(top_srcdir)/gir/GLib.gir \
-	--include=$(top_srcdir)/gir/GObject.gir \
-	--library=libdrawable.la \
-	--namespace=test \
-	--pkg gobject-2.0 \
-	$(libdrawable_la_SOURCES) \
-	 --output $@
-
-foo.gir: utility.gir libfoo.la foo.h $(SCANNER) $(SCANNER_LIBS)
+%.gir: lib%.la %.c %.h utility.gir $(SCANNER) $(SCANNER_LIBS)
 	$(CHECK_DEBUG) $(SCANNER) -v \
 	--include=$(top_srcdir)/gir/GLib.gir \
 	--include=$(top_srcdir)/gir/GObject.gir \
 	--include=$(top_builddir)/tests/scanner/utility.gir \
-	--library=libfoo.la \
-	--namespace=foo \
+	--library=$< \
+	--namespace=$* \
 	--pkg gobject-2.0 \
-	$(libfoo_la_SOURCES) \
+	$(srcdir)/$*.h $(srcdir)/$*.c \
 	 --output $@
+GIRS += annotation.gir
+GIRS += drawable.gir
+GIRS += foo.gir
 
 utility.gir: libutility.la utility.h $(SCANNER) $(SCANNER_LIBS)
 	$(CHECK_DEBUG) $(SCANNER) -v \
 	--include=$(top_srcdir)/gir/GLib.gir \
 	--include=$(top_srcdir)/gir/GObject.gir \
-	--library=libutility.la \
-	--namespace=utility \
+	--library=$< \
+	--namespace=$* \
 	--pkg gobject-2.0 \
-	$(libutility_la_SOURCES) \
+	$(srcdir)/$*.h $(srcdir)/$*.c \
 	--output $@
-
-check-%.gir: %.gir
-	@diff -u -U 10 $(srcdir)/$*-expected.gir $*.gir && echo "* $*.gir"
-
-%.typelib: %.gir
-	$(top_builddir)/tools/g-ir-compiler $< -o $@
-	$(SCANNER) --typelib-xml $< > $<.tmp && mv $<.tmp $<.txml
-
-check-%.typelib: %.typelib
-
-
-TYPELIBS = $(GIRS:.gir=.typelib)
-CLEANFILES += $(TYPELIBS)
+GIRS += utility.gir
 
 pre-check:
 	@if test "$(top_builddir)" != "$(top_srcdir)"; then \
@@ -107,10 +67,13 @@
 	   rm -f $(top_builddir)/giscanner/*.py*; \
 	fi
 
+%.gir.check: %.gir
+	@diff -u -U 10 $(srcdir)/$*-expected.gir $*.gir && echo "* $*.gir"
+
+%.typelib: %.gir
+	$(top_builddir)/tools/g-ir-compiler $< -o $@
+	$(SCANNER) --typelib-xml $< > $<.tmp && mv $<.tmp $<.txml
+
 check-local: pre-check
-check-local: check-utility.gir check-annotation.gir check-drawable.gir 
-check-local: check-foo.gir
-check-local: $(TYPELIBS)
+check-local: $(CHECKGIRS) $(TYPELIBS)
 check-local: post-check
-
-.PHONY: annotation.gir drawable.gir foo.gir utility.gir 

Modified: trunk/tests/scanner/annotation-expected.gir
==============================================================================
--- trunk/tests/scanner/annotation-expected.gir	(original)
+++ trunk/tests/scanner/annotation-expected.gir	Sat Aug 23 12:59:04 2008
@@ -3,144 +3,139 @@
             xmlns="http://www.gtk.org/introspection/core/1.0";
             xmlns:c="http://www.gtk.org/introspection/c/1.0";
             xmlns:glib="http://www.gtk.org/introspection/glib/1.0";>
-  <namespace name="test" shared-library="libannotation.la">
-    <record name="AnnotationObject" c:type="AnnotationObject">
+  <namespace name="annotation" shared-library="libannotation.la">
+    <record name="Object" c:type="AnnotationObject">
       <field name="parent_instance">
         <type name="GObject.Object" c:type="GObject"/>
       </field>
     </record>
-    <record name="AnnotationObjectClass" c:type="AnnotationObjectClass">
+    <record name="ObjectClass" c:type="AnnotationObjectClass">
       <field name="parent_class">
         <type name="GObject.Class" c:type="GObjectClass"/>
       </field>
     </record>
-    <function name="annotation_object_method"
-              c:identifier="annotation_object_method">
+    <function name="object_method" c:identifier="annotation_object_method">
       <return-value>
         <type name="int" c:type="gint"/>
       </return-value>
       <parameters>
         <parameter name="object">
-          <type name="AnnotationObject" c:type="AnnotationObject*"/>
+          <type name="Object" c:type="AnnotationObject*"/>
         </parameter>
       </parameters>
     </function>
-    <function name="annotation_object_out"
-              c:identifier="annotation_object_out">
+    <function name="object_out" c:identifier="annotation_object_out">
       <return-value>
         <type name="int" c:type="gint"/>
       </return-value>
       <parameters>
         <parameter name="object">
-          <type name="AnnotationObject" c:type="AnnotationObject*"/>
+          <type name="Object" c:type="AnnotationObject*"/>
         </parameter>
         <parameter name="outarg" direction="out">
           <type name="int" c:type="int*"/>
         </parameter>
       </parameters>
     </function>
-    <function name="annotation_object_create_object"
+    <function name="object_create_object"
               c:identifier="annotation_object_create_object">
       <return-value transfer-ownership="1">
         <type name="GObject.Object" c:type="GObject*"/>
       </return-value>
       <parameters>
         <parameter name="object">
-          <type name="AnnotationObject" c:type="AnnotationObject*"/>
+          <type name="Object" c:type="AnnotationObject*"/>
         </parameter>
       </parameters>
     </function>
-    <function name="annotation_object_allow_none"
+    <function name="object_allow_none"
               c:identifier="annotation_object_allow_none">
       <return-value>
         <type name="GObject.Object" c:type="GObject*"/>
       </return-value>
       <parameters>
         <parameter name="object">
-          <type name="AnnotationObject" c:type="AnnotationObject*"/>
+          <type name="Object" c:type="AnnotationObject*"/>
         </parameter>
         <parameter name="allow_none" allow-none="1">
           <type name="string" c:type="gchar*"/>
         </parameter>
       </parameters>
     </function>
-    <function name="annotation_object_inout"
-              c:identifier="annotation_object_inout">
+    <function name="object_inout" c:identifier="annotation_object_inout">
       <return-value>
         <type name="int" c:type="gint"/>
       </return-value>
       <parameters>
         <parameter name="object">
-          <type name="AnnotationObject" c:type="AnnotationObject*"/>
+          <type name="Object" c:type="AnnotationObject*"/>
         </parameter>
         <parameter name="inoutarg" direction="inout">
           <type name="int" c:type="int*"/>
         </parameter>
       </parameters>
     </function>
-    <function name="annotation_object_inout2"
-              c:identifier="annotation_object_inout2">
+    <function name="object_inout2" c:identifier="annotation_object_inout2">
       <return-value>
         <type name="int" c:type="gint"/>
       </return-value>
       <parameters>
         <parameter name="object">
-          <type name="AnnotationObject" c:type="AnnotationObject*"/>
+          <type name="Object" c:type="AnnotationObject*"/>
         </parameter>
         <parameter name="inoutarg">
           <type name="int" c:type="int*"/>
         </parameter>
       </parameters>
     </function>
-    <function name="annotation_object_inout3"
-              c:identifier="annotation_object_inout3">
+    <function name="object_inout3" c:identifier="annotation_object_inout3">
       <return-value>
         <type name="int" c:type="gint"/>
       </return-value>
       <parameters>
         <parameter name="object">
-          <type name="AnnotationObject" c:type="AnnotationObject*"/>
+          <type name="Object" c:type="AnnotationObject*"/>
         </parameter>
         <parameter name="inoutarg" direction="inout">
           <type name="int" c:type="int*"/>
         </parameter>
       </parameters>
     </function>
-    <function name="annotation_object_in" c:identifier="annotation_object_in">
+    <function name="object_in" c:identifier="annotation_object_in">
       <return-value>
         <type name="int" c:type="gint"/>
       </return-value>
       <parameters>
         <parameter name="object">
-          <type name="AnnotationObject" c:type="AnnotationObject*"/>
+          <type name="Object" c:type="AnnotationObject*"/>
         </parameter>
         <parameter name="inarg">
           <type name="int" c:type="int*"/>
         </parameter>
       </parameters>
     </function>
-    <function name="annotation_object_calleeowns"
+    <function name="object_calleeowns"
               c:identifier="annotation_object_calleeowns">
       <return-value>
         <type name="int" c:type="gint"/>
       </return-value>
       <parameters>
         <parameter name="object">
-          <type name="AnnotationObject" c:type="AnnotationObject*"/>
+          <type name="Object" c:type="AnnotationObject*"/>
         </parameter>
         <parameter name="toown" transfer-ownership="1">
           <type name="GObject.Object" c:type="GObject*"/>
         </parameter>
       </parameters>
     </function>
-    <function name="annotation_object_calleesowns"
+    <function name="object_calleesowns"
               c:identifier="annotation_object_calleesowns">
       <return-value>
         <type name="int" c:type="gint"/>
       </return-value>
       <parameters>
         <parameter name="object">
-          <type name="AnnotationObject" c:type="AnnotationObject*"/>
+          <type name="Object" c:type="AnnotationObject*"/>
         </parameter>
         <parameter name="toown1" transfer-ownership="1">
           <type name="GObject.Object" c:type="GObject*"/>
@@ -150,7 +145,7 @@
         </parameter>
       </parameters>
     </function>
-    <function name="annotation_object_get_strings"
+    <function name="object_get_strings"
               c:identifier="annotation_object_get_strings">
       <return-value>
         <type name="GLib.List" transfer-ownership="1">
@@ -159,20 +154,20 @@
       </return-value>
       <parameters>
         <parameter name="object">
-          <type name="AnnotationObject" c:type="AnnotationObject*"/>
+          <type name="Object" c:type="AnnotationObject*"/>
         </parameter>
       </parameters>
     </function>
-    <function name="annotation_object_get_objects"
+    <function name="object_get_objects"
               c:identifier="annotation_object_get_objects">
       <return-value>
         <type name="GLib.SList" transfer-ownership="1">
-          <type name="AnnotationObject" relation="element"/>
+          <type name="Object" relation="element"/>
         </type>
       </return-value>
       <parameters>
         <parameter name="object">
-          <type name="AnnotationObject" c:type="AnnotationObject*"/>
+          <type name="Object" c:type="AnnotationObject*"/>
         </parameter>
       </parameters>
     </function>

Modified: trunk/tests/scanner/drawable-expected.gir
==============================================================================
--- trunk/tests/scanner/drawable-expected.gir	(original)
+++ trunk/tests/scanner/drawable-expected.gir	Sat Aug 23 12:59:04 2008
@@ -3,8 +3,8 @@
             xmlns="http://www.gtk.org/introspection/core/1.0";
             xmlns:c="http://www.gtk.org/introspection/c/1.0";
             xmlns:glib="http://www.gtk.org/introspection/glib/1.0";>
-  <namespace name="test" shared-library="libdrawable.la">
-    <class name="Drawable"
+  <namespace name="drawable" shared-library="libdrawable.la">
+    <class name="TestDrawable"
            c:type="TestDrawable"
            parent="GObject.Object"
            glib:type-name="TestDrawable"
@@ -15,7 +15,7 @@
         </return-value>
         <parameters>
           <parameter name="drawable">
-            <type name="Drawable" c:type="TestDrawable*"/>
+            <type name="TestDrawable" c:type="TestDrawable*"/>
           </parameter>
           <parameter name="x">
             <type name="int" c:type="int"/>
@@ -23,14 +23,14 @@
         </parameters>
       </method>
     </class>
-    <record name="DrawableClass" c:type="TestDrawableClass">
+    <record name="TestDrawableClass" c:type="TestDrawableClass">
       <field name="parent_class">
         <type name="GObject.Class" c:type="GObjectClass"/>
       </field>
     </record>
-    <record name="PixmapObjectClass" c:type="_TestPixmapObjectClass">
+    <record name="TestPixmapObjectClass" c:type="_TestPixmapObjectClass">
       <field name="parent_class">
-        <type name="DrawableClass" c:type="TestDrawableClass"/>
+        <type name="TestDrawableClass" c:type="TestDrawableClass"/>
       </field>
     </record>
   </namespace>

Modified: trunk/tests/scanner/drawable.h
==============================================================================
--- trunk/tests/scanner/drawable.h	(original)
+++ trunk/tests/scanner/drawable.h	Sat Aug 23 12:59:04 2008
@@ -10,8 +10,8 @@
 {
   GObject parent_instance;
 };
- 
-struct _TestDrawableClass 
+
+struct _TestDrawableClass
 {
   GObjectClass parent_class;
 };



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