papyrus logo

Papyrus::Gtk::Viewport Class Reference

#include <viewport.h>

List of all members.

Public Types

typedef std::set
< Papyrus::Controller::pointer

Public Member Functions

 Viewport ()
virtual ~Viewport ()
virtual void clear ()
Papyrus::Canvas::pointer canvas ()
 Get the root canvas object.
void set_canvas (Papyrus::Canvas::pointer canvas)
 Set the root canvas object.
const Controllerscontrollers ()
void add_controller (Papyrus::Controller::pointer controller)
void remove_controller (Papyrus::Controller::pointer controller)
bool canvas_size_tied_to_viewport ()
void tie_canvas_size_to_viewport (bool tie=true)
bool viewport_size_tied_to_canvas ()
void tie_viewport_size_to_canvas (bool tie=true)
Papyrus::Event::signalsignal_papyrus_event ()
sigc::signal< void > & signal_canvas_replaced ()

Protected Types

typedef std::map
< Papyrus::Controller::pointer,
sigc::connection > 

Protected Member Functions

void on_canvas_size_changed ()
void on_redraw (double x, double y, double w, double h)
bool expose_event_callback (GdkEventExpose *e)
void size_allocate_callback (::Gtk::Allocation &allocation)
bool button_press_event_callback (GdkEventButton *event)
bool button_release_event_callback (GdkEventButton *event)
bool key_press_event_callback (GdkEventKey *event)
bool key_release_event_callback (GdkEventKey *event)
bool motion_notify_event_callback (GdkEventMotion *event)
bool scroll_event_callback (GdkEventScroll *event)

Protected Attributes

Papyrus::Canvas::pointer m_canvas
int m_width
int m_height
bool m_tie_canvas_size_to_viewport
bool m_tie_viewport_size_to_canvas
Controllers m_controllers
ControllerConnections m_controller_connections
Papyrus::Event::signal m_signal_papyrus_event
sigc::connection m_canvas_redraw_connection
sigc::connection m_canvas_size_connection
Context m_context
sigc::signal< void > m_signal_canvas_replaced

Detailed Description

Rick L Vinyard Jr

Member Typedef Documentation

typedef std::map<Papyrus::Controller::pointer,sigc::connection> Papyrus::Gtk::Viewport::ControllerConnections [protected]

Constructor & Destructor Documentation

Papyrus::Gtk::Viewport::Viewport (  ) 
Papyrus::Gtk::Viewport::~Viewport (  )  [virtual]

References m_canvas.

Member Function Documentation

void Papyrus::Gtk::Viewport::add_controller ( Papyrus::Controller::pointer  controller  ) 
bool Papyrus::Gtk::Viewport::button_press_event_callback ( GdkEventButton *  event  )  [protected]

References m_canvas, and m_signal_papyrus_event.

Referenced by Viewport().

bool Papyrus::Gtk::Viewport::button_release_event_callback ( GdkEventButton *  event  )  [protected]

References m_canvas, and m_signal_papyrus_event.

Referenced by Viewport().

Papyrus::Canvas::pointer Papyrus::Gtk::Viewport::canvas (  ) 
bool Papyrus::Gtk::Viewport::canvas_size_tied_to_viewport (  ) 
void Papyrus::Gtk::Viewport::clear (  )  [virtual]

References m_canvas.

const Viewport::Controllers & Papyrus::Gtk::Viewport::controllers (  ) 

References m_controllers.

bool Papyrus::Gtk::Viewport::expose_event_callback ( GdkEventExpose *  e  )  [protected]

We need to call the paint function passing it the bounds of the window and the cairo drawing surface. To do this, we need to create the cairo surface using gdk_cairo_create which requires the gdk drawable. But, we can't directly access the gdk drawable from a Gtk::Widget. We must obtain the Gdk::Window of the Gtk::Widget. Gdk::Drawable is a parent of Gdk::Window, but the gdk drawable is only available in the parent method. Therefore we must access it this way:

Gtk::Widget -> Gdk::Window -> Gdk::Drawable -> gdk drawable

References Papyrus::Context::clear(), m_canvas, and m_context.

Referenced by Viewport().

bool Papyrus::Gtk::Viewport::key_press_event_callback ( GdkEventKey *  event  )  [protected]

References m_signal_papyrus_event.

Referenced by Viewport().

bool Papyrus::Gtk::Viewport::key_release_event_callback ( GdkEventKey *  event  )  [protected]

References m_signal_papyrus_event.

Referenced by Viewport().

bool Papyrus::Gtk::Viewport::motion_notify_event_callback ( GdkEventMotion *  event  )  [protected]

References m_canvas, and m_signal_papyrus_event.

Referenced by Viewport().

void Papyrus::Gtk::Viewport::on_canvas_size_changed (  )  [protected]
void Papyrus::Gtk::Viewport::on_redraw ( double  x,
double  y,
double  w,
double  h 
) [protected]

Referenced by set_canvas(), and Viewport().

void Papyrus::Gtk::Viewport::remove_controller ( Papyrus::Controller::pointer  controller  ) 
bool Papyrus::Gtk::Viewport::scroll_event_callback ( GdkEventScroll *  event  )  [protected]
void Papyrus::Gtk::Viewport::set_canvas ( Papyrus::Canvas::pointer  canvas  ) 
sigc::signal< void > & Papyrus::Gtk::Viewport::signal_canvas_replaced (  ) 
Papyrus::Event::signal & Papyrus::Gtk::Viewport::signal_papyrus_event (  ) 
void Papyrus::Gtk::Viewport::size_allocate_callback ( ::Gtk::Allocation &  allocation  )  [protected]
void Papyrus::Gtk::Viewport::tie_canvas_size_to_viewport ( bool  tie = true  ) 
void Papyrus::Gtk::Viewport::tie_viewport_size_to_canvas ( bool  tie = true  ) 
bool Papyrus::Gtk::Viewport::viewport_size_tied_to_canvas (  ) 

Member Data Documentation

Referenced by set_canvas(), and Viewport().

Referenced by expose_event_callback().

Referenced by size_allocate_callback().

sigc::signal<void> Papyrus::Gtk::Viewport::m_signal_canvas_replaced [protected]

Referenced by size_allocate_callback().

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

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