From 95292027625e905080f37f585402f49ec49bc97f Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sat, 22 Jul 2017 09:14:51 +0200 Subject: moved color handling to video driver from generic VGA driver --- src/gui/composite_widget.c | 2 +- src/gui/composite_widget.h | 2 +- src/gui/desktop.c | 10 +++++----- src/gui/desktop.h | 2 +- src/gui/text_widget.c | 4 ++-- src/gui/text_widget.h | 2 +- src/gui/widget.c | 2 +- src/gui/widget.h | 4 ++-- src/gui/window.c | 2 +- src/gui/window.h | 2 +- 10 files changed, 16 insertions(+), 16 deletions(-) (limited to 'src/gui') diff --git a/src/gui/composite_widget.c b/src/gui/composite_widget.c index 07056c0..e167b43 100644 --- a/src/gui/composite_widget.c +++ b/src/gui/composite_widget.c @@ -18,7 +18,7 @@ static composite_widget_vtable_t const composite_widget_vtable = { composite_widget_add_child }; -void composite_widget_init( composite_widget_t *widget, widget_t *parent, const int x, const int y, const int w, const int h, const vga_color_t background_color ) +void composite_widget_init( composite_widget_t *widget, widget_t *parent, const int x, const int y, const int w, const int h, const video_rgb_color_t background_color ) { memset( widget, 0, sizeof( composite_widget_t ) ); diff --git a/src/gui/composite_widget.h b/src/gui/composite_widget.h index c055e09..ed8518d 100644 --- a/src/gui/composite_widget.h +++ b/src/gui/composite_widget.h @@ -17,7 +17,7 @@ typedef struct { widget_t *focused_child; } composite_widget_t; -void composite_widget_init( composite_widget_t *widget, widget_t *parent, const int x, const int y, const int w, const int h, const vga_color_t background_color ); +void composite_widget_init( composite_widget_t *widget, widget_t *parent, const int x, const int y, const int w, const int h, const video_rgb_color_t background_color ); void composite_widget_draw( void *obj, graphics_context_t *context ); void composite_widget_get_focus( void *obj, widget_t *widget ); diff --git a/src/gui/desktop.c b/src/gui/desktop.c index e0cb69b..33afed6 100644 --- a/src/gui/desktop.c +++ b/src/gui/desktop.c @@ -20,7 +20,7 @@ static desktop_vtable_t const desktop_vtable = { } }; -void desktop_init( desktop_t *desktop, const int w, const int h, const vga_color_t background_color ) +void desktop_init( desktop_t *desktop, const int w, const int h, const video_rgb_color_t background_color ) { memset( desktop, 0, sizeof( desktop_t ) ); @@ -47,16 +47,16 @@ void desktop_draw( void *obj, graphics_context_t *context ) for( int i = 0; i < 4; i++ ) { if( desktop->mouse_x > i ) { - vga_set_pixel( context, desktop->mouse_x - i, desktop->mouse_y, VGA_COLOR_WHITE ); + vga_set_pixel( context, desktop->mouse_x - i, desktop->mouse_y, VIDEO_RGB_COLOR_WHITE ); } if( desktop->mouse_x < context->mode->base.x - i ) { - vga_set_pixel( context, desktop->mouse_x + i, desktop->mouse_y, VGA_COLOR_WHITE ); + vga_set_pixel( context, desktop->mouse_x + i, desktop->mouse_y, VIDEO_RGB_COLOR_WHITE ); } if( desktop->mouse_y > i ) { - vga_set_pixel( context, desktop->mouse_x, desktop->mouse_y - i, VGA_COLOR_WHITE ); + vga_set_pixel( context, desktop->mouse_x, desktop->mouse_y - i, VIDEO_RGB_COLOR_WHITE ); } if( desktop->mouse_y < context->mode->base.y - i ) { - vga_set_pixel( context, desktop->mouse_x, desktop->mouse_y + i, VGA_COLOR_WHITE ); + vga_set_pixel( context, desktop->mouse_x, desktop->mouse_y + i, VIDEO_RGB_COLOR_WHITE ); } } diff --git a/src/gui/desktop.h b/src/gui/desktop.h index 09a2d75..4215a79 100644 --- a/src/gui/desktop.h +++ b/src/gui/desktop.h @@ -18,7 +18,7 @@ typedef struct { bool needs_redrawing; } desktop_t; -void desktop_init( desktop_t *widget, const int w, const int h, const vga_color_t background_color ); +void desktop_init( desktop_t *widget, const int w, const int h, const video_rgb_color_t background_color ); void desktop_draw( void *obj, graphics_context_t *context ); void desktop_on_mouse_down( void *obj, const int x, const int y ); diff --git a/src/gui/text_widget.c b/src/gui/text_widget.c index 5e468c7..3aa09cc 100644 --- a/src/gui/text_widget.c +++ b/src/gui/text_widget.c @@ -18,7 +18,7 @@ static text_widget_vtable_t const text_widget_vtable = { text_widget_set_text }; -void text_widget_init( text_widget_t *widget, widget_t *parent, const int x, const int y, const int w, const int h, const vga_color_t background_color, const char *s ) +void text_widget_init( text_widget_t *widget, widget_t *parent, const int x, const int y, const int w, const int h, const video_rgb_color_t background_color, const char *s ) { memset( widget, 0, sizeof( text_widget_t ) ); @@ -47,7 +47,7 @@ void text_widget_draw( void *obj, graphics_context_t *context ) for( const char *p = widget->s; *p != '\0'; p++ ) { vga_draw_char( context, *p, x + w, y + h, ((widget_t *)widget)->background_color, - VGA_COLOR_WHITE ); + VIDEO_RGB_COLOR_WHITE ); w += 9; if( w >= ((widget_t *)widget)->w - 10 ) { h += 16; diff --git a/src/gui/text_widget.h b/src/gui/text_widget.h index 2604eff..305ec65 100644 --- a/src/gui/text_widget.h +++ b/src/gui/text_widget.h @@ -15,7 +15,7 @@ typedef struct { char s[TEXT_WIDGET_MAX_TEXT_SIZE]; } text_widget_t; -void text_widget_init( text_widget_t *widget, widget_t *parent, const int x, const int y, const int w, const int h, const vga_color_t background_color, const char *s ); +void text_widget_init( text_widget_t *widget, widget_t *parent, const int x, const int y, const int w, const int h, const video_rgb_color_t background_color, const char *s ); void text_widget_draw( void *obj, graphics_context_t *context ); void text_widget_set_text( void *obj, const char *s ); diff --git a/src/gui/widget.c b/src/gui/widget.c index 58b03ef..70e0dbc 100644 --- a/src/gui/widget.c +++ b/src/gui/widget.c @@ -15,7 +15,7 @@ static widget_vtable_t const widget_vtable = { widget_on_key_up }; -void widget_init( widget_t *widget, widget_t *parent, const int x, const int y, const int w, const int h, const vga_color_t background_color ) +void widget_init( widget_t *widget, widget_t *parent, const int x, const int y, const int w, const int h, const video_rgb_color_t background_color ) { memset( widget, 0, sizeof( widget_t ) ); diff --git a/src/gui/widget.h b/src/gui/widget.h index 87b8c62..01ce361 100644 --- a/src/gui/widget.h +++ b/src/gui/widget.h @@ -24,13 +24,13 @@ typedef struct widget_t { int y; int w; int h; - vga_color_t background_color; + video_rgb_color_t background_color; bool focusable; struct widget_t *parent; widget_vtable_t const *vtable; } widget_t; -void widget_init( widget_t *widget, widget_t *parent, const int x, const int y, const int w, const int h, const vga_color_t background_color ); +void widget_init( widget_t *widget, widget_t *parent, const int x, const int y, const int w, const int h, const video_rgb_color_t background_color ); void widget_draw( void *obj, graphics_context_t *context ); void widget_get_focus( void *obj, widget_t *widget ); diff --git a/src/gui/window.c b/src/gui/window.c index 681c3b7..1cb1fb1 100644 --- a/src/gui/window.c +++ b/src/gui/window.c @@ -21,7 +21,7 @@ static window_vtable_t const window_vtable = { }; -void window_init( window_t *window, widget_t *parent, const int x, const int y, const int w, const int h, const vga_color_t background_color ) +void window_init( window_t *window, widget_t *parent, const int x, const int y, const int w, const int h, const video_rgb_color_t background_color ) { memset( window, 0, sizeof( window_t ) ); diff --git a/src/gui/window.h b/src/gui/window.h index 793d8b3..269ff8c 100644 --- a/src/gui/window.h +++ b/src/gui/window.h @@ -14,7 +14,7 @@ typedef struct { bool dragging; } window_t; -void window_init( window_t *window, widget_t *parent, const int x, const int y, const int w, const int h, const vga_color_t background_color ); +void window_init( window_t *window, widget_t *parent, const int x, const int y, const int w, const int h, const video_rgb_color_t background_color ); void window_draw( void *obj, graphics_context_t *context ); void window_on_mouse_down( void *obj, const int x, const int y ); -- cgit v1.2.3-54-g00ecf