Browse Source

Imported Upstream version 0.7.1

tags/upstream/0.7.1^0
Laurent Bigonville 7 years ago
parent
commit
aad6136013
13 changed files with 125 additions and 55 deletions
  1. +10
    -10
      configure
  2. +1
    -1
      configure.ac
  3. +2
    -1
      src/libply/ply-utils.c
  4. +1
    -1
      src/libplybootsplash/ply-animation.c
  5. +2
    -2
      src/libplybootsplash/ply-image.c
  6. +33
    -12
      src/libplybootsplash/ply-window.c
  7. +7
    -3
      src/main.c
  8. +12
    -0
      src/plugins/splash/script/plugin.c
  9. +25
    -0
      src/plugins/splash/script/script-lib-plymouth.c
  10. +4
    -0
      src/plugins/splash/script/script-lib-plymouth.h
  11. BIN
      themes/glow/bullet.png
  12. BIN
      themes/glow/entry.png
  13. +28
    -25
      themes/script/script.script

+ 10
- 10
configure View File

@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.63 for plymouth 0.7.0.
# Generated by GNU Autoconf 2.63 for plymouth 0.7.1.
#
# Report bugs to <"halfline@gmail.com">.
#
@@ -745,8 +745,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='plymouth'
PACKAGE_TARNAME='plymouth'
PACKAGE_VERSION='0.7.0'
PACKAGE_STRING='plymouth 0.7.0'
PACKAGE_VERSION='0.7.1'
PACKAGE_STRING='plymouth 0.7.1'
PACKAGE_BUGREPORT='"halfline@gmail.com"'

ac_unique_file="src/main.c"
@@ -1530,7 +1530,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures plymouth 0.7.0 to adapt to many kinds of systems.
\`configure' configures plymouth 0.7.1 to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

@@ -1600,7 +1600,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of plymouth 0.7.0:";;
short | recursive ) echo "Configuration of plymouth 0.7.1:";;
esac
cat <<\_ACEOF

@@ -1736,7 +1736,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
plymouth configure 0.7.0
plymouth configure 0.7.1
generated by GNU Autoconf 2.63

Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1750,7 +1750,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by plymouth $as_me 0.7.0, which was
It was created by plymouth $as_me 0.7.1, which was
generated by GNU Autoconf 2.63. Invocation command line was

$ $0 $@
@@ -5556,7 +5556,7 @@ fi

# Define the identity of the package.
PACKAGE='plymouth'
VERSION='0.7.0'
VERSION='0.7.1'


cat >>confdefs.h <<_ACEOF
@@ -13903,7 +13903,7 @@ exec 6>&1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by plymouth $as_me 0.7.0, which was
This file was extended by plymouth $as_me 0.7.1, which was
generated by GNU Autoconf 2.63. Invocation command line was

CONFIG_FILES = $CONFIG_FILES
@@ -13966,7 +13966,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
plymouth config.status 0.7.0
plymouth config.status 0.7.1
configured by $0, generated by GNU Autoconf 2.63,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"



+ 1
- 1
configure.ac View File

@@ -1,4 +1,4 @@
AC_INIT(plymouth, 0.7.0, "halfline@gmail.com")
AC_INIT(plymouth, 0.7.1, "halfline@gmail.com")
AC_CONFIG_SRCDIR(src/main.c)
AC_CONFIG_HEADER(config.h)
AC_CONFIG_AUX_DIR(build-tools)


+ 2
- 1
src/libply/ply-utils.c View File

@@ -676,7 +676,8 @@ ply_open_module (const char *module_path)

assert (module_path != NULL);

handle = (ply_module_handle_t *) dlopen (module_path, RTLD_NOW | RTLD_LOCAL);
handle = (ply_module_handle_t *) dlopen (module_path,
RTLD_NODELETE |RTLD_NOW | RTLD_LOCAL);

if (handle == NULL)
{


+ 1
- 1
src/libplybootsplash/ply-animation.c View File

@@ -151,7 +151,7 @@ animate_at_time (ply_animation_t *animation,
number_of_frames = ply_array_get_size (animation->frames);

if (number_of_frames == 0)
return true;
return false;

should_continue = true;



+ 2
- 2
src/libplybootsplash/ply-image.c View File

@@ -342,8 +342,8 @@ ply_image_resize (ply_image_t *image,
old_width = ply_image_get_width (image);
old_height = ply_image_get_height (image);

scale_x = ((double) old_width) / width;
scale_y = ((double) old_height) / height;
scale_x = ((double) old_width - 1) / MAX (width - 1, 1);
scale_y = ((double) old_height - 1) / MAX (height - 1, 1);

for (y = 0; y < height; y++)
{


+ 33
- 12
src/libplybootsplash/ply-window.c View File

@@ -146,6 +146,8 @@ struct _ply_window
void *erase_handler_user_data;
};

static bool ply_window_open_tty (ply_window_t *window);

ply_window_t *
ply_window_new (const char *tty_name)
{
@@ -422,6 +424,13 @@ on_tty_disconnected (ply_window_t *window)
{
ply_trace ("tty disconnected (fd %d)", window->tty_fd);
window->tty_fd_watch = NULL;
window->tty_fd = -1;

if (window->tty_name != NULL)
{
ply_trace ("trying to reopen window '%s'", window->tty_name);
ply_window_open_tty (window);
}
}

static bool
@@ -528,12 +537,33 @@ ply_window_look_up_geometry (ply_window_t *window)
return true;
}

bool
ply_window_open (ply_window_t *window)
static bool
ply_window_open_tty (ply_window_t *window)
{
assert (window != NULL);
assert (window->tty_name != NULL);
assert (window->tty_fd < 0);
assert (window->tty_fd_watch == NULL);

window->tty_fd = open (window->tty_name, O_RDWR | O_NOCTTY);

if (window->tty_fd < 0)
return false;

if (window->loop != NULL)
window->tty_fd_watch = ply_event_loop_watch_fd (window->loop, window->tty_fd,
PLY_EVENT_LOOP_FD_STATUS_HAS_DATA,
(ply_event_handler_t) on_key_event,
(ply_event_handler_t) on_tty_disconnected,
window);

return true;
}

bool
ply_window_open (ply_window_t *window)
{
assert (window != NULL);

if (window->tty_name == NULL)
{
@@ -552,9 +582,7 @@ ply_window_open (ply_window_t *window)

ply_trace ("trying to open window '%s'", window->tty_name);

window->tty_fd = open (window->tty_name, O_RDWR | O_NOCTTY);

if (window->tty_fd < 0)
if (!ply_window_open_tty (window))
{
ply_trace ("could not open %s : %m", window->tty_name);
return false;
@@ -576,13 +604,6 @@ ply_window_open (ply_window_t *window)
ply_window_look_up_geometry,
window);

if (window->loop != NULL)
window->tty_fd_watch = ply_event_loop_watch_fd (window->loop, window->tty_fd,
PLY_EVENT_LOOP_FD_STATUS_HAS_DATA,
(ply_event_handler_t) on_key_event,
(ply_event_handler_t) on_tty_disconnected,
window);

/* We try to open the frame buffer, but it may fail. splash plugins can check
* to see if it's open and react accordingly
*/


+ 7
- 3
src/main.c View File

@@ -1144,9 +1144,6 @@ check_verbosity (state_t *state)
debug_buffer_path = path;
}

if (debug_buffer_path == NULL)
debug_buffer_path = strdup (PLYMOUTH_LOG_DIRECTORY "/plymouth-debug.log");

if (debug_buffer != NULL)
debug_buffer = ply_buffer_new ();

@@ -1160,6 +1157,9 @@ check_verbosity (state_t *state)

if (debug_buffer != NULL)
{
if (debug_buffer_path == NULL)
debug_buffer_path = strdup (PLYMOUTH_LOG_DIRECTORY "/plymouth-debug.log");

ply_logger_add_filter (ply_logger_get_error_default (),
(ply_logger_filter_handler_t)
on_error_message,
@@ -1330,6 +1330,10 @@ dump_debug_buffer_to_file (void)

fd = open (debug_buffer_path,
O_WRONLY | O_CREAT, 0600);

if (fd < 0)
return;

size = ply_buffer_get_size (debug_buffer);
bytes = ply_buffer_get_bytes (debug_buffer);
ply_write (fd, bytes, size);


+ 12
- 0
src/plugins/splash/script/plugin.c View File

@@ -134,6 +134,8 @@ on_timeout (ply_boot_splash_plugin_t *plugin)
{
double sleep_time;

ply_window_set_mode (plugin->window, PLY_WINDOW_MODE_GRAPHICS);

script_lib_plymouth_on_refresh (plugin->script_state,
plugin->script_plymouth_lib);
script_lib_sprite_refresh (plugin->script_sprite_lib);
@@ -415,6 +417,15 @@ display_question (ply_boot_splash_plugin_t *plugin,
entry_text);
}

static void
display_message (ply_boot_splash_plugin_t *plugin,
const char *message)
{
script_lib_plymouth_on_message (plugin->script_state,
plugin->script_plymouth_lib,
message);
}

ply_boot_splash_plugin_interface_t *
ply_boot_splash_plugin_get_interface (void)
{
@@ -433,6 +444,7 @@ ply_boot_splash_plugin_get_interface (void)
.display_normal = display_normal,
.display_password = display_password,
.display_question = display_question,
.display_message = display_message,
};

return &plugin_interface;


+ 25
- 0
src/plugins/splash/script/script-lib-plymouth.c View File

@@ -66,6 +66,7 @@ script_lib_plymouth_data_t *script_lib_plymouth_setup (script_state_t *state)
data->script_display_normal_func = script_obj_new_null ();
data->script_display_password_func = script_obj_new_null ();
data->script_display_question_func = script_obj_new_null ();
data->script_message_func = script_obj_new_null ();

script_add_native_function (state->global,
"PlymouthSetRefreshFunction",
@@ -115,6 +116,12 @@ script_lib_plymouth_data_t *script_lib_plymouth_setup (script_state_t *state)
&data->script_display_question_func,
"function",
NULL);
script_add_native_function (state->global,
"PlymouthSetMessageFunction",
plymouth_set_function,
&data->script_message_func,
"function",
NULL);
data->script_main_op = script_parse_string (script_lib_plymouth_string);
script_return_t ret = script_execute (state, data->script_main_op);
script_obj_unref (ret.object); /* Throw anything sent back away */
@@ -133,6 +140,7 @@ void script_lib_plymouth_destroy (script_lib_plymouth_data_t *data)
script_obj_unref (data->script_display_normal_func);
script_obj_unref (data->script_display_password_func);
script_obj_unref (data->script_display_question_func);
script_obj_unref (data->script_message_func);
free (data);
}

@@ -271,3 +279,20 @@ void script_lib_plymouth_on_display_question (script_state_t *state,
script_obj_unref (ret.object);
}
}

void script_lib_plymouth_on_message (script_state_t *state,
script_lib_plymouth_data_t *data,
const char *message)
{
script_function_t *function = script_obj_as_function (data->script_message_func);
if (function)
{
script_obj_t *new_message_obj = script_obj_new_string (message);
script_return_t ret = script_execute_function (state,
function,
new_message_obj,
NULL);
script_obj_unref (new_message_obj);
script_obj_unref (ret.object);
}
}

+ 4
- 0
src/plugins/splash/script/script-lib-plymouth.h View File

@@ -35,6 +35,7 @@ typedef struct
script_obj_t *script_display_normal_func;
script_obj_t *script_display_password_func;
script_obj_t *script_display_question_func;
script_obj_t *script_message_func;
} script_lib_plymouth_data_t;

script_lib_plymouth_data_t *script_lib_plymouth_setup (script_state_t *state);
@@ -64,5 +65,8 @@ void script_lib_plymouth_on_display_question (script_state_t *state,
script_lib_plymouth_data_t *data,
const char *prompt,
const char *entry_text);
void script_lib_plymouth_on_message (script_state_t *state,
script_lib_plymouth_data_t *data,
const char *new_message);

#endif /* SCRIPT_LIB_PLYMOUTH */

BIN
themes/glow/bullet.png View File

Before After
Width: 7  |  Height: 7  |  Size: 296 B Width: 8  |  Height: 8  |  Size: 131 B

BIN
themes/glow/entry.png View File

Before After
Width: 200  |  Height: 30  |  Size: 350 B Width: 200  |  Height: 30  |  Size: 367 B

+ 28
- 25
themes/script/script.script View File

@@ -35,7 +35,7 @@ PlymouthSetRefreshFunction (refresh_callback);

status = "normal";

fun dialogue_setup()
fun dialog_setup()
{
local.box;
local.lock;
@@ -66,50 +66,53 @@ fun dialogue_setup()
entry.z = box.z + 1;
SpriteSetPosition(entry.sprite, entry.x, entry.y, entry.z);
global.dialogue.box = box;
global.dialogue.lock = lock;
global.dialogue.entry = entry;
global.dialogue.bullet_image = ImageNew("bullet.png");
dialogue_opacity (1);
global.dialog.box = box;
global.dialog.lock = lock;
global.dialog.entry = entry;
global.dialog.bullet_image = ImageNew("bullet.png");
dialog_opacity (1);
}
fun dialogue_opacity(opacity)
fun dialog_opacity(opacity)
{
SpriteSetOpacity (dialogue.box.sprite, opacity);
SpriteSetOpacity (dialogue.lock.sprite, opacity);
SpriteSetOpacity (dialogue.entry.sprite, opacity);
for (index = 0; dialogue.bullet[index]; index++)
SpriteSetOpacity (dialog.box.sprite, opacity);
SpriteSetOpacity (dialog.lock.sprite, opacity);
SpriteSetOpacity (dialog.entry.sprite, opacity);
for (index = 0; dialog.bullet[index]; index++)
{
SpriteSetOpacity(dialogue.bullet[index].sprite, opacity);
SpriteSetOpacity(dialog.bullet[index].sprite, opacity);
}
}

fun display_normal_callback ()
{
global.status = "normal";
if (global.dialogue)
dialogue_opacity (0);
if (global.dialog)
dialog_opacity (0);
}

fun display_password_callback (prompt, bullets)
{
global.status = "password";
if (!global.dialogue) dialogue_setup();
for (index = 0; dialogue.bullet[index] || index < bullets; index++)
if (!global.dialog)
dialog_setup();
else
dialog_opacity(1);
for (index = 0; dialog.bullet[index] || index < bullets; index++)
{
if (!dialogue.bullet[index])
if (!dialog.bullet[index])
{
dialogue.bullet[index].sprite = SpriteNew();
SpriteSetImage(dialogue.bullet[index].sprite, dialogue.bullet_image);
dialogue.bullet[index].x = dialogue.entry.x + index * ImageGetWidth(dialogue.bullet_image);
dialogue.bullet[index].y = dialogue.entry.y + ImageGetHeight(dialogue.entry.image) / 2 - ImageGetHeight(dialogue.bullet_image) / 2;
dialogue.bullet[index].z = dialogue.entry.z + 1;
SpriteSetPosition(dialogue.bullet[index].sprite, dialogue.bullet[index].x, dialogue.bullet[index].y, dialogue.bullet[index].z);
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(dialogue.bullet[index].sprite, 1);
SpriteSetOpacity(dialog.bullet[index].sprite, 1);
else
SpriteSetOpacity(dialogue.bullet[index].sprite, 0);
SpriteSetOpacity(dialog.bullet[index].sprite, 0);
}
}



Loading…
Cancel
Save