Add MoreBlue USplash theme. WIP: ugly atm but works.

This commit is contained in:
Fathi Boudra
2008-08-20 18:17:35 +00:00
parent 7bff0e24b1
commit 3262f496fd
15 changed files with 7314 additions and 27 deletions
+4 -6
View File
@@ -8,19 +8,17 @@ PIXMAPS=$(wildcard pixmaps/*.png)
DESKTOPFILES=$(wildcard *.desktop)
all:
make -C usplash/moreblue-orbit
#build:
# make -C usplash
#clean:
# make -C usplash clean
clean:
make -C usplash/moreblue-orbit clean
install:
# splashy theme
mkdir -p $(DESTDIR)/etc/splashy/themes/moreblue-orbit
$(INSTALL) $(wildcard splashy/moreblue-orbit/*) $(DESTDIR)/etc/splashy/themes/moreblue-orbit
# usplash theme
# make -C usplash install
make -C usplash/moreblue-orbit install DESTDIR=$(CURDIR)/debian/usplash-theme-debian-desktop/usr/lib/usplash
# background files
mkdir -p $(DESTDIR)/usr/share/images/desktop-base
$(INSTALL) $(BACKGROUNDS) $(DESTDIR)/usr/share/images/desktop-base
+1
View File
@@ -18,6 +18,7 @@ desktop-base (5.0.1) unstable; urgency=low
* Add MoreBlue Orbit widescreen.
* Add Nightly source.
* Add MoreBlue Orbit Splashy theme.
* Add MoreBlue Orbit USplash theme.
-- Yves-Alexis Perez <corsac@debian.org> Tue, 19 Aug 2008 07:06:17 +0200
+11 -11
View File
@@ -5,8 +5,8 @@ Maintainer: Gustavo Franco <stratus@debian.org>
Uploaders: Loïc Minier <lool@dooz.org>,
Fathi Boudra <fabo@debian.org>,
Yves-Alexis Perez <corsac@debian.org>
Build-Depends: cdbs, debhelper (>= 6)
# libusplash-dev, imagemagick, librsvg2-bin
Build-Depends: cdbs, debhelper (>= 6),
libusplash-dev, imagemagick, librsvg2-bin
Standards-Version: 3.8.0
Homepage: http://www.debian.org/devel/debian-desktop
Vcs-Browser: http://svn.debian.org/wsvn/debian-desktop/packages/trunk/desktop-base
@@ -24,12 +24,12 @@ Description: common files for the Debian Desktop
and other common files between the available desktop environments
such as GNOME and KDE.
# Package: usplash-theme-debian-desktop
# Section: misc
# Architecture: amd64 i386 powerpc sparc
# Depends: ${shlibs:Depends}
# Provides: usplash-theme
# Description: Debian Desktop usplash theme
# This package contains an usplash theme based on Debian Desktop project.
# .
# See http://wiki.debian.org/DebianDesktopArtwork for more details.
Package: usplash-theme-debian-desktop
Section: misc
Architecture: amd64 i386 powerpc sparc
Depends: ${shlibs:Depends}, usplash
Provides: usplash-theme
Description: Debian Desktop usplash theme
This package contains an usplash theme based on Debian Desktop project.
.
See http://wiki.debian.org/DebianDesktopArtwork for more details.
-6
View File
@@ -79,12 +79,6 @@ if [ "$1" = "configure" -o "$1" = "abort-upgrade" ]; then
desktop-grub \
/usr/share/images/desktop-base/moreblue-orbit-grub.png 10
# Alternatives for usplash
# update-alternatives --install \
# /usr/lib/usplash/usplash-artwork.so \
# usplash-artwork.so \
# /usr/lib/usplash/debian-theme.so 50
# GRUB background
if which update-grub2 > /dev/null ; then
update-grub2
-4
View File
@@ -44,9 +44,5 @@ if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ]; then
# remove grub alternatives
update-alternatives --remove desktop-grub \
/usr/share/images/desktop-base/moreblue-orbit-grub.png
# remove usplash alternatives
# update-alternatives --remove usplash-artwork.so \
# /usr/lib/usplash/debian-theme.so
fi
+3
View File
@@ -4,6 +4,9 @@ include /usr/share/cdbs/1/rules/buildcore.mk
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/makefile.mk
# needed for usplash
CFLAGS += -fPIC
DEB_MAKE_INSTALL_TARGET := install DESTDIR=$(CURDIR)/debian/desktop-base/
binary-fixup/desktop-base::
+30
View File
@@ -0,0 +1,30 @@
#! /bin/sh
set -e
case "$1" in
configure)
# Alternatives for usplash
update-alternatives --install \
/usr/lib/usplash/usplash-artwork.so \
usplash-artwork.so \
/usr/lib/usplash/moreblue-orbit-theme.so 60
if [ -x /usr/sbin/update-initramfs ]; then
update-initramfs -u
fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#
exit 0
+23
View File
@@ -0,0 +1,23 @@
#! /bin/sh
set -e
case "$1" in
remove|upgrade|deconfigure)
# remove usplash alternatives
update-alternatives --remove usplash-artwork.so \
/usr/lib/usplash/moreblue-orbit-theme.so
;;
failed-upgrade)
;;
*)
echo "prerm called with unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#
exit 0
+120
View File
@@ -0,0 +1,120 @@
# usplash-theme-debian - Makefile
#
# Copyright © 2006 - 2007 David Härdeman <david@hardeman.nu>
#
# 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 of the License, 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.
#
# 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 St, Fifth Floor, Boston, MA 02110-1301 USA
# This is the list of sizes to build and include in the theme
# By convention, the sizes should go from smaller to larger
sizes = 640x480 800x600 1024x768 1280x1024
# This creates a list with entries like background_800x600.png...
backgrounds = $(addsuffix .png, $(addprefix background_, $(sizes)))
background_objs = $(backgrounds:.png=.o)
progressfgs = $(addsuffix .png, $(addprefix progressfg_, $(sizes)))
progressfg_objs = $(progressfgs:.png=.o)
progressbgs = $(addsuffix .png, $(addprefix progressbg_, $(sizes)))
progressbg_objs = $(progressbgs:.png=.o)
theme = moreblue-orbit-theme.so
CC = gcc
CFLAGS = -g -Wall -fPIC
LDFLAGS =
INCLUDES =
COMPILE = $(CC) $(INCLUDES) $(CFLAGS)
LINK = $(CC) $(CFLAGS) $(LDFLAGS)
INSTALL = install
INSTALL_DATA = $(INSTALL) -m 644
INSTALL_PROG = $(INSTALL) -m 755
DESTDIR = /usr/lib/usplash
# Default = silent build
V =
ifeq ($(strip $(V)),)
E = @echo
Q = @
else
E = @\#
Q =
endif
export E Q
all: $(theme)
.PHONY: all
.DEFAULT: all
$(theme): theme.o $(background_objs) $(progressfg_objs) $(progressbg_objs)
$(E) " LINK " $@
$(Q) $(COMPILE) -shared -o $@ $^
theme.h: theme.in progress.png themesetup.sh $(backgrounds) $(progressfgs) $(progressbgs)
$(E) " THMPARM " $@
$(Q) ./themesetup.sh $(sizes) > $@
theme.o: theme.c theme.h
background_%.png: background.svg cmap.gif
$(E) " BG " $@
$(Q) rsvg-convert -w `echo $* | cut -dx -f1` -h `echo $* | cut -dx -f2` -f png $< > $@
progressfg_%.png: background_%.png progress.png cmap.gif
$(E) " PROGFG " $@
$(Q) composite -compose dst_over -gravity center $< progress.png $@
progressbg_%.png: background_%.png progress.png cmap.gif
$(E) " PROGBG " $@
$(Q) composite -gravity center -dissolve 25x100 progress.png $< png:- | \
composite -gravity center -compose src_over png:- progress.png $@
%.o: %.c
$(E) " CC " $@
$(Q) $(COMPILE) -o $@ -c $<
%.c: %.png cmap.gif
$(E) " PNGSRC " $@
$(Q) convert $< +dither -map cmap.gif gif:- | \
convert gif:- $<
$(Q) pngtousplash $< > $@
#cmap.gif: background.svg progress.png
# $(E) " CMAP " $@
# $(Q) rsvg-convert -w 1024 -h 768 -f png background.svg | \
# composite -compose src_over -gravity center progress.png png:- +dither cmap.gif
install: $(theme)
$(E) " INSTALL " $<
$(Q) $(INSTALL_DATA) -D $< $(DESTDIR)/$(theme)
.PHONY: install
install-strip: $(theme)
$(MAKE) INSTALL='$(INSTALL) -s' install
.PHONY: install-strip
clean:
$(E) " CLEAN "
$(Q) - find . -type f -name '*.png.c' -print0 | xargs -0r rm -f
$(Q) - find . -type f -name '*.cfont' -print0 | xargs -0r rm -f
$(Q) - find . -type f -name '*.o' -print0 | xargs -0r rm -f
$(Q) - find . -type f -name '*.so' -print0 | xargs -0r rm -f
# $(Q) - find . -type f -name 'cmap.*' -print0 | xargs -0r rm -f
$(Q) - find . -type f -name 'background_*' -print0 | xargs -0r rm -f
$(Q) - find . -type f -name 'progressfg_*' -print0 | xargs -0r rm -f
$(Q) - find . -type f -name 'progressbg_*' -print0 | xargs -0r rm -f
$(Q) - rm -f theme.h
.PHONY: clean
.PRECIOUS: %.c progressbg_%.png progressfg_%.png background_%.png
File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 258 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 461 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

+178
View File
@@ -0,0 +1,178 @@
/* usplash
*
* theme.c - theme definition
*
* Copyright © 2006 David Härdeman <david@hardeman.nu>
* based on example-theme from usplash which is
* Copyright © 2006 Dennis Kaarsemaker <dennis@kaarsemaker.net>
*
* 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 of the License, 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.
*
* 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 St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <usplash-theme.h>
#include <usplash_backend.h>
void t_init(struct usplash_theme *theme);
void t_draw_progressbar(struct usplash_theme *theme, int percentage);
void t_clear_progressbar(struct usplash_theme *theme);
void t_clear_text(struct usplash_theme *theme);
void t_animate_step(struct usplash_theme* theme, int pulsating);
/* Auto-generated theme definitions */
#include "theme.h"
static struct private_hack *phack = NULL;
void
t_init(struct usplash_theme *theme)
{
int x, y;
/* START - HACKS R US */
phack = (struct private_hack *)theme->font;
theme->font = NULL;
/* FINISH - HACKS R US */
usplash_getdimensions(&x, &y);
theme->progressbar_x = (x - theme->pixmap->width)/2 + theme->progressbar_x;
theme->progressbar_y = (y - theme->pixmap->height)/2 + theme->progressbar_y;
}
void
t_draw_progressbar(struct usplash_theme *theme, int percentage)
{
int w = (phack->progress_bg->width * percentage / 100);
static int last_w = 0;
if (w != 0 && w == last_w)
return;
/* Check if we're changing mode between startup and shutdown */
if (last_w >= 0 && w < 0) {
usplash_put(theme->progressbar_x,
theme->progressbar_y,
phack->progress_fg);
last_w = 0;
} else if (last_w < 0 && w > 0) {
usplash_put(theme->progressbar_x,
theme->progressbar_y,
phack->progress_bg);
last_w = 0;
}
/* Draw only the part which has changed since last time */
if (percentage == 0) {
usplash_put(theme->progressbar_x,
theme->progressbar_y,
phack->progress_bg);
} else if (percentage < 0) {
usplash_put_part(theme->progressbar_x - last_w,
theme->progressbar_y,
-w + last_w,
phack->progress_bg->height,
phack->progress_bg,
-last_w, 0);
} else if (percentage > 0) {
usplash_put_part(theme->progressbar_x + last_w,
theme->progressbar_y,
w - last_w,
phack->progress_fg->height,
phack->progress_fg,
last_w, 0);
}
last_w = w;
}
void
t_clear_progressbar(struct usplash_theme *theme)
{
t_draw_progressbar(theme, 0);
}
void
t_clear_text(struct usplash_theme *theme)
{
int x, y, x1, y1, x2, y2;
usplash_getdimensions(&x, &y);
/* Draw outer border */
x1 = (x - theme->pixmap->width)/2 + theme->text_x - TEXT_EXTRA_PX;
y1 = (y - theme->pixmap->height)/2 + theme->text_y - TEXT_EXTRA_PX;
x2 = x1 + theme->text_width + 2 * TEXT_EXTRA_PX;
y2 = y1 + theme->text_height + 2 * TEXT_EXTRA_PX;
usplash_clear(x1, y1, x2, y2, theme->text_foreground);
/* Draw main text area with TEXT_BORDER_PX pixels padding */
x1 += TEXT_BORDER_PX;
y1 += TEXT_BORDER_PX;
x2 -= TEXT_BORDER_PX;
y2 -= TEXT_BORDER_PX;
usplash_clear(x1, y1, x2, y2, theme->text_background);
}
void
t_animate_step(struct usplash_theme* theme, int pulsating)
{
static int pulsate_step = 0;
static int pulse_width = 70;
static int step_width = 1;
static int prev_step = 0;
static int reset = 1;
int num_steps = (phack->progress_fg->width - pulse_width)/step_width;
int x1;
if (!pulsating) {
reset = 1;
return;
}
if (reset) {
/* Reset pulse */
t_clear_progressbar(theme);
reset = 0;
pulsate_step = 0;
usplash_put_part(theme->progressbar_x,
theme->progressbar_y,
pulse_width,
phack->progress_fg->height,
phack->progress_fg,
0, 0);
} else {
/* Remove from left hand side of pulse */
x1 = step_width * prev_step;
usplash_put_part(theme->progressbar_x + x1,
theme->progressbar_y,
step_width,
phack->progress_bg->height,
phack->progress_bg,
x1, 0);
}
/* Add to right hand side of pulse */
x1 = step_width * pulsate_step + pulse_width;
usplash_put_part(theme->progressbar_x + x1,
theme->progressbar_y,
step_width,
phack->progress_fg->height,
phack->progress_fg,
x1, 0);
/* Check for wraparound */
prev_step = pulsate_step;
pulsate_step++;
if (pulsate_step >= num_steps)
reset = 1;
}
+20
View File
@@ -0,0 +1,20 @@
#define PALETTE_BG 0
#define PALETTE_PROGRESS_FG 0
#define PALETTE_PROGRESS_BG 0
#define PALETTE_TEXT_BG 251
#define PALETTE_TEXT_FG 0
#define PALETTE_TEXT_SUCCESS 67
#define PALETTE_TEXT_FAILURE 134
#define TEXT_BORDER_PX 1
#define TEXT_PADDING_PX 9
#define TEXT_EXTRA_PX (TEXT_BORDER_PX + TEXT_PADDING_PX)
#define TEXT_MARGIN 30
/* Horrible hack */
struct private_hack {
struct usplash_pixmap *pixmap; /* Background image */
struct usplash_pixmap *progress_fg; /* Progress bar foreground */
struct usplash_pixmap *progress_bg; /* Progress bar background */
};
+151
View File
@@ -0,0 +1,151 @@
#!/bin/sh
#
# Sanity checks
#
if [ ! -e theme.in ]; then
exit 1
fi
if [ $# -lt 1 ]; then
exit 1
fi
#
# Helper functions
#
struct_name() {
name=${1%.*}
echo "pixmap_$name"
}
#
# Begin processing
#
echo "/*"
echo " * Part 1 - Generic header part"
echo " */"
cat theme.in
echo
echo "/*"
echo " * Part 2 - Forward theme struct declarations"
echo " */"
first=yes
for size in $@; do
if [ $first = "yes" ]; then
THEMENAME="usplash_theme"
first=no
else
THEMENAME="usplash_theme_$size"
fi
echo "struct usplash_theme $THEMENAME;"
done
echo
echo "/*"
echo " * Step 3 - Actual theme struct defs"
echo " */"
first=yes
while [ 1 ]; do
size="$1"
if [ -z "$size" ]; then
exit 0
fi
if [ $first = "yes" ]; then
THEMENAME="usplash_theme"
first=no
else
THEMENAME="usplash_theme_$size"
fi
if [ -z "$2" ]; then
THEMENEXT="NULL"
else
THEMENEXT="&usplash_theme_$2"
fi
shift
PGFG_PIX="progressfg_$size.png"
PGFG_STRUCT=$(struct_name "$PGFG_PIX")
PGBG_PIX="progressbg_$size.png"
PGBG_STRUCT=$(struct_name "$PGBG_PIX")
BG_PIX="background_$size.png"
BG_STRUCT=$(struct_name "$BG_PIX")
PROGRESS_WIDTH=$( identify "$PGFG_PIX" | cut -d' ' -f3 | cut -dx -f1)
PROGRESS_HEIGHT=$( identify "$PGFG_PIX" | cut -d' ' -f3 | cut -dx -f2)
WIDTH=${size%x*}
HEIGHT=${size#*x}
if [ $(( $WIDTH / 16 )) -eq $(( $HEIGHT / 9 )) ]; then
RATIO="USPLASH_16_9"
else
RATIO="USPLASH_4_3"
fi
cat <<EOF
/* Theme definition for $size */
extern struct usplash_pixmap $PGFG_STRUCT;
extern struct usplash_pixmap $PGBG_STRUCT;
extern struct usplash_pixmap $BG_STRUCT;
struct private_hack phack_$size = {
.progress_fg = &$PGFG_STRUCT,
.progress_bg = &$PGBG_STRUCT
};
struct usplash_theme $THEMENAME = {
.version = THEME_VERSION,
.next = $THEMENEXT,
.ratio = $RATIO,
/* Background and font */
.pixmap = &$BG_STRUCT,
.font = (struct usplash_font *)&phack_$size,
/* Palette indexes */
.background = PALETTE_BG,
.progressbar_background = PALETTE_PROGRESS_FG,
.progressbar_foreground = PALETTE_PROGRESS_BG,
.text_background = PALETTE_TEXT_BG,
.text_foreground = PALETTE_TEXT_FG,
.text_success = PALETTE_TEXT_SUCCESS,
.text_failure = PALETTE_TEXT_FAILURE,
/* Progress bar position and size in pixels */
.progressbar_x = $WIDTH/2 - $PROGRESS_WIDTH/2,
.progressbar_y = $HEIGHT/2 - $PROGRESS_HEIGHT/2,
.progressbar_width = $PROGRESS_WIDTH,
.progressbar_height = $PROGRESS_HEIGHT,
/* Text box position and size in pixels */
.text_x = TEXT_MARGIN,
.text_y = $HEIGHT/2 + $PROGRESS_HEIGHT/2 + TEXT_MARGIN,
.text_width = $WIDTH - 2 * TEXT_MARGIN,
.text_height = $HEIGHT/2 - $PROGRESS_HEIGHT/2 - 2*TEXT_MARGIN,
/* Text details */
.line_height = 15,
.line_length = 32,
.status_width = 25,
/* Functions */
.init = t_init,
.clear_progressbar = t_clear_progressbar,
.draw_progressbar = t_draw_progressbar,
.clear_text = t_clear_text,
.animate_step = t_animate_step,
};
EOF
done
exit 0