Re: Creating GObject/GTK bindings for language
I apologize for being so terse. I was grasping at straws, trying to think of a specific question regarding GTK binding to get me started. There have been plenty of bindings to scripting languages in the past, so I thought asking about them in general would be the quickest way to get information about making binding. I would like bindings for GTK from Objective C. I originally started to bind classes manually, starting with GList in GLib. While I know that this will take time, if I use that method, I'll die before I finish. I've looked at the obgtk and GTKKit bindings for GTK1, and some of it does look helpful (like how to associate ObjC methods with signals), but GTK has grown so much since then. I'm not sure if it's reasonable to build off of that. How much of this process is not automated? I would like to know how to minimize some of the work involved. Looking at the gir xml stored in the GLib.typelib reveals xml descriptions of what looks like all of the library's classes, but doing the same thing for the libxml typelib shows a gir file that doesn't look complete. How do I know I can trust the .gir file to have a complete description of the library it purports to describe. Secondly, is it header information that is usually automatically generated? Do maintainers then go and manually write the implementations themselves? Finally, do you have a suggestion as to where I can start? Am I on the right track in first trying to get automatically generated headers from the typelib information? --- On Fri, 2/26/10, John Palmieri wrote: > From: John Palmieri > Subject: Re: Creating GObject/GTK bindings for language > To: "Tristin Celestin" > Cc: gtk-devel-list@gnome.org > Date: Friday, February 26, 2010, 12:14 PM > > - "Tristin Celestin" > wrote: > > > I want to be able to use GObject and GObject based > libraries from an > > object oriented scripting language with no bindings > for GObject and > > GObject based libraries currently. > > > > > > How does one go about creating GObject bindings for > another language? > > I've read the GObject-Introspection pages at gnome.org > and looked at > > the > > PyGobject binding, but I still don't have a clear idea > of where to > > start. > > Which language? Have you ever done bindings in that > language before? Usually you would wrap a library by > making equivalent API calls in that language and marshaling > API parameters and results using the glue C/C++ libraries > that the language provides for creating modules. More > complex libraries usually have some sort of automation for > this and some languages have generic automated > binding tools like SWiG. With the advent of > GObject-Introspection you can now write a minimal interface > module that reads in the gir files and routes and marshals > method calls based on the gir data structure. > PyGObject is a poor library to look at because it does not > yet use GObject-Introspect and does the wrapping with its > own targeted tool. It is better to look at the Gjs or > Seed javascript bindings. Every language is going to > be different as they all have their own API for creating C > extension modules so again, you need to know how to wrap a > simple library in your language before tackling GTK+. > > -- > John (J5) Palmieri > Software Engineer > Red Hat, Inc. > ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list
Re: GTK+ at the UX Hackfest
From: Cosimo Cecchi > On Mon, 2010-03-01 at 16:44 +0100, Piñeiro wrote: > >> In the gtk side, I don't know much about the XSettings, but I suppose >> that you are talking more general, and XSetting will manage all the >> gtk modules to be loaded (engines, and so on). So XSettings would have >> the lists of modules instead of the envvar, and inform to the >> applications that this setting has changed. In this case is just >> load/unload the a11y modules as any other gtk modules. > > AFAIK GTK+ already reads the XSettings variable and loads modules > accordingly in gtk_init(). The filling of that property is currently > done by gnome-settings-daemon. Yes, you are right, I have just made a quick search, thanks. Probably people like Mathias Clasen, Li Yuan and Willie Walker knows more about xsettings and a11y relation. After another quick search on the bugzilla, I found some interesting (and resolved) bugs about this issue: https://bugzilla.gnome.org/show_bug.cgi?id=535827 https://bugzilla.gnome.org/show_bug.cgi?id=565110 https://bugzilla.gnome.org/show_bug.cgi?id=563943 === API (apinhe...@igalia.com) ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list
Re: GTK+ at the UX Hackfest
On Mon, 2010-03-01 at 16:44 +0100, Piñeiro wrote: > In the gtk side, I don't know much about the XSettings, but I suppose > that you are talking more general, and XSetting will manage all the > gtk modules to be loaded (engines, and so on). So XSettings would have > the lists of modules instead of the envvar, and inform to the > applications that this setting has changed. In this case is just > load/unload the a11y modules as any other gtk modules. AFAIK GTK+ already reads the XSettings variable and loads modules accordingly in gtk_init(). The filling of that property is currently done by gnome-settings-daemon. Cheers, Cosimo ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list
Re: GTK+ at the UX Hackfest
From: Bastien Nocera CCing gnome-accessibility list, as probably I will forgot several things. > - a11y instant-on (if not instant-off) > a11y is enabled in applications when the XSettings mention that the GTK+ > modules should be loaded. We could make GTK+ programs instant-apply the > XSettings (what applications would be breaking? Could we whitelist a11y > to be the only one auto-loaded? Can we make the change for GTK+ 3.0?) > > The other problem is that application need to initialise themselves, and > register with the at-spi bus to appear in things like screen readers. > > Could somebody with more knowledge on the subject tell me what changes > would be necessary for a11y to become instant-apply? The initalization can be done at any moment (and as you said, made by the application themselves). Right now gtk apps require to load gail and atk-bridge modules, so they just need to load this modules using gmodule, and then call the method gtk_module_init (although the method gnome_accessibility_module_init is also provided). At this moment, to made that more easy, this is done during the gtk_init, as it load the gtk modules reading the envar GTK_MODULES (as far as I undertand, the idea now is avoid that and start to use XSettings). About the unload, there are also a method gnome_accessibility_module_shutdown (but not gtk_module_shutdown one), so it would be just call this method and unload the modules. So in theory, no changes should be required from the a11y modules, except, perhaps, add a gtk_module_shutdown method, in order to be more general. In the gtk side, I don't know much about the XSettings, but I suppose that you are talking more general, and XSetting will manage all the gtk modules to be loaded (engines, and so on). So XSettings would have the lists of modules instead of the envvar, and inform to the applications that this setting has changed. In this case is just load/unload the a11y modules as any other gtk modules. Anyway, there are some applications that made that in a custom way. The main example is firefox. As they have some custom a11y thingies, they override this procedure (ie loading by hand the atk bridge). So if firefox wants to use the XSettings solution he would require to rewrite that part, and from the gtk side, it should allow a process to be overriden. Firefox created a log of headaches in this aspect. More information and several cross-bugs here [1] Other issue is that the at-spi daemon (corba or dbus) must be running before the application load the modules (one part of this a11y initialization from the application side is register on at-spi). This can be tricky on the first application that want to instant-on the a11y, and it would require to check if the daemon is running, and if not, execute that. The other module part are general (just load gtk modules when required) but this step requires specific code. BR [1] http://mail.gnome.org/archives/gnome-accessibility-list/2009-January/msg00030.html === API (apinhe...@igalia.com) ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list
GTK+ at the UX Hackfest
Heya, We had a GNOME Usability hackfest last week in London, and a couple of TODO items, and questions cropped up which I thought I would share. For all those tasks, if resources are scarce to get the work done, I think adding those as ideas for the upcoming GSoC 2010 would be good, once technical requirements have been discussed. Cheers Widgets --- Having often used widgets in GTK+ means that we reduce differences in appearance and behaviour between applications and make applications easier to maintain. If the APIs are carefully thought of, usability and design changes can be made without touching the applications. A couple of widgets were mentioned: - a sidebar widget (which I never followed-up on): https://bugzilla.gnome.org/show_bug.cgi?id=307044 - a breadcrumb navigation widget (which could be used in nautilus, the file chooser and yelp, for example) No bugs filed, Cody will be working on filing a bug, and start discussions about the API soon - Segmented bar? It's used in Rhythmbox, Banshee, the Ubuntu installer and could probably be used in others There's a C version in Rhythmbox now: https://bugzilla.gnome.org/show_bug.cgi?id=558576 - Others? Theming --- Just a couple of opened questions: - GTK+ 3.0 theme. How final are the widget set used in the various mockups that were posted during the UX hackfest? Cody mentioned that this is something he might be able to allocate some time for. Thomas Wood might be able to help (though he was non-committal when we mentioned it during the hackfest) A couple of examples: http://jimmac.musichall.cz/log/?p=946 (lower down the post) http://www.hadess.net/2010/02/were-removing-settings-again.html - OSD icons/symbolic icons For a variety of reasons (which are best explained by people that aren't me) we'd like to switch to using symbolic icons instead of colourful ones in the notification areas, and OSD popups. The notification area icons might also end up being used as the "Label" for menus. In such cases, it would be nice if the OSD icons could use the same properties as text itself (change from black to white when hightlighted, in the default theme), and symbolic colours in GTK+ themes could be used (so that red means warning in both icons and in other places in the UI) Jakub dropped a mail to Bedhad about making those SVG icons as first-class "fonts" in pango/fontconfig, though I don't know whether this would be the best technical way of achieving those goals. The problems are Colours, and Sizing. Some examples: http://jimmac.musichall.cz/log/?p=946 - a11y instant-on (if not instant-off) a11y is enabled in applications when the XSettings mention that the GTK+ modules should be loaded. We could make GTK+ programs instant-apply the XSettings (what applications would be breaking? Could we whitelist a11y to be the only one auto-loaded? Can we make the change for GTK+ 3.0?) The other problem is that application need to initialise themselves, and register with the at-spi bus to appear in things like screen readers. Could somebody with more knowledge on the subject tell me what changes would be necessary for a11y to become instant-apply? Instant-load/unload of the GTK+ modules in the XSettings sounds like something we could be doing for GTK+ 3.0. Cheers ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list