Libraries/Graphics/src/include/Graphics/Device.h
Go to the documentation of this file.
1 /****
2  * Device.h
3  *
4  * Copyright 2021 mikee47 <mike@sillyhouse.net>
5  *
6  * This file is part of the Sming-Graphics Library
7  *
8  * This library is free software: you can redistribute it and/or modify it under the terms of the
9  * GNU General Public License as published by the Free Software Foundation, version 3 or later.
10  *
11  * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
12  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13  * See the GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along with this library.
16  * If not, see <https://www.gnu.org/licenses/>.
17  *
18  * @author: May 2021 - mikee47 <mike@sillyhouse.net>
19  *
20  ****/
21 
22 #pragma once
23 
24 #include "Types.h"
25 #include "Surface.h"
26 
27 namespace Graphics
28 {
32 class Device
33 {
34 public:
35  virtual ~Device()
36  {
37  }
38 
42  virtual String getName() const = 0;
43 
47  virtual bool setOrientation(Orientation orientation) = 0;
48 
53  virtual Size getNativeSize() const = 0;
54 
59  {
60  return orientation;
61  }
62 
70  virtual bool setScrollMargins(uint16_t top, uint16_t bottom) = 0;
71 
76  virtual bool scroll(int16_t y) = 0;
77 
78 protected:
80 };
81 
82 } // namespace Graphics
Orientation orientation
Definition: Libraries/Graphics/src/include/Graphics/Device.h:117
The String class.
Definition: WString.h:136
virtual bool setScrollMargins(uint16_t top, uint16_t bottom)=0
Set margins for hardware scrolling.
virtual String getName() const =0
Get name of display.
virtual bool setOrientation(Orientation orientation)=0
Set display orientation.
Definition: Virtual.h:30
Orientation getOrientation()
Get current display orientation.
Definition: Libraries/Graphics/src/include/Graphics/Device.h:96
Orientation
Defines orientation of display.
Definition: Libraries/Graphics/src/include/Graphics/Types.h:66
virtual bool scroll(int16_t y)=0
Scroll region of display up or down using hardware scrolling.
virtual Size getNativeSize() const =0
Get physical size of display.
virtual ~Device()
Definition: Libraries/Graphics/src/include/Graphics/Device.h:73