Scroom 0.14-49-gb7ae7a6d
Loading...
Searching...
No Matches
Detail::ViewData Class Reference
Inheritance diagram for Detail::ViewData:
Inheritance graph
Collaboration diagram for Detail::ViewData:
Collaboration graph

Public Types

using Ptr = std::shared_ptr< ViewData >
 
- Public Types inherited from ViewInterface
using Ptr = std::shared_ptr< ViewInterface >
 
using WeakPtr = std::weak_ptr< ViewInterface >
 

Public Member Functions

ViewInterface::Ptr parent () const
 
void invalidate () override
 
ProgressInterface::Ptr getProgressInterface () override
 
void addSideWidget (std::string title, GtkWidget *w) override
 
void removeSideWidget (GtkWidget *w) override
 
void addToToolbar (GtkToolItem *ti) override
 
void removeFromToolbar (GtkToolItem *ti) override
 
void registerSelectionListener (SelectionListener::Ptr ptr) override
 
void registerPostRenderer (PostRenderer::Ptr ptr) override
 
void setStatusMessage (const std::string &string) override
 
std::shared_ptr< PresentationInterfacegetCurrentPresentation () override
 
void addToolButton (GtkToggleButton *button, ToolStateListener::Ptr ptr) override
 

Static Public Member Functions

static ViewData::Ptr create (const ViewInterface::WeakPtr &parent)
 

Public Attributes

Scroom::Utils::Rectangle< double > presentationArea
 
int zoom {0}
 
Scroom::Bitmap::BitmapSurface::Ptr image
 
ViewInterface::WeakPtr weakParent
 

Private Member Functions

 ViewData (ViewInterface::WeakPtr parent_)
 

Member Typedef Documentation

◆ Ptr

using Detail::ViewData::Ptr = std::shared_ptr<ViewData>

Constructor & Destructor Documentation

◆ ViewData()

Detail::ViewData::ViewData ( ViewInterface::WeakPtr  parent_)
explicitprivate
181 : weakParent(std::move(parent_))
182 {
183 }
ViewInterface::WeakPtr weakParent
Definition transformpresentation.hh:51

Member Function Documentation

◆ addSideWidget()

void Detail::ViewData::addSideWidget ( std::string  title,
GtkWidget *  w 
)
overridevirtual

Request that the given widget be added to the sidebar.

Precondition
Should be called from within a Gdk critical section (i.e. between gdk_threads_enter() and gdk_threads_leave() calls)

Implements ViewInterface.

194{ parent()->addSideWidget(title, w); }
ViewInterface::Ptr parent() const
Definition transformpresentation.cc:185
std::pair< GSourceFunc, gpointer > const w
Definition gtkhelper-tests.cc:42
Here is the call graph for this function:

◆ addToolButton()

void Detail::ViewData::addToolButton ( GtkToggleButton *  ,
ToolStateListener::Ptr   
)
overridevirtual

Adds a new tool button to the toolbar. The given ToolStateListener will be informed when the tool is turned on or off. Only one tool will be active at the same time.

See also
ToolStateListener

Implements ViewInterface.

202{ parent()->addToolButton(button, ptr); }
Here is the call graph for this function:

◆ addToToolbar()

void Detail::ViewData::addToToolbar ( GtkToolItem *  ti)
overridevirtual

Request that the given tool item be added to the toolbar.

Precondition
Should be called from within a Gdk critical section (i.e. between gdk_threads_enter() and gdk_threads_leave() calls)

Implements ViewInterface.

196{ parent()->addToToolbar(ti); }
Here is the call graph for this function:

◆ create()

ViewData::Ptr Detail::ViewData::create ( const ViewInterface::WeakPtr parent)
static
203{ return ViewData::Ptr(new ViewData(parent)); }
ViewData(ViewInterface::WeakPtr parent_)
Definition transformpresentation.cc:180
std::shared_ptr< ViewData > Ptr
Definition transformpresentation.hh:45

Referenced by TransformPresentation::open().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCurrentPresentation()

std::shared_ptr< PresentationInterface > Detail::ViewData::getCurrentPresentation ( )
overridevirtual

Returns a shared pointer to the current presentation.

See also
PresentationInterface

Implements ViewInterface.

201{ return parent()->getCurrentPresentation(); }
Here is the call graph for this function:

◆ getProgressInterface()

ProgressInterface::Ptr Detail::ViewData::getProgressInterface ( )
overridevirtual

Return a pointer to the progess interface associated with the View

Note
The progress bar should only be manipulated from within a Gdk critical section (i.e. between gdk_threads_enter() and gdk_threads_leave() calls)

Implements ViewInterface.

193{ return parent()->getProgressInterface(); }
Here is the call graph for this function:

◆ invalidate()

void Detail::ViewData::invalidate ( )
overridevirtual

Request that the window content is redrawn.

Precondition
Should be called from within a Gdk critical section (i.e. between gdk_threads_enter() and gdk_threads_leave() calls)

Implements ViewInterface.

188 {
189 image.reset();
190 parent()->invalidate();
191 }
Scroom::Bitmap::BitmapSurface::Ptr image
Definition transformpresentation.hh:50
Here is the call graph for this function:

◆ parent()

ViewInterface::Ptr Detail::ViewData::parent ( ) const

◆ registerPostRenderer()

void Detail::ViewData::registerPostRenderer ( PostRenderer::Ptr  )
overridevirtual

Register a postrenderer to be updated whenever a redraw occurs. When this happens, the 'render' function gets called on the instance that is passed to the given instance.

Note that the order in which different registered instances get updated is the order in which they register to the view. This order remains constant throughout the view's lifetime.

See also
PostRenderer

Implements ViewInterface.

199{ parent()->registerPostRenderer(ptr); }
Here is the call graph for this function:

◆ registerSelectionListener()

void Detail::ViewData::registerSelectionListener ( SelectionListener::Ptr  )
overridevirtual

Register a SelectionListener to be updated whenever the user selects a region . When the user changes the selection, various functions on the given instance are called.

See also
SelectionListener

Implements ViewInterface.

198{ parent()->registerSelectionListener(ptr); }
Here is the call graph for this function:

◆ removeFromToolbar()

void Detail::ViewData::removeFromToolbar ( GtkToolItem *  ti)
overridevirtual

Request that the given tool item be removed from the toolbar.

Precondition
Should be called from within a Gdk critical section (i.e. between gdk_threads_enter() and gdk_threads_leave() calls)

Implements ViewInterface.

197{ parent()->removeFromToolbar(ti); }
Here is the call graph for this function:

◆ removeSideWidget()

void Detail::ViewData::removeSideWidget ( GtkWidget *  w)
overridevirtual

Request that the given widget be removed from the sidebar.

Precondition
Should be called from within a Gdk critical section (i.e. between gdk_threads_enter() and gdk_threads_leave() calls)

Implements ViewInterface.

195{ parent()->removeSideWidget(w); }
Here is the call graph for this function:

◆ setStatusMessage()

void Detail::ViewData::setStatusMessage ( const std::string &  )
overridevirtual

Sets the status message in the status bar of the application.

Implements ViewInterface.

200{ parent()->setStatusMessage(string); }
Here is the call graph for this function:

Member Data Documentation

◆ image

Scroom::Bitmap::BitmapSurface::Ptr Detail::ViewData::image

Referenced by invalidate().

◆ presentationArea

Scroom::Utils::Rectangle<double> Detail::ViewData::presentationArea

◆ weakParent

ViewInterface::WeakPtr Detail::ViewData::weakParent

Referenced by parent().

◆ zoom

int Detail::ViewData::zoom {0}
49{0};

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