Hacking The Gnome Desktop
04/05/2012 § Leave a comment
I hack for fun, personal growth, and profit. Right now I do a lot of it for personal growth, and I believe that’s important. There’s always something to learn. I also think there’s lots of room for more native Gnome apps and I really want to contribute to the stable.
My personal development cycle goes like this; I get idea or I identify a personal need and start some prototyping. I first change my ‘Currently Hacking:’ banner on my web page with a simple bourne shell script I threw together, which serves to remind me what my goal is (I need that from time to time) and then I shell out to my development area in my home directory and run another script I wrote that creates a subdir with the name of the project, creates a subdir under that named ‘src’, touches main.cc in that, and the files that autoconf will want (“README” and so forth) in the top level dir. I then run Anjuta and import that new project. I then fire up a movie, usually a Samurai film (I’m currently watching NHK’s 47 part taiga drama Aoi Tokugawa Sandai) in a window.
This works well and I like it. I also like being able to work on something without issues, if there are any issues I really like to believe that the issues are mine and not because of any code down the chain that are out of my control. If the problem is ability I can fix that.
To teach myself Gnome programming I started working on a Gnome-native version of a windows application I like very much, Breakpoint Software’s Hex Workshop. Its a great app and I use it a lot. Even though it runs perfectly well under Wine I thought a native version for Linux was a good idea, and something I could get a lot of use out of, I would use it much more under Linux that Windows. I know there are a number of hex editors for Linux, GHex is the prime Gnome app in this space, but like I said I wanted to learn Gnome application development. Plus most of the other offerings are console apps.
I actually started ‘Hex Tool’ (for lack of another name, and I’m not licensing anything from BP) back in 2008 and got as far as laying down the main frame, menus, and views, including the main window and the two sub windows below that, and I had the toggle action working and everything. All three views can be toggled on or off, and the drag bars wrote their positions to a GConf client I had added, and I had even included a class that pulled the writable mounted file systems to a dialog, so the user could select a file system to edit, not just a file. It was to be a full-featured copy of Hes Workshop. I was really proud of that code.
I kept it in the repository that was associated with google code search, thinking it would be safe there for all eternity. Well, if you’re up on the news, you know that isn’t true. After the media spilled the beans on google’s shuttering of many of its free services I, after a year of not looking at the code frantically searched for it. Did I call it ‘hex tool’, ‘htool’, I couldn’t remember. Neither turned up a result. All that work is gone. Hours of work. Literally.
I thought ‘unfortunate, but ok’, I really needed to rewrite the thing using Glade anyway. I had placed and positioned all the menus and widgets in the GUI using the APIs and although I didn’t find it that incredibly tedious while I was prototyping, now that I have a better handle on what I needed to do I think I want to use it for this. Ok, so lets get to writing a gnome app.
Unfortunately, as I’ve commented before, GTKMM development seems to be on a minor hold. I say minor, but it really is a show stopper for application development. Application.h has been yanked from the current stable build, which includes application.cc, really the entire Application Class has been pulled from the kit, nothing else (that I can see). And here’s the weird part; not only is it missing from GTKMM 3.0, it seems to be missing from previous releases as well. I d/l’d a 2.4 tarball of GTKMM (which is actually 2.6 internally? I can’t keep their verisioning system strait) last night and its simply not there. That means many of the examples won’t build.
I’ve commented on it before, I know, and their are obviously ways around it (read on for how I know that). But since I’m learning, its difficult to know exactly what the solution is. I did an experiment last night to see where I could go and what I could do with what I have. GTK+ applications are fine, this is a GTKMM issue. Unfortunately (again), I’m not really interested in C development (GTK+ is the Gnome Tool Kit, C only.) I could, after a considerable investment in time, write a wrapper or some way around the issue, perhaps writing my own application class, I could write my own C++ framework around GTK+, but seriously? That would effectively be writing a competitor to GTKMM, and I really have no hope of doing that. I lack the talent, time, and energy to make a serious attempt. I would miss the nuances of writing such a thing for GTK+, it would really be a huge waste of time. And I want to write an application, not a tool kit.
I noticed Bakery is still in the repositories, so I did a little experiment to see if it still functioned. Bakery is a MVC implementation using GTKMM by the same team that wrote GTKMM, but they stopped development on it in 2009. The best excuse I could get from here and there is that it was redundant. I’m paraphrasing, I’m not exactly sure if that’s the reason, but it is a reasonable excuse IF one can find the better kit. I can’t. So I dunno. Its still in the repos, so there’s probably stuff out there that use it. So I installed it. All the examples run. I did a quick dependency check, no dependencies on application.h. Hmm… should I? Dare I use bakery? It would solve a few issues, I wouldn’t have to create my own MVC framework, I could just use that… in the end I decided against it, it will be pulled from the repositories some day soon, leaving my poor little app to suck dirt. And I think its best to stay on the cuve as much as possible.
I could use Qt, or KDE, but call me a glutton for punishment, there’s just something about GTKMM I really agree with, I enjoy developing with it.
THE FINAL SOLUTION: Application.h HAS been put back in the latest stable build, which is 3.3. I know, because as a last resort and after reading more commit notices from the team. I could find no human-intelligible explanation, just release numbers and yes, its in there, and so on. Well, I’m running GTKMM 3.0, would a build-level, incremental point upgrade kill me? It has in the past, I’ve tried this before and it resulted in a broken desktop. But actually some builds and some forced package installs. This time I don’t think I need to go that far, I just need to build the latest stable GIOMM, GLIBMM, and then GTKMM. I’m going to try it.
Wish me luck.