Tag Archives: Gnome

www.gnome.org

libepc

I’m very pleased with the libepc library that Mathias Hasselmann created for Glom. I much prefer having the Avahi and network communication wrapped up in a simple separate library rather than mixing it in with Glom’s source code. I don’t want to deal with avahi, libsoup and gnutls if I don’t have to.

Glom will effectively use it to discover and load .glom documents over the network from other Glom instances. I suspect that it will be useful to a few other applications, but if not then it will still have been a good exercise in modularity.

I’ve already reviewed a few iterations of the library. Mathias and I are both fussy coders, though in different ways, so that’s why it already has full and meaningful documentation, tests, and examples. But we would welcome feedback so we can show how seriously we take documentation and API. I’ve added it to jhbuild.

gtkmm book as pdf

Jonathon Jongsma recently fixed up the “Programming with gtkmm” book so the result of docbook2pdf is fairly useable. We’d like to improve it even more and maybe sell hard copies online. But I think we need more control over docbook2pdf (a wrapper for jw). For instance:

  • We need to scale images down instead of cropping them.
  • Ideally, the links to the reference documentation would be real hyperlinks in the PDF.
  • It would be nice to specify a different base URL (an XML entity in our Docbook) for the PDF than for the HTML, to make the URLs absolute instead of relative.
  • A background block for the source code examples would provide some structure.
  • Syntax highlighting of the source code examples would be really nice, but we don’t have that in the HTML either. (It’s inserted in the Docbook automatically, from our real source code.)

Does anyone have experience with this?

Of course, I also plan to review all the text and make improvements to the content where necessary. It’s been a few years since I read it all through.

goocanvas experiences

I’ve got to know goocanvas (API documentation, browse CVS) better over the last week. I achieved what I needed, but it could have been easier.

No generic positioning of items

You can’t set the position of goocanvas items. Well, you can set the x,y position of a GooCanvasRect, and you can set the points in a GooCanvasPolyline, but there is no generic position API in the base GooCanvasItem interface.

This makes it very difficult to write generic code for dragging, loading, and saving. All the items could support a generic API – it wouldn’t matter if the x,y is some arbitrary point in the item. I have implemented this in derived classes in C++, with some multiple inheritance awkwardness, but life would be far easier if it was in the GooCanvasItem base class itself. Erik Osheim did this in Python too. You wouldn’t want to do it in C. It seems to be a regression compared to libgnomecanvas, which has gnome_canvas_item_move().

Note that you can “translate” generic GooCanvasItem items, but

  • Two APIs for the same thing, to be used at different times, is annoying.
  • You can’t easily discover the actual position after translating. For instance, the GooCanvasRect x,y properties are not changed by goo_canvas_item_translate(). That function just changes a translation matrix which is applied to the x,y, rather than changing x,y.

I guess this is the cairo drawing system, but the canvas API shouldn’t force that on me. This is a major problem in the API for me, so I hope I can persuade Damon to let us add this.

Update: We created a GooCanvas generic positioning patch for this.

No high-level funtionality

You have to implement too much yourself. Not every application needs the ability to drag and resize items, but many do, and it would be nice if this was easy and consistent. I implemented drag-to-move, snap to grid, snap to rules, ctrl-to-restrict-drag-to-one-axis, resizing via corners and edges with appropriate arrow cursors, and signalling for a context menu on right-click. I still need to do selection highlighting and moving of multiple selections. I did that with a CanvasGroupResizable class that can take a child to be manipulated, though it currently only works with a rectangle child. It uses the generically-movable rectangles and lines that I mentioned above.

The next person to reimplement this will probably make it behave subtly differently.

Now that I finally have a canvas with the basic functionality that I need, I was able to reimplement and improve Glom’s Relationships Overview. I’ll now start using it to implement print layouts showing field data.

Printing is easy

goo_canvas_render() makes printing really easy with GtkPrintOperation.

Minor issues

  • Instead of having a GooCanvasContainer type, there’s a goo_canvas_item_is_container() function that tells you whether goo_canvas_item_get_child() and friends are useful.
    Damon seems to like the idea of correcting this. Update: We created a GooCanvas Container-type patch for this.
  • The root item idea doesn’t seem useful. You always have to use goo_canvas_get_root_item() to actually add or remove items to the canvas. I’d like to make the GooCanvas widget implement the GooCanvasContainer interface instead.
  • The model/view separation doesn’t seem useful, though I might be persuaded by a real life example. I don’t see a big need to display the same canvas twice in the same UI. In GtkTreeView the model/view separation allows you to show two views with differently sorted or filtered models, but I don’t see an equivalent in goocanvas. I can imagine using different zoom levels or different visibility (at different zooms) levels, but I don’t see a way to specify that for a canvas “view”.
  • The *_new() functions need to be fixed to just use g_object_new(), for language bindings. Bug filed.
  • The *_new() functions, such as goo_canvas_rect_new() correctly return an initial reference if you pass NULL for the parent parameter, but do not return a reference if you specify a parent. That’s maybe convenient if you can remember, but its’ an invitation to make mistakes.

At first glance, libccc has many of the same problems. Note that I was dissuaded from trying libccc first because it was started after goocanvas, without any stated reason, and due to the lack of documentation on the functions that I looked at.

I should look at HippoCanvas too.

Glom: Print layouts

As mentioned before, Glom needs a more precise way to specify print layouts, for instance to print on a pre-printed form. I’m looking at the problem again. At the same time, Johannes is working on a prettier drag-and-drop UI for Glom’s regular (automatic) view layouts.

For now, I think I’ll start with text areas that don’t move or shrink depending on their content. But for later I would like to gather some examples of how other software does this. I wasn’t impressed with what I found, though FileMaker is the best of the bunch:

FileMaker print layouts

FileMaker offers two ways to achieve this: You can use the <<fieldname>> placeholder format in static text, or you can specify that a field’s text box will be moved left, right, up or down until it hits another box. Both techniques can be seen in this screenshot:

FileMaker designing print layout

Kexi print layouts

Kexi (version 1.1.3) doesn’t seem to have any support for printing, but please correct me if I’m wrong. (Update: It doesn’t support printing of details forms – the print menu is grayed out in that case. It does support printing of list views, though the result is arranged differently than what’s on screen. It has a reports feature, available under “queries”. For me, a report is for multiple records, not a single record, and I’d like to keep them separate to keep things simple.) However, the regular layout is pixel-perfect rather than automatic, which would be suitable for precise printing, though awful for all other situations.

kexi_layout.png

Knoda print layouts

Knoda (version 0.8.3) seems to support printing, but I didn’t find any features to support flowing of variable sized text. Its layout is pixel-perfect rather than automatic, as with Knoda and Access.

knoda_form_editor.png

Microsoft Access

It looks like Access (the version in Office 2007) also doesn’t have special printing support. I think you are just meant to design a regular custom form and print it. But I couldn’t find a way to print an invoice in their “Northwind” example, so I’m guessing. The regular layout is pixel-perfect, with the ability to make widgets stretch to fill available screen space, with the new “Anchoring” feature in Access 2007.

As seen in this screenshot they also use an invented markup (or mini programming language) to show data, as in FileMaker, but it’s even more complicated here.

access_2007_layout.png

libgda reports

libgda has some reports support (example). It uses custom XML tags (and a custom mini programming language for conditionals) to replace XML nodes (arbitrarily named, without any libgda prefix, it seems, such as <row>) with query results in, for instance, DocBook. So that’s not really useful for the precise layout problem and seems targeted more at multiple rows reports rather than single record printouts. Glom already has its reports feature which seems equivalent, though it is more integrated with Glom concepts such as Relationships and Related Fields.

Others?

What other systems should I look at? Note that I’m not interested in anything that requires the user to edit XML or SQL queries, though it’s possible that I could reuse some of that implementation some day.
By the way, having to use all these other systems for a while convinced me once again how badly Glom is needed. They are so unnecessarily low level and complicated, instead of directly helping people to achieve their actual goals.

Playstation 3

September was a pleasantly quiet month, giving me time to do all kinds of paperwork and minor jobs that have been lingering on my to-do list for a while.

It also gave me time to get a Playstation 3 and feel a little less out-of-date. My experiences:

  • I felt incredibly uncoordinated after years of no gaming. It got better, but I still feel like I need to upgrade my nervous system.
  • The Metalstorm off-road car racing game is great fun and looks amazing.
  • Resistance Fall Of Man doesn’t seem like a significant update compared to Doom/Quake/Unreal of years ago. I miss a run button. Single player was the same old monotonous moving forwards, shooting, opening doors, shooting bigger things, moving forwards. Even after finishing the single player mode, I am still helpless in the face of online players. That’s me flailing around wondering who is shooting me.
  • The PS3 can’t find Rhythmbox’s “media server”, though the “UPnP sharing support” plugin should have made this possible. Bastian had the same problem.
  • Rub-A-Dub is a great game. It makes people laugh. It uses the motion detector on the controller.
  • You’re not allowed to register an online name that’s anything like your real name or email address. So everyone has stupid names involving random punctuation and numbers. This is probably to protect children or other unsophisticated users. But online identities aren’t very interesting without a link to real identities. People like to find their real friends, and like to know where their new friends are. Heavy users don’t want to be anonymous. It misses out on a large part of the online community experience. I am Moorai, until Sony figure out that it’s phonetically similar to my real name.
  • When you register an online account (needed to use the Playstation online store), you have to choose your country of residence. Then you can choose your language, but you are forced to choose the German language if you live in Germany. But I don’t want the UI in German. When I lied and said that I lived in the UK then all the prices were in UK pounds instead of Euros. This is annoying. I created a second user so I can use the PS3 in one language and change users when I need to purchase something – I haven’t tested that idea yet.
  • It took me a while to figure out that the PS button in the middle of the controller could be long-pressed to turn off the machine, or pressed to quit a game.
  • The browser is pretty crappy and never zooms to a useful size. It can’t play Apple’s movie trailers or YouTube videos (Update: It can play YouTube, though it’s not smooth). I would have used them lots.
  • The Playstation store has some movie trailers, but just a tiny selection that hasn’t been updated recently. I like movie trailers. Please give me more.
  • The playstation can show images and play music (not Ogg Vorbis though), but you’ll have to get past a bug that I am amazed is not fixed: When you select the memory card or USB Stick, it will show a “no files available” (or similar) message. Only when you click the options (green triangle) and select “show all files” (or similar) will it actually let you browse through your files.
  • The 3D photo slideshow is amazing and useful, particularly when you manage to make the PS3 play music at the same time.
  • Even if the PS3 became a really usable media server/player, TV tuner/PVR, etc with access to internet TV, I’d feel bad about having an always-on device that has a fan, suggesting that it draws a lot of power.

Overall, I’m happy with the PS3. It provides simple distraction, with some extra gimmicks. I feel vaguely part of the proper gaming world again – the one that has lots of buttons and needs to figure out what they do. It’s nice that they will update the software over the internet every now and then.

Horrible Compiz in Ubuntu betas

The October 18th release date for Ubuntu “Gutsy” approaches fast. It currently defaults to using desktop effects (the Compiz window manager instead of Metacity). But compiz is still appalling. In particular, it behaves terribly together with the GNOME Panel, with windows appearing under the panels or over the panels, and sometimes drawing its shadows over the panels while otherwise being in the correct position. In the past I experienced various focus problems, leading, for instance, to unclickable foreground windows. I don’t know whether those focus problems have been fixed – it’s hard to have the patience to test it completely.

Window managers are meant to be irrelevant to users, just doing obvious things so you don’t have to think about them. But Compiz generally makes Ubuntu feel so utterly broken that some average non-technical users may suspect intermittent hardware failure or a malicious virus. I wonder if this is likely to improve before the release.

screenshot_compiz_window_and_shadow_over_panel.png

libgda: iterator-based data models

I finally had a chance to test out Vivien Malerba’s cursor support in libgda, and fixed some problems. It lets you use the “ITER_MODEL_ONLY” parameter to get a GdaDataModel that should be used only via a GdaDataModelIter iterator. That uses the SQL “FETCH” command to get chunks of rows at a time instead of getting all the rows even if you are only interested in a few of them. I added an example of this to libgdamm.

For instance, Glom won’t cause libgda to get all one million records to show you a list of all records if the GtkTreeView only has space to show ten at a time. However, I’m not sure if it will get all the intermediate data when someone moves the scrollbar quickly from row 1 to row 500,000, because of this comment in the PostgreSQL documentation for FETCH. I’d like to avoid hacking on Postgres to fix that.

"ABSOLUTE fetches are not any faster than navigating to the desired row with a relative move: the underlying implementation must traverse all the intermediate rows anyway.”

So far this is only implemented for libgda’s PostgreSQL provider. It would be great if people could implement it for the other providers. The “FETCH” command seems to be fairly standard SQL, so it should be easy.

Some new C++ bindings

We released some extra C++ bindings recently:

gtksourceviewmm-2.0

I updated Dodji’s gtksourceviewmm to wrap the new gtksourceview-2.0 API. Here’s the svn, and the tarball download.

libnotifymm and hildon-notifymm

Johannes Schmid created libnotifymm (svn, tarball) to wrap libnotify, and we also wrapped Maemo’s hildon-notify, though there’s no documentation to say what this does beyond regular libnotify. I suspect that Maemo should just use a port of libnotify without requiring use of special API.

There are lots of examples in the libnotifymm source code. It seems quite simple, and particularly useful for code that uses Gtk::StatusIcon.

GNOME 2.20 Release Notes

GNOME 2.20 is out today. Here are the GNOME 2.20 release notes, showing all the enhancements and new features. It’s always more than we expect.

For GNOME 2.20 I returned to release notes duty after the 2.18 disaster. Now I’ve done 2.6, 2.8, 2.10, 2.12, and 2.20. I couldn’t take another aimless group conversation about why we haven’t achieved anything, just because nobody took the time to show what we have achieved.

It’s a lot of work, involving interrogation, investigation, and pestering, and we have to be very tough about what’s meaningful and relevant. Users don’t understand or care about “improved X” or “reworked Y code base”. Developers should be proud enough of their achievements to actually say what they’ve given to users. Empathy is required.

Jorge Castro wrote some initial text, and Andreas Nilsson took care of the screenshots. But, unfortunately, I don’t see anybody else who’s likely to ensure that it gets done for GNOME 2.22. Only by following a strict schedule, starting early enough, can you hope to have enough time to get all the information, correct mistakes, and be finished in time for translation. Maybe I can persuade Dayvd Madeley to take turns.

We put everything on one page this time, instead of splitting it into sections, without a separate start page, and without a separate press release. That’s because we noticed that people often never clicked through to the release notes or never clicked beyond the introduction page. It was frustrating to read comments about how we should have written about what’s actually changed. Now you have no excuse for not actually seeing the content. Hopefully the server can handle the content.

I am again pleased to see the hard work done by the translators. It’s great to see your text translated into incomprehensible languages such as Thai. Many have even taken the time to create localized versions of the screenshots.

developer.gnome.org clean up

GNOME’s new documentation site, library.gnome.org, is now live and usable. Thanks are due to Frédéric Peters, Goran Rakić (and Google for funding Summer Of Code), and Olav Vitters for getting this done. Bugs and suggestions should be filed in bugzilla: List of open library.gnome.org bugs. Submit a library.gnome.org bug.

So a few days ago I did some cleaning-up of developer.gnome.org. I ditched the awfully outdated stuff, and made sure that we now link to library.gnome.org and live.gnome.org where appropriate. The whole of the API section is redirected to library.gnome.org, thanks to Olav. There is still content there that should be moved into the source code modules that it documents (such as gnome-panel). That can then be hosted by library.gnome.org and removed from developer.gnome.org.

I’m not sure what the plan is for developer.gnome.org. It should probably just be a set of links to the library and the wiki, but that will become clearer as we remove the stuff that shouldn’t be there. Now that we have Shaun’s GNOME platform overview document, I think we don’t need much introductory text anywhere else.