From 6c1633b80a30c639bc096cc4b98a1da998af38c2 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Fri, 21 Jul 2017 21:10:12 +0200 Subject: 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 --- src/drivers/video/video.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src/drivers/video/video.h') 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 + +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 -- cgit v1.2.3-54-g00ecf