gimp/HACKING

119 lines
4.7 KiB
Plaintext
Raw Normal View History

Requirements
------------
2001-08-28 22:59:42 +08:00
If you want to hack on the GIMP project, it will make your life easier
to have the following packages (or newer versions) installed:
- GNU autoconf 2.13
- GNU automake 1.4
2001-08-28 22:59:42 +08:00
- GNU libtool 1.3.4
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.
- pkg-config 0.7.0 (or a newer version)
Available from http://www.freedesktop.org/software/pkgconfig
Compilation
-----------
1998-02-27 06:19:38 +08:00
If you are accessing gimp via CVS, then you will need to take several
steps to get it to compile. You can do all these steps at once
by running:
cvsroot/gimp# ./autogen.sh
Basically this does the following for you:
cvsroot/gimp# aclocal; automake; autoconf
The above commands create the "configure" script. Now you
can run the configure script in cvsroot/gimp to create all
the Makefiles.
Before running autogen.sh or configure, make sure you have libtool in
2001-09-28 19:46:14 +08:00
your path. Also make sure glib-2.0.m4 glib-gettext.m4 and gtk-2.0.m4
are either installed in the same $prefix/share/aclocal relative to
your automake/aclocal installation or call autogen.sh with
'ACLOCAL_FLAGS="-I $prefix/share/aclocal" ./autogen.sh'.
Note that autogen.sh runs configure for you. If you wish to pass
options like --prefix=/usr to configure you can give those options to
autogen.sh and they will be passed on to configure.
CVS
---
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:
$ export CVSROOT=':pserver:anonymous@anoncvs.gimp.org:/cvs/gnome'
$ cvs login
(there is no password, just hit return)
$ cvs -z3 checkout gtk-doc glib pango atk gtk+ gimp
We will try our best to keep the GIMP CVS tree compileable against
the latest development releases of glib, pango, atk and gtk+. Since
it is sometimes difficult to get a working state out of CVS, you may
prefer to use these releases instead. Get them from
bumped version number to 1.3.1. Require Glib/GTK+-1.3.11 and Pango-0.22. 2001-11-23 Sven Neumann <sven@gimp.org> * configure.in: bumped version number to 1.3.1. Require Glib/GTK+-1.3.11 and Pango-0.22. Removed GDK_DISABLE_COMPAT_H and GTK_DISABLE_COMPAT_H from our default CFLAGS since they don't exist any longer. * RELEASE-TO-CVS.patch: removed since the glib/gtk+ API is supposed to be frozen now. * HACKING: removed reference to RELEASE-TO-CVS.patch * app/gui/menus.c * app/tools/gimptexttool.c: applied RELEASE-TO-CVS.patch to conform to the new GTK+/Pango API. * app/core/Makefile.am: generate marshallers with gimp_marshal prefix. * app/core/gimpmarshal.list: added all marshallers we use. * app/core/gimpmarshal.[ch]: regenerated. * app/[lots of .c files]: use gimp_marshal_* for all marshallers. * data/images/ * app/app_procs.c * app/gui/splash.c: * libgimpbase/Makefile.am * libgimpbase/gimpbase.h * libgimpbase/gimputils.[ch]: removed since they are no longer needed. * app/gimprc.c * plug-ins/common/ps.c * plug-ins/gdyntext/gdyntext.c * plug-ins/gdyntext/gdyntextcompat.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c * plug-ins/script-fu/script-fu-scripts.c: use glib functions instead of gimp_strescape() and gimpstrcompress(). * cleaned up all header files: use G_BEGIN_DECLS/G_END_DECLS, declared all _get_type function as G_GNUC_CONST. * tools/pdbgen/enumcode.pl * tools/pdbgen/lib.pl: make them generate header files using G_BEGIN_DECLS/G_END_DECLS. * pixmaps/Makefile.am * pixmaps/wilber3.xpm: removed ... * data/images/tips_wilber.png: ... and added here as PNG * app/gui/tips-dialog.c: load the Wilber on demand using GdkPixbuf. * data/images/gimp_splash.ppm: removed ... * data/images/gimp_splash.png: ... and added as PNG * app/app_procs.c * app/gui/splash.[ch]: load the splash image using GdkPixbuf. * app/gui/about-dialog.c: sink the GtkPreview.
2001-11-23 07:46:13 +08:00
ftp://ftp.gtk.org/pub/gtk/v1.3/. We don't expect the API of these
modules to change anymore. If it does nevertheless, we will adapt
GIMP in CVS. This means, GIMP from CVS is supposed to compile against
glib, pango, atk and gtk+ from CVS. Most probably however, the latest
releases will do also.
Patches
-------
Please submit patches to the gimp-developer@lists.xcf.berkeley.edu
mailing list. All kinds of contributions are appreciated. Larger patches
should be uploaded to ftp://ftp.gimp.org/incoming/. Follow the rules
there for naming your patches.
Autogenerated Files
-------------------
Please notice that some files in the source are generated from other
sources. 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.
added a note about apptype.h and about not including headers in headers. 2001-02-14 Michael Natterer <mitch@gimp.org> * HACKING: added a note about apptype.h and about not including headers in headers. * app/apptypes.h: added GimpTool and BitmapCursor. * app/cursorutil.h * app/devices.h * app/draw_core.h * app/tools/color_picker.h * app/tools/tool.h * app/tools/tool_options.h * app/gimpcontext.h: removed includes of "tools/tool.h" * app/gimprc.[ch]: indentadion cleanup, added "module_db_load_inhibit". * app/module_db.c: removed the above variable here. * app/gimpdata.[ch]: added a vitrual "duplicate" method. * app/gimpbrush.[ch] * app/gimpbrushgenerated.[ch] * app/gimpbrushpipe.[ch] * app/gimpgradient.[ch] * app/gimppalette.[ch] * app/gimppattern.[ch]: all "load", "new" and "get_standard" functions return a GimpData pointer now. * app/gimpdatafactory.[ch]: made some stuff const. * app/gimpdatafactoryview.c: activate the "duplicate" button and set the initial button sensitivity correctly. * app/brush_select.c * app/gradient_select.c * app/pattern_select.c: use the new GimpDataFactoryView. * libgimp/Makefile.am: grouped the file to sort out what _may_ go to subdirs or separate libs. * libgimp/gimpenv.[ch]: added many "const". * app/app_procs.c * app/brush_edit.c * app/gimpcontext.c * app/gimpdnd.c * app/gradient_editor.c * app/palette.c * app/palette_import.c * app/user_install.c: many related changes. * libgimpmath/gimpmathtypes.h * libgimpmath/gimpvector.[ch]: minor cleanups. * plug-ins/script-fu/script-fu.c: gimp_data_directory() is const now.
2001-02-14 22:57:14 +08:00
Macros and enums are all uppercase, words seperated by underscores.
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.
Try to make use of GLib's object system as much as possible. Do not create
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.
added a note about apptype.h and about not including headers in headers. 2001-02-14 Michael Natterer <mitch@gimp.org> * HACKING: added a note about apptype.h and about not including headers in headers. * app/apptypes.h: added GimpTool and BitmapCursor. * app/cursorutil.h * app/devices.h * app/draw_core.h * app/tools/color_picker.h * app/tools/tool.h * app/tools/tool_options.h * app/gimpcontext.h: removed includes of "tools/tool.h" * app/gimprc.[ch]: indentadion cleanup, added "module_db_load_inhibit". * app/module_db.c: removed the above variable here. * app/gimpdata.[ch]: added a vitrual "duplicate" method. * app/gimpbrush.[ch] * app/gimpbrushgenerated.[ch] * app/gimpbrushpipe.[ch] * app/gimpgradient.[ch] * app/gimppalette.[ch] * app/gimppattern.[ch]: all "load", "new" and "get_standard" functions return a GimpData pointer now. * app/gimpdatafactory.[ch]: made some stuff const. * app/gimpdatafactoryview.c: activate the "duplicate" button and set the initial button sensitivity correctly. * app/brush_select.c * app/gradient_select.c * app/pattern_select.c: use the new GimpDataFactoryView. * libgimp/Makefile.am: grouped the file to sort out what _may_ go to subdirs or separate libs. * libgimp/gimpenv.[ch]: added many "const". * app/app_procs.c * app/brush_edit.c * app/gimpcontext.c * app/gimpdnd.c * app/gradient_editor.c * app/palette.c * app/palette_import.c * app/user_install.c: many related changes. * libgimpmath/gimpmathtypes.h * libgimpmath/gimpvector.[ch]: minor cleanups. * plug-ins/script-fu/script-fu.c: gimp_data_directory() is const now.
2001-02-14 22:57:14 +08:00
Don't include headers in headers except where unavoidable (e.g. for
deriving objects). Opaque typedefs go to app/base/base-types.h,
app/core/core-types.h etc.
added a note about apptype.h and about not including headers in headers. 2001-02-14 Michael Natterer <mitch@gimp.org> * HACKING: added a note about apptype.h and about not including headers in headers. * app/apptypes.h: added GimpTool and BitmapCursor. * app/cursorutil.h * app/devices.h * app/draw_core.h * app/tools/color_picker.h * app/tools/tool.h * app/tools/tool_options.h * app/gimpcontext.h: removed includes of "tools/tool.h" * app/gimprc.[ch]: indentadion cleanup, added "module_db_load_inhibit". * app/module_db.c: removed the above variable here. * app/gimpdata.[ch]: added a vitrual "duplicate" method. * app/gimpbrush.[ch] * app/gimpbrushgenerated.[ch] * app/gimpbrushpipe.[ch] * app/gimpgradient.[ch] * app/gimppalette.[ch] * app/gimppattern.[ch]: all "load", "new" and "get_standard" functions return a GimpData pointer now. * app/gimpdatafactory.[ch]: made some stuff const. * app/gimpdatafactoryview.c: activate the "duplicate" button and set the initial button sensitivity correctly. * app/brush_select.c * app/gradient_select.c * app/pattern_select.c: use the new GimpDataFactoryView. * libgimp/Makefile.am: grouped the file to sort out what _may_ go to subdirs or separate libs. * libgimp/gimpenv.[ch]: added many "const". * app/app_procs.c * app/brush_edit.c * app/gimpcontext.c * app/gimpdnd.c * app/gradient_editor.c * app/palette.c * app/palette_import.c * app/user_install.c: many related changes. * libgimpmath/gimpmathtypes.h * libgimpmath/gimpvector.[ch]: minor cleanups. * plug-ins/script-fu/script-fu.c: gimp_data_directory() is const now.
2001-02-14 22:57:14 +08:00
Don't use the GTK wrappers around the GLib object and signal system.
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.