papyrus logo

Papyrus::Canvas Class Reference

#include <canvas.h>

Inheritance diagram for Papyrus::Canvas:

Inheritance graph
[legend]

List of all members.

Public Types

typedef PapyrusPointer< Canvaspointer

Public Member Functions

virtual ~Canvas ()
virtual Matrix global_matrix () const
double width ()
double height ()
void size (double &width, double &height)
void set_width (double width)
void set_height (double height)
void set_size (double width, double height)
Units units () const
void set_units (Units u)
void device_resolution (double &x, double &y) const
bool set_device_resolution (double x, double y)
Paint::pointer background ()
void set_background (Paint::pointer background)
void scroll_to (double offset_x, double offset_y)
void scroll_to_center ()
void scroll_position (double &x, double &y)
void set_scroll_anchor (ScrollAnchor scroll_achor=SCROLL_ANCHOR_CENTER)
ScrollAnchor scroll_anchor ()
void window_to_canvas (double &x, double &y) const
 Convert window coordinates to canvas coordinates.
void canvas_to_window (double &x, double &y) const
 Convert canvas coordinates to window coordinates.
virtual Selection select (double x, double y, unsigned depth=1)
sigc::signal< void > signal_size ()
sigc::signal< void, Unitssignal_units ()
sigc::signal< void, double,
double > 
signal_display_resolution ()
 PAPYRUS_CLASS_NAME ("Canvas")
 PAPYRUS_CLONE_METHOD (Canvas)

Static Public Member Functions

static pointer create (double width=0.0, double height=0.0, double scale=1.0)
static pointer create (const Glib::ustring &id, double width=0.0, double height=0.0, double scale=1.0)

Protected Member Functions

 Canvas (const Glib::ustring &id, double width, double height, double scale)
virtual void draw (Cairo::RefPtr< Cairo::Context > cairo) const
virtual Matrix calculate_composed_matrix () const
void update_scroll_anchor_offsets ()

Protected Attributes

double m_width
double m_height
double m_scale
ScrollAnchor m_scroll_anchor
 Determines the default scroll position and the result of scroll_to_center().
double m_scroll_anchor_offset_x
 Stores the default scroll anchor x offset.
double m_scroll_anchor_offset_y
 Stores the default scroll anchor y offset.
double m_scroll_x
 Stores the current scroll x offset.
double m_scroll_y
 Stores the current scroll y offset.
Units m_units
double m_display_x_resolution
double m_display_y_resolution
Paint::pointer m_background
sigc::signal< void > m_signal_size
sigc::signal< void, Unitsm_signal_units
sigc::signal< void, double,
double > 
m_signal_display_resolution


Detailed Description

Author:
Rick L Vinyard Jr

Member Typedef Documentation

typedef PapyrusPointer<Canvas> Papyrus::Canvas::pointer

Reimplemented from Papyrus::Group.


Constructor & Destructor Documentation

Papyrus::Canvas::Canvas ( const Glib::ustring &  id,
double  width,
double  height,
double  scale 
) [protected]

Papyrus::Canvas::~Canvas (  )  [virtual]


Member Function Documentation

Paint::pointer Papyrus::Canvas::background (  ) 

References m_background.

Matrix Papyrus::Canvas::calculate_composed_matrix (  )  const [protected, virtual]

void Papyrus::Canvas::canvas_to_window ( double &  x,
double &  y 
) const

Convert canvas coordinates to window coordinates.

Parameters:
[in] x The canvas x coordinate
[in] y The canvas y coordinate
[out] x The window x coordinate
[out] y The window y coordinate

References Papyrus::Drawable::composed_matrix().

Canvas::pointer Papyrus::Canvas::create ( const Glib::ustring &  id,
double  width = 0.0,
double  height = 0.0,
double  scale = 1.0 
) [static]

References PAPYRUS_CREATE.

Canvas::pointer Papyrus::Canvas::create ( double  width = 0.0,
double  height = 0.0,
double  scale = 1.0 
) [static]

void Papyrus::Canvas::device_resolution ( double &  x,
double &  y 
) const

void Papyrus::Canvas::draw ( Cairo::RefPtr< Cairo::Context >  cairo  )  const [protected, virtual]

Reimplemented from Papyrus::Group.

References m_background.

Matrix Papyrus::Canvas::global_matrix (  )  const [virtual]

double Papyrus::Canvas::height (  ) 

References m_height.

Papyrus::Canvas::PAPYRUS_CLASS_NAME ( "Canvas"   ) 

Papyrus::Canvas::PAPYRUS_CLONE_METHOD ( Canvas   ) 

ScrollAnchor Papyrus::Canvas::scroll_anchor (  ) 

References m_scroll_anchor.

void Papyrus::Canvas::scroll_position ( double &  x,
double &  y 
)

References m_scroll_x, and m_scroll_y.

void Papyrus::Canvas::scroll_to ( double  offset_x,
double  offset_y 
)

void Papyrus::Canvas::scroll_to_center (  ) 

Selection Papyrus::Canvas::select ( double  x,
double  y,
unsigned  depth = 1 
) [virtual]

void Papyrus::Canvas::set_background ( Paint::pointer  background  ) 

bool Papyrus::Canvas::set_device_resolution ( double  x,
double  y 
)

void Papyrus::Canvas::set_height ( double  height  ) 

void Papyrus::Canvas::set_scroll_anchor ( ScrollAnchor  scroll_achor = SCROLL_ANCHOR_CENTER  ) 

void Papyrus::Canvas::set_size ( double  width,
double  height 
)

void Papyrus::Canvas::set_units ( Units  u  ) 

void Papyrus::Canvas::set_width ( double  width  ) 

sigc::signal< void, double, double > Papyrus::Canvas::signal_display_resolution (  ) 

sigc::signal< void > Papyrus::Canvas::signal_size (  ) 

References m_signal_size.

sigc::signal< void, Units > Papyrus::Canvas::signal_units (  ) 

References m_signal_units.

void Papyrus::Canvas::size ( double &  width,
double &  height 
)

References m_height, and m_width.

Units Papyrus::Canvas::units (  )  const

References m_units.

void Papyrus::Canvas::update_scroll_anchor_offsets (  )  [protected]

double Papyrus::Canvas::width (  ) 

References m_width.

void Papyrus::Canvas::window_to_canvas ( double &  x,
double &  y 
) const

Convert window coordinates to canvas coordinates.

Parameters:
[in] x The window x coordinate
[in] y The window y coordinate
[out] x The canvas x coordinate
[out] y The canvas y coordinate

References Papyrus::Drawable::composed_matrix().


Member Data Documentation

Referenced by background(), draw(), and set_background().

double Papyrus::Canvas::m_height [protected]

double Papyrus::Canvas::m_scale [protected]

Referenced by Canvas().

Determines the default scroll position and the result of scroll_to_center().

Referenced by scroll_anchor(), set_scroll_anchor(), and update_scroll_anchor_offsets().

Stores the default scroll anchor x offset.

Referenced by Canvas(), scroll_to_center(), set_size(), set_width(), and update_scroll_anchor_offsets().

Stores the default scroll anchor y offset.

Referenced by Canvas(), scroll_to_center(), set_height(), set_size(), and update_scroll_anchor_offsets().

double Papyrus::Canvas::m_scroll_x [protected]

Stores the current scroll x offset.

Referenced by calculate_composed_matrix(), Canvas(), scroll_position(), scroll_to(), scroll_to_center(), set_size(), and set_width().

double Papyrus::Canvas::m_scroll_y [protected]

Stores the current scroll y offset.

Referenced by calculate_composed_matrix(), Canvas(), scroll_position(), scroll_to(), scroll_to_center(), set_height(), and set_size().

sigc::signal<void,double,double> Papyrus::Canvas::m_signal_display_resolution [protected]

sigc::signal<void> Papyrus::Canvas::m_signal_size [protected]

sigc::signal<void,Units> Papyrus::Canvas::m_signal_units [protected]

Referenced by set_units(), and signal_units().

Referenced by set_units(), and units().

double Papyrus::Canvas::m_width [protected]


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

Generated on Wed Mar 18 12:34:56 2009 for papyrus by doxygen 1.5.7.1