|
|
6cc380 |
From 8fa6fec9d86dbe34be626652cda0fba4f4803223 Mon Sep 17 00:00:00 2001
|
|
|
6cc380 |
From: Ray Strode <rstrode@redhat.com>
|
|
|
6cc380 |
Date: Tue, 22 Oct 2013 18:34:46 -0400
|
|
|
6cc380 |
Subject: [PATCH 1/5] pixel-buffer: add tiling function
|
|
|
6cc380 |
|
|
|
6cc380 |
It can be useful to tile a group of pixels across the screen
|
|
|
6cc380 |
(for e.g. backgrounds).
|
|
|
6cc380 |
|
|
|
6cc380 |
This commit adds API to pixel buffer to do that tiling.
|
|
|
6cc380 |
|
|
|
6cc380 |
A follow up commit will add support into ply-image so images can
|
|
|
6cc380 |
be loaded from disk and then tiled on screen.
|
|
|
6cc380 |
---
|
|
|
6cc380 |
src/libply-splash-core/ply-pixel-buffer.c | 30 ++++++++++++++++++++++++++++++
|
|
|
6cc380 |
src/libply-splash-core/ply-pixel-buffer.h | 4 ++++
|
|
|
6cc380 |
2 files changed, 34 insertions(+)
|
|
|
6cc380 |
|
|
|
6cc380 |
diff --git a/src/libply-splash-core/ply-pixel-buffer.c b/src/libply-splash-core/ply-pixel-buffer.c
|
|
|
6cc380 |
index a612990..a860b7f 100644
|
|
|
6cc380 |
--- a/src/libply-splash-core/ply-pixel-buffer.c
|
|
|
6cc380 |
+++ b/src/libply-splash-core/ply-pixel-buffer.c
|
|
|
6cc380 |
@@ -821,32 +821,62 @@ ply_pixel_buffer_rotate (ply_pixel_buffer_t *old_buffer,
|
|
|
6cc380 |
bytes = ply_pixel_buffer_get_argb32_data (buffer);
|
|
|
6cc380 |
|
|
|
6cc380 |
double d = sqrt ((center_x * center_x +
|
|
|
6cc380 |
center_y * center_y));
|
|
|
6cc380 |
double theta = atan2 (-center_y, -center_x) - theta_offset;
|
|
|
6cc380 |
double start_x = center_x + d * cos (theta);
|
|
|
6cc380 |
double start_y = center_y + d * sin (theta);
|
|
|
6cc380 |
double step_x = cos (-theta_offset);
|
|
|
6cc380 |
double step_y = sin (-theta_offset);
|
|
|
6cc380 |
|
|
|
6cc380 |
for (y = 0; y < height; y++)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
old_y = start_y;
|
|
|
6cc380 |
old_x = start_x;
|
|
|
6cc380 |
start_y += step_x;
|
|
|
6cc380 |
start_x -= step_y;
|
|
|
6cc380 |
for (x = 0; x < width; x++)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
if (old_x < 0 || old_x > width || old_y < 0 || old_y > height)
|
|
|
6cc380 |
bytes[x + y * width] = 0;
|
|
|
6cc380 |
else
|
|
|
6cc380 |
bytes[x + y * width] =
|
|
|
6cc380 |
ply_pixel_buffer_interpolate (old_buffer, old_x, old_y);
|
|
|
6cc380 |
old_x += step_x;
|
|
|
6cc380 |
old_y += step_y;
|
|
|
6cc380 |
}
|
|
|
6cc380 |
}
|
|
|
6cc380 |
return buffer;
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
+ply_pixel_buffer_t *
|
|
|
6cc380 |
+ply_pixel_buffer_tile (ply_pixel_buffer_t *old_buffer,
|
|
|
6cc380 |
+ long width,
|
|
|
6cc380 |
+ long height)
|
|
|
6cc380 |
+{
|
|
|
6cc380 |
+ long x, y;
|
|
|
6cc380 |
+ long old_x, old_y;
|
|
|
6cc380 |
+ long old_width, old_height;
|
|
|
6cc380 |
+ uint32_t *bytes, *old_bytes;
|
|
|
6cc380 |
+ ply_pixel_buffer_t *buffer;
|
|
|
6cc380 |
+
|
|
|
6cc380 |
+ buffer = ply_pixel_buffer_new (width, height);
|
|
|
6cc380 |
+
|
|
|
6cc380 |
+ old_bytes = ply_pixel_buffer_get_argb32_data (old_buffer);
|
|
|
6cc380 |
+ bytes = ply_pixel_buffer_get_argb32_data (buffer);
|
|
|
6cc380 |
+
|
|
|
6cc380 |
+ old_width = old_buffer->area.width;
|
|
|
6cc380 |
+ old_height = old_buffer->area.height;
|
|
|
6cc380 |
+
|
|
|
6cc380 |
+ for (y = 0; y < height; y++)
|
|
|
6cc380 |
+ {
|
|
|
6cc380 |
+ old_y = y % old_height;
|
|
|
6cc380 |
+ for (x = 0; x < width; x++)
|
|
|
6cc380 |
+ {
|
|
|
6cc380 |
+ old_x = x % old_width;
|
|
|
6cc380 |
+ bytes[x + y * width] = old_bytes[old_x + old_y * old_width];
|
|
|
6cc380 |
+ }
|
|
|
6cc380 |
+ }
|
|
|
6cc380 |
+ return buffer;
|
|
|
6cc380 |
+}
|
|
|
6cc380 |
|
|
|
6cc380 |
/* vim: set ts=4 sw=4 et ai ci cino={.5s,^-2,+.5s,t0,g0,e-2,n-2,p2s,(0,=.5s,:.5s */
|
|
|
6cc380 |
diff --git a/src/libply-splash-core/ply-pixel-buffer.h b/src/libply-splash-core/ply-pixel-buffer.h
|
|
|
6cc380 |
index 47cdd52..e0dffda 100644
|
|
|
6cc380 |
--- a/src/libply-splash-core/ply-pixel-buffer.h
|
|
|
6cc380 |
+++ b/src/libply-splash-core/ply-pixel-buffer.h
|
|
|
6cc380 |
@@ -97,34 +97,38 @@ void ply_pixel_buffer_fill_with_buffer_at_opacity (ply_pixel_buffer_t *canvas,
|
|
|
6cc380 |
ply_pixel_buffer_t *source,
|
|
|
6cc380 |
int x_offset,
|
|
|
6cc380 |
int y_offset,
|
|
|
6cc380 |
float opacity);
|
|
|
6cc380 |
void ply_pixel_buffer_fill_with_buffer_with_clip (ply_pixel_buffer_t *canvas,
|
|
|
6cc380 |
ply_pixel_buffer_t *source,
|
|
|
6cc380 |
int x_offset,
|
|
|
6cc380 |
int y_offset,
|
|
|
6cc380 |
ply_rectangle_t *clip_area);
|
|
|
6cc380 |
void ply_pixel_buffer_fill_with_buffer (ply_pixel_buffer_t *canvas,
|
|
|
6cc380 |
ply_pixel_buffer_t *source,
|
|
|
6cc380 |
int x_offset,
|
|
|
6cc380 |
int y_offset);
|
|
|
6cc380 |
|
|
|
6cc380 |
|
|
|
6cc380 |
void ply_pixel_buffer_push_clip_area (ply_pixel_buffer_t *buffer,
|
|
|
6cc380 |
ply_rectangle_t *clip_area);
|
|
|
6cc380 |
void ply_pixel_buffer_pop_clip_area (ply_pixel_buffer_t *buffer);
|
|
|
6cc380 |
|
|
|
6cc380 |
uint32_t *ply_pixel_buffer_get_argb32_data (ply_pixel_buffer_t *buffer);
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_pixel_buffer_t *ply_pixel_buffer_resize (ply_pixel_buffer_t *old_buffer,
|
|
|
6cc380 |
long width,
|
|
|
6cc380 |
long height);
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_pixel_buffer_t *ply_pixel_buffer_rotate (ply_pixel_buffer_t *old_buffer,
|
|
|
6cc380 |
long center_x,
|
|
|
6cc380 |
long center_y,
|
|
|
6cc380 |
double theta_offset);
|
|
|
6cc380 |
|
|
|
6cc380 |
+ply_pixel_buffer_t *ply_pixel_buffer_tile (ply_pixel_buffer_t *old_buffer,
|
|
|
6cc380 |
+ long width,
|
|
|
6cc380 |
+ long height);
|
|
|
6cc380 |
+
|
|
|
6cc380 |
#endif
|
|
|
6cc380 |
|
|
|
6cc380 |
#endif /* PLY_PIXEL_BUFFER_H */
|
|
|
6cc380 |
/* vim: set ts=4 sw=4 expandtab autoindent cindent cino={.5s,(0: */
|
|
|
6cc380 |
--
|
|
|
6cc380 |
1.8.3.1
|
|
|
6cc380 |
|
|
|
6cc380 |
|
|
|
6cc380 |
From fc440513d337ca15067039383502f73a0fe2796f Mon Sep 17 00:00:00 2001
|
|
|
6cc380 |
From: Ray Strode <rstrode@redhat.com>
|
|
|
6cc380 |
Date: Tue, 22 Oct 2013 18:36:15 -0400
|
|
|
6cc380 |
Subject: [PATCH 2/5] ply-image: add tiling support
|
|
|
6cc380 |
|
|
|
6cc380 |
This follow up commit adds tiling support to images, so
|
|
|
6cc380 |
that splash screens can have been background patterns instead
|
|
|
6cc380 |
of just background colors.
|
|
|
6cc380 |
---
|
|
|
6cc380 |
src/libply-splash-graphics/ply-image.c | 15 +++++++++++++++
|
|
|
6cc380 |
src/libply-splash-graphics/ply-image.h | 1 +
|
|
|
6cc380 |
2 files changed, 16 insertions(+)
|
|
|
6cc380 |
|
|
|
6cc380 |
diff --git a/src/libply-splash-graphics/ply-image.c b/src/libply-splash-graphics/ply-image.c
|
|
|
6cc380 |
index be85809..7d21946 100644
|
|
|
6cc380 |
--- a/src/libply-splash-graphics/ply-image.c
|
|
|
6cc380 |
+++ b/src/libply-splash-graphics/ply-image.c
|
|
|
6cc380 |
@@ -227,53 +227,68 @@ ply_image_resize (ply_image_t *image,
|
|
|
6cc380 |
long width,
|
|
|
6cc380 |
long height)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_image_t *new_image;
|
|
|
6cc380 |
|
|
|
6cc380 |
new_image = ply_image_new (image->filename);
|
|
|
6cc380 |
|
|
|
6cc380 |
new_image->buffer = ply_pixel_buffer_resize (image->buffer,
|
|
|
6cc380 |
width,
|
|
|
6cc380 |
height);
|
|
|
6cc380 |
return new_image;
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_image_t *
|
|
|
6cc380 |
ply_image_rotate (ply_image_t *image,
|
|
|
6cc380 |
long center_x,
|
|
|
6cc380 |
long center_y,
|
|
|
6cc380 |
double theta_offset)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_image_t *new_image;
|
|
|
6cc380 |
|
|
|
6cc380 |
new_image = ply_image_new (image->filename);
|
|
|
6cc380 |
|
|
|
6cc380 |
new_image->buffer = ply_pixel_buffer_rotate (image->buffer,
|
|
|
6cc380 |
center_x,
|
|
|
6cc380 |
center_y,
|
|
|
6cc380 |
theta_offset);
|
|
|
6cc380 |
return new_image;
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
+ply_image_t *
|
|
|
6cc380 |
+ply_image_tile (ply_image_t *image,
|
|
|
6cc380 |
+ long width,
|
|
|
6cc380 |
+ long height)
|
|
|
6cc380 |
+{
|
|
|
6cc380 |
+ ply_image_t *new_image;
|
|
|
6cc380 |
+
|
|
|
6cc380 |
+ new_image = ply_image_new (image->filename);
|
|
|
6cc380 |
+
|
|
|
6cc380 |
+ new_image->buffer = ply_pixel_buffer_tile (image->buffer,
|
|
|
6cc380 |
+ width,
|
|
|
6cc380 |
+ height);
|
|
|
6cc380 |
+ return new_image;
|
|
|
6cc380 |
+}
|
|
|
6cc380 |
+
|
|
|
6cc380 |
ply_pixel_buffer_t *
|
|
|
6cc380 |
ply_image_get_buffer (ply_image_t *image)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
assert (image != NULL);
|
|
|
6cc380 |
|
|
|
6cc380 |
return image->buffer;
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_pixel_buffer_t *
|
|
|
6cc380 |
ply_image_convert_to_pixel_buffer (ply_image_t *image)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_pixel_buffer_t *buffer;
|
|
|
6cc380 |
|
|
|
6cc380 |
assert (image != NULL);
|
|
|
6cc380 |
|
|
|
6cc380 |
buffer = image->buffer;
|
|
|
6cc380 |
image->buffer = NULL;
|
|
|
6cc380 |
ply_image_free (image);
|
|
|
6cc380 |
|
|
|
6cc380 |
return buffer;
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
/* vim: set ts=4 sw=4 expandtab autoindent cindent cino={.5s,(0: */
|
|
|
6cc380 |
diff --git a/src/libply-splash-graphics/ply-image.h b/src/libply-splash-graphics/ply-image.h
|
|
|
6cc380 |
index 66fa520..5bda567 100644
|
|
|
6cc380 |
--- a/src/libply-splash-graphics/ply-image.h
|
|
|
6cc380 |
+++ b/src/libply-splash-graphics/ply-image.h
|
|
|
6cc380 |
@@ -12,37 +12,38 @@
|
|
|
6cc380 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
6cc380 |
* GNU General Public License for more details.
|
|
|
6cc380 |
*
|
|
|
6cc380 |
* You should have received a copy of the GNU General Public License
|
|
|
6cc380 |
* along with this program; if not, write to the Free Software
|
|
|
6cc380 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
|
6cc380 |
* 02111-1307, USA.
|
|
|
6cc380 |
*
|
|
|
6cc380 |
* Written By: Ray Strode <rstrode@redhat.com>
|
|
|
6cc380 |
*/
|
|
|
6cc380 |
#ifndef PLY_IMAGE_H
|
|
|
6cc380 |
#define PLY_IMAGE_H
|
|
|
6cc380 |
|
|
|
6cc380 |
#include "ply-pixel-buffer.h"
|
|
|
6cc380 |
|
|
|
6cc380 |
#include <stdbool.h>
|
|
|
6cc380 |
#include <stdint.h>
|
|
|
6cc380 |
#include <unistd.h>
|
|
|
6cc380 |
|
|
|
6cc380 |
typedef struct _ply_image ply_image_t;
|
|
|
6cc380 |
|
|
|
6cc380 |
#ifndef PLY_HIDE_FUNCTION_DECLARATIONS
|
|
|
6cc380 |
ply_image_t *ply_image_new (const char *filename);
|
|
|
6cc380 |
void ply_image_free (ply_image_t *image);
|
|
|
6cc380 |
bool ply_image_load (ply_image_t *image);
|
|
|
6cc380 |
uint32_t *ply_image_get_data (ply_image_t *image);
|
|
|
6cc380 |
long ply_image_get_width (ply_image_t *image);
|
|
|
6cc380 |
long ply_image_get_height (ply_image_t *image);
|
|
|
6cc380 |
ply_image_t *ply_image_resize (ply_image_t *image, long width, long height);
|
|
|
6cc380 |
ply_image_t *ply_image_rotate (ply_image_t *oldimage, long center_x, long center_y, double theta_offset);
|
|
|
6cc380 |
+ply_image_t *ply_image_tile (ply_image_t *image, long width, long height);
|
|
|
6cc380 |
ply_pixel_buffer_t *ply_image_get_buffer (ply_image_t *image);
|
|
|
6cc380 |
ply_pixel_buffer_t *ply_image_convert_to_pixel_buffer (ply_image_t *image);
|
|
|
6cc380 |
|
|
|
6cc380 |
#endif
|
|
|
6cc380 |
|
|
|
6cc380 |
#endif /* PLY_IMAGE_H */
|
|
|
6cc380 |
/* vim: set ts=4 sw=4 expandtab autoindent cindent cino={.5s,(0: */
|
|
|
6cc380 |
--
|
|
|
6cc380 |
1.8.3.1
|
|
|
6cc380 |
|
|
|
6cc380 |
|
|
|
6cc380 |
From 257408d44d1b5d0dc202f60f79d3d8f5c3427413 Mon Sep 17 00:00:00 2001
|
|
|
6cc380 |
From: Ray Strode <rstrode@redhat.com>
|
|
|
6cc380 |
Date: Tue, 22 Oct 2013 19:24:14 -0400
|
|
|
6cc380 |
Subject: [PATCH 3/5] two-step: add support for tiled background image
|
|
|
6cc380 |
|
|
|
6cc380 |
If there's a file named background-tile.png in the theme
|
|
|
6cc380 |
then it will get used as the background behind the other
|
|
|
6cc380 |
content in place of the background gradient.
|
|
|
6cc380 |
---
|
|
|
6cc380 |
src/plugins/splash/two-step/plugin.c | 45 ++++++++++++++++++++++++++++++++++++
|
|
|
6cc380 |
1 file changed, 45 insertions(+)
|
|
|
6cc380 |
|
|
|
6cc380 |
diff --git a/src/plugins/splash/two-step/plugin.c b/src/plugins/splash/two-step/plugin.c
|
|
|
6cc380 |
index 541a108..2c6d97a 100644
|
|
|
6cc380 |
--- a/src/plugins/splash/two-step/plugin.c
|
|
|
6cc380 |
+++ b/src/plugins/splash/two-step/plugin.c
|
|
|
6cc380 |
@@ -64,70 +64,72 @@
|
|
|
6cc380 |
#define FRAMES_PER_SECOND 30
|
|
|
6cc380 |
#endif
|
|
|
6cc380 |
|
|
|
6cc380 |
#ifndef SHOW_ANIMATION_PERCENT
|
|
|
6cc380 |
#define SHOW_ANIMATION_PERCENT 0.9
|
|
|
6cc380 |
#endif
|
|
|
6cc380 |
|
|
|
6cc380 |
typedef enum {
|
|
|
6cc380 |
PLY_BOOT_SPLASH_DISPLAY_NORMAL,
|
|
|
6cc380 |
PLY_BOOT_SPLASH_DISPLAY_QUESTION_ENTRY,
|
|
|
6cc380 |
PLY_BOOT_SPLASH_DISPLAY_PASSWORD_ENTRY
|
|
|
6cc380 |
} ply_boot_splash_display_type_t;
|
|
|
6cc380 |
|
|
|
6cc380 |
typedef enum {
|
|
|
6cc380 |
PROGRESS_FUNCTION_TYPE_WWOODS,
|
|
|
6cc380 |
PROGRESS_FUNCTION_TYPE_LINEAR,
|
|
|
6cc380 |
} progress_function_t;
|
|
|
6cc380 |
|
|
|
6cc380 |
typedef struct
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_boot_splash_plugin_t *plugin;
|
|
|
6cc380 |
ply_pixel_display_t *display;
|
|
|
6cc380 |
ply_entry_t *entry;
|
|
|
6cc380 |
ply_animation_t *end_animation;
|
|
|
6cc380 |
ply_progress_animation_t *progress_animation;
|
|
|
6cc380 |
ply_throbber_t *throbber;
|
|
|
6cc380 |
ply_label_t *label;
|
|
|
6cc380 |
ply_label_t *message_label;
|
|
|
6cc380 |
ply_rectangle_t box_area, lock_area;
|
|
|
6cc380 |
ply_trigger_t *end_trigger;
|
|
|
6cc380 |
+ ply_image_t *background_image;
|
|
|
6cc380 |
} view_t;
|
|
|
6cc380 |
|
|
|
6cc380 |
struct _ply_boot_splash_plugin
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_event_loop_t *loop;
|
|
|
6cc380 |
ply_boot_splash_mode_t mode;
|
|
|
6cc380 |
ply_image_t *lock_image;
|
|
|
6cc380 |
ply_image_t *box_image;
|
|
|
6cc380 |
ply_image_t *corner_image;
|
|
|
6cc380 |
ply_image_t *header_image;
|
|
|
6cc380 |
+ ply_image_t *background_tile_image;
|
|
|
6cc380 |
ply_list_t *views;
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_boot_splash_display_type_t state;
|
|
|
6cc380 |
|
|
|
6cc380 |
double animation_horizontal_alignment;
|
|
|
6cc380 |
double animation_vertical_alignment;
|
|
|
6cc380 |
char *animation_dir;
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_progress_animation_transition_t transition;
|
|
|
6cc380 |
double transition_duration;
|
|
|
6cc380 |
|
|
|
6cc380 |
uint32_t background_start_color;
|
|
|
6cc380 |
uint32_t background_end_color;
|
|
|
6cc380 |
|
|
|
6cc380 |
progress_function_t progress_function;
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_trigger_t *idle_trigger;
|
|
|
6cc380 |
ply_trigger_t *stop_trigger;
|
|
|
6cc380 |
|
|
|
6cc380 |
uint32_t root_is_mounted : 1;
|
|
|
6cc380 |
uint32_t is_visible : 1;
|
|
|
6cc380 |
uint32_t is_animating : 1;
|
|
|
6cc380 |
uint32_t is_idle : 1;
|
|
|
6cc380 |
};
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_boot_splash_plugin_interface_t * ply_boot_splash_plugin_get_interface (void);
|
|
|
6cc380 |
|
|
|
6cc380 |
static void stop_animation (ply_boot_splash_plugin_t *plugin,
|
|
|
6cc380 |
ply_trigger_t *idle_trigger);
|
|
|
6cc380 |
|
|
|
6cc380 |
@@ -149,66 +151,83 @@ view_new (ply_boot_splash_plugin_t *plugin,
|
|
|
6cc380 |
|
|
|
6cc380 |
view->entry = ply_entry_new (plugin->animation_dir);
|
|
|
6cc380 |
view->end_animation = ply_animation_new (plugin->animation_dir,
|
|
|
6cc380 |
"animation-");
|
|
|
6cc380 |
view->progress_animation = ply_progress_animation_new (plugin->animation_dir,
|
|
|
6cc380 |
"progress-");
|
|
|
6cc380 |
|
|
|
6cc380 |
view->throbber = ply_throbber_new (plugin->animation_dir,
|
|
|
6cc380 |
"throbber-");
|
|
|
6cc380 |
ply_progress_animation_set_transition (view->progress_animation,
|
|
|
6cc380 |
plugin->transition,
|
|
|
6cc380 |
plugin->transition_duration);
|
|
|
6cc380 |
|
|
|
6cc380 |
view->label = ply_label_new ();
|
|
|
6cc380 |
view->message_label = ply_label_new ();
|
|
|
6cc380 |
|
|
|
6cc380 |
return view;
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
static void
|
|
|
6cc380 |
view_free (view_t *view)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_entry_free (view->entry);
|
|
|
6cc380 |
ply_animation_free (view->end_animation);
|
|
|
6cc380 |
ply_progress_animation_free (view->progress_animation);
|
|
|
6cc380 |
ply_throbber_free (view->throbber);
|
|
|
6cc380 |
ply_label_free (view->label);
|
|
|
6cc380 |
ply_label_free (view->message_label);
|
|
|
6cc380 |
|
|
|
6cc380 |
+ if (view->background_image != NULL)
|
|
|
6cc380 |
+ ply_image_free (view->background_image);
|
|
|
6cc380 |
+
|
|
|
6cc380 |
free (view);
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
static bool
|
|
|
6cc380 |
view_load (view_t *view)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
+ unsigned long screen_width, screen_height;
|
|
|
6cc380 |
+ ply_boot_splash_plugin_t *plugin;
|
|
|
6cc380 |
+
|
|
|
6cc380 |
+ plugin = view->plugin;
|
|
|
6cc380 |
+
|
|
|
6cc380 |
+ screen_width = ply_pixel_display_get_width (view->display);
|
|
|
6cc380 |
+ screen_height = ply_pixel_display_get_height (view->display);
|
|
|
6cc380 |
+
|
|
|
6cc380 |
+ if (plugin->background_tile_image != NULL)
|
|
|
6cc380 |
+ {
|
|
|
6cc380 |
+ ply_trace ("tiling background to %lux%lu", screen_width, screen_height);
|
|
|
6cc380 |
+ view->background_image = ply_image_tile (plugin->background_tile_image, screen_width, screen_height);
|
|
|
6cc380 |
+ }
|
|
|
6cc380 |
+
|
|
|
6cc380 |
ply_trace ("loading entry");
|
|
|
6cc380 |
if (!ply_entry_load (view->entry))
|
|
|
6cc380 |
return false;
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_trace ("loading animation");
|
|
|
6cc380 |
if (!ply_animation_load (view->end_animation))
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_trace ("Default animation wouldn't load, "
|
|
|
6cc380 |
"falling back to old naming scheme");
|
|
|
6cc380 |
|
|
|
6cc380 |
/* fallback to throbber- for compatibility
|
|
|
6cc380 |
*/
|
|
|
6cc380 |
ply_animation_free (view->end_animation);
|
|
|
6cc380 |
view->end_animation = ply_animation_new (view->plugin->animation_dir,
|
|
|
6cc380 |
"throbber-");
|
|
|
6cc380 |
if (!ply_animation_load (view->end_animation))
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_trace ("old naming scheme didn't work either");
|
|
|
6cc380 |
return false;
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_throbber_free (view->throbber);
|
|
|
6cc380 |
view->throbber = NULL;
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_trace ("loading progress animation");
|
|
|
6cc380 |
if (!ply_progress_animation_load (view->progress_animation))
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_trace ("optional progress animation wouldn't load");
|
|
|
6cc380 |
ply_progress_animation_free (view->progress_animation);
|
|
|
6cc380 |
@@ -492,60 +511,66 @@ create_plugin (ply_key_file_t *key_file)
|
|
|
6cc380 |
char *image_dir, *image_path;
|
|
|
6cc380 |
char *alignment;
|
|
|
6cc380 |
char *transition;
|
|
|
6cc380 |
char *transition_duration;
|
|
|
6cc380 |
char *color;
|
|
|
6cc380 |
char *progress_function;
|
|
|
6cc380 |
|
|
|
6cc380 |
srand ((int) ply_get_timestamp ());
|
|
|
6cc380 |
plugin = calloc (1, sizeof (ply_boot_splash_plugin_t));
|
|
|
6cc380 |
|
|
|
6cc380 |
image_dir = ply_key_file_get_value (key_file, "two-step", "ImageDir");
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_trace ("Using '%s' as working directory", image_dir);
|
|
|
6cc380 |
|
|
|
6cc380 |
asprintf (&image_path, "%s/lock.png", image_dir);
|
|
|
6cc380 |
plugin->lock_image = ply_image_new (image_path);
|
|
|
6cc380 |
free (image_path);
|
|
|
6cc380 |
|
|
|
6cc380 |
asprintf (&image_path, "%s/box.png", image_dir);
|
|
|
6cc380 |
plugin->box_image = ply_image_new (image_path);
|
|
|
6cc380 |
free (image_path);
|
|
|
6cc380 |
|
|
|
6cc380 |
asprintf (&image_path, "%s/corner-image.png", image_dir);
|
|
|
6cc380 |
plugin->corner_image = ply_image_new (image_path);
|
|
|
6cc380 |
free (image_path);
|
|
|
6cc380 |
|
|
|
6cc380 |
asprintf (&image_path, "%s/header-image.png", image_dir);
|
|
|
6cc380 |
plugin->header_image = ply_image_new (image_path);
|
|
|
6cc380 |
free (image_path);
|
|
|
6cc380 |
|
|
|
6cc380 |
+ asprintf (&image_path, "%s/background-tile.png", image_dir);
|
|
|
6cc380 |
+ plugin->background_tile_image = ply_image_new (image_path);
|
|
|
6cc380 |
+
|
|
|
6cc380 |
+ ply_trace ("loading background tile %s", image_path);
|
|
|
6cc380 |
+ free (image_path);
|
|
|
6cc380 |
+
|
|
|
6cc380 |
plugin->animation_dir = image_dir;
|
|
|
6cc380 |
|
|
|
6cc380 |
alignment = ply_key_file_get_value (key_file, "two-step", "HorizontalAlignment");
|
|
|
6cc380 |
if (alignment != NULL)
|
|
|
6cc380 |
plugin->animation_horizontal_alignment = strtod (alignment, NULL);
|
|
|
6cc380 |
else
|
|
|
6cc380 |
plugin->animation_horizontal_alignment = .5;
|
|
|
6cc380 |
free (alignment);
|
|
|
6cc380 |
|
|
|
6cc380 |
alignment = ply_key_file_get_value (key_file, "two-step", "VerticalAlignment");
|
|
|
6cc380 |
if (alignment != NULL)
|
|
|
6cc380 |
plugin->animation_vertical_alignment = strtod (alignment, NULL);
|
|
|
6cc380 |
else
|
|
|
6cc380 |
plugin->animation_vertical_alignment = .5;
|
|
|
6cc380 |
free (alignment);
|
|
|
6cc380 |
|
|
|
6cc380 |
plugin->transition = PLY_PROGRESS_ANIMATION_TRANSITION_NONE;
|
|
|
6cc380 |
transition = ply_key_file_get_value (key_file, "two-step", "Transition");
|
|
|
6cc380 |
if (transition != NULL)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
if (strcmp (transition, "fade-over") == 0)
|
|
|
6cc380 |
plugin->transition = PLY_PROGRESS_ANIMATION_TRANSITION_FADE_OVER;
|
|
|
6cc380 |
else if (strcmp (transition, "cross-fade") == 0)
|
|
|
6cc380 |
plugin->transition = PLY_PROGRESS_ANIMATION_TRANSITION_CROSS_FADE;
|
|
|
6cc380 |
else if (strcmp (transition, "merge-fade") == 0)
|
|
|
6cc380 |
plugin->transition = PLY_PROGRESS_ANIMATION_TRANSITION_MERGE_FADE;
|
|
|
6cc380 |
}
|
|
|
6cc380 |
free (transition);
|
|
|
6cc380 |
|
|
|
6cc380 |
transition_duration = ply_key_file_get_value (key_file, "two-step", "TransitionDuration");
|
|
|
6cc380 |
@@ -626,60 +651,63 @@ free_views (ply_boot_splash_plugin_t *plugin)
|
|
|
6cc380 |
plugin->views = NULL;
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
static void
|
|
|
6cc380 |
destroy_plugin (ply_boot_splash_plugin_t *plugin)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
if (plugin == NULL)
|
|
|
6cc380 |
return;
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_trace ("destroying plugin");
|
|
|
6cc380 |
|
|
|
6cc380 |
if (plugin->loop != NULL)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
stop_animation (plugin, NULL);
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_event_loop_stop_watching_for_exit (plugin->loop, (ply_event_loop_exit_handler_t)
|
|
|
6cc380 |
detach_from_event_loop,
|
|
|
6cc380 |
plugin);
|
|
|
6cc380 |
detach_from_event_loop (plugin);
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_image_free (plugin->box_image);
|
|
|
6cc380 |
ply_image_free (plugin->lock_image);
|
|
|
6cc380 |
|
|
|
6cc380 |
if (plugin->corner_image != NULL)
|
|
|
6cc380 |
ply_image_free (plugin->corner_image);
|
|
|
6cc380 |
|
|
|
6cc380 |
if (plugin->header_image != NULL)
|
|
|
6cc380 |
ply_image_free (plugin->header_image);
|
|
|
6cc380 |
|
|
|
6cc380 |
+ if (plugin->background_tile_image != NULL)
|
|
|
6cc380 |
+ ply_image_free (plugin->background_tile_image);
|
|
|
6cc380 |
+
|
|
|
6cc380 |
free (plugin->animation_dir);
|
|
|
6cc380 |
free_views (plugin);
|
|
|
6cc380 |
free (plugin);
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
static void
|
|
|
6cc380 |
start_end_animation (ply_boot_splash_plugin_t *plugin,
|
|
|
6cc380 |
ply_trigger_t *trigger)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_trace ("starting end animation");
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_list_node_t *node;
|
|
|
6cc380 |
|
|
|
6cc380 |
node = ply_list_get_first_node (plugin->views);
|
|
|
6cc380 |
while (node != NULL)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_list_node_t *next_node;
|
|
|
6cc380 |
view_t *view;
|
|
|
6cc380 |
ply_trigger_t *throbber_trigger;
|
|
|
6cc380 |
|
|
|
6cc380 |
view = ply_list_node_get_data (node);
|
|
|
6cc380 |
next_node = ply_list_get_next_node (plugin->views, node);
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_trigger_ignore_next_pull (trigger);
|
|
|
6cc380 |
|
|
|
6cc380 |
if (view->throbber != NULL)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_trace ("stopping throbber");
|
|
|
6cc380 |
view->end_trigger = trigger;
|
|
|
6cc380 |
throbber_trigger = ply_trigger_new (NULL);
|
|
|
6cc380 |
@@ -786,60 +814,67 @@ static void
|
|
|
6cc380 |
detach_from_event_loop (ply_boot_splash_plugin_t *plugin)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
plugin->loop = NULL;
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
static void
|
|
|
6cc380 |
draw_background (view_t *view,
|
|
|
6cc380 |
ply_pixel_buffer_t *pixel_buffer,
|
|
|
6cc380 |
int x,
|
|
|
6cc380 |
int y,
|
|
|
6cc380 |
int width,
|
|
|
6cc380 |
int height)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_boot_splash_plugin_t *plugin;
|
|
|
6cc380 |
ply_rectangle_t area;
|
|
|
6cc380 |
|
|
|
6cc380 |
plugin = view->plugin;
|
|
|
6cc380 |
|
|
|
6cc380 |
area.x = x;
|
|
|
6cc380 |
area.y = y;
|
|
|
6cc380 |
area.width = width;
|
|
|
6cc380 |
area.height = height;
|
|
|
6cc380 |
|
|
|
6cc380 |
if (plugin->background_start_color != plugin->background_end_color)
|
|
|
6cc380 |
ply_pixel_buffer_fill_with_gradient (pixel_buffer, &area,
|
|
|
6cc380 |
plugin->background_start_color,
|
|
|
6cc380 |
plugin->background_end_color);
|
|
|
6cc380 |
else
|
|
|
6cc380 |
ply_pixel_buffer_fill_with_hex_color (pixel_buffer, &area,
|
|
|
6cc380 |
plugin->background_start_color);
|
|
|
6cc380 |
+
|
|
|
6cc380 |
+ if (view->background_image != NULL)
|
|
|
6cc380 |
+ {
|
|
|
6cc380 |
+ uint32_t *data;
|
|
|
6cc380 |
+ data = ply_image_get_data (view->background_image);
|
|
|
6cc380 |
+ ply_pixel_buffer_fill_with_argb32_data (pixel_buffer, &area, data);
|
|
|
6cc380 |
+ }
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
static void
|
|
|
6cc380 |
on_draw (view_t *view,
|
|
|
6cc380 |
ply_pixel_buffer_t *pixel_buffer,
|
|
|
6cc380 |
int x,
|
|
|
6cc380 |
int y,
|
|
|
6cc380 |
int width,
|
|
|
6cc380 |
int height)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_boot_splash_plugin_t *plugin;
|
|
|
6cc380 |
ply_rectangle_t screen_area;
|
|
|
6cc380 |
ply_rectangle_t image_area;
|
|
|
6cc380 |
|
|
|
6cc380 |
plugin = view->plugin;
|
|
|
6cc380 |
|
|
|
6cc380 |
draw_background (view, pixel_buffer, x, y, width, height);
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_pixel_buffer_get_size (pixel_buffer, &screen_area);
|
|
|
6cc380 |
|
|
|
6cc380 |
if (plugin->state == PLY_BOOT_SPLASH_DISPLAY_QUESTION_ENTRY ||
|
|
|
6cc380 |
plugin->state == PLY_BOOT_SPLASH_DISPLAY_PASSWORD_ENTRY )
|
|
|
6cc380 |
{
|
|
|
6cc380 |
uint32_t *box_data, *lock_data;
|
|
|
6cc380 |
|
|
|
6cc380 |
box_data = ply_image_get_data (plugin->box_image);
|
|
|
6cc380 |
ply_pixel_buffer_fill_with_argb32_data (pixel_buffer,
|
|
|
6cc380 |
&view->box_area,
|
|
|
6cc380 |
box_data);
|
|
|
6cc380 |
|
|
|
6cc380 |
@@ -970,60 +1005,70 @@ show_splash_screen (ply_boot_splash_plugin_t *plugin,
|
|
|
6cc380 |
ply_trace ("loading lock image");
|
|
|
6cc380 |
if (!ply_image_load (plugin->lock_image))
|
|
|
6cc380 |
return false;
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_trace ("loading box image");
|
|
|
6cc380 |
if (!ply_image_load (plugin->box_image))
|
|
|
6cc380 |
return false;
|
|
|
6cc380 |
|
|
|
6cc380 |
if (plugin->corner_image != NULL)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_trace ("loading corner image");
|
|
|
6cc380 |
|
|
|
6cc380 |
if (!ply_image_load (plugin->corner_image))
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_image_free (plugin->corner_image);
|
|
|
6cc380 |
plugin->corner_image = NULL;
|
|
|
6cc380 |
}
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
if (plugin->header_image != NULL)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_trace ("loading header image");
|
|
|
6cc380 |
|
|
|
6cc380 |
if (!ply_image_load (plugin->header_image))
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_image_free (plugin->header_image);
|
|
|
6cc380 |
plugin->header_image = NULL;
|
|
|
6cc380 |
}
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
+ if (plugin->background_tile_image != NULL)
|
|
|
6cc380 |
+ {
|
|
|
6cc380 |
+ ply_trace ("loading background tile image");
|
|
|
6cc380 |
+ if (!ply_image_load (plugin->background_tile_image))
|
|
|
6cc380 |
+ {
|
|
|
6cc380 |
+ ply_image_free (plugin->background_tile_image);
|
|
|
6cc380 |
+ plugin->background_tile_image = NULL;
|
|
|
6cc380 |
+ }
|
|
|
6cc380 |
+ }
|
|
|
6cc380 |
+
|
|
|
6cc380 |
if (!load_views (plugin))
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_trace ("couldn't load views");
|
|
|
6cc380 |
return false;
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_event_loop_watch_for_exit (loop, (ply_event_loop_exit_handler_t)
|
|
|
6cc380 |
detach_from_event_loop,
|
|
|
6cc380 |
plugin);
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_trace ("starting boot animations");
|
|
|
6cc380 |
start_progress_animation (plugin);
|
|
|
6cc380 |
|
|
|
6cc380 |
plugin->is_visible = true;
|
|
|
6cc380 |
|
|
|
6cc380 |
return true;
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
static void
|
|
|
6cc380 |
update_status (ply_boot_splash_plugin_t *plugin,
|
|
|
6cc380 |
const char *status)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
assert (plugin != NULL);
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
static void
|
|
|
6cc380 |
on_animation_stopped (ply_boot_splash_plugin_t *plugin)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
if (plugin->idle_trigger != NULL)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
--
|
|
|
6cc380 |
1.8.3.1
|
|
|
6cc380 |
|
|
|
6cc380 |
|
|
|
6cc380 |
From 454fee71c109bfef897d9e8655d594838cd8a99b Mon Sep 17 00:00:00 2001
|
|
|
6cc380 |
From: Ray Strode <rstrode@redhat.com>
|
|
|
6cc380 |
Date: Thu, 24 Oct 2013 09:33:17 -0400
|
|
|
6cc380 |
Subject: [PATCH 4/5] two-step: add support for watermark
|
|
|
6cc380 |
|
|
|
6cc380 |
The watermark is overlaid on top of the background but below all the
|
|
|
6cc380 |
other content.
|
|
|
6cc380 |
---
|
|
|
6cc380 |
src/plugins/splash/two-step/plugin.c | 53 +++++++++++++++++++++++++++++++++++-
|
|
|
6cc380 |
1 file changed, 52 insertions(+), 1 deletion(-)
|
|
|
6cc380 |
|
|
|
6cc380 |
diff --git a/src/plugins/splash/two-step/plugin.c b/src/plugins/splash/two-step/plugin.c
|
|
|
6cc380 |
index 2c6d97a..5cf333f 100644
|
|
|
6cc380 |
--- a/src/plugins/splash/two-step/plugin.c
|
|
|
6cc380 |
+++ b/src/plugins/splash/two-step/plugin.c
|
|
|
6cc380 |
@@ -62,78 +62,82 @@
|
|
|
6cc380 |
|
|
|
6cc380 |
#ifndef FRAMES_PER_SECOND
|
|
|
6cc380 |
#define FRAMES_PER_SECOND 30
|
|
|
6cc380 |
#endif
|
|
|
6cc380 |
|
|
|
6cc380 |
#ifndef SHOW_ANIMATION_PERCENT
|
|
|
6cc380 |
#define SHOW_ANIMATION_PERCENT 0.9
|
|
|
6cc380 |
#endif
|
|
|
6cc380 |
|
|
|
6cc380 |
typedef enum {
|
|
|
6cc380 |
PLY_BOOT_SPLASH_DISPLAY_NORMAL,
|
|
|
6cc380 |
PLY_BOOT_SPLASH_DISPLAY_QUESTION_ENTRY,
|
|
|
6cc380 |
PLY_BOOT_SPLASH_DISPLAY_PASSWORD_ENTRY
|
|
|
6cc380 |
} ply_boot_splash_display_type_t;
|
|
|
6cc380 |
|
|
|
6cc380 |
typedef enum {
|
|
|
6cc380 |
PROGRESS_FUNCTION_TYPE_WWOODS,
|
|
|
6cc380 |
PROGRESS_FUNCTION_TYPE_LINEAR,
|
|
|
6cc380 |
} progress_function_t;
|
|
|
6cc380 |
|
|
|
6cc380 |
typedef struct
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_boot_splash_plugin_t *plugin;
|
|
|
6cc380 |
ply_pixel_display_t *display;
|
|
|
6cc380 |
ply_entry_t *entry;
|
|
|
6cc380 |
ply_animation_t *end_animation;
|
|
|
6cc380 |
ply_progress_animation_t *progress_animation;
|
|
|
6cc380 |
ply_throbber_t *throbber;
|
|
|
6cc380 |
ply_label_t *label;
|
|
|
6cc380 |
ply_label_t *message_label;
|
|
|
6cc380 |
- ply_rectangle_t box_area, lock_area;
|
|
|
6cc380 |
+ ply_rectangle_t box_area, lock_area, watermark_area;
|
|
|
6cc380 |
ply_trigger_t *end_trigger;
|
|
|
6cc380 |
ply_image_t *background_image;
|
|
|
6cc380 |
} view_t;
|
|
|
6cc380 |
|
|
|
6cc380 |
struct _ply_boot_splash_plugin
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_event_loop_t *loop;
|
|
|
6cc380 |
ply_boot_splash_mode_t mode;
|
|
|
6cc380 |
ply_image_t *lock_image;
|
|
|
6cc380 |
ply_image_t *box_image;
|
|
|
6cc380 |
ply_image_t *corner_image;
|
|
|
6cc380 |
ply_image_t *header_image;
|
|
|
6cc380 |
ply_image_t *background_tile_image;
|
|
|
6cc380 |
+ ply_image_t *watermark_image;
|
|
|
6cc380 |
ply_list_t *views;
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_boot_splash_display_type_t state;
|
|
|
6cc380 |
|
|
|
6cc380 |
+ double watermark_horizontal_alignment;
|
|
|
6cc380 |
+ double watermark_vertical_alignment;
|
|
|
6cc380 |
+
|
|
|
6cc380 |
double animation_horizontal_alignment;
|
|
|
6cc380 |
double animation_vertical_alignment;
|
|
|
6cc380 |
char *animation_dir;
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_progress_animation_transition_t transition;
|
|
|
6cc380 |
double transition_duration;
|
|
|
6cc380 |
|
|
|
6cc380 |
uint32_t background_start_color;
|
|
|
6cc380 |
uint32_t background_end_color;
|
|
|
6cc380 |
|
|
|
6cc380 |
progress_function_t progress_function;
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_trigger_t *idle_trigger;
|
|
|
6cc380 |
ply_trigger_t *stop_trigger;
|
|
|
6cc380 |
|
|
|
6cc380 |
uint32_t root_is_mounted : 1;
|
|
|
6cc380 |
uint32_t is_visible : 1;
|
|
|
6cc380 |
uint32_t is_animating : 1;
|
|
|
6cc380 |
uint32_t is_idle : 1;
|
|
|
6cc380 |
};
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_boot_splash_plugin_interface_t * ply_boot_splash_plugin_get_interface (void);
|
|
|
6cc380 |
|
|
|
6cc380 |
static void stop_animation (ply_boot_splash_plugin_t *plugin,
|
|
|
6cc380 |
ply_trigger_t *idle_trigger);
|
|
|
6cc380 |
|
|
|
6cc380 |
static void detach_from_event_loop (ply_boot_splash_plugin_t *plugin);
|
|
|
6cc380 |
static void display_message (ply_boot_splash_plugin_t *plugin,
|
|
|
6cc380 |
const char *message);
|
|
|
6cc380 |
static void become_idle (ply_boot_splash_plugin_t *plugin,
|
|
|
6cc380 |
@@ -174,60 +178,68 @@ view_free (view_t *view)
|
|
|
6cc380 |
ply_entry_free (view->entry);
|
|
|
6cc380 |
ply_animation_free (view->end_animation);
|
|
|
6cc380 |
ply_progress_animation_free (view->progress_animation);
|
|
|
6cc380 |
ply_throbber_free (view->throbber);
|
|
|
6cc380 |
ply_label_free (view->label);
|
|
|
6cc380 |
ply_label_free (view->message_label);
|
|
|
6cc380 |
|
|
|
6cc380 |
if (view->background_image != NULL)
|
|
|
6cc380 |
ply_image_free (view->background_image);
|
|
|
6cc380 |
|
|
|
6cc380 |
free (view);
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
static bool
|
|
|
6cc380 |
view_load (view_t *view)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
unsigned long screen_width, screen_height;
|
|
|
6cc380 |
ply_boot_splash_plugin_t *plugin;
|
|
|
6cc380 |
|
|
|
6cc380 |
plugin = view->plugin;
|
|
|
6cc380 |
|
|
|
6cc380 |
screen_width = ply_pixel_display_get_width (view->display);
|
|
|
6cc380 |
screen_height = ply_pixel_display_get_height (view->display);
|
|
|
6cc380 |
|
|
|
6cc380 |
if (plugin->background_tile_image != NULL)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_trace ("tiling background to %lux%lu", screen_width, screen_height);
|
|
|
6cc380 |
view->background_image = ply_image_tile (plugin->background_tile_image, screen_width, screen_height);
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
+ if (plugin->watermark_image != NULL)
|
|
|
6cc380 |
+ {
|
|
|
6cc380 |
+ view->watermark_area.width = ply_image_get_width (plugin->watermark_image);
|
|
|
6cc380 |
+ view->watermark_area.height = ply_image_get_height (plugin->watermark_image);
|
|
|
6cc380 |
+ view->watermark_area.x = screen_width * plugin->watermark_horizontal_alignment - ply_image_get_width (plugin->watermark_image) * plugin->watermark_horizontal_alignment;
|
|
|
6cc380 |
+ view->watermark_area.y = screen_height * plugin->watermark_vertical_alignment - ply_image_get_height (plugin->watermark_image) * plugin->watermark_vertical_alignment;
|
|
|
6cc380 |
+ }
|
|
|
6cc380 |
+
|
|
|
6cc380 |
ply_trace ("loading entry");
|
|
|
6cc380 |
if (!ply_entry_load (view->entry))
|
|
|
6cc380 |
return false;
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_trace ("loading animation");
|
|
|
6cc380 |
if (!ply_animation_load (view->end_animation))
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_trace ("Default animation wouldn't load, "
|
|
|
6cc380 |
"falling back to old naming scheme");
|
|
|
6cc380 |
|
|
|
6cc380 |
/* fallback to throbber- for compatibility
|
|
|
6cc380 |
*/
|
|
|
6cc380 |
ply_animation_free (view->end_animation);
|
|
|
6cc380 |
view->end_animation = ply_animation_new (view->plugin->animation_dir,
|
|
|
6cc380 |
"throbber-");
|
|
|
6cc380 |
if (!ply_animation_load (view->end_animation))
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_trace ("old naming scheme didn't work either");
|
|
|
6cc380 |
return false;
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_throbber_free (view->throbber);
|
|
|
6cc380 |
view->throbber = NULL;
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_trace ("loading progress animation");
|
|
|
6cc380 |
if (!ply_progress_animation_load (view->progress_animation))
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_trace ("optional progress animation wouldn't load");
|
|
|
6cc380 |
ply_progress_animation_free (view->progress_animation);
|
|
|
6cc380 |
@@ -517,76 +529,94 @@ create_plugin (ply_key_file_t *key_file)
|
|
|
6cc380 |
|
|
|
6cc380 |
srand ((int) ply_get_timestamp ());
|
|
|
6cc380 |
plugin = calloc (1, sizeof (ply_boot_splash_plugin_t));
|
|
|
6cc380 |
|
|
|
6cc380 |
image_dir = ply_key_file_get_value (key_file, "two-step", "ImageDir");
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_trace ("Using '%s' as working directory", image_dir);
|
|
|
6cc380 |
|
|
|
6cc380 |
asprintf (&image_path, "%s/lock.png", image_dir);
|
|
|
6cc380 |
plugin->lock_image = ply_image_new (image_path);
|
|
|
6cc380 |
free (image_path);
|
|
|
6cc380 |
|
|
|
6cc380 |
asprintf (&image_path, "%s/box.png", image_dir);
|
|
|
6cc380 |
plugin->box_image = ply_image_new (image_path);
|
|
|
6cc380 |
free (image_path);
|
|
|
6cc380 |
|
|
|
6cc380 |
asprintf (&image_path, "%s/corner-image.png", image_dir);
|
|
|
6cc380 |
plugin->corner_image = ply_image_new (image_path);
|
|
|
6cc380 |
free (image_path);
|
|
|
6cc380 |
|
|
|
6cc380 |
asprintf (&image_path, "%s/header-image.png", image_dir);
|
|
|
6cc380 |
plugin->header_image = ply_image_new (image_path);
|
|
|
6cc380 |
free (image_path);
|
|
|
6cc380 |
|
|
|
6cc380 |
asprintf (&image_path, "%s/background-tile.png", image_dir);
|
|
|
6cc380 |
plugin->background_tile_image = ply_image_new (image_path);
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_trace ("loading background tile %s", image_path);
|
|
|
6cc380 |
free (image_path);
|
|
|
6cc380 |
|
|
|
6cc380 |
+ asprintf (&image_path, "%s/watermark.png", image_dir);
|
|
|
6cc380 |
+ plugin->watermark_image = ply_image_new (image_path);
|
|
|
6cc380 |
+ free (image_path);
|
|
|
6cc380 |
+
|
|
|
6cc380 |
plugin->animation_dir = image_dir;
|
|
|
6cc380 |
|
|
|
6cc380 |
alignment = ply_key_file_get_value (key_file, "two-step", "HorizontalAlignment");
|
|
|
6cc380 |
if (alignment != NULL)
|
|
|
6cc380 |
plugin->animation_horizontal_alignment = strtod (alignment, NULL);
|
|
|
6cc380 |
else
|
|
|
6cc380 |
plugin->animation_horizontal_alignment = .5;
|
|
|
6cc380 |
free (alignment);
|
|
|
6cc380 |
|
|
|
6cc380 |
alignment = ply_key_file_get_value (key_file, "two-step", "VerticalAlignment");
|
|
|
6cc380 |
if (alignment != NULL)
|
|
|
6cc380 |
plugin->animation_vertical_alignment = strtod (alignment, NULL);
|
|
|
6cc380 |
else
|
|
|
6cc380 |
plugin->animation_vertical_alignment = .5;
|
|
|
6cc380 |
free (alignment);
|
|
|
6cc380 |
|
|
|
6cc380 |
+ alignment = ply_key_file_get_value (key_file, "two-step", "WatermarkHorizontalAlignment");
|
|
|
6cc380 |
+ if (alignment != NULL)
|
|
|
6cc380 |
+ plugin->watermark_horizontal_alignment = strtod (alignment, NULL);
|
|
|
6cc380 |
+ else
|
|
|
6cc380 |
+ plugin->watermark_horizontal_alignment = 1.0;
|
|
|
6cc380 |
+ free (alignment);
|
|
|
6cc380 |
+
|
|
|
6cc380 |
+ alignment = ply_key_file_get_value (key_file, "two-step", "WatermarkVerticalAlignment");
|
|
|
6cc380 |
+ if (alignment != NULL)
|
|
|
6cc380 |
+ plugin->watermark_vertical_alignment = strtod (alignment, NULL);
|
|
|
6cc380 |
+ else
|
|
|
6cc380 |
+ plugin->watermark_vertical_alignment = .5;
|
|
|
6cc380 |
+ free (alignment);
|
|
|
6cc380 |
+
|
|
|
6cc380 |
plugin->transition = PLY_PROGRESS_ANIMATION_TRANSITION_NONE;
|
|
|
6cc380 |
transition = ply_key_file_get_value (key_file, "two-step", "Transition");
|
|
|
6cc380 |
if (transition != NULL)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
if (strcmp (transition, "fade-over") == 0)
|
|
|
6cc380 |
plugin->transition = PLY_PROGRESS_ANIMATION_TRANSITION_FADE_OVER;
|
|
|
6cc380 |
else if (strcmp (transition, "cross-fade") == 0)
|
|
|
6cc380 |
plugin->transition = PLY_PROGRESS_ANIMATION_TRANSITION_CROSS_FADE;
|
|
|
6cc380 |
else if (strcmp (transition, "merge-fade") == 0)
|
|
|
6cc380 |
plugin->transition = PLY_PROGRESS_ANIMATION_TRANSITION_MERGE_FADE;
|
|
|
6cc380 |
}
|
|
|
6cc380 |
free (transition);
|
|
|
6cc380 |
|
|
|
6cc380 |
transition_duration = ply_key_file_get_value (key_file, "two-step", "TransitionDuration");
|
|
|
6cc380 |
if (transition_duration != NULL)
|
|
|
6cc380 |
plugin->transition_duration = strtod (transition_duration, NULL);
|
|
|
6cc380 |
else
|
|
|
6cc380 |
plugin->transition_duration = 0.0;
|
|
|
6cc380 |
free (transition_duration);
|
|
|
6cc380 |
|
|
|
6cc380 |
color = ply_key_file_get_value (key_file, "two-step", "BackgroundStartColor");
|
|
|
6cc380 |
|
|
|
6cc380 |
if (color != NULL)
|
|
|
6cc380 |
plugin->background_start_color = strtol (color, NULL, 0);
|
|
|
6cc380 |
else
|
|
|
6cc380 |
plugin->background_start_color = PLYMOUTH_BACKGROUND_START_COLOR;
|
|
|
6cc380 |
|
|
|
6cc380 |
free (color);
|
|
|
6cc380 |
|
|
|
6cc380 |
color = ply_key_file_get_value (key_file, "two-step", "BackgroundEndColor");
|
|
|
6cc380 |
@@ -654,60 +684,63 @@ free_views (ply_boot_splash_plugin_t *plugin)
|
|
|
6cc380 |
static void
|
|
|
6cc380 |
destroy_plugin (ply_boot_splash_plugin_t *plugin)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
if (plugin == NULL)
|
|
|
6cc380 |
return;
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_trace ("destroying plugin");
|
|
|
6cc380 |
|
|
|
6cc380 |
if (plugin->loop != NULL)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
stop_animation (plugin, NULL);
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_event_loop_stop_watching_for_exit (plugin->loop, (ply_event_loop_exit_handler_t)
|
|
|
6cc380 |
detach_from_event_loop,
|
|
|
6cc380 |
plugin);
|
|
|
6cc380 |
detach_from_event_loop (plugin);
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_image_free (plugin->box_image);
|
|
|
6cc380 |
ply_image_free (plugin->lock_image);
|
|
|
6cc380 |
|
|
|
6cc380 |
if (plugin->corner_image != NULL)
|
|
|
6cc380 |
ply_image_free (plugin->corner_image);
|
|
|
6cc380 |
|
|
|
6cc380 |
if (plugin->header_image != NULL)
|
|
|
6cc380 |
ply_image_free (plugin->header_image);
|
|
|
6cc380 |
|
|
|
6cc380 |
if (plugin->background_tile_image != NULL)
|
|
|
6cc380 |
ply_image_free (plugin->background_tile_image);
|
|
|
6cc380 |
|
|
|
6cc380 |
+ if (plugin->watermark_image != NULL)
|
|
|
6cc380 |
+ ply_image_free (plugin->watermark_image);
|
|
|
6cc380 |
+
|
|
|
6cc380 |
free (plugin->animation_dir);
|
|
|
6cc380 |
free_views (plugin);
|
|
|
6cc380 |
free (plugin);
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
static void
|
|
|
6cc380 |
start_end_animation (ply_boot_splash_plugin_t *plugin,
|
|
|
6cc380 |
ply_trigger_t *trigger)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_trace ("starting end animation");
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_list_node_t *node;
|
|
|
6cc380 |
|
|
|
6cc380 |
node = ply_list_get_first_node (plugin->views);
|
|
|
6cc380 |
while (node != NULL)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_list_node_t *next_node;
|
|
|
6cc380 |
view_t *view;
|
|
|
6cc380 |
ply_trigger_t *throbber_trigger;
|
|
|
6cc380 |
|
|
|
6cc380 |
view = ply_list_node_get_data (node);
|
|
|
6cc380 |
next_node = ply_list_get_next_node (plugin->views, node);
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_trigger_ignore_next_pull (trigger);
|
|
|
6cc380 |
|
|
|
6cc380 |
if (view->throbber != NULL)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_trace ("stopping throbber");
|
|
|
6cc380 |
view->end_trigger = trigger;
|
|
|
6cc380 |
throbber_trigger = ply_trigger_new (NULL);
|
|
|
6cc380 |
@@ -821,60 +854,68 @@ draw_background (view_t *view,
|
|
|
6cc380 |
ply_pixel_buffer_t *pixel_buffer,
|
|
|
6cc380 |
int x,
|
|
|
6cc380 |
int y,
|
|
|
6cc380 |
int width,
|
|
|
6cc380 |
int height)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_boot_splash_plugin_t *plugin;
|
|
|
6cc380 |
ply_rectangle_t area;
|
|
|
6cc380 |
|
|
|
6cc380 |
plugin = view->plugin;
|
|
|
6cc380 |
|
|
|
6cc380 |
area.x = x;
|
|
|
6cc380 |
area.y = y;
|
|
|
6cc380 |
area.width = width;
|
|
|
6cc380 |
area.height = height;
|
|
|
6cc380 |
|
|
|
6cc380 |
if (plugin->background_start_color != plugin->background_end_color)
|
|
|
6cc380 |
ply_pixel_buffer_fill_with_gradient (pixel_buffer, &area,
|
|
|
6cc380 |
plugin->background_start_color,
|
|
|
6cc380 |
plugin->background_end_color);
|
|
|
6cc380 |
else
|
|
|
6cc380 |
ply_pixel_buffer_fill_with_hex_color (pixel_buffer, &area,
|
|
|
6cc380 |
plugin->background_start_color);
|
|
|
6cc380 |
|
|
|
6cc380 |
if (view->background_image != NULL)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
uint32_t *data;
|
|
|
6cc380 |
data = ply_image_get_data (view->background_image);
|
|
|
6cc380 |
ply_pixel_buffer_fill_with_argb32_data (pixel_buffer, &area, data);
|
|
|
6cc380 |
}
|
|
|
6cc380 |
+
|
|
|
6cc380 |
+ if (plugin->watermark_image != NULL)
|
|
|
6cc380 |
+ {
|
|
|
6cc380 |
+ uint32_t *data;
|
|
|
6cc380 |
+
|
|
|
6cc380 |
+ data = ply_image_get_data (plugin->watermark_image);
|
|
|
6cc380 |
+ ply_pixel_buffer_fill_with_argb32_data (pixel_buffer, &view->watermark_area, data);
|
|
|
6cc380 |
+ }
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
static void
|
|
|
6cc380 |
on_draw (view_t *view,
|
|
|
6cc380 |
ply_pixel_buffer_t *pixel_buffer,
|
|
|
6cc380 |
int x,
|
|
|
6cc380 |
int y,
|
|
|
6cc380 |
int width,
|
|
|
6cc380 |
int height)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_boot_splash_plugin_t *plugin;
|
|
|
6cc380 |
ply_rectangle_t screen_area;
|
|
|
6cc380 |
ply_rectangle_t image_area;
|
|
|
6cc380 |
|
|
|
6cc380 |
plugin = view->plugin;
|
|
|
6cc380 |
|
|
|
6cc380 |
draw_background (view, pixel_buffer, x, y, width, height);
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_pixel_buffer_get_size (pixel_buffer, &screen_area);
|
|
|
6cc380 |
|
|
|
6cc380 |
if (plugin->state == PLY_BOOT_SPLASH_DISPLAY_QUESTION_ENTRY ||
|
|
|
6cc380 |
plugin->state == PLY_BOOT_SPLASH_DISPLAY_PASSWORD_ENTRY )
|
|
|
6cc380 |
{
|
|
|
6cc380 |
uint32_t *box_data, *lock_data;
|
|
|
6cc380 |
|
|
|
6cc380 |
box_data = ply_image_get_data (plugin->box_image);
|
|
|
6cc380 |
ply_pixel_buffer_fill_with_argb32_data (pixel_buffer,
|
|
|
6cc380 |
&view->box_area,
|
|
|
6cc380 |
box_data);
|
|
|
6cc380 |
|
|
|
6cc380 |
@@ -1015,60 +1056,70 @@ show_splash_screen (ply_boot_splash_plugin_t *plugin,
|
|
|
6cc380 |
ply_trace ("loading corner image");
|
|
|
6cc380 |
|
|
|
6cc380 |
if (!ply_image_load (plugin->corner_image))
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_image_free (plugin->corner_image);
|
|
|
6cc380 |
plugin->corner_image = NULL;
|
|
|
6cc380 |
}
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
if (plugin->header_image != NULL)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_trace ("loading header image");
|
|
|
6cc380 |
|
|
|
6cc380 |
if (!ply_image_load (plugin->header_image))
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_image_free (plugin->header_image);
|
|
|
6cc380 |
plugin->header_image = NULL;
|
|
|
6cc380 |
}
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
if (plugin->background_tile_image != NULL)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_trace ("loading background tile image");
|
|
|
6cc380 |
if (!ply_image_load (plugin->background_tile_image))
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_image_free (plugin->background_tile_image);
|
|
|
6cc380 |
plugin->background_tile_image = NULL;
|
|
|
6cc380 |
}
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
+ if (plugin->watermark_image != NULL)
|
|
|
6cc380 |
+ {
|
|
|
6cc380 |
+ ply_trace ("loading watermark image");
|
|
|
6cc380 |
+ if (!ply_image_load (plugin->watermark_image))
|
|
|
6cc380 |
+ {
|
|
|
6cc380 |
+ ply_image_free (plugin->watermark_image);
|
|
|
6cc380 |
+ plugin->watermark_image = NULL;
|
|
|
6cc380 |
+ }
|
|
|
6cc380 |
+ }
|
|
|
6cc380 |
+
|
|
|
6cc380 |
if (!load_views (plugin))
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_trace ("couldn't load views");
|
|
|
6cc380 |
return false;
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_event_loop_watch_for_exit (loop, (ply_event_loop_exit_handler_t)
|
|
|
6cc380 |
detach_from_event_loop,
|
|
|
6cc380 |
plugin);
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_trace ("starting boot animations");
|
|
|
6cc380 |
start_progress_animation (plugin);
|
|
|
6cc380 |
|
|
|
6cc380 |
plugin->is_visible = true;
|
|
|
6cc380 |
|
|
|
6cc380 |
return true;
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
static void
|
|
|
6cc380 |
update_status (ply_boot_splash_plugin_t *plugin,
|
|
|
6cc380 |
const char *status)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
assert (plugin != NULL);
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
static void
|
|
|
6cc380 |
on_animation_stopped (ply_boot_splash_plugin_t *plugin)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
if (plugin->idle_trigger != NULL)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
--
|
|
|
6cc380 |
1.8.3.1
|
|
|
6cc380 |
|
|
|
6cc380 |
|
|
|
6cc380 |
From 2ce951c56b4ffa26803072789a6f8d16e4cdca3a Mon Sep 17 00:00:00 2001
|
|
|
6cc380 |
From: Ray Strode <rstrode@redhat.com>
|
|
|
6cc380 |
Date: Fri, 25 Oct 2013 16:24:47 -0400
|
|
|
6cc380 |
Subject: [PATCH 5/5] two-step: introduce delayed startup
|
|
|
6cc380 |
|
|
|
6cc380 |
Many machines these days can boot in 5 seconds or less.
|
|
|
6cc380 |
In those cases, there's little point in showing a boot splash.
|
|
|
6cc380 |
|
|
|
6cc380 |
This commit introduces a StartupDelay option to the two step
|
|
|
6cc380 |
plugin to prevent it from displaying anything for a few seconds.
|
|
|
6cc380 |
---
|
|
|
6cc380 |
src/plugins/splash/two-step/plugin.c | 45 ++++++++++++++++++++++++++++++++++++
|
|
|
6cc380 |
1 file changed, 45 insertions(+)
|
|
|
6cc380 |
|
|
|
6cc380 |
diff --git a/src/plugins/splash/two-step/plugin.c b/src/plugins/splash/two-step/plugin.c
|
|
|
6cc380 |
index 5cf333f..fff928c 100644
|
|
|
6cc380 |
--- a/src/plugins/splash/two-step/plugin.c
|
|
|
6cc380 |
+++ b/src/plugins/splash/two-step/plugin.c
|
|
|
6cc380 |
@@ -65,135 +65,141 @@
|
|
|
6cc380 |
#endif
|
|
|
6cc380 |
|
|
|
6cc380 |
#ifndef SHOW_ANIMATION_PERCENT
|
|
|
6cc380 |
#define SHOW_ANIMATION_PERCENT 0.9
|
|
|
6cc380 |
#endif
|
|
|
6cc380 |
|
|
|
6cc380 |
typedef enum {
|
|
|
6cc380 |
PLY_BOOT_SPLASH_DISPLAY_NORMAL,
|
|
|
6cc380 |
PLY_BOOT_SPLASH_DISPLAY_QUESTION_ENTRY,
|
|
|
6cc380 |
PLY_BOOT_SPLASH_DISPLAY_PASSWORD_ENTRY
|
|
|
6cc380 |
} ply_boot_splash_display_type_t;
|
|
|
6cc380 |
|
|
|
6cc380 |
typedef enum {
|
|
|
6cc380 |
PROGRESS_FUNCTION_TYPE_WWOODS,
|
|
|
6cc380 |
PROGRESS_FUNCTION_TYPE_LINEAR,
|
|
|
6cc380 |
} progress_function_t;
|
|
|
6cc380 |
|
|
|
6cc380 |
typedef struct
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_boot_splash_plugin_t *plugin;
|
|
|
6cc380 |
ply_pixel_display_t *display;
|
|
|
6cc380 |
ply_entry_t *entry;
|
|
|
6cc380 |
ply_animation_t *end_animation;
|
|
|
6cc380 |
ply_progress_animation_t *progress_animation;
|
|
|
6cc380 |
ply_throbber_t *throbber;
|
|
|
6cc380 |
ply_label_t *label;
|
|
|
6cc380 |
ply_label_t *message_label;
|
|
|
6cc380 |
ply_rectangle_t box_area, lock_area, watermark_area;
|
|
|
6cc380 |
ply_trigger_t *end_trigger;
|
|
|
6cc380 |
ply_image_t *background_image;
|
|
|
6cc380 |
+
|
|
|
6cc380 |
+ uint32_t is_blank : 1;
|
|
|
6cc380 |
} view_t;
|
|
|
6cc380 |
|
|
|
6cc380 |
struct _ply_boot_splash_plugin
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_event_loop_t *loop;
|
|
|
6cc380 |
ply_boot_splash_mode_t mode;
|
|
|
6cc380 |
ply_image_t *lock_image;
|
|
|
6cc380 |
ply_image_t *box_image;
|
|
|
6cc380 |
ply_image_t *corner_image;
|
|
|
6cc380 |
ply_image_t *header_image;
|
|
|
6cc380 |
ply_image_t *background_tile_image;
|
|
|
6cc380 |
ply_image_t *watermark_image;
|
|
|
6cc380 |
ply_list_t *views;
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_boot_splash_display_type_t state;
|
|
|
6cc380 |
|
|
|
6cc380 |
double watermark_horizontal_alignment;
|
|
|
6cc380 |
double watermark_vertical_alignment;
|
|
|
6cc380 |
|
|
|
6cc380 |
double animation_horizontal_alignment;
|
|
|
6cc380 |
double animation_vertical_alignment;
|
|
|
6cc380 |
char *animation_dir;
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_progress_animation_transition_t transition;
|
|
|
6cc380 |
double transition_duration;
|
|
|
6cc380 |
|
|
|
6cc380 |
uint32_t background_start_color;
|
|
|
6cc380 |
uint32_t background_end_color;
|
|
|
6cc380 |
|
|
|
6cc380 |
progress_function_t progress_function;
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_trigger_t *idle_trigger;
|
|
|
6cc380 |
ply_trigger_t *stop_trigger;
|
|
|
6cc380 |
|
|
|
6cc380 |
+ double start_time;
|
|
|
6cc380 |
+ double startup_delay;
|
|
|
6cc380 |
+
|
|
|
6cc380 |
uint32_t root_is_mounted : 1;
|
|
|
6cc380 |
uint32_t is_visible : 1;
|
|
|
6cc380 |
uint32_t is_animating : 1;
|
|
|
6cc380 |
uint32_t is_idle : 1;
|
|
|
6cc380 |
};
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_boot_splash_plugin_interface_t * ply_boot_splash_plugin_get_interface (void);
|
|
|
6cc380 |
|
|
|
6cc380 |
static void stop_animation (ply_boot_splash_plugin_t *plugin,
|
|
|
6cc380 |
ply_trigger_t *idle_trigger);
|
|
|
6cc380 |
|
|
|
6cc380 |
static void detach_from_event_loop (ply_boot_splash_plugin_t *plugin);
|
|
|
6cc380 |
static void display_message (ply_boot_splash_plugin_t *plugin,
|
|
|
6cc380 |
const char *message);
|
|
|
6cc380 |
static void become_idle (ply_boot_splash_plugin_t *plugin,
|
|
|
6cc380 |
ply_trigger_t *idle_trigger);
|
|
|
6cc380 |
|
|
|
6cc380 |
static view_t *
|
|
|
6cc380 |
view_new (ply_boot_splash_plugin_t *plugin,
|
|
|
6cc380 |
ply_pixel_display_t *display)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
view_t *view;
|
|
|
6cc380 |
|
|
|
6cc380 |
view = calloc (1, sizeof (view_t));
|
|
|
6cc380 |
view->plugin = plugin;
|
|
|
6cc380 |
view->display = display;
|
|
|
6cc380 |
|
|
|
6cc380 |
view->entry = ply_entry_new (plugin->animation_dir);
|
|
|
6cc380 |
view->end_animation = ply_animation_new (plugin->animation_dir,
|
|
|
6cc380 |
"animation-");
|
|
|
6cc380 |
view->progress_animation = ply_progress_animation_new (plugin->animation_dir,
|
|
|
6cc380 |
"progress-");
|
|
|
6cc380 |
|
|
|
6cc380 |
view->throbber = ply_throbber_new (plugin->animation_dir,
|
|
|
6cc380 |
"throbber-");
|
|
|
6cc380 |
ply_progress_animation_set_transition (view->progress_animation,
|
|
|
6cc380 |
plugin->transition,
|
|
|
6cc380 |
plugin->transition_duration);
|
|
|
6cc380 |
|
|
|
6cc380 |
view->label = ply_label_new ();
|
|
|
6cc380 |
view->message_label = ply_label_new ();
|
|
|
6cc380 |
+ view->is_blank = true;
|
|
|
6cc380 |
|
|
|
6cc380 |
return view;
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
static void
|
|
|
6cc380 |
view_free (view_t *view)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_entry_free (view->entry);
|
|
|
6cc380 |
ply_animation_free (view->end_animation);
|
|
|
6cc380 |
ply_progress_animation_free (view->progress_animation);
|
|
|
6cc380 |
ply_throbber_free (view->throbber);
|
|
|
6cc380 |
ply_label_free (view->label);
|
|
|
6cc380 |
ply_label_free (view->message_label);
|
|
|
6cc380 |
|
|
|
6cc380 |
if (view->background_image != NULL)
|
|
|
6cc380 |
ply_image_free (view->background_image);
|
|
|
6cc380 |
|
|
|
6cc380 |
free (view);
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
static bool
|
|
|
6cc380 |
view_load (view_t *view)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
unsigned long screen_width, screen_height;
|
|
|
6cc380 |
ply_boot_splash_plugin_t *plugin;
|
|
|
6cc380 |
|
|
|
6cc380 |
plugin = view->plugin;
|
|
|
6cc380 |
|
|
|
6cc380 |
screen_width = ply_pixel_display_get_width (view->display);
|
|
|
6cc380 |
@@ -494,101 +500,111 @@ view_show_prompt (view_t *view,
|
|
|
6cc380 |
if (prompt != NULL)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_label_set_text (view->label, prompt);
|
|
|
6cc380 |
|
|
|
6cc380 |
/* We center the prompt in the middle and use 80% of the horizontal space */
|
|
|
6cc380 |
int label_width = screen_width * 100 / 80;
|
|
|
6cc380 |
ply_label_set_alignment (view->label, PLY_LABEL_ALIGN_CENTER);
|
|
|
6cc380 |
ply_label_set_width (view->label, label_width);
|
|
|
6cc380 |
|
|
|
6cc380 |
x = (screen_width - label_width) / 2;
|
|
|
6cc380 |
y = view->box_area.y + view->box_area.height;
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_label_show (view->label, view->display, x, y);
|
|
|
6cc380 |
}
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
static void
|
|
|
6cc380 |
view_hide_prompt (view_t *view)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
assert (view != NULL);
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_entry_hide (view->entry);
|
|
|
6cc380 |
ply_label_hide (view->label);
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
static ply_boot_splash_plugin_t *
|
|
|
6cc380 |
create_plugin (ply_key_file_t *key_file)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_boot_splash_plugin_t *plugin;
|
|
|
6cc380 |
char *image_dir, *image_path;
|
|
|
6cc380 |
+ char *startup_delay;
|
|
|
6cc380 |
char *alignment;
|
|
|
6cc380 |
char *transition;
|
|
|
6cc380 |
char *transition_duration;
|
|
|
6cc380 |
char *color;
|
|
|
6cc380 |
char *progress_function;
|
|
|
6cc380 |
|
|
|
6cc380 |
srand ((int) ply_get_timestamp ());
|
|
|
6cc380 |
plugin = calloc (1, sizeof (ply_boot_splash_plugin_t));
|
|
|
6cc380 |
|
|
|
6cc380 |
+ plugin->start_time = ply_get_timestamp ();
|
|
|
6cc380 |
+
|
|
|
6cc380 |
image_dir = ply_key_file_get_value (key_file, "two-step", "ImageDir");
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_trace ("Using '%s' as working directory", image_dir);
|
|
|
6cc380 |
|
|
|
6cc380 |
asprintf (&image_path, "%s/lock.png", image_dir);
|
|
|
6cc380 |
plugin->lock_image = ply_image_new (image_path);
|
|
|
6cc380 |
free (image_path);
|
|
|
6cc380 |
|
|
|
6cc380 |
asprintf (&image_path, "%s/box.png", image_dir);
|
|
|
6cc380 |
plugin->box_image = ply_image_new (image_path);
|
|
|
6cc380 |
free (image_path);
|
|
|
6cc380 |
|
|
|
6cc380 |
asprintf (&image_path, "%s/corner-image.png", image_dir);
|
|
|
6cc380 |
plugin->corner_image = ply_image_new (image_path);
|
|
|
6cc380 |
free (image_path);
|
|
|
6cc380 |
|
|
|
6cc380 |
asprintf (&image_path, "%s/header-image.png", image_dir);
|
|
|
6cc380 |
plugin->header_image = ply_image_new (image_path);
|
|
|
6cc380 |
free (image_path);
|
|
|
6cc380 |
|
|
|
6cc380 |
asprintf (&image_path, "%s/background-tile.png", image_dir);
|
|
|
6cc380 |
plugin->background_tile_image = ply_image_new (image_path);
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_trace ("loading background tile %s", image_path);
|
|
|
6cc380 |
free (image_path);
|
|
|
6cc380 |
|
|
|
6cc380 |
asprintf (&image_path, "%s/watermark.png", image_dir);
|
|
|
6cc380 |
plugin->watermark_image = ply_image_new (image_path);
|
|
|
6cc380 |
free (image_path);
|
|
|
6cc380 |
|
|
|
6cc380 |
plugin->animation_dir = image_dir;
|
|
|
6cc380 |
|
|
|
6cc380 |
+ startup_delay = ply_key_file_get_value (key_file, "two-step", "StartupDelay");
|
|
|
6cc380 |
+ if (startup_delay != NULL)
|
|
|
6cc380 |
+ plugin->startup_delay = strtod (startup_delay, NULL);
|
|
|
6cc380 |
+ else
|
|
|
6cc380 |
+ plugin->startup_delay = 5.0;
|
|
|
6cc380 |
+ free (startup_delay);
|
|
|
6cc380 |
+
|
|
|
6cc380 |
alignment = ply_key_file_get_value (key_file, "two-step", "HorizontalAlignment");
|
|
|
6cc380 |
if (alignment != NULL)
|
|
|
6cc380 |
plugin->animation_horizontal_alignment = strtod (alignment, NULL);
|
|
|
6cc380 |
else
|
|
|
6cc380 |
plugin->animation_horizontal_alignment = .5;
|
|
|
6cc380 |
free (alignment);
|
|
|
6cc380 |
|
|
|
6cc380 |
alignment = ply_key_file_get_value (key_file, "two-step", "VerticalAlignment");
|
|
|
6cc380 |
if (alignment != NULL)
|
|
|
6cc380 |
plugin->animation_vertical_alignment = strtod (alignment, NULL);
|
|
|
6cc380 |
else
|
|
|
6cc380 |
plugin->animation_vertical_alignment = .5;
|
|
|
6cc380 |
free (alignment);
|
|
|
6cc380 |
|
|
|
6cc380 |
alignment = ply_key_file_get_value (key_file, "two-step", "WatermarkHorizontalAlignment");
|
|
|
6cc380 |
if (alignment != NULL)
|
|
|
6cc380 |
plugin->watermark_horizontal_alignment = strtod (alignment, NULL);
|
|
|
6cc380 |
else
|
|
|
6cc380 |
plugin->watermark_horizontal_alignment = 1.0;
|
|
|
6cc380 |
free (alignment);
|
|
|
6cc380 |
|
|
|
6cc380 |
alignment = ply_key_file_get_value (key_file, "two-step", "WatermarkVerticalAlignment");
|
|
|
6cc380 |
if (alignment != NULL)
|
|
|
6cc380 |
plugin->watermark_vertical_alignment = strtod (alignment, NULL);
|
|
|
6cc380 |
else
|
|
|
6cc380 |
plugin->watermark_vertical_alignment = .5;
|
|
|
6cc380 |
free (alignment);
|
|
|
6cc380 |
|
|
|
6cc380 |
plugin->transition = PLY_PROGRESS_ANIMATION_TRANSITION_NONE;
|
|
|
6cc380 |
transition = ply_key_file_get_value (key_file, "two-step", "Transition");
|
|
|
6cc380 |
@@ -878,60 +894,89 @@ draw_background (view_t *view,
|
|
|
6cc380 |
if (view->background_image != NULL)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
uint32_t *data;
|
|
|
6cc380 |
data = ply_image_get_data (view->background_image);
|
|
|
6cc380 |
ply_pixel_buffer_fill_with_argb32_data (pixel_buffer, &area, data);
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
if (plugin->watermark_image != NULL)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
uint32_t *data;
|
|
|
6cc380 |
|
|
|
6cc380 |
data = ply_image_get_data (plugin->watermark_image);
|
|
|
6cc380 |
ply_pixel_buffer_fill_with_argb32_data (pixel_buffer, &view->watermark_area, data);
|
|
|
6cc380 |
}
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
static void
|
|
|
6cc380 |
on_draw (view_t *view,
|
|
|
6cc380 |
ply_pixel_buffer_t *pixel_buffer,
|
|
|
6cc380 |
int x,
|
|
|
6cc380 |
int y,
|
|
|
6cc380 |
int width,
|
|
|
6cc380 |
int height)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_boot_splash_plugin_t *plugin;
|
|
|
6cc380 |
ply_rectangle_t screen_area;
|
|
|
6cc380 |
ply_rectangle_t image_area;
|
|
|
6cc380 |
|
|
|
6cc380 |
plugin = view->plugin;
|
|
|
6cc380 |
|
|
|
6cc380 |
+ if (plugin->mode == PLY_BOOT_SPLASH_MODE_BOOT_UP)
|
|
|
6cc380 |
+ {
|
|
|
6cc380 |
+ double now;
|
|
|
6cc380 |
+
|
|
|
6cc380 |
+ now = ply_get_timestamp ();
|
|
|
6cc380 |
+
|
|
|
6cc380 |
+ if (now - plugin->start_time < plugin->startup_delay)
|
|
|
6cc380 |
+ return;
|
|
|
6cc380 |
+
|
|
|
6cc380 |
+ if (view->is_blank)
|
|
|
6cc380 |
+ {
|
|
|
6cc380 |
+ ply_rectangle_t clip_area;
|
|
|
6cc380 |
+
|
|
|
6cc380 |
+ x = 0;
|
|
|
6cc380 |
+ y = 0;
|
|
|
6cc380 |
+ width = ply_pixel_display_get_width (view->display);
|
|
|
6cc380 |
+ height = ply_pixel_display_get_height (view->display);
|
|
|
6cc380 |
+
|
|
|
6cc380 |
+ clip_area.x = 0;
|
|
|
6cc380 |
+ clip_area.y = 0;
|
|
|
6cc380 |
+ clip_area.width = width;
|
|
|
6cc380 |
+ clip_area.height = height;
|
|
|
6cc380 |
+ ply_pixel_buffer_pop_clip_area (pixel_buffer);
|
|
|
6cc380 |
+ ply_pixel_buffer_push_clip_area (pixel_buffer,
|
|
|
6cc380 |
+ &clip_area);
|
|
|
6cc380 |
+ view->is_blank = false;
|
|
|
6cc380 |
+ }
|
|
|
6cc380 |
+ }
|
|
|
6cc380 |
+
|
|
|
6cc380 |
draw_background (view, pixel_buffer, x, y, width, height);
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_pixel_buffer_get_size (pixel_buffer, &screen_area);
|
|
|
6cc380 |
|
|
|
6cc380 |
if (plugin->state == PLY_BOOT_SPLASH_DISPLAY_QUESTION_ENTRY ||
|
|
|
6cc380 |
plugin->state == PLY_BOOT_SPLASH_DISPLAY_PASSWORD_ENTRY )
|
|
|
6cc380 |
{
|
|
|
6cc380 |
uint32_t *box_data, *lock_data;
|
|
|
6cc380 |
|
|
|
6cc380 |
box_data = ply_image_get_data (plugin->box_image);
|
|
|
6cc380 |
ply_pixel_buffer_fill_with_argb32_data (pixel_buffer,
|
|
|
6cc380 |
&view->box_area,
|
|
|
6cc380 |
box_data);
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_entry_draw_area (view->entry,
|
|
|
6cc380 |
pixel_buffer,
|
|
|
6cc380 |
x, y, width, height);
|
|
|
6cc380 |
ply_label_draw_area (view->label,
|
|
|
6cc380 |
pixel_buffer,
|
|
|
6cc380 |
x, y, width, height);
|
|
|
6cc380 |
|
|
|
6cc380 |
lock_data = ply_image_get_data (plugin->lock_image);
|
|
|
6cc380 |
ply_pixel_buffer_fill_with_argb32_data (pixel_buffer,
|
|
|
6cc380 |
&view->lock_area,
|
|
|
6cc380 |
lock_data);
|
|
|
6cc380 |
}
|
|
|
6cc380 |
else
|
|
|
6cc380 |
{
|
|
|
6cc380 |
if (view->throbber != NULL &&
|
|
|
6cc380 |
!ply_throbber_is_stopped (view->throbber))
|
|
|
6cc380 |
--
|
|
|
6cc380 |
1.8.3.1
|
|
|
6cc380 |
|
|
|
6cc380 |
From ba50f9e79da79d42ed7f50798b955ef929819daf Mon Sep 17 00:00:00 2001
|
|
|
6cc380 |
From: Ray Strode <rstrode@redhat.com>
|
|
|
6cc380 |
Date: Fri, 8 Nov 2013 08:31:32 -0500
|
|
|
6cc380 |
Subject: [PATCH] two-step: fix unlock screen
|
|
|
6cc380 |
|
|
|
6cc380 |
The previous commit introduced a bug where the unlock screen won't
|
|
|
6cc380 |
get shown if it's requested within the first 5 seconds of startup.
|
|
|
6cc380 |
|
|
|
6cc380 |
This commit fixes that by forcing a redraw if the state switches from
|
|
|
6cc380 |
NORMAL.
|
|
|
6cc380 |
---
|
|
|
6cc380 |
src/plugins/splash/two-step/plugin.c | 3 ++-
|
|
|
6cc380 |
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
6cc380 |
|
|
|
6cc380 |
diff --git a/src/plugins/splash/two-step/plugin.c b/src/plugins/splash/two-step/plugin.c
|
|
|
6cc380 |
index fff928c..eaf20b3 100644
|
|
|
6cc380 |
--- a/src/plugins/splash/two-step/plugin.c
|
|
|
6cc380 |
+++ b/src/plugins/splash/two-step/plugin.c
|
|
|
6cc380 |
@@ -900,61 +900,62 @@ draw_background (view_t *view,
|
|
|
6cc380 |
|
|
|
6cc380 |
if (plugin->watermark_image != NULL)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
uint32_t *data;
|
|
|
6cc380 |
|
|
|
6cc380 |
data = ply_image_get_data (plugin->watermark_image);
|
|
|
6cc380 |
ply_pixel_buffer_fill_with_argb32_data (pixel_buffer, &view->watermark_area, data);
|
|
|
6cc380 |
}
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
static void
|
|
|
6cc380 |
on_draw (view_t *view,
|
|
|
6cc380 |
ply_pixel_buffer_t *pixel_buffer,
|
|
|
6cc380 |
int x,
|
|
|
6cc380 |
int y,
|
|
|
6cc380 |
int width,
|
|
|
6cc380 |
int height)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_boot_splash_plugin_t *plugin;
|
|
|
6cc380 |
ply_rectangle_t screen_area;
|
|
|
6cc380 |
ply_rectangle_t image_area;
|
|
|
6cc380 |
|
|
|
6cc380 |
plugin = view->plugin;
|
|
|
6cc380 |
|
|
|
6cc380 |
if (plugin->mode == PLY_BOOT_SPLASH_MODE_BOOT_UP)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
double now;
|
|
|
6cc380 |
|
|
|
6cc380 |
now = ply_get_timestamp ();
|
|
|
6cc380 |
|
|
|
6cc380 |
- if (now - plugin->start_time < plugin->startup_delay)
|
|
|
6cc380 |
+ if ((now - plugin->start_time < plugin->startup_delay) &&
|
|
|
6cc380 |
+ plugin->state == PLY_BOOT_SPLASH_DISPLAY_NORMAL)
|
|
|
6cc380 |
return;
|
|
|
6cc380 |
|
|
|
6cc380 |
if (view->is_blank)
|
|
|
6cc380 |
{
|
|
|
6cc380 |
ply_rectangle_t clip_area;
|
|
|
6cc380 |
|
|
|
6cc380 |
x = 0;
|
|
|
6cc380 |
y = 0;
|
|
|
6cc380 |
width = ply_pixel_display_get_width (view->display);
|
|
|
6cc380 |
height = ply_pixel_display_get_height (view->display);
|
|
|
6cc380 |
|
|
|
6cc380 |
clip_area.x = 0;
|
|
|
6cc380 |
clip_area.y = 0;
|
|
|
6cc380 |
clip_area.width = width;
|
|
|
6cc380 |
clip_area.height = height;
|
|
|
6cc380 |
ply_pixel_buffer_pop_clip_area (pixel_buffer);
|
|
|
6cc380 |
ply_pixel_buffer_push_clip_area (pixel_buffer,
|
|
|
6cc380 |
&clip_area);
|
|
|
6cc380 |
view->is_blank = false;
|
|
|
6cc380 |
}
|
|
|
6cc380 |
}
|
|
|
6cc380 |
|
|
|
6cc380 |
draw_background (view, pixel_buffer, x, y, width, height);
|
|
|
6cc380 |
|
|
|
6cc380 |
ply_pixel_buffer_get_size (pixel_buffer, &screen_area);
|
|
|
6cc380 |
|
|
|
6cc380 |
if (plugin->state == PLY_BOOT_SPLASH_DISPLAY_QUESTION_ENTRY ||
|
|
|
6cc380 |
plugin->state == PLY_BOOT_SPLASH_DISPLAY_PASSWORD_ENTRY )
|
|
|
6cc380 |
{
|
|
|
6cc380 |
uint32_t *box_data, *lock_data;
|
|
|
6cc380 |
--
|
|
|
6cc380 |
1.8.3.1
|
|
|
6cc380 |
|