Updated: Plymouth
Signed-off-by: debianpepper <pdpdebdevuan@protonmail.com>
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 4.5 KiB |
|
@ -0,0 +1,8 @@
|
|||
[Plymouth Theme]
|
||||
Name=Joy, the default Debian 7.0 (Wheezy) theme
|
||||
Description=A theme that features a blank background with a logo.
|
||||
ModuleName=script
|
||||
|
||||
[script]
|
||||
ImageDir=/usr/share/plymouth/themes/joy
|
||||
ScriptFile=/usr/share/plymouth/themes/joy/joy.script
|
453
iso_configs/plymouth/lines/lines.script → iso_configs/plymouth/lines/joy.script
Normal file → Executable file
|
@ -1,8 +1,8 @@
|
|||
# lines.script - boot splash using script plugin
|
||||
# ubuntu-logo.script - boot splash plugin
|
||||
#
|
||||
# Copyright (C) 2009 Canonical Ltd.
|
||||
# Copyright © 2010-2014 Aurélien Couderc <coucouf@debian.org>
|
||||
# Copyright © 2014 Juliette Taka <juliette.belin@logilab.fr>
|
||||
# Copyright © 2010 Aurélien Couderc <coucouf@debian.org>
|
||||
# Copyright © 2012 Jonathan Carter <jcc@debian.org>
|
||||
#
|
||||
# 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
|
||||
|
@ -17,7 +17,6 @@
|
|||
# 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.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
#
|
||||
# Written by: Alberto Milone <alberto.milone@canonical.com>
|
||||
#
|
||||
|
@ -25,21 +24,8 @@
|
|||
# Charlie Brej <cbrej@cs.man.ac.uk>
|
||||
#
|
||||
|
||||
|
||||
#------------------------------- Constants -----------------------------------------
|
||||
ELECTRONS_DISPLAYED = 3;
|
||||
SECS_BETWEEN_ANIMS = 2.5;
|
||||
|
||||
#------------------------------- Globals -------------------------------------------
|
||||
# are we currently prompting for a password?
|
||||
prompt_active = 0;
|
||||
|
||||
anim_iter = 0;
|
||||
anim_status = "stopped";
|
||||
|
||||
|
||||
#------------------------------- Background ----------------------------------------
|
||||
bg_image = Image("background.png");
|
||||
|
||||
# Compute screen/image ratio and scale the background accordingly
|
||||
window_max_width = Window.GetX() * 2 + Window.GetWidth();
|
||||
window_max_height = Window.GetY() * 2 + Window.GetHeight();
|
||||
|
@ -58,101 +44,17 @@ bg_sprite.SetPosition(Window.GetX() + Window.GetWidth() / 2 - scaled_bg_image.Ge
|
|||
Window.GetY() + Window.GetHeight() / 2 - scaled_bg_image.GetHeight() / 2,
|
||||
-10000);
|
||||
|
||||
#------------------------------- Logo ----------------------------------------------
|
||||
logo_image = Image("logo.png");
|
||||
logo_height = Math.Min(Window.GetWidth(), Window.GetHeight()) * 0.7;
|
||||
logo_scale_factor = logo_height / logo_image.GetHeight();
|
||||
logo_image = logo_image.Scale(logo_image.GetWidth() * logo_scale_factor,
|
||||
logo_image.GetHeight() * logo_scale_factor);
|
||||
logo_sprite = Sprite(logo_image);
|
||||
logo_to_top_edge = Window.GetHeight() * 0;
|
||||
logo_right_shift = logo_image.GetWidth() * 0.092;
|
||||
logo_sprite.SetPosition(Window.GetX() + Window.GetWidth() / 2 - logo_image.GetWidth() / 2 + logo_right_shift,
|
||||
Window.GetY() + logo_to_top_edge,
|
||||
-100);
|
||||
|
||||
#------------------------------- Debian ----------------------------------------------
|
||||
debian_image = Image("debian.png");
|
||||
debian_width = logo_image.GetWidth();
|
||||
debian_scale_factor = debian_width / debian_image.GetWidth() * 0.24;
|
||||
if (debian_scale_factor < 1) {
|
||||
debian_image = debian_image.Scale(debian_image.GetWidth() * debian_scale_factor,
|
||||
debian_image.GetHeight() * debian_scale_factor);
|
||||
}
|
||||
debian_sprite = Sprite(debian_image);
|
||||
debian_to_bottom_edge = Window.GetHeight() * 0.10;
|
||||
debian_sprite.SetPosition(Window.GetX() + Window.GetWidth() / 2 - debian_image.GetWidth() / 2,
|
||||
Window.GetY() + Window.GetHeight() - debian_to_bottom_edge - debian_image.GetHeight(),
|
||||
-90);
|
||||
#------------------------------- Electrons --------------------------------------------
|
||||
|
||||
electron_image = Image("electron.png");
|
||||
electron_image = electron_image.Scale(
|
||||
electron_image.GetWidth() * 0.06 * logo_scale_factor,
|
||||
electron_image.GetHeight() * 0.06 * logo_scale_factor);
|
||||
|
||||
|
||||
#main center coords
|
||||
ellipses[0].x = logo_sprite.GetX() + logo_image.GetWidth() * 0.4245;
|
||||
ellipses[0].y = logo_sprite.GetY() + logo_image.GetHeight() * 0.611;
|
||||
#main small / large axis
|
||||
ellipses[0].height = logo_image.GetHeight() * 0.3303;
|
||||
ellipses[0].width = logo_image.GetWidth() * 0.295;
|
||||
#main animation parameters
|
||||
ellipses[0].anim.start_iter = 0;
|
||||
ellipses[0].anim.stop_iter = 150;
|
||||
ellipses[0].anim.start_angle = Math.Pi;
|
||||
ellipses[0].anim.arc = 2*Math.Pi;
|
||||
ellipses[0].anim.rotat_dir = -1;
|
||||
|
||||
#left center coords
|
||||
ellipses[1].x = logo_sprite.GetX() + logo_image.GetWidth() * 0.3825;
|
||||
ellipses[1].y = logo_sprite.GetY() + logo_image.GetHeight() * 0.411;
|
||||
#left small / large axis
|
||||
ellipses[1].height = logo_image.GetHeight() * 0.1645;
|
||||
ellipses[1].width = logo_image.GetWidth() * 0.2248;
|
||||
#left animation parameters
|
||||
ellipses[1].anim.start_iter = 50;
|
||||
ellipses[1].anim.stop_iter = 130;
|
||||
ellipses[1].anim.start_angle = 0;
|
||||
ellipses[1].anim.arc = 2*Math.Pi;
|
||||
ellipses[1].anim.rotat_dir = 1;
|
||||
|
||||
#right center coords
|
||||
ellipses[2].x = logo_sprite.GetX() + logo_image.GetWidth() * 0.7065;
|
||||
ellipses[2].y = logo_sprite.GetY() + logo_image.GetHeight() * 0.460;
|
||||
#right small / large axis
|
||||
ellipses[2].height = logo_image.GetHeight() * 0.2343;
|
||||
ellipses[2].width = logo_image.GetWidth() * 0.2945;
|
||||
#right animation parameters
|
||||
ellipses[2].anim.start_iter = 20;
|
||||
ellipses[2].anim.stop_iter = 100;
|
||||
ellipses[2].anim.start_angle = 0;
|
||||
ellipses[2].anim.arc = 2*Math.Pi;
|
||||
ellipses[2].anim.rotat_dir = 1;
|
||||
|
||||
# Define 5 sprites for each electron to create gradient along the ellipses
|
||||
for (i = 0; i < ELECTRONS_DISPLAYED; i++) {
|
||||
anim = ellipses[i].anim;
|
||||
anim.angle_incr = anim.arc / (anim.stop_iter - anim.start_iter) * anim.rotat_dir;
|
||||
for (j = 0; j < 5; j++) {
|
||||
electron_sprite[i][j] = Sprite(electron_image);
|
||||
electron_sprite[i][j].SetOpacity(0);
|
||||
electron_sprite[i][j].base_opacity = 1-(0.2*j);
|
||||
electron_sprite[i][j].angle_diff = -(anim.rotat_dir*j*0.01);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Set the text colour in (rgb / 256)
|
||||
text_colour.red = 1.0;
|
||||
text_colour.green = 1.0;
|
||||
text_colour.blue = 1.0;
|
||||
text_colour.red = 0.0;
|
||||
text_colour.green = 0.0;
|
||||
text_colour.blue = 0.0;
|
||||
|
||||
# Tinted text #988592
|
||||
tinted_text_colour.red = 1.0;
|
||||
tinted_text_colour.green = 1.0;
|
||||
tinted_text_colour.blue = 1.0;
|
||||
tinted_text_colour.red = 0.0;
|
||||
tinted_text_colour.green = 0.0;
|
||||
tinted_text_colour.blue = 0.0;
|
||||
|
||||
# Action Text - #ffffff - RGB 255 255 255
|
||||
action_text_colour.red = 1.0;
|
||||
|
@ -162,9 +64,10 @@ action_text_colour.blue = 1.0;
|
|||
# Orange - #ff4012 - RGB 255 64 18
|
||||
debugsprite = Sprite();
|
||||
debugsprite_bottom = Sprite();
|
||||
debugsprite_bottom.SetPosition(0, (Window.GetHeight (0) - 20), 1);
|
||||
debugsprite_medium = Sprite();
|
||||
debugsprite_medium.SetPosition(0, (Window.GetHeight (0) - 100), 1);
|
||||
|
||||
# are we currently prompting for a password?
|
||||
prompt_active = 0;
|
||||
|
||||
# General purpose function to create text
|
||||
fun WriteText (text, colour) {
|
||||
|
@ -172,31 +75,33 @@ fun WriteText (text, colour) {
|
|||
return image;
|
||||
}
|
||||
|
||||
fun ImageFromText (text) {
|
||||
fun ImageToText (text) {
|
||||
image = WriteText (text, text_colour);
|
||||
return image;
|
||||
}
|
||||
|
||||
fun ImageFromTintedText (text) {
|
||||
fun ImageToTintedText (text) {
|
||||
image = WriteText (text, tinted_text_colour);
|
||||
return image;
|
||||
}
|
||||
|
||||
fun ImageFromActionText (text) {
|
||||
fun ImageToActionText (text) {
|
||||
image = WriteText (text, action_text_colour);
|
||||
return image;
|
||||
}
|
||||
|
||||
fun Debug(text) {
|
||||
debugsprite.SetImage(ImageFromText (text));
|
||||
debugsprite.SetImage(ImageToText (text));
|
||||
}
|
||||
|
||||
fun DebugBottom(text) {
|
||||
debugsprite_bottom.SetImage(ImageFromText (text));
|
||||
debugsprite_bottom.SetImage(ImageToText (text));
|
||||
debugsprite_bottom.SetPosition(0, (Window.GetHeight (0) - 20), 1);
|
||||
}
|
||||
|
||||
fun DebugMedium(text) {
|
||||
debugsprite_medium.SetImage(ImageFromText (text));
|
||||
debugsprite_medium.SetImage(ImageToText (text));
|
||||
debugsprite_medium.SetPosition(0, (Window.GetHeight (0) - 60), 1);
|
||||
}
|
||||
|
||||
fun TextYOffset() {
|
||||
|
@ -205,8 +110,7 @@ fun TextYOffset() {
|
|||
local.min_height;
|
||||
|
||||
# Put the 1st line below the logo + some spacing
|
||||
y = logo_sprite.GetY() + logo_image.GetHeight();
|
||||
#Debug("y = " + y);
|
||||
y = logo.y + logo.height + (progress_indicator.bullet_height * 7 ); # + logo_spacing;
|
||||
|
||||
text_height = first_line_height * 7.5;
|
||||
|
||||
|
@ -214,10 +118,8 @@ fun TextYOffset() {
|
|||
if (y + text_height > min_height)
|
||||
y = min_height - text_height;
|
||||
|
||||
# Ensure we don’t bump into the Debian image.
|
||||
# The approx height of the 3 text lines + password input is 140 px.
|
||||
y = Math.Min(y, debian_sprite.GetY() - 140);
|
||||
|
||||
if (y < progress_indicator.y + progress_indicator.height)
|
||||
return progress_indicator.y + progress_indicator.height;
|
||||
return y;
|
||||
}
|
||||
|
||||
|
@ -279,40 +181,65 @@ fun StringToInteger (str) {
|
|||
}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Top background colour
|
||||
# #489291 --> 0.282, 0.572, 0.569
|
||||
# Previous background colour
|
||||
# #300a24 --> 0.19, 0.04, 0.14
|
||||
# New background colour
|
||||
# #0a3649 --> 0.039, 0.212, 0.286
|
||||
# #2c001e --> 0.16, 0.00, 0.12
|
||||
#
|
||||
Window.SetBackgroundTopColor (0.282, 0.572, 0.569); # Nice colour on top of the screen fading to
|
||||
Window.SetBackgroundBottomColor (0.039, 0.212, 0.286); # an equally nice colour on the bottom
|
||||
Window.SetBackgroundTopColor (0.39, 0.43, 0.51); # Nice colour on top of the screen fading to
|
||||
Window.SetBackgroundBottomColor (0.39, 0.43, 0.51); # an equally nice colour on the bottom
|
||||
|
||||
bits_per_pixel = Window.GetBitsPerPixel ();
|
||||
# TODO need to handle 16 colors ?
|
||||
#if (bits_per_pixel == 4) {
|
||||
# logo_filename = "debian_logo16.png";
|
||||
# progress_dot_off_filename = "progress_dot_off16.png";
|
||||
# progress_dot_on_filename = "progress_dot_on16.png";
|
||||
# password_dot_filename = "password_dot.png";
|
||||
# password_field_filename = "password_field16.png";
|
||||
#} else {
|
||||
# logo_filename = "debian_logo.png";
|
||||
# progress_dot_off_filename = "progress_dot_off.png";
|
||||
# progress_dot_on_filename = "progress_dot_on.png";
|
||||
if (bits_per_pixel == 4) {
|
||||
logo_filename = "debian_logo16.png";
|
||||
progress_dot_off_filename = "progress_dot_off16.png";
|
||||
progress_dot_on_filename = "progress_dot_on16.png";
|
||||
password_dot_filename = "password_dot.png";
|
||||
password_field_filename = "password_field16.png";
|
||||
} else {
|
||||
logo_filename = "debian_logo.png";
|
||||
progress_dot_off_filename = "progress_dot_off.png";
|
||||
progress_dot_on_filename = "progress_dot_on.png";
|
||||
password_dot_filename = "password_dot.png";
|
||||
password_field_filename = "password_field.png";
|
||||
#}
|
||||
}
|
||||
|
||||
message_notification[0].image = ImageFromTintedText ("");
|
||||
message_notification[1].image = ImageFromTintedText ("");
|
||||
fsck_notification.image = ImageFromActionText ("");
|
||||
logo.image = Image (logo_filename);
|
||||
logo.sprite = Sprite ();
|
||||
logo.sprite.SetImage (logo.image);
|
||||
logo.width = logo.image.GetWidth ();
|
||||
logo.height = logo.image.GetHeight ();
|
||||
logo.x = Window.GetX () + Window.GetWidth () / 2 - logo.width / 2;
|
||||
logo.y = Window.GetY () + Window.GetHeight () / 2 - logo.height;
|
||||
logo.z = 1000;
|
||||
logo.sprite.SetX (logo.x);
|
||||
logo.sprite.SetY (logo.y);
|
||||
logo.sprite.SetZ (logo.z);
|
||||
logo.sprite.SetOpacity (1);
|
||||
|
||||
# Spacing below the logo - in pixels
|
||||
logo_spacing = logo.height * 4;
|
||||
|
||||
message_notification[0].image = ImageToTintedText ("");
|
||||
message_notification[1].image = ImageToTintedText ("");
|
||||
fsck_notification.image = ImageToActionText ("");
|
||||
|
||||
status = "normal";
|
||||
|
||||
progress_indicator.bullet_off = Image (progress_dot_off_filename);
|
||||
progress_indicator.bullet_on = Image (progress_dot_on_filename);
|
||||
progress_indicator.bullet_width = progress_indicator.bullet_off.GetWidth ();
|
||||
progress_indicator.bullet_height = progress_indicator.bullet_off.GetHeight ();
|
||||
progress_indicator.bullet_hspacing = progress_indicator.bullet_width * 1.1;
|
||||
progress_indicator.width = progress_indicator.bullet_width * 5;
|
||||
progress_indicator.height = progress_indicator.bullet_height;
|
||||
progress_indicator.y = logo.y + logo.height + (logo.height / 4);
|
||||
progress_indicator.x = Window.GetX () + Window.GetWidth () / 2 - progress_indicator.width / 2; # logo.x + 26;
|
||||
|
||||
# use a fixed string with ascending and descending stems to calibrate the
|
||||
# bounding box for the first message, so the messages below don't move up
|
||||
# and down according to *their* height.
|
||||
first_line_height = ImageFromTintedText ("AfpqtM").GetHeight();
|
||||
first_line_height = ImageToTintedText ("AfpqtM").GetHeight();
|
||||
|
||||
# if the user has a 640x480 or 800x600 display, we can't quite fit everything
|
||||
# (including passphrase prompts) with the target spacing, so scoot the text up
|
||||
|
@ -323,25 +250,135 @@ top_of_the_text = TextYOffset();
|
|||
|
||||
# Call this when updating the screen
|
||||
fun draw_logo () {
|
||||
# logo.sprite.SetX (logo.x);
|
||||
# logo.sprite.SetY (logo.y);
|
||||
# logo.sprite.SetZ (logo.z);
|
||||
# logo.sprite.SetOpacity (1);
|
||||
# logo_sprite.SetOpacity (1);
|
||||
logo.sprite.SetX (logo.x);
|
||||
logo.sprite.SetY (logo.y);
|
||||
logo.sprite.SetZ (logo.z);
|
||||
logo.sprite.SetOpacity (1);
|
||||
}
|
||||
|
||||
|
||||
#-----------------------------------------Progress Indicator--------------------------
|
||||
fun set_progress_indicator () {
|
||||
|
||||
|
||||
# Here we assume that we can store half bullets on each half of the screen
|
||||
# together with some spacing
|
||||
local.x = progress_indicator.x;
|
||||
|
||||
for (index = 0; index <= 4; index++) {
|
||||
# Set the "off" bullets
|
||||
progress_indicator.bullets_off[index].sprite = Sprite (progress_indicator.bullet_off);
|
||||
progress_indicator.bullets_off[index].sprite.SetPosition (local.x, progress_indicator.y, 1000);
|
||||
progress_indicator.bullets_off[index].x = local.x;
|
||||
progress_indicator.bullets_off[index].y = progress_indicator.y;
|
||||
progress_indicator.bullets_off[index].sprite.SetOpacity (1);
|
||||
|
||||
#local.debug_medium_string = "Progress indicator " + index + ": x = " + progress_indicator.bullets_off[index].x +
|
||||
# ", y = " + progress_indicator.bullets_off[index].y + ", logo width = " + logo.width +
|
||||
# ", logo height = " + logo.height + " " + screen_width + " " + screen_height;
|
||||
#
|
||||
#(index % 2) && DebugMedium (local.debug_medium_string) || DebugBottom (local.debug_medium_string);
|
||||
|
||||
# Set the "on" bullets on top of the "off" bullets and make them transparent
|
||||
progress_indicator.bullets_on[index].sprite = Sprite (progress_indicator.bullet_on);
|
||||
progress_indicator.bullets_on[index].x = progress_indicator.bullets_off[index].x;
|
||||
progress_indicator.bullets_on[index].y = progress_indicator.bullets_off[index].y;
|
||||
progress_indicator.bullets_on[index].sprite.SetPosition (progress_indicator.bullets_on[index].x, progress_indicator.bullets_on[index].y, 10000);
|
||||
|
||||
progress_indicator.bullets_on[index].sprite.SetOpacity (0);
|
||||
|
||||
local.x += progress_indicator.bullet_hspacing;
|
||||
}
|
||||
#local.debug_string = "Progress indicator: x1 = " + progress_indicator.x + ", x2 = " + local.x + ", y = " + progress_indicator.y +
|
||||
# ", x logo = " + logo.x + ", y logo = " + logo.y + ", indicator width = " + progress_indicator.width;
|
||||
#Debug(progress_indicator.bullets_off[0].x);
|
||||
}
|
||||
|
||||
|
||||
# We have 2 bullets, one on top of the other:
|
||||
# The white one is on top of the red one and the former should
|
||||
# slowly fade so as to get a nice transition effect.
|
||||
fun switch_on_bullet (bullets_off, bullets_on, bullet_number, opacity) {
|
||||
local.x = bullets_on[bullet_number].x;
|
||||
local.y = bullets_on[bullet_number].y;
|
||||
local.z = bullets_on[bullet_number].z;
|
||||
|
||||
# Hide the bullets which are off
|
||||
bullets_off[bullet_number].sprite.SetOpacity (0);
|
||||
|
||||
# Show the bullets which are on
|
||||
bullets_on[bullet_number].sprite.SetPosition (local.x, local.y, local.z);
|
||||
bullets_on[bullet_number].sprite.SetOpacity (opacity);
|
||||
|
||||
# Bump the number of times we have switched on bullets
|
||||
global.times_bullets_switched++;
|
||||
}
|
||||
|
||||
fun switch_off_bullets () {
|
||||
# Debug("Switching off progress indicator");
|
||||
|
||||
set_progress_indicator ();
|
||||
global.times_bullets_switched = 0;
|
||||
global.on_off = 1;
|
||||
}
|
||||
|
||||
# This is something that we can call when we exit
|
||||
fun switch_on_bullets () {
|
||||
# Debug("Switching off progress indicator");
|
||||
if (!global.progress_indicator.bullets_on) set_progress_indicator ();
|
||||
local = global.progress_indicator;
|
||||
|
||||
for (index = 0; bullets_on[index]; index++) {
|
||||
switch_on_bullet (bullets_off, bullets_on, index, 1.0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Implement in boot progress callback
|
||||
fun animate_progress_indicator (time, progress) {
|
||||
# Start electrons animation at launch and every 3 seconds
|
||||
if (global.progress_time == NULL || (time - global.progress_time) >= SECS_BETWEEN_ANIMS) {
|
||||
global.progress_time = time;
|
||||
global.anim_status = "start";
|
||||
fun animate_progress_indicator (progress, time) {
|
||||
if (global.progress_time == NULL) {
|
||||
global.progress_time = progress; #time;
|
||||
switch_off_bullets ();
|
||||
}
|
||||
|
||||
#Debug ("global progress time =" + global.progress_time + " global anim status = " + global.anim_status + " progress = " + progress + ", time = " + time);
|
||||
# Debug ("progress = " + progress + ", time = " + time + " times switched = " + global.times_bullets_switched + " on_off " + global.on_off);
|
||||
|
||||
# if (global.times_bullets_switched == NULL)
|
||||
# global.times_bullets_switched = 5;
|
||||
|
||||
# if (global.on_off == NULL)
|
||||
# global.on_off = 0;
|
||||
|
||||
if ((progress - global.progress_time) >= 1.0) {
|
||||
global.progress_time = progress;
|
||||
|
||||
if (global.times_bullets_switched == 5) {
|
||||
# Change which bullets are switched on
|
||||
# and which ones are switched off
|
||||
global.on_off = !global.on_off;
|
||||
global.times_bullets_switched = 0;
|
||||
}
|
||||
|
||||
if (global.on_off) {
|
||||
switch_on_bullet (progress_indicator.bullets_off, progress_indicator.bullets_on,
|
||||
global.times_bullets_switched, 1.0);
|
||||
}
|
||||
else {
|
||||
switch_on_bullet (progress_indicator.bullets_on, progress_indicator.bullets_off,
|
||||
global.times_bullets_switched, 1.0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Start setting bullets to "on" with translucency
|
||||
# for (index = 0; index <= 5; index++) {
|
||||
# opacity = 0.0;
|
||||
# while (opacity <= 1.0) {
|
||||
# switch_on_bullet (progress_indicator.bullets_off, progress_indicator.bullets_on,
|
||||
# index, opacity);
|
||||
# opacity += 0.1;
|
||||
# }
|
||||
# }
|
||||
}
|
||||
|
||||
|
||||
|
@ -352,15 +389,15 @@ fun animate_progress_indicator (time, progress) {
|
|||
# message_label array
|
||||
#
|
||||
fun get_message_label (label, is_fake, is_action_line) {
|
||||
#Debug("Get Label position");
|
||||
# Debug("Get Label position");
|
||||
local.message_label;
|
||||
|
||||
if (is_fake)
|
||||
# Create a fake label so as to get the y coordinate of
|
||||
# a standard-length label.
|
||||
local.message_image = ImageFromTintedText ("This is a fake message");
|
||||
local.message_image = ImageToTintedText ("This is a fake message");
|
||||
else
|
||||
local.message_image = (is_action_line) && ImageFromActionText (label) || ImageFromTintedText (label);
|
||||
local.message_image = (is_action_line) && ImageToActionText (label) || ImageToTintedText (label);
|
||||
|
||||
message_label.width = message_image.GetWidth ();
|
||||
message_label.height = message_image.GetHeight ();
|
||||
|
@ -376,7 +413,7 @@ fun get_message_label (label, is_fake, is_action_line) {
|
|||
message_label.y = local.fsck_label.y + (first_line_height * 2);
|
||||
}
|
||||
|
||||
#Debug("action label x = " + message_label.x + " y = " + message_label.y );
|
||||
# Debug("action label x = " + message_label.x + " y = " + message_label.y );
|
||||
|
||||
# message_debug = "msg_x = " + message_label.x + " msg_y = " + message_label.y +
|
||||
# "msg_width = " + message_label.width + " msg_height = " +
|
||||
|
@ -393,9 +430,9 @@ fun get_fsck_label (label, is_fake) {
|
|||
local.fsck_label = global.progress_label;
|
||||
|
||||
if (is_fake)
|
||||
fsck_label.image = ImageFromTintedText ("This is a fake message");
|
||||
fsck_label.image = ImageToTintedText ("This is a fake message");
|
||||
else
|
||||
fsck_label.image = ImageFromTintedText (label);
|
||||
fsck_label.image = ImageToTintedText (label);
|
||||
|
||||
fsck_label.width = fsck_label.image.GetWidth ();
|
||||
fsck_label.height = fsck_label.image.GetHeight ();
|
||||
|
@ -424,8 +461,8 @@ fun get_fsck_label (label, is_fake) {
|
|||
# NOTE: this is called when doing something like 'plymouth message "hello world"'
|
||||
#
|
||||
fun setup_message (message_text, x, y, z, index) {
|
||||
#DebugMedium("Message setup: " + message_text);
|
||||
global.message_notification[index].image = (index) && ImageFromActionText (message_text) || ImageFromTintedText (message_text);
|
||||
# Debug("Message setup");
|
||||
global.message_notification[index].image = (index) && ImageToActionText (message_text) || ImageToTintedText (message_text);
|
||||
|
||||
# Set up the text message, if any
|
||||
message_notification[index].x = x;
|
||||
|
@ -494,7 +531,7 @@ fun message_callback (message)
|
|||
#
|
||||
|
||||
fun password_dialogue_setup (message_label) {
|
||||
#Debug("Password dialog setup");
|
||||
# Debug("Password dialog setup");
|
||||
|
||||
local.entry;
|
||||
local.bullet_image;
|
||||
|
@ -523,7 +560,7 @@ fun password_dialogue_setup (message_label) {
|
|||
# Put the entry below the second label.
|
||||
entry.y = message_notification[2].y + label.height;
|
||||
|
||||
#DebugMedium("entry x = " + entry.x + ", y = " + entry.y);
|
||||
#Debug ("entry x = " + entry.x + ", y = " + entry.y);
|
||||
entry.z = 10000;
|
||||
entry.sprite.SetX (entry.x);
|
||||
entry.sprite.SetY (entry.y);
|
||||
|
@ -533,7 +570,7 @@ fun password_dialogue_setup (message_label) {
|
|||
}
|
||||
|
||||
fun password_dialogue_opacity (opacity) {
|
||||
#Debug("Setting password dialog opacity to " + opacity);
|
||||
# Debug("Password dialog opacity");
|
||||
global.password_dialogue.opacity = opacity;
|
||||
local = global.password_dialogue;
|
||||
|
||||
|
@ -553,7 +590,7 @@ fun password_dialogue_opacity (opacity) {
|
|||
# The callback function is called when the display should display a password dialogue.
|
||||
# First arg is prompt string, the second is the number of bullets.
|
||||
fun display_password_callback (prompt, bullets) {
|
||||
#Debug("Password dialog setup");
|
||||
# Debug("Password dialog setup");
|
||||
|
||||
global.status = "password";
|
||||
if (!global.password_dialogue) password_dialogue_setup(prompt);
|
||||
|
@ -564,7 +601,7 @@ fun display_password_callback (prompt, bullets) {
|
|||
password_dialogue.bullet_image.GetHeight () / 2;
|
||||
margin = bullet_width;
|
||||
spaces = Math.Int( (password_dialogue.entry.image.GetWidth () - (margin * 2)) / (bullet_width / 2 ) );
|
||||
#DebugMedium ("spaces = " + spaces + ", bullets = " + bullets);
|
||||
#Debug ("spaces = " + spaces + ", bullets = " + bullets);
|
||||
bullets_area.width = margin + spaces * (bullet_width / 2);
|
||||
bullets_area.x = Window.GetX () + Window.GetWidth () / 2 - bullets_area.width / 2;
|
||||
#DebugBottom ("pwd_entry x = " + password_dialogue.entry.x + ", bullets_area.x = " + bullets_area.x + ", bullets_area.width = " + bullets_area.width);
|
||||
|
@ -1020,7 +1057,6 @@ Plymouth.SetUpdateStatusFunction (update_status_callback);
|
|||
#
|
||||
#Plymouth.SetDisplayQuestionFunction (display_question_callback);
|
||||
|
||||
|
||||
#-----------------------------------------Refresh stuff --------------------------------
|
||||
#
|
||||
# Calling Plymouth.SetRefreshFunction with a function will set that function to be
|
||||
|
@ -1031,80 +1067,10 @@ Plymouth.SetUpdateStatusFunction (update_status_callback);
|
|||
#
|
||||
fun refresh_callback ()
|
||||
{
|
||||
if (global.anim_status == "start") {
|
||||
anim_iter = 0;
|
||||
for (i = 0; i < ELECTRONS_DISPLAYED; i++) {
|
||||
ellipses[i].anim.angle = ellipses[i].anim.start_angle;
|
||||
}
|
||||
global.anim_status = "running";
|
||||
}
|
||||
|
||||
if (global.anim_status == "running") {
|
||||
anim_done = 1;
|
||||
for (i = 0; i < ELECTRONS_DISPLAYED; i++) {
|
||||
if (anim_iter >= ellipses[i].anim.start_iter && anim_iter < ellipses[i].anim.stop_iter) {
|
||||
draw_electron(i);
|
||||
|
||||
ellipses[i].anim.angle += ellipses[i].anim.angle_incr;
|
||||
# check if at least one of the animations needs more loops
|
||||
if (ellipses[i].anim.stop_iter > anim_iter) {
|
||||
anim_done = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (anim_done) {
|
||||
global.anim_status = "stopped";
|
||||
}
|
||||
anim_iter++;
|
||||
# DebugBottom ("anim iter = " + anim_iter);
|
||||
}
|
||||
draw_logo ();
|
||||
}
|
||||
Plymouth.SetRefreshFunction (refresh_callback);
|
||||
|
||||
# Acceleration function to have the electrons move faster in there most visible section, in
|
||||
# the middle of the ellipses.
|
||||
#
|
||||
# The function computes the result based on the .anim.angle member value in the given ellipse
|
||||
#
|
||||
# The angle is adapted so that accel([start_angle,start_angle+arc])->[start_angle,start_angle+arc]
|
||||
# is traveled in a sin([0,Pi/2])->[0,1] manner instead of linear increments
|
||||
#
|
||||
fun compute_angle_with_accel(ellipse) {
|
||||
# first map the [start_angle,start_angle+arc] to [0,Pi/2]
|
||||
angle_in_0_pi_2 = Math.Pi / 2 / ellipse.anim.arc * (ellipse.anim.angle - ellipse.anim.start_angle);
|
||||
# then compute sin and scale output to [start_angle,start_angle+arc]
|
||||
accel_angle = ellipse.anim.arc * Math.Sin(angle_in_0_pi_2) + ellipse.anim.start_angle;
|
||||
return accel_angle;
|
||||
}
|
||||
|
||||
# Computes the opacity factor so that the electrons visibility somehow matches that of the ellipses:
|
||||
# Most visible in a middle part, and invisible at the opposite.
|
||||
fun compute_opacity(ellipse) {
|
||||
# map the [start_angle,start_angle+arc] to [0,Pi]
|
||||
transformed_angle = Math.Pi / ellipse.anim.arc * (ellipse.anim.angle - ellipse.anim.start_angle);
|
||||
# and compute Math.Sin^2
|
||||
opacity_factor = Math.Sin(Math.Max(transformed_angle,-transformed_angle));
|
||||
opacity_factor *= opacity_factor;
|
||||
return opacity_factor;
|
||||
}
|
||||
|
||||
# Draw the 5 electron sprites to create a gradient effect
|
||||
#
|
||||
# The position is computed based on the .angle field, adapted with the acceleration function above.
|
||||
#
|
||||
fun draw_electron(index) {
|
||||
base_electron_x = ellipses[index].x - electron_image.GetWidth() / 2;
|
||||
base_electron_y = ellipses[index].y - electron_image.GetHeight() / 2;
|
||||
accel_angle = compute_angle_with_accel(ellipses[index]);
|
||||
opacity_factor = compute_opacity(ellipses[index]);
|
||||
for (j = 0; j < 5; j++) {
|
||||
electron_x = base_electron_x + ellipses[index].width * Math.Cos(accel_angle + electron_sprite[index][j].angle_diff);
|
||||
electron_y = base_electron_y + ellipses[index].height * Math.Sin(accel_angle + electron_sprite[index][j].angle_diff);
|
||||
electron_sprite[index][j].SetOpacity(opacity_factor * electron_sprite[index][j].base_opacity);
|
||||
electron_sprite[index][j].SetPosition(electron_x , electron_y, -10);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#-----------------------------------------Display Normal stuff -----------------------
|
||||
#
|
||||
|
@ -1119,9 +1085,8 @@ fun display_normal_callback ()
|
|||
prompt_active = 0;
|
||||
}
|
||||
|
||||
if (message_notification[1].sprite) {
|
||||
show_message (1);
|
||||
}
|
||||
if (message_notification[1].sprite) show_message (1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -1130,8 +1095,12 @@ Plymouth.SetDisplayNormalFunction (display_normal_callback);
|
|||
|
||||
#----------------------------------------- Quit --------------------------------
|
||||
|
||||
# TODO: Maybe we should also hide any other dialog
|
||||
# Show the logo and make the progress indicator look full when on exit
|
||||
fun quit_callback ()
|
||||
{
|
||||
logo.sprite.SetOpacity (1);
|
||||
switch_on_bullets ();
|
||||
}
|
||||
|
||||
Plymouth.SetQuitFunction(quit_callback);
|
|
@ -1,8 +0,0 @@
|
|||
[Plymouth Theme]
|
||||
Name=Default theme for Debian 8.0 Jessie
|
||||
Description=A theme that features a white Debian logo on a blue-green background surrounded by thin curves
|
||||
ModuleName=script
|
||||
|
||||
[script]
|
||||
ImageDir=/usr/share/plymouth/themes/lines
|
||||
ScriptFile=/usr/share/plymouth/themes/lines/lines.script
|
Before Width: | Height: | Size: 59 KiB |
Before Width: | Height: | Size: 269 B After Width: | Height: | Size: 269 B |
Before Width: | Height: | Size: 285 B After Width: | Height: | Size: 285 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 230 B After Width: | Height: | Size: 230 B |
After Width: | Height: | Size: 229 B |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 269 B |
After Width: | Height: | Size: 269 B |