Hacking:Source Tree

From GIMP Developer Wiki
Revision as of 15:51, 16 August 2010 by LightningIsMyName (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page describes how the GIMP source is organized - it will describe what's inside each directory of GIMP, and should help you navigate your way through the source.

The app directory

The app directory contains the source code of GIMP itself, without any external tools or plugins. The only exception for that is the testing framework of GIMP which is also included here.

app/actions

app/base

app/composite

app/config

app/core

This folder is truly the guts of GIMP. It contains most of the objects that GIMP deals with - guides, brushes, drawables, images,... If you want to do something to the way objects in GIMP behave or if you want to implement a new type of objects (for example, angular guides, vector layers, ...) this is the first place you'd want to look at. Note that almost every change in this directory requires changes in other places - for example, if I want to implement a new type of layers (let's say vector layers) then you would also need to update the layers tree widget (and not to mention many other things). "Massive" hacks that are not just for implementing one tool or another, but to change/add new objects to GIMP will start here, and will affect many other parts of GIMP so be prepared for lots of work when changing things in here.

app/dialogs

The code of all GIMP's dialogs, is inside this directory. Any dialog including simple ones (like renaming a layer) and the most complex ones (Like the preferences dialog) can be found in this directory.

Dialogs should not be confused with dockable areas:

  • Dialogs are things which open in response to a specific action. These are not dockable, meaning that they will always be in a floating window of their own
  • Dockables (or Docks in short) are parts of the user interface which can be open all of the time and don't have to be available only as a result of a specific action. Dockables can either "float around" like dialogs, or you can drag and drop them to other docks, in order to organize them together in a single window (You "dock" one dockable inside the other).

Examples:

  • Editing a layer's name is done inside a dialog since it's a response to a request to edit the name of a specific layer
  • The brushes dialog is a dockable since it makes sense to have it open all the time

The definition of what should be a dock and what should be a dialog is sometimes unclear. But by taking a brief look inside this directory, it's usually very easy to find from the file names if what you are looking for is a dialog or not.

app/display

This directory contains the code of the image display. This includes the image projection (i.e. the process of combining the data from all the layers, channels, etc. to an image which can be displayed on screen), the and various functions to draw on the canvas itself (these functions are used to draw guides, grids, and the controls of some tools). Note that although the functions for drawing on the canvas are all located here, the actual code who calls these functions (for example, the code of the rectangle tool which calls these function to draw lines on the canvas) is often located somewhere else

app/file

app/gegl

app/gui

app/menus

app/paint

app/paint-funcs

app/pdb

app/tests

app/text

app/tools

app/vectors

app/widgets

app/xcf

|-- autom4te.cache |-- cursors | `-- xbm |-- data | |-- brushes | |-- dynamics | |-- environ | |-- gradients | |-- images | |-- interpreters | |-- palettes | |-- patterns | |-- tags | `-- tips |-- desktop | |-- 16x16 | |-- 22x22 | |-- 24x24 | |-- 256x256 | |-- 32x32 | |-- 48x48 | |-- 64x64 | `-- src |-- devel-docs | |-- app | |-- libgimp | | |-- html | | |-- tmpl | | `-- xml | |-- libgimpbase | | |-- html | | |-- tmpl | | `-- xml | |-- libgimpcolor | | |-- html | | |-- tmpl | | `-- xml | |-- libgimpconfig | | |-- html | | |-- tmpl | | `-- xml | |-- libgimpmath | | |-- html | | |-- tmpl | | `-- xml | |-- libgimpmodule | | |-- html | | |-- tmpl | | `-- xml | |-- libgimpthumb | | |-- html | | |-- tmpl | | `-- xml | |-- libgimpwidgets | | |-- html | | |-- images | | |-- tmpl | | `-- xml | `-- tools |-- docs |-- etc |-- libgimp |-- libgimpbase |-- libgimpcolor |-- libgimpconfig |-- libgimpmath |-- libgimpmodule |-- libgimpthumb |-- libgimpwidgets |-- m4macros |-- menus |-- modules |-- plug-ins | |-- color-rotate | | `-- images | |-- common | |-- file-bmp | |-- file-faxg3 | |-- file-fits | |-- file-fli | |-- file-ico | |-- file-jpeg | |-- file-psd | |-- file-sgi | |-- file-uri | |-- file-xjt | |-- flame | |-- fractal-explorer | | `-- examples | |-- gfig | | |-- gfig-examples | | `-- images | |-- gimpressionist | | |-- Brushes | | |-- Paper | | `-- Presets | |-- gradient-flare | | `-- flares | |-- help | |-- help-browser | |-- ifs-compose | |-- imagemap | | `-- images | |-- lighting | | `-- images | |-- map-object | |-- maze | |-- metadata | |-- pagecurl | |-- print | |-- pygimp | | |-- doc | | `-- plug-ins | |-- script-fu | | |-- ftx | | |-- scripts | | `-- tinyscheme | |-- selection-to-path | |-- twain | |-- ui | `-- win-snap |-- po |-- po-libgimp |-- po-plug-ins |-- po-python |-- po-script-fu |-- po-tags |-- po-tips |-- themes | |-- Default | | `-- images | `-- Small `-- tools

   `-- pdbgen
       `-- pdb