2012-05-02 00:43:55 +00:00
|
|
|
/*******************************************************************************
|
|
|
|
|
2013-07-10 13:26:01 +00:00
|
|
|
Copyright(C) Jonas 'Sortie' Termansen 2012.
|
2012-05-02 00:43:55 +00:00
|
|
|
|
2013-07-10 13:26:01 +00:00
|
|
|
This file is part of Sortix.
|
2012-05-02 00:43:55 +00:00
|
|
|
|
2013-07-10 13:26:01 +00:00
|
|
|
Sortix 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 3 of the License, or (at your option) any later
|
|
|
|
version.
|
2012-05-02 00:43:55 +00:00
|
|
|
|
2013-07-10 13:26:01 +00:00
|
|
|
Sortix 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.
|
2012-05-02 00:43:55 +00:00
|
|
|
|
2013-07-10 13:26:01 +00:00
|
|
|
You should have received a copy of the GNU General Public License along with
|
|
|
|
Sortix. If not, see <http://www.gnu.org/licenses/>.
|
2012-05-02 00:43:55 +00:00
|
|
|
|
2013-07-10 13:26:01 +00:00
|
|
|
sortix/kernel/video.h
|
|
|
|
Framework for Sortix video drivers.
|
2012-05-02 00:43:55 +00:00
|
|
|
|
|
|
|
*******************************************************************************/
|
|
|
|
|
|
|
|
#ifndef SORTIX_VIDEO_H
|
|
|
|
#define SORTIX_VIDEO_H
|
|
|
|
|
2012-08-07 22:19:44 +00:00
|
|
|
#include <sortix/kernel/refcount.h>
|
|
|
|
|
2012-05-02 00:43:55 +00:00
|
|
|
namespace Sortix {
|
|
|
|
|
|
|
|
class TextBuffer;
|
|
|
|
class TextBufferHandle;
|
|
|
|
|
|
|
|
bool ReadParamString(const char* str, ...);
|
|
|
|
|
|
|
|
class VideoDriver
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~VideoDriver() { }
|
|
|
|
virtual bool StartUp() = 0;
|
|
|
|
virtual bool ShutDown() = 0;
|
|
|
|
virtual char* GetCurrentMode() const = 0;
|
|
|
|
virtual bool SwitchMode(const char* mode) = 0;
|
|
|
|
virtual bool Supports(const char* mode) const = 0;
|
|
|
|
virtual char** GetModes(size_t* nummodes) const = 0;
|
|
|
|
virtual off_t FrameSize() const = 0;
|
|
|
|
virtual ssize_t WriteAt(off_t off, const void* buf, size_t count) = 0;
|
|
|
|
virtual ssize_t ReadAt(off_t off, void* buf, size_t count) = 0;
|
|
|
|
virtual TextBuffer* CreateTextBuffer() = 0;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
namespace Video {
|
|
|
|
|
2012-08-07 22:19:44 +00:00
|
|
|
void Init(Ref<TextBufferHandle> textbufhandle);
|
2012-05-02 00:43:55 +00:00
|
|
|
bool RegisterDriver(const char* name, VideoDriver* driver);
|
|
|
|
char* GetCurrentMode();
|
2012-12-16 01:06:29 +00:00
|
|
|
char* GetDriverName(size_t index);
|
|
|
|
size_t GetCurrentDriverIndex();
|
|
|
|
size_t GetNumDrivers();
|
|
|
|
size_t LookupDriverIndexOfMode(const char* mode);
|
2012-05-02 00:43:55 +00:00
|
|
|
bool Supports(const char* mode);
|
|
|
|
bool SwitchMode(const char* mode);
|
|
|
|
char** GetModes(size_t* modesnum);
|
|
|
|
off_t FrameSize();
|
|
|
|
ssize_t WriteAt(off_t off, const void* buf, size_t count);
|
|
|
|
ssize_t ReadAt(off_t off, void* buf, size_t count);
|
|
|
|
|
|
|
|
} // namespace Video
|
|
|
|
|
|
|
|
} // namespace Sortix
|
|
|
|
|
|
|
|
#endif
|