Scroom  0.14
sizedeterminer.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 <list>
11 #include <map>
12 #include <set>
13 
14 #include <boost/shared_ptr.hpp>
15 
18 
20 {
21 public:
22  using Ptr = boost::shared_ptr<SizeDeterminer>;
23 
24 private:
26  {
27  public:
29  std::set<ViewInterface::WeakPtr> views;
30 
31  public:
32  PresentationData(); // Don't use
34  };
35 
36 private:
37  std::list<PresentationInterface::Ptr> presentations;
38  std::map<PresentationInterface::Ptr, PresentationData> resizablePresentationData;
39 
40 private:
41  SizeDeterminer() = default;
42  void sendUpdates();
43 
44 public:
45  static Ptr create();
46  void add(PresentationInterface::Ptr const& p);
47  [[nodiscard]] Scroom::Utils::Rectangle<double> getRect() const;
48 
49  void open(PresentationInterface::Ptr const& p, ViewInterface::WeakPtr const& vi);
51 };
assertions.hh
SizeDeterminer::PresentationData::PresentationData
PresentationData()
Definition: sizedeterminer.cc:51
SizeDeterminer::SizeDeterminer
SizeDeterminer()=default
sizedeterminer.hh
SizeDeterminer::sendUpdates
void sendUpdates()
Definition: sizedeterminer.cc:126
resizablepresentationinterface.hh
anonymous_namespace{sizedeterminer.cc}::DetermineSize
Scroom::Utils::Rectangle< double > DetermineSize(const std::list< PresentationInterface::Ptr > &presentations)
Definition: sizedeterminer.cc:18
SizeDeterminer::presentations
std::list< PresentationInterface::Ptr > presentations
Definition: sizedeterminer.hh:37
SizeDeterminer::PresentationData::views
std::set< ViewInterface::WeakPtr > views
Definition: sizedeterminer.hh:29
SizeDeterminer::close
void close(PresentationInterface::Ptr const &p, ViewInterface::WeakPtr const &vi)
Definition: sizedeterminer.cc:112
SizeDeterminer::open
void open(PresentationInterface::Ptr const &p, ViewInterface::WeakPtr const &vi)
Definition: sizedeterminer.cc:96
presentationinterface.hh
ResizablePresentationInterface::Ptr
boost::shared_ptr< ResizablePresentationInterface > Ptr
Definition: resizablepresentationinterface.hh:29
Scroom::Utils::Rectangle::getBottom
value_type getBottom() const
Definition: rectangle.hh:112
SizeDeterminer::create
static Ptr create()
Definition: sizedeterminer.cc:66
require
#define require(expr)
Definition: assertions.hh:28
presentations
static std::list< PresentationInterface::WeakPtr > presentations
Definition: callbacks.cc:57
PresentationInterface::Ptr
boost::shared_ptr< PresentationInterface > Ptr
Definition: presentationinterface.hh:74
ViewInterface::WeakPtr
boost::weak_ptr< ViewInterface > WeakPtr
Definition: viewinterface.hh:194
Scroom::Utils::Rectangle::getRight
value_type getRight() const
Definition: rectangle.hh:114
SizeDeterminer::add
void add(PresentationInterface::Ptr const &p)
Definition: sizedeterminer.cc:68
SizeDeterminer
Definition: sizedeterminer.hh:19
SizeDeterminer::getRect
Scroom::Utils::Rectangle< double > getRect() const
Definition: sizedeterminer.cc:83
Scroom::Utils::Rectangle::getLeft
value_type getLeft() const
Definition: rectangle.hh:110
SizeDeterminer::PresentationData::resizablePresentationInterface
const ResizablePresentationInterface::Ptr resizablePresentationInterface
Definition: sizedeterminer.hh:28
SizeDeterminer::Ptr
boost::shared_ptr< SizeDeterminer > Ptr
Definition: sizedeterminer.hh:22
gtk-helpers.hh
SizeDeterminer::resizablePresentationData
std::map< PresentationInterface::Ptr, PresentationData > resizablePresentationData
Definition: sizedeterminer.hh:38
SizeDeterminer::PresentationData
Definition: sizedeterminer.hh:25
Scroom::Utils::Rectangle< double >
anonymous_namespace{sizedeterminer.cc}::keys
std::list< K > keys(std::map< K, V > const &m)
Definition: sizedeterminer.cc:37
Scroom::Utils::Rectangle::getTop
value_type getTop() const
Definition: rectangle.hh:108
defect
#define defect()
Definition: assertions.hh:40