diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2017-07-21 21:10:12 +0200 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2017-07-21 21:10:12 +0200 |
commit | 6c1633b80a30c639bc096cc4b98a1da998af38c2 (patch) | |
tree | 0f45096ba3d4cfcb92ae84274e2ce2d53d95f3f7 /src/gui | |
parent | 3e9f594c7e06017b5d919d79530c39a58de8a3c7 (diff) | |
download | abaos-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/gui')
-rw-r--r-- | src/gui/desktop.c | 4 | ||||
-rw-r--r-- | src/gui/window.c | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/gui/desktop.c b/src/gui/desktop.c index 9851b78..e0cb69b 100644 --- a/src/gui/desktop.c +++ b/src/gui/desktop.c @@ -49,13 +49,13 @@ void desktop_draw( void *obj, graphics_context_t *context ) if( desktop->mouse_x > i ) { vga_set_pixel( context, desktop->mouse_x - i, desktop->mouse_y, VGA_COLOR_WHITE ); } - if( desktop->mouse_x < context->mode.x - i ) { + if( desktop->mouse_x < context->mode->base.x - i ) { vga_set_pixel( context, desktop->mouse_x + i, desktop->mouse_y, VGA_COLOR_WHITE ); } if( desktop->mouse_y > i ) { vga_set_pixel( context, desktop->mouse_x, desktop->mouse_y - i, VGA_COLOR_WHITE ); } - if( desktop->mouse_y < context->mode.y - i ) { + if( desktop->mouse_y < context->mode->base.y - i ) { vga_set_pixel( context, desktop->mouse_x, desktop->mouse_y + i, VGA_COLOR_WHITE ); } } diff --git a/src/gui/window.c b/src/gui/window.c index fd53920..681c3b7 100644 --- a/src/gui/window.c +++ b/src/gui/window.c @@ -39,14 +39,14 @@ void window_draw( void *obj, graphics_context_t *context ) if( ((widget_t *)widget)->x < 0 ) { ((widget_t *)widget)->x = 0; } - if( ((widget_t *)widget)->x > context->mode.x - ((widget_t *)widget)->w ) { - ((widget_t *)widget)->x = context->mode.x - ((widget_t *)widget)->w; + if( ((widget_t *)widget)->x > context->mode->base.x - ((widget_t *)widget)->w ) { + ((widget_t *)widget)->x = context->mode->base.x - ((widget_t *)widget)->w; } if( ((widget_t *)widget)->y < 0 ) { ((widget_t *)widget)->y = 0; } - if( ((widget_t *)widget)->y > context->mode.y - ((widget_t *)widget)->h ) { - ((widget_t *)widget)->y = context->mode.y - ((widget_t *)widget)->h; + if( ((widget_t *)widget)->y > context->mode->base.y - ((widget_t *)widget)->h ) { + ((widget_t *)widget)->y = context->mode->base.y - ((widget_t *)widget)->h; } composite_widget_draw( obj, context ); |