#include <viewport.h>
typedef std::map<Papyrus::Controller::pointer,sigc::connection> Papyrus::Gtk::Viewport::ControllerConnections [protected] |
typedef std::set<Papyrus::Controller::pointer> Papyrus::Gtk::Viewport::Controllers |
Papyrus::Gtk::Viewport::Viewport | ( | ) |
References button_press_event_callback(), button_release_event_callback(), Papyrus::Canvas::create(), expose_event_callback(), key_press_event_callback(), key_release_event_callback(), m_canvas, m_canvas_redraw_connection, m_canvas_size_connection, motion_notify_event_callback(), on_canvas_size_changed(), on_redraw(), scroll_event_callback(), and size_allocate_callback().
Papyrus::Gtk::Viewport::~Viewport | ( | ) | [virtual] |
References m_canvas.
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 | ( | ) |
Get the root canvas object.
References m_canvas.
Referenced by Papyrus::Gtk::ScrolledViewport::canvas(), Papyrus::Gtk::ScrolledViewport::on_canvas_replaced(), Papyrus::Gtk::StrokeWidget::set_use_preview(), and Papyrus::Gtk::MarkerWidget::set_use_preview().
bool Papyrus::Gtk::Viewport::canvas_size_tied_to_viewport | ( | ) |
References m_tie_canvas_size_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] |
References m_canvas, m_canvas_size_connection, and m_tie_viewport_size_to_canvas.
Referenced by set_canvas(), tie_viewport_size_to_canvas(), and Viewport().
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 | ) |
References m_controller_connections, and m_controllers.
bool Papyrus::Gtk::Viewport::scroll_event_callback | ( | GdkEventScroll * | event | ) | [protected] |
References m_canvas, m_signal_papyrus_event, Papyrus::Event::SCROLL_DOWN, Papyrus::Event::SCROLL_LEFT, Papyrus::Event::SCROLL_RIGHT, and Papyrus::Event::SCROLL_UP.
Referenced by Viewport().
void Papyrus::Gtk::Viewport::set_canvas | ( | Papyrus::Canvas::pointer | canvas | ) |
Set the root canvas object.
References m_canvas, m_canvas_redraw_connection, m_canvas_size_connection, m_signal_canvas_replaced, on_canvas_size_changed(), and on_redraw().
sigc::signal< void > & Papyrus::Gtk::Viewport::signal_canvas_replaced | ( | ) |
References m_signal_canvas_replaced.
Referenced by Papyrus::Gtk::ScrolledViewport::ScrolledViewport().
Papyrus::Event::signal & Papyrus::Gtk::Viewport::signal_papyrus_event | ( | ) |
References m_signal_papyrus_event.
void Papyrus::Gtk::Viewport::size_allocate_callback | ( | ::Gtk::Allocation & | allocation | ) | [protected] |
References m_canvas, m_canvas_size_connection, m_height, m_tie_canvas_size_to_viewport, and m_width.
Referenced by Viewport().
void Papyrus::Gtk::Viewport::tie_canvas_size_to_viewport | ( | bool | tie = true |
) |
References m_canvas, and m_tie_canvas_size_to_viewport.
void Papyrus::Gtk::Viewport::tie_viewport_size_to_canvas | ( | bool | tie = true |
) |
bool Papyrus::Gtk::Viewport::viewport_size_tied_to_canvas | ( | ) |
References m_tie_viewport_size_to_canvas.
Referenced by button_press_event_callback(), button_release_event_callback(), canvas(), clear(), expose_event_callback(), motion_notify_event_callback(), on_canvas_size_changed(), scroll_event_callback(), set_canvas(), size_allocate_callback(), tie_canvas_size_to_viewport(), tie_viewport_size_to_canvas(), Viewport(), and ~Viewport().
sigc::connection Papyrus::Gtk::Viewport::m_canvas_redraw_connection [protected] |
Referenced by set_canvas(), and Viewport().
sigc::connection Papyrus::Gtk::Viewport::m_canvas_size_connection [protected] |
Referenced by on_canvas_size_changed(), set_canvas(), size_allocate_callback(), tie_viewport_size_to_canvas(), and Viewport().
Context Papyrus::Gtk::Viewport::m_context [protected] |
Referenced by expose_event_callback().
Referenced by add_controller(), and remove_controller().
Controllers Papyrus::Gtk::Viewport::m_controllers [protected] |
Referenced by add_controller(), controllers(), and remove_controller().
int Papyrus::Gtk::Viewport::m_height [protected] |
Referenced by size_allocate_callback().
sigc::signal<void> Papyrus::Gtk::Viewport::m_signal_canvas_replaced [protected] |
Referenced by set_canvas(), and signal_canvas_replaced().
bool Papyrus::Gtk::Viewport::m_tie_canvas_size_to_viewport [protected] |
bool Papyrus::Gtk::Viewport::m_tie_viewport_size_to_canvas [protected] |
Referenced by on_canvas_size_changed(), tie_viewport_size_to_canvas(), and viewport_size_tied_to_canvas().
int Papyrus::Gtk::Viewport::m_width [protected] |
Referenced by size_allocate_callback().