summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2008-07-16 16:48:26 -0400
committerRay Strode <rstrode@redhat.com>2008-07-29 15:15:51 -0400
commit0470ae47ed1e3b33c835dec6399c4ef1eb64e365 (patch)
treee06a1d4fb4b82db5227bd6b63b0da5beee780f9a
parent4848ce9c05eb57a2b504efb1fa09281cac8262aa (diff)
downloadplymouth-0470ae47ed1e3b33c835dec6399c4ef1eb64e365.tar.gz
plymouth-0470ae47ed1e3b33c835dec6399c4ef1eb64e365.tar.xz
plymouth-0470ae47ed1e3b33c835dec6399c4ef1eb64e365.zip
Make spinfinity plugin provide erase/draw handlers
-rw-r--r--src/splash-plugins/spinfinity/plugin.c67
1 files changed, 64 insertions, 3 deletions
diff --git a/src/splash-plugins/spinfinity/plugin.c b/src/splash-plugins/spinfinity/plugin.c
index 454071b..9616494 100644
--- a/src/splash-plugins/spinfinity/plugin.c
+++ b/src/splash-plugins/spinfinity/plugin.c
@@ -148,9 +148,16 @@ static void
draw_background (ply_boot_splash_plugin_t *plugin,
ply_frame_buffer_area_t *area)
{
- ply_frame_buffer_fill_with_gradient (plugin->frame_buffer, area,
- PLYMOUTH_BACKGROUND_START_COLOR,
- PLYMOUTH_BACKGROUND_END_COLOR);
+ 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
@@ -284,6 +291,47 @@ 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
+ draw_logo (plugin);
+}
+
+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,
+ PLYMOUTH_BACKGROUND_START_COLOR,
+ PLYMOUTH_BACKGROUND_END_COLOR);
+}
+
bool
show_splash_screen (ply_boot_splash_plugin_t *plugin,
ply_event_loop_t *loop,
@@ -303,6 +351,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");
@@ -369,6 +425,8 @@ hide_splash_screen (ply_boot_splash_plugin_t *plugin,
ply_window_set_keyboard_input_handler (window, NULL, NULL);
ply_window_set_backspace_handler (window, NULL, NULL);
ply_window_set_enter_handler (window, NULL, NULL);
+ ply_window_set_draw_handler (window, NULL, NULL);
+ ply_window_set_erase_handler (window, NULL, NULL);
if (plugin->loop != NULL)
{
@@ -392,6 +450,9 @@ draw_password_entry (ply_boot_splash_plugin_t *plugin)
uint32_t *box_data, *lock_data, *entry_data, *bullet_data;
int i;
+ if (plugin->pending_password_answer == NULL)
+ return;
+
ply_frame_buffer_pause_updates (plugin->frame_buffer);
entry_data = ply_image_get_data (plugin->entry_image);