Blame Scripts/Bash/Functions/Render/render_doIdentityImageKsplash.sh

4c79b5
#!/bin/bash
4c79b5
#
39208d
# render_doIdentityImageKsplash.sh -- This function collects KDE
39208d
# splash (KSplash) required files and creates a tar.gz package that
39208d
# groups them all together. Use this function as last-rendition
39208d
# action for KSplash base-rendition action.
4c79b5
#
9f5f2e
# Copyright (C) 2009-2011 Alain Reguera Delgado
4c79b5
# 
7cd8e9
# This program is free software; you can redistribute it and/or
7cd8e9
# modify it under the terms of the GNU General Public License as
7cd8e9
# published by the Free Software Foundation; either version 2 of the
7cd8e9
# License, or (at your option) any later version.
4c79b5
# 
4c79b5
# This program is distributed in the hope that it will be useful, but
4c79b5
# WITHOUT ANY WARRANTY; without even the implied warranty of
4c79b5
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4c79b5
# General Public License for more details.
4c79b5
#
4c79b5
# You should have received a copy of the GNU General Public License
4c79b5
# along with this program; if not, write to the Free Software
4c79b5
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
4c79b5
# USA.
4c79b5
# 
4c79b5
# ----------------------------------------------------------------------
418249
# $Id$
4c79b5
# ----------------------------------------------------------------------
4c79b5
4c79b5
function render_doIdentityImageKsplash {
4c79b5
39208d
    local -a SRC
39208d
    local -a DST
39208d
    local FONT=''
39208d
    local COUNT=0
4c79b5
39208d
    # Define font used to print bottom splash message.
25c2b4
    FONT=$(cli_getRepoTLDir)/Identity/Fonts/DejaVuLGCSans-Bold.ttf
4c79b5
39208d
    # Check existence of font file.
39208d
    cli_checkFiles "$FONT" 'f'
4c79b5
39208d
    # Define absolute source location of files.
39208d
    SRC[0]="${DIRNAME}/splash_top.png"
39208d
    SRC[1]="${DIRNAME}/splash_active_bar.png"
39208d
    SRC[2]="${DIRNAME}/splash_inactive_bar.png"
39208d
    SRC[3]="${DIRNAME}/splash_bottom.png"
39208d
    SRC[4]="$(cli_getRepoTLDir)/Identity/Themes/Models/${THEMEMODEL}/Distro/BootUp/KSplash/Theme.rc"
4c79b5
39208d
    # Check absolute source location of files.
39208d
    cli_checkFiles "${SRC[@]}" 'f'
2c2082
39208d
    # Define relative target location of files.
39208d
    DST[0]="${DIRNAME}/splash_top.png"
39208d
    DST[1]="${DIRNAME}/splash_active_bar.png"
39208d
    DST[2]="${DIRNAME}/splash_inactive_bar.png"
39208d
    DST[3]="${DIRNAME}/splash_bottom.png"
39208d
    DST[4]="${DIRNAME}/Theme.rc"
2c2082
39208d
    # Create `Preview.png' image.
39208d
    convert -append ${SRC[0]} ${SRC[1]} ${SRC[3]} ${DIRNAME}/Preview.png
2c2082
39208d
    # Add bottom text to Preview.png image. The text position was set
39208d
    # inside an image of 400x300 pixels. If you change the final
39208d
    # preview image dimension, you probably need to change the text
39208d
    # position too.
39208d
    mogrify -draw 'text 6,295 "KDE is up and running."' \
39208d
        -fill \#ffffff \
39208d
        -font $FONT \
39208d
        ${DIRNAME}/Preview.png
2c2082
39208d
    # Copy `Theme.rc' file.
39208d
    cp ${SRC[4]} ${DST[4]}
4c79b5
39208d
    # Apply common translation markers to Theme.rc file.
79e54d
    cli_replaceTMarkers "${DST[4]}"
ec641d
4c79b5
}