<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet href="/serendipity/templates/default/atom.css" type="text/css" ?>

<feed 
   xmlns="http://www.w3.org/2005/Atom"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/">
    <link href="http://arbur.net/serendipity/feeds/atom.xml" rel="self" title="Armin's personal Blog" type="application/atom+xml" />
    <link href="http://arbur.net/serendipity/"                        rel="alternate"    title="Armin's personal Blog" type="text/html" />
    <link href="http://arbur.net/serendipity/rss.php?version=2.0"     rel="alternate"    title="Armin's personal Blog" type="application/rss+xml" />
    <title type="html">Armin's personal Blog</title>
    <subtitle type="html">Open source programming</subtitle>
    <icon>http://arbur.net/serendipity/templates/default/img/s9y_banner_small.png</icon>
    <id>http://arbur.net/serendipity/</id>
    <updated>2008-06-18T12:01:59Z</updated>
    <generator uri="http://www.s9y.org/" version="1.1.3">Serendipity 1.1.3 - http://www.s9y.org/</generator>
    <dc:language>en</dc:language>

    <entry>
        <link href="http://arbur.net/serendipity/archives/38-Kobby-coming-along.html" rel="alternate" title="Kobby coming along" />
        <author>
            <name>Armin Burgmeier</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2008-06-17T20:28:00Z</published>
        <updated>2008-06-17T20:28:00Z</updated>
        <wfw:comment>http://arbur.net/serendipity/wfwcomment.php?cid=38</wfw:comment>
    
        <wfw:commentRss>http://arbur.net/serendipity/rss.php?version=atom1.0&amp;type=comments&amp;cid=38</wfw:commentRss>
    
            <category scheme="http://arbur.net/serendipity/categories/2-Gobby" label="Gobby" term="Gobby" />
    
        <id>http://arbur.net/serendipity/archives/38-guid.html</id>
        <title type="html">Kobby coming along</title>
        <content type="xhtml" xml:base="http://arbur.net/serendipity/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p><a href="http://gregarei.com/"  title="Gregory Haynes Weblog">Gregory Haynes</a> is working on Kobby featuring collaborative text editing in your favourite KDE text editor as a GSoC project. He started to <a href="http://gregarei.com/2008/06/introducing-libinfinitymm/" >wrap</a> the (still unreleased!) libinfinity (my infinote implementation) API for C++ for this task. I'm really excited to see other collaborative text editors coming up that work together with Gobby, since this is exactly one of the reasons why I took the burden to write the library in GObject-based C.</p>

<p>Speaking of which; I didn't blog on it for a long time. We have moved to <a href="http://git.0x539.de/"  title="The 0x539 git repositories">git</a> in the meantime. I'm currently working on porting <a href="git://git.0x539.de/git/gobby.git"  title="The Gobby git repository">Gobby</a> to use <a href="git://git.0x539.de/git/infinote.git"  title="The infinote git repository">libinfinity</a> instead of obby, heading towards a first usable release, so that the hard work pays off. There are still some things in libinfinity that need to be fixed (performance issues, a few known bugs and way more testing) which are probably easier to fix when a usable Gobby version using it exists. I hope to have these done in a few months, though the most difficult part is always to get the little details right, which is probably why I'm not good at meeting (self-set) deadlines.</p> 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://arbur.net/serendipity/archives/37-Glom-Windows-Installer-2.html" rel="alternate" title="Glom Windows Installer 2" />
        <author>
            <name>Armin Burgmeier</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2008-02-09T13:29:12Z</published>
        <updated>2008-02-09T13:29:12Z</updated>
        <wfw:comment>http://arbur.net/serendipity/wfwcomment.php?cid=37</wfw:comment>
    
        <wfw:commentRss>http://arbur.net/serendipity/rss.php?version=atom1.0&amp;type=comments&amp;cid=37</wfw:commentRss>
    
            <category scheme="http://arbur.net/serendipity/categories/7-Openismus" label="Openismus" term="Openismus" />
    
        <id>http://arbur.net/serendipity/archives/37-guid.html</id>
        <title type="html">Glom Windows Installer 2</title>
        <content type="xhtml" xml:base="http://arbur.net/serendipity/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>I updated the <a href="http://arbur.net/code/glom/glom-setup-1.7.1.exe"  title="Glom Windows installer">installer</a>. It now includes jpeg62.dll and python25.dll which were missing (thanks to the reporters on my <a href="http://arbur.net/serendipity/archives/36-Glom-Windows-Installer.html"  title="Initial post about Glom installer on Windows">initial post</a>). I also included the glom and gda python modules. If I do understand things right, then installing <a href="http://python.org/download/"  title="Python downloads">Python</a> and <a href="http://www.pygtk.org/downloads.html"  title="PyGTK downloads">pygtk</a> makes Python support in Glom automatically work with this. I tried this out by reinstalling Python into a different directory, which worked.</p>

<p>Again, if there are still problems with it, please tell me.</p> 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://arbur.net/serendipity/archives/36-Glom-Windows-Installer.html" rel="alternate" title="Glom Windows Installer" />
        <author>
            <name>Armin Burgmeier</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2008-02-04T20:58:00Z</published>
        <updated>2008-02-04T20:58:00Z</updated>
        <wfw:comment>http://arbur.net/serendipity/wfwcomment.php?cid=36</wfw:comment>
    
        <wfw:commentRss>http://arbur.net/serendipity/rss.php?version=atom1.0&amp;type=comments&amp;cid=36</wfw:commentRss>
    
            <category scheme="http://arbur.net/serendipity/categories/7-Openismus" label="Openismus" term="Openismus" />
    
        <id>http://arbur.net/serendipity/archives/36-guid.html</id>
        <title type="html">Glom Windows Installer</title>
        <content type="xhtml" xml:base="http://arbur.net/serendipity/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p><a href="http://arbur.net/code/glom/glom-setup-1.7.1.exe"  title="Glom Windows Installer">Here</a> it is, <a href="http://www.glom.org"  title="Easy database management">Glom</a>'s installer for Windows. Thanks to the opinions on my <a href="http://arbur.net/serendipity/archives/34-Glom-packaging-on-Windows.html"  title="Glom packaging on Windows">last blog entry</a>. I set up an all-in-one installer, so Glom should run out of the box after installing (please tell me if not). It includes GTK+ from SVN with my patch from bug <a href="http://bugzilla.gnome.org/show_bug.cgi?id=506062"  title="gtk_recent_manager_add_item does not detect mime type on Windows">#506062</a> (hint, hint) so that recent files filtering works.</p>

<p>Since most people seem to use <a href="http://nsis.sourceforge.net"  title="Nullsoft scriptable installer system">NSIS</a> for Windows installers (comment on <a href="http://arbur.net/serendipity/archives/27-Installer++.html"  title="Installer++">this blog entry</a>, <a href="http://gtk-win.sourceforge.net"  title="GTK+ installer for Windows">gtk-win.sourceforge.net</a>) I also had a look at it. However, the scripting language reminds me more of assembly than anything else, and I think these days are over. So I used <a href="http://www.innosetup.org"  title="InnoSetup Installer system">InnoSetup</a> which has Pascal scripting for the rare cases you need it.</p>

<p>The only thing that is not going to work is python scripts for buttons and calculated fields. Ideally, one would just install Python and PyGtk, and having Glom use that installation automatically when present. This shouldn't be too hard, it just needs to tell python where to find the own gda and glom python modules. I am going to tackle this after my physics exam on Thursday.</p> 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://arbur.net/serendipity/archives/35-Blackout.html" rel="alternate" title="Blackout" />
        <author>
            <name>Armin Burgmeier</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2008-01-30T18:54:33Z</published>
        <updated>2008-01-30T18:54:33Z</updated>
        <wfw:comment>http://arbur.net/serendipity/wfwcomment.php?cid=35</wfw:comment>
    
        <wfw:commentRss>http://arbur.net/serendipity/rss.php?version=atom1.0&amp;type=comments&amp;cid=35</wfw:commentRss>
    
    
        <id>http://arbur.net/serendipity/archives/35-guid.html</id>
        <title type="html">Blackout</title>
        <content type="xhtml" xml:base="http://arbur.net/serendipity/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                Having done several hours of physics homework in <a href="http://xournal.sourceforge.net"  title="Xournal - Paper replacement">xournal</a> without saving: <a href="http://www.alertnet.org/thenews/newsdesk/L30437065.htm"  title="Blackout in Karlsruhe">Bad</a>. 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://arbur.net/serendipity/archives/34-Glom-packaging-on-Windows.html" rel="alternate" title="Glom packaging on Windows" />
        <author>
            <name>Armin Burgmeier</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2008-01-27T00:41:00Z</published>
        <updated>2008-01-27T00:41:00Z</updated>
        <wfw:comment>http://arbur.net/serendipity/wfwcomment.php?cid=34</wfw:comment>
    
        <wfw:commentRss>http://arbur.net/serendipity/rss.php?version=atom1.0&amp;type=comments&amp;cid=34</wfw:commentRss>
    
            <category scheme="http://arbur.net/serendipity/categories/7-Openismus" label="Openismus" term="Openismus" />
    
        <id>http://arbur.net/serendipity/archives/34-guid.html</id>
        <title type="html">Glom packaging on Windows</title>
        <content type="xhtml" xml:base="http://arbur.net/serendipity/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>With added support for self-hosting, <a href="http://www.glom.org"  title="User friendly database environment">Glom</a> for Windows now supports all the major features that the Linux version does (apart from Service Publishing, which is probably way more effort since <a href="http://www.avahi.org"  title="Avahi service publishing and discovery">Avahi</a> is not available on Windows). It's time to think about how to package it, and what dependencies to include, especially whether to ship with <a href="http://www.gtk.org"  title="GTK+ windowing toolkit">GTK+</a> or not.</p>

<p>All the major GTK+-using projects such as <a href="http://www.inkscape.org"  title="Inkscape vector graphics editor">Inkscape</a>, <a href="http://www.pidgin.im"  title="Multi-protocol instant messanger">Pidgin</a> and <a href="http://www.wireshark.org"  title="Network protocol analyzer">Wireshark</a> include GTK+. Even the <a href="http://www.gimp.org"  title="The GNU image manipulation program">GIMP</a> does so since version 2.4. This actually generates a lot of duplication, which is why we (or, rather, I) did decide not to ship it with <a href="http://gobby.0x539.de"  title="Collaborative text editor">Gobby</a>. Of course we are getting complaints such as &quot;Hey, this doesn't work because libgtk-win32-2-0-0.dll was not found!!1&quot; from time to time, but if people are not able to read the instructions right above the download link, well, then I'm sorry. Do others think the added duplication is worth that the user needs to install GTK+ manually once? Or, maybe, is this just because there is no "official" GTK+ installer?</p>

<p>Then, there is python, and I have not so much experience here. Glom links statically against libpython, so it should even run without python being installed. However, buttons and calculated fields won't work then, unless we ship with at least pyGTK. Perhaps the best thing is to state that for button scripts and calculated fields to work, python and pyGTK have to be installed. We just have to make sure that Python finds the glom and pygda modules then, even if Python was installed after Glom (so it had no chance to install them into the standard location for such modules), but probably Python has some API for this.</p>

<p>Last but not least, we have <a href="http://www.gtkmm.org"  title="C++ bindings for GTK+">gtkmm</a> which also has an <a href="http://ftp.gnome.org/pub/gnome/binaries/win32/gtkmm/2.10/"  title="Windows installer for gtkmm 2.10">installer</a> that is hosted on <a href="http://ftp.gnome.org"  title="Gnome FTP servers">ftp.gnome.org</a> even. I think we should either ship both GTK+ and gtkmm, or none of them.</p>

<p>If you have any thoughts on this, recommendations and suggestions are welcome.</p> 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://arbur.net/serendipity/archives/33-autotools-on-Windows.html" rel="alternate" title="autotools on Windows" />
        <author>
            <name>Armin Burgmeier</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2007-12-18T23:53:00Z</published>
        <updated>2007-12-18T23:53:00Z</updated>
        <wfw:comment>http://arbur.net/serendipity/wfwcomment.php?cid=33</wfw:comment>
    
        <wfw:commentRss>http://arbur.net/serendipity/rss.php?version=atom1.0&amp;type=comments&amp;cid=33</wfw:commentRss>
    
            <category scheme="http://arbur.net/serendipity/categories/7-Openismus" label="Openismus" term="Openismus" />
    
        <id>http://arbur.net/serendipity/archives/33-guid.html</id>
        <title type="html">autotools on Windows</title>
        <content type="xhtml" xml:base="http://arbur.net/serendipity/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>There are several ways to fix the recent chooser showing no recent files in <a href="http://www.glom.org"  title="The Glom Database Designer">Glom</a> <a href="http://arbur.net/serendipity/archives/32-Glom-on-Windows.html"  title="Blog entry about Glom on Windows">on Windows</a>, but they are all sort of hacks except one, namely make the recent chooser guess the mime type of an URI on Windows as it already does on Unix. Currently, it always falls back to <em>application/octet-stream</em> and this is why the filter on <em>application/x-glom</em> that glom uses does not show up any files. I looked around a bit in the registry, and it seems that all known file extensions are in <code>HKEY_CLASSES_ROOT/.$ext</code>, and some of them have a "Content Type" key that looks like the mime type we are after. So all we need to do is to register the .glom type there (this can also be used to associate a nice icon with it) and to make the GTK+ recent chooser use that "Content Type" key for the extension of the URI it gets as default mime type.</p>

<p>To implement this, I need to be able to build GTK+ (and glib which GTK+ from SVN trunk depends on) on Windows. The easy method I already used for glom itself was to copy tarballs created by "make dist" to the windows machine so I don't have to create the configure script there, not requiring the autotools stuff. However, this gets horribly annoying when the repositories are updated frequently. It would be much nicer to have a working copy directly on Windows, and to (re)create the configure script there when necessary. In theory, this should work since mingw provides all necessary tools. In practise, I already stumbled upon several ugly problems in the past. I gave it another try, though, and I ended up with a freshly built glib from SVN at the end of the day. Below are the exact steps that got me this far.</p>

<p>I used the environment I set up as described <a href="http://www.glom.org/wiki/index.php?title=WindowsBuildInstructions"  title="Windows Build Instructions for Glom">here</a> as a starting point. It is probably equally well possible to start with a freshly set up <a href="http://mingw.org/msys.shtml"  title="A minimal unix-like shell for Windows">MSYS</a>+<a href="http://www.mingw.org"  title="GCC and other GNU tools for Windows">MingW</a>, though.</p>

<ul>
 <li>First, install termcap, libtool, automake and autoconf from <a href="http://sf.net/project/showfiles.php?group_id=2435"  title="MingW download area">mingw.org</a> into C:\msys (without the usr/ prefix that is in the tarball, such that files end up as <code>/bin/autoconf</code> etc.). Copy <code>/bin/automake</code> to <code>/bin/automake-1.10</code> and <code>/bin/aclocal</code> to <code>/bin/aclocal-1.10</code>. The -1.10 versions are just 0-byte stubs, but glib's autogen.sh calls them explicitely.</li>
 <li>Then, rename the /bin/perl wrapper script and install the mingw-provided perl package. This is still 5.6, but it is enough for what we need, and the problems with paths in arguments seem to go away with this. Perhaps it would be enough to install ActivePerl directly so that /bin/perl.exe is the ActivePerl one.</li>
 <li>Add gtk-doc stubs to your system. Most GNOME libraries (including glib and GTK) require gtk-doc, but I could not find any success story of getting it to work on Windows. I used the instructions by <a href="http://hans.breuer.org/gtk/build.html"  title="Hans Breuer's instructions on building GTK+ on Windows">Hans Breuer</a>:

<pre>cd gtk-doc
cp gtk-doc.m4 /gtk/share/aclocal
cp gtkdocize /gtk/bin
mkdir -p /gtk/share/gtk-doc/data/
cp gtk-doc.make /gtk/share/gtk-doc/data</pre>

  You need a gtk-doc tarball from ftp.gnome.org for this.
 </li>
 <li>Next, load svn-win32-1.4.5.zip (or a more recent version) from <a href="http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91"  title="Subversion Windows Binary downloads">subversion.tigris.org</a>, unpack the zip to C:\svn and add /c/svn/bin to the PATH in your <code>~/.profile</code>. After a relogin or <code>exec bash -l</code> you should be able to use the SVN client in msys. Try getting glib via <code>svn co http://svn.gnome.org/svn/glib/trunk glib</code>.</li>
 <li>The most hacky thing I had to do was changing the /bin/aclocal file. Add

<pre>$file =~ s/^C:\/msys\//\/usr\//;</pre>

around line 680, right before

<pre>
$map_traced_defs{$arg1} = $file
  if ($macro eq 'AC_DEFUN'
      || $macro eq 'AC_DEFUN_ONCE'
      || $macro eq 'AU_DEFUN');
</pre>

Note that you need to adjust <code>C:\/msys\/</code> if you installed msys elsewhere. Also remember to copy it to <code>/bin/aclocal-1.10</code> (By the way, NTFS is capable of symlinks somehow, isn't it)? This is required so that aclocal converts paths starting with <code>C:/msys/share/[...]</code> to <code>/usr/share/[...]</code>. Both refer to the same file on disk, but since aclocal does a simple string comparison, it does not recognize this and always creates an empty aclocal.m4, causing autoconf to fail due to not finding any macros. Better solutions to this are very much appreciated.</li>
 <li>Last, replace <code>AM_CONFIG_HEADER</code> by <code>AC_CONFIG_HEADER</code> in glib's configure.in. autoheader complains about the first. Quick googling seems to suggest that <code>AM_CONFIG_HEADER</code> is deprecated by <code>AC_CONFIG_HEADER</code>, but I am not sure. If that is really the case we should probably change glib.</li>
 <li>Run <code>./autogen.sh</code> and watch the magic.</li>
</ul>

<p>So far for today, I am going to try GTK+ and glom tomorrow. Perhaps I even get to what I originally wanted to do, making the GTK+ recent chooser guess mime types on Windows. If you try these steps out and run into further problems, I would be glad to hear about it. I am especially looking forward to <a href="http://www.johnstowers.co.nz/blog/index.php/2007/12/16/jhbuild-anything-on-windows-in-12-steps/"  title="John Stowers' blog entry about jhbuild on Windows">John Stowers' work</a> on jhbuild on Windows. Building GNOME libraries and applications directly from SVN via jhbuild on Windows sounds really cool.</p> 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://arbur.net/serendipity/archives/32-Glom-on-Windows.html" rel="alternate" title="Glom on Windows" />
        <author>
            <name>Armin Burgmeier</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2007-12-04T23:07:00Z</published>
        <updated>2007-12-04T23:07:00Z</updated>
        <wfw:comment>http://arbur.net/serendipity/wfwcomment.php?cid=32</wfw:comment>
    
        <wfw:commentRss>http://arbur.net/serendipity/rss.php?version=atom1.0&amp;type=comments&amp;cid=32</wfw:commentRss>
    
            <category scheme="http://arbur.net/serendipity/categories/7-Openismus" label="Openismus" term="Openismus" />
    
        <id>http://arbur.net/serendipity/archives/32-guid.html</id>
        <title type="html">Glom on Windows</title>
        <content type="xhtml" xml:base="http://arbur.net/serendipity/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>After porting <a href="http://www.glom.org"  title="Glom Database Designer">Glom</a> to <a href="http://www.maemo.org"  title="The maemo platform for Nokia's internet tablets">maemo</a>, the next target was Windows. Glom's dependencies are already ported to Windows, so getting it to work wasn't too hard, though some hacks were still necessary to get things going (see the <a href="http://www.glom.org/wiki/index.php?title=WindowsBuildInstructions"  title="Glom Windows Build Instructions">Windows build instructions</a>). Currently, only the client-only mode of Glom runs on Windows, but I hope the full version follows soon.</p>

<p>I installed Windows XP within a virtual machine on my laptop to do the port. The good thing is that this doesn't force me to leave my usual Linux environment, especially when I am not at home where I still have a desktop Linux machine. However, on the other hand compilation is slowed down pretty much, becoming really significant when compiling rather big C++ projects such as <a href="http://www.gtkmm.org"  title="The Gtkmm GUI Toolkit">gtkmm</a> and glom, probably due to memory constraints.</p>

<a class='serendipity_image_link' href='http://arbur.net/serendipity/uploads/openismus/glomwin32_list.png'><!-- s9ymdb:32 --><img width='110' height='94' style="float: left; border: 0px; padding-left: 5px; padding-right: 5px;" src="http://arbur.net/serendipity/uploads/openismus/glomwin32_list.serendipityThumb.png" alt="" /></a>
<a class='serendipity_image_link' href='http://arbur.net/serendipity/uploads/openismus/glomwin32_details.png'><!-- s9ymdb:33 --><img width='110' height='94' style="float: left; border: 0px; padding-left: 5px; padding-right: 5px;" src="http://arbur.net/serendipity/uploads/openismus/glomwin32_details.serendipityThumb.png" alt="" /></a><a class='serendipity_image_link' href='http://arbur.net/serendipity/uploads/openismus/glomwin32_brokendetails.png'><!-- s9ymdb:34 --><img width='110' height='94' style="float: left; border: 0px; padding-left: 5px; padding-right: 5px;" src="http://arbur.net/serendipity/uploads/openismus/glomwin32_brokendetails.serendipityThumb.png" alt="" /></a>

<p>As always, pictures say more than a thousand words, so enjoy. The third screenshot shows a weird problem when scrolling directly after connecting to the database. The bug disappears when minimizing and re-maximizing the window. The screenshots are truncated to the left because the Glom Window requires more space than the 800x600 assigned to the virtual machine for the Small Business Example (which the screenshots are from). I could also use 1024x768 (the laptop has 1280x800), but I like to have a terminal or other windows next to the VM, and I don't like scrollbars in it either. Other drawbacks the current version suffers from and which I am going to tackle within the next days are listed in the <a href="http://www.glom.org/wiki/index.php?title=Development/Plans/WindowsPort"  title="WindowsPort page in the Glom Wiki">Glom Wiki</a>.</p> 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://arbur.net/serendipity/archives/31-Glom-on-maemo.html" rel="alternate" title="Glom on maemo" />
        <author>
            <name>Armin Burgmeier</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2007-10-18T20:55:00Z</published>
        <updated>2007-10-18T20:55:00Z</updated>
        <wfw:comment>http://arbur.net/serendipity/wfwcomment.php?cid=31</wfw:comment>
    
        <wfw:commentRss>http://arbur.net/serendipity/rss.php?version=atom1.0&amp;type=comments&amp;cid=31</wfw:commentRss>
    
            <category scheme="http://arbur.net/serendipity/categories/7-Openismus" label="Openismus" term="Openismus" />
    
        <id>http://arbur.net/serendipity/archives/31-guid.html</id>
        <title type="html">Glom on maemo</title>
        <content type="xhtml" xml:base="http://arbur.net/serendipity/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>I recently ported <a href="http://www.glom.org"  title="Glom database designer">glom</a> to the <a href="http://www.maemo.org"  title="The maemo platform for Nokia's internet tablets">maemo</a> platform for Nokia's internet tablets for <a href="http://www.openismus.com"  title="Openismus provides custom software development using Open Source Software">Openismus</a>. The major work of this was compiling glom and its dependencies in <a href="http://www.scratchbox.org"  title="The scratchbox cross-compilation toolkit">scratchbox</a>, i.e. make it build and run without using some convencience API in glibmm and friends to save code size. This leads to a lot of #ifdef statements uglifying the code (especially because you cannot use exceptions for the code to compile with the -fno-exceptions flag), but well, that's the price you have to pay if you want to use C++ on maemo (you can at least save the #ifdefs if you are writing a maemo-only application, though). It's still much more convenient than plain C. Note that the maemo version of glom is a client only version, i.e. it does not support self-hosting and developer mode.</p>

<p>The work has already been committed to glom <a href="http://svn.gnome.org/viewvc/glom/trunk/"  title="glom trunk in the GNOME Subversion repository">trunk</a>, though I keep making changes in the <a href="http://svn.gnome.org/viewvc/glom/branches/GLOM_CLIENTONLY/"  title="The GLOM_CLIENTONLY branch in the GNOME Subversion repository">GLOM_CLIENTONLY</a> branch to be able to make debian packages for sardine extras that are based on glom 1.6. With friendly help from <a href="http://jsschmid.de/"  title="The blog of my Openismus colleague Johannes Schmid">Johannes Schmid</a> and <a href="http://www.philkern.de/"  title="My friend Philipp Kern">Philipp Kern</a> I managed to build debian packages for glom and its dependencies that are already in sardine extras. Feel free to contact me if there are problems with them, since these are the first ones I ever made, and I am not too familiar with debian based distributions either, because I am not using one.</p>

<p><a class='serendipity_image_link' href='http://arbur.net/serendipity/uploads/openismus/glom-maemo-1.png'><!-- s9ymdb:29 --><img width='110' height='69' style="float: left; border: 0px; padding-left: 5px; padding-right: 5px;" src="http://arbur.net/serendipity/uploads/openismus/glom-maemo-1.serendipityThumb.png" alt="Glom right after startup" /></a><a class='serendipity_image_link' href='http://arbur.net/serendipity/uploads/openismus/glom-maemo-2.png'><!-- s9ymdb:30 --><img width='110' height='69' style="float: left; border: 0px; padding-left: 5px; padding-right: 5px;" src="http://arbur.net/serendipity/uploads/openismus/glom-maemo-2.serendipityThumb.png" alt="List view of the small business example" /></a><a class='serendipity_image_link' href='http://arbur.net/serendipity/uploads/openismus/glom-maemo-3.png'><!-- s9ymdb:31 --><img width='110' height='69' style="float: left; border: 0px; padding-left: 5px; padding-right: 5px;" src="http://arbur.net/serendipity/uploads/openismus/glom-maemo-3.serendipityThumb.png" alt="Details view of the small business example" /></a>These screenshots show how the whole thing currently looks like. I made use of the <a href="http://maemomm.garage.maemo.org/unstable/docs/index.html"  title="maemomm API documentation">hildonmm</a> APIs where appropriate to get a more native maemo look-and-feel, though there is still some work left in that regard. At some places, glom measures size of text to determine the width and/or height of its widgets, using <a href="http://library.gnome.org/devel/gtk/unstable/GtkWidget.html#gtk-widget-create-pango-layout" title="API reference for gtk_widget_create_pango_layout">gtk_widget_create_pango_layout()</a> and <a href="http://library.gnome.org/devel/pango/unstable/pango-Layout-Objects.html#pango-layout-get-pixel-size" title="API reference for pango_layout_get_pixel_size">pango_layout_get_pixel_size()</a>. However, this seems to result in the size of the text for the normal GTK+ theme, not the one with the bigger font on maemo, and this renders glom's guesses about widget sizes rather unusable. I fixed the most obvious uses (like the height of the tree rows in the glom list view) by hardcoding the size, but of course that is not a permanent solution. I am thankful for any hints how to get a correctly setup PangoLayout to do text measuring on maemo.</p>

<p>The automatic column sizing of GtkTreeView also seems not too useful for glom on maemo (see second screenshot). We probably should rather allow the user to scroll the list view horizontally, and introduce a minimum width for the columns.</p> 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://arbur.net/serendipity/archives/30-Collaborative-Undo-done-right.html" rel="alternate" title="Collaborative Undo done right" />
        <author>
            <name>Armin Burgmeier</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2007-07-16T11:27:00Z</published>
        <updated>2007-07-16T11:27:00Z</updated>
        <wfw:comment>http://arbur.net/serendipity/wfwcomment.php?cid=30</wfw:comment>
    
        <wfw:commentRss>http://arbur.net/serendipity/rss.php?version=atom1.0&amp;type=comments&amp;cid=30</wfw:commentRss>
    
            <category scheme="http://arbur.net/serendipity/categories/2-Gobby" label="Gobby" term="Gobby" />
    
        <id>http://arbur.net/serendipity/archives/30-guid.html</id>
        <title type="html">Collaborative Undo done right</title>
        <content type="xhtml" xml:base="http://arbur.net/serendipity/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>Many people using gobby complain that it does not support Undo, and some do not even use it therefore. Of course, they are right. It is not only convenient but may also save you lots of data in case you accidentally delete it. However, it is not easy to implement it in a collaborative editor because between your own do and undo operation pairs others might have altered the document. It is thus not reverted to a previous state as with a single user editor. We got suggestions to add some sort of "primitive" Undo like just undoing the last operation, no matter from whom it was. I didn't like that, though, because I prefer to either do things correctly or not at all.</p>

<p>Fortunately, other people also thought about how to achieve collaborative Undo. I read some papers <a href="#collundo_papers">[1]</a> describing an algorithm (adOPTed) that not only achieves convergence, meaning that two users don't end up with a different document after having applied some operations concurrently (which the obby algorithm (called Jupiter) obviously also achieves), but also allows Undo/Redo (which Jupiter does not when more than two users are involved). This is however not the one-and-only solution. There are other approaches to collaborative Undo (or resolving collisions in general), like the <a href="http://uwog.net/news/?p=85"  title="Marc Maurer's blog entry about AbiCollab collision handling">AbiCollab</a> one. adOPTed has some nice properties though:</p>

<ul>
 <li>It has enough information to not only undo your own but also any other's operation. Actually, when a user wants to Undo something, it just says "I am doing an Undo now" and the others calculate the required operation. This especially allows to easily restore user colors when a deletion is being undone (without allowing arbitrary insertion of text colored with another user's color). It could also be used to undo vandalism issued by another user.</li>
 <li>You can always undo and redo your operations, independent of what others have done in between. However, it might happen that an undo has no effect (for example, if you type something, another one deletes it and you press undo then). I wonder by the way what a user expects in that case: Imagine you are typing two letters, and another user deletes the second one. When you press Undo now, would you expect nothing to happen (because another one already "manually" undid your latest operation) or would you expect that the first letter also disappears (because of exactly the same reason)?</li>
 <li>It doesn't need a server to make some final decisions or to keep things in order. You just have to make the other participants receive your requests somehow. Also, there are no conflict situations or something requiring additional round-trips.</li>
</ul>

<p>However, as always, everything has its price:</p>

<ul>
 <li>My implementation requires already a lot of CPU power in my simple test cases to calculate the required transformations, especially when there are lots of operations between a do/undo pair.</li>
 <li>As every user calculates the undo operation by itself, every user needs to keep track of every request made by any user. This also requires to send the whole request log to a joining user. Of course, this can be limited to the latest N operations, but it is still a considerable amount of data (especially when many users are working together) and restricts the number of operations people can undo.</li>
</ul>

<p>My proof of concept featuring Undo and Redo is <a href="http://arbur.net/code/adopted.cpp"  title="Adopted implementation">here</a>. However, you probably won't understand the interesting part of that code without having read the papers referenced above (which you should do as well if you are interested in more details, by the way). There a still a couple of issues before that can be used in a real-world environment, though. I think the performance problems mentioned above can be fixed by caching transformed requests, so that it does not have to compute the same requests all over again. Another problem that needs to be solved is a dynamic amount of users. My test code only works for a fixed number of users. The difficulty is to find out when it is safe to forget about operations from a user that has left the editing session, to save memory and bandwidth.</p>

<p>I hope to get that done really soon now so that it can be used in Infinote and perhaps even Gobby (I have not yet decided whether I want to implement that in Gobby because it is still a considerable amount of work).</p>

<p>I am off to Ireland at the 23th of July and am visiting some friends near <a href="http://en.wikipedia.org/wiki/Osnabr%C3%BCck"  title="Wikipedia article on Osnabr&uuml;ck">Osnabr&uuml;ck</a> right after that, but when I am back home (presumably at 12th of August) I really hope to get something usable (read: a gedit plugin) before my third semester at university begins in October. Unfortunately, I cannot make it to GUADEC this year because I have to be at university that week, but I really look forward to finally get there next year.</p>

<p><small>
 <a id="collundo_papers"></a>[1] <a href="http://hal.inria.fr/action/open_file.php?url=http://hal.inria.fr/docs/00/07/13/98/PDF/RR-5188.pdf&amp;docid=71398">Achieving Convergence with Operational Transformation in Distributed Groupware Systems</a> (by Abdessamad Imine et al.)<br />
 <a href="http://citeseer.ist.psu.edu/rd/10822314%2C428837%2C1%2C0.25%2CDownload/http://coblitz.codeen.org:3125/citeseer.ist.psu.edu/cache/papers/cs/20920/http:zSzzSzwww.cit.gu.edu.auzSz%7EsczzSzsigcezSzpaperszSzcscw96.pdf/ressel96integrating.pdf">An Integrating, Transformation-Oriented Approach to Concurrency Control and Undo in Group Editors</a> (by Matthias Ressel, Rul Gunzenh&auml;user and Doris Nitsche-Ruhland)<br />
 <a href="http://www.welie.com/eelke/literature/p131-ressel.pdf">Reducing the problems of group undo</a> (by Matthias Ressel and Rul Gunzenh&auml;user)
</small></p> 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://arbur.net/serendipity/archives/29-GtkSourceView2-in-Gobby.html" rel="alternate" title="GtkSourceView2 in Gobby" />
        <author>
            <name>Armin Burgmeier</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2007-05-27T00:30:10Z</published>
        <updated>2007-05-27T00:30:10Z</updated>
        <wfw:comment>http://arbur.net/serendipity/wfwcomment.php?cid=29</wfw:comment>
    
        <wfw:commentRss>http://arbur.net/serendipity/rss.php?version=atom1.0&amp;type=comments&amp;cid=29</wfw:commentRss>
    
            <category scheme="http://arbur.net/serendipity/categories/2-Gobby" label="Gobby" term="Gobby" />
    
        <id>http://arbur.net/serendipity/archives/29-guid.html</id>
        <title type="html">GtkSourceView2 in Gobby</title>
        <content type="xhtml" xml:base="http://arbur.net/serendipity/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>Today, I read the <a href="http://mail.gnome.org/archives/gedit-list/2007-May/msg00028.html"  title="GtkSourceView 1.90 release announcement on gedit-list">GtkSourceview 1.90 release announcement</a> on <a href="http://mail.gnome.org/mailman/listinfo/gedit-list"  title="gedit-list mailing list information">gedit-list</a>. After having finished my math excerises much earlier then expected I decided to hack GtkSourceview2 support into Gobby. I committed it a few minutes ago into SVN, after having received some advice from <a href="http://www.math.tamu.edu/~yevgen.muntyan/"  title="Yevgen Muntyan's web page">Yevgen Muntyan</a> to get it to work (You have to associate a style theme by hand to get highlighting, which will hopefully be changed in the future so that a default theme is used if none is given).</p>

<p><a class='serendipity_image_link' href='http://arbur.net/serendipity/uploads/gobby/gobby-gsv2.png'><!-- s9ymdb:28 --><img width='110' height='87' style="float: left; border: 0px; padding-left: 5px; padding-right: 5px;" src="http://arbur.net/serendipity/uploads/gobby/gobby-gsv2.serendipityThumb.png" alt="" /></a>GtkSourceView2 basically comes with a new syntax highlighting engine that allows embedding languages into others (such as JavaScript into HTML, as shown on the screenshot). It also has theming support and mapping between filename patterns and language definitions, which Gobby had to implement before (and it still does since GtkSourceView1 is still supported).</p> 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://arbur.net/serendipity/archives/28-Gobby-status.html" rel="alternate" title="Gobby status" />
        <author>
            <name>Armin Burgmeier</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2007-05-07T21:49:00Z</published>
        <updated>2007-05-07T21:49:00Z</updated>
        <wfw:comment>http://arbur.net/serendipity/wfwcomment.php?cid=28</wfw:comment>
    
        <wfw:commentRss>http://arbur.net/serendipity/rss.php?version=atom1.0&amp;type=comments&amp;cid=28</wfw:commentRss>
    
            <category scheme="http://arbur.net/serendipity/categories/2-Gobby" label="Gobby" term="Gobby" />
    
        <id>http://arbur.net/serendipity/archives/28-guid.html</id>
        <title type="html">Gobby status</title>
        <content type="xhtml" xml:base="http://arbur.net/serendipity/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p><a href="http://gobby.0x539.de"  title="Gobby Collaborative editor">Gobby</a> development has not stalled. We released 0.4.3 with native <a href="http://avahi.org/"  title="Avahi Service Discovery">Avahi</a> support a few weeks ago. However, it is not planned to add any great new features in favor of the sequel I already <a href="http://arbur.net/serendipity/archives/3-The-future-of-Gobby.html"  title="The future of (G)obby">announced</a> half a year ago. Unfortunately, it does not make as much progress as one could expect it to do, and especially not as much as I would like it to do. My second semester at university began three weeks ago, so I also don't think I get too much done in the following two to three months, either.</p>

<p>The successor of Gobby is going to be called Infinote. It will offer some (long-requested) features the current Gobby architecture does not support, such as different document types, XMPP-based messaging and showing remote cursors/selections. However, the fundamental change is that I want to provide a kind of framework rather than an editor, and to get people to implement Infinote support into their editors so that ideally you can just continue to use your favorite editor for collaborative work. For this to work, I need to properly document the API and network protocol which is also one of the points Gobby is rather weak in currently.</p>

<p>A propos protocol: More and more collaborative editing efforts pop up lately, like <a href="http://xmppcollaborate.wordpress.com/"  title="Pisara - An XMPP based collaborative text editor">Pisara Editor</a>, <a href="http://www.abisource.com/twiki/bin/view/Abiword/AbiCollab"  title="AbiWord collaboration">AbiCollab</a> (which I should really try out in the near feature...) seems to be mature and a GUADEC session description mentions some <a href="http://guadec.org/node/521"  title="
Collaboration within GNOME">gedit/collab</a> (over which I did not find out any further details, though). Then, there are of course <a href="http://ace.iserver.ch/"  title="ACE - A collaborative editor">ACE</a> and <a href="http://mateedit.sourceforge.net/"  title="MateEdit collaborative editor">MateEdit</a> which I am already aware of. All of these (including Gobby) use different protocols, and are therefore unable to interoperate with each other. Most seem to agree that XMPP is a good base, but there is still the application-specific stuff on top of it that needs to be compatible. It would be great if there was some project like freedesktop.org to agree on a standard for collaborative (text) editing.</p>

<p>The current Infinote code is available in a public SVN at <a href="svn://svn.0x539.de/inifinote"  title="Infinote SVN repository">svn://svn.0x539.de/inifinote</a> for those who want to have a look at it. However, most of the ideas do only exist in my head by now and are not written down somewhere in there.</p> 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://arbur.net/serendipity/archives/27-Installer++.html" rel="alternate" title="Installer++" />
        <author>
            <name>Armin Burgmeier</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2007-04-10T13:22:00Z</published>
        <updated>2007-04-10T13:22:00Z</updated>
        <wfw:comment>http://arbur.net/serendipity/wfwcomment.php?cid=27</wfw:comment>
    
        <wfw:commentRss>http://arbur.net/serendipity/rss.php?version=atom1.0&amp;type=comments&amp;cid=27</wfw:commentRss>
    
            <category scheme="http://arbur.net/serendipity/categories/2-Gobby" label="Gobby" term="Gobby" />
    
        <id>http://arbur.net/serendipity/archives/27-guid.html</id>
        <title type="html">Installer++</title>
        <content type="xhtml" xml:base="http://arbur.net/serendipity/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>Do you remember back in school when you learned stuff you certainly would not need anymore in your future life? I thought the same thing when we programmed things in Delphi (those things actually were quite interesting, though). After Phil poked me once again yesterday, I finally decided to fix long-standing <a href="http://gobby.0x539.de/trac/ticket/145"  title="Gobby Bug #145 - Have installer verify the presence of GTK+, and gtkmm">bug #145</a>. So, guess what, the setup system we use (<a href="http://www.jrsoftware.org/isinfo.php"  title="Free installer for Windows">InnoSetup</a>) is not only written in Delphi but also allows custom Pascal Code to be executed during setup. So <a href="http://gobby.0x539.de/trac/changeset/1552"  title="Gobby ChangeSet 1552">this</a> is what I came up with, and it would certainly have taken me some more hours if I did not know Delphi before.</p>

<p>I wonder however whether I will have to use Java for some real-world application one day. I would be nearly as good prepared as I was for the Delphi task.</p> 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://arbur.net/serendipity/archives/26-Back-from-FOSTEL.html" rel="alternate" title="Back from FOSTEL" />
        <author>
            <name>Armin Burgmeier</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2007-04-06T21:55:00Z</published>
        <updated>2007-04-06T21:55:00Z</updated>
        <wfw:comment>http://arbur.net/serendipity/wfwcomment.php?cid=26</wfw:comment>
    
        <wfw:commentRss>http://arbur.net/serendipity/rss.php?version=atom1.0&amp;type=comments&amp;cid=26</wfw:commentRss>
    
            <category scheme="http://arbur.net/serendipity/categories/6-Real-Life" label="Real Life" term="Real Life" />
    
        <id>http://arbur.net/serendipity/archives/26-guid.html</id>
        <title type="html">Back from FOSTEL</title>
        <content type="xhtml" xml:base="http://arbur.net/serendipity/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>I got home from <a href="http://fostel2007.fostel.org"  title="Free Software/Open Source Telephony summit">FOSTEL 2007</a> a few hours ago. I was there to represent <a href="http://gobby.0x539.de"  title="Gobby collaborative text editor">Gobby</a> and to spread the word about <a href="http://www.openismus.com"  title="Openismus GmbH - Custom software development using Open Source software">Openismus</a> a bit.</p>

<p>I met a couple of interesting people there like Philip van Hoof, the author of the <a href="http://www.tinymail.org"  title="Tinymail - The Small eMail framework">Tinymail</a> framework, Robert McQueen from the <a href="http://telepathy.freedesktop.org"  title="Telepathy - Flexible Communication Framework">Telepathy</a> project and <a href="http://www.remote.org/jochen/"  title="Homepage of Jochen Topf">Jochen Topf</a> who pointed me to the <a href="http://www.openstreetmap.org"  title="Project providing free geographic data">OpenStreetMap</a> project (and who is also living in Karlsruhe, by the way). There was also a lot of VoIP and Telephony stuff I do not know much about and I did not understand that much, but it was nevertheless pretty interesting and fun. I really enjoyed <a href="http://en.wikipedia.org/wiki/Sean_Egan"  title="Wikipedia article on Sean Egan">Sean Egan</a>'s talk on <a href="http://en.wikipedia.org/wiki/XMPP"  title="Wikipedia article on XMPP">XMPP</a>, too.</p>

<p>Things I want to keep in mind for the next conference:</p>

<ul>
 <li>Do not pronounce Gobby in a way so that people might understand <a href="http://kopete.kde.org"  title="Kopete, the KDE messanger">Kopete</a>.</li>
 <li>When doing a five minute talk, only prepare for about four minutes, because it will eventually take longer. Apropos lightning talk, the slides of my Gobby Status talk are <a href="http://arbur.net/gnome/fostel2007/Gobby.pdf"  title="Slides of my Gobby lightning talk">here</a>. OpenOffice messed the headers up when exporting to PDF, but I don't want to fiddle around with that at the moment. Also expect a blog entry about that topic in the near future.</li>
</ul>

<p>Last but not least, I want to thank Dave Neary (and probably <a href="http://www.openwengo.org"  title="OpenWengo Free PC-to-PC audio/video calls">OpenWengo</a>) for providing me free accommodation and for the dinner Wednesday night. Perhaps we meet again next year.</p> 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://arbur.net/serendipity/archives/25-Hello-Planet.html" rel="alternate" title="Hello Planet" />
        <author>
            <name>Armin Burgmeier</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2007-04-06T21:37:00Z</published>
        <updated>2007-04-06T21:37:00Z</updated>
        <wfw:comment>http://arbur.net/serendipity/wfwcomment.php?cid=25</wfw:comment>
    
        <wfw:commentRss>http://arbur.net/serendipity/rss.php?version=atom1.0&amp;type=comments&amp;cid=25</wfw:commentRss>
    
            <category scheme="http://arbur.net/serendipity/categories/5-Internet" label="Internet" term="Internet" />
    
        <id>http://arbur.net/serendipity/archives/25-guid.html</id>
        <title type="html">Hello Planet</title>
        <content type="xhtml" xml:base="http://arbur.net/serendipity/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>If you are stumbling over this while reading <a href="http://planet.gnome.org"  title="GNOME Planet Aggregator">Planet Gnome</a>, then I have been added to the latter. Thanks Jeff!</p>

<p>For those who do not know me yet: I am a 20-year old German guy, developer of <a href="http://gobby.0x539.de"  title="Gobby collaborative text editor">Gobby</a>, and doing various GNOME-related things as a part-time <a href="http://www.openismus.com"  title="Openismus GmbH - Custom software development using Open Source software">Openismus</a> employee. Currently, I am working on porting <a href="http://www.glom.org"  title="Glom database system designer">Glom</a> to the new <a href="http://www.gnome-db.org"  title="Gnome Data Access">libgda</a> 3.0 API.</p> 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://arbur.net/serendipity/archives/24-Speeding-up-gtkmm.html" rel="alternate" title="Speeding up gtkmm" />
        <author>
            <name>Armin Burgmeier</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2007-03-16T15:52:00Z</published>
        <updated>2007-03-16T15:52:00Z</updated>
        <wfw:comment>http://arbur.net/serendipity/wfwcomment.php?cid=24</wfw:comment>
    
        <wfw:commentRss>http://arbur.net/serendipity/rss.php?version=atom1.0&amp;type=comments&amp;cid=24</wfw:commentRss>
    
            <category scheme="http://arbur.net/serendipity/categories/7-Openismus" label="Openismus" term="Openismus" />
    
        <id>http://arbur.net/serendipity/archives/24-guid.html</id>
        <title type="html">Speeding up gtkmm</title>
        <content type="xhtml" xml:base="http://arbur.net/serendipity/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>According to <a href="http://arbur.net/code/gtkmm-speedup/gtkmm-table.cc"  title="gtkmm performance test">test</a> test application, gtkmm needs significantly more time when default signal handlers and virtual functions are enabled. What gtkmm basically does is creating a new class inheriting from the corresponding class in GTK and overriding all vfuncs and default signal handlers. In the overridden method, it gets the C++ wrapper object for the C object (if any) and casts it to the actual type (e.g. Gtk::Window). As an optimization it checks already whether the C++ object is a custom one that derives from the gtkmm one. If not, the vfunc could not have been overridden anyway and we just call the parent's (GtkWindow) vfunc implementation. Otherwise, a C++ virtual function is called that classes deriving from Gtk::Window might override. This way, GObject vfuncs can be overridden in the C++ code.</p>

<p>For <a href="http://www.openismus.com"  title="Openismus GmbH">Openismus</a>, I tried to find out what makes this procedure slow. To do so I used <a href="http://valgrind.org/info/tools.html#callgrind"  title="The callgrind tool of valgrind">callgrind</a> to collect some profiling data from the test program mentioned above. Then, I installed <a href="http://www.trolltech.com/products/qt"  title="Qt widget toolkit">Qt</a> and <a href="http://en.wikipedia.org/wiki/Kdelibs"  title="Wikipedia article on the kdelibs framework">kdelibs</a> just to be able to use <a href="http://kcachegrind.sourceforge.net/cgi-bin/show.cgi"  title="KCachegrind profiling visualizer">kcachegrind</a> to visualize that data. Wouldn't someone like to write a kcachegrind-like application for GNOME? <img src="http://arbur.net/serendipity/templates/default/img/emoticons/smile.png" alt=":-)" style="display: inline; vertical-align: bottom;" class="emoticon" /></p>

<img width='773' height='472' style="border: 0px; padding-left: 5px; padding-right: 5px;" src="http://arbur.net/serendipity/uploads/openismus/kcachegrind1.png" alt="" />

<p>I had a look at Container_Class::forall_vfunc because this was the one called most times (64 025 calls, to be accurate). kcachegrind shows that 3.10% of the total time was spent in forall_vfunc (actually, its not time but CPU cycles or something, but as a physician I assume they are proportional...). Out of these 3.10%, 1.48% are spent in dynamic_cast&lt;&gt;, another 0.99% in ObjectBase::_get_current_wrapper(). The latter call looks up the C++ object from the C object, and the dynamic_cast casts it from ObjectBase to the actual type. Both calls are at the very beginning of the function. Also of notice is that 2.50% of the overall time is in dynamic_cast&lt;&gt;. This means that just the forall_vfunc issues more than the half of all dynamic_casts in the whole program, not counting all the other vfuncs.</p>

<p>What I tried out now is to do the dynamic_cast only if the C++ object is derived from the gtkmm class. In the test application, this is only the case for ExampleWindow but not for all the other widgets that are created. If the object is not derived, the actual C++ type is not needed because we just call the parent vfunc anyway. The result looks like this:</p>

<img width='773' height='239' style="border: 0px; padding-left: 5px; padding-right: 5px;" src="http://arbur.net/serendipity/uploads/openismus/kcachegrind2.png" alt="" />

<p>The time spent in forall_vfunc is now nearly only the half as before. It does no more call to dynamic_cast. This is because all containers on which the forall vfunc was called are not overridden by a C++ class. Other vfuncs, as expose_event, still showed a small amount of dynamic_cast calls. These were the expose events the Window received because of being derived by ExampleWindow. There is a <a href="http://bugzilla.gnome.org/show_bug.cgi?id=418571"  title="Bugzilla bug about doing dynamic_cast only when necessary">bug</a> open about this.</p>

<p>The next thing I had a look at was the ObjectBase::_get_current_wrapper() call. kcachegrind shows a total amount of 1.70% out of which 0.14% are spent in the function itself (and not in functions being called by get_current_wrapper() in turn). However, the function does nothing more than calling g_object_get_qdata on the given GObject to get the C++ wrapper. Therefore, it seems that a significant amount of time is lost due to the overhead of a function call here because the function is often called (106 674 times), so I tried inlining it:</p>

<img width='773' height='234' style="border: 0px; padding-left: 5px; padding-right: 5px;" src="http://arbur.net/serendipity/uploads/openismus/kcachegrind3.png" alt="" />

<p>Any calls to get_current_wrapper() disappeared now. Instead, g_object_get_qdata() shows up directly in forall_vfunc. A good way to verify that the compiler actually inlined the function call. Again, there is a performance gain, but way smaller.</p>

<p>So long, but what about actual execution times? When running the test application, there was no noticeable speedup. However, when running under <a href="http://www.valgrind.org"  title="Valgrind debugging tool suite">valgrind</a> (meaning about 10-30 times slower), it finished one or two seconds earlier. To conclude, for most users the changes will probably not be visible, but for large applications and/or less powerful machines gtkmm applications might run a bit more smoothly now.</p> 
            </div>
        </content>
        
    </entry>

</feed>