]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
add a glow plugin
authorWilliam Jon McCann <jmccann@redhat.com>
Wed, 4 Mar 2009 20:07:11 +0000 (15:07 -0500)
committerWilliam Jon McCann <jmccann@redhat.com>
Wed, 4 Mar 2009 22:10:24 +0000 (17:10 -0500)
This plugin will progress through a sequence of images until
the progress reaches 90% complete.  At that point it will run
an animation sequence.

59 files changed:
configure.ac
src/libplybootsplash/ply-throbber.c
src/libplybootsplash/ply-throbber.h
src/plugins/splash/Makefile.am
src/plugins/splash/glow/Makefile.am [new file with mode: 0644]
src/plugins/splash/glow/images/progress-00.png [new file with mode: 0644]
src/plugins/splash/glow/images/progress-01.png [new file with mode: 0644]
src/plugins/splash/glow/images/progress-02.png [new file with mode: 0644]
src/plugins/splash/glow/images/progress-03.png [new file with mode: 0644]
src/plugins/splash/glow/images/progress-04.png [new file with mode: 0644]
src/plugins/splash/glow/images/progress-05.png [new file with mode: 0644]
src/plugins/splash/glow/images/progress-06.png [new file with mode: 0644]
src/plugins/splash/glow/images/progress-07.png [new file with mode: 0644]
src/plugins/splash/glow/images/progress-08.png [new file with mode: 0644]
src/plugins/splash/glow/images/progress-09.png [new file with mode: 0644]
src/plugins/splash/glow/images/progress-10.png [new file with mode: 0644]
src/plugins/splash/glow/images/progress-11.png [new file with mode: 0644]
src/plugins/splash/glow/images/progress-12.png [new file with mode: 0644]
src/plugins/splash/glow/images/progress-13.png [new file with mode: 0644]
src/plugins/splash/glow/images/progress-14.png [new file with mode: 0644]
src/plugins/splash/glow/images/progress-15.png [new file with mode: 0644]
src/plugins/splash/glow/images/progress-16.png [new file with mode: 0644]
src/plugins/splash/glow/images/progress-17.png [new file with mode: 0644]
src/plugins/splash/glow/images/progress-18.png [new file with mode: 0644]
src/plugins/splash/glow/images/progress-19.png [new file with mode: 0644]
src/plugins/splash/glow/images/progress-20.png [new file with mode: 0644]
src/plugins/splash/glow/images/progress-21.png [new file with mode: 0644]
src/plugins/splash/glow/images/progress-22.png [new file with mode: 0644]
src/plugins/splash/glow/images/progress-23.png [new file with mode: 0644]
src/plugins/splash/glow/images/progress-24.png [new file with mode: 0644]
src/plugins/splash/glow/images/progress-25.png [new file with mode: 0644]
src/plugins/splash/glow/images/progress-26.png [new file with mode: 0644]
src/plugins/splash/glow/images/progress-27.png [new file with mode: 0644]
src/plugins/splash/glow/images/progress-28.png [new file with mode: 0644]
src/plugins/splash/glow/images/progress-29.png [new file with mode: 0644]
src/plugins/splash/glow/images/progress-30.png [new file with mode: 0644]
src/plugins/splash/glow/images/progress-31.png [new file with mode: 0644]
src/plugins/splash/glow/images/progress-32.png [new file with mode: 0644]
src/plugins/splash/glow/images/throbber-00.png [new file with mode: 0644]
src/plugins/splash/glow/images/throbber-01.png [new file with mode: 0644]
src/plugins/splash/glow/images/throbber-02.png [new file with mode: 0644]
src/plugins/splash/glow/images/throbber-03.png [new file with mode: 0644]
src/plugins/splash/glow/images/throbber-04.png [new file with mode: 0644]
src/plugins/splash/glow/images/throbber-05.png [new file with mode: 0644]
src/plugins/splash/glow/images/throbber-06.png [new file with mode: 0644]
src/plugins/splash/glow/images/throbber-07.png [new file with mode: 0644]
src/plugins/splash/glow/images/throbber-08.png [new file with mode: 0644]
src/plugins/splash/glow/images/throbber-09.png [new file with mode: 0644]
src/plugins/splash/glow/images/throbber-10.png [new file with mode: 0644]
src/plugins/splash/glow/images/throbber-11.png [new file with mode: 0644]
src/plugins/splash/glow/images/throbber-12.png [new file with mode: 0644]
src/plugins/splash/glow/images/throbber-13.png [new file with mode: 0644]
src/plugins/splash/glow/images/throbber-14.png [new file with mode: 0644]
src/plugins/splash/glow/images/throbber-15.png [new file with mode: 0644]
src/plugins/splash/glow/images/throbber-16.png [new file with mode: 0644]
src/plugins/splash/glow/images/throbber-17.png [new file with mode: 0644]
src/plugins/splash/glow/images/throbber-18.png [new file with mode: 0644]
src/plugins/splash/glow/images/throbber-19.png [new file with mode: 0644]
src/plugins/splash/glow/plugin.c [new file with mode: 0644]

index 63a470961a1cf84d83918f96c6230b6a4d207213..f5d4639101c80575ce959fab7710e8adbc902eb5 100644 (file)
@@ -111,6 +111,8 @@ AM_CONDITIONAL(ADD_DEFAULT_PLUGIN_LINK,
                   -o "$default_plugin_name" = "fade-in"    \
                   -o "$default_plugin_name" = "pulser"     \
                   -o "$default_plugin_name" = "text"       \
+                  -o "$default_plugin_name" = "glow"       \
+                  -o "$default_plugin_name" = "solar"      \
                   -o "$default_plugin_name" = "details"])
 AC_SUBST(default_plugin_name)
 
@@ -203,6 +205,7 @@ AC_OUTPUT([Makefile
            src/plugins/splash/pulser/Makefile
            src/plugins/splash/details/Makefile
            src/plugins/splash/solar/Makefile
+           src/plugins/splash/glow/Makefile
            src/plugins/controls/Makefile
            src/plugins/controls/label/Makefile
            src/Makefile
index a3bd2eaba582d93695a98a4ee236dfe482ad6362..e1bce90bddab7b6031e72acd8c92bf449b758f77 100644 (file)
@@ -70,6 +70,7 @@ struct _ply_throbber
   long x, y;
   long width, height;
   double start_time, previous_time, now;
+  uint32_t is_stopped : 1;
 };
 
 ply_throbber_t *
@@ -86,6 +87,7 @@ ply_throbber_new (const char *image_dir,
   throbber->frames = ply_array_new ();
   throbber->frames_prefix = strdup (frames_prefix);
   throbber->image_dir = strdup (image_dir);
+  throbber->is_stopped = true;
   throbber->width = 0;
   throbber->height = 0;
   throbber->frame_area.width = 0;
@@ -323,6 +325,7 @@ ply_throbber_start (ply_throbber_t         *throbber,
   throbber->loop = loop;
   throbber->window = window;
   throbber->frame_buffer = ply_window_get_frame_buffer (window);;
+  throbber->is_stopped = false;
 
   throbber->x = x;
   throbber->y = y;
@@ -345,6 +348,7 @@ ply_throbber_stop_now (ply_throbber_t *throbber)
 
   throbber->frame_buffer = NULL;
   throbber->window = NULL;
+  throbber->is_stopped = true;
 
   if (throbber->loop != NULL)
     {
@@ -369,6 +373,12 @@ ply_throbber_stop (ply_throbber_t *throbber,
   throbber->stop_trigger = stop_trigger;
 }
 
+bool
+ply_throbber_is_stopped (ply_throbber_t *throbber)
+{
+  return throbber->is_stopped;
+}
+
 long
 ply_throbber_get_width (ply_throbber_t *throbber)
 {
index 83f6b43eea7637b5acedc789a98e79b352f569a6..647f409c006595a0c5b1f9d22639460b3094037c 100644 (file)
@@ -46,6 +46,7 @@ bool ply_throbber_start (ply_throbber_t         *throbber,
                          long                y);
 void ply_throbber_stop (ply_throbber_t *throbber,
                         ply_trigger_t  *stop_trigger);
+bool ply_throbber_is_stopped (ply_throbber_t *throbber);
 
 long ply_throbber_get_width (ply_throbber_t *throbber);
 long ply_throbber_get_height (ply_throbber_t *throbber);
index d12484e1d5ae6954cf87297651134618a178ea86..a09bdfe8cfebde86c149f0c23e090ba3410df961 100644 (file)
@@ -1,4 +1,4 @@
-SUBDIRS = spinfinity fade-in text details solar pulser
+SUBDIRS = spinfinity fade-in text details solar pulser glow
 MAINTAINERCLEANFILES = Makefile.in
 
 if ADD_DEFAULT_PLUGIN_LINK
diff --git a/src/plugins/splash/glow/Makefile.am b/src/plugins/splash/glow/Makefile.am
new file mode 100644 (file)
index 0000000..9655af6
--- /dev/null
@@ -0,0 +1,81 @@
+INCLUDES = -I$(top_srcdir)                                                    \
+           -I$(srcdir)/../../../libply                                        \
+           -I$(srcdir)/../../../libplybootsplash                              \
+           -I$(srcdir)/../../..                                               \
+           -I$(srcdir)/../..                                                  \
+           -I$(srcdir)/..                                                     \
+           -I$(srcdir)
+
+plugindir = $(libdir)/plymouth
+plugin_LTLIBRARIES = glow.la
+
+glow_la_CFLAGS =    $(PLYMOUTH_CFLAGS)                                       \
+                    -DPLYMOUTH_IMAGE_DIR=\"$(datadir)/plymouth/\"             \
+                    -DPLYMOUTH_LOGO_FILE=\"$(logofile)\"                      \
+                    -DPLYMOUTH_BACKGROUND_COLOR=$(background_color)           \
+                    -DPLYMOUTH_BACKGROUND_END_COLOR=$(background_end_color)   \
+                    -DPLYMOUTH_BACKGROUND_START_COLOR=$(background_start_color)
+glow_la_LDFLAGS =   -module -avoid-version -export-dynamic
+glow_la_LIBADD =    $(PLYMOUTH_LIBS)                                         \
+                    ../../../libply/libply.la                                 \
+                    ../../../libplybootsplash/libplybootsplash.la
+glow_la_SOURCES = $(srcdir)/plugin.c
+
+plymouthdir = $(datadir)/plymouth/glow
+plymouth_DATA = \
+       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
diff --git a/src/plugins/splash/glow/images/progress-00.png b/src/plugins/splash/glow/images/progress-00.png
new file mode 100644 (file)
index 0000000..9f94fc0
Binary files /dev/null and b/src/plugins/splash/glow/images/progress-00.png differ
diff --git a/src/plugins/splash/glow/images/progress-01.png b/src/plugins/splash/glow/images/progress-01.png
new file mode 100644 (file)
index 0000000..b00035d
Binary files /dev/null and b/src/plugins/splash/glow/images/progress-01.png differ
diff --git a/src/plugins/splash/glow/images/progress-02.png b/src/plugins/splash/glow/images/progress-02.png
new file mode 100644 (file)
index 0000000..872da19
Binary files /dev/null and b/src/plugins/splash/glow/images/progress-02.png differ
diff --git a/src/plugins/splash/glow/images/progress-03.png b/src/plugins/splash/glow/images/progress-03.png
new file mode 100644 (file)
index 0000000..24f32ff
Binary files /dev/null and b/src/plugins/splash/glow/images/progress-03.png differ
diff --git a/src/plugins/splash/glow/images/progress-04.png b/src/plugins/splash/glow/images/progress-04.png
new file mode 100644 (file)
index 0000000..da1ecbd
Binary files /dev/null and b/src/plugins/splash/glow/images/progress-04.png differ
diff --git a/src/plugins/splash/glow/images/progress-05.png b/src/plugins/splash/glow/images/progress-05.png
new file mode 100644 (file)
index 0000000..38721af
Binary files /dev/null and b/src/plugins/splash/glow/images/progress-05.png differ
diff --git a/src/plugins/splash/glow/images/progress-06.png b/src/plugins/splash/glow/images/progress-06.png
new file mode 100644 (file)
index 0000000..3efdca7
Binary files /dev/null and b/src/plugins/splash/glow/images/progress-06.png differ
diff --git a/src/plugins/splash/glow/images/progress-07.png b/src/plugins/splash/glow/images/progress-07.png
new file mode 100644 (file)
index 0000000..53277ed
Binary files /dev/null and b/src/plugins/splash/glow/images/progress-07.png differ
diff --git a/src/plugins/splash/glow/images/progress-08.png b/src/plugins/splash/glow/images/progress-08.png
new file mode 100644 (file)
index 0000000..db0b570
Binary files /dev/null and b/src/plugins/splash/glow/images/progress-08.png differ
diff --git a/src/plugins/splash/glow/images/progress-09.png b/src/plugins/splash/glow/images/progress-09.png
new file mode 100644 (file)
index 0000000..14c2055
Binary files /dev/null and b/src/plugins/splash/glow/images/progress-09.png differ
diff --git a/src/plugins/splash/glow/images/progress-10.png b/src/plugins/splash/glow/images/progress-10.png
new file mode 100644 (file)
index 0000000..c522bc5
Binary files /dev/null and b/src/plugins/splash/glow/images/progress-10.png differ
diff --git a/src/plugins/splash/glow/images/progress-11.png b/src/plugins/splash/glow/images/progress-11.png
new file mode 100644 (file)
index 0000000..30171ec
Binary files /dev/null and b/src/plugins/splash/glow/images/progress-11.png differ
diff --git a/src/plugins/splash/glow/images/progress-12.png b/src/plugins/splash/glow/images/progress-12.png
new file mode 100644 (file)
index 0000000..b920cb1
Binary files /dev/null and b/src/plugins/splash/glow/images/progress-12.png differ
diff --git a/src/plugins/splash/glow/images/progress-13.png b/src/plugins/splash/glow/images/progress-13.png
new file mode 100644 (file)
index 0000000..c697003
Binary files /dev/null and b/src/plugins/splash/glow/images/progress-13.png differ
diff --git a/src/plugins/splash/glow/images/progress-14.png b/src/plugins/splash/glow/images/progress-14.png
new file mode 100644 (file)
index 0000000..02b7d07
Binary files /dev/null and b/src/plugins/splash/glow/images/progress-14.png differ
diff --git a/src/plugins/splash/glow/images/progress-15.png b/src/plugins/splash/glow/images/progress-15.png
new file mode 100644 (file)
index 0000000..533ceb0
Binary files /dev/null and b/src/plugins/splash/glow/images/progress-15.png differ
diff --git a/src/plugins/splash/glow/images/progress-16.png b/src/plugins/splash/glow/images/progress-16.png
new file mode 100644 (file)
index 0000000..7039f4f
Binary files /dev/null and b/src/plugins/splash/glow/images/progress-16.png differ
diff --git a/src/plugins/splash/glow/images/progress-17.png b/src/plugins/splash/glow/images/progress-17.png
new file mode 100644 (file)
index 0000000..210c917
Binary files /dev/null and b/src/plugins/splash/glow/images/progress-17.png differ
diff --git a/src/plugins/splash/glow/images/progress-18.png b/src/plugins/splash/glow/images/progress-18.png
new file mode 100644 (file)
index 0000000..f36be2c
Binary files /dev/null and b/src/plugins/splash/glow/images/progress-18.png differ
diff --git a/src/plugins/splash/glow/images/progress-19.png b/src/plugins/splash/glow/images/progress-19.png
new file mode 100644 (file)
index 0000000..b44475b
Binary files /dev/null and b/src/plugins/splash/glow/images/progress-19.png differ
diff --git a/src/plugins/splash/glow/images/progress-20.png b/src/plugins/splash/glow/images/progress-20.png
new file mode 100644 (file)
index 0000000..45d275b
Binary files /dev/null and b/src/plugins/splash/glow/images/progress-20.png differ
diff --git a/src/plugins/splash/glow/images/progress-21.png b/src/plugins/splash/glow/images/progress-21.png
new file mode 100644 (file)
index 0000000..641ba2f
Binary files /dev/null and b/src/plugins/splash/glow/images/progress-21.png differ
diff --git a/src/plugins/splash/glow/images/progress-22.png b/src/plugins/splash/glow/images/progress-22.png
new file mode 100644 (file)
index 0000000..9805103
Binary files /dev/null and b/src/plugins/splash/glow/images/progress-22.png differ
diff --git a/src/plugins/splash/glow/images/progress-23.png b/src/plugins/splash/glow/images/progress-23.png
new file mode 100644 (file)
index 0000000..d8a41a5
Binary files /dev/null and b/src/plugins/splash/glow/images/progress-23.png differ
diff --git a/src/plugins/splash/glow/images/progress-24.png b/src/plugins/splash/glow/images/progress-24.png
new file mode 100644 (file)
index 0000000..ac25bdc
Binary files /dev/null and b/src/plugins/splash/glow/images/progress-24.png differ
diff --git a/src/plugins/splash/glow/images/progress-25.png b/src/plugins/splash/glow/images/progress-25.png
new file mode 100644 (file)
index 0000000..66cd03d
Binary files /dev/null and b/src/plugins/splash/glow/images/progress-25.png differ
diff --git a/src/plugins/splash/glow/images/progress-26.png b/src/plugins/splash/glow/images/progress-26.png
new file mode 100644 (file)
index 0000000..e19fb68
Binary files /dev/null and b/src/plugins/splash/glow/images/progress-26.png differ
diff --git a/src/plugins/splash/glow/images/progress-27.png b/src/plugins/splash/glow/images/progress-27.png
new file mode 100644 (file)
index 0000000..d875c3a
Binary files /dev/null and b/src/plugins/splash/glow/images/progress-27.png differ
diff --git a/src/plugins/splash/glow/images/progress-28.png b/src/plugins/splash/glow/images/progress-28.png
new file mode 100644 (file)
index 0000000..dd2a1a3
Binary files /dev/null and b/src/plugins/splash/glow/images/progress-28.png differ
diff --git a/src/plugins/splash/glow/images/progress-29.png b/src/plugins/splash/glow/images/progress-29.png
new file mode 100644 (file)
index 0000000..4d8b349
Binary files /dev/null and b/src/plugins/splash/glow/images/progress-29.png differ
diff --git a/src/plugins/splash/glow/images/progress-30.png b/src/plugins/splash/glow/images/progress-30.png
new file mode 100644 (file)
index 0000000..7ea1544
Binary files /dev/null and b/src/plugins/splash/glow/images/progress-30.png differ
diff --git a/src/plugins/splash/glow/images/progress-31.png b/src/plugins/splash/glow/images/progress-31.png
new file mode 100644 (file)
index 0000000..73e85d2
Binary files /dev/null and b/src/plugins/splash/glow/images/progress-31.png differ
diff --git a/src/plugins/splash/glow/images/progress-32.png b/src/plugins/splash/glow/images/progress-32.png
new file mode 100644 (file)
index 0000000..914bc6d
Binary files /dev/null and b/src/plugins/splash/glow/images/progress-32.png differ
diff --git a/src/plugins/splash/glow/images/throbber-00.png b/src/plugins/splash/glow/images/throbber-00.png
new file mode 100644 (file)
index 0000000..6eed4b4
Binary files /dev/null and b/src/plugins/splash/glow/images/throbber-00.png differ
diff --git a/src/plugins/splash/glow/images/throbber-01.png b/src/plugins/splash/glow/images/throbber-01.png
new file mode 100644 (file)
index 0000000..3bc8747
Binary files /dev/null and b/src/plugins/splash/glow/images/throbber-01.png differ
diff --git a/src/plugins/splash/glow/images/throbber-02.png b/src/plugins/splash/glow/images/throbber-02.png
new file mode 100644 (file)
index 0000000..d14f24c
Binary files /dev/null and b/src/plugins/splash/glow/images/throbber-02.png differ
diff --git a/src/plugins/splash/glow/images/throbber-03.png b/src/plugins/splash/glow/images/throbber-03.png
new file mode 100644 (file)
index 0000000..aa5554c
Binary files /dev/null and b/src/plugins/splash/glow/images/throbber-03.png differ
diff --git a/src/plugins/splash/glow/images/throbber-04.png b/src/plugins/splash/glow/images/throbber-04.png
new file mode 100644 (file)
index 0000000..02a42c2
Binary files /dev/null and b/src/plugins/splash/glow/images/throbber-04.png differ
diff --git a/src/plugins/splash/glow/images/throbber-05.png b/src/plugins/splash/glow/images/throbber-05.png
new file mode 100644 (file)
index 0000000..08d30cf
Binary files /dev/null and b/src/plugins/splash/glow/images/throbber-05.png differ
diff --git a/src/plugins/splash/glow/images/throbber-06.png b/src/plugins/splash/glow/images/throbber-06.png
new file mode 100644 (file)
index 0000000..1b3c0b9
Binary files /dev/null and b/src/plugins/splash/glow/images/throbber-06.png differ
diff --git a/src/plugins/splash/glow/images/throbber-07.png b/src/plugins/splash/glow/images/throbber-07.png
new file mode 100644 (file)
index 0000000..cf6b61d
Binary files /dev/null and b/src/plugins/splash/glow/images/throbber-07.png differ
diff --git a/src/plugins/splash/glow/images/throbber-08.png b/src/plugins/splash/glow/images/throbber-08.png
new file mode 100644 (file)
index 0000000..fa62c8c
Binary files /dev/null and b/src/plugins/splash/glow/images/throbber-08.png differ
diff --git a/src/plugins/splash/glow/images/throbber-09.png b/src/plugins/splash/glow/images/throbber-09.png
new file mode 100644 (file)
index 0000000..7009467
Binary files /dev/null and b/src/plugins/splash/glow/images/throbber-09.png differ
diff --git a/src/plugins/splash/glow/images/throbber-10.png b/src/plugins/splash/glow/images/throbber-10.png
new file mode 100644 (file)
index 0000000..f145d64
Binary files /dev/null and b/src/plugins/splash/glow/images/throbber-10.png differ
diff --git a/src/plugins/splash/glow/images/throbber-11.png b/src/plugins/splash/glow/images/throbber-11.png
new file mode 100644 (file)
index 0000000..d7d0c43
Binary files /dev/null and b/src/plugins/splash/glow/images/throbber-11.png differ
diff --git a/src/plugins/splash/glow/images/throbber-12.png b/src/plugins/splash/glow/images/throbber-12.png
new file mode 100644 (file)
index 0000000..f161c67
Binary files /dev/null and b/src/plugins/splash/glow/images/throbber-12.png differ
diff --git a/src/plugins/splash/glow/images/throbber-13.png b/src/plugins/splash/glow/images/throbber-13.png
new file mode 100644 (file)
index 0000000..334f78d
Binary files /dev/null and b/src/plugins/splash/glow/images/throbber-13.png differ
diff --git a/src/plugins/splash/glow/images/throbber-14.png b/src/plugins/splash/glow/images/throbber-14.png
new file mode 100644 (file)
index 0000000..535f7ea
Binary files /dev/null and b/src/plugins/splash/glow/images/throbber-14.png differ
diff --git a/src/plugins/splash/glow/images/throbber-15.png b/src/plugins/splash/glow/images/throbber-15.png
new file mode 100644 (file)
index 0000000..3291f07
Binary files /dev/null and b/src/plugins/splash/glow/images/throbber-15.png differ
diff --git a/src/plugins/splash/glow/images/throbber-16.png b/src/plugins/splash/glow/images/throbber-16.png
new file mode 100644 (file)
index 0000000..b855791
Binary files /dev/null and b/src/plugins/splash/glow/images/throbber-16.png differ
diff --git a/src/plugins/splash/glow/images/throbber-17.png b/src/plugins/splash/glow/images/throbber-17.png
new file mode 100644 (file)
index 0000000..e914841
Binary files /dev/null and b/src/plugins/splash/glow/images/throbber-17.png differ
diff --git a/src/plugins/splash/glow/images/throbber-18.png b/src/plugins/splash/glow/images/throbber-18.png
new file mode 100644 (file)
index 0000000..3ae351a
Binary files /dev/null and b/src/plugins/splash/glow/images/throbber-18.png differ
diff --git a/src/plugins/splash/glow/images/throbber-19.png b/src/plugins/splash/glow/images/throbber-19.png
new file mode 100644 (file)
index 0000000..2a27b62
Binary files /dev/null and b/src/plugins/splash/glow/images/throbber-19.png differ
diff --git a/src/plugins/splash/glow/plugin.c b/src/plugins/splash/glow/plugin.c
new file mode 100644 (file)
index 0000000..229b433
--- /dev/null
@@ -0,0 +1,619 @@
+/*
+ *
+ * Copyright (C) 2009 Red Hat, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * Written by: William Jon McCann
+ *
+ */
+#include "config.h"
+
+#include <assert.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <math.h>
+#include <signal.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/ioctl.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <values.h>
+#include <unistd.h>
+#include <wchar.h>
+
+#include "ply-boot-splash-plugin.h"
+#include "ply-buffer.h"
+#include "ply-entry.h"
+#include "ply-event-loop.h"
+#include "ply-label.h"
+#include "ply-list.h"
+#include "ply-logger.h"
+#include "ply-frame-buffer.h"
+#include "ply-image.h"
+#include "ply-trigger.h"
+#include "ply-utils.h"
+#include "ply-window.h"
+
+#include "ply-animation.h"
+#include "ply-progress-animation.h"
+
+#include <linux/kd.h>
+
+#ifndef FRAMES_PER_SECOND
+#define FRAMES_PER_SECOND 30
+#endif
+
+#ifndef SHOW_ANIMATION_PERCENT
+#define SHOW_ANIMATION_PERCENT 0.9
+#endif
+
+typedef enum {
+   PLY_BOOT_SPLASH_DISPLAY_NORMAL,
+   PLY_BOOT_SPLASH_DISPLAY_QUESTION_ENTRY,
+   PLY_BOOT_SPLASH_DISPLAY_PASSWORD_ENTRY
+} ply_boot_splash_display_type_t;
+
+struct _ply_boot_splash_plugin
+{
+  ply_event_loop_t *loop;
+  ply_frame_buffer_t *frame_buffer;
+  ply_frame_buffer_area_t box_area, lock_area;
+  ply_image_t *lock_image;
+  ply_image_t *box_image;
+  ply_window_t *window;
+
+  ply_entry_t *entry;
+  ply_animation_t *animation;
+  ply_progress_animation_t *progress_animation;
+  ply_label_t *label;
+  ply_boot_splash_display_type_t state;
+
+  ply_trigger_t *idle_trigger;
+
+  uint32_t root_is_mounted : 1;
+  uint32_t is_visible : 1;
+  uint32_t is_animating : 1;
+};
+
+static void detach_from_event_loop (ply_boot_splash_plugin_t *plugin);
+ply_boot_splash_plugin_t *
+create_plugin (void)
+{
+  ply_boot_splash_plugin_t *plugin;
+
+  srand ((int) ply_get_timestamp ());
+  plugin = calloc (1, sizeof (ply_boot_splash_plugin_t));
+
+  plugin->lock_image = ply_image_new (PLYMOUTH_IMAGE_DIR "spinfinity/lock.png");
+  plugin->box_image = ply_image_new (PLYMOUTH_IMAGE_DIR "spinfinity/box.png");
+
+  plugin->entry = ply_entry_new (PLYMOUTH_IMAGE_DIR "spinfinity");
+  plugin->animation = ply_animation_new (PLYMOUTH_IMAGE_DIR "glow",
+                                         "throbber-");
+  plugin->progress_animation = ply_progress_animation_new (PLYMOUTH_IMAGE_DIR "glow",
+                                                           "progress-");
+  plugin->label = ply_label_new ();
+
+  return plugin;
+}
+
+void
+destroy_plugin (ply_boot_splash_plugin_t *plugin)
+{
+  if (plugin == NULL)
+    return;
+
+  if (plugin->loop != NULL)
+    {
+      ply_event_loop_stop_watching_for_exit (plugin->loop, (ply_event_loop_exit_handler_t)
+                                             detach_from_event_loop,
+                                             plugin);
+      detach_from_event_loop (plugin);
+    }
+
+  ply_image_free (plugin->box_image);
+  ply_image_free (plugin->lock_image);
+  ply_entry_free (plugin->entry);
+  ply_animation_free (plugin->animation);
+  ply_progress_animation_free (plugin->progress_animation);
+  ply_label_free (plugin->label);
+
+  free (plugin);
+}
+
+static void
+draw_background (ply_boot_splash_plugin_t *plugin,
+                 ply_frame_buffer_area_t  *area)
+{
+  ply_frame_buffer_area_t screen_area;
+
+  if (area == NULL)
+    {
+      ply_frame_buffer_get_size (plugin->frame_buffer, &screen_area);
+      area = &screen_area;
+    }
+
+  ply_window_erase_area (plugin->window, area->x, area->y,
+                         area->width, area->height);
+}
+
+static void
+begin_animation (ply_boot_splash_plugin_t *plugin,
+                 ply_trigger_t            *trigger)
+{
+  long width, height;
+  ply_frame_buffer_area_t area;
+  ply_frame_buffer_get_size (plugin->frame_buffer, &area);
+  width = ply_animation_get_width (plugin->animation);
+  height = ply_animation_get_height (plugin->animation);
+  ply_animation_start (plugin->animation,
+                       plugin->loop,
+                       plugin->window,
+                       trigger,
+                       area.width / 4.0 - width / 2.0,
+                       area.height / 2 - height / 2.0);
+}
+
+static void
+start_animation (ply_boot_splash_plugin_t *plugin)
+{
+
+  long width, height;
+  ply_frame_buffer_area_t area;
+  assert (plugin != NULL);
+  assert (plugin->loop != NULL);
+
+  if (plugin->is_animating)
+     return;
+
+  draw_background (plugin, NULL);
+
+  ply_frame_buffer_get_size (plugin->frame_buffer, &area);
+
+  width = ply_progress_animation_get_width (plugin->progress_animation);
+  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->is_animating = true;
+}
+
+static void
+stop_animation (ply_boot_splash_plugin_t *plugin)
+{
+  assert (plugin != NULL);
+  assert (plugin->loop != NULL);
+
+  if (!plugin->is_animating)
+     return;
+
+  plugin->is_animating = false;
+
+  ply_progress_animation_hide (plugin->progress_animation);
+  ply_animation_stop (plugin->animation);
+
+#ifdef ENABLE_FADE_OUT
+  for (i = 0; i < 10; i++)
+    {
+      ply_frame_buffer_fill_with_hex_color_at_opacity (plugin->frame_buffer, NULL,
+                                                       PLYMOUTH_BACKGROUND_COLOR,
+                                                       .1 + .1 * i);
+    }
+
+  ply_frame_buffer_fill_with_hex_color (plugin->frame_buffer, NULL,
+                                        PLYMOUTH_BACKGROUND_COLOR);
+
+  for (i = 0; i < 20; i++)
+    {
+      ply_frame_buffer_fill_with_color (plugin->frame_buffer, NULL,
+                                        0.0, 0.0, 0.0, .05 + .05 * i);
+    }
+
+  ply_frame_buffer_fill_with_color (plugin->frame_buffer, NULL,
+                                    0.0, 0.0, 0.0, 1.0);
+#endif
+}
+
+static void
+on_interrupt (ply_boot_splash_plugin_t *plugin)
+{
+  ply_event_loop_exit (plugin->loop, 1);
+  stop_animation (plugin);
+  ply_window_set_mode (plugin->window, PLY_WINDOW_MODE_TEXT);
+}
+
+static void
+detach_from_event_loop (ply_boot_splash_plugin_t *plugin)
+{
+  plugin->loop = NULL;
+}
+
+void
+on_keyboard_input (ply_boot_splash_plugin_t *plugin,
+                   const char               *keyboard_input,
+                   size_t                    character_size)
+{
+}
+
+void
+on_backspace (ply_boot_splash_plugin_t *plugin)
+{
+  ply_entry_remove_bullet (plugin->entry);
+}
+
+void
+on_enter (ply_boot_splash_plugin_t *plugin,
+          const char               *text)
+{
+}
+
+void
+on_draw (ply_boot_splash_plugin_t *plugin,
+         int                       x,
+         int                       y,
+         int                       width,
+         int                       height)
+{
+  ply_frame_buffer_area_t area;
+
+  area.x = x;
+  area.y = y;
+  area.width = width;
+  area.height = height;
+
+  ply_frame_buffer_pause_updates (plugin->frame_buffer);
+  draw_background (plugin, &area);
+
+  if (plugin->state == PLY_BOOT_SPLASH_DISPLAY_QUESTION_ENTRY ||
+      plugin->state == PLY_BOOT_SPLASH_DISPLAY_PASSWORD_ENTRY  )
+    {
+      ply_entry_draw (plugin->entry);
+      ply_label_draw (plugin->label);
+    }
+  else
+    {
+      ply_progress_animation_draw (plugin->progress_animation);
+    }
+  ply_frame_buffer_unpause_updates (plugin->frame_buffer);
+}
+
+void
+on_erase (ply_boot_splash_plugin_t *plugin,
+          int                       x,
+          int                       y,
+          int                       width,
+          int                       height)
+{
+  ply_frame_buffer_area_t area;
+
+  area.x = x;
+  area.y = y;
+  area.width = width;
+  area.height = height;
+
+  ply_frame_buffer_fill_with_gradient (plugin->frame_buffer, &area,
+                                       PLYMOUTH_BACKGROUND_START_COLOR,
+                                       PLYMOUTH_BACKGROUND_END_COLOR);
+}
+
+void
+add_window (ply_boot_splash_plugin_t *plugin,
+            ply_window_t             *window)
+{
+  plugin->window = window;
+}
+
+void
+remove_window (ply_boot_splash_plugin_t *plugin,
+               ply_window_t             *window)
+{
+  plugin->window = NULL;
+}
+
+bool
+show_splash_screen (ply_boot_splash_plugin_t *plugin,
+                    ply_event_loop_t         *loop,
+                    ply_buffer_t             *boot_buffer)
+{
+  assert (plugin != NULL);
+
+  ply_window_add_keyboard_input_handler (plugin->window,
+                                         (ply_window_keyboard_input_handler_t)
+                                         on_keyboard_input, plugin);
+  ply_window_add_backspace_handler (plugin->window,
+                                    (ply_window_backspace_handler_t)
+                                    on_backspace, plugin);
+  ply_window_add_enter_handler (plugin->window,
+                                (ply_window_enter_handler_t)
+                                on_enter, plugin);
+
+  ply_window_set_draw_handler (plugin->window,
+                               (ply_window_draw_handler_t)
+                               on_draw, plugin);
+
+  ply_window_set_erase_handler (plugin->window,
+                               (ply_window_erase_handler_t)
+                               on_erase, plugin);
+
+  plugin->loop = loop;
+
+  ply_trace ("loading lock image");
+  if (!ply_image_load (plugin->lock_image))
+    return false;
+
+  ply_trace ("loading box image");
+  if (!ply_image_load (plugin->box_image))
+    return false;
+
+  ply_trace ("loading entry");
+  if (!ply_entry_load (plugin->entry))
+    return false;
+
+  ply_trace ("loading animation");
+  if (!ply_animation_load (plugin->animation))
+    return false;
+
+  ply_trace ("loading progress animation");
+  if (!ply_progress_animation_load (plugin->progress_animation))
+    return false;
+
+  ply_trace ("setting graphics mode");
+  if (!ply_window_set_mode (plugin->window, PLY_WINDOW_MODE_GRAPHICS))
+    return false;
+
+  plugin->frame_buffer = ply_window_get_frame_buffer (plugin->window);
+
+  ply_event_loop_watch_for_exit (loop, (ply_event_loop_exit_handler_t)
+                                 detach_from_event_loop,
+                                 plugin);
+
+  ply_event_loop_watch_signal (plugin->loop,
+                               SIGINT,
+                               (ply_event_handler_t)
+                               on_interrupt, plugin);
+
+  ply_window_clear_screen (plugin->window);
+  ply_window_hide_text_cursor (plugin->window);
+
+  ply_trace ("starting boot animation");
+  start_animation (plugin);
+
+  plugin->is_visible = true;
+
+  return true;
+}
+
+void
+update_status (ply_boot_splash_plugin_t *plugin,
+               const char               *status)
+{
+  assert (plugin != NULL);
+}
+
+
+void
+on_boot_progress (ply_boot_splash_plugin_t *plugin,
+                  double                    duration,
+                  double                    percent_done)
+{
+
+
+  if (percent_done >= SHOW_ANIMATION_PERCENT)
+    {
+      if (ply_animation_is_stopped (plugin->animation))
+        {
+          ply_progress_animation_hide (plugin->progress_animation);
+          begin_animation (plugin, NULL);
+        }
+    }
+  else
+    {
+      double total_duration;
+
+      percent_done *= (1 / SHOW_ANIMATION_PERCENT);
+      total_duration = duration / percent_done;
+
+      /* Fun made-up smoothing function to make the growth asymptotic:
+       * fraction(time,estimate)=1-2^(-(time^1.45)/estimate) */
+      percent_done = 1.0 - pow (2.0, -pow (duration, 1.45) / total_duration) * (1.0 - percent_done);
+
+      ply_progress_animation_set_percent_done (plugin->progress_animation,
+                                               percent_done);
+    }
+
+  ply_progress_animation_draw (plugin->progress_animation);
+}
+
+void
+hide_splash_screen (ply_boot_splash_plugin_t *plugin,
+                    ply_event_loop_t         *loop)
+{
+  assert (plugin != NULL);
+
+
+  ply_window_remove_keyboard_input_handler (plugin->window, (ply_window_keyboard_input_handler_t) on_keyboard_input);
+  ply_window_remove_backspace_handler (plugin->window, (ply_window_backspace_handler_t) on_backspace);
+  ply_window_remove_enter_handler (plugin->window, (ply_window_enter_handler_t) on_enter);
+  ply_window_set_draw_handler (plugin->window, NULL, NULL);
+  ply_window_set_erase_handler (plugin->window, NULL, NULL);
+
+  if (plugin->loop != NULL)
+    {
+      stop_animation (plugin);
+
+      ply_event_loop_stop_watching_for_exit (plugin->loop, (ply_event_loop_exit_handler_t)
+                                             detach_from_event_loop,
+                                             plugin);
+      detach_from_event_loop (plugin);
+    }
+
+  plugin->frame_buffer = NULL;
+  plugin->is_visible = false;
+
+  ply_window_set_mode (plugin->window, PLY_WINDOW_MODE_TEXT);
+}
+
+static void
+show_password_prompt (ply_boot_splash_plugin_t *plugin,
+                      const char               *prompt)
+{
+  ply_frame_buffer_area_t area;
+  int x, y;
+  int entry_width, entry_height;
+
+  uint32_t *box_data, *lock_data;
+
+  assert (plugin != NULL);
+
+  if (ply_entry_is_hidden (plugin->entry))
+    {
+      draw_background (plugin, NULL);
+
+      ply_frame_buffer_get_size (plugin->frame_buffer, &area);
+      plugin->box_area.width = ply_image_get_width (plugin->box_image);
+      plugin->box_area.height = ply_image_get_height (plugin->box_image);
+      plugin->box_area.x = area.width / 2.0 - plugin->box_area.width / 2.0;
+      plugin->box_area.y = area.height / 2.0 - plugin->box_area.height / 2.0;
+
+      plugin->lock_area.width = ply_image_get_width (plugin->lock_image);
+      plugin->lock_area.height = ply_image_get_height (plugin->lock_image);
+
+      entry_width = ply_entry_get_width (plugin->entry);
+      entry_height = ply_entry_get_height (plugin->entry);
+
+      x = area.width / 2.0 - (plugin->lock_area.width + entry_width) / 2.0 + plugin->lock_area.width;
+      y = area.height / 2.0 - entry_height / 2.0;
+
+      plugin->lock_area.x = area.width / 2.0 - (plugin->lock_area.width + entry_width) / 2.0;
+      plugin->lock_area.y = area.height / 2.0 - plugin->lock_area.height / 2.0;
+
+      box_data = ply_image_get_data (plugin->box_image);
+      ply_frame_buffer_fill_with_argb32_data (plugin->frame_buffer,
+                                              &plugin->box_area, 0, 0,
+                                              box_data);
+
+      ply_entry_show (plugin->entry, plugin->loop, plugin->window, x, y);
+
+      lock_data = ply_image_get_data (plugin->lock_image);
+      ply_frame_buffer_fill_with_argb32_data (plugin->frame_buffer,
+                                              &plugin->lock_area, 0, 0,
+                                              lock_data);
+    }
+  else
+    {
+      ply_entry_draw (plugin->entry);
+    }
+  if (prompt != NULL)
+    {
+      int label_width, label_height;
+
+      ply_label_set_text (plugin->label, prompt);
+      label_width = ply_label_get_width (plugin->label);
+      label_height = ply_label_get_height (plugin->label);
+
+      x = plugin->box_area.x + plugin->lock_area.width / 2;
+      y = plugin->box_area.y + plugin->box_area.height;
+
+      ply_label_show (plugin->label, plugin->window, x, y);
+    }
+
+}
+
+void
+on_root_mounted (ply_boot_splash_plugin_t *plugin)
+{
+  plugin->root_is_mounted = true;
+}
+
+void
+become_idle (ply_boot_splash_plugin_t *plugin,
+             ply_trigger_t            *idle_trigger)
+{
+  stop_animation (plugin);
+  ply_trigger_pull (idle_trigger, NULL);
+}
+
+void display_normal (ply_boot_splash_plugin_t *plugin)
+{
+  if (plugin->state != PLY_BOOT_SPLASH_DISPLAY_NORMAL)
+    {
+      plugin->state = PLY_BOOT_SPLASH_DISPLAY_NORMAL;
+      ply_entry_hide (plugin->entry);
+      start_animation (plugin);
+    }
+}
+
+void
+display_password (ply_boot_splash_plugin_t *plugin,
+                  const char               *prompt,
+                  int                       bullets)
+{
+  if (plugin->state == PLY_BOOT_SPLASH_DISPLAY_NORMAL)
+    {
+      stop_animation (plugin);
+    }
+  plugin->state = PLY_BOOT_SPLASH_DISPLAY_PASSWORD_ENTRY;
+  show_password_prompt (plugin, prompt);
+  ply_entry_set_bullet_count (plugin->entry, bullets);
+}
+
+void
+display_question (ply_boot_splash_plugin_t *plugin,
+                  const char               *prompt,
+                  const char               *entry_text)
+{
+  if (plugin->state == PLY_BOOT_SPLASH_DISPLAY_NORMAL)
+    {
+      stop_animation (plugin);
+    }
+
+  plugin->state = PLY_BOOT_SPLASH_DISPLAY_QUESTION_ENTRY;
+  show_password_prompt (plugin, prompt);
+  ply_entry_set_text (plugin->entry, entry_text);
+}
+
+ply_boot_splash_plugin_interface_t *
+ply_boot_splash_plugin_get_interface (void)
+{
+  static ply_boot_splash_plugin_interface_t plugin_interface =
+    {
+      .create_plugin = create_plugin,
+      .destroy_plugin = destroy_plugin,
+      .add_window = add_window,
+      .remove_window = remove_window,
+      .show_splash_screen = show_splash_screen,
+      .update_status = update_status,
+      .on_boot_progress = on_boot_progress,
+      .hide_splash_screen = hide_splash_screen,
+      .on_root_mounted = on_root_mounted,
+      .become_idle = become_idle,
+      .display_normal = display_normal,
+      .display_password = display_password,
+      .display_question = display_question,
+    };
+
+  return &plugin_interface;
+}
+
+/* vim: set ts=4 sw=4 expandtab autoindent cindent cino={.5s,(0: */