Tag Archives: Openismus

Openismus at FOSTEL

The FOSTEL Telephony summit looks to be shaping up well, for Wednesday 4th and Thursday 5th April 2007 in Paris. I am consistently impressed with Dave Neary’s ability to get stuff done. Thanks, Dave.

Unfortunately I don’t have time to attend myself, but Openismus is sending Armin Burgmeier, mostly so he can represent his Gobby collaborative editing project. I know he has plans for a more generic next-generation version, even using plain C this time, so make sure you make a full-duplex connection with him.

Openismus is growing gradually, but I’m being very careful about the money stuff so that we don’t stumble. Therefore our expenses budget is not overflowing at the moment, and this is the first time time we’ve sent someone other than me to a conference. To justify it, Armin is under strict instructions to repeatedly say “By the way, Openismus does paid software development” and variations on that theme. It’s not his fault.

Scratchbox on Ubuntu Feisty

I’m using a dodgy fork of Scratchbox 0.9.8 so I can use apt-get through https instead of http, but the following tips should be relevant for the regular Scratchbox 1.0.x that I’d rather be using.

  • Make sh point to bash instead of dash (probably not necessary for Scratchbox 1.0.newenough):
    sudo rm /bin/sh
    sudo ln -s bash /bin/sh
  • Install linux-image-2.6.20-6-generic and boot from it. You’ll probably need to press Esc when booting to see the boot menu. This vdso bug might be fixed in Ubuntu’s linux-image-2-6.20-10 soon.
    If you don’t do this then you’ll see this error after logging in:
    Inconsistency detected by ld.so: rtld.c: 1192: dl_main: Assertion `(void *) ph->p_vaddr == _rtld_local._dl_sysinfo_dso’ failed!
  • If you see this error while installing some packages, such as docbook-utils,
    ERROR: ld.so: object ‘/usr/lib/libfakeroot/libfakeroot-tcp.so.0’ from LD_PRELOAD cannot be preloaded: ignored.
    then fix your fakeroot like so, while logged in:
    sbox-config –copy-libfakeroot
  • Update: You’ll need to correct the hosts line in your /scratchbox/etc/nsswitch.conf file, so that apt-get can resolve domain names (wget will work without this, which is confusing).
  • Update2: That nsswitch.conf corrections seems to still be necessary with Ubuntu Gutsy and the latest Scratchbox version (as of July 29th 2007).

Ross Burton helped me with most of this. Thanks, Ross

libgda and libgnomedb and C++

libgda and libgnomedb provide a generic database API and UI for a variety of database systems, built on glib and GTK+.

The version 3.0 C++ bindings (libgdamm and libgnomedbmm) are taking shape pretty well, along with a task-orientated tutorial for C++, and reference API for libgdamm and libgnomedbmm. The libgda and libgnomedb C documentation is also online at openismus.com while we wait for some way to get it on to the GNOME servers.

Johannes and Armin and I are still working hard on finishing it. As part of this, we’ve had to do far more work than I’d prefer on the underlying libgda and libgnomedb, but I feel much more confident about them now that it’s done. I’ve also given lots of attention to the many open libgda and libgnomedb bugs and patches in bugzilla, so you’ll see lots of new names in the ChangeLog files. Some of these bugs have been ignored for four years, which I think is a real waste.

libgda 3.0 and libgnomedb 3.0 have a much bigger API than their 1.2 versions, due to the addition of new concepts, abstractions, and features. I’d be surprised if these really meet all the expected needs, so I personally guess that another parallel-installable libgda 4.0 might do some refactoring in the future. Vivien Malerba, Daniel Espinosa and Bas Driessen (blogless?) have done the heavy thinking to get us so far.

Some parts of the API have been simplified, but I still worry that other often-used parts are too complex, exposing API that should not be public, requiring repetition, and requiring data that can only be discovered at runtime. But this can be improved with API additions.

GTK+ Multipress Input Method

I’ve done some more work on the GTK+ multipress input method, adding a GKeyfile-based configuration file, and some stability bugfixing, and Daniel Elstner has renovated the build files. The source code and packages for Debian Etch are online.

As soon as I figure out a good name that doesn’t use the (not ours to use) gtk/Gtk prefix, I’ll probably move the source into GNOME’s cvs.

Now we just need to add a way for applications to turn this off and on per widget, so that numeric-only entry doesn’t need multiple key presses.

(I also tried Movial’s input method, from Markku Vire, but I can’t get it to work. I commented about it there a few days ago but the comment hasn’t shown up yet.)

Going to FOSDEM

I booked my flights and hotel, so I’m finally going to my first FOSDEM conference, in Brussels, Belgium on the weekend of the 24th and 25th February 2007.

Technically, I am incredibly unproductive at conferences. I much prefer email for that kind of thing. For instance, I hate feeling forced to have instant opinions without first doing research and weighing pros and cons. Sometimes I want to put in-person conversations on hold while I do some fact-checking. However, actually meeting people is very good for development momentum, and it’s a chance to meet new European open source people and maybe drum up some more work for Openismus.

There are some GNOME activities at FOSDEM, but I’m not really sure what to expect. Dodji wants me to do a gtkmm talk, but I don’t really see the point. If you like gtkmm and C++ then there’s a lot of information about it out there already. I think conference talks should be for new things. So Dodji should tell us about Nemiver and what it needs from gdb, and I should maybe do a Glom status talk.

Maemomm: Maemo for C++, with gtkmm

gtkmm is now available for the new Maemo 3.0 “Bora” version, as used on the Nokia N800 Internet Tablet. It’s in the extras repository.

There are also gtkmm C++ bindings for the Maemo UI (hildon-libs and hildon-fm) widgets, covered in the online maemomm documentation. Nokia tasked Openismus with updating these bindings for the N800 and writing the documentation, which was done mostly by Johannes Schmid and Daniel Elstner in the last few weeks of 2006. Of course, no applications use maemomm just yet, though gtkmm is already used enthusiastically on other embedded devices, and the demand for gtkmm on Maemo has been strong, so let’s see what happens.

It’s a slightly cut-down version of gtkmm for embedded devices, but most programmers won’t notice much difference in the API. I’d welcome patches to reduce the code size and memory requirements even more. It’s gtkmm 2.6 for now, but it looks like Maemo will update to GTK+ 2.8 or 2.10 in the near future. For the “armel” architecture that runs on the device, the (stripped) gtkmm library is 1.4M, which is a (small part of the) small price to pay if you prefer C++.

libgnomedbmm: Database UI widgets for gtkmm

Johannes Schmid and Armin Burgmeier have almost finished the C++ bindings for libgnomedb for Openismus, and the work so far is now in GNOME’s subversion repository, in the gnomemmm/libgnomedbmm module. There are already working examples in svn. This needs the latest version of libgdamm, which we have updated for the latest libgda API.

They will soon start on the documentation, to show how to use this stuff easily.

This work is for a company (Openismus codename: “The Austrians”) making some specialized embedded Linux equipment, using gtkmm for the UI.

A screenshot of a libgnomedbmm example:
libgnomedbmm_example_form

Creating GTK+ input methods

I have just implemented a GTK+ input method to allow input via multiple key presses, with a timeout, as on mobile phones.

(Update: here is a source tarball – improvements welcome. I’m now wondering how I can specify this as the default input method.)

I didn’t find any documentation about how to do this, but there are examples:

From these examples, I figured out the following, which I might try to get into the gtk-doc documentation later:

Functions that the shared library should export

The shared library must export:

  • im_module_init()
  • im_module_exit()
  • im_module_list()
  • im_module_create()

Updating gtk.immodules

The input modules must be listed in the /etc/gtk-2.0/gtk.immodules file, which is a cache of input modules information. Your Makefile should generate a new gtk.immodules file, using gtk-query-immodules-2.0, then install it.

Implementing a GtkIMContext

You must implement a GtkIMContext, an instance of which will be returned by your im_module_create() function.

Though most GObjects would have a *_get_type() function that calls g_type_register_static(), input modules need a *_register_type() function that takes a GTypeModule, which it provides to g_type_module_register_type(). This *_register_type() function should be called from your im_module_init() function. This means:

  • You can’t use the G_DEFINE_TYPE macro.
  • You can implement a *_get_type() function that just gets the GType if it has been registered by your *_register_type() function, but which fails otherwise. This seems to make if difficult (maybe impossible) to implement a GtkIMContext which is both directly usable and which may be a base class for other GtkIMContext implementations.

For “table-based” input methods, you can just derive from GtkIMContextSimple and call gtk_im_context_simple_add_table() with your table array, which specifies which sequences of characters can be used to specify an actual output character. When entering one of these intermediate characters an underline indicates that the user is in compose mode. Pressing the right arrow, or pressing a non-relevant character, accepts the displayed character. For instance, see the Tigrigna-Eritrean input method from GTK+, or the Esperanto input method in gtk-im-extra.

GtkIMContext has several virtual functions that you may want to override. These are not documented, but you can at least see their signatures in the GtkIMContext header file. The most important ones seem to be:

  • filter_keypress: This can emit the (undocumented) “commit” signal, sending a string when composing has finished, resulting in a character, and it can emit the “preedit_changed” signal, which will cause your get_preedit_string vfunc to be called.
  • get_preedit_string: This returns a string to be shown to the user, to indicate what character would be used if it were accepted. This can use Pango to show the pre-edit UI, such as underlined text to indicate a possible character.