]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[splash] Split splashes into plugins and themes
authorRay Strode <rstrode@redhat.com>
Wed, 29 Apr 2009 18:25:02 +0000 (14:25 -0400)
committerRay Strode <rstrode@redhat.com>
Wed, 20 May 2009 21:27:52 +0000 (17:27 -0400)
Some of the plugins (well, the glow plugin) would be a lot more
versatile if they could be reused for multiple splashes with different
images.

This commit splits boot splashes into two parts, the plugin engine which
does all the dirty work, and the theme which says which plugin to use
and optionally how the plugin should work (using plugin specific
key/value pairs)

143 files changed:
.gitignore
Makefile.am
configure.ac
scripts/Makefile.am
scripts/plymouth-populate-initrd.in
scripts/plymouth-set-default-theme.in [moved from scripts/plymouth-set-default-plugin.in with 54% similarity]
src/Makefile.am
src/libplybootsplash/ply-boot-splash-plugin.h
src/main.c
src/plugins/splash/details/plugin.c
src/plugins/splash/fade-in/Makefile.am
src/plugins/splash/fade-in/plugin.c
src/plugins/splash/glow/Makefile.am
src/plugins/splash/glow/plugin.c
src/plugins/splash/pulser/plugin.c
src/plugins/splash/solar/Makefile.am
src/plugins/splash/solar/plugin.c
src/plugins/splash/spinfinity/Makefile.am
src/plugins/splash/spinfinity/plugin.c
src/plugins/splash/text/plugin.c
src/ply-boot-splash.c
src/ply-boot-splash.h
src/plymouth-1.pc.in
themes/Makefile.am [new file with mode: 0644]
themes/details/Makefile.am [new file with mode: 0644]
themes/details/details.plymouth [new file with mode: 0644]
themes/fade-in/Makefile.am [new file with mode: 0644]
themes/fade-in/bullet.png [moved from src/plugins/splash/fade-in/bullet.png with 100% similarity]
themes/fade-in/entry.png [moved from src/plugins/splash/fade-in/entry.png with 100% similarity]
themes/fade-in/fade-in.plymouth.in [new file with mode: 0644]
themes/fade-in/lock.png [moved from src/plugins/splash/fade-in/lock.png with 100% similarity]
themes/fade-in/star.png [moved from src/plugins/splash/fade-in/star.png with 100% similarity]
themes/glow/Makefile.am [new file with mode: 0644]
themes/glow/box.png [moved from src/plugins/splash/glow/images/box.png with 100% similarity]
themes/glow/bullet.png [moved from src/plugins/splash/glow/images/bullet.png with 100% similarity]
themes/glow/entry.png [moved from src/plugins/splash/glow/images/entry.png with 100% similarity]
themes/glow/glow.plymouth.in [new file with mode: 0644]
themes/glow/lock.png [moved from src/plugins/splash/glow/images/lock.png with 100% similarity]
themes/glow/progress-00.png [moved from src/plugins/splash/glow/images/progress-00.png with 100% similarity]
themes/glow/progress-01.png [moved from src/plugins/splash/glow/images/progress-01.png with 100% similarity]
themes/glow/progress-02.png [moved from src/plugins/splash/glow/images/progress-02.png with 100% similarity]
themes/glow/progress-03.png [moved from src/plugins/splash/glow/images/progress-03.png with 100% similarity]
themes/glow/progress-04.png [moved from src/plugins/splash/glow/images/progress-04.png with 100% similarity]
themes/glow/progress-05.png [moved from src/plugins/splash/glow/images/progress-05.png with 100% similarity]
themes/glow/progress-06.png [moved from src/plugins/splash/glow/images/progress-06.png with 100% similarity]
themes/glow/progress-07.png [moved from src/plugins/splash/glow/images/progress-07.png with 100% similarity]
themes/glow/progress-08.png [moved from src/plugins/splash/glow/images/progress-08.png with 100% similarity]
themes/glow/progress-09.png [moved from src/plugins/splash/glow/images/progress-09.png with 100% similarity]
themes/glow/progress-10.png [moved from src/plugins/splash/glow/images/progress-10.png with 100% similarity]
themes/glow/progress-11.png [moved from src/plugins/splash/glow/images/progress-11.png with 100% similarity]
themes/glow/progress-12.png [moved from src/plugins/splash/glow/images/progress-12.png with 100% similarity]
themes/glow/progress-13.png [moved from src/plugins/splash/glow/images/progress-13.png with 100% similarity]
themes/glow/progress-14.png [moved from src/plugins/splash/glow/images/progress-14.png with 100% similarity]
themes/glow/progress-15.png [moved from src/plugins/splash/glow/images/progress-15.png with 100% similarity]
themes/glow/progress-16.png [moved from src/plugins/splash/glow/images/progress-16.png with 100% similarity]
themes/glow/progress-17.png [moved from src/plugins/splash/glow/images/progress-17.png with 100% similarity]
themes/glow/progress-18.png [moved from src/plugins/splash/glow/images/progress-18.png with 100% similarity]
themes/glow/progress-19.png [moved from src/plugins/splash/glow/images/progress-19.png with 100% similarity]
themes/glow/progress-20.png [moved from src/plugins/splash/glow/images/progress-20.png with 100% similarity]
themes/glow/progress-21.png [moved from src/plugins/splash/glow/images/progress-21.png with 100% similarity]
themes/glow/progress-22.png [moved from src/plugins/splash/glow/images/progress-22.png with 100% similarity]
themes/glow/progress-23.png [moved from src/plugins/splash/glow/images/progress-23.png with 100% similarity]
themes/glow/progress-24.png [moved from src/plugins/splash/glow/images/progress-24.png with 100% similarity]
themes/glow/progress-25.png [moved from src/plugins/splash/glow/images/progress-25.png with 100% similarity]
themes/glow/progress-26.png [moved from src/plugins/splash/glow/images/progress-26.png with 100% similarity]
themes/glow/progress-27.png [moved from src/plugins/splash/glow/images/progress-27.png with 100% similarity]
themes/glow/progress-28.png [moved from src/plugins/splash/glow/images/progress-28.png with 100% similarity]
themes/glow/progress-29.png [moved from src/plugins/splash/glow/images/progress-29.png with 100% similarity]
themes/glow/progress-30.png [moved from src/plugins/splash/glow/images/progress-30.png with 100% similarity]
themes/glow/progress-31.png [moved from src/plugins/splash/glow/images/progress-31.png with 100% similarity]
themes/glow/progress-32.png [moved from src/plugins/splash/glow/images/progress-32.png with 100% similarity]
themes/glow/throbber-00.png [moved from src/plugins/splash/glow/images/throbber-00.png with 100% similarity]
themes/glow/throbber-01.png [moved from src/plugins/splash/glow/images/throbber-01.png with 100% similarity]
themes/glow/throbber-02.png [moved from src/plugins/splash/glow/images/throbber-02.png with 100% similarity]
themes/glow/throbber-03.png [moved from src/plugins/splash/glow/images/throbber-03.png with 100% similarity]
themes/glow/throbber-04.png [moved from src/plugins/splash/glow/images/throbber-04.png with 100% similarity]
themes/glow/throbber-05.png [moved from src/plugins/splash/glow/images/throbber-05.png with 100% similarity]
themes/glow/throbber-06.png [moved from src/plugins/splash/glow/images/throbber-06.png with 100% similarity]
themes/glow/throbber-07.png [moved from src/plugins/splash/glow/images/throbber-07.png with 100% similarity]
themes/glow/throbber-08.png [moved from src/plugins/splash/glow/images/throbber-08.png with 100% similarity]
themes/glow/throbber-09.png [moved from src/plugins/splash/glow/images/throbber-09.png with 100% similarity]
themes/glow/throbber-10.png [moved from src/plugins/splash/glow/images/throbber-10.png with 100% similarity]
themes/glow/throbber-11.png [moved from src/plugins/splash/glow/images/throbber-11.png with 100% similarity]
themes/glow/throbber-12.png [moved from src/plugins/splash/glow/images/throbber-12.png with 100% similarity]
themes/glow/throbber-13.png [moved from src/plugins/splash/glow/images/throbber-13.png with 100% similarity]
themes/glow/throbber-14.png [moved from src/plugins/splash/glow/images/throbber-14.png with 100% similarity]
themes/glow/throbber-15.png [moved from src/plugins/splash/glow/images/throbber-15.png with 100% similarity]
themes/glow/throbber-16.png [moved from src/plugins/splash/glow/images/throbber-16.png with 100% similarity]
themes/glow/throbber-17.png [moved from src/plugins/splash/glow/images/throbber-17.png with 100% similarity]
themes/glow/throbber-18.png [moved from src/plugins/splash/glow/images/throbber-18.png with 100% similarity]
themes/glow/throbber-19.png [moved from src/plugins/splash/glow/images/throbber-19.png with 100% similarity]
themes/pulser/Makefile.am [new file with mode: 0644]
themes/pulser/pulser.plymouth [new file with mode: 0644]
themes/solar/Makefile.am [new file with mode: 0644]
themes/solar/box.png [moved from src/plugins/splash/solar/box.png with 100% similarity]
themes/solar/bullet.png [moved from src/plugins/splash/solar/bullet.png with 100% similarity]
themes/solar/entry.png [moved from src/plugins/splash/solar/entry.png with 100% similarity]
themes/solar/lock.png [moved from src/plugins/splash/solar/lock.png with 100% similarity]
themes/solar/progress_bar.png [moved from src/plugins/splash/solar/progress_bar.png with 100% similarity]
themes/solar/solar.plymouth.in [new file with mode: 0644]
themes/solar/star.png [moved from src/plugins/splash/solar/star.png with 100% similarity]
themes/spinfinity/Makefile.am [new file with mode: 0644]
themes/spinfinity/box.png [moved from src/plugins/splash/spinfinity/box.png with 100% similarity]
themes/spinfinity/bullet.png [moved from src/plugins/splash/spinfinity/bullet.png with 100% similarity]
themes/spinfinity/entry.png [moved from src/plugins/splash/spinfinity/entry.png with 100% similarity]
themes/spinfinity/lock.png [moved from src/plugins/splash/spinfinity/lock.png with 100% similarity]
themes/spinfinity/spinfinity.plymouth.in [new file with mode: 0644]
themes/spinfinity/throbber-00.png [moved from src/plugins/splash/spinfinity/throbber-00.png with 100% similarity]
themes/spinfinity/throbber-01.png [moved from src/plugins/splash/spinfinity/throbber-01.png with 100% similarity]
themes/spinfinity/throbber-02.png [moved from src/plugins/splash/spinfinity/throbber-02.png with 100% similarity]
themes/spinfinity/throbber-03.png [moved from src/plugins/splash/spinfinity/throbber-03.png with 100% similarity]
themes/spinfinity/throbber-04.png [moved from src/plugins/splash/spinfinity/throbber-04.png with 100% similarity]
themes/spinfinity/throbber-05.png [moved from src/plugins/splash/spinfinity/throbber-05.png with 100% similarity]
themes/spinfinity/throbber-06.png [moved from src/plugins/splash/spinfinity/throbber-06.png with 100% similarity]
themes/spinfinity/throbber-07.png [moved from src/plugins/splash/spinfinity/throbber-07.png with 100% similarity]
themes/spinfinity/throbber-08.png [moved from src/plugins/splash/spinfinity/throbber-08.png with 100% similarity]
themes/spinfinity/throbber-09.png [moved from src/plugins/splash/spinfinity/throbber-09.png with 100% similarity]
themes/spinfinity/throbber-10.png [moved from src/plugins/splash/spinfinity/throbber-10.png with 100% similarity]
themes/spinfinity/throbber-11.png [moved from src/plugins/splash/spinfinity/throbber-11.png with 100% similarity]
themes/spinfinity/throbber-12.png [moved from src/plugins/splash/spinfinity/throbber-12.png with 100% similarity]
themes/spinfinity/throbber-13.png [moved from src/plugins/splash/spinfinity/throbber-13.png with 100% similarity]
themes/spinfinity/throbber-14.png [moved from src/plugins/splash/spinfinity/throbber-14.png with 100% similarity]
themes/spinfinity/throbber-15.png [moved from src/plugins/splash/spinfinity/throbber-15.png with 100% similarity]
themes/spinfinity/throbber-16.png [moved from src/plugins/splash/spinfinity/throbber-16.png with 100% similarity]
themes/spinfinity/throbber-17.png [moved from src/plugins/splash/spinfinity/throbber-17.png with 100% similarity]
themes/spinfinity/throbber-18.png [moved from src/plugins/splash/spinfinity/throbber-18.png with 100% similarity]
themes/spinfinity/throbber-19.png [moved from src/plugins/splash/spinfinity/throbber-19.png with 100% similarity]
themes/spinfinity/throbber-20.png [moved from src/plugins/splash/spinfinity/throbber-20.png with 100% similarity]
themes/spinfinity/throbber-21.png [moved from src/plugins/splash/spinfinity/throbber-21.png with 100% similarity]
themes/spinfinity/throbber-22.png [moved from src/plugins/splash/spinfinity/throbber-22.png with 100% similarity]
themes/spinfinity/throbber-23.png [moved from src/plugins/splash/spinfinity/throbber-23.png with 100% similarity]
themes/spinfinity/throbber-24.png [moved from src/plugins/splash/spinfinity/throbber-24.png with 100% similarity]
themes/spinfinity/throbber-25.png [moved from src/plugins/splash/spinfinity/throbber-25.png with 100% similarity]
themes/spinfinity/throbber-26.png [moved from src/plugins/splash/spinfinity/throbber-26.png with 100% similarity]
themes/spinfinity/throbber-27.png [moved from src/plugins/splash/spinfinity/throbber-27.png with 100% similarity]
themes/spinfinity/throbber-28.png [moved from src/plugins/splash/spinfinity/throbber-28.png with 100% similarity]
themes/spinfinity/throbber-29.png [moved from src/plugins/splash/spinfinity/throbber-29.png with 100% similarity]
themes/spinfinity/throbber-30.png [moved from src/plugins/splash/spinfinity/throbber-30.png with 100% similarity]
themes/spinfinity/throbber-31.png [moved from src/plugins/splash/spinfinity/throbber-31.png with 100% similarity]
themes/spinfinity/throbber-32.png [moved from src/plugins/splash/spinfinity/throbber-32.png with 100% similarity]
themes/spinfinity/throbber-33.png [moved from src/plugins/splash/spinfinity/throbber-33.png with 100% similarity]
themes/text/Makefile.am [new file with mode: 0644]
themes/text/text.plymouth [new file with mode: 0644]

index fbd8038994d6db8b69451a7e6f9110f63c4e3fd9..f0c948f7e1977d258dc606e9897225f3102e57e7 100644 (file)
@@ -28,7 +28,7 @@ stamp-*
 *.rpm
 plymouth
 plymouth-populate-initrd
-plymouth-set-default-plugin
+plymouth-set-default-theme
 plymouth-log-viewer
 plymouthd
 *.pc
index d55187fc53101b360ab1b267f56daef344a099cc..5c35769f3515e626823a652fb12a7c79d25c6d76 100644 (file)
@@ -1,4 +1,4 @@
-SUBDIRS = src images scripts
+SUBDIRS = src themes images scripts
 DISTCHECK_CONFIGURE_FLAGS = --disable-tests --without-system-root-install
 
 EXTRA_DIST = ChangeLog                                                         \
index 0dc4722a2881af8a9af8ee254313a88ca271d9da..558f97b2e332ed82580f4db2a6dd482f426e0a0f 100644 (file)
@@ -193,6 +193,9 @@ AC_CACHE_CHECK([for supported warning flags], plymouth_cv_warn_cflags, [
 WARN_CFLAGS="$plymouth_cv_warn_cflags"
 PLYMOUTH_CFLAGS="$PLYMOUTH_CFLAGS $WARN_CFLAGS"
 
+PLYMOUTH_THEME_PATH=$datadir/plymouth/themes
+AC_SUBST(PLYMOUTH_THEME_PATH)
+
 AC_OUTPUT([Makefile
            src/libply/Makefile
            src/libplybootsplash/Makefile
@@ -214,6 +217,14 @@ AC_OUTPUT([Makefile
            src/tests/Makefile
            src/libply/tests/Makefile
            src/client/tests/Makefile
+           themes/Makefile
+           themes/spinfinity/Makefile
+           themes/fade-in/Makefile
+           themes/text/Makefile
+           themes/pulser/Makefile
+           themes/details/Makefile
+           themes/solar/Makefile
+           themes/glow/Makefile
            images/Makefile
            scripts/Makefile
 ])
index bcd04de4385a79fc3264bf6cf66e4c0f6e616f44..9c6e095d6ca05fc466147c6abe5e88b7b2c6f6b8 100644 (file)
@@ -4,7 +4,7 @@ initrdscriptdir = $(libexecdir)/plymouth
 initrdscript_SCRIPTS = plymouth-update-initrd plymouth-populate-initrd
 
 sbinscriptsdir = $(sbindir)
-sbinscripts_SCRIPTS = plymouth-set-default-plugin
+sbinscripts_SCRIPTS = plymouth-set-default-theme
 
 plymouth-populate-initrd: $(srcdir)/plymouth-populate-initrd.in
        sed -e 's,[@]logofile[@],$(logofile),g'                                \
@@ -12,17 +12,17 @@ plymouth-populate-initrd: $(srcdir)/plymouth-populate-initrd.in
            -e 's,[@]plymouthdaemondir[@],$(plymouthdaemondir),g'              \
            $(srcdir)/plymouth-populate-initrd.in > plymouth-populate-initrd
 
-plymouth-set-default-plugin: $(srcdir)/plymouth-set-default-plugin.in
+plymouth-set-default-theme: $(srcdir)/plymouth-set-default-theme.in
        sed -e 's,[@]logofile[@],$(logofile),g'                                \
            -e 's,[@]plymouthclientdir[@],$(plymouthclientdir),g'              \
            -e 's,[@]plymouthdaemondir[@],$(plymouthdaemondir),g'              \
-           $(srcdir)/plymouth-set-default-plugin.in > plymouth-set-default-plugin
+           $(srcdir)/plymouth-set-default-theme.in > plymouth-set-default-theme
 
 EXTRA_DIST= plymouth-update-initrd                                             \
            plymouth-populate-initrd.in                                        \
-           plymouth-set-default-plugin.in                                     \
+           plymouth-set-default-theme.in                                     \
            $(noinst_SCRIPTS)                                                  \
            default.cfg
 
-CLEANFILES = plymouth-populate-initrd plymouth-set-default-plugin
-MAINTAINERCLEANFILES = Makefile.in plymouth-populate-initrd plymouth-set-default-plugin
+CLEANFILES = plymouth-populate-initrd plymouth-set-default-theme
+MAINTAINERCLEANFILES = Makefile.in plymouth-populate-initrd plymouth-set-default-theme
index 8e4a29fa985795f52459a368b8da5b7e73c1a0a2..d87f357ec8ce464391767621fcd8281fe3bc9380 100755 (executable)
@@ -16,7 +16,7 @@ fi
 [ -z "$BINDIR" ] && BINDIR="/usr/bin"
 [ -z "$GRUB_MENU_TITLE" ] && GRUB_MENU_TITLE="Graphical Bootup"
 [ -z "$PLYMOUTH_LOGO_FILE" ] && PLYMOUTH_LOGO_FILE="@logofile@"
-[ -z "$PLYMOUTH_PLUGIN_NAME" ] && PLYMOUTH_PLUGIN_NAME=$(plymouth-set-default-plugin)
+[ -z "$PLYMOUTH_THEME_NAME" ] && PLYMOUTH_THEME_NAME=$(plymouth-set-default-theme)
 
 if [ -f "${LIBEXECDIR}/initrd-functions" ]; then
     . "${LIBEXECDIR}/initrd-functions"
@@ -62,35 +62,39 @@ set_verbose $verbose
 
 [ -z "$INITRDDIR" ] && usage error
 
-inst @plymouthdaemondir@/plymouthd $INITRDDIR /bin/plymouthd
-inst @plymouthclientdir@/plymouth $INITRDDIR
+mkdir -p ${INITRDDIR}${DATADIR}/plymouth/themes
+inst /sbin/plymouthd $INITRDDIR /bin/plymouthd
+inst /bin/plymouth $INITRDDIR
+inst ${DATADIR}/plymouth/themes/text/text.plymouth $INITRDDIR
 inst ${LIBDIR}/plymouth/text.so $INITRDDIR
+inst ${DATADIR}/plymouth/themes/details/details.plymouth $INITRDDIR
 inst ${LIBDIR}/plymouth/details.so $INITRDDIR
 inst ${PLYMOUTH_LOGO_FILE} $INITRDDIR
 inst /etc/system-release $INITRDDIR
-mkdir -p ${INITRDDIR}${DATADIR}/plymouth
 
-if [ -z "$PLYMOUTH_PLUGIN_NAME" ]; then
+if [ -z "$PLYMOUTH_THEME_NAME" ]; then
     echo "No default plymouth plugin is set" > /dev/stderr
     exit 1
 fi
 
-if [ ! -f ${LIBDIR}/plymouth/${PLYMOUTH_PLUGIN_NAME}.so ]; then
-    echo "The default plymouth plugin (${PLYMOUTH_PLUGIN_NAME}) doesn't exist" > /dev/stderr
+PLYMOUTH_MODULE_NAME=$(grep "ModuleName *= *" ${DATADIR}/plymouth/themes/${PLYMOUTH_THEME_NAME}/${PLYMOUTH_THEME_NAME}.plymouth | sed 's/ModuleName *= *//')
+
+if [ ! -f ${LIBDIR}/plymouth/${PLYMOUTH_MODULE_NAME}.so ]; then
+    echo "The default plymouth plugin (${PLYMOUTH_MODULE_NAME}) doesn't exist" > /dev/stderr
     exit 1
 fi
 
-inst ${LIBDIR}/plymouth/${PLYMOUTH_PLUGIN_NAME}.so $INITRDDIR
-
-if [ -f ${LIBDIR}/plymouth/default.so ]; then
-    inst ${LIBDIR}/plymouth/default.so $INITRDDIR
-fi
+inst ${LIBDIR}/plymouth/${PLYMOUTH_MODULE_NAME}.so $INITRDDIR
 
-if [ -d ${DATADIR}/plymouth/${PLYMOUTH_PLUGIN_NAME} ]; then
-    for x in ${DATADIR}/plymouth/${PLYMOUTH_PLUGIN_NAME}/* ; do
+if [ -d ${DATADIR}/plymouth/themes/${PLYMOUTH_THEME_NAME} ]; then
+    for x in ${DATADIR}/plymouth/themes/${PLYMOUTH_THEME_NAME}/* ; do
         [ ! -f "$x" ] && break
         inst $x $INITRDDIR
     done
 fi
 
+if [ -L ${DATADIR}/plymouth/themes/default.plymouth ]; then
+    cp -a ${DATADIR}/plymouth/themes/default.plymouth $INITRDDIR${DATADIR}/plymouth/themes
+fi
+
 # vim:ts=8:sw=4:sts=4:et
similarity index 54%
rename from scripts/plymouth-set-default-plugin.in
rename to scripts/plymouth-set-default-theme.in
index 94b8b979e96f0b8502bd0ba9a1a9de1f2ec0715c..9ca9f35f5951d90ed0c0de360d737dd17f4e4ad7 100755 (executable)
@@ -16,41 +16,37 @@ fi
 
 function usage ()
 {
-  echo "usage: plymouth-set-default-plugin { --list | --reset | <plugin-name> [ --rebuild-initrd ] }"
+  echo "usage: plymouth-set-default-theme { --list | --reset | <theme-name> [ --rebuild-initrd ] }"
 }
 
-function list_plugins ()
+function list_themes ()
 {
-        for plugin in ${LIBDIR}/plymouth/*.so; do
-                [ -f $plugin ] || continue;
-                [ -L $plugin ] && continue;
-
-                if $(nm -D $plugin | grep -q ply_boot_splash_plugin_get_interface); then
-                        echo "$(basename $plugin .so)"
-                fi
+        for theme in ${DATADIR}/plymouth/themes/*/*.plymouth; do
+                [ -f $theme ] || continue;
+                echo "$(basename $theme .plymouth)"
         done
 }
 
-function get_default_plugin ()
+function get_default_theme ()
 {
-        PLUGIN_NAME=$(basename $(readlink ${LIBDIR}/plymouth/default.so) .so)
-        if [ "$PLUGIN_NAME" = ".so" ]; then
+        THEME_NAME=$(basename $(readlink ${DATADIR}/plymouth/themes/default.plymouth) .plymouth)
+        if [ "$THEME_NAME" = ".plymouth" ]; then
                 $0 --reset
-                PLUGIN_NAME=$(basename $(readlink ${LIBDIR}/plymouth/default.so) .so)
+                THEME_NAME=$(basename $(readlink ${DATADIR}/plymouth/themes/default.plymouth) .plymouth)
         fi
-        [ "$PLUGIN_NAME" = ".so" ] || echo $PLUGIN_NAME && exit 1
+        [ "$THEME_NAME" = ".so" ] || echo $THEME_NAME && exit 1
 }
 
 DO_RESET=0
 DO_INITRD_REBUILD=0
 DO_LIST=0
-PLUGIN_NAME=""
+THEME_NAME=""
 while [ $# -gt 0 ]; do
         case "$1" in
 
         --list)
-                if [ -n "$PLUGIN_NAME" ]; then
-                        echo "You can only specify --list or a plugin name, not both" > /dev/stderr
+                if [ -n "$THEME_NAME" ]; then
+                        echo "You can only specify --list or a theme name, not both" > /dev/stderr
                         echo $(usage) > /dev/stderr
                         exit 1
                 fi
@@ -69,8 +65,8 @@ while [ $# -gt 0 ]; do
         ;;
 
         --reset|default)
-                if [ -n "$PLUGIN_NAME" ]; then
-                        echo "You can only specify --reset or a plugin name, not both" > /dev/stderr
+                if [ -n "$THEME_NAME" ]; then
+                        echo "You can only specify --reset or a theme name, not both" > /dev/stderr
                         echo $(usage) > /dev/stderr
                         exit 1
                 fi
@@ -85,37 +81,37 @@ while [ $# -gt 0 ]; do
         ;;
 
         *)
-                if [ -n "$PLUGIN_NAME" ]; then
-                        echo "You can only specify one plugin at a time" > /dev/stderr
+                if [ -n "$THEME_NAME" ]; then
+                        echo "You can only specify one theme at a time" > /dev/stderr
                         echo $(usage) > /dev/stderr
                         exit 1
                 fi
 
                 if [ $DO_RESET -ne 0 ]; then
-                        echo "You can only specify --reset or a plugin name, not both" > /dev/stderr
+                        echo "You can only specify --reset or a theme name, not both" > /dev/stderr
                         echo $(usage) > /dev/stderr
                         exit 1
                 fi
 
                 if [ $DO_LIST -ne 0 ]; then
-                        echo "You can only specify --list or a plugin name, not both" > /dev/stderr
+                        echo "You can only specify --list or a theme name, not both" > /dev/stderr
                         echo $(usage) > /dev/stderr
                         exit 1
                 fi
 
-                PLUGIN_NAME="$1"
+                THEME_NAME="$1"
         ;;
   esac
   shift
 done
 
 if [ $DO_LIST -ne 0 ]; then
-        list_plugins
+        list_themes
         exit $?
 fi
 
-if [ $DO_RESET -eq 0 ] && [ $DO_INITRD_REBUILD -eq 0 ] && [ -z $PLUGIN_NAME ]; then
-        get_default_plugin
+if [ $DO_RESET -eq 0 ] && [ $DO_INITRD_REBUILD -eq 0 ] && [ -z $THEME_NAME ]; then
+        get_default_theme
         exit $?
 fi
 
@@ -125,20 +121,27 @@ if [ `id -u` -ne 0 ]; then
 fi
 
 if [ $DO_RESET -ne 0 ]; then
-        PLUGIN_NAME=$(basename $(ls -1 -t ${LIBDIR}/plymouth/*.so 2> /dev/null | grep -v default.so | grep -v label.so | tail -n 1) .so)
-        if [ $PLUGIN_NAME = .so ]; then
-                rm -f ${LIBDIR}/plymouth/default.so
+        THEME_NAME=$(basename $(ls -1 -t ${DATADIR}/plymouth/themes/*/*.plymouth 2> /dev/null | tail -n 1) .plymouth)
+        if [ $THEME_NAME = .plymouth ]; then
+                rm -f ${DATADIR}/plymouth/themes/default.plymouth
                 exit 0
         fi
 fi
 
-if [ ! -e ${LIBDIR}/plymouth/${PLUGIN_NAME}.so ]; then
-        echo "${LIBDIR}/plymouth/${PLUGIN_NAME}.so does not exist" > /dev/stderr
+if [ ! -e ${DATADIR}/plymouth/themes/${THEME_NAME}/${THEME_NAME}.plymouth ]; then
+        echo "${DATADIR}/plymouth/themes/${THEME_NAME}/${THEME_NAME}.plymouth does not exist" > /dev/stderr
+        exit 1
+fi
+
+MODULE_NAME=$(grep "ModuleName *= *" ${DATADIR}/plymouth/themes/${THEME_NAME}/${THEME_NAME}.plymouth | sed 's/ModuleName *= *//')
+
+if [ ! -e ${LIBDIR}/plymouth/${MODULE_NAME}.so ]; then
+        echo "${LIBDIR}/plymouth/${MODULE_NAME}.so does not exist" > /dev/stderr
         exit 1
 fi
 
-(cd ${LIBDIR}/plymouth;
-        ln -sf ${PLUGIN_NAME}.so default.so && \
+(cd ${DATADIR}/plymouth/themes;
+        ln -sf ${THEME_NAME}/${THEME_NAME}.plymouth default.plymouth && \
         ([ $DO_INITRD_REBUILD -ne 0 ] && \
            $LIBEXECDIR/plymouth/plymouth-update-initrd) || :)
 
index a90531766a3379e23428cd6b55094ab61661defb..b4e5cc728361f53762f559039f64e5712df46b86 100644 (file)
@@ -11,7 +11,9 @@ INCLUDES = -I$(top_srcdir)                                                    \
 plymouthdbindir = $(plymouthdaemondir)
 plymouthdbin_PROGRAMS = plymouthd
 
-plymouthd_CFLAGS = $(PLYMOUTH_CFLAGS) -DPLYMOUTH_PLUGIN_PATH=\"$(libdir)/plymouth/\"
+plymouthd_CFLAGS = $(PLYMOUTH_CFLAGS)                                         \
+                  -DPLYMOUTH_PLUGIN_PATH=\"$(libdir)/plymouth/\"             \
+                  -DPLYMOUTH_THEME_PATH=\"$(PLYMOUTH_THEME_PATH)/\"
 plymouthd_LDADD = $(PLYMOUTH_LIBS) libply/libply.la libplybootsplash/libplybootsplash.la
 plymouthd_SOURCES =                                                            \
                    ply-boot-protocol.h                                        \
index 5cd408c8f2bd5bbb592a4fed57398b67e5a9dc32..e22ae00f267a8d6ab1821387efa05ee09bc69189 100644 (file)
@@ -29,6 +29,7 @@
 #include "ply-buffer.h"
 #include "ply-event-loop.h"
 #include "ply-trigger.h"
+#include "ply-key-file.h"
 #include "ply-window.h"
 
 typedef enum
@@ -41,7 +42,7 @@ typedef struct _ply_boot_splash_plugin ply_boot_splash_plugin_t;
 
 typedef struct
 {
-  ply_boot_splash_plugin_t * (* create_plugin) (void);
+  ply_boot_splash_plugin_t * (* create_plugin) (ply_key_file_t *key_file);
   void (* destroy_plugin) (ply_boot_splash_plugin_t *plugin);
 
   void (* add_window) (ply_boot_splash_plugin_t *plugin,
index 5acc5e6750eee742eacad1251db178fb72be8b9c..440ac11e45a26bbc8f77ab42c0d7a3cc6fe72eb7 100644 (file)
@@ -105,7 +105,7 @@ typedef struct
 } state_t;
 
 static ply_boot_splash_t *start_boot_splash (state_t    *state,
-                                             const char *module_path);
+                                             const char *theme_path);
 
 static ply_window_t *create_window (state_t    *state,
                                     const char *tty_name);
@@ -181,7 +181,7 @@ show_detailed_splash (state_t *state)
 
   ply_trace ("Showing detailed splash screen");
   state->boot_splash = start_boot_splash (state,
-                                          PLYMOUTH_PLUGIN_PATH "details.so");
+                                          PLYMOUTH_THEME_PATH "details/details.plymouth");
 
   if (state->boot_splash == NULL)
     {
@@ -198,14 +198,14 @@ show_default_splash (state_t *state)
 
   ply_trace ("Showing splash screen");
   state->boot_splash = start_boot_splash (state,
-                                          PLYMOUTH_PLUGIN_PATH "default.so");
+                                          PLYMOUTH_THEME_PATH "default.plymouth");
 
   if (state->boot_splash == NULL)
     {
       ply_trace ("Could not start graphical splash screen,"
                  "showing text splash screen");
       state->boot_splash = start_boot_splash (state,
-                                              PLYMOUTH_PLUGIN_PATH "text.so");
+                                              PLYMOUTH_THEME_PATH "text/text.plymouth");
     }
 
   if (state->boot_splash == NULL)
@@ -908,15 +908,15 @@ add_windows_to_boot_splash (state_t           *state,
 
 static ply_boot_splash_t *
 start_boot_splash (state_t    *state,
-                   const char *module_path)
+                   const char *theme_path)
 {
   ply_boot_splash_t *splash;
   ply_boot_splash_mode_t splash_mode;
 
-  ply_trace ("Loading boot splash plugin '%s'",
-             module_path);
+  ply_trace ("Loading boot splash theme '%s'",
+             theme_path);
 
-  splash = ply_boot_splash_new (module_path, state->boot_buffer);
+  splash = ply_boot_splash_new (theme_path, PLYMOUTH_PLUGIN_PATH, state->boot_buffer);
 
   if (!ply_boot_splash_load (splash))
     {
index 168e643070cce53ae4bb5bea1c0a10e0a0648251..0585ddf67801011339afcdf4b0f16729e967937d 100644 (file)
@@ -43,6 +43,7 @@
 #include "ply-boot-splash-plugin.h"
 #include "ply-buffer.h"
 #include "ply-event-loop.h"
+#include "ply-key-file.h"
 #include "ply-list.h"
 #include "ply-logger.h"
 #include "ply-frame-buffer.h"
@@ -83,7 +84,7 @@ struct _ply_boot_splash_plugin
 };
 
 ply_boot_splash_plugin_t *
-create_plugin (void)
+create_plugin (ply_key_file_t *key_file)
 {
   ply_boot_splash_plugin_t *plugin;
 
index 85256d0a3d789b641899d4e57416bc593f682065..63e79681a2d4f6fab9990841834c0f1cb846b7cc 100644 (file)
@@ -21,8 +21,4 @@ fade_in_la_LIBADD = $(PLYMOUTH_LIBS)                                          \
                     ../../../libplybootsplash/libplybootsplash.la
 fade_in_la_SOURCES = $(srcdir)/plugin.c
 
-plymouthdir = $(datadir)/plymouth/fade-in
-plymouth_DATA = star.png bullet.png entry.png lock.png
-
-EXTRA_DIST = $(plymouth_DATA)
 MAINTAINERCLEANFILES = Makefile.in
index 40c61ff7ceb814697915ae121de1841008422074..5a7a3492da82e2629c9a911fb9697f6621737303 100644 (file)
@@ -47,6 +47,7 @@
 #include "ply-logger.h"
 #include "ply-frame-buffer.h"
 #include "ply-image.h"
+#include "ply-key-file.h"
 #include "ply-trigger.h"
 #include "ply-utils.h"
 #include "ply-window.h"
@@ -92,18 +93,29 @@ struct _ply_boot_splash_plugin
 };
 
 ply_boot_splash_plugin_t *
-create_plugin (void)
+create_plugin (ply_key_file_t *key_file)
 {
   ply_boot_splash_plugin_t *plugin;
+  char *image_dir, *image_path;
 
   srand ((int) ply_get_timestamp ());
   plugin = calloc (1, sizeof (ply_boot_splash_plugin_t));
   plugin->start_time = 0.0;
 
   plugin->logo_image = ply_image_new (PLYMOUTH_LOGO_FILE);
-  plugin->star_image = ply_image_new (PLYMOUTH_IMAGE_DIR "fade-in/star.png");
-  plugin->lock_image = ply_image_new (PLYMOUTH_IMAGE_DIR "fade-in/lock.png");
-  plugin->entry = ply_entry_new (PLYMOUTH_IMAGE_DIR "fade-in");
+  image_dir = ply_key_file_get_value (key_file, "fade-in", "ImageDir");
+
+  asprintf (&image_path, "%s/star.png", image_dir);
+  plugin->star_image = ply_image_new (image_path);
+  free (image_path);
+
+  asprintf (&image_path, "%s/lock.png", image_dir);
+  plugin->lock_image = ply_image_new (image_path);
+  free (image_path);
+
+  plugin->entry = ply_entry_new (image_dir);
+  free (image_dir);
+
   plugin->state = PLY_BOOT_SPLASH_DISPLAY_NORMAL;
   plugin->stars = ply_list_new ();
 
index 705e7afcce7ea2f6ab7af80d8380b206c6015ce7..ad7d9ba6de9b4ad8ebb52440bd9b170e046d2881 100644 (file)
@@ -21,65 +21,4 @@ glow_la_LIBADD =    $(PLYMOUTH_LIBS)                                         \
                     ../../../libplybootsplash/libplybootsplash.la
 glow_la_SOURCES = $(srcdir)/plugin.c
 
-plymouthdir = $(datadir)/plymouth/glow
-plymouth_DATA = \
-       images/box.png                  \
-       images/bullet.png               \
-       images/entry.png                \
-       images/lock.png                 \
-       images/progress-00.png          \
-       images/progress-01.png          \
-       images/progress-02.png          \
-       images/progress-03.png          \
-       images/progress-04.png          \
-       images/progress-05.png          \
-       images/progress-06.png          \
-       images/progress-07.png          \
-       images/progress-08.png          \
-       images/progress-09.png          \
-       images/progress-10.png          \
-       images/progress-11.png          \
-       images/progress-12.png          \
-       images/progress-13.png          \
-       images/progress-14.png          \
-       images/progress-15.png          \
-       images/progress-16.png          \
-       images/progress-17.png          \
-       images/progress-18.png          \
-       images/progress-19.png          \
-       images/progress-20.png          \
-       images/progress-21.png          \
-       images/progress-22.png          \
-       images/progress-23.png          \
-       images/progress-24.png          \
-       images/progress-25.png          \
-       images/progress-26.png          \
-       images/progress-27.png          \
-       images/progress-28.png          \
-       images/progress-29.png          \
-       images/progress-30.png          \
-       images/progress-31.png          \
-       images/progress-32.png          \
-       images/throbber-00.png          \
-       images/throbber-01.png          \
-       images/throbber-02.png          \
-       images/throbber-03.png          \
-       images/throbber-04.png          \
-       images/throbber-05.png          \
-       images/throbber-06.png          \
-       images/throbber-07.png          \
-       images/throbber-08.png          \
-       images/throbber-09.png          \
-       images/throbber-10.png          \
-       images/throbber-11.png          \
-       images/throbber-12.png          \
-       images/throbber-13.png          \
-       images/throbber-14.png          \
-       images/throbber-15.png          \
-       images/throbber-16.png          \
-       images/throbber-17.png          \
-       images/throbber-18.png          \
-       images/throbber-19.png
-
-EXTRA_DIST = $(plymouth_DATA)
 MAINTAINERCLEANFILES = Makefile.in
index 6d2490e81ab565ac58236515be38e7d67e2d2085..2c7f4cdcbc05443cf32193ee76a7a9b04771a797 100644 (file)
@@ -49,6 +49,7 @@
 #include "ply-logger.h"
 #include "ply-frame-buffer.h"
 #include "ply-image.h"
+#include "ply-key-file.h"
 #include "ply-trigger.h"
 #include "ply-utils.h"
 #include "ply-window.h"
@@ -88,6 +89,10 @@ struct _ply_boot_splash_plugin
   ply_label_t *label;
   ply_boot_splash_display_type_t state;
 
+  double animation_horizontal_alignment;
+  double animation_vertical_alignment;
+  char *animation_dir;
+
   ply_trigger_t *idle_trigger;
 
   uint32_t root_is_mounted : 1;
@@ -100,22 +105,42 @@ static void remove_handlers (ply_boot_splash_plugin_t *plugin);
 
 static void detach_from_event_loop (ply_boot_splash_plugin_t *plugin);
 ply_boot_splash_plugin_t *
-create_plugin (void)
+create_plugin (ply_key_file_t *key_file)
 {
   ply_boot_splash_plugin_t *plugin;
+  char *image_dir, *image_path;
+  char *alignment;
 
   srand ((int) ply_get_timestamp ());
   plugin = calloc (1, sizeof (ply_boot_splash_plugin_t));
 
-  plugin->lock_image = ply_image_new (PLYMOUTH_IMAGE_DIR "glow/lock.png");
-  plugin->box_image = ply_image_new (PLYMOUTH_IMAGE_DIR "glow/box.png");
+  image_dir = ply_key_file_get_value (key_file, "glow", "ImageDir");
 
-  plugin->entry = ply_entry_new (PLYMOUTH_IMAGE_DIR "glow");
-  plugin->animation = ply_animation_new (PLYMOUTH_IMAGE_DIR "glow",
-                                         "throbber-");
-  plugin->progress_animation = ply_progress_animation_new (PLYMOUTH_IMAGE_DIR "glow",
-                                                           "progress-");
+  asprintf (&image_path, "%s/lock.png", image_dir);
+  plugin->lock_image = ply_image_new (image_path);
+  free (image_path);
+
+  asprintf (&image_path, "%s/box.png", image_dir);
+  plugin->box_image = ply_image_new (image_path);
+  free (image_path);
+
+  plugin->entry = ply_entry_new (image_dir);
   plugin->label = ply_label_new ();
+  plugin->animation_dir = image_dir;
+
+  alignment = ply_key_file_get_value (key_file, "glow", "HorizontalAlignment");
+  if (alignment != NULL)
+    plugin->animation_horizontal_alignment = strtod (alignment, NULL);
+  else
+    plugin->animation_horizontal_alignment = .5;
+  free (alignment);
+
+  alignment = ply_key_file_get_value (key_file, "glow", "VerticalAlignment");
+  if (alignment != NULL)
+    plugin->animation_vertical_alignment = strtod (alignment, NULL);
+  else
+    plugin->animation_vertical_alignment = .5;
+  free (alignment);
 
   return plugin;
 }
@@ -175,8 +200,8 @@ begin_animation (ply_boot_splash_plugin_t *plugin,
                        plugin->loop,
                        plugin->window,
                        trigger,
-                       area.width / 4.0 - width / 2.0,
-                       area.height / 2 - height / 2.0);
+                       plugin->animation_horizontal_alignment * area.width - width / 2.0,
+                       plugin->animation_vertical_alignment * area.height - height / 2.0);
 }
 
 static void
@@ -205,8 +230,8 @@ start_animation (ply_boot_splash_plugin_t *plugin)
   height = ply_progress_animation_get_height (plugin->progress_animation);
   ply_progress_animation_show (plugin->progress_animation,
                                plugin->window,
-                               area.width / 4.0 - width / 2.0,
-                               area.height / 2 - height / 2.0);
+                               plugin->animation_horizontal_alignment * area.width - width / 2.0,
+                               plugin->animation_vertical_alignment * area.height - height / 2.0);
 
   plugin->is_animating = true;
 }
@@ -389,6 +414,11 @@ show_splash_screen (ply_boot_splash_plugin_t *plugin,
   plugin->loop = loop;
   plugin->mode = mode;
 
+  plugin->animation = ply_animation_new (plugin->animation_dir,
+                                         "throbber-");
+  plugin->progress_animation = ply_progress_animation_new (plugin->animation_dir,
+                                                           "progress-");
+
   ply_trace ("loading lock image");
   if (!ply_image_load (plugin->lock_image))
     return false;
@@ -563,7 +593,6 @@ show_password_prompt (ply_boot_splash_plugin_t *plugin,
 
       ply_label_show (plugin->label, plugin->window, x, y);
     }
-
 }
 
 void
index d767d78cdb5d0081404a5c5c645fb0b6730e5212..05771ad766917ecf119ec87f38e38f7ad015e301 100644 (file)
@@ -44,6 +44,7 @@
 #include "ply-boot-splash-plugin.h"
 #include "ply-buffer.h"
 #include "ply-event-loop.h"
+#include "ply-key-file.h"
 #include "ply-list.h"
 #include "ply-logger.h"
 #include "ply-frame-buffer.h"
@@ -75,7 +76,7 @@ static void add_handlers (ply_boot_splash_plugin_t *plugin);
 static void remove_handlers (ply_boot_splash_plugin_t *plugin);
 
 ply_boot_splash_plugin_t *
-create_plugin (void)
+create_plugin (ply_key_file_t *key_file)
 {
   ply_boot_splash_plugin_t *plugin;
 
index ede61ec9c829765644b3cc2b0421f167f4ea3e46..f39dfc6fb0dd589398a8ba155777e48b19562c2e 100644 (file)
@@ -21,11 +21,4 @@ solar_la_LIBADD =    $(PLYMOUTH_LIBS)                                         \
                     ../../../libplybootsplash/libplybootsplash.la
 solar_la_SOURCES = $(srcdir)/plugin.c
 
-plymouthdir = $(datadir)/plymouth/solar
-plymouth_DATA = bullet.png entry.png lock.png                                 \
-                star.png box.png                                              \
-                progress_bar.png
-#                planet1.png planet2.png planet3.png planet4.png planet5.png
-
-EXTRA_DIST = $(plymouth_DATA)
 MAINTAINERCLEANFILES = Makefile.in
index 8ce2472ffee02498eecc516987dfa0d382da6c0b..45ee033a7f9304567a562cd25facb50e52916485 100644 (file)
@@ -45,6 +45,7 @@
 #include "ply-buffer.h"
 #include "ply-entry.h"
 #include "ply-event-loop.h"
+#include "ply-key-file.h"
 #include "ply-label.h"
 #include "ply-list.h"
 #include "ply-logger.h"
@@ -209,29 +210,62 @@ static void detach_from_event_loop (ply_boot_splash_plugin_t *plugin);
 
 
 ply_boot_splash_plugin_t *
-create_plugin (void)
+create_plugin (ply_key_file_t *key_file)
 {
   ply_boot_splash_plugin_t *plugin;
+  char *image_dir, *image_path;
 
   srand ((int) ply_get_timestamp ());
   plugin = calloc (1, sizeof (ply_boot_splash_plugin_t));
 
   plugin->logo_image = ply_image_new (PLYMOUTH_LOGO_FILE);
-  plugin->lock_image = ply_image_new (PLYMOUTH_IMAGE_DIR "solar/lock.png");
-  plugin->box_image = ply_image_new (PLYMOUTH_IMAGE_DIR "solar/box.png");
+
+  image_dir = ply_key_file_get_value (key_file, "solar", "ImageDir");
+
+  asprintf (&image_path, "%s/lock.png", image_dir);
+  plugin->lock_image = ply_image_new (image_path);
+  free (image_path);
+
+  asprintf (&image_path, "%s/box.png", image_dir);
+  plugin->box_image = ply_image_new (image_path);
+  free (image_path);
+
   plugin->scaled_background_image = NULL;
-  plugin->star_image = ply_image_new (PLYMOUTH_IMAGE_DIR "solar/star.png");
+
+  asprintf (&image_path, "%s/star.png", image_dir);
+  plugin->star_image = ply_image_new (image_path);
+  free (image_path);
+
 #ifdef  SHOW_PLANETS
-  plugin->planet_image[0] = ply_image_new (PLYMOUTH_IMAGE_DIR "solar/planet1.png");
-  plugin->planet_image[1] = ply_image_new (PLYMOUTH_IMAGE_DIR "solar/planet2.png");
-  plugin->planet_image[2] = ply_image_new (PLYMOUTH_IMAGE_DIR "solar/planet3.png");
-  plugin->planet_image[3] = ply_image_new (PLYMOUTH_IMAGE_DIR "solar/planet4.png");
-  plugin->planet_image[4] = ply_image_new (PLYMOUTH_IMAGE_DIR "solar/planet5.png");
+
+  asprintf (&image_path, "%s/plant1.png", image_dir);
+  plugin->planet_image[0] = ply_image_new (image_path);
+  free (image_path);
+
+  asprintf (&image_path, "%s/plant2.png", image_dir);
+  plugin->planet_image[1] = ply_image_new (image_path);
+  free (image_path);
+
+  asprintf (&image_path, "%s/plant3.png", image_dir);
+  plugin->planet_image[2] = ply_image_new (image_path);
+  free (image_path);
+
+  asprintf (&image_path, "%s/plant4.png", image_dir);
+  plugin->planet_image[3] = ply_image_new (image_path);
+  free (image_path);
+
+  asprintf (&image_path, "%s/plant5.png", image_dir);
+  plugin->planet_image[4] = ply_image_new (image_path);
+  free (image_path);
+
 #endif
 #ifdef  SHOW_PROGRESS_BAR
-  plugin->progress_barimage = ply_image_new (PLYMOUTH_IMAGE_DIR "solar/progress_bar.png");
+
+  asprintf (&image_path, "%s/progress_bar.png", image_dir);
+  plugin->progress_barimage = ply_image_new (image_path);
+  free (image_path);
 #endif
-  plugin->entry = ply_entry_new (PLYMOUTH_IMAGE_DIR "solar");
+  plugin->entry = ply_entry_new (image_dir);
   plugin->label = ply_label_new ();
   plugin->state = PLY_BOOT_SPLASH_DISPLAY_NORMAL;
   plugin->sprites = ply_list_new();
index 4b3ca55078a23a24c0ba83386f93f9fc205ea573..3b17c21b56a428ccba815b1f6f50994843f00d0c 100644 (file)
@@ -23,44 +23,4 @@ spinfinity_la_LIBADD = $(PLYMOUTH_LIBS)                                      \
                        ../../../libplybootsplash/libplybootsplash.la
 spinfinity_la_SOURCES = $(srcdir)/plugin.c
 
-throbber_frames =                                                            \
-                    throbber-00.png                                          \
-                    throbber-01.png                                          \
-                    throbber-02.png                                          \
-                    throbber-03.png                                          \
-                    throbber-04.png                                          \
-                    throbber-05.png                                          \
-                    throbber-06.png                                          \
-                    throbber-07.png                                          \
-                    throbber-08.png                                          \
-                    throbber-09.png                                          \
-                    throbber-10.png                                          \
-                    throbber-11.png                                          \
-                    throbber-12.png                                          \
-                    throbber-13.png                                          \
-                    throbber-14.png                                          \
-                    throbber-15.png                                          \
-                    throbber-16.png                                          \
-                    throbber-17.png                                          \
-                    throbber-18.png                                          \
-                    throbber-19.png                                          \
-                    throbber-20.png                                          \
-                    throbber-21.png                                          \
-                    throbber-22.png                                          \
-                    throbber-23.png                                          \
-                    throbber-24.png                                          \
-                    throbber-25.png                                          \
-                    throbber-26.png                                          \
-                    throbber-27.png                                          \
-                    throbber-28.png                                          \
-                    throbber-29.png                                          \
-                    throbber-30.png                                          \
-                    throbber-31.png                                          \
-                    throbber-32.png                                          \
-                    throbber-33.png
-
-plymouthdir = $(datadir)/plymouth/spinfinity
-plymouth_DATA = bullet.png entry.png lock.png box.png $(throbber_frames)
-
-EXTRA_DIST = $(plymouth_DATA)
 MAINTAINERCLEANFILES = Makefile.in
index 622fa7154807c2522366a74d2d689a5e54a6ee7c..df8c4418ff4b5bfbf601f9f70fa26767740f854e 100644 (file)
@@ -44,6 +44,7 @@
 #include "ply-buffer.h"
 #include "ply-entry.h"
 #include "ply-event-loop.h"
+#include "ply-key-file.h"
 #include "ply-label.h"
 #include "ply-list.h"
 #include "ply-progress-bar.h"
@@ -101,20 +102,27 @@ static void remove_handlers (ply_boot_splash_plugin_t *plugin);
 
 static void detach_from_event_loop (ply_boot_splash_plugin_t *plugin);
 ply_boot_splash_plugin_t *
-create_plugin (void)
+create_plugin (ply_key_file_t *key_file)
 {
   ply_boot_splash_plugin_t *plugin;
+  char *image_dir, *image_path;
 
   srand ((int) ply_get_timestamp ());
   plugin = calloc (1, sizeof (ply_boot_splash_plugin_t));
 
   plugin->logo_image = ply_image_new (PLYMOUTH_LOGO_FILE);
-  plugin->lock_image = ply_image_new (PLYMOUTH_IMAGE_DIR "spinfinity/lock.png");
-  plugin->box_image = ply_image_new (PLYMOUTH_IMAGE_DIR "spinfinity/box.png");
+  image_dir = ply_key_file_get_value (key_file, "spinfinity", "ImageDir");
 
-  plugin->entry = ply_entry_new (PLYMOUTH_IMAGE_DIR "spinfinity");
-  plugin->throbber = ply_throbber_new (PLYMOUTH_IMAGE_DIR "spinfinity",
-                                   "throbber-");
+  asprintf (&image_path, "%s/lock.png", image_dir);
+  plugin->lock_image = ply_image_new (image_path);
+  free (image_path);
+
+  asprintf (&image_path, "%s/box.png", image_dir);
+  plugin->box_image = ply_image_new (image_path);
+  free (image_path);
+
+  plugin->entry = ply_entry_new (image_dir);
+  plugin->throbber = ply_throbber_new (image_dir, "throbber-");
   plugin->label = ply_label_new ();
   plugin->progress_bar = ply_progress_bar_new ();
 
index b9b7ad289bc38dd0300922ab86e1cf74f73362ee..65111e263bd79e32d481993e20981a89a011fc8d 100644 (file)
@@ -45,6 +45,7 @@
 #include "ply-boot-splash-plugin.h"
 #include "ply-buffer.h"
 #include "ply-event-loop.h"
+#include "ply-key-file.h"
 #include "ply-list.h"
 #include "ply-logger.h"
 #include "ply-frame-buffer.h"
@@ -79,7 +80,7 @@ static void add_handlers (ply_boot_splash_plugin_t *plugin);
 static void remove_handlers (ply_boot_splash_plugin_t *plugin);
 
 ply_boot_splash_plugin_t *
-create_plugin (void)
+create_plugin (ply_key_file_t *key_file)
 {
   ply_boot_splash_plugin_t *plugin;
 
index e9533675e900d540f30a0456a867726b71a8ea64..c92ae1a57067f1dc71add5ca8d3951285e0c3615 100644 (file)
@@ -40,6 +40,7 @@
 #include "ply-trigger.h"
 #include "ply-utils.h"
 #include "ply-progress.h"
+#include "ply-key-file.h"
 
 #ifndef UPDATES_PER_SECOND
 #define UPDATES_PER_SECOND 30
@@ -55,7 +56,8 @@ struct _ply_boot_splash
   ply_buffer_t *boot_buffer;
   ply_trigger_t *idle_trigger;
 
-  char *module_name;
+  char *theme_path;
+  char *plugin_dir;
   char *status;
 
   ply_progress_t *progress;
@@ -68,16 +70,18 @@ typedef const ply_boot_splash_plugin_interface_t *
         (* get_plugin_interface_function_t) (void);
 
 ply_boot_splash_t *
-ply_boot_splash_new (const char   *module_name,
+ply_boot_splash_new (const char   *theme_path,
+                     const char   *plugin_dir,
                      ply_buffer_t *boot_buffer)
 {
   ply_boot_splash_t *splash;
 
-  assert (module_name != NULL);
+  assert (theme_path != NULL);
 
   splash = calloc (1, sizeof (ply_boot_splash_t));
   splash->loop = NULL;
-  splash->module_name = strdup (module_name);
+  splash->theme_path = strdup (theme_path);
+  splash->plugin_dir = strdup (plugin_dir);
   splash->module_handle = NULL;
   splash->is_shown = false;
 
@@ -103,16 +107,35 @@ ply_boot_splash_remove_window (ply_boot_splash_t *splash,
 bool
 ply_boot_splash_load (ply_boot_splash_t *splash)
 {
+  ply_key_file_t *key_file;
+  char *module_name;
+  char *module_path;
+
   assert (splash != NULL);
-  assert (splash->module_name != NULL);
 
   get_plugin_interface_function_t get_boot_splash_plugin_interface;
 
-  splash->module_handle = ply_open_module (splash->module_name);
+  key_file = ply_key_file_new (splash->theme_path);
 
-  if (splash->module_handle == NULL)
+  if (!ply_key_file_load (key_file))
     return false;
 
+  module_name = ply_key_file_get_value (key_file, "Plymouth Theme", "ModuleName");
+
+  asprintf (&module_path, "%s%s.so",
+            splash->plugin_dir, module_name);
+  free (module_name);
+
+  splash->module_handle = ply_open_module (module_path);
+
+  free (module_path);
+
+  if (splash->module_handle == NULL)
+    {
+      ply_key_file_free (key_file);
+      return false;
+    }
+
   get_boot_splash_plugin_interface = (get_plugin_interface_function_t)
       ply_module_look_up_function (splash->module_handle,
                                    "ply_boot_splash_plugin_get_interface");
@@ -122,6 +145,7 @@ ply_boot_splash_load (ply_boot_splash_t *splash)
       ply_save_errno ();
       ply_close_module (splash->module_handle);
       splash->module_handle = NULL;
+      ply_key_file_free (key_file);
       ply_restore_errno ();
       return false;
     }
@@ -133,11 +157,14 @@ ply_boot_splash_load (ply_boot_splash_t *splash)
       ply_save_errno ();
       ply_close_module (splash->module_handle);
       splash->module_handle = NULL;
+      ply_key_file_free (key_file);
       ply_restore_errno ();
       return false;
     }
 
-  splash->plugin = splash->plugin_interface->create_plugin ();
+  splash->plugin = splash->plugin_interface->create_plugin (key_file);
+
+  ply_key_file_free (key_file);
 
   assert (splash->plugin != NULL);
 
@@ -173,7 +200,8 @@ ply_boot_splash_free (ply_boot_splash_t *splash)
   if (splash->module_handle != NULL)
     ply_boot_splash_unload (splash);
 
-  free (splash->module_name);
+  free (splash->theme_path);
+  free (splash->plugin_dir);
   free (splash);
 }
 
@@ -218,7 +246,7 @@ ply_boot_splash_show (ply_boot_splash_t *splash,
                       ply_boot_splash_mode_t mode)
 {
   assert (splash != NULL);
-  assert (splash->module_name != NULL);
+  assert (splash->module_handle != NULL);
   assert (splash->loop != NULL);
 
   if (splash->is_shown)
@@ -436,16 +464,16 @@ main (int    argc,
   int exit_code;
   test_state_t state;
   char *tty_name;
-  const char *module_name;
+  const char *theme_path;
 
   exit_code = 0;
 
   state.loop = ply_event_loop_new ();
 
   if (argc > 1)
-    module_name = argv[1];
+    theme_path = argv[1];
   else
-    module_name = "../splash-plugins/fade-in/.libs/fade-in.so";
+    theme_path = PLYMOUTH_THEME_PATH "/fade-in/fade-in.plymouth";
 
   tty_name = strdup("tty");
   if (argc > 2) {
@@ -468,7 +496,7 @@ main (int    argc,
                                  (ply_window_escape_handler_t) on_quit, &state);
 
   state.buffer = ply_buffer_new ();
-  state.splash = ply_boot_splash_new (module_name, state.buffer);
+  state.splash = ply_boot_splash_new (theme_path, PLYMOUTH_PLUGIN_PATH, state.buffer);
   if (!ply_boot_splash_load (state.splash))
     {
       perror ("could not load splash screen");
index 04085ed14ec5b059e54a9188128bbb792f47e306..90cd5853deb0263bbe2c4aa20990376ca7d96185 100644 (file)
@@ -37,7 +37,8 @@ typedef struct _ply_boot_splash ply_boot_splash_t;
 typedef void (* ply_boot_splash_on_idle_handler_t) (void *user_data);
 
 #ifndef PLY_HIDE_FUNCTION_DECLARATIONS
-ply_boot_splash_t *ply_boot_splash_new (const char *module_name,
+ply_boot_splash_t *ply_boot_splash_new (const char   *theme_path,
+                                        const char   *plugin_dir,
                                         ply_buffer_t *boot_buffer);
 bool ply_boot_splash_load (ply_boot_splash_t *splash);
 void ply_boot_splash_unload (ply_boot_splash_t *splash);
index 4494d26ff885ffec9f8e25546eb3826dc715bec2..9c116b539be34636ff7eec8cc9139f449b5201cc 100644 (file)
@@ -3,6 +3,7 @@ exec_prefix=@exec_prefix@
 libdir=@libdir@
 includedir=@includedir@
 pluginsdir=@libdir@/plymouth-1
+themesdir=@PLYMOUTH_PLUGIN_PATH@
 
 Name: Plymouth
 Description: Utility Library for Boot Splash Plugins
diff --git a/themes/Makefile.am b/themes/Makefile.am
new file mode 100644 (file)
index 0000000..6613ba6
--- /dev/null
@@ -0,0 +1,2 @@
+SUBDIRS = spinfinity fade-in text details solar pulser glow
+MAINTAINERCLEANFILES = Makefile.in
diff --git a/themes/details/Makefile.am b/themes/details/Makefile.am
new file mode 100644 (file)
index 0000000..6ff0543
--- /dev/null
@@ -0,0 +1,4 @@
+themedir = $(datadir)/plymouth/themes/details
+dist_theme_DATA = details.plymouth
+
+MAINTAINERCLEANFILES = Makefile.in
diff --git a/themes/details/details.plymouth b/themes/details/details.plymouth
new file mode 100644 (file)
index 0000000..bd84964
--- /dev/null
@@ -0,0 +1,4 @@
+[Plymouth Theme]
+Name=Details
+Description=Verbose fallback theme
+ModuleName=details
diff --git a/themes/fade-in/Makefile.am b/themes/fade-in/Makefile.am
new file mode 100644 (file)
index 0000000..e79ebfd
--- /dev/null
@@ -0,0 +1,9 @@
+themedir = $(datadir)/plymouth/themes/fade-in
+dist_theme_DATA = fade-in.plymouth star.png bullet.png entry.png lock.png
+
+MAINTAINERCLEANFILES = Makefile.in fade-in.plymouth
+CLEANFILES = fade-in.plymouth
+
+fade-in.plymouth: $(srcdir)/fade-in.plymouth.in
+       sed -e 's,[@]PLYMOUTH_THEME_PATH[@],$(PLYMOUTH_THEME_PATH),g' \
+              $(srcdir)/fade-in.plymouth.in > fade-in.plymouth
diff --git a/themes/fade-in/fade-in.plymouth.in b/themes/fade-in/fade-in.plymouth.in
new file mode 100644 (file)
index 0000000..532e720
--- /dev/null
@@ -0,0 +1,7 @@
+[Plymouth Theme]
+Name=Fade In
+Description=Simple theme that fades in and out with shimmering stars
+ModuleName=fade-in
+
+[fade-in]
+ImageDir=@PLYMOUTH_THEME_PATH@/fade-in
diff --git a/themes/glow/Makefile.am b/themes/glow/Makefile.am
new file mode 100644 (file)
index 0000000..472506d
--- /dev/null
@@ -0,0 +1,68 @@
+themedir = $(datadir)/plymouth/themes/glow
+dist_theme_DATA =                                                     \
+                    glow.plymouth                                     \
+                    box.png                                           \
+                    bullet.png                                        \
+                    entry.png                                         \
+                    lock.png                                          \
+                    progress-00.png                                   \
+                    progress-01.png                                   \
+                    progress-02.png                                   \
+                    progress-03.png                                   \
+                    progress-04.png                                   \
+                    progress-05.png                                   \
+                    progress-06.png                                   \
+                    progress-07.png                                   \
+                    progress-08.png                                   \
+                    progress-09.png                                   \
+                    progress-10.png                                   \
+                    progress-11.png                                   \
+                    progress-12.png                                   \
+                    progress-13.png                                   \
+                    progress-14.png                                   \
+                    progress-15.png                                   \
+                    progress-16.png                                   \
+                    progress-17.png                                   \
+                    progress-18.png                                   \
+                    progress-19.png                                   \
+                    progress-20.png                                   \
+                    progress-21.png                                   \
+                    progress-22.png                                   \
+                    progress-23.png                                   \
+                    progress-24.png                                   \
+                    progress-25.png                                   \
+                    progress-26.png                                   \
+                    progress-27.png                                   \
+                    progress-28.png                                   \
+                    progress-29.png                                   \
+                    progress-30.png                                   \
+                    progress-31.png                                   \
+                    progress-32.png                                   \
+                    throbber-00.png                                   \
+                    throbber-01.png                                   \
+                    throbber-02.png                                   \
+                    throbber-03.png                                   \
+                    throbber-04.png                                   \
+                    throbber-05.png                                   \
+                    throbber-06.png                                   \
+                    throbber-07.png                                   \
+                    throbber-08.png                                   \
+                    throbber-09.png                                   \
+                    throbber-10.png                                   \
+                    throbber-11.png                                   \
+                    throbber-12.png                                   \
+                    throbber-13.png                                   \
+                    throbber-14.png                                   \
+                    throbber-15.png                                   \
+                    throbber-16.png                                   \
+                    throbber-17.png                                   \
+                    throbber-18.png                                   \
+                    throbber-19.png
+
+MAINTAINERCLEANFILES = Makefile.in glow.plymouth
+CLEANFILES = glow.plymouth
+
+glow.plymouth: $(srcdir)/glow.plymouth.in
+       sed -e 's,[@]PLYMOUTH_THEME_PATH[@],$(PLYMOUTH_THEME_PATH),g' \
+              $(srcdir)/glow.plymouth.in > glow.plymouth
+
diff --git a/themes/glow/glow.plymouth.in b/themes/glow/glow.plymouth.in
new file mode 100644 (file)
index 0000000..f977904
--- /dev/null
@@ -0,0 +1,9 @@
+[Plymouth Theme]
+Name=Bizcom Glow
+Description=Corporate theme with pie chart boot progress followed by a glowing emerging logo
+ModuleName=glow
+
+[glow]
+ImageDir=@PLYMOUTH_THEME_PATH@/glow
+HorizontalAlignment=.25
+VerticalAlignment=.5
diff --git a/themes/pulser/Makefile.am b/themes/pulser/Makefile.am
new file mode 100644 (file)
index 0000000..d5836ab
--- /dev/null
@@ -0,0 +1,4 @@
+themedir = $(datadir)/plymouth/themes/pulser
+dist_theme_DATA = pulser.plymouth
+
+MAINTAINERCLEANFILES = Makefile.in
diff --git a/themes/pulser/pulser.plymouth b/themes/pulser/pulser.plymouth
new file mode 100644 (file)
index 0000000..8a833ec
--- /dev/null
@@ -0,0 +1,4 @@
+[Plymouth Theme]
+Name=Pulser
+Description=Ugly text mode plugin with cylon like pulsing progress bar
+ModuleName=pulser
diff --git a/themes/solar/Makefile.am b/themes/solar/Makefile.am
new file mode 100644 (file)
index 0000000..a3f32db
--- /dev/null
@@ -0,0 +1,20 @@
+themedir = $(datadir)/plymouth/themes/solar
+dist_theme_DATA =                                                     \
+                    solar.plymouth                                    \
+                    box.png                                           \
+                    bullet.png                                        \
+                    entry.png                                         \
+                    lock.png                                          \
+                    progress_bar.png                                  \
+                    star.png
+
+
+
+MAINTAINERCLEANFILES = Makefile.in solar.plymouth
+CLEANFILES = solar.plymouth
+
+solar.plymouth: $(srcdir)/solar.plymouth.in
+       sed -e 's,[@]PLYMOUTH_THEME_PATH[@],$(PLYMOUTH_THEME_PATH),g' \
+              $(srcdir)/solar.plymouth.in > solar.plymouth
+
+
diff --git a/themes/solar/solar.plymouth.in b/themes/solar/solar.plymouth.in
new file mode 100644 (file)
index 0000000..d2e63f4
--- /dev/null
@@ -0,0 +1,7 @@
+[Plymouth Theme]
+Name=Solar
+Description=Space theme with violent flaring blue star
+ModuleName=solar
+
+[solar]
+ImageDir=@PLYMOUTH_THEME_PATH@/solar
diff --git a/themes/spinfinity/Makefile.am b/themes/spinfinity/Makefile.am
new file mode 100644 (file)
index 0000000..44736fb
--- /dev/null
@@ -0,0 +1,50 @@
+themedir = $(datadir)/plymouth/themes/spinfinity
+dist_theme_DATA =                                                     \
+                  spinfinity.plymouth                                 \
+                  box.png                                             \
+                  bullet.png                                          \
+                  entry.png                                           \
+                  lock.png                                            \
+                  throbber-00.png                                     \
+                  throbber-01.png                                     \
+                  throbber-02.png                                     \
+                  throbber-03.png                                     \
+                  throbber-04.png                                     \
+                  throbber-05.png                                     \
+                  throbber-06.png                                     \
+                  throbber-07.png                                     \
+                  throbber-08.png                                     \
+                  throbber-09.png                                     \
+                  throbber-10.png                                     \
+                  throbber-11.png                                     \
+                  throbber-12.png                                     \
+                  throbber-13.png                                     \
+                  throbber-14.png                                     \
+                  throbber-15.png                                     \
+                  throbber-16.png                                     \
+                  throbber-17.png                                     \
+                  throbber-18.png                                     \
+                  throbber-19.png                                     \
+                  throbber-20.png                                     \
+                  throbber-21.png                                     \
+                  throbber-22.png                                     \
+                  throbber-23.png                                     \
+                  throbber-24.png                                     \
+                  throbber-25.png                                     \
+                  throbber-26.png                                     \
+                  throbber-27.png                                     \
+                  throbber-28.png                                     \
+                  throbber-29.png                                     \
+                  throbber-30.png                                     \
+                  throbber-31.png                                     \
+                  throbber-32.png                                     \
+                  throbber-33.png
+
+MAINTAINERCLEANFILES = Makefile.in spinfinity.plymouth
+CLEANFILES = spinfinity.plymouth
+
+spinfinity.plymouth: $(srcdir)/spinfinity.plymouth.in
+       sed -e 's,[@]PLYMOUTH_THEME_PATH[@],$(PLYMOUTH_THEME_PATH),g' \
+              $(srcdir)/spinfinity.plymouth.in > spinfinity.plymouth
+
+
diff --git a/themes/spinfinity/spinfinity.plymouth.in b/themes/spinfinity/spinfinity.plymouth.in
new file mode 100644 (file)
index 0000000..9c11c3b
--- /dev/null
@@ -0,0 +1,7 @@
+[Plymouth Theme]
+Name=Spinfinity
+Description=Simple theme that shows a rotating infinity sign in the center of the screen
+ModuleName=spinfinity
+
+[spinfinity]
+ImageDir=@PLYMOUTH_THEME_PATH@/spinfinity
diff --git a/themes/text/Makefile.am b/themes/text/Makefile.am
new file mode 100644 (file)
index 0000000..c9425bf
--- /dev/null
@@ -0,0 +1,4 @@
+themedir = $(datadir)/plymouth/themes/text
+dist_theme_DATA = text.plymouth
+
+MAINTAINERCLEANFILES = Makefile.in
diff --git a/themes/text/text.plymouth b/themes/text/text.plymouth
new file mode 100644 (file)
index 0000000..a2db9e6
--- /dev/null
@@ -0,0 +1,4 @@
+[Plymouth Theme]
+Name=Text
+Description=Text mode theme with tricolor progress bar
+ModuleName=text