diff options
author | Ray Strode <rstrode@redhat.com> | 2008-07-16 16:46:02 -0400 |
---|---|---|
committer | Ray Strode <rstrode@redhat.com> | 2008-07-29 15:15:51 -0400 |
commit | a5065a34952ac62fa5f9d6a1a779324cd32072f3 (patch) | |
tree | 8f7c28ea3be3c5c60f0b5a65f304ad92d2ab9622 | |
parent | 0470ae47ed1e3b33c835dec6399c4ef1eb64e365 (diff) | |
download | plymouth-a5065a34952ac62fa5f9d6a1a779324cd32072f3.tar.gz plymouth-a5065a34952ac62fa5f9d6a1a779324cd32072f3.tar.xz plymouth-a5065a34952ac62fa5f9d6a1a779324cd32072f3.zip |
Make fade-in plugin provide erase/draw handlers
-rw-r--r-- | src/libplybootsplash/ply-throbber.c | 7 | ||||
-rw-r--r-- | src/splash-plugins/fade-in/plugin.c | 67 |
2 files changed, 63 insertions, 11 deletions
diff --git a/src/libplybootsplash/ply-throbber.c b/src/libplybootsplash/ply-throbber.c index 0dd6dc5..361a24f 100644 --- a/src/libplybootsplash/ply-throbber.c +++ b/src/libplybootsplash/ply-throbber.c @@ -124,9 +124,10 @@ ply_throbber_free (ply_throbber_t *throbber) static void draw_background (ply_throbber_t *throbber) { - ply_frame_buffer_fill_with_gradient (throbber->frame_buffer, &throbber->frame_area, - PLYMOUTH_BACKGROUND_START_COLOR, - PLYMOUTH_BACKGROUND_END_COLOR); + ply_window_erase_area (throbber->window, + throbber->x, throbber->y, + throbber->frame_area.width, + throbber->frame_area.height); } static void diff --git a/src/splash-plugins/fade-in/plugin.c b/src/splash-plugins/fade-in/plugin.c index 892323e..d2df373 100644 --- a/src/splash-plugins/fade-in/plugin.c +++ b/src/splash-plugins/fade-in/plugin.c @@ -196,15 +196,18 @@ destroy_plugin (ply_boot_splash_plugin_t *plugin) static void draw_background (ply_boot_splash_plugin_t *plugin, - ply_frame_buffer_area_t *area) + ply_frame_buffer_area_t *area) { -#if 0 - ply_frame_buffer_fill_with_hex_color (plugin->frame_buffer, area, - PLYMOUTH_BACKGROUND_COLOR); -#else - ply_frame_buffer_fill_with_gradient (plugin->frame_buffer, area, - 0x807c71, 0x3a362f); -#endif + ply_frame_buffer_area_t screen_area; + + if (area == NULL) + { + ply_frame_buffer_get_size (plugin->frame_buffer, &screen_area); + area = &screen_area; + } + + ply_window_erase_area (plugin->window, area->x, area->y, + area->width, area->height); } static void @@ -417,6 +420,46 @@ on_enter (ply_boot_splash_plugin_t *plugin, start_animation (plugin); } +void +on_draw (ply_boot_splash_plugin_t *plugin, + int x, + int y, + int width, + int height) +{ + ply_frame_buffer_area_t area; + + area.x = x; + area.y = y; + area.width = width; + area.height = height; + + draw_background (plugin, &area); + + if (plugin->pending_password_answer != NULL) + draw_password_entry (plugin); + else + animate_at_time (plugin, plugin->now); +} + +void +on_erase (ply_boot_splash_plugin_t *plugin, + int x, + int y, + int width, + int height) +{ + ply_frame_buffer_area_t area; + + area.x = x; + area.y = y; + area.width = width; + area.height = height; + + ply_frame_buffer_fill_with_gradient (plugin->frame_buffer, &area, + 0x807c71, 0x3a362f); +} + bool show_splash_screen (ply_boot_splash_plugin_t *plugin, ply_event_loop_t *loop, @@ -436,6 +479,14 @@ show_splash_screen (ply_boot_splash_plugin_t *plugin, (ply_window_enter_handler_t) on_enter, plugin); + ply_window_set_draw_handler (window, + (ply_window_draw_handler_t) + on_draw, plugin); + + ply_window_set_erase_handler (window, + (ply_window_erase_handler_t) + on_erase, plugin); + plugin->loop = loop; ply_trace ("loading logo image"); |