Ipelib
The Ipe library documentation

The Ipe library ("Ipelib") provides the geometric primitives and implements all the geometric objects that appear in Ipe. Many tasks related to modifying an Ipe document are actually performed by Ipelib. For instance, the ipetoipe program consists of only a few calls to Ipelib.

Ipelib can easily be used by C++ programs to read, write, and modify Ipe documents. Compiling Ipelib is easy, it requires only the standard C++ library (including the STL), and the zlib compression library. Nearly all symbols in Ipelib are in the ipe namespace, those that aren't start with the letters "Ipe".

Before using Ipelib in your own program, make sure to initialize the library by calling ipe::Platform::initLib().

Many of the Ipelib classes are also made available as Lua objects. Lua bindings for Ipelib describes these bindings. The Ipe program itself is mostly written in Lua and uses these Lua bindings.

Ipe uses UTF-8 for all text strings, including filenames passed to Ipelib and all Lua strings.

The manual explains how to write Ipe scripts and ipelets (extensions to Ipe) in Lua. Ipelets can also be written in C++ (using a small Lua wrapper to describe the ipelet). C++ ipelets have to be linked with Ipelib to access and modify Ipe objects.

The classes documented here are implemented in five different libraries:

  • libipe is the core Ipelib library. It implements geometric primitives, Ipe objects, and the Ipe document. However, it doesn't know anything about drawing to the screen or about the Lua bindings.
  • libipecairo implements the Ipe cairo module. It provides drawing of Ipe objects using the Cairo library.
  • libipelua implements the Lua bindings for Ipelib. If installed properly, it can be loaded dynamically from Lua using require. It is also used by ipescript.
  • libipecanvas implements the Ipe canvas module. It provides a widget for displaying and editing Ipe objects.
  • libipeui implements the Lua bindings for user interfaces. This library does not depend on any other Ipe component, and can be used for other Lua projects.

Here is an annotated list of the modules:

For quick access, the Lua bindings for Ipelib:

The Lua bindings for ipeui (dialogs, menus, etc.), and for Ipe itself (available in ipelets, but not in Ipe scripts):