/* *********************************************************************
This source file is a part of the standard library of Scol
For the latest info, see http://www.scolring.org
Copyright (c) 2014 Stephane Bisaro aka Iri.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place - Suite 330, Boston, MA 02111-1307, USA, or go to
http://www.gnu.org/copyleft/lesser.txt
********************************************************************* */
/*
* Functions for 2d resources
* See http://redmine.scolring.org/projects/tutorials/wiki/Scol_usage
* for more informations
*/
/*! \file rsc2d.pkg
* \author Scol team
* \version 0.1
* \copyright GNU Lesser General Public License 2.0 or later
* \brief 2d graphical resources API
*
* These resources are PNG files which should be available on each
* Scol client. It is recommended to use this API instead of the
* filenames directly : they can be modified in a next version.
*
* Properties :
* - size : 48 x 48 pixels
* - depth : 32 bits
* - resolution : 72 dpi
*
* This package has not dependancies.
**/
var L2D_RSC_PATH = "lib/2dos/rsc/";; /*!< default 2d resource paths */
proto lib2d_rscApply = fun [] S;;
/*! \brief Set the 2d resources path.
*
* This function should not be called in the mostly cases.
*
* \ingroup _2dos_rsc
* Prototype : fun [S] I
*
* \param S : the new path to set
* \return I : 0 if success or a positive value if an error occurs :
* - 1 : the given path is wrong
**/
fun lib2d_rscSetPath (szPath)=
if szPath == nil then
1
else
let L2D_RSC_PATH -> p in
(
set L2D_RSC_PATH = szPath;
if nil == _checkpack lib2d_rscApply then
(
set L2D_RSC_PATH = p;
1
)
else
(
set L2D_RSC_PATH = szPath;
0
)
);;
/*! \brief Get the 2d resources path.
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscGetPath ()=
L2D_RSC_PATH;;
/*! \brief Get the 2d resources path to "Access".
*
* \image html access.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscAccess ()=
strcat L2D_RSC_PATH "access.png";;
/*! \brief Get the 2d resources path to "accessories".
*
* \image html accessories.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscAccessories ()=
strcat L2D_RSC_PATH "accessories.png";;
/*! \brief Get the 2d resources path to "apply".
*
* \image html apply.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscApply ()=
strcat L2D_RSC_PATH "apply.png";;
/*! \brief Get the 2d resources path to "apply2".
*
* \image html apply2.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscApply2 ()=
strcat L2D_RSC_PATH "apply2.png";;
/*! \brief Get the 2d resources path to "audio-volume-high".
*
* \image html audio-volume-high.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscAudioVolumeHigh ()=
strcat L2D_RSC_PATH "audio-volume-high.png";;
/*! \brief Get the 2d resources path to "audio-volume-low".
*
* \image html audio-volume-low.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscAudioVolumeLow ()=
strcat L2D_RSC_PATH "audio-volume-low.png";;
/*! \brief Get the 2d resources path to "audio-volume-medium".
*
* \image html audio-volume-medium.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscAudioVolumeMedium ()=
strcat L2D_RSC_PATH "audio-volume-medium.png";;
/*! \brief Get the 2d resources path to "audio-volume-muted".
*
* \image html audio-volume-muted.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscAudioVolumeMuted ()=
strcat L2D_RSC_PATH "audio-volume-muted.png";;
/*! \brief Get the 2d resources path to "battery".
*
* \image html battery.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscBattery ()=
strcat L2D_RSC_PATH "battery.png";;
/*! \brief Get the 2d resources path to "book".
*
* \image html book.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscBook ()=
strcat L2D_RSC_PATH "book.png";;
/*! \brief Get the 2d resources path to "browser".
*
* \image html browser.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscBrowser ()=
strcat L2D_RSC_PATH "browser.png";;
/*! \brief Get the 2d resources path to "camera".
*
* \image html camera.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscCamera ()=
strcat L2D_RSC_PATH "camera.png";;
/*! \brief Get the 2d resources path to "cancel".
*
* \image html cancel.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscCancel ()=
strcat L2D_RSC_PATH "cancel.png";;
/*! \brief Get the 2d resources path to "caution".
*
* \image html caution.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscCaution ()=
strcat L2D_RSC_PATH "caution.png";;
/*! \brief Get the 2d resources path to "clock".
*
* \image html clock.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscClock ()=
strcat L2D_RSC_PATH "clock.png";;
/*! \brief Get the 2d resources path to "colors".
*
* \image html colors.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscColors ()=
strcat L2D_RSC_PATH "colors.png";;
/*! \brief Get the 2d resources path to "connect".
*
* \image html connect.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscConnect ()=
strcat L2D_RSC_PATH "connect.png";;
/*! \brief Get the 2d resources path to "copy".
*
* \image html copy.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscCopy ()=
strcat L2D_RSC_PATH "copy.png";;
/*! \brief Get the 2d resources path to "cut".
*
* \image html cut.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscCut ()=
strcat L2D_RSC_PATH "cut.png";;
/*! \brief Get the 2d resources path to "date".
*
* \image html date.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscDate ()=
strcat L2D_RSC_PATH "date.png";;
/*! \brief Get the 2d resources path to "development".
*
* \image html development.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscDevelopment ()=
strcat L2D_RSC_PATH "development.png";;
/*! \brief Get the 2d resources path to "disconnect".
*
* \image html disconnect.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscDisconnect ()=
strcat L2D_RSC_PATH "disconnect.png";;
/*! \brief Get the 2d resources path to "edit".
*
* \image html edit.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscEdit ()=
strcat L2D_RSC_PATH "edit.png";;
/*! \brief Get the 2d resources path to "error".
*
* \image html error.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscError ()=
strcat L2D_RSC_PATH "error.png";;
/*! \brief Get the 2d resources path to "face-plain".
*
* \image html face-plain.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscFacePlain ()=
strcat L2D_RSC_PATH "face-plain.png";;
/*! \brief Get the 2d resources path to "face-sad".
*
* \image html face-sad.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscFaceSad ()=
strcat L2D_RSC_PATH "face-sad.png";;
/*! \brief Get the 2d resources path to "face-smile".
*
* \image html face-smile.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscFaceSmile ()=
strcat L2D_RSC_PATH "face-smile.png";;
/*! \brief Get the 2d resources path to "fileopen".
*
* \image html fileopen.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscFileopen ()=
strcat L2D_RSC_PATH "fileopen.png";;
/*! \brief Get the 2d resources path to "games".
*
* \image html games.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscGames ()=
strcat L2D_RSC_PATH "games.png";;
/*! \brief Get the 2d resources path to "gaming".
*
* \image html gaming.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscGaming ()=
strcat L2D_RSC_PATH "gaming.png";;
/*! \brief Get the 2d resources path to "graphics".
*
* \image html graphics.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscGraphics ()=
strcat L2D_RSC_PATH "graphics.png";;
/*! \brief Get the 2d resources path to "halt".
*
* \image html halt.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscHalt ()=
strcat L2D_RSC_PATH "halt.png";;
/*! \brief Get the 2d resources path to "help".
*
* \image html help.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscHelp ()=
strcat L2D_RSC_PATH "help.png";;
/*! \brief Get the 2d resources path to "important".
*
* \image html important.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscImportant ()=
strcat L2D_RSC_PATH "important.png";;
/*! \brief Get the 2d resources path to "info".
*
* \image html info.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscInfo ()=
strcat L2D_RSC_PATH "info.png";;
/*! \brief Get the 2d resources path to "internet".
*
* \image html internet.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscInternet ()=
strcat L2D_RSC_PATH "internet.png";;
/*! \brief Get the 2d resources path to "keyboard".
*
* \image html keyboard.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscKeyboard ()=
strcat L2D_RSC_PATH "keyboard.png";;
/*! \brief Get the 2d resources path to "language".
*
* \image html language.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscLanguage ()=
strcat L2D_RSC_PATH "language.png";;
/*! \brief Get the 2d resources path to "login".
*
* \image html login.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscLogin ()=
strcat L2D_RSC_PATH "login.png";;
/*! \brief Get the 2d resources path to "microphone".
*
* \image html microphone.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscMicrophone ()=
strcat L2D_RSC_PATH "microphone.png";;
/*! \brief Get the 2d resources path to "mouse".
*
* \image html mouse.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscMouse ()=
strcat L2D_RSC_PATH "mouse.png";;
/*! \brief Get the 2d resources path to "multimedia".
*
* \image html multimedia.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscMultimedia ()=
strcat L2D_RSC_PATH "multimedia.png";;
/*! \brief Get the 2d resources path to "no".
*
* \image html no.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscNo ()=
strcat L2D_RSC_PATH "no.png";;
/*! \brief Get the 2d resources path to "office".
*
* \image html office.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscOffice ()=
strcat L2D_RSC_PATH "office.png";;
/*! \brief Get the 2d resources path to "paste".
*
* \image html paste.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscPaste ()=
strcat L2D_RSC_PATH "paste.png";;
/*! \brief Get the 2d resources path to "preferences".
*
* \image html preferences.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscPreferences ()=
strcat L2D_RSC_PATH "preferences.png";;
/*! \brief Get the 2d resources path to "printer".
*
* \image html printer.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscPrinter ()=
strcat L2D_RSC_PATH "printer.png";;
/*! \brief Get the 2d resources path to "properties".
*
* \image html properties.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscProperties ()=
strcat L2D_RSC_PATH "properties.png";;
/*! \brief Get the 2d resources path to "record".
*
* \image html record.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscRecord ()=
strcat L2D_RSC_PATH "record.png";;
/*! \brief Get the 2d resources path to "run".
*
* \image html run.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscRun ()=
strcat L2D_RSC_PATH "run.png";;
/*! \brief Get the 2d resources path to "run2".
*
* \image html run2.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscRun2 ()=
strcat L2D_RSC_PATH "run2.png";;
/*! \brief Get the 2d resources path to "save".
*
* \image html save.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscSave ()=
strcat L2D_RSC_PATH "save.png";;
/*! \brief Get the 2d resources path to "scol".
*
* \image html scol.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
*
* \remark A BMP file is also available in the root Scol directory : "logo.bmp" (64x64 px)
**/
fun lib2d_rscScol ()=
strcat L2D_RSC_PATH "scol.png";;
/*! \brief Get the 2d resources path to "screenshooter".
*
* \image html screenshooter.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscScreenshooter ()=
strcat L2D_RSC_PATH "screenshooter.png";;
/*! \brief Get the 2d resources path to "search".
*
* \image html search.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscSearch ()=
strcat L2D_RSC_PATH "search.png";;
/*! \brief Get the 2d resources path to "status-0-24".
*
* \image html status-0-24.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscStatus_0_24 ()=
strcat L2D_RSC_PATH "status-0-24.png";;
/*! \brief Get the 2d resources path to "status-25-49".
*
* \image html status-25-49.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscStatus_25_49 ()=
strcat L2D_RSC_PATH "status-25-49.png";;
/*! \brief Get the 2d resources path to "status-50-74".
*
* \image html status-50-74.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscStatus_50_74 ()=
strcat L2D_RSC_PATH "status-50-74.png";;
/*! \brief Get the 2d resources path to "status-75-100".
*
* \image html status-75-100.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscStatus_75_100 ()=
strcat L2D_RSC_PATH "status-75-100.png";;
/*! \brief Get the 2d resources path to "stop".
*
* \image html stop.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscStop ()=
strcat L2D_RSC_PATH "stop.png";;
/*! \brief Get the 2d resources path to "system".
*
* \image html system.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscSystem ()=
strcat L2D_RSC_PATH "system.png";;
/*! \brief Get the 2d resources path to "theme".
*
* \image html theme.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscTheme ()=
strcat L2D_RSC_PATH "theme.png";;
/*! \brief Get the 2d resources path to "unknown".
*
* \image html unknown.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscUnknown ()=
strcat L2D_RSC_PATH "unknown.png";;
/*! \brief Get the 2d resources path to "update-available".
*
* \image html update-available.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscUpdateAvailable ()=
strcat L2D_RSC_PATH "update-available.png";;
/*! \brief Get the 2d resources path to "user".
*
* \image html user.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscUser ()=
strcat L2D_RSC_PATH "user.png";;
/*! \brief Get the 2d resources path to "warning".
*
* \image html warning.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscWarning ()=
strcat L2D_RSC_PATH "warning.png";;
/*! \brief Get the 2d resources path to "www".
*
* \image html www.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscWww ()=
strcat L2D_RSC_PATH "www.png";;
/*! \brief Get the 2d resources path to "yes".
*
* \image html yes.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscYes ()=
strcat L2D_RSC_PATH "yes.png";;
/*! \brief Get the 2d resources path to "scol_logo_scol_black".
*
* \image html scol_logo_scol_black.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscScolLogoBlack ()=
strcat L2D_RSC_PATH "scol_logo_scol_black.png";;
/*! \brief Get the 2d resources path to "scol_logo_scol_white".
*
* \image html scol_logo_scol_white.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscScolLogoWhite ()=
strcat L2D_RSC_PATH "scol_logo_scol_white.png";;
/*! \brief Get the 2d resources path to "scol_logo_powered_black".
*
* \image html scol_logo_powered_black.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscScolLogoPoweredBlack ()=
strcat L2D_RSC_PATH "scol_logo_powered_black.png";;
/*! \brief Get the 2d resources path to "scol_logo_powered_white".
*
* \image html scol_logo_powered_white.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscScolLogoPoweredWhite ()=
strcat L2D_RSC_PATH "scol_logo_powered_white.png";;
/*! \brief Get the 2d resources path to "scolring_black".
*
* \image html scolring_black.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscScolringBlack ()=
strcat L2D_RSC_PATH "scolring_black.png";;
/*! \brief Get the 2d resources path to "scolring_white".
*
* \image html scolring_white.png
*
* \ingroup _2dos_rsc
* Prototype : fun [] S
*
* \return S : the current 2d resources path
**/
fun lib2d_rscScolringWhite ()=
strcat L2D_RSC_PATH "scolring_white.png";;