From 788359b9ece1076bf9d154b75b4d4c6ba1ee389f Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Thu, 29 May 2008 01:12:17 -0400 Subject: [PATCH] Change throbber to take window instead of framebuffer We want the throbber to know about the window it's in, so that it will be easier to move drawing code to a draw handler model --- src/splash-plugins/spinfinity/plugin.c | 2 +- src/splash-plugins/spinfinity/throbber.c | 7 +++++-- src/splash-plugins/spinfinity/throbber.h | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/splash-plugins/spinfinity/plugin.c b/src/splash-plugins/spinfinity/plugin.c index 1022292..4bc8774 100644 --- a/src/splash-plugins/spinfinity/plugin.c +++ b/src/splash-plugins/spinfinity/plugin.c @@ -189,7 +189,7 @@ start_animation (ply_boot_splash_plugin_t *plugin) height = throbber_get_height (plugin->throbber); throbber_start (plugin->throbber, plugin->loop, - plugin->frame_buffer, + plugin->window, area.width / 2.0 - width / 2.0, area.width / 2.0 - height / 2.0); } diff --git a/src/splash-plugins/spinfinity/throbber.c b/src/splash-plugins/spinfinity/throbber.c index 15f8fbb..131cdf2 100644 --- a/src/splash-plugins/spinfinity/throbber.c +++ b/src/splash-plugins/spinfinity/throbber.c @@ -62,6 +62,7 @@ struct _throbber char *image_dir; char *frames_prefix; + ply_window_t *window; ply_frame_buffer_t *frame_buffer; ply_frame_buffer_area_t frame_area; @@ -261,7 +262,7 @@ out: bool throbber_start (throbber_t *throbber, ply_event_loop_t *loop, - ply_frame_buffer_t *frame_buffer, + ply_window_t *window, long x, long y) { @@ -275,7 +276,8 @@ throbber_start (throbber_t *throbber, } throbber->loop = loop; - throbber->frame_buffer = frame_buffer; + throbber->window = window; + throbber->frame_buffer = ply_window_get_frame_buffer (window);; throbber->x = x; throbber->y = y; @@ -297,6 +299,7 @@ throbber_stop (throbber_t *throbber) ply_frame_buffer_fill_with_color (throbber->frame_buffer, &throbber->frame_area, 0.0, 0.43, .71, 1.0); throbber->frame_buffer = NULL; + throbber->window = NULL; if (throbber->loop != NULL) { diff --git a/src/splash-plugins/spinfinity/throbber.h b/src/splash-plugins/spinfinity/throbber.h index f055c7e..191bfcb 100644 --- a/src/splash-plugins/spinfinity/throbber.h +++ b/src/splash-plugins/spinfinity/throbber.h @@ -28,6 +28,7 @@ #include "ply-event-loop.h" #include "ply-frame-buffer.h" +#include "ply-window.h" typedef struct _throbber throbber_t; @@ -38,7 +39,7 @@ void throbber_free (throbber_t *throbber); bool throbber_start (throbber_t *throbber, ply_event_loop_t *loop, - ply_frame_buffer_t *frame_buffer, + ply_window_t *window, long x, long y); void throbber_stop (throbber_t *throbber);