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) \
libplybootsplash_la_SOURCES = \
$(libplybootsplash_HEADERS) \
ply-answer.c \
+ ply-throbber.c \
ply-window.c
MAINTAINERCLEANFILES = Makefile.in
#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"
#define FRAMES_PER_SECOND 30
#endif
-struct _throbber
+struct _ply_throbber
{
ply_array_t *frames;
ply_event_loop_t *loop;
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);
}
static void
-throbber_remove_frames (throbber_t *throbber)
+ply_throbber_remove_frames (ply_throbber_t *throbber)
{
int i;
ply_image_t **frames;
}
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);
}
static void
-animate_at_time (throbber_t *throbber,
+animate_at_time (ply_throbber_t *throbber,
double time)
{
int number_of_frames;
}
static void
-on_timeout (throbber_t *throbber)
+on_timeout (ply_throbber_t *throbber)
{
double sleep_time;
throbber->now = ply_get_timestamp ();
}
static bool
-throbber_add_frame (throbber_t *throbber,
+ply_throbber_add_frame (ply_throbber_t *throbber,
const char *filename)
{
ply_image_t *image;
}
static bool
-throbber_add_frames (throbber_t *throbber)
+ply_throbber_add_frames (ply_throbber_t *throbber)
{
struct dirent **entries;
int number_of_entries;
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);
out:
if (!load_finished)
{
- throbber_remove_frames (throbber);
+ ply_throbber_remove_frames (throbber);
while (entries[i] != NULL)
{
}
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,
}
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,
}
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;
}
#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 */
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 \
#include "ply-utils.h"
#include "ply-window.h"
-#include "throbber.h"
+#include "ply-throbber.h"
#include <linux/kd.h>
ply_window_t *window;
entry_t *entry;
- throbber_t *throbber;
+ ply_throbber_t *throbber;
ply_answer_t *pending_password_answer;
};
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;
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);
}
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,
assert (plugin != NULL);
assert (plugin->loop != NULL);
- throbber_stop (plugin->throbber);
+ ply_throbber_stop (plugin->throbber);
for (i = 0; i < 10; i++)
{
return false;
ply_trace ("loading throbber");
- if (!throbber_load (plugin->throbber))
+ if (!ply_throbber_load (plugin->throbber))
return false;
plugin->window = window;