From 6a52a168eeb54938c757d3be560f7ba8b30aa7c0 Mon Sep 17 00:00:00 2001 From: Alejandro Marzini Date: Tue, 15 Jun 2010 03:49:20 +0000 Subject: Renamed abstract Manager files. svn-id: r49677 --- backends/audiocd/abstract-audiocd.h | 132 ----------------------------- backends/audiocd/audiocd.h | 132 +++++++++++++++++++++++++++++ backends/audiocd/default/default-audiocd.h | 2 +- backends/graphics/abstract-graphics.h | 85 ------------------- backends/graphics/graphics.h | 85 +++++++++++++++++++ backends/graphics/null/null-graphics.h | 2 +- backends/graphics/sdl/sdl-graphics.h | 2 +- backends/mutex/abstract-mutex.h | 43 ---------- backends/mutex/mutex.h | 43 ++++++++++ backends/mutex/null/null-mutex.h | 2 +- backends/mutex/sdl/sdl-mutex.h | 2 +- 11 files changed, 265 insertions(+), 265 deletions(-) delete mode 100644 backends/audiocd/abstract-audiocd.h create mode 100644 backends/audiocd/audiocd.h delete mode 100644 backends/graphics/abstract-graphics.h create mode 100644 backends/graphics/graphics.h delete mode 100644 backends/mutex/abstract-mutex.h create mode 100644 backends/mutex/mutex.h (limited to 'backends') diff --git a/backends/audiocd/abstract-audiocd.h b/backends/audiocd/abstract-audiocd.h deleted file mode 100644 index 41634b38fb..0000000000 --- a/backends/audiocd/abstract-audiocd.h +++ /dev/null @@ -1,132 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#ifndef BACKENDS_AUDIOCD_ABSTRACT_H -#define BACKENDS_AUDIOCD_ABSTRACT_H - -#include "common/noncopyable.h" - -/** -* Abstract Audio CD manager class. Private subclasses implement the actual -* functionality. -*/ -class AudioCDManager : Common::NonCopyable { -public: - virtual ~AudioCDManager() {} - - - struct Status { - bool playing; - int track; - int start; - int duration; - int numLoops; - }; - - /** - * @name Emulated playback functions - * Engines should call these functions. Not all platforms - * support cd playback, and these functions should try to - * emulate it. - */ - //@{ - - /** - * Start audio CD playback - * @param track the track to play. - * @param num_loops how often playback should be repeated (-1 = infinitely often). - * @param start_frame the frame at which playback should start (75 frames = 1 second). - * @param duration the number of frames to play. - * @param only_emulate determines if the track should be emulated only - */ - virtual void play(int track, int numLoops, int startFrame, int duration, bool only_emulate = false) = 0; - - /** - * Get if audio is being played. - * @return true if CD or emulated audio is playing - */ - virtual bool isPlaying() const = 0; - - /** - * Stop CD or emulated audio playback. - */ - virtual void stop() = 0; - - /** - * Update CD or emulated audio status. - */ - virtual void update() = 0; - - /** - * Get the playback status. - * @return a Status struct with playback data. - */ - virtual Status getStatus() const = 0; - - //@} - - - /** - * @name Real CD audio methods - * These functions should be called from the emulated - * ones if they can't emulate the audio playback. - */ - //@{ - - /** - * Initialise the specified CD drive for audio playback. - * @return true if the CD drive was inited succesfully - */ - virtual bool openCD(int drive) = 0; - - /** - * Poll CD status. - * @return true if CD audio is playing - */ - virtual bool pollCD() const = 0; - - /** - * Start CD audio playback. - * @param track the track to play. - * @param num_loops how often playback should be repeated (-1 = infinitely often). - * @param start_frame the frame at which playback should start (75 frames = 1 second). - * @param duration the number of frames to play. - */ - virtual void playCD(int track, int num_loops, int start_frame, int duration) = 0; - - /** - * Stop CD audio playback. - */ - virtual void stopCD() = 0; - - /** - * Update CD audio status. - */ - virtual void updateCD() = 0; - - //@} -}; - -#endif diff --git a/backends/audiocd/audiocd.h b/backends/audiocd/audiocd.h new file mode 100644 index 0000000000..41634b38fb --- /dev/null +++ b/backends/audiocd/audiocd.h @@ -0,0 +1,132 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + +#ifndef BACKENDS_AUDIOCD_ABSTRACT_H +#define BACKENDS_AUDIOCD_ABSTRACT_H + +#include "common/noncopyable.h" + +/** +* Abstract Audio CD manager class. Private subclasses implement the actual +* functionality. +*/ +class AudioCDManager : Common::NonCopyable { +public: + virtual ~AudioCDManager() {} + + + struct Status { + bool playing; + int track; + int start; + int duration; + int numLoops; + }; + + /** + * @name Emulated playback functions + * Engines should call these functions. Not all platforms + * support cd playback, and these functions should try to + * emulate it. + */ + //@{ + + /** + * Start audio CD playback + * @param track the track to play. + * @param num_loops how often playback should be repeated (-1 = infinitely often). + * @param start_frame the frame at which playback should start (75 frames = 1 second). + * @param duration the number of frames to play. + * @param only_emulate determines if the track should be emulated only + */ + virtual void play(int track, int numLoops, int startFrame, int duration, bool only_emulate = false) = 0; + + /** + * Get if audio is being played. + * @return true if CD or emulated audio is playing + */ + virtual bool isPlaying() const = 0; + + /** + * Stop CD or emulated audio playback. + */ + virtual void stop() = 0; + + /** + * Update CD or emulated audio status. + */ + virtual void update() = 0; + + /** + * Get the playback status. + * @return a Status struct with playback data. + */ + virtual Status getStatus() const = 0; + + //@} + + + /** + * @name Real CD audio methods + * These functions should be called from the emulated + * ones if they can't emulate the audio playback. + */ + //@{ + + /** + * Initialise the specified CD drive for audio playback. + * @return true if the CD drive was inited succesfully + */ + virtual bool openCD(int drive) = 0; + + /** + * Poll CD status. + * @return true if CD audio is playing + */ + virtual bool pollCD() const = 0; + + /** + * Start CD audio playback. + * @param track the track to play. + * @param num_loops how often playback should be repeated (-1 = infinitely often). + * @param start_frame the frame at which playback should start (75 frames = 1 second). + * @param duration the number of frames to play. + */ + virtual void playCD(int track, int num_loops, int start_frame, int duration) = 0; + + /** + * Stop CD audio playback. + */ + virtual void stopCD() = 0; + + /** + * Update CD audio status. + */ + virtual void updateCD() = 0; + + //@} +}; + +#endif diff --git a/backends/audiocd/default/default-audiocd.h b/backends/audiocd/default/default-audiocd.h index af75572788..4669382a53 100644 --- a/backends/audiocd/default/default-audiocd.h +++ b/backends/audiocd/default/default-audiocd.h @@ -26,7 +26,7 @@ #ifndef BACKENDS_AUDIOCD_DEFAULT_H #define BACKENDS_AUDIOCD_DEFAULT_H -#include "backends/audiocd/abstract-audiocd.h" +#include "backends/audiocd/audiocd.h" #include "sound/mixer.h" class DefaultAudioCDManager : AudioCDManager { diff --git a/backends/graphics/abstract-graphics.h b/backends/graphics/abstract-graphics.h deleted file mode 100644 index 6037bb10e3..0000000000 --- a/backends/graphics/abstract-graphics.h +++ /dev/null @@ -1,85 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#ifndef BACKENDS_GRAPHICS_ABSTRACT_H -#define BACKENDS_GRAPHICS_ABSTRACT_H - -#include "common/system.h" -#include "common/noncopyable.h" - -class GraphicsManager : Common::NonCopyable { -public: - virtual ~GraphicsManager() {} - - virtual bool hasFeature(OSystem::Feature f) = 0; - virtual void setFeatureState(OSystem::Feature f, bool enable) = 0; - virtual bool getFeatureState(OSystem::Feature f) = 0; - - virtual const OSystem::GraphicsMode *getSupportedGraphicsModes() const = 0; - virtual int getDefaultGraphicsMode() const = 0; - virtual bool setGraphicsMode(int mode) = 0; - virtual int getGraphicsMode() const = 0; -#ifdef USE_RGB_COLOR - virtual Graphics::PixelFormat getScreenFormat() const = 0; - virtual Common::List getSupportedFormats() = 0; -#endif - virtual void initSize(uint width, uint height, const Graphics::PixelFormat *format = NULL) = 0; - virtual int getScreenChangeID() const = 0; - - virtual void beginGFXTransaction() = 0; - virtual OSystem::TransactionError endGFXTransaction() = 0; - - virtual int16 getHeight() = 0; - virtual int16 getWidth() = 0; - virtual void setPalette(const byte *colors, uint start, uint num) = 0; - virtual void grabPalette(byte *colors, uint start, uint num) = 0; - virtual void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h) = 0; - virtual Graphics::Surface *lockScreen() = 0; - virtual void unlockScreen() = 0; - virtual void fillScreen(uint32 col) = 0; - virtual void updateScreen() = 0; - virtual void setShakePos(int shakeOffset) = 0; - virtual void setFocusRectangle(const Common::Rect& rect) = 0; - virtual void clearFocusRectangle() = 0; - - virtual void showOverlay() = 0; - virtual void hideOverlay() = 0; - virtual Graphics::PixelFormat getOverlayFormat() const = 0; - virtual void clearOverlay() = 0; - virtual void grabOverlay(OverlayColor *buf, int pitch) = 0; - virtual void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h)= 0; - virtual int16 getOverlayHeight() = 0; - virtual int16 getOverlayWidth() = 0; - - virtual bool showMouse(bool visible) = 0; - virtual void warpMouse(int x, int y) = 0; - virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale = 1, const Graphics::PixelFormat *format = NULL) = 0; - virtual void setCursorPalette(const byte *colors, uint start, uint num) = 0; - virtual void disableCursorPalette(bool disable) = 0; - - virtual void displayMessageOnOSD(const char *msg) {} -}; - -#endif diff --git a/backends/graphics/graphics.h b/backends/graphics/graphics.h new file mode 100644 index 0000000000..6037bb10e3 --- /dev/null +++ b/backends/graphics/graphics.h @@ -0,0 +1,85 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + +#ifndef BACKENDS_GRAPHICS_ABSTRACT_H +#define BACKENDS_GRAPHICS_ABSTRACT_H + +#include "common/system.h" +#include "common/noncopyable.h" + +class GraphicsManager : Common::NonCopyable { +public: + virtual ~GraphicsManager() {} + + virtual bool hasFeature(OSystem::Feature f) = 0; + virtual void setFeatureState(OSystem::Feature f, bool enable) = 0; + virtual bool getFeatureState(OSystem::Feature f) = 0; + + virtual const OSystem::GraphicsMode *getSupportedGraphicsModes() const = 0; + virtual int getDefaultGraphicsMode() const = 0; + virtual bool setGraphicsMode(int mode) = 0; + virtual int getGraphicsMode() const = 0; +#ifdef USE_RGB_COLOR + virtual Graphics::PixelFormat getScreenFormat() const = 0; + virtual Common::List getSupportedFormats() = 0; +#endif + virtual void initSize(uint width, uint height, const Graphics::PixelFormat *format = NULL) = 0; + virtual int getScreenChangeID() const = 0; + + virtual void beginGFXTransaction() = 0; + virtual OSystem::TransactionError endGFXTransaction() = 0; + + virtual int16 getHeight() = 0; + virtual int16 getWidth() = 0; + virtual void setPalette(const byte *colors, uint start, uint num) = 0; + virtual void grabPalette(byte *colors, uint start, uint num) = 0; + virtual void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h) = 0; + virtual Graphics::Surface *lockScreen() = 0; + virtual void unlockScreen() = 0; + virtual void fillScreen(uint32 col) = 0; + virtual void updateScreen() = 0; + virtual void setShakePos(int shakeOffset) = 0; + virtual void setFocusRectangle(const Common::Rect& rect) = 0; + virtual void clearFocusRectangle() = 0; + + virtual void showOverlay() = 0; + virtual void hideOverlay() = 0; + virtual Graphics::PixelFormat getOverlayFormat() const = 0; + virtual void clearOverlay() = 0; + virtual void grabOverlay(OverlayColor *buf, int pitch) = 0; + virtual void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h)= 0; + virtual int16 getOverlayHeight() = 0; + virtual int16 getOverlayWidth() = 0; + + virtual bool showMouse(bool visible) = 0; + virtual void warpMouse(int x, int y) = 0; + virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale = 1, const Graphics::PixelFormat *format = NULL) = 0; + virtual void setCursorPalette(const byte *colors, uint start, uint num) = 0; + virtual void disableCursorPalette(bool disable) = 0; + + virtual void displayMessageOnOSD(const char *msg) {} +}; + +#endif diff --git a/backends/graphics/null/null-graphics.h b/backends/graphics/null/null-graphics.h index 8423f4f5da..3ee99be93d 100644 --- a/backends/graphics/null/null-graphics.h +++ b/backends/graphics/null/null-graphics.h @@ -26,7 +26,7 @@ #ifndef BACKENDS_GRAPHICS_NULL_H #define BACKENDS_GRAPHICS_NULL_H -#include "backends/graphics/abstract-graphics.h" +#include "backends/graphics/graphics.h" static const OSystem::GraphicsMode s_noGraphicsModes[] = { {0, 0, 0} }; diff --git a/backends/graphics/sdl/sdl-graphics.h b/backends/graphics/sdl/sdl-graphics.h index 1ba0074bd1..84bb439783 100644 --- a/backends/graphics/sdl/sdl-graphics.h +++ b/backends/graphics/sdl/sdl-graphics.h @@ -26,7 +26,7 @@ #ifndef BACKENDS_GRAPHICS_SDL_H #define BACKENDS_GRAPHICS_SDL_H -#include "backends/graphics/abstract-graphics.h" +#include "backends/graphics/graphics.h" #include "common/system.h" #include "graphics/scaler.h" diff --git a/backends/mutex/abstract-mutex.h b/backends/mutex/abstract-mutex.h deleted file mode 100644 index d8647bae13..0000000000 --- a/backends/mutex/abstract-mutex.h +++ /dev/null @@ -1,43 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#ifndef BACKENDS_MUTEX_ABSTRACT_H -#define BACKENDS_MUTEX_ABSTRACT_H - -#include "common/system.h" -#include "common/noncopyable.h" - -class MutexManager : Common::NonCopyable { -public: - virtual ~MutexManager() {} - - virtual OSystem::MutexRef createMutex() = 0; - virtual void lockMutex(OSystem::MutexRef mutex) = 0; - virtual void unlockMutex(OSystem::MutexRef mutex) = 0; - virtual void deleteMutex(OSystem::MutexRef mutex) = 0; -}; - - -#endif diff --git a/backends/mutex/mutex.h b/backends/mutex/mutex.h new file mode 100644 index 0000000000..d8647bae13 --- /dev/null +++ b/backends/mutex/mutex.h @@ -0,0 +1,43 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + +#ifndef BACKENDS_MUTEX_ABSTRACT_H +#define BACKENDS_MUTEX_ABSTRACT_H + +#include "common/system.h" +#include "common/noncopyable.h" + +class MutexManager : Common::NonCopyable { +public: + virtual ~MutexManager() {} + + virtual OSystem::MutexRef createMutex() = 0; + virtual void lockMutex(OSystem::MutexRef mutex) = 0; + virtual void unlockMutex(OSystem::MutexRef mutex) = 0; + virtual void deleteMutex(OSystem::MutexRef mutex) = 0; +}; + + +#endif diff --git a/backends/mutex/null/null-mutex.h b/backends/mutex/null/null-mutex.h index 76bb595631..ddfe23bdee 100644 --- a/backends/mutex/null/null-mutex.h +++ b/backends/mutex/null/null-mutex.h @@ -26,7 +26,7 @@ #ifndef BACKENDS_MUTEX_NULL_H #define BACKENDS_MUTEX_NULL_H -#include "backends/mutex/abstract-mutex.h" +#include "backends/mutex/mutex.h" class NullMutexManager : MutexManager { public: diff --git a/backends/mutex/sdl/sdl-mutex.h b/backends/mutex/sdl/sdl-mutex.h index acd13a879d..a929ea495f 100644 --- a/backends/mutex/sdl/sdl-mutex.h +++ b/backends/mutex/sdl/sdl-mutex.h @@ -26,7 +26,7 @@ #ifndef BACKENDS_MUTEX_SDL_H #define BACKENDS_MUTEX_SDL_H -#include "backends/mutex/abstract-mutex.h" +#include "backends/mutex/mutex.h" class SdlMutexManager : public MutexManager { public: -- cgit v1.2.3