TBTK
Need a break? Support the development by playing Polarity Puzzles
Canvas.h
1 /* Copyright 2019 Kristofer Björnson
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
17 
24 #ifndef COM_DAFER45_TBTK_CANVAS
25 #define COM_DAFER45_TBTK_CANVAS
26 
27 #include "TBTK/TBTKMacros.h"
28 
29 #include <string>
30 
31 namespace TBTK{
32 
33 class Canvas{
34 public:
36  Canvas();
37 
39  virtual ~Canvas();
40 
42  void setWidth(unsigned int width);
43 
45  double getWidth() const;
46 
48  void setHeight(unsigned int height);
49 
51  double getHeight() const;
52 
54  void setTitle(const std::string &title);
55 
57  const std::string& getTitle() const;
58 
60  virtual void clear();
61 private:
63  double width, height;
64 
66  std::string title;
67 };
68 
69 inline void Canvas::setWidth(unsigned int width){
70  this->width = width;
71 }
72 
73 inline double Canvas::getWidth() const{
74  return width;
75 }
76 
77 inline void Canvas::setHeight(unsigned int height){
78  this->height = height;
79 }
80 
81 inline double Canvas::getHeight() const{
82  return height;
83 }
84 
85 inline void Canvas::setTitle(const std::string &title){
86  this->title = title;
87 }
88 
89 inline const std::string& Canvas::getTitle() const{
90  return title;
91 }
92 
93 inline void Canvas::clear(){
94 }
95 
96 }; //End namespace TBTK
97 
98 #endif
99 
Precompiler macros.
Definition: Boolean.h:32