summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2008-06-12 13:54:57 -0400
committerRay Strode <rstrode@redhat.com>2008-06-12 14:08:50 -0400
commit5ea6157c54f0dde1efa695f882b77ea5ad63de1e (patch)
treec0c2f331c5eec0caff2c85a06e12a6672425ce02 /src
parent988d8b232ebbda8e1b16da4bc06bfc551e0a959b (diff)
downloadplymouth-5ea6157c54f0dde1efa695f882b77ea5ad63de1e.tar.gz
plymouth-5ea6157c54f0dde1efa695f882b77ea5ad63de1e.tar.xz
plymouth-5ea6157c54f0dde1efa695f882b77ea5ad63de1e.zip
Add new throbber_load function to preload frames
This will be important for determining the propery location of the throbber on screen
Diffstat (limited to 'src')
-rw-r--r--src/splash-plugins/spinfinity/plugin.c4
-rw-r--r--src/splash-plugins/spinfinity/throbber.c26
-rw-r--r--src/splash-plugins/spinfinity/throbber.h1
3 files changed, 21 insertions, 10 deletions
diff --git a/src/splash-plugins/spinfinity/plugin.c b/src/splash-plugins/spinfinity/plugin.c
index 7db3e8a..91e0407 100644
--- a/src/splash-plugins/spinfinity/plugin.c
+++ b/src/splash-plugins/spinfinity/plugin.c
@@ -325,6 +325,10 @@ show_splash_screen (ply_boot_splash_plugin_t *plugin,
if (!ply_image_load (plugin->box_image))
return false;
+ ply_trace ("loading throbber");
+ if (!throbber_load (plugin->throbber))
+ return false;
+
plugin->window = window;
ply_trace ("setting graphics mode");
diff --git a/src/splash-plugins/spinfinity/throbber.c b/src/splash-plugins/spinfinity/throbber.c
index d5a8e90..998f229 100644
--- a/src/splash-plugins/spinfinity/throbber.c
+++ b/src/splash-plugins/spinfinity/throbber.c
@@ -85,12 +85,12 @@ throbber_new (const char *image_dir,
throbber->frames = ply_array_new ();
throbber->frames_prefix = strdup (frames_prefix);
throbber->image_dir = strdup (image_dir);
- throbber->width = 82;
- throbber->height = 47;
+ throbber->width = 0;
+ throbber->height = 0;
throbber->frame_area.width = 0;
throbber->frame_area.height = 0;
- throbber->frame_area.x = 700;
- throbber->frame_area.y = 700;
+ throbber->frame_area.x = 0;
+ throbber->frame_area.y = 0;
return throbber;
}
@@ -262,6 +262,18 @@ out:
}
bool
+throbber_load (throbber_t *throbber)
+{
+ if (ply_array_get_size (throbber->frames) != 0)
+ throbber_remove_frames (throbber->frames);
+
+ if (!throbber_add_frames (throbber))
+ return false;
+
+ return true;
+}
+
+bool
throbber_start (throbber_t *throbber,
ply_event_loop_t *loop,
ply_window_t *window,
@@ -271,12 +283,6 @@ throbber_start (throbber_t *throbber,
assert (throbber != NULL);
assert (throbber->loop == NULL);
- if (ply_array_get_size (throbber->frames) == 0)
- {
- if (!throbber_add_frames (throbber))
- return false;
- }
-
throbber->loop = loop;
throbber->window = window;
throbber->frame_buffer = ply_window_get_frame_buffer (window);;
diff --git a/src/splash-plugins/spinfinity/throbber.h b/src/splash-plugins/spinfinity/throbber.h
index 191bfcb..c1e7b1a 100644
--- a/src/splash-plugins/spinfinity/throbber.h
+++ b/src/splash-plugins/spinfinity/throbber.h
@@ -37,6 +37,7 @@ throbber_t *throbber_new (const char *image_dir,
const char *frames_prefix);
void throbber_free (throbber_t *throbber);
+bool throbber_load (throbber_t *throbber);
bool throbber_start (throbber_t *throbber,
ply_event_loop_t *loop,
ply_window_t *window,