Re: [java-gnome-hackers] GtkApplication to replace LibUnique
Brought to you by:
afcowie
|
From: Andrew C. <an...@op...> - 2012-08-14 05:35:40
|
On Mon, 2012-07-23 at 13:29 +0200, Guillaume Mazoyer wrote:
> deprecating libunique and replace it with the new (well, not so new)
> GtkApplication class. It is actually a thing that we *have to* do [1].
> I have started a branch about it and you can find it at
> `hackers/guillaume/gtk-application' [2].
Ok, we have a working test suite again, so at last I've been able to
start reviewing your branch. Fantastic of you to have undertaken getting
this code going.
Namespaces
----------
This is a bit unfortunate:
a.connect(new Application.Activate() {
public void onActivate(org.gnome.glib.Application source) {
System.out.println("Activated");
}
});
Can we make another one that shadows the one in [org.gnome.glib]
Application?
My inclination is actually to go a bit further, and make the methods in
[org.gnome.glib] Application protected, and publicly exposed on
[org.gnome.gtk] Application. Sure you can use GApplication by itself,
but would you ever really? Maybe someone can say, but my sense of it is
that you're only supposed to use GtkApplication in practice. The
documentation for GApplication says "In general, you should not use this
class outside of a higher level framework." so I think I'm on the right
track.
Initialization
--------------
So this is an interesting question. The documentation for
gtk_application_new() says it calls gtk_init() for you. Hm. Translated,
that implies that {java-gnome-}developers should not be calling
Gtk.init() anymore, which of course is **absolutely obligatory** at the
moment because it causes all the C side JNI setup to be done.
I imagine we'll need to adjust that somewhat, but to what?
Maybe we change the manual call to "gtk_init()" [which has all kinds of
gumpf in it] to (effectively) bindings_java_init().
Then we can even have that called by a static block somewhere.
Presumably Gtk.init() still has to work for people not using
GtkApplication.
Branch
------
I've done some minor documentation changes and cleanup; if you could
merge from 'hackers/andrew/application' that would be good.
AfC
Sydney
|