java-gobject-introspection r85 - in trunk: . src src/org/gnome/gir/compiler src/org/gnome/gir/gobject src/org/gnome/gir/repository



Author: walters
Date: Sat Oct 18 21:45:55 2008
New Revision: 85
URL: http://svn.gnome.org/viewvc/java-gobject-introspection?rev=85&view=rev

Log:
Add jgir-compile, map GObject.Parameter


Added:
   trunk/src/jgir-compile.in
Modified:
   trunk/src/org/gnome/gir/compiler/CodeFactory.java
   trunk/src/org/gnome/gir/gobject/GObjectAPI.java
   trunk/src/org/gnome/gir/gobject/GType.java
   trunk/src/org/gnome/gir/repository/GIntrospectionAPI.java
   trunk/src/org/gnome/gir/repository/Repository.java
   trunk/wscript

Added: trunk/src/jgir-compile.in
==============================================================================
--- (empty file)
+++ trunk/src/jgir-compile.in	Sat Oct 18 21:45:55 2008
@@ -0,0 +1,10 @@
+#!/usr/bin/python
+import os,sys,subprocess
+
+classpath="@CLASSPATH@"
+args = ['java', '-cp', classpath, 'org.gnome.gir.compiler.CodeFactory']
+args.extend(sys.argv[1:])
+subprocess.check_call(args,
+                      stdout=sys.stdout,
+                      stderr=sys.stderr,
+                      close_fds=True)

Modified: trunk/src/org/gnome/gir/compiler/CodeFactory.java
==============================================================================
--- trunk/src/org/gnome/gir/compiler/CodeFactory.java	(original)
+++ trunk/src/org/gnome/gir/compiler/CodeFactory.java	Sat Oct 18 21:45:55 2008
@@ -2341,7 +2341,18 @@
 		GObjectAPI.gobj.g_type_init();
 		if (args[0].equals("--verify"))
 			verifyAll(args[1].split(","));
-		else {
+		else if (args[0].endsWith(".typelib")) {
+			File typelib = new File(args[0]);
+			String base = typelib.getName();
+			int dash = base.indexOf('-');
+			String namespace = base.substring(0, dash);
+			String version = base.substring(dash+1, base.lastIndexOf('.'));
+			String parent = typelib.getParent();
+			if (parent == null)
+				parent = System.getProperty("user.dir");
+			Repository.getDefault().prependSearchPath(parent);
+			compile(namespace, version);
+		} else {
 			String namespace = args[0];
 			String version = args[1];
 			if (!namespaceIsExcluded(namespace))

Modified: trunk/src/org/gnome/gir/gobject/GObjectAPI.java
==============================================================================
--- trunk/src/org/gnome/gir/gobject/GObjectAPI.java	(original)
+++ trunk/src/org/gnome/gir/gobject/GObjectAPI.java	Sat Oct 18 21:45:55 2008
@@ -272,7 +272,7 @@
     };
     
     
-    static class GParamSpec extends com.sun.jna.Structure {
+    public static class GParamSpec extends com.sun.jna.Structure {
         public volatile GTypeInstance g_type_instance;
         public volatile String g_name;
         public volatile /* GParamFlags */ int g_flags;
@@ -288,6 +288,12 @@
         public GParamSpec() {}
     }
     
+    public static class GParameter /* auxillary structure for _setv() variants */
+    {
+      String name;
+      GValue value;
+    };
+    
     public interface GTypeDebugFlags {
     	public static final int NONE = 0;
     	public static final int OBJECTS = 1 << 0;

Modified: trunk/src/org/gnome/gir/gobject/GType.java
==============================================================================
--- trunk/src/org/gnome/gir/gobject/GType.java	(original)
+++ trunk/src/org/gnome/gir/gobject/GType.java	Sat Oct 18 21:45:55 2008
@@ -96,7 +96,8 @@
 			for (String unmapped : glibIntegerUnmapped)
 				put("GLib." + unmapped, "java/lang/Integer");			
 			
-			put("GObject.ParamSpec", "org/gnome/gir/gobject/GObjectAPI$GParamSpec");			
+			put("GObject.ParamSpec", "org/gnome/gir/gobject/GObjectAPI$GParamSpec");
+			put("GObject.Parameter", "org/gnome/gir/gobject/GObjectAPI$GParameter");				
 			put("GObject.Object", "org/gnome/gir/gobject/GObject");
 			put("GObject.InitiallyUnowned", "org/gnome/gir/gobject/GInitiallyUnowned");					
 			put("GObject.Type", "org/gnome/gir/gobject/GType");

Modified: trunk/src/org/gnome/gir/repository/GIntrospectionAPI.java
==============================================================================
--- trunk/src/org/gnome/gir/repository/GIntrospectionAPI.java	(original)
+++ trunk/src/org/gnome/gir/repository/GIntrospectionAPI.java	Sat Oct 18 21:45:55 2008
@@ -45,6 +45,7 @@
 	});	
 	
 	Repository g_irepository_get_default();
+	void g_irepository_prepend_search_path(String path);
 	int g_irepository_get_n_infos(Repository repo, String namespace);
 	boolean g_irepository_is_registered (Repository repository, String namespace);
 	boolean g_irepository_require(Repository repo, String namespace, String version, int flags, PointerByReference error);
@@ -55,7 +56,7 @@
 	String g_irepository_get_version(Repository repo, String namespace);
 	BaseInfo g_irepository_get_info(Repository repo, String namespace, int idx);
 	String g_irepository_get_shared_library(Repository repository, String namespace);
-	String g_irepository_get_typelib_path(Repository repository, String namespace);		
+	String g_irepository_get_typelib_path(Repository repository, String namespace);
 	
 	void g_base_info_ref(BaseInfo info);
 	void g_base_info_unref(BaseInfo info);		

Modified: trunk/src/org/gnome/gir/repository/Repository.java
==============================================================================
--- trunk/src/org/gnome/gir/repository/Repository.java	(original)
+++ trunk/src/org/gnome/gir/repository/Repository.java	Sat Oct 18 21:45:55 2008
@@ -10,6 +10,10 @@
 
 public class Repository extends PointerType {
 
+	public void prependSearchPath(String path) {
+		GIntrospectionAPI.gi.g_irepository_prepend_search_path(path);
+	}
+	
 	public BaseInfo findByName(String namespace, String name) {
 		return GIntrospectionAPI.gi.g_irepository_find_by_name(this, namespace, name);
 	}

Modified: trunk/wscript
==============================================================================
--- trunk/wscript	(original)
+++ trunk/wscript	Sat Oct 18 21:45:55 2008
@@ -63,12 +63,20 @@
   jsrc.jarname = 'jgir.jar'
   jsrc.source_root = 'src'
 
+  full_cp = bld.env['CLASSPATH'] + ':' + bld.env['PREFIX'] + '/share/java/jgir.jar'
   compscript = bld.new_task_gen('subst')
   compscript.install_path = "${PREFIX}/bin"
   compscript.chmod = 0755
   compscript.source = 'src/jgir-compile-all.in'
   compscript.target = 'jgir-compile-all'
-  compscript.dict = {'CLASSPATH': bld.env['CLASSPATH'] + ':' + bld.env['PREFIX'] + '/share/java/jgir.jar'}
+  compscript.dict = {'CLASSPATH': full_cp}
+
+  compscript = bld.new_task_gen('subst')
+  compscript.install_path = "${PREFIX}/bin"
+  compscript.chmod = 0755
+  compscript.source = 'src/jgir-compile.in'
+  compscript.target = 'jgir-compile'
+  compscript.dict = {'CLASSPATH': full_cp}
 
   #libinvoke = bld.new_task_gen('cc', 'shlib')
   #libinvoke.packages = ['gobject-introspection-1.0']



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