Google Summer of Code Update 0
As you’ve probably seen around the site by now, I am participating in this year’s Google Summer of Code program. For a lot more detailed information on my project look here. I should have been posting periodic updates since I started the project, but since I just got around to working on the website the other day, I haven’t. I guess I’ll do one post now that gives some idea of what I’ve done for the last month.
In the Beginning
After hearing I was accepted, the first thing I did was get on the #gnumeric IRC channel where I met both my mentor, Morten Welinder, and Jody Goldberg, the lead maintainer of Gnumeric, for the first time. They told me to get setup to build gnumeric and goffice from source. At that point I figured that would be an easy task. I was wrong. Finding, downloading, and installing all of the dependencies was a much bigger deal than I expected. I think it took me 1 or 2 days to get things to compile. Then, just when I thought I was safe, gnumeric wouldn’t run. The error was with the libspreadsheet-1.9.0.so shared library. After a bit of searching, I realized I had the file, it just wasn’t in the correct directory. So, I made a symbolic link from the file to where it was supposed to be. Then gnumeric worked beautifully.
First Iteration
In the first week of June, I talked to Jody both on IRC and on the phone about how the project should proceed. The main idea is to store the details of every command executed to a log file. Later, this log file can be imported and the stored commands can be re-executed. It’s somewhat similar to macros on a basic level.
The first step was to set up the export functions for some commands. Most of the code of interest is in gnumeric/src/commands.c which is where commands are added to the undo and redo lists. This is also where GnmCommand and GnmCommandClass are defined, both of which help to store command data when it is being processed. I started out by creating two new files (command-io.h and command-io.c) so that I could try to keep my code from getting hidden in commands.c. When I attempted to recompile gnumeric, I had problems because these new files weren’t being linked. After a bit of searching, I found out where to add references to the files in src/Makefile.am so that they would be linked when compiling.
A few other notes from the first iteration of coding:
- Adding a simple UI was surprisingly simple. It might be more difficult when adding a dialog, but adding some basic items to the Tools menu only required updating 3 or 4 files.
- I found it necessary to add a change_tracker struct to the _Workbook struct defined in workbook-priv.h so that I could keep track of the current xml output file and whether or not ‘change tracking’ was enabled
- It took a while to figure out how to write to an xml file using libgsf, but after looking at xml-sax-write.c and playing around with it, I got things working.
- I was really happy when I found the GLib Reference Manual. You have no idea how much easier that makes understanding and writing code that utilizes GLib.
On June 17th, I submitted my first patch to the Gnumeric mailing list (link). And by first patch I mean I have never submitted a patch for anything ever. It was a lot scarier than I expected–making code public is a humbling experience. Luckily the response I got was positive, and gave me a lot of things to work on. If you would like to download the patch it is available here.
Stay tuned for more updates.