summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2008-06-12 17:29:16 -0400
committerRay Strode <rstrode@redhat.com>2008-06-12 17:32:02 -0400
commit54a651f30cb40c4adbba610aff86d20a4bc38e52 (patch)
tree4d25dac061aa763f13fc77e4249725d65349180c
parent76d837e38783f635e1cb7b258034b82e7ef7bee1 (diff)
downloadplymouth-54a651f30cb40c4adbba610aff86d20a4bc38e52.tar.gz
plymouth-54a651f30cb40c4adbba610aff86d20a4bc38e52.tar.xz
plymouth-54a651f30cb40c4adbba610aff86d20a4bc38e52.zip
Move throbber to libplybootsplash
-rw-r--r--src/libplybootsplash/Makefile.am6
-rw-r--r--src/libplybootsplash/ply-throbber.c (renamed from src/splash-plugins/spinfinity/throbber.c)44
-rw-r--r--src/libplybootsplash/ply-throbber.h (renamed from src/splash-plugins/spinfinity/throbber.h)26
-rw-r--r--src/splash-plugins/spinfinity/Makefile.am4
-rw-r--r--src/splash-plugins/spinfinity/plugin.c18
5 files changed, 49 insertions, 49 deletions
diff --git a/src/libplybootsplash/Makefile.am b/src/libplybootsplash/Makefile.am
index 7e59c9b..b2f4a3d 100644
--- a/src/libplybootsplash/Makefile.am
+++ b/src/libplybootsplash/Makefile.am
@@ -5,9 +5,10 @@ INCLUDES = -I$(top_srcdir) \
lib_LTLIBRARIES = libplybootsplash.la
libplybootsplashdir = $(includedir)/plymouth-1/plybootsplash
-libplybootsplash_HEADERS = ply-answer.h ply-window.h ply-boot-splash-plugin.h
+libplybootsplash_HEADERS = ply-answer.h ply-throbber.h ply-window.h ply-boot-splash-plugin.h
-libplybootsplash_la_CFLAGS = $(PLYMOUTH_CFLAGS)
+libplybootsplash_la_CFLAGS = $(PLYMOUTH_CFLAGS) \
+ -DPLYMOUTH_BACKGROUND_COLOR=$(background_color)
libplybootsplash_la_LIBADD = $(PLYMOUTH_LIBS) ../libply/libply.la
libplybootsplash_la_LDFLAGS = -export-symbols-regex '^[^_].*' \
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
@@ -15,6 +16,7 @@ libplybootsplash_la_LDFLAGS = -export-symbols-regex '^[^_].*' \
libplybootsplash_la_SOURCES = \
$(libplybootsplash_HEADERS) \
ply-answer.c \
+ ply-throbber.c \
ply-window.c
MAINTAINERCLEANFILES = Makefile.in
diff --git a/src/splash-plugins/spinfinity/throbber.c b/src/libplybootsplash/ply-throbber.c
index 998f229..2b3ebba 100644
--- a/src/splash-plugins/spinfinity/throbber.c
+++ b/src/libplybootsplash/ply-throbber.c
@@ -40,7 +40,7 @@
#include <unistd.h>
#include <wchar.h>
-#include "throbber.h"
+#include "ply-throbber.h"
#include "ply-event-loop.h"
#include "ply-array.h"
#include "ply-logger.h"
@@ -55,7 +55,7 @@
#define FRAMES_PER_SECOND 30
#endif
-struct _throbber
+struct _ply_throbber
{
ply_array_t *frames;
ply_event_loop_t *loop;
@@ -71,16 +71,16 @@ struct _throbber
double start_time, now;
};
-throbber_t *
-throbber_new (const char *image_dir,
+ply_throbber_t *
+ply_throbber_new (const char *image_dir,
const char *frames_prefix)
{
- throbber_t *throbber;
+ ply_throbber_t *throbber;
assert (image_dir != NULL);
assert (frames_prefix != NULL);
- throbber = calloc (1, sizeof (throbber_t));
+ throbber = calloc (1, sizeof (ply_throbber_t));
throbber->frames = ply_array_new ();
throbber->frames_prefix = strdup (frames_prefix);
@@ -96,7 +96,7 @@ throbber_new (const char *image_dir,
}
static void
-throbber_remove_frames (throbber_t *throbber)
+ply_throbber_remove_frames (ply_throbber_t *throbber)
{
int i;
ply_image_t **frames;
@@ -108,12 +108,12 @@ throbber_remove_frames (throbber_t *throbber)
}
void
-throbber_free (throbber_t *throbber)
+ply_throbber_free (ply_throbber_t *throbber)
{
if (throbber == NULL)
return;
- throbber_remove_frames (throbber);
+ ply_throbber_remove_frames (throbber);
ply_array_free (throbber->frames);
free (throbber->frames_prefix);
@@ -122,7 +122,7 @@ throbber_free (throbber_t *throbber)
}
static void
-animate_at_time (throbber_t *throbber,
+animate_at_time (ply_throbber_t *throbber,
double time)
{
int number_of_frames;
@@ -159,7 +159,7 @@ animate_at_time (throbber_t *throbber,
}
static void
-on_timeout (throbber_t *throbber)
+on_timeout (ply_throbber_t *throbber)
{
double sleep_time;
throbber->now = ply_get_timestamp ();
@@ -184,7 +184,7 @@ on_timeout (throbber_t *throbber)
}
static bool
-throbber_add_frame (throbber_t *throbber,
+ply_throbber_add_frame (ply_throbber_t *throbber,
const char *filename)
{
ply_image_t *image;
@@ -206,7 +206,7 @@ throbber_add_frame (throbber_t *throbber,
}
static bool
-throbber_add_frames (throbber_t *throbber)
+ply_throbber_add_frames (ply_throbber_t *throbber)
{
struct dirent **entries;
int number_of_entries;
@@ -234,7 +234,7 @@ throbber_add_frames (throbber_t *throbber)
filename = NULL;
asprintf (&filename, "%s/%s", throbber->image_dir, entries[i]->d_name);
- if (!throbber_add_frame (throbber, filename))
+ if (!ply_throbber_add_frame (throbber, filename))
goto out;
free (filename);
@@ -248,7 +248,7 @@ throbber_add_frames (throbber_t *throbber)
out:
if (!load_finished)
{
- throbber_remove_frames (throbber);
+ ply_throbber_remove_frames (throbber);
while (entries[i] != NULL)
{
@@ -262,19 +262,19 @@ out:
}
bool
-throbber_load (throbber_t *throbber)
+ply_throbber_load (ply_throbber_t *throbber)
{
if (ply_array_get_size (throbber->frames) != 0)
- throbber_remove_frames (throbber->frames);
+ ply_throbber_remove_frames (throbber->frames);
- if (!throbber_add_frames (throbber))
+ if (!ply_throbber_add_frames (throbber))
return false;
return true;
}
bool
-throbber_start (throbber_t *throbber,
+ply_throbber_start (ply_throbber_t *throbber,
ply_event_loop_t *loop,
ply_window_t *window,
long x,
@@ -301,7 +301,7 @@ throbber_start (throbber_t *throbber,
}
void
-throbber_stop (throbber_t *throbber)
+ply_throbber_stop (ply_throbber_t *throbber)
{
if (throbber->frame_area.width > 0)
ply_frame_buffer_fill_with_hex_color (throbber->frame_buffer, &throbber->frame_area,
@@ -319,13 +319,13 @@ throbber_stop (throbber_t *throbber)
}
long
-throbber_get_width (throbber_t *throbber)
+ply_throbber_get_width (ply_throbber_t *throbber)
{
return throbber->width;
}
long
-throbber_get_height (throbber_t *throbber)
+ply_throbber_get_height (ply_throbber_t *throbber)
{
return throbber->height;
}
diff --git a/src/splash-plugins/spinfinity/throbber.h b/src/libplybootsplash/ply-throbber.h
index c1e7b1a..21ff17e 100644
--- a/src/splash-plugins/spinfinity/throbber.h
+++ b/src/libplybootsplash/ply-throbber.h
@@ -30,23 +30,23 @@
#include "ply-frame-buffer.h"
#include "ply-window.h"
-typedef struct _throbber throbber_t;
+typedef struct _ply_throbber ply_throbber_t;
#ifndef PLY_HIDE_FUNCTION_DECLARATIONS
-throbber_t *throbber_new (const char *image_dir,
- const char *frames_prefix);
-void throbber_free (throbber_t *throbber);
+ply_throbber_t *ply_throbber_new (const char *image_dir,
+ const char *frames_prefix);
+void ply_throbber_free (ply_throbber_t *throbber);
-bool throbber_load (throbber_t *throbber);
-bool throbber_start (throbber_t *throbber,
- ply_event_loop_t *loop,
- ply_window_t *window,
- long x,
- long y);
-void throbber_stop (throbber_t *throbber);
+bool ply_throbber_load (ply_throbber_t *throbber);
+bool ply_throbber_start (ply_throbber_t *throbber,
+ ply_event_loop_t *loop,
+ ply_window_t *window,
+ long x,
+ long y);
+void ply_throbber_stop (ply_throbber_t *throbber);
-long throbber_get_width (throbber_t *throbber);
-long throbber_get_height (throbber_t *throbber);
+long ply_throbber_get_width (ply_throbber_t *throbber);
+long ply_throbber_get_height (ply_throbber_t *throbber);
#endif
#endif /* THROBBER_H */
diff --git a/src/splash-plugins/spinfinity/Makefile.am b/src/splash-plugins/spinfinity/Makefile.am
index 8a22804..485b19f 100644
--- a/src/splash-plugins/spinfinity/Makefile.am
+++ b/src/splash-plugins/spinfinity/Makefile.am
@@ -17,9 +17,7 @@ spinfinity_la_LDFLAGS = -module -avoid-version -export-dynamic
spinfinity_la_LIBADD = $(PLYMOUTH_LIBS) \
../../libply/libply.la \
../../libplybootsplash/libplybootsplash.la
-spinfinity_la_SOURCES = $(srcdir)/plugin.c \
- $(srcdir)/throbber.h \
- $(srcdir)/throbber.c
+spinfinity_la_SOURCES = $(srcdir)/plugin.c
throbber_frames = \
throbber-00.png \
diff --git a/src/splash-plugins/spinfinity/plugin.c b/src/splash-plugins/spinfinity/plugin.c
index 07f9ffd..8b95c0e 100644
--- a/src/splash-plugins/spinfinity/plugin.c
+++ b/src/splash-plugins/spinfinity/plugin.c
@@ -50,7 +50,7 @@
#include "ply-utils.h"
#include "ply-window.h"
-#include "throbber.h"
+#include "ply-throbber.h"
#include <linux/kd.h>
@@ -77,7 +77,7 @@ struct _ply_boot_splash_plugin
ply_window_t *window;
entry_t *entry;
- throbber_t *throbber;
+ ply_throbber_t *throbber;
ply_answer_t *pending_password_answer;
};
@@ -99,7 +99,7 @@ create_plugin (void)
plugin->entry_image = ply_image_new (PLYMOUTH_IMAGE_DIR "spinfinity/entry.png");
plugin->box_image = ply_image_new (PLYMOUTH_IMAGE_DIR "spinfinity/box.png");
- plugin->throbber = throbber_new (PLYMOUTH_IMAGE_DIR "spinfinity",
+ plugin->throbber = ply_throbber_new (PLYMOUTH_IMAGE_DIR "spinfinity",
"throbber-");
return plugin;
@@ -140,7 +140,7 @@ destroy_plugin (ply_boot_splash_plugin_t *plugin)
ply_image_free (plugin->entry_image);
ply_image_free (plugin->box_image);
ply_image_free (plugin->lock_image);
- throbber_free (plugin->throbber);
+ ply_throbber_free (plugin->throbber);
free (plugin);
}
@@ -189,9 +189,9 @@ start_animation (ply_boot_splash_plugin_t *plugin)
ply_frame_buffer_get_size (plugin->frame_buffer, &area);
- width = throbber_get_width (plugin->throbber);
- height = throbber_get_height (plugin->throbber);
- throbber_start (plugin->throbber,
+ width = ply_throbber_get_width (plugin->throbber);
+ height = ply_throbber_get_height (plugin->throbber);
+ ply_throbber_start (plugin->throbber,
plugin->loop,
plugin->window,
area.width / 2.0 - width / 2.0,
@@ -206,7 +206,7 @@ stop_animation (ply_boot_splash_plugin_t *plugin)
assert (plugin != NULL);
assert (plugin->loop != NULL);
- throbber_stop (plugin->throbber);
+ ply_throbber_stop (plugin->throbber);
for (i = 0; i < 10; i++)
{
@@ -325,7 +325,7 @@ show_splash_screen (ply_boot_splash_plugin_t *plugin,
return false;
ply_trace ("loading throbber");
- if (!throbber_load (plugin->throbber))
+ if (!ply_throbber_load (plugin->throbber))
return false;
plugin->window = window;