Hacking Xiphos
This document will hopefully give you a little overview of what you need to start hacking Xiphos 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 Xiphos. If you run into any trouble, your system likely misses some of the required tools or header files. Make sure to have a complete installation 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 Xiphos SourceForge page.
There you will find the latest source for the latest official 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 Xiphos tree, for the current release:
svn co https://gnomesword.svn.sourceforge.net/svnroot/gnomesword/trunk
Get general information on SVN usage on your system with
svn help
First make run
If you retrieved your source from SVN, you should first do...
./autogen.sh
...in the top-level directory of the source directory. Include the option "--prefix=/usr" if you intend to install it normally, rather than in /usr/local. If you retrieved the source from the homepage, untar it...
tar -xzf xiphos-X.Y.tar.gz
...and enter the top-level directory of the source
cd xiphos-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 Xiphos, you may have to become root...
su
...which asks you for the root password. After that do...
make install
...to let Xiphos 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 Xiphos with another prefix. For example, your home directory is /home/user. Type...
./configure --prefix=/home/user
...and Xiphos 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 formatting choices.
Xiphos is separated into three parts:
- main
- backend
- gui
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.
