Gnomesword - Bible study with GNOME

Hacking GnomeSword

This document will hopefully give you a little overview of what you need to start hacking GnomeSword and how the code is laid out. It is not an introduction how to use your shell or compiler.

Tools

You need development tools like the C and C++ compiler, make, autoconf, automake and of course all the header files for the libraries required by GnomeSword. If you run into any trouble, your system likely misses some of the required tools or header files. Make sure to have a complete installtion for development. Most distributions split Gnome into packages for the normal user and packages for development, mostly recognizable with a package name ending with -devel.

Source code

If you just want to take a look at the source code, download it from the GnomeSword SourceForge page.

There you will find the latest source for the latest offical release. If you have time and want to contribute to the development, you should consider using SVN.

Retrieving source code from SVN

One-stop retrieval of the GnomeSword tree:

 svn co https://gnomesword.svn.sourceforge.net/svnroot/gnomesword/branches/development gnomesword 

Get general information on SVN usage on your system with

    man svn

or

    info svn

First make run

If you retrieved your source from SVN, you should first do...

    ./autogen.sh

...in the toplevel directory of the source directory. If you retrieved the source from the homepage, untar it...

    tar -xzf gnomesword-x.xx.tar.gz

...and enter the toplevel directory of the source

    cd gnomesword-X.Y

From this point on, whether if you use SVN or a tar file, there comes the widely known configure and make process

    ./configure
    make

If you now want to install GnomeSword, you may have to become root...

    su

...which asks you for the root password. After that do...

    make install

...to let GnomeSword install under /usr/local. Compile while not running as the root user, as you can screw up your whole system if something goes wrong. Use a normal user account.

If you do not have root right on your system, you can configure GnomeSword with another prefix. For example, your home directory is /home/user. Type...

    ./configure --prefix=/home/user

...and GnomeSword can be installed in your home directory after the make process.

Hacking the code

The choice of editor or IDE you is up to you. Please read Coding Conventions to understand indention and formating choices.

GnomeSword is seperated into three parts:

Main is the glue between backend and gui and contains all the code that does not belong to backend or gui.

The backend is strictly for communicating with the sword library. It should not contain anything else.

The gui is, speaking for itself, just for the gui. The aim is, to keep all gui relevant code out of main and backend, to make it possible to switch between different guis.

The gui is split into the gui header files in the gui directoy which only provides the exported functions for inclusion, plus the gui C files in the gnome2 directory.