Make appearance more configurable
PATCH 2/2 Make appearance more configurable
In reply to a message not in the archiveFrom ca876147d839a33fb1a397cda682d307554cb1d7 Mon Sep 17 00:00:00 2001
From: Olaf Mandel <[email protected]>
Date: Tue, 7 Oct 2014 15:43:20 +0200
Subject: [PATCH 2/2] Make appearance more configurable
* Allow not showing the startup message
* Make the screen-split (between image and progress bar) configurable
* Allow for fullscreen image (overlaid by progress bar)
Signed-off-by Olaf Mandel <[email protected]>
--- ChangeLog | 9 +++++++++ Makefile.am | 2 +- psplash-config.h | 34 ++++++++++++++++++++++++++++++++++ psplash.c | 28 +++++++++++++++++++++------- psplash.h | 1 - 5 files changed, 65 insertions(+), 9 deletions(-) create mode 100644 psplash-config.h
ChangeLog +9 -0
@@ -5,6 +5,15 @@ * psplash.c: Images: handle rowstride != width*bytes_per_pixel + * psplash-config.h: + * psplash.c: + * psplash.h: + Make appearance more configurable: + - Allow not showing the startup message + - Make the screen-split (between image and progress bar) + configurable + - Allow for fullscreen image (overlaid by progress bar) + 2009-05-28 Richard Purdie <[email protected]> * psplash-fb.c:
Makefile.am +1 -1
@@ -4,7 +4,7 @@ AM_CFLAGS = $(GCC_FLAGS) -D_GNU_SOURCE psplash_SOURCES = psplash.c psplash.h psplash-fb.c psplash-fb.h \ psplash-console.c psplash-console.h \ - psplash-colors.h \ + psplash-colors.h psplash-config.h \ psplash-poky-img.h psplash-bar-img.h radeon-font.h psplash_write_SOURCES = psplash-write.c psplash.h
psplash-config.h new file +34 -0
@@ -0,0 +1,34 @@ +/* +* pslash - a lightweight framebuffer splashscreen for embedded devices. +* +* Copyright (c) 2014 MenloSystems GmbH +* Author: Olaf Mandel <[email protected]> +* +* 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 +* the Free Software Foundation; either version 2, or (at your option) +* any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +*/ + +#ifndef _HAVE_PSPLASH_CONFIG_H +#define _HAVE_PSPLASH_CONFIG_H + +/* Text to output on program start; if undefined, output nothing */ +#define PSPLASH_STARTUP_MSG "" + +/* Bool indicating if the image is fullscreen, as opposed to split screen */ +#define PSPLASH_IMG_FULLSCREEN 0 + +/* Position of the image split from top edge, numerator of fraction */ +#define PSPLASH_IMG_SPLIT_NUMERATOR 5 + +/* Position of the image split from top edge, denominator of fraction */ +#define PSPLASH_IMG_SPLIT_DENOMINATOR 6 + +#endif
psplash.c +21 -7
@@ -19,11 +19,18 @@*/ #include "psplash.h" +#include "psplash-config.h" +#include "psplash-colors.h" #include "psplash-poky-img.h" #include "psplash-bar-img.h" #include "radeon-font.h" -#define MSG "" +#define SPLIT_LINE_POS (fb) \ + ( (fb)->height \ + - (( PSPLASH_IMG_SPLIT_DENOMINATOR \ + - PSPLASH_IMG_SPLIT_NUMERATOR) \ + * (fb)->height / PSPLASH_IMG_SPLIT_DENOMINATOR) \ + )void psplash_exit (int signum)
@@ -46,14 +53,14 @@ psplash_draw_msg (PSplashFB *fb, const char *msg)psplash_fb_draw_rect (fb,0 , - fb->height - (fb->height/6 ) - h, +SPLIT_LINE_POS (fb) - h, fb->width, h,PSPLASH_BACKGROUND_COLOR );psplash_fb_draw_text (fb, (fb->width-w)/2 , - fb->height - (fb->height/6 ) - h, +SPLIT_LINE_POS (fb) - h,PSPLASH_TEXT_COLOR , &radeon_font, msg);
@@ -66,7 +73,7 @@ psplash_draw_progress (PSplashFB *fb, int value)/* 4 pix border */ x = ((fb->width -BAR_IMG_WIDTH )/2 ) +4 ; - y = fb->height - (fb->height/6 ) +4 ; + y =SPLIT_LINE_POS (fb) +4 ; width =BAR_IMG_WIDTH -8 ; height =BAR_IMG_HEIGHT -8 ;
@@ -270,7 +277,12 @@ main (int argc, char** argv)/* Draw the Poky logo */ psplash_fb_draw_image (fb, (fb->width - POKY_IMG_WIDTH)/2, - ((fb->height * 5) / 6 - POKY_IMG_HEIGHT)/2, +#if PSPLASH_IMG_FULLSCREEN + (fb->height - POKY_IMG_HEIGHT)/2, +#else + (fb->height * PSPLASH_IMG_SPLIT_NUMERATOR + / PSPLASH_IMG_SPLIT_DENOMINATOR - POKY_IMG_HEIGHT)/2, +#endif POKY_IMG_WIDTH, POKY_IMG_HEIGHT, POKY_IMG_BYTES_PER_PIXEL,
@@ -280,7 +292,7 @@ main (int argc, char** argv)/* Draw progress bar border */ psplash_fb_draw_image (fb, (fb->width - BAR_IMG_WIDTH)/2, - fb->height - (fb->height/6), + SPLIT_LINE_POS(fb), BAR_IMG_WIDTH, BAR_IMG_HEIGHT, BAR_IMG_BYTES_PER_PIXEL,
@@ -289,7 +301,9 @@ main (int argc, char** argv)psplash_draw_progress (fb,0 ); -psplash_draw_msg (fb,MSG ); +#ifdef PSPLASH_STARTUP_MSG +psplash_draw_msg (fb,PSPLASH_STARTUP_MSG ); +#endif psplash_main (fb, pipe_fd,0 );
psplash.h +0 -1
@@ -83,6 +83,5 @@ PSplashFont;#include "psplash-fb.h" #include "psplash-console.h" -#include "psplash-colors.h" #endif
Signature · 1 line
1.7.10.4
Hi Olaf,
I've merged these two patches into the psplash repository and have sent a corresponding recipe update patch for OE-Core. Apologies for the delay.
Thanks,
Paul
Signature · 2 lines
Paul Eggleton Intel Open Source Technology Centre