From 45a10dae51a04427640f484d6bca16c06772b058 Mon Sep 17 00:00:00 2001 From: Frederic Crozat Date: Wed, 7 Oct 2009 12:19:50 +0000 Subject: - Switch to plymouth, drop bootsplash and splashy --- Makefile | 55 +----- Mandriva-Flash/plymouth/Mandriva-Flash.plymouth | 8 + Mandriva-Free/plymouth/Mandriva-Free.plymouth | 8 + Mandriva-One/plymouth/Mandriva-One.plymouth | 8 + .../plymouth/Mandriva-Powerpack.plymouth | 8 + common/plymouth/box.png | Bin 0 -> 365990 bytes common/plymouth/bullet.png | Bin 0 -> 365990 bytes common/plymouth/entry.png | Bin 0 -> 365990 bytes common/plymouth/lock.png | Bin 0 -> 365990 bytes common/plymouth/logo.png | Bin 0 -> 365990 bytes common/plymouth/mdv.script | 196 +++++++++++++++++++++ common/plymouth/progress_bar.png | Bin 0 -> 365990 bytes common/plymouth/progress_box.png | Bin 0 -> 365990 bytes common/plymouth/progress_box_background.png | Bin 0 -> 365990 bytes common/plymouth/progress_box_edge.png | Bin 0 -> 365990 bytes common/plymouth/suspend.png | Bin 0 -> 365990 bytes 16 files changed, 235 insertions(+), 48 deletions(-) create mode 100644 Mandriva-Flash/plymouth/Mandriva-Flash.plymouth create mode 100644 Mandriva-Free/plymouth/Mandriva-Free.plymouth create mode 100644 Mandriva-One/plymouth/Mandriva-One.plymouth create mode 100644 Mandriva-Powerpack/plymouth/Mandriva-Powerpack.plymouth create mode 100644 common/plymouth/box.png create mode 100644 common/plymouth/bullet.png create mode 100644 common/plymouth/entry.png create mode 100644 common/plymouth/lock.png create mode 100644 common/plymouth/logo.png create mode 100644 common/plymouth/mdv.script create mode 100644 common/plymouth/progress_bar.png create mode 100644 common/plymouth/progress_box.png create mode 100644 common/plymouth/progress_box_background.png create mode 100644 common/plymouth/progress_box_edge.png create mode 100644 common/plymouth/suspend.png diff --git a/Makefile b/Makefile index 41c3992..55b04ce 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ NAME=mandriva-theme PACKAGE=mandriva-theme -VERSION=1.3.12 +VERSION=1.4.0 THEMES=Mandriva-Free Mandriva-One Mandriva-Powerpack Mandriva-Flash @@ -17,7 +17,7 @@ install: @mkdir -p $(prefix)$(sharedir)/mdk/backgrounds/ @/bin/cp -f gimp/scripts/gimp-normalize-to-bootsplash.scm tmp-gimp-command @cat gimp/scripts/gimp-convert-to-jpeg.scm >> tmp-gimp-command - @for i in */bootsplash/data/*.png */gfxboot/*.png ; do \ + @for i in */gfxboot/*.png ; do \ echo \(gimp-normalize-to-bootsplash 1.0 \"$$i\" \"`dirname $$i`/`basename $$i .png`.jpg\"\) >> tmp-gimp-command; \ done @for i in */background/*.png ; do \ @@ -30,28 +30,17 @@ install: # GIMP2_DIRECTORY=`pwd`/gimp gimp --console-messages -i -d -b '(begin (gimp-normalize-to-bootsplash-dirs "1.0" "*" "bootsplash/data/*.png") (gimp-quit 1))' # GIMP2_DIRECTORY=`pwd`/gimp gimp --console-messages -i -d -b '(begin (gimp-normalize-to-bootsplash-dirs "1.0" "*" "gfxboot/*.png") (gimp-quit 1))' - mkdir -p $(prefix)$(sharedir)/bootsplash/themes/ - mkdir -p $(prefix)$(configdir)/bootsplash/themes/ mkdir -p $(prefix)/$(sharedir)/mdk/screensaver mkdir -p $(prefix)/$(sharedir)/mdk/backgrounds - mkdir -p $(prefix)$(sharedir)/config/ - mkdir -p $(prefix)$(sharedir)/bootsplash/Mandriva-common/images - install -m 644 common/bootsplash/data/*.jpg $(prefix)$(sharedir)/bootsplash/Mandriva-common/images install -m 644 common/screensaver/*.png $(prefix)$(sharedir)/mdk/screensaver # install -m644 */background/*.jpg $(prefix)$(sharedir)/mdk/backgrounds @for t in $(THEMES); do \ set -x; set -e; \ - install -d $(prefix)$(sharedir)/bootsplash/themes/$$t/images; \ - install -m644 $$t/bootsplash/data/*.jpg $(prefix)$(sharedir)/bootsplash/themes/$$t/images/; \ - install -d $(prefix)/$(configdir)/bootsplash/themes/$$t/config; \ - install -m644 common/bootsplash/config/* $(prefix)$(configdir)/bootsplash/themes/$$t/config/; \ - if [ ! -f $(prefix)$(sharedir)/bootsplash/themes/$$t/images/bootsplash-640x480.jpg ]; then \ - ln -f $(prefix)$(sharedir)/bootsplash/themes/$$t/images/bootsplash-800x600.jpg $(prefix)$(sharedir)/bootsplash/themes/$$t/images/bootsplash-640x480.jpg ; \ - fi; \ - if [ -d $$t/bootsplash/config ]; then \ - install -m644 $$t/bootsplash/config/* $(prefix)$(configdir)/bootsplash/themes/$$t/config/; \ - fi; \ - install -d $(prefix)/$(configdir)/bootsplash/themes/$$t/animations; \ + install -d $(prefix)/$(sharedir)/plymouth/themes/$$t; \ + install -m644 common/plymouth/*.script $(prefix)$(sharedir)/plymouth/themes/$$t/; \ + install -m644 common/plymouth/*.png $(prefix)$(sharedir)/plymouth/themes/$$t/; \ + install -m644 $$t/plymouth/*.plymouth $(prefix)$(sharedir)/plymouth/themes/$$t/; \ + install -m644 $$t/gfxboot/welcome.png $(prefix)/$(sharedir)/plymouth/themes/$$t/welcome.png; \ install -m644 $$t/background/$$t.xml $(prefix)$(sharedir)/mdk/backgrounds/; \ for h in 0000 0700 1300 1800 ; \ do \ @@ -66,38 +55,8 @@ install: do \ [ -e $(prefix)$(sharedir)/mdk/backgrounds/$$t-$$d-1300.jpg ] && ln -f -s $$t-$$d-1300.jpg $(prefix)$(sharedir)/mdk/backgrounds/$$t-$$d.jpg; \ done; \ - source $$t/bootsplash/colors; \ - for d in 640x480 800x600 1024x768 1280x1024 1600x1200; \ - do \ - [ -e $(prefix)$(sharedir)/bootsplash/themes/$$t/images/bootsplash-$$d.jpg ] || continue; \ - W=`echo $$d | sed -e "s/x.*//"` ;\ - H=`echo $$d | sed -e "s/.*x//"` ;\ - ln -f -s bootsplash-$$d.jpg $(prefix)$(sharedir)/bootsplash/themes/$$t/images/silent-$$d.jpg; \ - for v in common/bootsplash/config/*-template.cfg ; do \ - cp -f $$v $(prefix)$(configdir)/bootsplash/themes/$$t/config/`basename $$v -template.cfg`-$$d.cfg ;\ - done; \ - perl -pi -e "s,/\@THEME\@/,/$$t/,; s,\@B1\@,$$B1,g; s,\@B2\@,$$B2,g; s,\@B3\@,$$B3,g;s,\@B4\@,$$B4,g; s/\@HEIGHT\@\*([\d\.]+)/$$H*\$$1/eg ; s/\@WIDTH\@\*([\d\.]+)/$$W*\$$1/eg ; s/\@WIDTH\@(-\d+)?/$$W+\$$1/eg ; s/\@HEIGHT\@(-\d+)?/$$H+\$$1/eg; " $(prefix)$(configdir)/bootsplash/themes/$$t/config/*-$$d.cfg; \ - for v in 1 2 3 4 5 6; \ - do \ - ln -f -s vt0-$$d.cfg $(prefix)$(configdir)/bootsplash/themes/$$t/config/vt$$v-$$d.cfg; \ - done; \ - install -d $(prefix)/$(sharedir)/splashy/themes/$$t-$$d; \ - cp -fal $(prefix)$(sharedir)/bootsplash/themes/$$t/images/bootsplash-$$d.jpg $(prefix)/$(sharedir)/splashy/themes/$$t-$$d/background.jpg; \ - if [ -e $(prefix)$(sharedir)/bootsplash/Mandriva-common/images/hibernate-$$d.jpg ]; then \ - cp -fal $(prefix)$(sharedir)/bootsplash/Mandriva-common/images/hibernate-$$d.jpg $(prefix)/$(sharedir)/splashy/themes/$$t-$$d/suspend.jpg; \ - fi; \ - ln -sf ../default/FreeSans.ttf $(prefix)/$(sharedir)/splashy/themes/$$t-$$d; \ - if [ -e $$t/bootsplash/theme.xml ]; then \ - perl -pe "s,\@THEME\@,$$t,g" $$t/bootsplash/theme.xml > $(prefix)/$(sharedir)/splashy/themes/$$t-$$d/theme.xml; \ - else \ - perl -pe "s,\@THEME\@,$$t,g" common/bootsplash/theme.xml > $(prefix)/$(sharedir)/splashy/themes/$$t-$$d/theme.xml; \ - fi;\ - done; \ - rm -f $(prefix)$(configdir)/bootsplash/themes/$$t/config/*template.cfg ; \ - chmod 644 $(prefix)$(configdir)/bootsplash/themes/$$t/config/*.cfg; \ install -d $(prefix)$(sharedir)/gfxboot/themes/$$t; \ install -m644 $$t/gfxboot/*.jpg $(prefix)$(sharedir)/gfxboot/themes/$$t/; \ - install -m644 /usr/share/fonts/TTF/dejavu/DejaVuSans.ttf $(prefix)$(configdir)/bootsplash/luxisri.ttf; \ done changelog: diff --git a/Mandriva-Flash/plymouth/Mandriva-Flash.plymouth b/Mandriva-Flash/plymouth/Mandriva-Flash.plymouth new file mode 100644 index 0000000..ce0a3b3 --- /dev/null +++ b/Mandriva-Flash/plymouth/Mandriva-Flash.plymouth @@ -0,0 +1,8 @@ +[Plymouth Theme] +Name=Mandriva Flash theme +Description=Mandriva Flash theme +ModuleName=script + +[script] +ImageDir=/usr/share/plymouth/themes/mandriva-flash +ScriptFile=/usr/share/plymouth/themes/mandriva-flash/mdv.script diff --git a/Mandriva-Free/plymouth/Mandriva-Free.plymouth b/Mandriva-Free/plymouth/Mandriva-Free.plymouth new file mode 100644 index 0000000..26d2cf8 --- /dev/null +++ b/Mandriva-Free/plymouth/Mandriva-Free.plymouth @@ -0,0 +1,8 @@ +[Plymouth Theme] +Name=Mandriva Free theme +Description=Mandriva Free theme +ModuleName=script + +[script] +ImageDir=/usr/share/plymouth/themes/mandriva-free +ScriptFile=/usr/share/plymouth/themes/mandriva-free/mdv.script diff --git a/Mandriva-One/plymouth/Mandriva-One.plymouth b/Mandriva-One/plymouth/Mandriva-One.plymouth new file mode 100644 index 0000000..6012151 --- /dev/null +++ b/Mandriva-One/plymouth/Mandriva-One.plymouth @@ -0,0 +1,8 @@ +[Plymouth Theme] +Name=Mandriva One theme +Description=Mandriva One theme +ModuleName=script + +[script] +ImageDir=/usr/share/plymouth/themes/mandriva-one +ScriptFile=/usr/share/plymouth/themes/mandriva-one/mdv.script diff --git a/Mandriva-Powerpack/plymouth/Mandriva-Powerpack.plymouth b/Mandriva-Powerpack/plymouth/Mandriva-Powerpack.plymouth new file mode 100644 index 0000000..9efc5f4 --- /dev/null +++ b/Mandriva-Powerpack/plymouth/Mandriva-Powerpack.plymouth @@ -0,0 +1,8 @@ +[Plymouth Theme] +Name=Mandriva Powerpack theme +Description=Mandriva Powerpack theme +ModuleName=script + +[script] +ImageDir=/usr/share/plymouth/themes/mandriva-powerpack +ScriptFile=/usr/share/plymouth/themes/mandriva-powerpack/mdv.script diff --git a/common/plymouth/box.png b/common/plymouth/box.png new file mode 100644 index 0000000..45ee75d Binary files /dev/null and b/common/plymouth/box.png differ diff --git a/common/plymouth/bullet.png b/common/plymouth/bullet.png new file mode 100644 index 0000000..45ee75d Binary files /dev/null and b/common/plymouth/bullet.png differ diff --git a/common/plymouth/entry.png b/common/plymouth/entry.png new file mode 100644 index 0000000..45ee75d Binary files /dev/null and b/common/plymouth/entry.png differ diff --git a/common/plymouth/lock.png b/common/plymouth/lock.png new file mode 100644 index 0000000..45ee75d Binary files /dev/null and b/common/plymouth/lock.png differ diff --git a/common/plymouth/logo.png b/common/plymouth/logo.png new file mode 100644 index 0000000..45ee75d Binary files /dev/null and b/common/plymouth/logo.png differ diff --git a/common/plymouth/mdv.script b/common/plymouth/mdv.script new file mode 100644 index 0000000..e330dc7 --- /dev/null +++ b/common/plymouth/mdv.script @@ -0,0 +1,196 @@ +# Mdv splashy like theme + + +if (PlymouthGetMode() == "suspend" || PlymouthGetMode() == "resume") { + background.original_image = ImageNew("suspend.png"); + SpriteWindowSetBackgroundTopColor(1, 0, 0); + SpriteWindowSetBackgroundBottomColor(0, 1, 0); +} +else { + logo.original_image = ImageNew("logo.png"); + background.original_image = ImageNew("welcome.png"); + SpriteWindowSetBackgroundTopColor(0.234, 0.43, 0.705); + SpriteWindowSetBackgroundBottomColor(0.16, 0.25, 0.44); +} + +ratio = ImageGetWidth(logo.original_image) / ImageGetHeight(logo.original_image); +reduction = 0.4; +logo.image = ImageScale(logo.original_image, reduction * SpriteWindowGetWidth() , reduction / ratio * SpriteWindowGetWidth()); +logo.sprite = SpriteNew(); +SpriteSetImage(logo.sprite, logo.image); +logo.opacity_angle = 0; +SpriteSetX (logo.sprite, ( SpriteWindowGetWidth() - ImageGetWidth(logo.image)) / 2); +SpriteSetY (logo.sprite, 50); + +background.image = ImageScale (background.original_image, SpriteWindowGetWidth() , SpriteWindowGetHeight()); +background.sprite = SpriteNew(); +SpriteSetImage(background.sprite, background.image); +SpriteSetPosition (background.sprite, 0, 0, -10); + +sprite_prompt = SpriteNew(); + + +fun refresh_callback () + { + + if (status == "normal") + { + logo.opacity_angle += ((2 * 3.14) / 50) * 0.5; # 0.5 HZ + min_opacity = 0.3; + opacity = (MathCos(logo.opacity_angle) + 1) / 2; + opacity *= 1 - min_opacity; + opacity += min_opacity; + SpriteSetOpacity (logo.sprite, opacity); + } + else + { + SpriteSetOpacity (logo.sprite, 1); + } + } + +PlymouthSetRefreshFunction (refresh_callback); + +#----------------------------------------- Dialogue -------------------------------- + +status = "normal"; + +fun dialog_setup() + { + local.box; + local.lock; + local.entry; + local.prompt_sprite; + + box.image = ImageNew("box.png"); + lock.image = ImageNew("lock.png"); + entry.image = ImageNew("entry.png"); + + box.sprite = SpriteNew(); + SpriteSetImage(box.sprite, box.image); + box.x = SpriteWindowGetWidth() / 2 - ImageGetWidth (box.image)/2; + box.y = SpriteWindowGetHeight() / 2 - ImageGetHeight(box.image)/2; + box.z = 10000; + SpriteSetPosition(box.sprite, box.x, box.y, box.z); + + lock.sprite = SpriteNew(); + SpriteSetImage(lock.sprite, lock.image); + lock.x = box.x + ImageGetWidth(box.image)/2 - (ImageGetWidth(lock.image) + ImageGetWidth(entry.image)) / 2; + lock.y = box.y + ImageGetHeight(box.image)/2 - ImageGetHeight(lock.image)/2; + lock.z = box.z + 1; + SpriteSetPosition(lock.sprite, lock.x, lock.y, lock.z); + + entry.sprite = SpriteNew(); + SpriteSetImage(entry.sprite, entry.image); + entry.x = lock.x + ImageGetWidth(lock.image); + entry.y = box.y + ImageGetHeight(box.image)/2 - ImageGetHeight(entry.image)/2; + entry.z = box.z + 1; + SpriteSetPosition(entry.sprite, entry.x, entry.y, entry.z); + + prompt_sprite = SpriteNew(); + SpriteSetPosition(prompt_sprite, box.x, box.y - 20, box.z); + + global.dialog.box = box; + global.dialog.lock = lock; + global.dialog.entry = entry; + global.dialog.bullet_image = ImageNew("bullet.png"); + global.dialog.prompt_sprite = prompt_sprite; + dialog_opacity (1); + } + +fun dialog_opacity(opacity) + { + SpriteSetOpacity (dialog.box.sprite, opacity); + SpriteSetOpacity (dialog.lock.sprite, opacity); + SpriteSetOpacity (dialog.entry.sprite, opacity); + SpriteSetOpacity (dialog.prompt_sprite, opacity); + for (index = 0; dialog.bullet[index]; index++) + { + SpriteSetOpacity(dialog.bullet[index].sprite, 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); + logo.opacity_angle=0; + SpriteSetOpacity(logo.sprite, 1); + SpriteSetImage(dialog.prompt_sprite, ImageText(prompt, 1.0, 1.0, 1.0)); + for (index = 0; dialog.bullet[index] || index < bullets; index++) + { + + if (!dialog.bullet[index]) + { + dialog.bullet[index].sprite = SpriteNew(); + SpriteSetImage(dialog.bullet[index].sprite, dialog.bullet_image); + dialog.bullet[index].x = dialog.entry.x + index * ImageGetWidth(dialog.bullet_image); + dialog.bullet[index].y = dialog.entry.y + ImageGetHeight(dialog.entry.image) / 2 - ImageGetHeight(dialog.bullet_image) / 2; + dialog.bullet[index].z = dialog.entry.z + 1; + SpriteSetPosition(dialog.bullet[index].sprite, dialog.bullet[index].x, dialog.bullet[index].y, dialog.bullet[index].z); + } + if (index < bullets) + SpriteSetOpacity(dialog.bullet[index].sprite, 1); + else + SpriteSetOpacity(dialog.bullet[index].sprite, 0); + } + } + +fun display_message_callback (prompt) + { + +prompt = ImageText(prompt,1.0, 1.0, 1.0); +SpriteSetImage(sprite_prompt, prompt); +SpriteSetPosition(sprite_prompt, (SpriteWindowGetWidth() - ImageGetWidth(prompt)) / 2, SpriteWindowGetHeight() * 0.89, 2); + } + +PlymouthSetDisplayNormalFunction(display_normal_callback); +PlymouthSetDisplayPasswordFunction(display_password_callback); +PlymouthSetMessageFunction(display_message_callback); + +#----------------------------------------- Progress Bar -------------------------------- + + +progress_box.original_image = ImageNew("progress_box_background.png"); +progress_box.image = ImageScale(progress_box.original_image, SpriteWindowGetWidth() * 0.44, ImageGetHeight(progress_box.original_image)); +progress_box.edge = ImageNew("progress_box_edge.png"); +progress_box.left_edge_sprite = SpriteNew(); +progress_box.right_edge_sprite = SpriteNew(); +progress_box.sprite = SpriteNew(); +SpriteSetImage(progress_box.sprite, progress_box.image); +SpriteSetImage(progress_box.left_edge_sprite, progress_box.edge); +SpriteSetImage(progress_box.right_edge_sprite, progress_box.edge); + +progress_box.x = SpriteWindowGetWidth() / 2 - ImageGetWidth(progress_box.image) / 2; +progress_box.y = SpriteWindowGetHeight() * 0.86 - ImageGetHeight(progress_box.image) / 2; + +SpriteSetPosition(progress_box.sprite, progress_box.x, progress_box.y, 0); +SpriteSetPosition(progress_box.left_edge_sprite, progress_box.x-1, progress_box.y, 0); +SpriteSetPosition(progress_box.right_edge_sprite, progress_box.x + ImageGetWidth(progress_box.image) , progress_box.y, 0); + + +progress_bar.original_image = ImageNew("progress_bar.png"); +progress_bar.sprite = SpriteNew(); + +SpriteSetPosition(progress_bar.sprite, progress_box.x + 1, progress_box.y + 2, 1); + +fun progress_callback (duration, progress) + { + new_width = (ImageGetWidth (progress_box.image) - 2) * progress; + if (ImageGetWidth (progress_bar.image) != MathInt (new_width)) + { + progress_bar.image = ImageScale(progress_bar.original_image, new_width, ImageGetHeight(progress_bar.original_image)); + SpriteSetImage (progress_bar.sprite, progress_bar.image); + } + } + +PlymouthSetBootProgressFunction(progress_callback); diff --git a/common/plymouth/progress_bar.png b/common/plymouth/progress_bar.png new file mode 100644 index 0000000..45ee75d Binary files /dev/null and b/common/plymouth/progress_bar.png differ diff --git a/common/plymouth/progress_box.png b/common/plymouth/progress_box.png new file mode 100644 index 0000000..45ee75d Binary files /dev/null and b/common/plymouth/progress_box.png differ diff --git a/common/plymouth/progress_box_background.png b/common/plymouth/progress_box_background.png new file mode 100644 index 0000000..45ee75d Binary files /dev/null and b/common/plymouth/progress_box_background.png differ diff --git a/common/plymouth/progress_box_edge.png b/common/plymouth/progress_box_edge.png new file mode 100644 index 0000000..45ee75d Binary files /dev/null and b/common/plymouth/progress_box_edge.png differ diff --git a/common/plymouth/suspend.png b/common/plymouth/suspend.png new file mode 100644 index 0000000..45ee75d Binary files /dev/null and b/common/plymouth/suspend.png differ -- cgit v1.2.1