diff --git a/Makefile b/Makefile index 0c7e1c8..b35a681 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/debian/changelog b/debian/changelog index da8a20d..68523ef 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Tue, 19 Aug 2008 07:06:17 +0200 diff --git a/debian/control b/debian/control index 2696237..daa7726 100644 --- a/debian/control +++ b/debian/control @@ -5,8 +5,8 @@ Maintainer: Gustavo Franco Uploaders: Loïc Minier , Fathi Boudra , Yves-Alexis Perez -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. diff --git a/debian/postinst b/debian/postinst index ae594ec..79738a0 100644 --- a/debian/postinst +++ b/debian/postinst @@ -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 diff --git a/debian/prerm b/debian/prerm index a992463..d42c618 100644 --- a/debian/prerm +++ b/debian/prerm @@ -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 diff --git a/debian/rules b/debian/rules index 24c94ee..da15001 100755 --- a/debian/rules +++ b/debian/rules @@ -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:: diff --git a/debian/usplash-theme-debian-desktop.postinst b/debian/usplash-theme-debian-desktop.postinst new file mode 100644 index 0000000..8b26fd8 --- /dev/null +++ b/debian/usplash-theme-debian-desktop.postinst @@ -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 diff --git a/debian/usplash-theme-debian-desktop.prerm b/debian/usplash-theme-debian-desktop.prerm new file mode 100644 index 0000000..079dfdd --- /dev/null +++ b/debian/usplash-theme-debian-desktop.prerm @@ -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 diff --git a/usplash/moreblue-orbit/Makefile b/usplash/moreblue-orbit/Makefile new file mode 100644 index 0000000..6f677f5 --- /dev/null +++ b/usplash/moreblue-orbit/Makefile @@ -0,0 +1,120 @@ +# usplash-theme-debian - Makefile +# +# Copyright © 2006 - 2007 David Härdeman +# +# 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 diff --git a/usplash/moreblue-orbit/background.svg b/usplash/moreblue-orbit/background.svg new file mode 100644 index 0000000..d60e2ed --- /dev/null +++ b/usplash/moreblue-orbit/background.svg @@ -0,0 +1,6773 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/usplash/moreblue-orbit/cmap.gif b/usplash/moreblue-orbit/cmap.gif new file mode 100644 index 0000000..ac8c4b8 Binary files /dev/null and b/usplash/moreblue-orbit/cmap.gif differ diff --git a/usplash/moreblue-orbit/progress.png b/usplash/moreblue-orbit/progress.png new file mode 100644 index 0000000..de57c52 Binary files /dev/null and b/usplash/moreblue-orbit/progress.png differ diff --git a/usplash/moreblue-orbit/theme.c b/usplash/moreblue-orbit/theme.c new file mode 100644 index 0000000..5963252 --- /dev/null +++ b/usplash/moreblue-orbit/theme.c @@ -0,0 +1,178 @@ +/* usplash + * + * theme.c - theme definition + * + * Copyright © 2006 David Härdeman + * based on example-theme from usplash which is + * Copyright © 2006 Dennis Kaarsemaker + * + * 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 +#include + +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; +} + diff --git a/usplash/moreblue-orbit/theme.in b/usplash/moreblue-orbit/theme.in new file mode 100644 index 0000000..ae8c4dd --- /dev/null +++ b/usplash/moreblue-orbit/theme.in @@ -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 */ +}; + diff --git a/usplash/moreblue-orbit/themesetup.sh b/usplash/moreblue-orbit/themesetup.sh new file mode 100755 index 0000000..81f0bd8 --- /dev/null +++ b/usplash/moreblue-orbit/themesetup.sh @@ -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 <