Prev Up Next
The Design of Sketch Developer's Guide Coordinate Systems

General Remarks

Directory Structure

The source is divided into the core sources, containing the basic graphics classes, the UI code and some utility modules. Import filters and other plugins are maintained outside of this core source. Other external packages provide direct access to Xlib functions and objects (Pax) and stream filter objects (Filter).

sketch-<version>/

The top level directory holds the main scripts sketch.py and sk2ps.py

Sketch/

The top-level directory for the core sources. This works as a Python package which export many of the commonly needed support and graphics objects (classes, functions, constants etc.).

Ideally, the Sketch package should export every thing a `normal' plugin may need. This is not yet the case, as some interfaces are not very stable yet and may need to be redesigned. Once they have reached a certain level of stability, they will be moved into Sketch.

Base/

Contains the most fundamental modules such as the modules for file IO, undo/redo, the plugin manager and code for user preferences.

Modules/

The C-Modules.

The modules in Base/ and Modules/ are accessible as Sketch.modulename. These directories are not currently subpackages.

Graphics/

The subpackage for the graphics modules.

It contains all of the builtin graphics classes: primitives, compound objects, special effects (blend/mask/...), the document object, ...

It also holds the graphics devices for drawing into the window or PostScript file.

The Graphics modules are accesible as Sketch.Graphics.modulename. Many of the objects defined in Graphics modules are exported directly by the Sketch module.

UI/

The subpackage for user interface related code.

Contains the user interface code including the application object.

Lib/

A subpackage for some support modules that are not really Sketch specific, such as a Type 1 font interpreter (simply extracts the outline information) and a simple parser for PostScript files adhering to the DSC.

Pixmaps/

Pixmap files used by Sketch.

Plugins/

The subdirectories contain the various plugins:

Filters/

Contains the import filters and export filters for SK-files and other formats.

Objects/

Plugin objects.

Resources/

The subdirectories contain platform/UI independent resources:

Fontmetrics/

Fontmetrics (*.afm) for standard PostScript fonts and `font directory file