Ipelib
Classes | Public Member Functions | Static Public Member Functions | List of all members
ipe::Page Class Reference

#include <ipepage.h>

Classes

struct  SLayer
struct  SObject
struct  SView

Public Member Functions

 Page ()
void saveAsXml (Stream &stream) const
void saveAsIpePage (Stream &stream) const
void saveSelection (Stream &stream) const
int countLayers () const
String layer (int index) const
bool isLocked (int i) const
bool hasSnapping (int i) const
void setLocked (int i, bool flag)
void setSnapping (int i, bool flag)
void moveLayer (int index, int newIndex)
int findLayer (String name) const
void addLayer (String name)
void addLayer ()
void removeLayer (String name)
void renameLayer (String oldName, String newName)
int countViews () const
int countMarkedViews () const
Attribute effect (int index) const
void setEffect (int index, Attribute sym)
String active (int index) const
void setActive (int index, String name)
bool markedView (int index) const
void setMarkedView (int index, bool marked)
void insertView (int i, String active)
void removeView (int i)
void clearViews ()
bool visible (int view, int layer) const
bool objectVisible (int view, int objno) const
void setVisible (int view, String layer, bool vis)
Rect textBox (const Cascade *sheet) const
String title () const
void setTitle (String title)
String section (int level) const
void setSection (int level, bool useTitle, String name)
bool sectionUsesTitle (int level) const
const TexttitleText () const
void applyTitleStyle (const Cascade *sheet)
bool marked () const
void setMarked (bool marked)
String notes () const
void setNotes (String notes)
int count () const
Objectobject (int i)
const Objectobject (int i) const
TSelect select (int i) const
int layerOf (int i) const
void setSelect (int i, TSelect sel)
void setLayerOf (int i, int layer)
Rect pageBBox (const Cascade *sheet) const
Rect viewBBox (const Cascade *sheet, int view) const
Rect bbox (int i) const
void transform (int i, const Matrix &m)
double distance (int i, const Vector &v, double bound) const
void snapVtx (int i, const Vector &mouse, Vector &pos, double &bound) const
void snapBnd (int i, const Vector &mouse, Vector &pos, double &bound) const
void invalidateBBox (int i) const
void insert (int i, TSelect sel, int layer, Object *obj)
void append (TSelect sel, int layer, Object *obj)
void remove (int i)
void replace (int i, Object *obj)
bool setAttribute (int i, Property prop, Attribute value, Attribute stroke, Attribute fill)
int primarySelection () const
bool hasSelection () const
void deselectAll ()
void ensurePrimarySelection ()

Static Public Member Functions

static Pagebasic ()

Detailed Description

An Ipe document page.

Its main ingredients are a sequence of Objects (with selection state, layer, and a cached bounding box), a set of Layers, and a sequence of Views.

Each object on a Page belongs to one of the layers of the page. Layers are orthogonal to the back-to-front ordering of objects (in particular, they are not "layered" - the word is a misnomer). The "layer" is really just another attribute of the object.

A Page is presented in a number of views. Each view presents some of the layers of the page. In addition, each view has an active layer (where objects are added when this view is shown in the UI), and possibly a transition effect (Acrobat Reader eye candy).

A Page can be copied and assigned. The operation takes time linear in the number of top-level object on the page.

Constructor & Destructor Documentation

Page::Page ( )
explicit

The default constructor creates a new empty page.

This page still needs a layer and a view to be usable!

Member Function Documentation

Page * Page::basic ( )
static

Create a new empty page with standard settings.

This is an empty page with layer 'alpha' and a single view.

void Page::saveAsXml ( Stream stream) const

save page in XML format.

void Page::saveAsIpePage ( Stream stream) const

Copy whole page with bitmaps as <ipepage> into the stream.

void Page::saveSelection ( Stream stream) const

Copy selected objects as <ipeselection> into the stream.

int ipe::Page::countLayers ( ) const
inline

Return number of layers.

String ipe::Page::layer ( int  index) const
inline

Return name of layer index.

bool ipe::Page::isLocked (