01 September, 2010

Moving on to gtkmm

I have spent the last weeks trying to improve some parts of GHangtux. One of the improvements (the more obvious and complicated one), came with the code restructuring.

BEFORE, all the code was divided in three different files:
- main.c: all code for the program except for the keyboard widget.
- keyboard.c/.h: keyboard widget code.

This structure made the code easy to read at the very beginning, but was obviously a bad idea for the long term. Actually, you should always divide your program in small modules although you think is going to be a very tiny one. It might be now, but who knows what is going to happen in the future. Also, you help to make this code reusable for other programs or programmers. So, mental note: always use modular code from the beginning!.

NOW, the code is divided in ten different files:
- ghangtux.c/.h: main program and definition of main structures.
- ghangtux_ui.c/.h: user interface.
- ghangtux_management.c/.h: functions for game management.
- ghangtux_utils.c/.h: auxiliary functions.
- ghangtux_keyboard.c/.h: keyboard widget.

After all the new code structure was ready, I decided to set up GTK-Doc to document GHangtux in a proper way (still need to finish commenting the functions), which brought me to the eternal discussion "recursive or non recursive Makefiles?". GTK-Doc documentation gave me the impression that I HAD to use recursive make with no explanation and no other chance. After some research and discussing about it with Dave, we found the way to do it "my way", that means: non recursive. You can read Peter Miller's excellent paper to learn why recursive make invocations are both slow and error-prone.

Happy with the results so far, I moved on to "convert GHangtux" to gtkmm, so now I am busy reading "Accelerated C++" and "Effective C++". Let's wait for the magic to happen soon ;).

Take care!

18 August, 2010

I was at GUADEC 2010

This year was my first time at GUADEC, and it was just great. I have got to chat to people involved in the GNOME shell, usability and accessibility programs and got in touch with the members of the "Gnome Women"  group as well. But not everything was chatting and socializing. I attended several interesting talks as well: clutter, state of union, GNOME shell... and joined a very handy workshop about "Design thinking" by the hand of the Invented Here guys. Pheeww, I am still trying to process all the new information!.

Back to chatting and socializing, more fun came at the evenings with the Canonical Party (first GUADEC where people danced I have heard), Collabora barbecue and the hackfest at Revelation Space.

Big news during GUADEC?
-  The release of GNOME 3.0 have been pushed back to March 2011, but at the same time, The GNOME Project will ship GNOME 2.32 in September, along with a preview release of GNOME 3.0. Several distributions will ship GNOME 3.0 components that can be used for user previews or developer testing. 
- An announcement was also made about the location for GUADEC 2011. Applause for Berlin this time!.

This year the Openismus crewed surprised all attendants with our new "Sommer/Autumn 2010 T-shirts collection". All thanks Kat.

I know..., envy is the word you are looking for ;). Hopefully I get the chance to go to GUADEC again next year.

23 July, 2010

GHangtux 1.0

Wondering, what I have been doing the last few weeks?. GTK+ is the answer, GHangtux 1.0 the result, and since we all know that a picture is worth a thousand words I go just straight to the introductions: "World, this is GHangtux, GHangtux this is the world".


What is GHangtux?
GHangtux is a free program variation of the popular Hangman game. It has been designed for people of all ages and has a simple, easy-to-use interface.

It provides a keyboard and a sentence/word to guess, whose theme, the player is able to select. Current themes are: films, objects and persons.

During the game, a graphic sequence of tux images will be displayed, indicating the player how many attempts he/she has left. 

How to "create life" from some code lines?
1. Getting familiar with GTK+. As I wrote in the last post, I spent my first weeks at Openismus learning GTK+ and to put this into practice, I worked in a very small but helpful project. "Foundations of GTK+ Development" was very useful in this learning process and gave me a good base.

2. Making and correcting mistakes. The next step was to learn about all those mistakes I made, to repeat them and to relearn from them again. This is part of every single step actually.

3. Testing the new knowledge. After the first two steps, it seemed that I was prepare to start my first simple GTK+ application which is the very early version of the game.

4. Creating a custom widget. After playing with GTK+ a few more weeks, I decided to create my own custom widget: the game's keyboard. For this step, I found Davyd Madeley's clock widget tutorial quite handy.

5. Integration of the custom widget in the early version of GHangtux. This is the last version of the game. 

What is coming next?
- Internationalization with i18n.
- More themes.
- More image themes.
- Shortcuts for the menus. 
- Others: clutter, desktop files...

"Side effects" of having developed GHangtux?
- Learning Git and discovering how powerful this tool is.
- Learning Autotools helped by Alexandre Duret-Lutz's tutorial, and some    Openismus manuals.
- Practicing C.
- Practicing Glade.
- Programming style.
- Improving my communication skills.

You can follow the project under the repository in GitHub or download it in .tgz or .zip.  All comments are welcome, as are merge requests.

Enjoy!

14 June, 2010

First weeks at Openismus

Yay! Almost one month since the last time I wrote. I need to improve this :). There is a convincing excuse though. Since I started my job at Openismus, another evening full-time job came out: the search of my new apartment!. It seemed to be an easy task at the beginning, but now it just turned into a complicated competition. I have just realized that writing in your presentation e-mail that you have something to do with informatics may probably be not that popular. Being non-smoker seems to be another problem too.

At last, things at work could not be better. During the first week we dedicated our time to install Fedora 13 in our computers. Apart from some issues with our keyboards concerning to the language layouts, everything went fine. We learnt to know as well, how the "internal communication system" here works and joined some lists to be up to date with all project's news. Then we started with jhbuild!. That was definitive lots of fun: is there anybody that run it without having to fix at last 2000 errors? ;). Thanks God or whoever, Chris, David and Saint Google were there for support. We actually learnt a lot.

The second week started really good since we finished fixing the jhbuild's errors, and moved on to GTK+. I was busy with this till Thursday. On Friday and Saturday we went to the Linux Tag here in Berlin and attended a series of interesting talks about MeeGo, systemd, Google, Ubuntu and Gnome 3.0. The talks were interesting, but more business-orientated in general from my point of view. However, the best part of this kind of events are the "after-talk-times", where you get to know some people involved on different open source projects or people that work / worked in the same company you do and still did not know. Better chances of socialization came in the evenings with the barbecues at C-Base!.

Well, now it is time I stop writing here and go on learning some GTK+, since I have to present some legible code today.

See you soon!