Thread: [java-gnome-hackers] libappindicator and libindicate support
Brought to you by:
afcowie
From: Francisco O. <fr...@pu...> - 2010-05-28 02:00:54
|
Hi everybody, First of all I want to thank for the huge effort you are doing delivering java bindings for gnome. I am developing a little java app just for fun and I am using the binding for libnotify provided for java-gnome project. As an Ubuntu user I want my app to support the new indicators (complementing the lack of 'actions' support for ubuntu notification system) based on the Ayatana umbrella project , so I read the docs get a copy of java-gnome src from the ubuntu repository (didn't use bzr way, but is the next step) and started hacking the bindings. After 3 days of work I have working bindings for libindicate <https://wiki.ubuntu.com/MessagingMenu/> and libappindicator <https://wiki.ubuntu.com/DesktopExperienceTeam/ApplicationIndicators>. I want to share with you what i did (i read the style, hacking, and docs and i am in process to document all the API) and i have a couple of questions: In configure (and in build/faster) I added the package dependencies under debian OS (shared with Ubuntu) but i think is not the best solution. The previous dependencies are Ubuntu specific, but I dont want to break the code of the project if you are not using Ubuntu. Even in Ubuntu I don't know if the libs are required. - How should I handle optional libraries for optional bindings? Or maybe I need to implement some kind of fallback implementation? - By default the generated code is under org.gnome.<libname> package but i dont know if its a valid package. I dont know the state I was inspecting the DBus messages and they are using org.ayatana or org.freedesktop namespaces, there is a ticket in the launchpad https://bugs.launchpad.net/libindicate/+bug/452165 regarding this. Suggestions? Thanks in advance for the answers, Regards Fran |
From: Serkan K. <se...@ge...> - 2010-05-28 02:54:27
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 28-05-2010 05:00, Francisco Ortiz wrote: > As an Ubuntu user I want my app to support the new indicators > (complementing the lack of 'actions' support for ubuntu notification > system) based on the Ayatana umbrella project , so I read the docs get a > copy of java-gnome src from the ubuntu repository (didn't use bzr way, > but is the next step) and started hacking the bindings. After 3 days of > work I have working bindings for libindicate > <https://wiki.ubuntu.com/MessagingMenu/> and libappindicator > <https://wiki.ubuntu.com/DesktopExperienceTeam/ApplicationIndicators>. > > I want to share with you what i did (i read the style, hacking, and docs > and i am in process to document all the API) and i have a couple of > questions: Great, well done. Feel free to send a bundle against mainline. > > In configure (and in build/faster) I added the package dependencies > under debian OS (shared with Ubuntu) but i think is not the best > solution. The previous dependencies are Ubuntu specific, but I dont want > to break the code of the project if you are not using Ubuntu. Even in > Ubuntu I don't know if the libs are required. > > - How should I handle optional libraries for optional bindings? Or maybe > I need to implement some kind of fallback implementation? In any case, even if the dependencies are not checked for other distros it would be a problem in build stage because java-gnome currently doesn't support optional dependencies. By the way is this library going to stay being Ubuntu specific. > > - By default the generated code is under org.gnome.<libname> package but > i dont know if its a valid package. I dont know the state I was > inspecting the DBus messages and they are using org.ayatana or > org.freedesktop namespaces, there is a ticket in the launchpad > https://bugs.launchpad.net/libindicate/+bug/452165 regarding this. > Suggestions? This package name generation is java-gnome specific, you can leave it to default. That bug is probably about exported dbus objects which we don't care at bindings level. - -- Sincerely, Serkan KABA -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkv/MFUACgkQRh6X64ivZaKG0gCffL4cXz/I2f6oHy5rQFgi9UUm zC4AmwTvypeCex8hCnBJPmFPnn2ILMrL =zAg8 -----END PGP SIGNATURE----- |
From: Guillaume M. <res...@gm...> - 2010-05-28 13:03:59
|
Hello, > In any case, even if the dependencies are not checked for other distros > it would be a problem in build stage because java-gnome currently > doesn't support optional dependencies. By the way is this library going > to stay being Ubuntu specific. No these libraries are not Ubuntu specific but they depend on the distros packagers of course. But they should absolutly not be required to build java-gnome or any kinds of programs (in C people use #ifdef things to know if the code should compile with appindicator/libindicate support). I thought about adding support for those libraries (well Francisco was faster than me :D) but I was stucking on "they should be optional not required". -- Guillaume Mazoyer - http://www.respawner.fr/ |
From: Andrew C. <an...@op...> - 2010-05-29 01:46:38
|
On Fri, 2010-05-28 at 15:03 +0200, Guillaume Mazoyer wrote: > But they should absolutely not be required to build java-gnome or any > kinds of programs (in C people use #ifdef things to know if the code > should compile with appindicator/libindicate support). Yeah. java-gnome isn't really very good at that right now, partly because a) Java the language isn't very good at that [and that's ok; no #ifdef is a feature, not a bug :). Actually, Java is very good at it - if you don't depend on it, you don't import it. But the code in scope needs to compile] b) philosophically, I didn't want to maintain a project where people wouldn't know whether what they needed would be there or not. [There's nothing worse than you installing something only to discover (eg) your Cairo doesn't have PDF support. "Like, what the fuck, man?" with my best 70s California surfer dude accent :). We just depend on Cairo, and expect it to work. People should be able to depend on java-gnome, and know what they're getting] c) java-gnome depends on GNOME; so, if you've got a Desktop installed you by definition have all the prerequisites. [Done. No fuss, no muss, and makes sense given the limited time we all have to spend on things like this. It's also why I've kept it 1 package and not 9] > I was stuck on "they should be optional not > required". d) we haven't implemented out the infrastructure and mechanisms for optionally depending on individual libraries. This is where it gets interesting. This *IS* something we have been thinking about for a long time and have a fairly good idea of what we need to do to support it. For example, I'd rather like to see us have a webkit-gtk binding, and James even worked on one a bit, but (especially a few years ago) it was completely unreasonable to expect a normal user of release or 'mainline' would have it available. But it's really hard. The build system assumes all the sources will compile. [What an amazing thought!] So if we put in code that depends on things $you don't have on your system, then boom java-gnome won't build. So we'd need to change that. Fair bit of work. Also, top level configure would also have to be taught what to do when it looks for something and doesn't find it. Another big piece of work, though that's more doable. Then we need to build the library such that it only links against the things you actually have (so it completes the build, hey). That's a bit more engineering. Getting trickier. The usual approach to these problems is to make many libraries instead of one. In java-gnome it wouldn't be *too* hard to load a bunch of lib{glib,gtk,webkitgtk,...}jni-4.0.so; presumably we'd just do it one loadLibrary() per module in the Plumbing class. So we'd need to arrange that, then arrange to link the individual .so files instead of one big one. That is all doable, but it's a LOT of work. ++ My take on it as maintainer is that we're still better off having just one top level .jar file (which for historical reasons is called gtk.jar) because Java only loads what you import and it doesn't matter a whit if *EVERYTHING* is in that .jar, and it's a pain in the ass having to add > 1 to your IDE, run scripts, etc. If the library itself then quietly internally then loads 10 - 15 .so files rather than the 1 .so file it's loading now, then I guess that'd be ok. [purists would complain about the cost of all the extra dynamic libraries, but I'm not so sure that in a land of Java on top of GTK that # of .so files is our biggest worry. Still, right now we have 1 and that's acceptable in anyone's books] Since supporting experimental or obscure (indicator is "obscure in the sense that no one but Ubuntu users will ever have it) would be really excellent, it'd be worth doing the work to implement it. It'll take hacking on configure, the build system, the Plumbing classes, and knowing a lot about how linking works ... essentially, everything there is to know about java-gnome :) Big piece of work, but if we want to go there, I'm happy to help. AfC Sydney |
From: Francisco O. <fr...@pu...> - 2010-05-30 16:40:00
Attachments:
ubuntu-indicate-support.patch
|
Hi again. Putting some code where my mouth is I am sending patch against mainline. I modified configure and faster to support the libs, tested with Ubuntu 10.04. I added the defs and bindings for libappindicator and libindicate and an example for libindicate. Comments, suggestions and patches are very welcome. Regards, Francisco > Hello, > > >> In any case, even if the dependencies are not checked for other distros >> it would be a problem in build stage because java-gnome currently >> doesn't support optional dependencies. By the way is this library going >> to stay being Ubuntu specific. >> > No these libraries are not Ubuntu specific but they depend on the > distros packagers of course. > > But they should absolutly not be required to build java-gnome or any > kinds of programs (in C people use #ifdef things to know if the code > should compile with appindicator/libindicate support). > > I thought about adding support for those libraries (well Francisco was > faster than me :D) but I was stucking on "they should be optional not > required". > > > > > ------------------------------------------------------------------------------ > > > > > _______________________________________________ > java-gnome-hackers mailing list > jav...@li... > https://lists.sourceforge.net/lists/listinfo/java-gnome-hackers > |
From: Serkan K. <se...@ge...> - 2010-05-31 06:14:45
|
2010/5/28 Guillaume Mazoyer <res...@gm...>: > But they should absolutly not be required to build java-gnome or any > kinds of programs (in C people use #ifdef things to know if the code > should compile with appindicator/libindicate support). There's JEnable (http://www.sosnoski.com/opensrc/jenable/index.html) for Java and I've also seen an example of using cpp (c preprocessor) on Java files but is either of them an option? Regards, Serkan |
From: Guillaume M. <res...@gm...> - 2010-06-27 11:58:17
|
I was thinking about that appindicator/libindicate support again. I guess that the best way to cover these things in Java would be to create a specific binding which would depend on java-gnome. In this way, it would not add optional things to java-gnome (which is something I'd like) but it would not benefit from the awesome architecture of java-gnome. Le lundi 31 mai 2010 à 09:14 +0300, Serkan Kaba a écrit : > 2010/5/28 Guillaume Mazoyer <res...@gm...>: > > > But they should absolutly not be required to build java-gnome or any > > kinds of programs (in C people use #ifdef things to know if the code > > should compile with appindicator/libindicate support). > There's JEnable (http://www.sosnoski.com/opensrc/jenable/index.html) > for Java and I've also seen an example of using cpp (c preprocessor) > on Java files but is either of them an option? > > Regards, > Serkan > > ------------------------------------------------------------------------------ > > _______________________________________________ > java-gnome-hackers mailing list > jav...@li... > https://lists.sourceforge.net/lists/listinfo/java-gnome-hackers -- Guillaume Mazoyer - http://www.respawner.fr/ |