HACKING 4.06 KB
Newer Older
1 2
Requirements
------------
Manish Singh's avatar
Manish Singh committed
3 4 5
If you want to hack on the GIMP project, it will make you life easier
to have the following packages installed:

Manish Singh's avatar
updated  
Manish Singh committed
6 7 8
	- GNU autoconf 2.13
	- GNU automake 1.4
	- GNU libtool 1.2d
9
	- GNU gettext 10.38
Manish Singh's avatar
updated  
Manish Singh committed
10 11
		Available in ftp://alpha.gnu.org/gnu

Manish Singh's avatar
Manish Singh committed
12 13 14
These should be available by ftp from prep.ai.mit.edu or any of the
fine GNU mirrors.  Beta software can be found at alpha.gnu.org.

15 16 17
	- pkg-config 0.7.0 or better
		Available from http://www.freedesktop.org/software/pkgconfig

18 19 20

Compilation
-----------
Sven Neumann's avatar
Sven Neumann committed
21
If you are accessing gimp via CVS, then you will need to take several
22 23
steps to get it to compile.  You can do all these steps at once
by running:
Manish Singh's avatar
Manish Singh committed
24

25
        cvsroot/gimp# ./autogen.sh
Manish Singh's avatar
Manish Singh committed
26

27
Basically this does the following for you:
Manish Singh's avatar
Manish Singh committed
28

29 30 31
        cvsroot/gimp# aclocal; automake; autoconf

        The above commands create the "configure" script.  Now you
32
        can run the configure script in cvsroot/gimp to create all
33 34
        the Makefiles.

35 36
Before running autogen.sh or configure, make sure you have libtool in
your path. Also make sure gtk-2.0.m4 is in the same --prefix relative
37 38 39
to your automake installation.

Note that autogen.sh runs configure for you.  If you wish to pass
40 41
options like --prefix=/usr to configure you can give those options to
autogen.sh and they will be passed on to configure.
42

43 44 45

CVS
---
46 47 48
If at all possible, please use CVS to get the latest development
version of gimp, as well as the CVS version of gtk-doc, glib, pango,
atk and gtk+.  You can do the following to get them all from cvs:
49

50
   $ export CVSROOT=':pserver:anonymous@anoncvs.gimp.org:/cvs/gnome'
51 52
   $ cvs login
     (there is no password, just hit return)
53
   $ cvs -z3 checkout gtk-doc glib pango atk gtk+ gimp
54

55 56 57

Patches
-------
58
Please submit patches to the gimp-developer@lists.xcf.berkeley.edu mailing
59 60 61
list.  All kinds of contributions are accepted.  Patches that you wish to go
into the distribution should also be uploaded to ftp://ftp.gimp.org/incoming.
Follow the rules there for naming your patches.
Manish Singh's avatar
Manish Singh committed
62

63 64 65

Autogenerated Files
-------------------
66
Please notice that some files in the source are generated from other sources. 
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
All those files have a short notice about being autogenerated somewhere at 
the top. Among them are the files ending in _pdb.[ch] in the libgimp 
directory and the files ending in _cmds.c in the app/pdb subdirectory. Those 
are generated from the respective .pdb files in tools/pdbgen/pdb. The list of
contributors is used in several files which are for that reason generated 
from the file contributors in tools/authorsgen.


Hackordnung
-----------
We encourage you to follow the GIMP coding style throughout the GIMP project. 
For the core components (application and libs) this coding style is enforced. 
The GIMP coding style is defined as follows:

  Function names are lowercase, words separated by underscores.
82
  Macros and enums are all uppercase, words seperated by underscores.
83 84 85 86 87 88 89 90 91 92 93 94 95
  Types are all words capitalized, no separators between words.

  All functions in header files need to be prototyped.

  Indentation rules are GNU coding style, in particular:
    - 2 characters indentation level
    - Do not use tabs (of course your editor can use tabs, but it 
      should write them to file as 8 spaces each).
    - Opening brackets are on a new line and indented one level.
    - Function header have the return type on one line, the name starting
      in the first column of the following line. All parameters are 
      prototyped and there's a new line for each.

96
Try to make use of GLib's object system as much as possible. Do not create 
97 98 99
wrappers around functions of parent classes. If you end up duplicating code, 
try to create a common parent class and implement the common methods there.

100 101 102
Don't include headers in headers except where unavoidable (e.g. for
deriving objects). Opaque typedefs go to app/apptypes.h

103 104
Don't use the GTK wrappers around the GLib object and signal system.

105 106 107
One goal of the 1.3 development branch is to make the GIMP code more readable
and understandable. Please help us to achieve this goal by cleaning up the
present code and make sure that all new code follows the coding guidelines.