Move things round a bit.
[dcpomatic.git] / src / lib / screen.h
1 /*
2     Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
3
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.
8
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13
14     You should have received a copy of the GNU General Public License
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 */
19
20 #include <string>
21 #include <vector>
22 #include <map>
23 #include "util.h"
24
25 class Format;
26
27 class Screen
28 {
29 public:
30         Screen (std::string);
31
32         void set_geometry (Format const *, Position, Size);
33
34         std::string name () const {
35                 return _name;
36         }
37
38         void set_name (std::string n) {
39                 _name = n;
40         }
41
42         struct Geometry {
43                 Geometry () {}
44
45                 Geometry (Position p, Size s)
46                         : position (p)
47                         , size (s)
48                 {}
49                 
50                 Position position;
51                 Size size;
52         };
53
54         typedef std::map<Format const *, Geometry> GeometryMap;
55         GeometryMap geometries () const {
56                 return _geometries;
57         }
58
59         Position position (Format const *) const;
60         Size size (Format const *) const;
61
62         std::string as_metadata () const;
63         static boost::shared_ptr<Screen> create_from_metadata (std::string);
64
65 private:
66         std::string _name;
67         GeometryMap _geometries;
68 };