papyrus logo

Papyrus::Renderable Class Reference

Papyrus::Renderable is a common base for all classes capable of rendering themselves into a cairomm context. More...

#include <renderable.h>

Inheritance diagram for Papyrus::Renderable:
Inheritance graph
[legend]

List of all members.

Public Types

typedef PapyrusPointer
< Renderable
pointer

Public Member Functions

virtual ~Renderable ()
virtual void render (Context &cairo) const =0
virtual void render (Context &cairo, double x, double y, double w, double h) const
void render (Cairo::RefPtr< Cairo::Context > cairo) const
void render (Cairo::RefPtr< Cairo::Context > cairo, double x, double y, double w, double h) const
virtual Glib::ustring svg (unsigned depth=0)
 Returns an SVG representation of the Renderable.
 PAPYRUS_CLASS_NAME ("Renderable")

Protected Member Functions

 Renderable (const Glib::ustring &id)
Glib::ustring svg_spacing (unsigned depth)
Glib::ustring svg_id ()

Detailed Description

Papyrus::Renderable is a common base for all classes capable of rendering themselves into a cairomm context.

Renderable provides the pure virtual render() method, which takes a cairomm context as its only parameter. Descendants of Papyrus::Renderable provide their own implementations of render() that allow them to be rendered into the supplied cairomm context.

The render() method makes it possible to render a hierarchy (or hierarchies) of Renderables into a cairomm context employing a visitor pattern.

Inheriting from Papyrus::Renderable

When:

Inherit from Papyrus::Renderable when you want your object to be capable of being rendered into a cairo context through a common interface.

Tips:

Don't forget to provide your own implementation of render() since it's a pure virtual method.

Author:
Rick L Vinyard Jr

Member Typedef Documentation

typedef PapyrusPointer<Renderable> Papyrus::Renderable::pointer

Reimplemented in Papyrus::Gradient, and Papyrus::Paint.


Constructor & Destructor Documentation

Papyrus::Renderable::Renderable ( const Glib::ustring &  id  )  [inline, protected]
virtual Papyrus::Renderable::~Renderable (  )  [inline, virtual]

Member Function Documentation

Papyrus::Renderable::PAPYRUS_CLASS_NAME ( "Renderable"   ) 
void Papyrus::Renderable::render ( Cairo::RefPtr< Cairo::Context >  cairo,
double  x,
double  y,
double  w,
double  h 
) const [inline]

References render().

Referenced by render().

void Papyrus::Renderable::render ( Cairo::RefPtr< Cairo::Context >  cairo  )  const [inline]

References render().

Referenced by render().

virtual void Papyrus::Renderable::render ( Context cairo,
double  x,
double  y,
double  w,
double  h 
) const [inline, virtual]

Reimplemented in Papyrus::Drawable.

References render().

Referenced by render().

virtual void Papyrus::Renderable::render ( Context cairo  )  const [pure virtual]
virtual Glib::ustring Papyrus::Renderable::svg ( unsigned  depth = 0  )  [inline, virtual]
Glib::ustring Papyrus::Renderable::svg_id (  )  [inline, protected]
Glib::ustring Papyrus::Renderable::svg_spacing ( unsigned  depth  )  [inline, protected]

The documentation for this class was generated from the following file:

Generated on Fri Apr 16 12:41:09 2010 for papyrus by doxygen 1.6.1