ScummVM API documentation
modular-backend.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef BACKENDS_MODULAR_BACKEND_H
23 #define BACKENDS_MODULAR_BACKEND_H
24 
25 #include "backends/base-backend.h"
26 
27 class GraphicsManager;
28 class MixerManager;
29 
48 class ModularGraphicsBackend : virtual public BaseBackend {
49 public:
51  virtual ~ModularGraphicsBackend();
52 
55 
56  bool hasFeature(Feature f) override;
57  void setFeatureState(Feature f, bool enable) override;
58  bool getFeatureState(Feature f) override;
59 
61 
64 
65  GraphicsManager *getGraphicsManager();
66  const GraphicsMode *getSupportedGraphicsModes() const override;
67  int getDefaultGraphicsMode() const override;
68  bool setGraphicsMode(int mode, uint flags = kGfxModeNoFlags) override;
69  int getGraphicsMode() const override;
70 #if defined(USE_IMGUI)
71  void setImGuiCallbacks(const ImGuiCallbacks &callbacks) override final;
72 #endif
73  bool setShader(const Common::Path &name) override final;
74  const GraphicsMode *getSupportedStretchModes() const override final;
75  int getDefaultStretchMode() const override final;
76  bool setStretchMode(int mode) override final;
77  int getStretchMode() const override final;
78  uint getDefaultScaler() const override final;
79  uint getDefaultScaleFactor() const override final;
81  bool setScaler(uint mode, int factor) override final;
82  uint getScaler() const override final;
83  uint getScaleFactor() const override final;
84 #ifdef USE_RGB_COLOR
85  Graphics::PixelFormat getScreenFormat() const override final;
86  Common::List<Graphics::PixelFormat> getSupportedFormats() const override final;
87 #endif
88  void initSize(uint width, uint height, const Graphics::PixelFormat *format = NULL) override final;
89  void initSizeHint(const Graphics::ModeList &modes) override final;
90  int getScreenChangeID() const override final;
91 
92  void beginGFXTransaction() override final;
94 
95  int16 getHeight() override final;
96  int16 getWidth() override final;
97  PaletteManager *getPaletteManager() override final;
98  void copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h) override final;
99  Graphics::Surface *lockScreen() override final;
100  void unlockScreen() override final;
101  void fillScreen(uint32 col) override final;
102  void fillScreen(const Common::Rect &r, uint32 col) override final;
103  void updateScreen() override final;
104  void setShakePos(int shakeXOffset, int shakeYOffset) override final;
105  void setFocusRectangle(const Common::Rect& rect) override final;
106  void clearFocusRectangle() override final;
107 
108  void showOverlay(bool inGUI) override final;
109  void hideOverlay() override final;
110  bool isOverlayVisible() const override final;
111  Graphics::PixelFormat getOverlayFormat() const override final;
112  void clearOverlay() override final;
113  void grabOverlay(Graphics::Surface &surface) override final;
114  void copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h) override final;
115  int16 getOverlayHeight() override final;
116  int16 getOverlayWidth() override final;
117 
118  float getHiDPIScreenFactor() const override final;
119 
120  bool showMouse(bool visible) override final;
121  void warpMouse(int x, int y) override final;
122  void setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale = false, const Graphics::PixelFormat *format = NULL, const byte *mask = NULL) override final;
123  void setCursorPalette(const byte *colors, uint start, uint num) override final;
124  bool lockMouse(bool lock) override final;
125 
127 
130 
131  void displayMessageOnOSD(const Common::U32String &msg) override final;
132  void displayActivityIconOnOSD(const Graphics::Surface *icon) override final;
133 
134  void saveScreenshot() override final;
135 
137 
138 protected:
141 
142  GraphicsManager *_graphicsManager;
143 
145 };
146 
147 class ModularMixerBackend : virtual public BaseBackend {
148 public:
150  virtual ~ModularMixerBackend();
151 
154 
155  virtual MixerManager *getMixerManager();
156  Audio::Mixer *getMixer() override final;
157 
159 
160 protected:
163 
164  MixerManager *_mixerManager;
165 
167 };
168 
169 #endif
bool setGraphicsMode(int mode, uint flags=kGfxModeNoFlags) override
void initSizeHint(const Graphics::ModeList &modes) override final
void unlockScreen() override final
Definition: modular-backend.h:147
int getScreenChangeID() const override final
Definition: modular-backend.h:48
uint getDefaultScaleFactor() const override final
void clearOverlay() override final
Definition: surface.h:66
Definition: system.h:788
void hideOverlay() override final
void displayMessageOnOSD(const Common::U32String &msg) override final
void fillScreen(uint32 col) override final
virtual Audio::Mixer * getMixer()=0
PaletteManager * getPaletteManager() override final
void warpMouse(int x, int y) override final
Definition: array.h:52
void clearFocusRectangle() override final
Definition: pixelformat.h:138
Definition: system.h:739
bool isOverlayVisible() const override final
Feature
Definition: system.h:417
int getStretchMode() const override final
Definition: list.h:44
int16 getWidth() override final
Definition: rect.h:144
Definition: path.h:52
void setCursorPalette(const byte *colors, uint start, uint num) override final
uint getDefaultScaler() const override final
void copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h) override final
void updateScreen() override final
const GraphicsMode * getSupportedGraphicsModes() const override
void setFocusRectangle(const Common::Rect &rect) override final
int16 getOverlayHeight() override final
int getDefaultGraphicsMode() const override
bool setShader(const Common::Path &name) override final
uint getScaler() const override final
void setFeatureState(Feature f, bool enable) override
int16 getHeight() override final
void grabOverlay(Graphics::Surface &surface) override final
Definition: mixer.h:59
int getGraphicsMode() const override
Definition: ustr.h:57
bool setScaler(uint mode, int factor) override final
Definition: base-backend.h:32
TransactionError
Definition: system.h:1148
void displayActivityIconOnOSD(const Graphics::Surface *icon) override final
float getHiDPIScreenFactor() const override final
bool setStretchMode(int mode) override final
void saveScreenshot() override final
void initSize(uint width, uint height, const Graphics::PixelFormat *format=NULL) override final
bool setScaler(const char *name, int factor) override final
bool getFeatureState(Feature f) override
void setShakePos(int shakeXOffset, int shakeYOffset) override final
bool hasFeature(Feature f) override
int16 getOverlayWidth() override final
Definition: mixer.h:31
Definition: graphics.h:36
uint getScaleFactor() const override final
bool showMouse(bool visible) override final
bool lockMouse(bool lock) override final
Graphics::Surface * lockScreen() override final
void setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale=false, const Graphics::PixelFormat *format=NULL, const byte *mask=NULL) override final
const GraphicsMode * getSupportedStretchModes() const override final
void showOverlay(bool inGUI) override final
void copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h) override final
int getDefaultStretchMode() const override final
OSystem::TransactionError endGFXTransaction() override final
Definition: paletteman.h:46
void beginGFXTransaction() override final
Graphics::PixelFormat getOverlayFormat() const override final