summaryrefslogtreecommitdiff
path: root/src/drivers/video/video.h
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2017-07-21 21:10:12 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2017-07-21 21:10:12 +0200
commit6c1633b80a30c639bc096cc4b98a1da998af38c2 (patch)
tree0f45096ba3d4cfcb92ae84274e2ce2d53d95f3f7 /src/drivers/video/video.h
parent3e9f594c7e06017b5d919d79530c39a58de8a3c7 (diff)
downloadabaos-6c1633b80a30c639bc096cc4b98a1da998af38c2.tar.gz
abaos-6c1633b80a30c639bc096cc4b98a1da998af38c2.tar.bz2
changed video mode management, moved to video driver,
the VGA driver registers his specific mode data with the video driver kernel function now use virtual functions of the video driver
Diffstat (limited to 'src/drivers/video/video.h')
-rw-r--r--src/drivers/video/video.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/drivers/video/video.h b/src/drivers/video/video.h
index 713aa4f..d17a51d 100644
--- a/src/drivers/video/video.h
+++ b/src/drivers/video/video.h
@@ -3,12 +3,34 @@
#include "driver.h"
+#include <stdbool.h>
+
+typedef enum {
+ VIDEO_MODE_TYPE_TEXT,
+ VIDEO_MODE_TYPE_GRAPHICS
+} video_mode_type_t;
+
+#define MAX_NOF_VIDEO_MODES 255
+
+typedef struct {
+ video_mode_type_t mode_type;
+ int x;
+ int y;
+ int color_depth;
+} video_mode_t;
+
typedef struct {
driver_t base;
+ unsigned int nof_modes;
+ const video_mode_t *modes[MAX_NOF_VIDEO_MODES];
} video_t;
typedef struct {
driver_vtable_t base;
+ void (*register_mode)( void *obj, const video_mode_t *mode );
+ bool (*supports_mode)( void *obj, const video_mode_t mode );
+ bool (*set_mode)( void *obj, const video_mode_t mode );
+ bool (*switch_mode)( void *obj, const video_mode_t *mode );
} video_vtable_t;
void video_init( video_t *video, interrupt_t *interrupt, void *context );
@@ -17,4 +39,11 @@ void video_deactivate( void *obj );
void video_deinit( void *obj );
void video_print_info( void *obj );
+video_mode_t video_make_mode( const video_mode_type_t mode_type, const int x, const int y, const int color_depth );
+
+void video_register_mode( void *obj, const video_mode_t *mode );
+bool video_supports_mode( void *obj, const video_mode_t mode );
+bool video_set_mode( void *obj, const video_mode_t mode );
+bool video_switch_mode( void *obj, const video_mode_t *mode );
+
#endif // VIDEO_H