Re: [java-gnome-hackers] Arrays in signal handlers
Brought to you by:
afcowie
From: Guillaume M. <res...@gm...> - 2012-02-03 00:22:02
|
2012/2/2 Andrew Cowie <an...@op...>: > Guillaume has hit an interesting engineering problem. I did :) > There is a signal which returns an array of GFile. That doesn't seem > like a problem, except that on the C side of the signal marshaling code > we don't have anything to handle arrays. To get the JNI signature, to call the right method, a C function is called for each argument of the method returning the correct string. We currently handle a various number of cases (integer, strings, objects etc...) but we do not handle array. The called C function is "bindings_java_typeToSignature". So the problem is to know if a gpointer is actually an array. We can't do that with our current "switch...case" (I don't think so). So we should probably do something else. > My best guess is to write a custom handler C side that takes the > gpointer and turns it into a GList* of GFile. But we would still need > code to handle that in the signal marshaller. A custom handler could be the beginning of a fix but we will still need to handle arrays or lists. We could use a G_TYPE_STRV which is an array of strings but in the marshaller this type would be G_TYPE_BOXED so we will be hiting another problem. How can we know that a G_TYPE_BOXED is actually a G_TYPE_STRV? GList* would be tricky, I never saw any signal using a GList* as parameter. > Guillaume could give more detail, I'm sure. I hope I was understandable enough ;) -- Guillaume Mazoyer - http://respawner.fr/ |