Initial commit
68
Makefile
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
# Makefile for plymouth-theme-openmamba
|
||||||
|
# Copyright (C) 2011 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
||||||
|
|
||||||
|
include VERSION
|
||||||
|
|
||||||
|
PACKAGE=plymouth-theme-openmamba
|
||||||
|
|
||||||
|
# system locations
|
||||||
|
prefix = /usr
|
||||||
|
exec_prefix = ${prefix}
|
||||||
|
sysconfdir = /etc
|
||||||
|
sbindir = ${exec_prefix}/sbin
|
||||||
|
bindir = ${exec_prefix}/bin
|
||||||
|
mandir = ${prefix}/usr/share/man
|
||||||
|
datadir = ${prefix}/share
|
||||||
|
initrddir = ${sysconfdir}/rc.d/init.d
|
||||||
|
sysconfigdir= ${sysconfdir}/sysconfig
|
||||||
|
localstatedir = /var
|
||||||
|
localesdir = ${datadir}/locale/
|
||||||
|
|
||||||
|
srcdir = .
|
||||||
|
|
||||||
|
DESTDIR =
|
||||||
|
INSTALL = /usr/bin/install
|
||||||
|
INSTALL_PROGRAM = ${INSTALL} -m 755
|
||||||
|
INSTALL_DATA = ${INSTALL} -m 644
|
||||||
|
INSTALL_DIR = ${INSTALL} -d -m 755
|
||||||
|
INSTALL_SCRIPT = ${INSTALL_PROGRAM}
|
||||||
|
|
||||||
|
# package related variables
|
||||||
|
distdir = $(PACKAGE)-$(VERSION)
|
||||||
|
dist_archive = $(distdir).tar.bz2
|
||||||
|
|
||||||
|
pck_catalogs := $(wildcard po/*.po)
|
||||||
|
|
||||||
|
.SUFFIXES:
|
||||||
|
.SUFFIXES: .po .mo
|
||||||
|
.po.mo:; msgfmt $< -o $@
|
||||||
|
|
||||||
|
all:
|
||||||
|
|
||||||
|
install-dirs:
|
||||||
|
$(INSTALL_DIR) $(DESTDIR)$(datadir)/plymouth/themes
|
||||||
|
|
||||||
|
install-files:
|
||||||
|
cp -a openmamba $(DESTDIR)$(datadir)
|
||||||
|
|
||||||
|
install: install-dirs install-files
|
||||||
|
|
||||||
|
dist: clean
|
||||||
|
@git log > ChangeLog.git
|
||||||
|
@mkdir /tmp/$(distdir)
|
||||||
|
@cp -a * /tmp/$(distdir)/
|
||||||
|
@rm -f $(dist_archive);\
|
||||||
|
tar cf - -C /tmp $(distdir) | bzip2 -9 -c > $(dist_archive)
|
||||||
|
@rm -rf /tmp/$(distdir)
|
||||||
|
@echo "file \`$(dist_archive)' created"
|
||||||
|
|
||||||
|
dist-rpm: dist
|
||||||
|
@rpm_sourcedir=`rpm --eval=%{_sourcedir}`;\
|
||||||
|
mv -f $(dist_archive) $$rpm_sourcedir;\
|
||||||
|
echo "and saved as \`$$rpm_sourcedir/$(dist_archive)'"
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(dist_archive)
|
||||||
|
rm -f $(pck_catalogs:.po=.mo)
|
||||||
|
rm -f $(PACKAGE).lang
|
||||||
|
make clean -C src
|
BIN
openmamba/background.png
Normal file
After Width: | Height: | Size: 161 KiB |
BIN
openmamba/box.png
Normal file
After Width: | Height: | Size: 870 B |
BIN
openmamba/bullet.png
Normal file
After Width: | Height: | Size: 296 B |
BIN
openmamba/entry.png
Normal file
After Width: | Height: | Size: 350 B |
BIN
openmamba/lock.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
11
openmamba/openmamba.plymouth
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
[Plymouth Theme]
|
||||||
|
Name=openmamba
|
||||||
|
Description=openmamba 2 default theme
|
||||||
|
ModuleName=script
|
||||||
|
|
||||||
|
[script]
|
||||||
|
ImageDir=/usr/share/plymouth/themes/openmamba
|
||||||
|
ScriptFile=/usr/share/plymouth/themes/openmamba/openmamba.script
|
||||||
|
|
||||||
|
[script-env-vars]
|
||||||
|
example_env_var=example env var value
|
206
openmamba/openmamba.script
Normal file
@ -0,0 +1,206 @@
|
|||||||
|
# This is an example plymouth plugin script
|
||||||
|
|
||||||
|
#Window.SetBackgroundTopColor(0.234, 0.43, 0.705);
|
||||||
|
#Window.SetBackgroundBottomColor(0.16, 0.25, 0.44);
|
||||||
|
|
||||||
|
wallpaper_image = Image("background.png");
|
||||||
|
screen_width = Window.GetWidth();
|
||||||
|
screen_height = Window.GetHeight();
|
||||||
|
resized_wallpaper_image = wallpaper_image.Scale(screen_width,screen_height);
|
||||||
|
wallpaper_sprite = Sprite(resized_wallpaper_image);
|
||||||
|
wallpaper_sprite.SetZ(-100);
|
||||||
|
|
||||||
|
stretch_factor = screen_width / screen_height / 1.25;
|
||||||
|
|
||||||
|
logo1.image = Image("openmamball.png");
|
||||||
|
logo1.image = logo1.image.Scale(72 * (screen_width / stretch_factor / 1280), 72 * (screen_height / 1024));
|
||||||
|
logo1.sprite = Sprite(logo1.image);
|
||||||
|
logo1.opacity_angle = 0;
|
||||||
|
|
||||||
|
logo2.image = Image("openmamball.png");
|
||||||
|
logo2.image = logo2.image.Scale(85 * (screen_width / stretch_factor / 1280), 85 * (screen_height / 1024));
|
||||||
|
logo2.sprite = Sprite(logo2.image);
|
||||||
|
logo2.opacity_angle = 0;
|
||||||
|
|
||||||
|
logo3.image = Image("openmamball.png");
|
||||||
|
logo3.image = logo3.image.Scale(118 * (screen_width / stretch_factor / 1280), 118 * (screen_height / 1024));
|
||||||
|
logo3.sprite = Sprite(logo3.image);
|
||||||
|
logo3.opacity_angle = 0;
|
||||||
|
|
||||||
|
fun refresh_callback ()
|
||||||
|
{
|
||||||
|
if (status == "normal")
|
||||||
|
{
|
||||||
|
logo1.opacity_angle += ((2 * 3.14) / 50) * 0.3; # 0.5 HZ
|
||||||
|
logo2.opacity_angle += ((2 * 3.14) / 50) * 0.4; # 0.25 HZ
|
||||||
|
logo3.opacity_angle += ((2 * 3.14) / 50) * 0.5; # 0.125 HZ
|
||||||
|
min_opacity = 0.3;
|
||||||
|
opacity1 = (Math.Cos(logo1.opacity_angle) + 1) / 2;
|
||||||
|
opacity1 *= 1 - min_opacity;
|
||||||
|
opacity1 += min_opacity;
|
||||||
|
logo1.sprite.SetX ((980 * screen_width) / 1280 - logo1.image.GetWidth() / 2);
|
||||||
|
logo1.sprite.SetY ((105 * screen_height) / 1024 - logo1.image.GetHeight() / 2);
|
||||||
|
logo1.sprite.SetOpacity (opacity1);
|
||||||
|
opacity2 = (Math.Cos(logo2.opacity_angle) + 1) / 2;
|
||||||
|
opacity2 *= 1 - min_opacity;
|
||||||
|
opacity2 += min_opacity;
|
||||||
|
logo2.sprite.SetX ((980 * screen_width) / 1280 - logo2.image.GetWidth() / 2);
|
||||||
|
logo2.sprite.SetY ((242 * screen_height) / 1024 - logo2.image.GetHeight() / 2);
|
||||||
|
logo2.sprite.SetOpacity (opacity2);
|
||||||
|
opacity3 = (Math.Cos(logo3.opacity_angle) + 1) / 2;
|
||||||
|
opacity3 *= 1 - min_opacity;
|
||||||
|
opacity3 += min_opacity;
|
||||||
|
logo3.sprite.SetX ((980 * screen_width) / 1280 - logo3.image.GetWidth() / 2);
|
||||||
|
logo3.sprite.SetY ((415 * screen_height) / 1024 - logo3.image.GetHeight() / 2);
|
||||||
|
logo3.sprite.SetOpacity (opacity3);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
logo1.sprite.SetX ((980 * screen_width) / 1280 - logo1.image.GetWidth() / 2);
|
||||||
|
logo1.sprite.SetY ((105 * screen_height) / 1024 - logo1.image.GetHeight() / 2);
|
||||||
|
logo1.sprite.SetOpacity (1);
|
||||||
|
logo2.sprite.SetX ((980 * screen_width) / 1280 - logo2.image.GetWidth() / 2);
|
||||||
|
logo2.sprite.SetY ((250 * screen_height) / 1024 - logo2.image.GetHeight() / 2);
|
||||||
|
logo2.sprite.SetOpacity (1);
|
||||||
|
logo3.sprite.SetX ((980 * screen_width) / 1280 - logo3.image.GetWidth() / 2);
|
||||||
|
logo3.sprite.SetY ((415 * screen_height) / 1024 - logo3.image.GetHeight() / 2);
|
||||||
|
logo3.sprite.SetOpacity (1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Plymouth.SetRefreshFunction (refresh_callback);
|
||||||
|
|
||||||
|
#----------------------------------------- Dialogue --------------------------------
|
||||||
|
|
||||||
|
status = "normal";
|
||||||
|
|
||||||
|
fun dialog_setup()
|
||||||
|
{
|
||||||
|
local.box;
|
||||||
|
local.lock;
|
||||||
|
local.entry;
|
||||||
|
|
||||||
|
box.image = Image("box.png");
|
||||||
|
lock.image = Image("lock.png");
|
||||||
|
entry.image = Image("entry.png");
|
||||||
|
|
||||||
|
box.sprite = Sprite(box.image);
|
||||||
|
box.x = Window.GetX() + Window.GetWidth() / 2 - box.image.GetWidth ()/2;
|
||||||
|
box.y = Window.GetY() + Window.GetHeight() / 2 - box.image.GetHeight()/2;
|
||||||
|
box.z = 10000;
|
||||||
|
box.sprite.SetPosition(box.x, box.y, box.z);
|
||||||
|
|
||||||
|
lock.sprite = Sprite(lock.image);
|
||||||
|
lock.x = box.x + box.image.GetWidth()/2 - (lock.image.GetWidth() + entry.image.GetWidth()) / 2;
|
||||||
|
lock.y = box.y + box.image.GetHeight()/2 - lock.image.GetHeight()/2;
|
||||||
|
lock.z = box.z + 1;
|
||||||
|
lock.sprite.SetPosition(lock.x, lock.y, lock.z);
|
||||||
|
|
||||||
|
entry.sprite = Sprite(entry.image);
|
||||||
|
entry.x = lock.x + lock.image.GetWidth();
|
||||||
|
entry.y = box.y + box.image.GetHeight()/2 - entry.image.GetHeight()/2;
|
||||||
|
entry.z = box.z + 1;
|
||||||
|
entry.sprite.SetPosition(entry.x, entry.y, entry.z);
|
||||||
|
|
||||||
|
global.dialog.box = box;
|
||||||
|
global.dialog.lock = lock;
|
||||||
|
global.dialog.entry = entry;
|
||||||
|
global.dialog.bullet_image = Image("bullet.png");
|
||||||
|
dialog_opacity (1);
|
||||||
|
}
|
||||||
|
|
||||||
|
fun dialog_opacity(opacity)
|
||||||
|
{
|
||||||
|
dialog.box.sprite.SetOpacity (opacity);
|
||||||
|
dialog.lock.sprite.SetOpacity (opacity);
|
||||||
|
dialog.entry.sprite.SetOpacity (opacity);
|
||||||
|
for (index = 0; dialog.bullet[index]; index++)
|
||||||
|
{
|
||||||
|
dialog.bullet[index].sprite.SetOpacity(opacity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun display_normal_callback ()
|
||||||
|
{
|
||||||
|
global.status = "normal";
|
||||||
|
if (global.dialog)
|
||||||
|
dialog_opacity (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
fun display_password_callback (prompt, bullets)
|
||||||
|
{
|
||||||
|
global.status = "password";
|
||||||
|
if (!global.dialog)
|
||||||
|
dialog_setup();
|
||||||
|
else
|
||||||
|
dialog_opacity(1);
|
||||||
|
for (index = 0; dialog.bullet[index] || index < bullets; index++)
|
||||||
|
{
|
||||||
|
if (!dialog.bullet[index])
|
||||||
|
{
|
||||||
|
dialog.bullet[index].sprite = Sprite(dialog.bullet_image);
|
||||||
|
dialog.bullet[index].x = dialog.entry.x + index * dialog.bullet_image.GetWidth();
|
||||||
|
dialog.bullet[index].y = dialog.entry.y + dialog.entry.image.GetHeight() / 2 - dialog.bullet_image.GetHeight() / 2;
|
||||||
|
dialog.bullet[index].z = dialog.entry.z + 1;
|
||||||
|
dialog.bullet[index].sprite.SetPosition(dialog.bullet[index].x, dialog.bullet[index].y, dialog.bullet[index].z);
|
||||||
|
}
|
||||||
|
if (index < bullets)
|
||||||
|
dialog.bullet[index].sprite.SetOpacity(1);
|
||||||
|
else
|
||||||
|
dialog.bullet[index].sprite.SetOpacity(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Plymouth.SetDisplayNormalFunction(display_normal_callback);
|
||||||
|
Plymouth.SetDisplayPasswordFunction(display_password_callback);
|
||||||
|
|
||||||
|
#----------------------------------------- Progress Bar --------------------------------
|
||||||
|
|
||||||
|
#progress_box.image = Image("progress_box.png");
|
||||||
|
#progress_box.sprite = Sprite(progress_box.image);
|
||||||
|
#
|
||||||
|
#progress_box.x = Window.GetX() + Window.GetWidth() / 2 - progress_box.image.GetWidth() / 2;
|
||||||
|
#progress_box.y = Window.GetY() + Window.GetHeight() * 0.75 - progress_box.image.GetHeight() / 2;
|
||||||
|
#progress_box.sprite.SetPosition(progress_box.x, progress_box.y, 0);
|
||||||
|
#
|
||||||
|
#progress_bar.original_image = Image("progress_bar.png");
|
||||||
|
#progress_bar.sprite = Sprite();
|
||||||
|
#
|
||||||
|
#progress_bar.x = Window.GetX() + Window.GetWidth() / 2 - progress_bar.original_image.GetWidth() / 2;
|
||||||
|
#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;
|
||||||
|
#progress_bar.sprite.SetPosition(progress_bar.x, progress_bar.y, 1);
|
||||||
|
#
|
||||||
|
#fun progress_callback (duration, progress)
|
||||||
|
# {
|
||||||
|
# if (progress_bar.image.GetWidth () != Math.Int (progress_bar.original_image.GetWidth () * progress))
|
||||||
|
# {
|
||||||
|
# progress_bar.image = progress_bar.original_image.Scale(progress_bar.original_image.GetWidth(progress_bar.original_image) * progress, progress_bar.original_image.GetHeight());
|
||||||
|
# progress_bar.sprite.SetImage (progress_bar.image);
|
||||||
|
# }
|
||||||
|
# }
|
||||||
|
#
|
||||||
|
#Plymouth.SetBootProgressFunction(progress_callback);
|
||||||
|
|
||||||
|
#----------------------------------------- Quit --------------------------------
|
||||||
|
|
||||||
|
fun quit_callback ()
|
||||||
|
{
|
||||||
|
logo1.sprite.SetOpacity (1);
|
||||||
|
logo2.sprite.SetOpacity (1);
|
||||||
|
logo3.sprite.SetOpacity (1);
|
||||||
|
}
|
||||||
|
|
||||||
|
Plymouth.SetQuitFunction(quit_callback);
|
||||||
|
|
||||||
|
#----------------------------------------- Message --------------------------------
|
||||||
|
|
||||||
|
message_sprite = Sprite();
|
||||||
|
|
||||||
|
fun message_callback (text)
|
||||||
|
{
|
||||||
|
my_image = Image.Text(text, 1, 1, 1);
|
||||||
|
message_sprite.SetPosition(screen_width / 2 - my_image.GetWidth() / 2, (800/1024) * screen_height, 10000);
|
||||||
|
message_sprite.SetImage(my_image);
|
||||||
|
}
|
||||||
|
|
||||||
|
Plymouth.SetMessageFunction(message_callback);
|
BIN
openmamba/openmamball.png
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
openmamba/progress_bar.png
Normal file
After Width: | Height: | Size: 173 B |
BIN
openmamba/progress_box.png
Normal file
After Width: | Height: | Size: 196 B |