Commit 925ecdc66e268315868c3daf3765a6959e61ca8c

Authored by Silvan Calarco
0 parents
Exists in master and in 1 other branch milestone2

Initial commit

Showing 12 changed files with 286 additions and 0 deletions Side-by-side Diff

... ... @@ -0,0 +1,68 @@
  1 +# Makefile for plymouth-theme-openmamba
  2 +# Copyright (C) 2011 by Silvan Calarco <silvan.calarco@mambasoft.it>
  3 +
  4 +include VERSION
  5 +
  6 +PACKAGE=plymouth-theme-openmamba
  7 +
  8 +# system locations
  9 +prefix = /usr
  10 +exec_prefix = ${prefix}
  11 +sysconfdir = /etc
  12 +sbindir = ${exec_prefix}/sbin
  13 +bindir = ${exec_prefix}/bin
  14 +mandir = ${prefix}/usr/share/man
  15 +datadir = ${prefix}/share
  16 +initrddir = ${sysconfdir}/rc.d/init.d
  17 +sysconfigdir= ${sysconfdir}/sysconfig
  18 +localstatedir = /var
  19 +localesdir = ${datadir}/locale/
  20 +
  21 +srcdir = .
  22 +
  23 +DESTDIR =
  24 +INSTALL = /usr/bin/install
  25 +INSTALL_PROGRAM = ${INSTALL} -m 755
  26 +INSTALL_DATA = ${INSTALL} -m 644
  27 +INSTALL_DIR = ${INSTALL} -d -m 755
  28 +INSTALL_SCRIPT = ${INSTALL_PROGRAM}
  29 +
  30 +# package related variables
  31 +distdir = $(PACKAGE)-$(VERSION)
  32 +dist_archive = $(distdir).tar.bz2
  33 +
  34 +pck_catalogs := $(wildcard po/*.po)
  35 +
  36 +.SUFFIXES:
  37 +.SUFFIXES: .po .mo
  38 +.po.mo:; msgfmt $< -o $@
  39 +
  40 +all:
  41 +
  42 +install-dirs:
  43 + $(INSTALL_DIR) $(DESTDIR)$(datadir)/plymouth/themes
  44 +
  45 +install-files:
  46 + cp -a openmamba $(DESTDIR)$(datadir)
  47 +
  48 +install: install-dirs install-files
  49 +
  50 +dist: clean
  51 + @git log > ChangeLog.git
  52 + @mkdir /tmp/$(distdir)
  53 + @cp -a * /tmp/$(distdir)/
  54 + @rm -f $(dist_archive);\
  55 + tar cf - -C /tmp $(distdir) | bzip2 -9 -c > $(dist_archive)
  56 + @rm -rf /tmp/$(distdir)
  57 + @echo "file \`$(dist_archive)' created"
  58 +
  59 +dist-rpm: dist
  60 + @rpm_sourcedir=`rpm --eval=%{_sourcedir}`;\
  61 + mv -f $(dist_archive) $$rpm_sourcedir;\
  62 + echo "and saved as \`$$rpm_sourcedir/$(dist_archive)'"
  63 +
  64 +clean:
  65 + rm -f $(dist_archive)
  66 + rm -f $(pck_catalogs:.po=.mo)
  67 + rm -f $(PACKAGE).lang
  68 + make clean -C src
... ... @@ -0,0 +1 @@
  1 +VERSION = 0.1
0 2 \ No newline at end of file
openmamba/background.png

161 KB

870 Bytes

openmamba/bullet.png

296 Bytes

350 Bytes

1.85 KB

openmamba/openmamba.plymouth
... ... @@ -0,0 +1,11 @@
  1 +[Plymouth Theme]
  2 +Name=openmamba
  3 +Description=openmamba 2 default theme
  4 +ModuleName=script
  5 +
  6 +[script]
  7 +ImageDir=/usr/share/plymouth/themes/openmamba
  8 +ScriptFile=/usr/share/plymouth/themes/openmamba/openmamba.script
  9 +
  10 +[script-env-vars]
  11 +example_env_var=example env var value
openmamba/openmamba.script
... ... @@ -0,0 +1,206 @@
  1 +# This is an example plymouth plugin script
  2 +
  3 +#Window.SetBackgroundTopColor(0.234, 0.43, 0.705);
  4 +#Window.SetBackgroundBottomColor(0.16, 0.25, 0.44);
  5 +
  6 +wallpaper_image = Image("background.png");
  7 +screen_width = Window.GetWidth();
  8 +screen_height = Window.GetHeight();
  9 +resized_wallpaper_image = wallpaper_image.Scale(screen_width,screen_height);
  10 +wallpaper_sprite = Sprite(resized_wallpaper_image);
  11 +wallpaper_sprite.SetZ(-100);
  12 +
  13 +stretch_factor = screen_width / screen_height / 1.25;
  14 +
  15 +logo1.image = Image("openmamball.png");
  16 +logo1.image = logo1.image.Scale(72 * (screen_width / stretch_factor / 1280), 72 * (screen_height / 1024));
  17 +logo1.sprite = Sprite(logo1.image);
  18 +logo1.opacity_angle = 0;
  19 +
  20 +logo2.image = Image("openmamball.png");
  21 +logo2.image = logo2.image.Scale(85 * (screen_width / stretch_factor / 1280), 85 * (screen_height / 1024));
  22 +logo2.sprite = Sprite(logo2.image);
  23 +logo2.opacity_angle = 0;
  24 +
  25 +logo3.image = Image("openmamball.png");
  26 +logo3.image = logo3.image.Scale(118 * (screen_width / stretch_factor / 1280), 118 * (screen_height / 1024));
  27 +logo3.sprite = Sprite(logo3.image);
  28 +logo3.opacity_angle = 0;
  29 +
  30 +fun refresh_callback ()
  31 + {
  32 + if (status == "normal")
  33 + {
  34 + logo1.opacity_angle += ((2 * 3.14) / 50) * 0.3; # 0.5 HZ
  35 + logo2.opacity_angle += ((2 * 3.14) / 50) * 0.4; # 0.25 HZ
  36 + logo3.opacity_angle += ((2 * 3.14) / 50) * 0.5; # 0.125 HZ
  37 + min_opacity = 0.3;
  38 + opacity1 = (Math.Cos(logo1.opacity_angle) + 1) / 2;
  39 + opacity1 *= 1 - min_opacity;
  40 + opacity1 += min_opacity;
  41 + logo1.sprite.SetX ((980 * screen_width) / 1280 - logo1.image.GetWidth() / 2);
  42 + logo1.sprite.SetY ((105 * screen_height) / 1024 - logo1.image.GetHeight() / 2);
  43 + logo1.sprite.SetOpacity (opacity1);
  44 + opacity2 = (Math.Cos(logo2.opacity_angle) + 1) / 2;
  45 + opacity2 *= 1 - min_opacity;
  46 + opacity2 += min_opacity;
  47 + logo2.sprite.SetX ((980 * screen_width) / 1280 - logo2.image.GetWidth() / 2);
  48 + logo2.sprite.SetY ((242 * screen_height) / 1024 - logo2.image.GetHeight() / 2);
  49 + logo2.sprite.SetOpacity (opacity2);
  50 + opacity3 = (Math.Cos(logo3.opacity_angle) + 1) / 2;
  51 + opacity3 *= 1 - min_opacity;
  52 + opacity3 += min_opacity;
  53 + logo3.sprite.SetX ((980 * screen_width) / 1280 - logo3.image.GetWidth() / 2);
  54 + logo3.sprite.SetY ((415 * screen_height) / 1024 - logo3.image.GetHeight() / 2);
  55 + logo3.sprite.SetOpacity (opacity3);
  56 + }
  57 + else
  58 + {
  59 + logo1.sprite.SetX ((980 * screen_width) / 1280 - logo1.image.GetWidth() / 2);
  60 + logo1.sprite.SetY ((105 * screen_height) / 1024 - logo1.image.GetHeight() / 2);
  61 + logo1.sprite.SetOpacity (1);
  62 + logo2.sprite.SetX ((980 * screen_width) / 1280 - logo2.image.GetWidth() / 2);
  63 + logo2.sprite.SetY ((250 * screen_height) / 1024 - logo2.image.GetHeight() / 2);
  64 + logo2.sprite.SetOpacity (1);
  65 + logo3.sprite.SetX ((980 * screen_width) / 1280 - logo3.image.GetWidth() / 2);
  66 + logo3.sprite.SetY ((415 * screen_height) / 1024 - logo3.image.GetHeight() / 2);
  67 + logo3.sprite.SetOpacity (1);
  68 + }
  69 + }
  70 +
  71 +Plymouth.SetRefreshFunction (refresh_callback);
  72 +
  73 +#----------------------------------------- Dialogue --------------------------------
  74 +
  75 +status = "normal";
  76 +
  77 +fun dialog_setup()
  78 + {
  79 + local.box;
  80 + local.lock;
  81 + local.entry;
  82 +
  83 + box.image = Image("box.png");
  84 + lock.image = Image("lock.png");
  85 + entry.image = Image("entry.png");
  86 +
  87 + box.sprite = Sprite(box.image);
  88 + box.x = Window.GetX() + Window.GetWidth() / 2 - box.image.GetWidth ()/2;
  89 + box.y = Window.GetY() + Window.GetHeight() / 2 - box.image.GetHeight()/2;
  90 + box.z = 10000;
  91 + box.sprite.SetPosition(box.x, box.y, box.z);
  92 +
  93 + lock.sprite = Sprite(lock.image);
  94 + lock.x = box.x + box.image.GetWidth()/2 - (lock.image.GetWidth() + entry.image.GetWidth()) / 2;
  95 + lock.y = box.y + box.image.GetHeight()/2 - lock.image.GetHeight()/2;
  96 + lock.z = box.z + 1;
  97 + lock.sprite.SetPosition(lock.x, lock.y, lock.z);
  98 +
  99 + entry.sprite = Sprite(entry.image);
  100 + entry.x = lock.x + lock.image.GetWidth();
  101 + entry.y = box.y + box.image.GetHeight()/2 - entry.image.GetHeight()/2;
  102 + entry.z = box.z + 1;
  103 + entry.sprite.SetPosition(entry.x, entry.y, entry.z);
  104 +
  105 + global.dialog.box = box;
  106 + global.dialog.lock = lock;
  107 + global.dialog.entry = entry;
  108 + global.dialog.bullet_image = Image("bullet.png");
  109 + dialog_opacity (1);
  110 + }
  111 +
  112 +fun dialog_opacity(opacity)
  113 + {
  114 + dialog.box.sprite.SetOpacity (opacity);
  115 + dialog.lock.sprite.SetOpacity (opacity);
  116 + dialog.entry.sprite.SetOpacity (opacity);
  117 + for (index = 0; dialog.bullet[index]; index++)
  118 + {
  119 + dialog.bullet[index].sprite.SetOpacity(opacity);
  120 + }
  121 + }
  122 +
  123 +fun display_normal_callback ()
  124 + {
  125 + global.status = "normal";
  126 + if (global.dialog)
  127 + dialog_opacity (0);
  128 + }
  129 +
  130 +fun display_password_callback (prompt, bullets)
  131 + {
  132 + global.status = "password";
  133 + if (!global.dialog)
  134 + dialog_setup();
  135 + else
  136 + dialog_opacity(1);
  137 + for (index = 0; dialog.bullet[index] || index < bullets; index++)
  138 + {
  139 + if (!dialog.bullet[index])
  140 + {
  141 + dialog.bullet[index].sprite = Sprite(dialog.bullet_image);
  142 + dialog.bullet[index].x = dialog.entry.x + index * dialog.bullet_image.GetWidth();
  143 + dialog.bullet[index].y = dialog.entry.y + dialog.entry.image.GetHeight() / 2 - dialog.bullet_image.GetHeight() / 2;
  144 + dialog.bullet[index].z = dialog.entry.z + 1;
  145 + dialog.bullet[index].sprite.SetPosition(dialog.bullet[index].x, dialog.bullet[index].y, dialog.bullet[index].z);
  146 + }
  147 + if (index < bullets)
  148 + dialog.bullet[index].sprite.SetOpacity(1);
  149 + else
  150 + dialog.bullet[index].sprite.SetOpacity(0);
  151 + }
  152 + }
  153 +
  154 +Plymouth.SetDisplayNormalFunction(display_normal_callback);
  155 +Plymouth.SetDisplayPasswordFunction(display_password_callback);
  156 +
  157 +#----------------------------------------- Progress Bar --------------------------------
  158 +
  159 +#progress_box.image = Image("progress_box.png");
  160 +#progress_box.sprite = Sprite(progress_box.image);
  161 +#
  162 +#progress_box.x = Window.GetX() + Window.GetWidth() / 2 - progress_box.image.GetWidth() / 2;
  163 +#progress_box.y = Window.GetY() + Window.GetHeight() * 0.75 - progress_box.image.GetHeight() / 2;
  164 +#progress_box.sprite.SetPosition(progress_box.x, progress_box.y, 0);
  165 +#
  166 +#progress_bar.original_image = Image("progress_bar.png");
  167 +#progress_bar.sprite = Sprite();
  168 +#
  169 +#progress_bar.x = Window.GetX() + Window.GetWidth() / 2 - progress_bar.original_image.GetWidth() / 2;
  170 +#progress_bar.y = Window.GetY() + Window.GetHeight() / 2 * 1.5 - progress_box.image.GetHeight() / 2 + (progress_box.image.GetHeight() - progress_bar.original_image.GetHeight()) / 2;
  171 +#progress_bar.sprite.SetPosition(progress_bar.x, progress_bar.y, 1);
  172 +#
  173 +#fun progress_callback (duration, progress)
  174 +# {
  175 +# if (progress_bar.image.GetWidth () != Math.Int (progress_bar.original_image.GetWidth () * progress))
  176 +# {
  177 +# progress_bar.image = progress_bar.original_image.Scale(progress_bar.original_image.GetWidth(progress_bar.original_image) * progress, progress_bar.original_image.GetHeight());
  178 +# progress_bar.sprite.SetImage (progress_bar.image);
  179 +# }
  180 +# }
  181 +#
  182 +#Plymouth.SetBootProgressFunction(progress_callback);
  183 +
  184 +#----------------------------------------- Quit --------------------------------
  185 +
  186 +fun quit_callback ()
  187 +{
  188 + logo1.sprite.SetOpacity (1);
  189 + logo2.sprite.SetOpacity (1);
  190 + logo3.sprite.SetOpacity (1);
  191 +}
  192 +
  193 +Plymouth.SetQuitFunction(quit_callback);
  194 +
  195 +#----------------------------------------- Message --------------------------------
  196 +
  197 +message_sprite = Sprite();
  198 +
  199 +fun message_callback (text)
  200 +{
  201 + my_image = Image.Text(text, 1, 1, 1);
  202 + message_sprite.SetPosition(screen_width / 2 - my_image.GetWidth() / 2, (800/1024) * screen_height, 10000);
  203 + message_sprite.SetImage(my_image);
  204 +}
  205 +
  206 +Plymouth.SetMessageFunction(message_callback);
openmamba/openmamball.png

33.2 KB

openmamba/progress_bar.png

173 Bytes

openmamba/progress_box.png

196 Bytes