Tag Archives: gtkmm

gtkmm 3.8

I didn’t get around to blogging about gtkmm 3.8 when I released it last month, partly because we had to fix a crasher bug and do a gtkmm .1 release before people noticed.

Anyway, just a little while after GNOME 3.8 was released, we managed to release gtkmm 3.8 and glibmm 2.36. There is quite a bit of work in these, almost all by José Alburquerque and Kjell Ahlstedt, as well as the usual few days of last-minute work by me to wrap remaining new API.

I spend very little time on glibmm and gtkmm these days, and don’t have much motivation to change that.

There’s also a change that we expect in glib 2.38 that will break many installed applications that use gtkmm. We successfully begged the glib developers to add a special case for us in glib 2.36, but we have not found any way to avoid this for 2.38. So far our best option seems to be to do a new parallel-installed gtkmm (and glibmm) ABI, leaving the old (broken with glib 2.38) one behind, at least allowing applications to be changed slightly and then rebuilt.

Personally, I have no great incentive to go through that pain.

glibmm 2.35.8

I found a little time to do the first glibmm release in a few months. Kjell Allstedt and José Alburquerque have pushed so many commits, fixing several awkward bugs, that I had to get it out there. It includes almost no commits from me.

Now to try rolling a gtkmm tarball.

gtkmm maintainership

I have not had enough time recently for my maintainership of gtkmm, glibmm, libxml++ and libsigc++. And I’m unlikely to find time soon. Family and (income earning) work have taken priority. That’s why glibmm and gtkmm didn’t have .0 releases until a couple of weeks after the GNOME .0 release, and why there was no real attempt to follow the GNOME release schedule this time. I’ve hardly touched cairomm for years.

It’s not a lot of work but I’ve had to find a few days every few months to keep glibmm and gtkmm up to date with API additions in glib and GTK+, to keep roughly in sync with them. There has been rather a lot of new API recently. See the list of new API in gtkmm 3.6, glibmm 2.34 , gtkmm 3.4, and glibmm 2.32. Krzesimir’s ongoing attempt to use the introspection information (rather than .defs files) would help with this but not hugely because we’d still need to take care that the API is right for C++. Some initial .hg/ccg creator script would probably be most helpful.

I have no time for the more difficult bugs that turn up occasionally. Luckily Kjell Ahlstedt, José Alburquerque and others arrive regularly in bugzilla with great fixes for hard problems. I trust Kjell and José to commit directly, but they deserve some decent patch review. Unfortunately I often keep them waiting far too long.

I need to make some change. As a start, I might stop receiving bug email for glibmm and gtkmm, and stop worrying about adding new API. I guess it will take at least one missed GNOME release cycle for some other people to take over my responsibilities.

Glom 1.20

It has taken over a year of hard work but Glom 1.20 is finally ready.

This is the most stable and most usable version of Glom yet, with a few new features, now using gtkmm 3. Here are some updated screenshots. The major changes:

  • Simplified main window.
  • Glom can now store and display PDFs. It can store any file format, though it can only display images and PDFs.
  • Print Layout: Major overhaul with improved UI and new functionality.
  • Related Records: Allow the developer to specify how many rows to show.
  • Choice drop-downs can show more than 2 fields.
  • Choice drop-down fields are aligned.
  • Choice drop-downs can show related fields.
  • List columns have sensible widths.

Around 20 bugs from bugzilla were fixed, plus several more.There are over 30 tests that prevent regressions in mostly non-UI code. I still wish I could get some kind of automated UI testing working.

We have packaged Glom 1.20 (and several dependencies) for Ubuntu 11.10 (Oneiric) in the Openismus PPA. We might do something similar for Fedora.

Unfortunately, it will probably take a year for Glom 1.20 to officially get into distros such as Ubuntu (bug) and Fedora (bug) officially, and then they won’t deliver bug fix updates. This is partly due to lack of the volunteer packagers’ time and partly due to unfriendly distro policies towards applications. My only hope now is something like Glick.

Glom: Storing PDFs

Glom already had an Image field type, letting you store pictures in the database and view them. It used GtkImage.

It can now store and preview PDFs, or anything else supported by Evince, via its evince-view library.

The contents can also now be opened in the external application via the context menu, and an Open With menu item even offers a choice of suitable applications via GtkAppChooserDialog. That’s why I haven’t bothered to add page navigation or zooming for PDFs in Glom itself.

It can even store arbitrary file contents, though it will just show a standard icon in that case. As a hack, it saves the contents as a temporary file in order to use GFileInfo to get the standard file icon. I haven’t managed to get the thumbnail via the G_FILE_ATTRIBUTE_THUMBNAIL_PATH attribute, but it’s probably not reasonable to expect to get that thumbnail for a completely new file.

In fact, I use the same temporary file hack to get the PDF data into the Evince EvView. I must figure out how to make EvView render from data in memory instead of a filepath.

It would be nice to show a simple video player for video files, but I haven’t found a suitable gstreamer-based library for that yet, though I guess I could copy/paste some code. And anyway, it doesn’t like huge files right now.

I use glib’s mime-type sniffing function to guess the mime-type, to decide how to display or open the document. This works surprisingly well but we really need to store the original mime type, and probably the file name, in extra database fields.

Update: I’ve given up on getting a thumbnail, so I’m just using g_content_type_get_icon(), which avoids the need to save a temporary file to disk. And for EvView, I’ll try to add API to allow loading from memory.

Programming with gtkmm 3

We kept the Programming with gtkmm book (the gtkmm-documentation module) up to date while working on gtkmm 3, so all the examples build for gtkmm 3. We have not yet added chapters about all the new API in glibmm, which would be very useful.

Anyway, yesterday I wrote a small Changes in gtkmm 3 chapter, that’s slightly more informative than the release announcement, and I published “Programming with gtkmm 3″ for the Kindle too.

gtkmm 3.0.0

We’ve been working on gtkmm 3 increasingly since sometime in 2009 and today we have finally declared it stable. gtkmm 3.0.0 is out. We last did an ABI-breaking parallel-installable stable version in April 2004 for gtkmm 2.4.0 so we’ll probably have to live with this for a while.

We didn’t fullfil all our amibions, due to lack of time, but we did fix many annoyances that had built up over the years. And luckily GTK+ 3 turned out to contain far more interesting changes than initially planned, most of which are now available via gtkmm-3.0.

Personally, I’m glad that it’s done. It’s been a long hard slog over the past year, made possible by my company Openismus GmbH, just to keep up with the (nevertheless necessary) API churn during the unstable GTK+ 3 development cycle. That hasn’t left me much time for any other software development, but now I feel free.

To port to gtkmm-3.0 you should first try to build your application with gtkmm-2.4 but without using deprecated API. The deprecated API generally has documentation suggesting what new API you
should use instead. These gtkmm-3.0 porting hints might also be helpful:

Some new/changed API in gtkmm-3.0, though this list is far from complete:

Gtk:

  • Adjustment is now used via RefPtr.
  • AppChooser, AppChooserButton, AppChooserDialog.
  • Box, ButtonBox, IconView, Paned, ProgressBar, ScaleButton, ScrollBar and Separator now derive from Orientable.
  • All widgets derive from Buildable.
  • Several widgets derive from Scrollable.
  • CellArea and CellAreaBox
  • ComboBox now derives from CellLayout.
  • IconSet is now used via RefPtr.
  • StyleContext, StyleProvider, and CssProvider, replacing Style and Rc.
  • Grid
  • NumerableIcon.
  • Switch
  • Widget::on_expose_event() is now Widget::on_draw().

Gdk:

  • Added DeviceManager.
  • Removed Drawable, Pixmap and Bitmap.
  • Cursor is now used via RefPtr.
  • RGBA replaces Color, though Color still exists because it is used by TextView. We hope to deprecated Color completely in gtkmm 3.2.
  • Removed Colormap and its general awkardness.

General:

  • Use std::vector in several methods instead of the intermediate *Handle types to make the API clearer.
  • Change all operator void* to operator const void*, with a BoolExpr typede and extra documentation. This avoids an unintentional implicit cast to int, and is generally considered good practice in C++. The new C++ standard allows the use of the explicit keyword here instead, but that is not yet widespread.
  • Many existing classes have many new methods.
  • gtkmm-3.0 currently has no deprecated API. Not even API that was added and then deprecated during GTK+ 3.0.

See also the list of new API in gtkmm 3.0.

Thanks to everyone who helped.

glibmm 2.28 with Gio::Settings and Gio::DBus

We finally released glibmm 2.28.0. This is the first stable release with new API since glibmm 2.24.0 in March 2010. We skipped glibmm 2.26.0 because there was so much new and awkward API that needed to be wrapped properly for C++. It’s scary to declare so much new API stable, but we had to do it eventually.

Glib has the following new API, though this list is not complete:

  • Variant: A new hierarchy of templated Variant<> types, for use with Gio::Settings and Gio::DBus.
  • Regex uses a new MatchInfo class.
  • build_filename() now has overloads to take up to 9 arguments,
  • get_system_data_dirs() and get_system_config_dirs().

Gio has the following new API, though this list is not complete:

  • Settings: For application settings, replacing GConf (or Gnome::Conf).
  • DBus: API to use or implement D-Bus services.
  • Proxy, ProxyAddress and ProxyResolver.
  • SocketControlMessage, UnixCredentialsMessage and UnixFDMessage.

See also this list of new API in glibmm 2.28.

Gio::DBus, Glib::Variant and Gio::Settings were a huge amount of difficult work mostly by José Alburquerque, with help from Jonathon Jongsmam, Yannick Guesnet, Michael Edwards, Martin Braure de Calignon, Murray Cumming and others. Some of José Alburquerque’s work, and most of Murray Cumming’s was funded by Openismus GmbH.
Thank you, everyone.

Glom: GtkNotebook with no frame

GtkNotebook has a frame around the page that it shows, grouping that page’s widgets together. That makes sense when the notebook is part of a more complicated UI. But Glom uses a GtkNotebook for almost all of its main window, taking up all of the window’s width. The frame needs an inner border that wastes space and the nesting actually makes the UI look more complicated than it is.

That frame is not optional in GtkNotebook, so I had to create a custom Gtk::Notebook-like class to replace it in my code. The result is mostly better, though I don’t like those two toggle buttons much. Suggestions are welcome.

I will also move those top labels around, putting them in the same row as the List and Details toggle buttons, but this is a start.