summaryrefslogtreecommitdiff
path: root/src/drivers/video/video.h
diff options
context:
space:
mode:
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