]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[splash] Drop pulser plugin
authorRay Strode <rstrode@redhat.com>
Thu, 14 May 2009 14:29:32 +0000 (10:29 -0400)
committerRay Strode <rstrode@redhat.com>
Wed, 20 May 2009 21:27:52 +0000 (17:27 -0400)
It's ugly and doesn't pass the quality sniff test.

configure.ac
src/plugins/splash/Makefile.am
src/plugins/splash/pulser/Makefile.am [deleted file]
src/plugins/splash/pulser/plugin.c [deleted file]
themes/Makefile.am
themes/pulser/Makefile.am [deleted file]
themes/pulser/pulser.plymouth [deleted file]

index 558f97b2e332ed82580f4db2a6dd482f426e0a0f..5a04311581b048907ad22de7c667e67321949ec8 100644 (file)
@@ -109,7 +109,6 @@ AC_ARG_WITH(default-plugin, AC_HELP_STRING([--with-default-plugin=fade-in], [Plu
 AM_CONDITIONAL(ADD_DEFAULT_PLUGIN_LINK,
                [test "$default_plugin_name" = "spinfinity" \
                   -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"      \
@@ -205,7 +204,6 @@ AC_OUTPUT([Makefile
            src/plugins/splash/spinfinity/Makefile
            src/plugins/splash/fade-in/Makefile
            src/plugins/splash/text/Makefile
-           src/plugins/splash/pulser/Makefile
            src/plugins/splash/details/Makefile
            src/plugins/splash/solar/Makefile
            src/plugins/splash/glow/Makefile
@@ -221,7 +219,6 @@ AC_OUTPUT([Makefile
            themes/spinfinity/Makefile
            themes/fade-in/Makefile
            themes/text/Makefile
-           themes/pulser/Makefile
            themes/details/Makefile
            themes/solar/Makefile
            themes/glow/Makefile
index a09bdfe8cfebde86c149f0c23e090ba3410df961..9e1a1cef787b829d0e587558a5e61faac60552f8 100644 (file)
@@ -1,4 +1,4 @@
-SUBDIRS = spinfinity fade-in text details solar pulser glow
+SUBDIRS = spinfinity fade-in text details solar glow
 MAINTAINERCLEANFILES = Makefile.in
 
 if ADD_DEFAULT_PLUGIN_LINK
diff --git a/src/plugins/splash/pulser/Makefile.am b/src/plugins/splash/pulser/Makefile.am
deleted file mode 100644 (file)
index abba533..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-INCLUDES = -I$(top_srcdir)                                                    \
-           -I$(srcdir)/../../../libply                                        \
-           -I$(srcdir)/../../../libplybootsplash                              \
-           -I$(srcdir)/../../..                                               \
-           -I$(srcdir)/../..                                                  \
-           -I$(srcdir)/..                                                     \
-           -I$(srcdir)
-
-plugindir = $(libdir)/plymouth
-plugin_LTLIBRARIES = pulser.la
-
-pulser_la_CFLAGS = $(PLYMOUTH_CFLAGS)                                           \
-                 -DPLYMOUTH_BACKGROUND_COLOR=$(background_color)              \
-                 -DPLYMOUTH_BACKGROUND_END_COLOR=$(background_end_color)      \
-                 -DPLYMOUTH_BACKGROUND_START_COLOR=$(background_start_color)
-
-pulser_la_LDFLAGS = -module -avoid-version -export-dynamic
-pulser_la_LIBADD = $(PLYMOUTH_LIBS)                                            \
-                 ../../../libply/libply.la                                   \
-                 ../../../libplybootsplash/libplybootsplash.la
-pulser_la_SOURCES = $(srcdir)/plugin.c
-
-MAINTAINERCLEANFILES = Makefile.in
diff --git a/src/plugins/splash/pulser/plugin.c b/src/plugins/splash/pulser/plugin.c
deleted file mode 100644 (file)
index 05771ad..0000000
+++ /dev/null
@@ -1,419 +0,0 @@
-/* text.c - boot splash plugin
- *
- * Copyright (C) 2008 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: Ray Strode <rstrode@redhat.com>
- */
-#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 <termios.h>
-#include <unistd.h>
-#include <values.h>
-#include <wchar.h>
-
-#include "ply-trigger.h"
-#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"
-#include "ply-image.h"
-#include "ply-text-pulser.h"
-#include "ply-utils.h"
-#include "ply-window.h"
-
-#include <linux/kd.h>
-
-#define CLEAR_LINE_SEQUENCE "\033[2K\r\n"
-#define BACKSPACE "\b\033[0K"
-
-struct _ply_boot_splash_plugin
-{
-  ply_event_loop_t *loop;
-  ply_boot_splash_mode_t mode;
-
-  ply_window_t *window;
-
-  ply_text_pulser_t *pulser;
-
-  uint32_t keyboard_input_is_hidden : 1;
-  uint32_t is_animating : 1;
-};
-void hide_splash_screen (ply_boot_splash_plugin_t *plugin,
-                         ply_event_loop_t         *loop);
-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 (ply_key_file_t *key_file)
-{
-  ply_boot_splash_plugin_t *plugin;
-
-  ply_trace ("creating plugin");
-
-  plugin = calloc (1, sizeof (ply_boot_splash_plugin_t));
-  plugin->pulser = ply_text_pulser_new ();
-
-  return plugin;
-}
-
-static void
-detach_from_event_loop (ply_boot_splash_plugin_t *plugin)
-{
-  plugin->loop = NULL;
-
-  ply_trace ("detaching from event loop");
-}
-
-void
-destroy_plugin (ply_boot_splash_plugin_t *plugin)
-{
-  ply_trace ("destroying plugin");
-
-  if (plugin == NULL)
-    return;
-
-  remove_handlers (plugin);
-
-  /* It doesn't ever make sense to keep this plugin on screen
-   * after exit
-   */
-  hide_splash_screen (plugin, plugin->loop);
-
-  ply_text_pulser_free (plugin->pulser);
-
-  free (plugin);
-}
-
-static void
-start_animation (ply_boot_splash_plugin_t *plugin)
-{
-
-  int window_width, window_height;
-  int width, height;
-  assert (plugin != NULL);
-  assert (plugin->loop != NULL);
-
-  if (plugin->is_animating)
-     return;
-
-  ply_window_set_color_hex_value (plugin->window,
-                                  PLY_WINDOW_COLOR_BROWN,
-                                  PLYMOUTH_BACKGROUND_END_COLOR);
-  ply_window_set_color_hex_value (plugin->window,
-                                  PLY_WINDOW_COLOR_BLUE,
-                                  PLYMOUTH_BACKGROUND_START_COLOR);
-  ply_window_set_color_hex_value (plugin->window,
-                                  PLY_WINDOW_COLOR_GREEN,
-                                  PLYMOUTH_BACKGROUND_COLOR);
-
-  ply_window_set_background_color (plugin->window, PLY_WINDOW_COLOR_BLUE);
-  ply_window_clear_screen (plugin->window);
-  ply_window_hide_text_cursor (plugin->window);
-
-  if (plugin->mode == PLY_BOOT_SPLASH_MODE_SHUTDOWN)
-    return;
-
-  window_width = ply_window_get_number_of_text_columns (plugin->window);
-  window_height = ply_window_get_number_of_text_rows (plugin->window);
-  width = ply_text_pulser_get_number_of_columns (plugin->pulser);
-  height = ply_text_pulser_get_number_of_rows (plugin->pulser);
-  ply_text_pulser_start (plugin->pulser,
-                         plugin->loop,
-                         plugin->window,
-                         window_width / 2.0 - width / 2.0,
-                         window_height / 2.0 - 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_text_pulser_stop (plugin->pulser);
-}
-
-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)
-{
-}
-
-void
-on_enter (ply_boot_splash_plugin_t *plugin,
-          const char               *line)
-{
-}
-
-void
-on_draw (ply_boot_splash_plugin_t *plugin,
-         int                       x,
-         int                       y,
-         int                       width,
-         int                       height)
-{
-  ply_window_set_background_color (plugin->window, PLY_WINDOW_COLOR_BLUE);
-  ply_window_clear_screen (plugin->window);
-}
-
-void
-on_erase (ply_boot_splash_plugin_t *plugin,
-          int                       x,
-          int                       y,
-          int                       width,
-          int                       height)
-{
-  ply_window_set_background_color (plugin->window, PLY_WINDOW_COLOR_BLUE);
-  ply_window_clear_screen (plugin->window);
-}
-
-static void
-add_handlers (ply_boot_splash_plugin_t *plugin)
-{
-  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);
-}
-
-static void
-remove_handlers (ply_boot_splash_plugin_t *plugin)
-{
-
-  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);
-}
-
-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,
-                    ply_boot_splash_mode_t    mode)
-{
-  assert (plugin != NULL);
-
-  add_handlers (plugin);
-  ply_show_new_kernel_messages (false);
-
-  plugin->loop = loop;
-  plugin->mode = mode;
-  ply_event_loop_watch_for_exit (loop, (ply_event_loop_exit_handler_t)
-                                 detach_from_event_loop,
-                                 plugin);
-
-  start_animation (plugin);
-
-  return true;
-}
-
-void
-update_status (ply_boot_splash_plugin_t *plugin,
-               const char               *status)
-{
-  assert (plugin != NULL);
-
-  ply_trace ("status update");
-}
-
-void
-hide_splash_screen (ply_boot_splash_plugin_t *plugin,
-                    ply_event_loop_t         *loop)
-{
-  assert (plugin != NULL);
-
-  ply_trace ("hiding splash screen");
-
-  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);
-    }
-
-  if (plugin->window != NULL)
-    {
-      remove_handlers (plugin);
-
-      ply_window_set_background_color (plugin->window, PLY_WINDOW_COLOR_DEFAULT);
-      ply_window_clear_screen (plugin->window);
-      ply_window_show_text_cursor (plugin->window);
-      ply_window_reset_colors (plugin->window);
-    }
-
-  ply_show_new_kernel_messages (true);
-}
-
-void display_normal (ply_boot_splash_plugin_t *plugin)
-{
-  start_animation(plugin);
-}
-
-void
-display_password (ply_boot_splash_plugin_t *plugin,
-                  const char               *prompt,
-                  int                       bullets)
-{
-      int window_width, window_height;
-      int i;
-      stop_animation (plugin);
-      ply_window_set_background_color (plugin->window, PLY_WINDOW_COLOR_DEFAULT);
-      ply_window_clear_screen (plugin->window);
-
-      window_width = ply_window_get_number_of_text_columns (plugin->window);
-      window_height = ply_window_get_number_of_text_rows (plugin->window);
-      
-      if (!prompt)
-        prompt = "Password";
-      
-      ply_window_set_text_cursor_position (plugin->window, 0, window_height / 2);
-      
-      for (i=0; i < window_width; i++)
-        {
-          write (STDOUT_FILENO, " ", strlen (" "));
-        }
-      ply_window_set_text_cursor_position (plugin->window,
-                                           window_width / 2 - (strlen (prompt)),
-                                           window_height / 2);
-      write (STDOUT_FILENO, prompt, strlen (prompt));
-      write (STDOUT_FILENO, ":", strlen (":"));
-      
-      for (i=0; i < bullets; i++)
-        {
-          write (STDOUT_FILENO, "•", strlen ("•"));
-        }
-      ply_window_show_text_cursor (plugin->window);
-}
-
-void
-display_question (ply_boot_splash_plugin_t *plugin,
-                  const char               *prompt,
-                  const char               *entry_text)
-{
-      int window_width, window_height;
-      int i;
-      stop_animation (plugin);
-      ply_window_set_background_color (plugin->window, PLY_WINDOW_COLOR_DEFAULT);
-      ply_window_clear_screen (plugin->window);
-
-      window_width = ply_window_get_number_of_text_columns (plugin->window);
-      window_height = ply_window_get_number_of_text_rows (plugin->window);
-      
-      if (!prompt)
-        prompt = "";
-      
-      ply_window_set_text_cursor_position (plugin->window,
-                                           0, window_height / 2);
-      
-      for (i=0; i < window_width; i++)
-        {
-          write (STDOUT_FILENO, " ", strlen (" "));
-        }
-      ply_window_set_text_cursor_position (plugin->window,
-                                           window_width / 2 - (strlen (prompt)),
-                                           window_height / 2);
-      write (STDOUT_FILENO, prompt, strlen (prompt));
-      write (STDOUT_FILENO, ":", strlen (":"));
-      
-      write (STDOUT_FILENO, entry_text, strlen (entry_text));
-      ply_window_show_text_cursor (plugin->window);
-}
-
-
-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,
-      .hide_splash_screen = hide_splash_screen,
-      .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: */
index 6613ba658955658fd7197325130b878db84c944c..3e5207dfba011c0d1459d47943f5ceb21ddd1958 100644 (file)
@@ -1,2 +1,2 @@
-SUBDIRS = spinfinity fade-in text details solar pulser glow
+SUBDIRS = spinfinity fade-in text details solar glow
 MAINTAINERCLEANFILES = Makefile.in
diff --git a/themes/pulser/Makefile.am b/themes/pulser/Makefile.am
deleted file mode 100644 (file)
index d5836ab..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-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
deleted file mode 100644 (file)
index 8a833ec..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-[Plymouth Theme]
-Name=Pulser
-Description=Ugly text mode plugin with cylon like pulsing progress bar
-ModuleName=pulser