java-gobject-introspection r170 - trunk/src/org/gnome/gir/compiler



Author: walters
Date: Sat Feb  7 02:05:42 2009
New Revision: 170
URL: http://svn.gnome.org/viewvc/java-gobject-introspection?rev=170&view=rev

Log:
Don't skip no-shlib typelibs.  Do skip class structs in functions.

There was a change to introspection to remove the shared-library
entry for a number of .gir files and .typelibs.  In that case we just open
the current process.

We need to skip class structs in functions since we don't expose
class structs right now.  Could possibly fix by mapping to Class<?>.

Modified:
   trunk/src/org/gnome/gir/compiler/CodeFactory.java

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 Feb  7 02:05:42 2009
@@ -1293,6 +1293,19 @@
 					ctx.lengthOfArrayIndices.put(lenIdx, argOffset);
 					ctx.arrayToLengthIndices.put(argOffset, lenIdx);
 				}
+			} else if (tag.equals(TypeTag.INTERFACE)) {
+				BaseInfo iface = info.getInterface();
+				/* gst_class_signal_connect trips us up here; we're not normally exposing class structs
+				 * in public API.  Possibly what we should do is special-case the class struct to be exposed
+				 * (but then the question is open for how you get a reference to it nicely).  Should we
+				 * have a mapping for Class<? extends GObject> to/from class struct?
+				 */
+				if (iface instanceof StructInfo) {
+					if (((StructInfo) iface).isClassStruct()) {
+						logger.warning(String.format("Skipping callable with class structure argument: %s", si.getIdentifier()));
+						return null;
+					}
+				}
 			}
 			t = TypeMap.toJava(arg);
 			if (t == null) {
@@ -1813,6 +1826,10 @@
 	}
 
 	private void compile(StructInfo info) {
+		/* Skip these, we don't want in the public API */
+		if (info.isClassStruct())
+			return;
+		
 		StubClassCompilation compilation = getCompilation(info);
 
 		writeStructUnion(info, compilation, "Structure", info.getMethods(), info.getFields());
@@ -2111,8 +2128,13 @@
 			throw new RuntimeException(e);
 		}
 
+		/* We used to throw this, but really we should encourage people not
+		 * to put their private typelibs in the public dir.
+		 */
+		/*
 		if (repo.getSharedLibrary(namespace) == null)
 			throw new PrivateNamespaceException();
+		*/
 
 		String globalName = namespace + "Globals";
 		String peerInternalName = GType.getInternalName(namespace, globalName);



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