]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
Add new throbber_load function to preload frames
authorRay Strode <rstrode@redhat.com>
Thu, 12 Jun 2008 17:54:57 +0000 (13:54 -0400)
committerRay Strode <rstrode@redhat.com>
Thu, 12 Jun 2008 18:08:50 +0000 (14:08 -0400)
This will be important for determining the propery location
of the throbber on screen

src/splash-plugins/spinfinity/plugin.c
src/splash-plugins/spinfinity/throbber.c
src/splash-plugins/spinfinity/throbber.h

index 7db3e8a2383a77b0fe9d16955c6eacb629ac43d2..91e04073d585eaab11b0d9ba609f71fd23db26fc 100644 (file)
@@ -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");
index d5a8e90cba7ec05ff2b6d67656c8016d367cd089..998f229e70d6a6ab38b63e1d978e2048f609c518 100644 (file)
@@ -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;
 }
@@ -261,6 +261,18 @@ out:
   return load_finished;
 }
 
+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,
@@ -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);;
index 191bfcb7fcb3275d9afbab719a7ea7105238247b..c1e7b1a565d76ba08ed1f1f5e834db80b4fa7876 100644 (file)
@@ -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,