Scroom  0.14
examplepresentation.hh
Go to the documentation of this file.
1 /*
2  * Scroom - Generic viewer for 2D data
3  * Copyright (C) 2009-2022 Kees-Jan Dijkzeul
4  *
5  * SPDX-License-Identifier: LGPL-2.1
6  */
7 
8 #pragma once
9 
10 #include <string>
11 
12 #include <cairo.h>
13 
15 #include <scroom/rectangle.hh>
16 #include <scroom/viewinterface.hh>
17 
19 {
20 private:
21  cairo_pattern_t* pattern{nullptr};
22 
23  void fillPattern();
24 
25 public:
27  ~ExamplePresentation() override;
32 
34  void open(ViewInterface::WeakPtr viewInterface) override;
35  void redraw(ViewInterface::Ptr const& vi, cairo_t* cr, Scroom::Utils::Rectangle<double> presentationArea, int zoom) override;
36  void close(ViewInterface::WeakPtr vi) override;
37  bool getProperty(const std::string& name, std::string& value) override;
38  bool isPropertyDefined(const std::string& name) override;
39  std::string getTitle() override;
40 };
UNUSED
#define UNUSED(x)
Definition: unused.hh:10
ExamplePresentation::~ExamplePresentation
~ExamplePresentation() override
Definition: examplepresentation.cc:19
PresentationInterface
Definition: presentationinterface.hh:69
ExamplePresentation::getTitle
std::string getTitle() override
Definition: examplepresentation.cc:93
ExamplePresentation::redraw
void redraw(ViewInterface::Ptr const &vi, cairo_t *cr, Scroom::Utils::Rectangle< double > presentationArea, int zoom) override
Definition: examplepresentation.cc:55
presentationinterface.hh
ExamplePresentation::fillPattern
void fillPattern()
Definition: examplepresentation.cc:21
ViewInterface::Ptr
boost::shared_ptr< ViewInterface > Ptr
Definition: viewinterface.hh:193
drawOutOfBoundsWithBackground
void drawOutOfBoundsWithBackground(cairo_t *cr, Scroom::Utils::Rectangle< double > const &requestedPresentationArea, Scroom::Utils::Rectangle< double > const &actualPresentationArea, double pixelSize)
Definition: cairo-helpers.cc:74
ExamplePresentation::close
void close(ViewInterface::WeakPtr vi) override
Definition: examplepresentation.cc:53
ExamplePresentation::isPropertyDefined
bool isPropertyDefined(const std::string &name) override
Definition: examplepresentation.cc:86
ExamplePresentation::pattern
cairo_pattern_t * pattern
Definition: examplepresentation.hh:21
ExamplePresentation::ExamplePresentation
ExamplePresentation()
Definition: examplepresentation.cc:17
ViewInterface::WeakPtr
boost::weak_ptr< ViewInterface > WeakPtr
Definition: viewinterface.hh:194
examplepresentation.hh
ExamplePresentation::operator=
ExamplePresentation operator=(const ExamplePresentation &)=delete
ExamplePresentation::getProperty
bool getProperty(const std::string &name, std::string &value) override
Definition: examplepresentation.cc:79
viewinterface.hh
ExamplePresentation
Definition: examplepresentation.hh:18
pixelSizeFromZoom
double pixelSizeFromZoom(int zoom)
Definition: cairo-helpers.cc:112
Scroom::Utils::Rectangle::toGdkRectangle
cairo_rectangle_int_t toGdkRectangle() const
Definition: rectangle.hh:62
unused.hh
Scroom::Utils::Rectangle< double >
cairo-helpers.hh
rectangle.hh
ExamplePresentation::open
void open(ViewInterface::WeakPtr viewInterface) override
Definition: examplepresentation.cc:51
ExamplePresentation::getRect
Scroom::Utils::Rectangle< double > getRect() override
Definition: examplepresentation.cc:49