papyrus

Gnome::Canvas -> Papyrus Equivalency

The goal of Papyrus is to provide a canvas library and not to reimplement the Gnome canvas. However, an early goal is to achieve similar functionality with respect to most of the canvas items and most of the canvas methods.

The purpose of the following table is two-fold:

  1. To provide a handy checklist on the Gnome canvas items.
  2. To (hopefully) assist in the migration of code from either the Gnome canvas ( C ) or the Gnome::Canvas ( C++ ) library.

Since Papyrus was not created as a 1-1 equivalent of the Gnome::Canvas, the following mapping is not meant to indicate a direct class replacement, but more of a functional replacement mapping. In particular, the Gnome::Canvas::Canvas class is the least mappable and probably is deserving of a more complete examination than is provided by the simple one-line form below.

Gnome::CanvasPapyrus ClassNotes
Gnome::Canvas::BpathBezierline and Beziergon
Gnome::Canvas::CanvasPapyrus::Canvas and Papyrus::ViewportThe Gnome::Canvas::Canvas widget serves as both a display and model container for canvas objects. In the Papyrus library, the Papyrus::Canvas class serves as the canvas model (not Gtkmm dependent), while the Papyrus::Viewport serves as the Gtkmm viewing widget of a Papyrus::Canvas. Utilizing model-view separation in this fashion makes it possible to leverage cairo's various drawing surfaces and render a canvas into a cairo backend such as PDF, PS or PNG as well as the screen.
Gnome::Canvas::CanvasAAPapyrus::Canvas and Papyrus::Viewport
Gnome::Canvas::EllipsePapyrus::CircleIf you need an ellipse, use a viewbox to enforce the dimensions. Alternatively scale a circle in the x and y dimensions.
Gnome::Canvas::GroupPapyrus::Group
Gnome::Canvas::ItemPapyrus::Drawable
Gnome::Canvas::PointsPapyrus::Vertices
Gnome::Canvas::LinePapyrus::Polyline
Gnome::Canvas::PathDefcairommPapyrus relies upon cairomm for drawing operations which provides a much richer drawing set than Gnome::Canvas::PathDef.

If instead you want a canvas item with a custom path, inherit from Papyrus::Shape and reimplement the draw_shape() method with your own shape drawing calls to cairomm.
Gnome::Canvas::PixbufPapyrus::Image
Gnome::Canvas::PolygonPapyrus::Polygon
Gnome::Canvas::RectEllipseNo equivalent in PapyrusSince Papyrus is structured differently, this class doesn't fit in the hierarchy.
Gnome::Canvas::RectPapyrus::Rectangle
Gnome::Canvas::RichTextNo equivalent in PapyrusAfter 0.3.0 and probably in PapyrusGtk. This is more of a GUI widget and doesn't fit conceptually into Papyrus, but will likely be incorporated into PapyrusGtk.
Gnome::Canvas::ShapePapyrus::Shape
Gnome::Canvas::TextPapyrus::Text
Gnome::Canvas::WidgetNo equivalent in PapyrusThis canvas item will never be in Papyrus but could be useful in PapyrusGtk. At the current time this is a low priority item.
Gnome::Canvas::PropertycairommThe concepts embodied in the Gnome::Canvas::Property namespace are mostly within the realm of cairomm. However classes such as Papyrus::LineStyle are used to aggregate the cairomm concepts for convenience.


SourceForge.net Logo     Support This Project     Valid XHTML 1.0!