Scroom  0.14
PresentationInterface Class Referenceabstract

#include <presentationinterface.hh>

Inheritance diagram for PresentationInterface:
Inheritance graph
Collaboration diagram for PresentationInterface:
Collaboration graph

Public Types

using Ptr = boost::shared_ptr< PresentationInterface >
 
using WeakPtr = boost::weak_ptr< PresentationInterface >
 
- Public Types inherited from Viewable
using Ptr = boost::shared_ptr< Viewable >
 
using WeakPtr = boost::weak_ptr< Viewable >
 
- Public Types inherited from Scroom::Utils::Observable< T >
using Observer = boost::shared_ptr< T >
 
using Ptr = boost::shared_ptr< Observable< T > >
 

Public Member Functions

virtual Scroom::Utils::Rectangle< double > getRect ()=0
 
virtual void redraw (ViewInterface::Ptr const &vi, cairo_t *cr, Scroom::Utils::Rectangle< double > presentationArea, int zoom)=0
 
virtual bool getProperty (const std::string &name, std::string &value)=0
 
virtual bool isPropertyDefined (const std::string &name)=0
 
virtual std::string getTitle ()=0
 
virtual Scroom::Utils::Point< double > getAspectRatio () const
 
- Public Member Functions inherited from Viewable
virtual void open (ViewInterface::WeakPtr vi)=0
 
virtual void close (ViewInterface::WeakPtr vi)=0
 
- Public Member Functions inherited from Scroom::Utils::Observable< T >
 Observable ()
 
 ~Observable () override
 
 Observable (const Observable &)=delete
 
 Observable (Observable &&)=delete
 
Observable operator= (const Observable &)=delete
 
Observable operator= (Observable &&)=delete
 
Scroom::Bookkeeping::Token registerStrongObserver (Observer const &observer)
 
Scroom::Bookkeeping::Token registerObserver (ObserverWeak const &observer)
 

Additional Inherited Members

- Protected Member Functions inherited from Scroom::Utils::Observable< T >
std::list< ObservergetObservers ()
 
virtual void observerAdded (Observer const &observer, Scroom::Bookkeeping::Token const &token)
 

Detailed Description

Represent some 2D content

Anything that should be shown by Scroom in a window should implement this interface.

Objects implementing this interface are typically returned by NewPresentationInterface::createNew() and OpenPresentationInterface::open().

Member Typedef Documentation

◆ Ptr

◆ WeakPtr

Member Function Documentation

◆ getAspectRatio()

virtual Scroom::Utils::Point<double> PresentationInterface::getAspectRatio ( ) const
inlinevirtual

Reimplemented in TransformPresentation.

110 { return Scroom::Utils::make_point(1.0, 1.0); }
Here is the call graph for this function:

◆ getProperty()

virtual bool PresentationInterface::getProperty ( const std::string &  name,
std::string &  value 
)
pure virtual

Return the value of the requested property

Parameters
[in]nameThe name of the requested property
[out]valueThe value of the requested property
Return values
trueif the property existed
falseif the property didn't exist

Implemented in anonymous_namespace{tiledbitmappresentation.cc}::TiledBitmapPresentation, TransformPresentation, TransparentOverlayPresentation, ExamplePresentation, anonymous_namespace{determine-size-test.cc}::PresentationInterfaceStub, and DummyPresentation.

◆ getRect()

◆ getTitle()

◆ isPropertyDefined()

virtual bool PresentationInterface::isPropertyDefined ( const std::string &  name)
pure virtual

◆ redraw()

virtual void PresentationInterface::redraw ( ViewInterface::Ptr const &  vi,
cairo_t *  cr,
Scroom::Utils::Rectangle< double >  presentationArea,
int  zoom 
)
pure virtual

Draw the requested ara at the requested zoom level

Parameters
viThe ViewInterface on whose behalf the request is made
crThe context to draw the area on
presentationAreathe area that is to be drawn. The given x and y coordinates should map on 0,0 of the given context cr.
zoomThe requested zoom level. One pixel of your presentation should have size 2**zoom when drawn. zoom may be negative.

Implemented in TransformPresentation, TransparentOverlayPresentation, ExamplePresentation, anonymous_namespace{determine-size-test.cc}::PresentationInterfaceStub, DummyPresentation, and anonymous_namespace{tiledbitmappresentation.cc}::TiledBitmapPresentation.


The documentation for this class was generated from the following file:
Scroom::Utils::make_point
Point< T > make_point(T x, T y)
Definition: point.hh:116