Merge branch 'packages'
37
configure.in
@ -21,19 +21,33 @@ AC_ARG_WITH(sdl-gfx-prefix,
|
||||
|
||||
AC_CHECK_LIB(SDL_gfx, rotozoomSurfaceXY,,check_sdl_gfx="no")
|
||||
|
||||
AC_CHECK_LIB(SDL_ttf, TTF_OpenFont)
|
||||
|
||||
# Check for libpng
|
||||
AC_CHECK_LIB(png, png_read_image,,check_png="no")
|
||||
|
||||
# Check for libopk
|
||||
AC_CHECK_LIB(opk, opk_open,,INOTIFY=no)
|
||||
|
||||
# Check for libxdgmime
|
||||
AC_CHECK_LIB(xdgmime, xdg_mime_get_extensions_from_mime_type)
|
||||
|
||||
AC_ARG_ENABLE(platform,
|
||||
[ --enable-platform=X specify the targeted platform],
|
||||
[GMENU2X_PLATFORM="$enableval"], [GMENU2X_PLATFORM="default"])
|
||||
|
||||
case "$GMENU2X_PLATFORM" in
|
||||
dingux)
|
||||
AC_DEFINE(PLATFORM_DINGUX)
|
||||
PLATFORM="dingux"
|
||||
a320)
|
||||
AC_DEFINE(PLATFORM_A320)
|
||||
PLATFORM="a320"
|
||||
SCREEN_RES="320x240"
|
||||
;;
|
||||
gcw0)
|
||||
AC_DEFINE(PLATFORM_GCW0)
|
||||
PLATFORM="gcw0"
|
||||
SCREEN_RES="320x240"
|
||||
CPUFREQ=no
|
||||
;;
|
||||
nanonote)
|
||||
AC_DEFINE(PLATFORM_NANONOTE)
|
||||
PLATFORM="nanonote"
|
||||
@ -60,8 +74,25 @@ case "$GMENU2X_PLATFORM" in
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_ARG_ENABLE(cpufreq,
|
||||
[ --disable-cpufreq disable support for CPU frequency scaling],
|
||||
[CPUFREQ=no],,)
|
||||
|
||||
AC_ARG_ENABLE(inotify,
|
||||
[ --disable-inotify disable file monitoring],
|
||||
[INOTIFY=no],,)
|
||||
|
||||
AC_SUBST(PLATFORM)
|
||||
AC_SUBST(SCREEN_RES)
|
||||
AC_DEFINE_UNQUOTED(PLATFORM, "${PLATFORM}")
|
||||
|
||||
if test "x$CPUFREQ" != xno ; then
|
||||
AC_DEFINE(ENABLE_CPUFREQ)
|
||||
fi
|
||||
|
||||
if test "x$INOTIFY" != xno ; then
|
||||
AC_DEFINE(ENABLE_INOTIFY)
|
||||
fi
|
||||
|
||||
|
||||
AC_OUTPUT(Makefile src/Makefile data/Makefile)
|
||||
|
2
data/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
/Makefile
|
||||
/Makefile.in
|
@ -2,3 +2,4 @@ title=Power Off
|
||||
description=Shut down the system
|
||||
icon=skin:icons/poweroff.png
|
||||
exec=/sbin/poweroff
|
||||
editable=false
|
@ -2,3 +2,4 @@ title=Reboot
|
||||
description=Reboot the dingoo
|
||||
icon=skin:icons/reboot.png
|
||||
exec=/sbin/reboot
|
||||
editable=false
|
@ -3,3 +3,4 @@ description=Suspend the dingoo
|
||||
icon=skin:icons/suspend.png
|
||||
exec=/usr/sbin/suspend
|
||||
dontleave=true
|
||||
editable=false
|
@ -3,3 +3,4 @@ description=Configure sound settings
|
||||
icon=skin:icons/alsamixer.png
|
||||
exec=/usr/bin/alsamixer
|
||||
consoleapp=true
|
||||
editable=false
|
@ -4,3 +4,4 @@ icon=skin:icons/about.png
|
||||
exec=/usr/bin/dialog
|
||||
params=--ok-label "Press START to exit" --no-shadow --msgbox "`/usr/bin/system_info`" 240 320
|
||||
consoleapp=true
|
||||
editable=false
|
@ -3,3 +3,4 @@ description=Enable/Disable TV output
|
||||
icon=skin:icons/tv.png
|
||||
exec=/usr/sbin/tvout_config
|
||||
consoleapp=true
|
||||
editable=false
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
19
data/platform/gcw0/about.txt
Normal file
@ -0,0 +1,19 @@
|
||||
GMenu2X has been created by Massimiliano "Ryo" Torromeo, and is released under the GPL-v2 license.
|
||||
|
||||
This version is maintained by the Qi-Hardware and OpenDingux crew. The credits, as well as the latest source code can be found here:
|
||||
http://projects.qi-hardware.com/index.php/p/gmenu2x
|
||||
|
||||
Credits for the translations:
|
||||
-----
|
||||
English & Italian by Massimiliano Torromeo
|
||||
French by Yodaz
|
||||
Danish by claus
|
||||
Dutch by superfly
|
||||
Spanish by pedator
|
||||
Portuguese (Portugal) by NightShadow
|
||||
Slovak by Jozef
|
||||
Swedish by Esslan and Micket
|
||||
German by fusion_power, johnnysnet and Waldteufel
|
||||
Finnish by Jontte and Atte
|
||||
Norwegian by cowai
|
||||
Russian by XaMMaX90
|
4
data/platform/gcw0/gmenu2x.conf
Normal file
@ -0,0 +1,4 @@
|
||||
videoBpp=32
|
||||
menuClock=192
|
||||
maxClock=1020
|
||||
backlightTimeout=60
|
10
data/platform/gcw0/input.conf
Normal file
@ -0,0 +1,10 @@
|
||||
accept=keyboard,306
|
||||
cancel=keyboard,308
|
||||
altleft=keyboard,9
|
||||
altright=keyboard,8
|
||||
menu=keyboard,27
|
||||
settings=keyboard,13
|
||||
up=keyboard,273
|
||||
down=keyboard,274
|
||||
left=keyboard,276
|
||||
right=keyboard,275
|
6
data/platform/gcw0/sections/applications/30_terminal
Normal file
@ -0,0 +1,6 @@
|
||||
title=Terminal
|
||||
description=Disable graphic mode
|
||||
icon=skin:icons/utilities-terminal.png
|
||||
exec=/bin/busybox
|
||||
params=sh -c 'clear; echo "The graphic mode is now disabled."; echo ""; echo "This is only useful for developers who want to test their graphical apps from telnet."; echo ""; echo "(Press START to exit to the launcher)"; read'
|
||||
consoleapp=true
|
5
data/platform/gcw0/sections/settings/10_poweroff
Normal file
@ -0,0 +1,5 @@
|
||||
title=Power Off
|
||||
description=Shut down the system
|
||||
icon=skin:icons/poweroff.png
|
||||
exec=/sbin/poweroff
|
||||
editable=false
|
5
data/platform/gcw0/sections/settings/20_reboot
Normal file
@ -0,0 +1,5 @@
|
||||
title=Reboot
|
||||
description=Reboot the system
|
||||
icon=skin:icons/reboot.png
|
||||
exec=/sbin/reboot
|
||||
editable=false
|
6
data/platform/gcw0/sections/settings/40_alsamixer
Normal file
@ -0,0 +1,6 @@
|
||||
title=Sound Mixer
|
||||
description=Configure sound settings
|
||||
icon=skin:icons/alsamixer.png
|
||||
exec=/usr/bin/alsamixer
|
||||
consoleapp=true
|
||||
editable=false
|
7
data/platform/gcw0/sections/settings/50_system_info
Normal file
@ -0,0 +1,7 @@
|
||||
title=System Info
|
||||
description=Info about the system
|
||||
icon=skin:icons/about.png
|
||||
exec=/usr/bin/dialog
|
||||
params=--ok-label "Press START to exit" --no-shadow --msgbox "`/usr/bin/system_info`" 240 320
|
||||
consoleapp=true
|
||||
editable=false
|
BIN
data/platform/gcw0/skins/Default/imgs/buttons/accept.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
data/platform/gcw0/skins/Default/imgs/buttons/cancel.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
data/platform/gcw0/skins/Default/wallpapers/320_A_BLUE.png
Normal file
After Width: | Height: | Size: 41 KiB |
BIN
data/platform/gcw0/skins/Default/wallpapers/320_A_GREEN.png
Normal file
After Width: | Height: | Size: 43 KiB |
BIN
data/platform/gcw0/skins/Default/wallpapers/320_A_GREY.png
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
data/platform/gcw0/skins/Default/wallpapers/320_A_LIGHTBLUE.png
Normal file
After Width: | Height: | Size: 49 KiB |
BIN
data/platform/gcw0/skins/Default/wallpapers/320_A_ORANGE.png
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
data/platform/gcw0/skins/Default/wallpapers/320_A_RED.png
Normal file
After Width: | Height: | Size: 39 KiB |
BIN
data/platform/gcw0/skins/Default/wallpapers/320_CONSOLE_DARK.png
Normal file
After Width: | Height: | Size: 7.9 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 38 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 32 KiB |
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 30 KiB |
BIN
data/platform/gcw0/skins/Default/wallpapers/320_GCW_DARK.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
data/platform/gcw0/skins/Default/wallpapers/320_GCW_LIGHT.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
data/platform/gcw0/skins/Default/wallpapers/320_GCW_WAVE2.png
Normal file
After Width: | Height: | Size: 44 KiB |
7
data/platform/gcw0/skins/Default/wallpapers/COPYING
Normal file
@ -0,0 +1,7 @@
|
||||
320_* images:
|
||||
Copyright 2013 Ivan Díaz Bardeci <hi-ban@hotmail.com>
|
||||
Licensed under Attribution-ShareAlike CC BY-SA.
|
||||
|
||||
blue-zero.png:
|
||||
Copyright 2013 Maarten ter Huurne <maarten@treewalker.org>
|
||||
Licensed under Attribution-ShareAlike CC BY-SA.
|
BIN
data/platform/gcw0/skins/Default/wallpapers/blue-zero.png
Normal file
After Width: | Height: | Size: 46 KiB |
1
data/platform/gcw0/skins/Default/wallpapers/default.png
Symbolic link
@ -0,0 +1 @@
|
||||
320_GCW_DARK.png
|
11
data/platform/gcw0/skins/OD/skin.conf
Normal file
@ -0,0 +1,11 @@
|
||||
wallpaper="blue-zero.png"
|
||||
linkHeight=50
|
||||
topBarHeight=50
|
||||
bottomBarHeight=21
|
||||
linkWidth=80
|
||||
topBarBg=#ffffff00
|
||||
bottomBarBg=#ffffff00
|
||||
selectionBg=#9b9bff80
|
||||
messageBoxBg=#000014bc
|
||||
messageBoxBorder=#9b9bff80
|
||||
messageBoxSelection=#9b9bff80
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 76 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 7.4 KiB |
Before Width: | Height: | Size: 278 B |
Before Width: | Height: | Size: 398 B |
BIN
data/skins/320x240/Default/imgs/section-l.png
Normal file
After Width: | Height: | Size: 153 B |
BIN
data/skins/320x240/Default/imgs/section-r.png
Normal file
After Width: | Height: | Size: 281 B |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 2.9 KiB |
@ -5,5 +5,6 @@ messageBoxBg=#00000080
|
||||
messageBoxSelection=#fffffff80
|
||||
bottomBarBg=#ffffff80
|
||||
topBarHeight=50
|
||||
bottomBarHeight=21
|
||||
linkHeight=50
|
||||
linkWidth=80
|
Before Width: | Height: | Size: 7.4 KiB |
Before Width: | Height: | Size: 278 B |
Before Width: | Height: | Size: 281 B |
Before Width: | Height: | Size: 398 B |
Before Width: | Height: | Size: 462 B |
Before Width: | Height: | Size: 281 B After Width: | Height: | Size: 281 B |
Before Width: | Height: | Size: 462 B After Width: | Height: | Size: 462 B |
@ -5,5 +5,6 @@ messageBoxBg=#00000080
|
||||
messageBoxSelection=#fffffff80
|
||||
bottomBarBg=#ffffff80
|
||||
topBarHeight=50
|
||||
bottomBarHeight=21
|
||||
linkHeight=50
|
||||
linkWidth=80
|
@ -1,3 +1,4 @@
|
||||
Lng=eu
|
||||
Settings=Aukerak
|
||||
Configure GMenu2X's options=GMenu2X aukerak konfiguratu
|
||||
Activate Usb on SD=Sd-aren usb-a aktibatu
|
||||
@ -50,11 +51,11 @@ Number of columns=Zutabe zenbakia
|
||||
Set the number of columns of links to display on a page=Orri bakoitzeko erakutsiko diren zutabeak
|
||||
Number of rows=Ilara zenbakia
|
||||
Set the number of rows of links to display on a page=Orri bakoitzeko erakutsiko diren ilarak
|
||||
Top Bar Color=Goiko barraren kolorea
|
||||
Top Bar=Goiko barraren
|
||||
Color of the top bar=Goian dagoen barraren kolorea
|
||||
Bottom Bar Color=Beheko barraren kolorea
|
||||
Bottom Bar=Beheko barraren
|
||||
Color of the bottom bar=Behean dagoen barraren kolorea
|
||||
Selection Color=aukeratutakoaren kolorea
|
||||
Selection=Aukeratutakoaren
|
||||
Color of the selection and other interface details=Aukeratutako testuaren kolorea eta interfacearen beste aukera batzuk
|
||||
You should disable Usb Networking to do this.=Usb sarea desaktibatu beharko zenuke.
|
||||
Operation not permitted.=Baimendu gabeko operazioa.
|
||||
|
@ -1,3 +1,4 @@
|
||||
Lng=ca
|
||||
Settings=Preferències
|
||||
Configure GMenu2X's options=Configura les opcions del GMenu2X
|
||||
Activate Usb on SD=Activa USB per la SD
|
||||
@ -51,11 +52,11 @@ Number of columns=Número de columnes
|
||||
Set the number of columns of links to display on a page=Ajusta el número de columnes d'enllaços a mostrar per pàgina
|
||||
Number of rows=Número de línies
|
||||
Set the number of rows of links to display on a page=Ajusta el número de línies d'enllaços a mostrar per pàgina
|
||||
Top Bar Color=Color de barra superior
|
||||
Top Bar=Barra superior
|
||||
Color of the top bar=Color de la barra superior
|
||||
Bottom Bar Color=Color de barra inferior
|
||||
Bottom Bar=Barra inferior
|
||||
Color of the bottom bar=Color de la barra inferior
|
||||
Selection Color=Color selecció
|
||||
Selection=Selecció
|
||||
Color of the selection and other interface details=Color de la selecció i altres detalls de la interfície
|
||||
You should disable Usb Networking to do this.=Ha de desactivar la Xarxa per USB per fer això.
|
||||
Operation not permitted.=Operació no permesa.
|
||||
@ -129,9 +130,9 @@ Gamma (default: 0)=Gamma (predeterminat: 0)
|
||||
Gamma value to set when launching this link=Valor de gamma que utilitzarà a l'executar aquest enllaç
|
||||
Wallpaper=Fons d'escriptori
|
||||
Configure skin=Configura el Tema
|
||||
Message Box Color=Color de caixa de text
|
||||
Message Box Border Color=Color de la vora de la caixa de text
|
||||
Message Box Selection Color=Color de la selecció de la caixa de text
|
||||
Message Box=Caixa de text
|
||||
Message Box Border=Vora de la caixa de text
|
||||
Message Box Selection=Selecció de la caixa de text
|
||||
Background color of the message box=Color de fons de la caixa de text
|
||||
Border color of the message box=Color de la vora de la caixa de text
|
||||
Color of the selection of the message box=Color de la selecció de la caixa de text
|
||||
|
@ -1,4 +1,5 @@
|
||||
settings=Indstillinger
|
||||
Lng=da
|
||||
settings=Indstillinger
|
||||
Configure GMenu2X's options=Konfigurer GMenu2X's Indstillinger
|
||||
Activate Usb on SD=Aktiver Usb på SD
|
||||
Activate Usb on Nand=Aktiver Usb på Nand
|
||||
@ -54,11 +55,11 @@ Number of columns=Antal spalter
|
||||
Set the number of columns of links to display on a page=Angiv antallet af spalter for genveje per side
|
||||
Number of rows=Antal rækker
|
||||
Set the number of rows of links to display on a page= Angiv antallet af rækker for genveje per side
|
||||
Top Bar Color=Øverste bjælkes farve
|
||||
Top Bar=Øverste bjælke
|
||||
Color of the top bar= Øverste bjælkes farve
|
||||
Bottom Bar Color=Nederste bjælkes farve
|
||||
Bottom Bar=Nederste bjælke
|
||||
Color of the bottom bar=Nederste bjælkes farve
|
||||
Selection Color=Markørens farve
|
||||
Selection=Markøren
|
||||
Color of the selection and other interface details= Markøren og grænseflades farve
|
||||
You should disable Usb Networking to do this.=Du bør fravælge USB netværket nå du vælger dette
|
||||
Operation not permitted.=Dette er ikke tilladt.
|
||||
@ -121,9 +122,9 @@ Scroll=Rulle
|
||||
Untitled=Ikke navngivet
|
||||
Wallpaper=Baggrund
|
||||
Configure skin=Konfigurer tema
|
||||
Message Box Color=Farve på Konfigurations vinduet
|
||||
Message Box Border Color= Farve på Konfig vinduets kant
|
||||
Message Box Selection Color=Konfig vinduets markør farve
|
||||
Message Box=Konfigurations vinduet
|
||||
Message Box Border=Konfig vinduets kant
|
||||
Message Box Selection=Konfig vinduets markør
|
||||
Background color of the message box= Konfigurations vinduets baggrundsfarve
|
||||
Border color of the message box=Farve på Konfigurations vinduets kant
|
||||
Color of the selection of the message box=Farven på markøren i Konfigurations vinduet
|
||||
|
@ -1,3 +1,4 @@
|
||||
Lng=nl
|
||||
Settings=Instellingen
|
||||
Configure GMenu2X's options=Instellingen van GMenu2X
|
||||
Activate Usb on SD=Activeer USB op SD
|
||||
@ -51,11 +52,11 @@ Number of columns=Aantal kolommen
|
||||
Set the number of columns of links to display on a page=Stel het aantal getoonde pictogrammen in (horizontaal)
|
||||
Number of rows=Aantal rijen
|
||||
Set the number of rows of links to display on a page=Stel het aantal getoonde pictogrammen in (verticaal)
|
||||
Top Bar Color=Kleur bovenste balk
|
||||
Top Bar=Bovenste balk
|
||||
Color of the top bar=Kleur van de bovenste balk
|
||||
Bottom Bar Color=Kleur onderste balk
|
||||
Bottom Bar=Onderste balk
|
||||
Color of the bottom bar=Kleur van de onderste balk
|
||||
Selection Color=Kleur selectie
|
||||
Selection=Selectie
|
||||
Color of the selection and other interface details=Kleur van de selectie en andere interface details
|
||||
You should disable Usb Networking to do this.=Zet USB Netwerk uit om dit te gebruiken.
|
||||
Operation not permitted.=Handeling niet toegestaan.
|
||||
|
@ -1,3 +1,4 @@
|
||||
Lng=fi
|
||||
Settings=Asetukset
|
||||
Configure GMenu2X's options=Muuta GMenu2X:n asetuksia
|
||||
Activate Usb on SD=Aktivoi USB SD-kortille
|
||||
@ -51,10 +52,11 @@ Number of columns=Sarakkeiden lukum<75><6D>r<EFBFBD>
|
||||
Set the number of columns of links to display on a page=Aseta linkkisarakkeiden lukum<75><6D>r<EFBFBD> sivulla
|
||||
Number of rows=Rivien lukum<75><6D>r<EFBFBD>
|
||||
Set the number of rows of links to display on a page=Aseta linkkirivien lukum<75><6D>r<EFBFBD> sivulla
|
||||
Top Bar Color=V<>ri yl<EFBFBD>palkille
|
||||
Top Bar=Yl<EFBFBD>palkille
|
||||
Color of the top bar=Yl<59>palkin v<>ri
|
||||
Bottom Bar=Alapalkin
|
||||
Color of the bottom bar=Alapalkin v<>ri
|
||||
Selection Color=Valinnan v<>ri
|
||||
Selection=Valinnan
|
||||
Color of the selection and other interface details=Valinnan ja muiden ykstiyiskohtien v<>ri
|
||||
You should disable Usb Networking to do this.=Usb Networking:in pit<69><74> olla poissa k<>yt<79>st<73> jotta voit tehd<68> t<>m<EFBFBD>n.
|
||||
Operation not permitted.=Toiminto ei ole sallittu.
|
||||
|
@ -1,3 +1,4 @@
|
||||
Lng=fr
|
||||
Settings=Configurations
|
||||
Configure GMenu2X's options=Configurer les options de GMenu2X
|
||||
Activate Usb on SD=Activer l'Usb sur la SD
|
||||
@ -51,11 +52,11 @@ Number of columns=Nombre de colonnes
|
||||
Set the number of columns of links to display on a page=Définir le nombre de colonnes de liens à afficher sur une page
|
||||
Number of rows=Nombres de rangées
|
||||
Set the number of rows of links to display on a page=Définir le nombre de rangées de liens à afficher sur une page
|
||||
Top Bar Color=Couleur de la bar supérieur
|
||||
Top Bar=Bar supérieur
|
||||
Color of the top bar=Couleur de la bar supérieur
|
||||
Bottom Bar Color=Couleur de la bar inférieur
|
||||
Bottom Bar=Bar inférieur
|
||||
Color of the bottom bar=Couleur de la bar inférieur
|
||||
Selection Color=Couleur de sélection
|
||||
Selection=Sélection
|
||||
Color of the selection and other interface details=Couleur de la sélection et des autres détails de l'interface
|
||||
You should disable Usb Networking to do this.=Vous devez désactiver le réseau Usb pour faire ceci.
|
||||
Operation not permitted.=Opération non permise
|
||||
|
@ -1,3 +1,4 @@
|
||||
Lng=de
|
||||
Settings=Einstellungen
|
||||
Configure GMenu2X's options=Optionen des GMenu2X konfigurieren
|
||||
Activate Usb on SD=Aktiviert USB für die SD-Karte
|
||||
@ -51,11 +52,11 @@ Number of columns=Anzahl der Spalten
|
||||
Set the number of columns of links to display on a page=Anzahl der Spalten mit Links, pro Seite
|
||||
Number of rows=Anzahl der Zeilen
|
||||
Set the number of rows of links to display on a page=Anzahl der Zeilen mit Links, pro Seite
|
||||
Top Bar Color=Farbe der Kopfleiste
|
||||
Top Bar=Kopfleiste
|
||||
Color of the top bar= Stellt Farbe und Transparenz der oberen Menüleiste ein
|
||||
Bottom Bar Color=Farbe der Fußleiste
|
||||
Bottom Bar=Fußleiste
|
||||
Color of the bottom bar=Stellt Farbe und Transparenz der unteren Menüleiste ein
|
||||
Selection Color=Farbe der Auswahl
|
||||
Selection=Auswahl
|
||||
Color of the selection and other interface details=Farbe der Auswahl-Hervorhebung und anderer Interface-Details
|
||||
You should disable Usb Networking to do this.=Du solltest USB Networking deaktivieren um dies zu tun.
|
||||
Operation not permitted.=Operation nicht gestattet.
|
||||
|
@ -1,3 +1,4 @@
|
||||
Lng=it
|
||||
Settings=Impostazioni
|
||||
Configure GMenu2X's options=Configura le opzioni di GMenu2X
|
||||
Activate Usb on SD=Attiva USB sulla SD
|
||||
@ -51,11 +52,11 @@ Number of columns=Numero di colonne
|
||||
Set the number of columns of links to display on a page=Imposta il numero di colonne di collegamenti da visualizzare in una pagina
|
||||
Number of rows=Numero di righe
|
||||
Set the number of rows of links to display on a page=Imposta il numero di righe di collegamenti da visualizzare in una pagina
|
||||
Top Bar Color=Colore barra superiore
|
||||
Top Bar=Barra superiore
|
||||
Color of the top bar=Colore della barra superiore
|
||||
Bottom Bar Color=Colore barra inferiore
|
||||
Bottom Bar=Barra inferiore
|
||||
Color of the bottom bar=Colore della barra inferiore
|
||||
Selection Color=Colore selezione
|
||||
Selection=Selezione
|
||||
Color of the selection and other interface details=Colore della selezione e altri dettagli dell'interfaccia
|
||||
You should disable Usb Networking to do this.=Dovresti disattivare le impostazioni di rete per farlo.
|
||||
Operation not permitted.=Operazione non consentita.
|
||||
@ -129,9 +130,9 @@ Gamma (default: 0)=Gamma (predefinito: 0)
|
||||
Gamma value to set when launching this link=Valore di gamma da impostare quando si lancia questo collegamento
|
||||
Wallpaper=Sfondo
|
||||
Configure skin=Configura skin
|
||||
Message Box Color=Colore Finestra Messaggi
|
||||
Message Box Border Color=Colore Bordo Finestra Messaggi
|
||||
Message Box Selection Color=Color Selezione Finestra Messaggi
|
||||
Message Box=Finestra Messaggi
|
||||
Message Box Border=Bordo Finestra Messaggi
|
||||
Message Box Selection=Selezione Finestra Messaggi
|
||||
Background color of the message box=Colore di sfondo della finestra dei messaggi
|
||||
Border color of the message box=Colore del bordo della finestra dei messaggi
|
||||
Color of the selection of the message box=Colore della selezione della finestra dei messaggi
|
||||
|
@ -1,3 +1,4 @@
|
||||
Lng=no
|
||||
Settings=Instillinger
|
||||
Configure GMenu2X's options=Konfigurer GMenu2X's innstillinger
|
||||
Activate Usb on SD=Aktiver USB på SD
|
||||
@ -51,11 +52,11 @@ Number of columns=Antall spalter
|
||||
Set the number of columns of links to display on a page=Velg antall spalter med linker som skal vises per side
|
||||
Number of rows=Antall rader
|
||||
Set the number of rows of links to display on a page=Velg antall rader med linker som skal vises per side
|
||||
Top Bar Color=Øverste felts farge
|
||||
Top Bar=Øverste felt
|
||||
Color of the top bar=Farge på det øverste feltet
|
||||
Bottom Bar Color=Nederste felts farge
|
||||
Bottom Bar=Nederste felt
|
||||
Color of the bottom bar=Färge på det nederste feltet
|
||||
Selection Color=Markørfarge
|
||||
Selection=Markør
|
||||
Color of the selection and other interface details=Farge på markøren og andre deler av grensesnittet
|
||||
You should disable Usb Networking to do this.=Du bør slå av USB-nettverket når du gjør dette.
|
||||
Operation not permitted.=Utillat operasjon.
|
||||
|
@ -1,3 +1,4 @@
|
||||
Lng=pt
|
||||
Settings= Configurações
|
||||
Configure GMenu2X's options=Configurar opções do GMenu2X
|
||||
Activate Usb on SD=Activar USB para SD
|
||||
@ -51,11 +52,11 @@ Number of columns=Número de colunas
|
||||
Set the number of columns of links to display on a page=Ajustar o número de colunas (de links) por página
|
||||
Number of rows=Número de filas
|
||||
Set the number of rows of links to display on a page=Ajustar o número de filas (de links) por página
|
||||
Top Bar Color=Cor da barra superior
|
||||
Top Bar=Barra superior
|
||||
Color of the top bar= Cor da barra superior
|
||||
Bottom Bar Color= Cor da barra inferior
|
||||
Bottom Bar=Barra inferior
|
||||
Color of the bottom bar= Cor da barra inferior
|
||||
Selection Color=Cor da selecção
|
||||
Selection=Selecção
|
||||
Color of the selection and other interface details=Cor da selecção e outros detalhes do interface
|
||||
You should disable Usb Networking to do this.=Deve desactivar a função Networking por USB para executar este comando.
|
||||
Operation not permitted.=Operação não permitida.
|
||||
|
@ -1,3 +1,4 @@
|
||||
Lng=ru
|
||||
Settings=Настройки
|
||||
Configure GMenu2X's options=Изменить настройки GMenu2X
|
||||
Activate Usb on SD=Активировать SD через USB
|
||||
@ -51,11 +52,11 @@ Number of columns=Количество столбцов
|
||||
Set the number of columns of links to display on a page=Установите количество столбцов для отображения на странице
|
||||
Number of rows=Количество колонок
|
||||
Set the number of rows of links to display on a page=Установите количество колонок для отображения на странице
|
||||
Top Bar Color=Цвет панели сверху
|
||||
Top Bar=Сверху
|
||||
Color of the top bar=Выберите цвет панели сверху
|
||||
Bottom Bar Color=Цвет панели внизу
|
||||
Bottom Bar=Внизу
|
||||
Color of the bottom bar= Выберите цвет панели внизу
|
||||
Selection Color=Цвет панели выбора
|
||||
Selection=Выбора
|
||||
Color of the selection and other interface details=Выберите цвет панели выбора
|
||||
You should disable Usb Networking to do this.=Вы должны выключить USB Networking чтобы сделать это.
|
||||
Operation not permitted.=Операция не разрешена.
|
||||
|
@ -1,3 +1,4 @@
|
||||
Lng=sk
|
||||
Settings=Nastavenia
|
||||
Configure GMenu2X's options=Nastaviť voľby pre GMenu2X
|
||||
Activate Usb on SD=Aktivovať USB pre SD kartu
|
||||
@ -51,11 +52,11 @@ Number of columns=Počet stĺpcov
|
||||
Set the number of columns of links to display on a page=Nastavte počet stĺpcov pre odkazy zobrazené na stránke
|
||||
Number of rows=Počet riadkov
|
||||
Set the number of rows of links to display on a page=Počet riadkov odkazov zobrazených na stránke
|
||||
Top Bar Color=Farba hornej lišty
|
||||
Top Bar=Hornej lišty
|
||||
Color of the top bar= Farba hornej lišty
|
||||
Bottom Bar Color=Farba spodnej lišty
|
||||
Bottom Bar=Spodnej lišty
|
||||
Color of the bottom bar=Farba spodnej lišty
|
||||
Selection Color=Farba výberu
|
||||
Selection=Výberu
|
||||
Color of the selection and other interface details=Farba výberu a iných detailov interfacu
|
||||
You should disable Usb Networking to do this.=Pre vykonanie tejto operácie by ste mali deaktivovať Usb sieťovanie.
|
||||
Operation not permitted.=Operácia nepovolená.
|
||||
@ -129,9 +130,9 @@ Gamma (default: 0)=Gamma (implic: 0)
|
||||
Gamma value to set when launching this link=Hodnota gamma pri spúšťaní tohto odkazu
|
||||
Wallpaper=Pozadie
|
||||
Configure skin=Nastaviť skin
|
||||
Message Box Color=Farba textového okna
|
||||
Message Box Border Color=Farba okraja textového okna
|
||||
Message Box Selection Color=Farba výberu textového okna
|
||||
Message Box=Textového okna
|
||||
Message Box Border=Okraja textového okna
|
||||
Message Box Selection=Výberu textového okna
|
||||
Background color of the message box=Farba pozadia textového okna
|
||||
Border color of the message box=Farba okraja textového okna
|
||||
Color of the selection of the message box=Farba výberu textového okna
|
||||
|
@ -1,3 +1,4 @@
|
||||
Lng=es
|
||||
Settings=Ajustes
|
||||
Configure GMenu2X's options=Configura las opciones de GMenu2X
|
||||
Activate Usb on SD=Activa USB para SD
|
||||
@ -50,11 +51,11 @@ Number of columns=Número de columnas
|
||||
Set the number of columns of links to display on a page=Ajuste el número de columnas de enlaces que mostrar por página
|
||||
Number of rows=Número de líneas
|
||||
Set the number of rows of links to display on a page=Ajuste el número de líneas de enlaces que mostrar por página
|
||||
Top Bar Color=Color de barra superior
|
||||
Top Bar=Barra superior
|
||||
Color of the top bar=Color de la barra superior
|
||||
Bottom Bar Color=Color de barra inferior
|
||||
Bottom Bar=Barra inferior
|
||||
Color of the bottom bar=Color de la barra inferior
|
||||
Selection Color=Color de selección
|
||||
Selection=Selección
|
||||
Color of the selection and other interface details=Color de la selección y otros detalles del interfaz
|
||||
You should disable Usb Networking to do this.=Debe desactivar Red por USB para hacer esto.
|
||||
Operation not permitted.=Operación no permitida.
|
||||
|
@ -1,3 +1,4 @@
|
||||
Lng=sv
|
||||
Settings=Inställningar
|
||||
Configure GMenu2X's options=Konfigurera GMenu2X's inställningar
|
||||
Activate Usb on SD=Aktivera Usb på SD
|
||||
@ -51,11 +52,11 @@ Number of columns=Antal spalter
|
||||
Set the number of columns of links to display on a page=Välj antal spalter med länkar som skall visas per sida
|
||||
Number of rows=Antal rader
|
||||
Set the number of rows of links to display on a page=Välj antal rader med länkar som skall visas per sida
|
||||
Top Bar Color=Översta fältets färg
|
||||
Top Bar=Översta fältet
|
||||
Color of the top bar=Färg på det översta fältet
|
||||
Bottom Bar Color=Nedersta fältets färg
|
||||
Bottom Bar=Nedersta fältet
|
||||
Color of the bottom bar=Färg på det nedersta fältet
|
||||
Selection Color=Markörfärg
|
||||
Selection=Markör
|
||||
Color of the selection and other interface details=Färg på markören och andra delar av gränssnittet
|
||||
You should disable Usb Networking to do this.=Du bör slå av usb-nätverket när du gör detta.
|
||||
Operation not permitted.=Otillåten användning.
|
||||
|
@ -1,4 +1,5 @@
|
||||
Settings=Ayarlar
|
||||
Lng=tr
|
||||
Settings=Ayarlar
|
||||
Configure GMenu2X's options=GMenu2X'in ayarlarini degistir
|
||||
Activate Usb on SD=SD Karti için USB baglantisini aktive et
|
||||
Activate Usb on Nand=Nand Bellegi için USB baglantisini aktive et
|
||||
@ -51,11 +52,11 @@ Number of columns=Sütun sayisi
|
||||
Set the number of columns of links to display on a page=Bir sayfada gösterilecek sütun sayisini belirleyin
|
||||
Number of rows=Satir sayisi
|
||||
Set the number of rows of links to display on a page=Bir sayfada gösterilecek satir sayisini belirleyin
|
||||
Top Bar Color=Baslik çubugunun rengi
|
||||
Top Bar=Baslik çubugunun
|
||||
Color of the top bar=Baslik çubugunun rengini ve saydamligini belirler
|
||||
Bottom Bar Color=Statü çubugunun rengi
|
||||
Bottom Bar=Statü çubugunun
|
||||
Color of the bottom bar=Statü çubugunun rengini ve saydamligini belirler
|
||||
Selection Color=Seçim rengi
|
||||
Selection=Seçim
|
||||
Color of the selection and other interface details=Seçim rengi ve baska arabirim detaylarinin rengi
|
||||
You should disable Usb Networking to do this.=Bunu yapmadan önce USB-Ag destegini kapatmalisiniz.
|
||||
Operation not permitted.=Isleme izin verilmedi.
|
||||
|
2108
src/FastDelegate.h
@ -1,6 +1,6 @@
|
||||
bin_PROGRAMS = gmenu2x
|
||||
|
||||
gmenu2x_SOURCES = asfont.cpp button.cpp cpu.cpp dirdialog.cpp filedialog.cpp \
|
||||
gmenu2x_SOURCES = font.cpp cpu.cpp dirdialog.cpp filedialog.cpp \
|
||||
filelister.cpp gmenu2x.cpp iconbutton.cpp imagedialog.cpp inputdialog.cpp \
|
||||
inputmanager.cpp linkapp.cpp link.cpp \
|
||||
menu.cpp menusettingbool.cpp menusetting.cpp menusettingdir.cpp \
|
||||
@ -12,9 +12,10 @@ gmenu2x_SOURCES = asfont.cpp button.cpp cpu.cpp dirdialog.cpp filedialog.cpp \
|
||||
textdialog.cpp textmanualdialog.cpp touchscreen.cpp translator.cpp \
|
||||
utilities.cpp wallpaperdialog.cpp \
|
||||
browsedialog.cpp buttonbox.cpp dialog.cpp \
|
||||
imageio.cpp powersaver.cpp
|
||||
imageio.cpp powersaver.cpp monitor.cpp mediamonitor.cpp clock.cpp \
|
||||
helppopup.cpp contextmenu.cpp background.cpp battery.cpp
|
||||
|
||||
noinst_HEADERS = asfont.h button.h cpu.h dirdialog.h FastDelegate.h \
|
||||
noinst_HEADERS = font.h cpu.h dirdialog.h \
|
||||
filedialog.h filelister.h gmenu2x.h gp2x.h iconbutton.h imagedialog.h \
|
||||
inputdialog.h inputmanager.h linkapp.h link.h \
|
||||
menu.h menusettingbool.h menusettingdir.h \
|
||||
@ -25,12 +26,13 @@ noinst_HEADERS = asfont.h button.h cpu.h dirdialog.h FastDelegate.h \
|
||||
surfacecollection.h surface.h textdialog.h textmanualdialog.h \
|
||||
touchscreen.h translator.h utilities.h wallpaperdialog.h \
|
||||
browsedialog.h buttonbox.h dialog.h \
|
||||
imageio.h powersaver.h
|
||||
imageio.h powersaver.h monitor.h mediamonitor.h clock.h \
|
||||
layer.h helppopup.h contextmenu.h background.h battery.h
|
||||
|
||||
AM_CFLAGS= @CFLAGS@ @SDL_CFLAGS@
|
||||
|
||||
AM_CXXFLAGS = @CXXFLAGS@ @SDL_CFLAGS@ \
|
||||
-fno-exceptions \
|
||||
-Wall -Wextra -Wundef -Wunused-macros
|
||||
-Wall -Wextra -Wundef -Wunused-macros -std=c++11
|
||||
|
||||
gmenu2x_LDADD = @LIBS@ @SDL_LIBS@
|
||||
|
200
src/asfont.cpp
@ -1,200 +0,0 @@
|
||||
#include "asfont.h"
|
||||
#include "imageio.h"
|
||||
#include "surface.h"
|
||||
#include "utilities.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <cstring>
|
||||
|
||||
#define SFONTPLUS_CHARSET "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~¡¿ÀÁÈÉÌÍÒÓÙÚÝÄËÏÖÜŸÂÊÎÔÛÅÃÕÑÆÇČĎĚĽĹŇÔŘŔŠŤŮŽàáèéìíòóùúýäëïöüÿâêîôûåãõñæçčďěľĺňôřŕšťžůðßÐÞþАБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдеёжзийклмнопрстуфхцчшщъыьэюяØøąćęłńśżźĄĆĘŁŃŚŻŹ"
|
||||
|
||||
ASFont::ASFont(const std::string &fontImagePath)
|
||||
: characters(SFONTPLUS_CHARSET)
|
||||
{
|
||||
surface = loadPNG(fontImagePath);
|
||||
if (!surface) {
|
||||
return;
|
||||
}
|
||||
assert(surface->format->BytesPerPixel == 4);
|
||||
|
||||
SDL_LockSurface(surface);
|
||||
|
||||
// Determine character widths.
|
||||
Uint32 pink = SDL_MapRGB(surface->format, 255, 0, 255);
|
||||
Uint32 *topLine = static_cast<Uint32 *>(surface->pixels);
|
||||
const unsigned width = surface->w;
|
||||
unsigned x = 0;
|
||||
unsigned c = 0;
|
||||
while (c < characters.length()) {
|
||||
while (x < width && topLine[x] != pink) x++;
|
||||
unsigned startx = x;
|
||||
x++;
|
||||
while (x < width && topLine[x] == pink) x++;
|
||||
|
||||
charpos.push_back(startx);
|
||||
charpos.push_back(x);
|
||||
if (c > 0 && utf8Code(characters[c - 1])) {
|
||||
// UTF8 character
|
||||
charpos.push_back(startx);
|
||||
charpos.push_back(x);
|
||||
c++;
|
||||
}
|
||||
c++;
|
||||
}
|
||||
|
||||
// Scan height of "0" glyph.
|
||||
std::string::size_type pos = characters.find("0") * 2;
|
||||
SDL_Rect srcrect = {
|
||||
static_cast<Sint16>(charpos[pos]),
|
||||
1,
|
||||
static_cast<Uint16>(charpos[pos + 2] - charpos[pos]),
|
||||
static_cast<Uint16>(surface->h - 1)
|
||||
};
|
||||
const unsigned alphaMask = surface->format->Amask;
|
||||
unsigned y = srcrect.h;
|
||||
bool nonTransparentFound = false;
|
||||
while (!nonTransparentFound && y-- > 0) {
|
||||
Uint32 *line = reinterpret_cast<Uint32 *>(
|
||||
reinterpret_cast<Uint8 *>(surface->pixels)
|
||||
+ (srcrect.y + y) * surface->pitch
|
||||
);
|
||||
for (unsigned x = 0; !nonTransparentFound && x < srcrect.w; x++) {
|
||||
nonTransparentFound = (line[srcrect.x + x] & alphaMask) != 0;
|
||||
}
|
||||
}
|
||||
lineHeight = y + 1;
|
||||
|
||||
SDL_UnlockSurface(surface);
|
||||
}
|
||||
|
||||
ASFont::~ASFont() {
|
||||
if (surface) {
|
||||
SDL_FreeSurface(surface);
|
||||
}
|
||||
}
|
||||
|
||||
bool ASFont::utf8Code(unsigned char c) {
|
||||
return (c>=194 && c<=198) || c==208 || c==209;
|
||||
//return c>=194;
|
||||
}
|
||||
|
||||
void ASFont::writeLine(Surface *s, const std::string &text, int x, int y) {
|
||||
if (text.empty()) return;
|
||||
|
||||
std::string::size_type pos;
|
||||
SDL_Rect srcrect, dstrect;
|
||||
|
||||
// these values won't change in the loop
|
||||
srcrect.y = 1;
|
||||
dstrect.y = y;
|
||||
srcrect.h = dstrect.h = surface->h-1;
|
||||
|
||||
for(unsigned i=0; i<text.length() && x<surface->w; i++) {
|
||||
//Utf8 characters
|
||||
if (utf8Code(text[i]) && i+1<text.length()) {
|
||||
pos = characters.find(text.substr(i,2));
|
||||
i++;
|
||||
} else
|
||||
pos = characters.find(text[i]);
|
||||
if (pos == std::string::npos) {
|
||||
x += charpos[2]-charpos[1];
|
||||
continue;
|
||||
}
|
||||
|
||||
pos *= 2;
|
||||
|
||||
srcrect.x = charpos[pos];
|
||||
srcrect.w = charpos[pos+2] - charpos[pos];
|
||||
dstrect.x = x - charpos[pos+1] + charpos[pos];
|
||||
|
||||
SDL_BlitSurface(surface, &srcrect, s->raw, &dstrect);
|
||||
|
||||
x += charpos[pos+2] - charpos[pos+1];
|
||||
}
|
||||
}
|
||||
|
||||
int ASFont::getTextWidth(const char *text) {
|
||||
int maxWidth = 0, width = 0;
|
||||
while (char ch = *text++) {
|
||||
if (ch == '\n') {
|
||||
// New line.
|
||||
maxWidth = std::max(width, maxWidth);
|
||||
width = 0;
|
||||
} else {
|
||||
std::string::size_type pos;
|
||||
if (utf8Code(ch) && *text) {
|
||||
// 2-byte character.
|
||||
pos = characters.find(std::string(&text[-1], 2));
|
||||
text++;
|
||||
} else {
|
||||
// 1-byte character.
|
||||
pos = characters.find(ch);
|
||||
}
|
||||
if (pos == std::string::npos) {
|
||||
pos = 0;
|
||||
}
|
||||
width += charpos[pos * 2 + 2] - charpos[pos * 2 + 1];
|
||||
}
|
||||
}
|
||||
return std::max(width, maxWidth);
|
||||
}
|
||||
|
||||
int ASFont::getTextWidth(const std::string& text) {
|
||||
return getTextWidth(text.c_str());
|
||||
}
|
||||
|
||||
void ASFont::writeLine(Surface* surface, const std::string& text, int x, int y, HAlign halign) {
|
||||
switch (halign) {
|
||||
case HAlignLeft:
|
||||
break;
|
||||
case HAlignCenter:
|
||||
x -= getTextWidth(text) / 2;
|
||||
break;
|
||||
case HAlignRight:
|
||||
x -= getTextWidth(text);
|
||||
break;
|
||||
}
|
||||
writeLine(surface, text, x, y);
|
||||
}
|
||||
|
||||
void ASFont::writeLine(Surface* surface, const std::string& text, int x, int y, HAlign halign, VAlign valign) {
|
||||
switch (valign) {
|
||||
case VAlignTop:
|
||||
break;
|
||||
case VAlignMiddle:
|
||||
y -= getHeight() / 2;
|
||||
break;
|
||||
case VAlignBottom:
|
||||
y -= getHeight();
|
||||
break;
|
||||
}
|
||||
writeLine(surface, text, x, y, halign);
|
||||
}
|
||||
|
||||
void ASFont::writeLine(Surface* surface, const std::vector<std::string> &text, int x, int y, HAlign halign, VAlign valign) {
|
||||
switch (valign) {
|
||||
case VAlignTop:
|
||||
break;
|
||||
case VAlignMiddle:
|
||||
y -= (getHeight() / 2) * text.size();
|
||||
break;
|
||||
case VAlignBottom:
|
||||
y -= getHeight() * text.size();
|
||||
break;
|
||||
}
|
||||
|
||||
for (std::vector<std::string>::const_iterator it = text.begin(); it != text.end(); ++it) {
|
||||
write(surface, *it, x, y, halign);
|
||||
y += getHeight();
|
||||
}
|
||||
}
|
||||
|
||||
void ASFont::write(Surface* surface, const std::string& text, int x, int y, HAlign halign, VAlign valign) {
|
||||
if (text.find("\n", 0) != std::string::npos) {
|
||||
std::vector<std::string> textArr;
|
||||
split(textArr, text, "\n");
|
||||
writeLine(surface, textArr, x, y, halign, valign);
|
||||
} else
|
||||
writeLine(surface, text, x, y, halign, valign);
|
||||
}
|
49
src/asfont.h
@ -1,49 +0,0 @@
|
||||
// Based on SFont by Karl Bartel.
|
||||
// Adapted to C++ by Massimiliano Torromeo.
|
||||
// Refactored by Maarten ter Huurne and several others (see git log).
|
||||
// License: GPL version 2 or later.
|
||||
|
||||
#ifndef ASFONT_H
|
||||
#define ASFONT_H
|
||||
|
||||
#include <SDL.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class Surface;
|
||||
|
||||
class ASFont {
|
||||
public:
|
||||
enum HAlign { HAlignLeft, HAlignRight, HAlignCenter };
|
||||
enum VAlign { VAlignTop, VAlignBottom, VAlignMiddle };
|
||||
|
||||
ASFont(const std::string &font);
|
||||
~ASFont();
|
||||
|
||||
bool utf8Code(unsigned char c);
|
||||
|
||||
int getTextWidth(const char *text);
|
||||
int getTextWidth(const std::string& text);
|
||||
|
||||
int getHeight() {
|
||||
return surface->h - 1;
|
||||
}
|
||||
int getLineHeight() {
|
||||
return lineHeight;
|
||||
}
|
||||
|
||||
void write(Surface* surface, const std::string& text, int x, int y, HAlign halign = HAlignLeft, VAlign valign = VAlignTop);
|
||||
|
||||
private:
|
||||
void writeLine(Surface *surface, const std::string &text, int x, int y);
|
||||
void writeLine(Surface *surface, const std::string &text, int x, int y, HAlign halign);
|
||||
void writeLine(Surface *surface, const std::string &text, int x, int y, HAlign halign, VAlign valign);
|
||||
void writeLine(Surface *surface, const std::vector<std::string> &text, int x, int y, HAlign halign, VAlign valign);
|
||||
|
||||
SDL_Surface *surface;
|
||||
std::vector<Uint16> charpos;
|
||||
std::string characters;
|
||||
int lineHeight;
|
||||
};
|
||||
|
||||
#endif /* ASFONT_H */
|
43
src/background.cpp
Normal file
@ -0,0 +1,43 @@
|
||||
// Various authors.
|
||||
// License: GPL version 2 or later.
|
||||
|
||||
#include "background.h"
|
||||
|
||||
#include "gmenu2x.h"
|
||||
|
||||
|
||||
Background::Background(GMenu2X &gmenu2x)
|
||||
: gmenu2x(gmenu2x)
|
||||
, battery(gmenu2x.sc)
|
||||
{
|
||||
}
|
||||
|
||||
void Background::paint(Surface &s) {
|
||||
Font &font = *gmenu2x.font;
|
||||
SurfaceCollection &sc = gmenu2x.sc;
|
||||
|
||||
sc["bgmain"]->blit(&s, 0, 0);
|
||||
|
||||
s.write(&font, clock.getTime(),
|
||||
s.width() / 2, gmenu2x.bottomBarTextY,
|
||||
Font::HAlignCenter, Font::VAlignMiddle);
|
||||
|
||||
battery.getIcon().blit(&s, s.width() - 19, gmenu2x.bottomBarIconY);
|
||||
}
|
||||
|
||||
bool Background::handleButtonPress(InputManager::Button button) {
|
||||
switch (button) {
|
||||
case InputManager::CANCEL:
|
||||
gmenu2x.showHelpPopup();
|
||||
return true;
|
||||
case InputManager::SETTINGS:
|
||||
gmenu2x.showSettings();
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool Background::handleTouchscreen(Touchscreen &/*ts*/) {
|
||||
return false;
|
||||
}
|
32
src/background.h
Normal file
@ -0,0 +1,32 @@
|
||||
// Various authors.
|
||||
// License: GPL version 2 or later.
|
||||
|
||||
#ifndef BACKGROUND_H
|
||||
#define BACKGROUND_H
|
||||
|
||||
#include "battery.h"
|
||||
#include "clock.h"
|
||||
#include "layer.h"
|
||||
|
||||
class GMenu2X;
|
||||
|
||||
|
||||
/**
|
||||
* The backmost layer.
|
||||
*/
|
||||
class Background : public Layer {
|
||||
public:
|
||||
Background(GMenu2X &gmenu2x);
|
||||
|
||||
// Layer implementation:
|
||||
virtual void paint(Surface &s);
|
||||
virtual bool handleButtonPress(InputManager::Button button);
|
||||
virtual bool handleTouchscreen(Touchscreen &ts);
|
||||
|
||||
private:
|
||||
GMenu2X &gmenu2x;
|
||||
Battery battery;
|
||||
Clock clock;
|
||||
};
|
||||
|
||||
#endif // BACKGROUND_H
|
78
src/battery.cpp
Normal file
@ -0,0 +1,78 @@
|
||||
#include "battery.h"
|
||||
|
||||
#include "surfacecollection.h"
|
||||
|
||||
#include <SDL.h>
|
||||
#include <cstdio>
|
||||
#include <sstream>
|
||||
|
||||
|
||||
/**
|
||||
* Reads the current battery state and returns a number representing its level
|
||||
* of charge.
|
||||
* @return A number representing battery charge: 0 means fully discharged,
|
||||
* 5 means fully charged, 6 represents running on external power.
|
||||
*/
|
||||
static unsigned short getBatteryLevel()
|
||||
{
|
||||
FILE *batteryHandle = NULL, *usbHandle = NULL;
|
||||
|
||||
#if defined(PLATFORM_A320) || defined(PLATFORM_GCW0) || defined(PLATFORM_NANONOTE)
|
||||
usbHandle = fopen("/sys/class/power_supply/usb/online", "r");
|
||||
#endif
|
||||
if (usbHandle) {
|
||||
int usbval = 0;
|
||||
fscanf(usbHandle, "%d", &usbval);
|
||||
fclose(usbHandle);
|
||||
if (usbval == 1)
|
||||
return 6;
|
||||
}
|
||||
|
||||
#if defined(PLATFORM_A320) || defined(PLATFORM_GCW0) || defined(PLATFORM_NANONOTE)
|
||||
batteryHandle = fopen("/sys/class/power_supply/battery/capacity", "r");
|
||||
#endif
|
||||
if (batteryHandle) {
|
||||
int battval = 0;
|
||||
fscanf(batteryHandle, "%d", &battval);
|
||||
fclose(batteryHandle);
|
||||
|
||||
if (battval>90) return 5;
|
||||
if (battval>70) return 4;
|
||||
if (battval>50) return 3;
|
||||
if (battval>30) return 2;
|
||||
if (battval>10) return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Battery::Battery(SurfaceCollection &sc_)
|
||||
: sc(sc_)
|
||||
{
|
||||
lastUpdate = SDL_GetTicks();
|
||||
update();
|
||||
}
|
||||
|
||||
const Surface &Battery::getIcon()
|
||||
{
|
||||
// Check battery status every 60 seconds.
|
||||
unsigned int now = SDL_GetTicks();
|
||||
if (now - lastUpdate >= 60000) {
|
||||
lastUpdate = now;
|
||||
update();
|
||||
}
|
||||
|
||||
return *sc.skinRes(iconPath);
|
||||
}
|
||||
|
||||
void Battery::update()
|
||||
{
|
||||
unsigned short battlevel = getBatteryLevel();
|
||||
if (battlevel > 5) {
|
||||
iconPath = "imgs/battery/ac.png";
|
||||
} else {
|
||||
std::stringstream ss;
|
||||
ss << "imgs/battery/" << battlevel << ".png";
|
||||
ss >> iconPath;
|
||||
}
|
||||
}
|
30
src/battery.h
Normal file
@ -0,0 +1,30 @@
|
||||
#ifndef __BATTERY_H__
|
||||
#define __BATTERY_H__
|
||||
|
||||
#include <string>
|
||||
|
||||
class Surface;
|
||||
class SurfaceCollection;
|
||||
|
||||
|
||||
/**
|
||||
* Keeps track of the battery status.
|
||||
*/
|
||||
class Battery {
|
||||
public:
|
||||
Battery(SurfaceCollection &sc);
|
||||
|
||||
/**
|
||||
* Gets the icon that reflects the current battery status.
|
||||
*/
|
||||
const Surface &getIcon();
|
||||
|
||||
private:
|
||||
void update();
|
||||
|
||||
SurfaceCollection ≻
|
||||
std::string iconPath;
|
||||
unsigned int lastUpdate;
|
||||
};
|
||||
|
||||
#endif /* __BATTERY_H__ */
|
@ -1,12 +1,11 @@
|
||||
#include "browsedialog.h"
|
||||
|
||||
#include "FastDelegate.h"
|
||||
#include "filelister.h"
|
||||
#include "gmenu2x.h"
|
||||
#include "iconbutton.h"
|
||||
#include "surface.h"
|
||||
#include "utilities.h"
|
||||
|
||||
using namespace fastdelegate;
|
||||
using std::string;
|
||||
|
||||
BrowseDialog::BrowseDialog(
|
||||
@ -23,19 +22,19 @@ BrowseDialog::BrowseDialog(
|
||||
|
||||
buttonBox.add(new IconButton(gmenu2x, ts, "skin:imgs/buttons/left.png"));
|
||||
btn = new IconButton(gmenu2x, ts, "skin:imgs/buttons/cancel.png", gmenu2x->tr["Up one folder"]);
|
||||
btn->setAction(MakeDelegate(this, &BrowseDialog::directoryUp));
|
||||
btn->setAction(BIND(&BrowseDialog::directoryUp));
|
||||
buttonBox.add(btn);
|
||||
|
||||
btn = new IconButton(gmenu2x, ts, "skin:imgs/buttons/accept.png", gmenu2x->tr["Enter folder"]);
|
||||
btn->setAction(MakeDelegate(this, &BrowseDialog::directoryEnter));
|
||||
btn->setAction(BIND(&BrowseDialog::directoryEnter));
|
||||
buttonBox.add(btn);
|
||||
|
||||
btn = new IconButton(gmenu2x, ts, "skin:imgs/buttons/start.png", gmenu2x->tr["Confirm"]);
|
||||
btn->setAction(MakeDelegate(this, &BrowseDialog::confirm));
|
||||
btn->setAction(BIND(&BrowseDialog::confirm));
|
||||
buttonBox.add(btn);
|
||||
|
||||
btn = new IconButton(gmenu2x, ts, "skin:imgs/buttons/select.png", gmenu2x->tr["Exit"]);
|
||||
btn->setAction(MakeDelegate(this, &BrowseDialog::quit));
|
||||
btn->setAction(BIND(&BrowseDialog::quit));
|
||||
buttonBox.add(btn);
|
||||
|
||||
iconGoUp = gmenu2x->sc.skinRes("imgs/go-up.png");
|
||||
@ -53,7 +52,8 @@ bool BrowseDialog::exec()
|
||||
return false;
|
||||
|
||||
string path = fl->getPath();
|
||||
if (path.empty() || !fileExists(path) || path.compare(0, CARD_ROOT_LEN, CARD_ROOT) != 0)
|
||||
if (path.empty() || !fileExists(path) || path.compare(0,
|
||||
strlen(CARD_ROOT), CARD_ROOT) != 0)
|
||||
setPath(CARD_ROOT);
|
||||
|
||||
fl->browse();
|
||||
@ -270,7 +270,7 @@ void BrowseDialog::paint()
|
||||
}
|
||||
icon->blit(gmenu2x->s, 5, offsetY);
|
||||
gmenu2x->s->write(gmenu2x->font, (*fl)[i], 24, offsetY + 8,
|
||||
ASFont::HAlignLeft, ASFont::VAlignMiddle);
|
||||
Font::HAlignLeft, Font::VAlignMiddle);
|
||||
|
||||
if (ts.available() && ts.pressed()
|
||||
&& ts.inRect(touchRect.x, offsetY + 3, touchRect.w, rowHeight)) {
|
||||
@ -282,7 +282,6 @@ void BrowseDialog::paint()
|
||||
}
|
||||
gmenu2x->s->clearClipRect();
|
||||
|
||||
gmenu2x->drawScrollBar(
|
||||
numRows,fl->size(), firstElement, clipRect.y, clipRect.h);
|
||||
gmenu2x->drawScrollBar(numRows,fl->size(), firstElement);
|
||||
gmenu2x->s->flip();
|
||||
}
|
||||
|
@ -1,69 +0,0 @@
|
||||
#include "button.h"
|
||||
#include "gmenu2x.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace fastdelegate;
|
||||
|
||||
Button::Button(Touchscreen &ts_, bool doubleClick_)
|
||||
: ts(ts_)
|
||||
, action(MakeDelegate(this, &Button::voidAction))
|
||||
, rect((SDL_Rect) { 0, 0, 0, 0 })
|
||||
, doubleClick(doubleClick_)
|
||||
, lastTick(0)
|
||||
{
|
||||
}
|
||||
|
||||
void Button::paint() {
|
||||
if (ts.inRect(rect))
|
||||
if (!paintHover()) return;
|
||||
}
|
||||
|
||||
bool Button::paintHover() {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Button::isPressed() {
|
||||
return ts.pressed() && ts.inRect(rect);
|
||||
}
|
||||
|
||||
bool Button::isReleased() {
|
||||
return ts.released() && ts.inRect(rect);
|
||||
}
|
||||
|
||||
bool Button::handleTS() {
|
||||
if (isReleased()) {
|
||||
if (doubleClick) {
|
||||
int tickNow = SDL_GetTicks();
|
||||
if (tickNow - lastTick < 400)
|
||||
exec();
|
||||
lastTick = tickNow;
|
||||
} else {
|
||||
exec();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void Button::exec() {
|
||||
ts.setHandled();
|
||||
action();
|
||||
}
|
||||
|
||||
SDL_Rect Button::getRect() {
|
||||
return rect;
|
||||
}
|
||||
|
||||
void Button::setSize(int w, int h) {
|
||||
rect.w = w;
|
||||
rect.h = h;
|
||||
}
|
||||
|
||||
void Button::setPosition(int x, int y) {
|
||||
rect.x = x;
|
||||
rect.y = y;
|
||||
}
|
||||
|
||||
void Button::setAction(ButtonAction action) {
|
||||
this->action = action;
|
||||
}
|
59
src/button.h
@ -1,59 +0,0 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2006 by Massimiliano Torromeo *
|
||||
* massimiliano.torromeo@gmail.com *
|
||||
* *
|
||||
* 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., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef BUTTON_H
|
||||
#define BUTTON_H
|
||||
|
||||
#include "FastDelegate.h"
|
||||
|
||||
#include <SDL.h>
|
||||
|
||||
typedef fastdelegate::FastDelegate0<> ButtonAction;
|
||||
class Touchscreen;
|
||||
|
||||
class Button {
|
||||
protected:
|
||||
Touchscreen &ts;
|
||||
ButtonAction action;
|
||||
SDL_Rect rect;
|
||||
bool doubleClick;
|
||||
int lastTick;
|
||||
|
||||
public:
|
||||
Button(Touchscreen &ts, bool doubleClick = false);
|
||||
virtual ~Button() {};
|
||||
|
||||
SDL_Rect getRect();
|
||||
void setSize(int w, int h);
|
||||
virtual void setPosition(int x, int y);
|
||||
|
||||
virtual void paint();
|
||||
virtual bool paintHover();
|
||||
|
||||
bool isPressed();
|
||||
bool isReleased();
|
||||
bool handleTS();
|
||||
|
||||
void exec();
|
||||
void voidAction() {};
|
||||
void setAction(ButtonAction action);
|
||||
};
|
||||
|
||||
#endif // BUTTON_H
|
@ -1,9 +1,8 @@
|
||||
|
||||
#include "button.h"
|
||||
#include "gmenu2x.h"
|
||||
|
||||
#include "buttonbox.h"
|
||||
|
||||
#include "gmenu2x.h"
|
||||
#include "iconbutton.h"
|
||||
|
||||
ButtonBox::ButtonBox(GMenu2X *gmenu2x) : gmenu2x(gmenu2x)
|
||||
{
|
||||
}
|
||||
@ -13,7 +12,7 @@ ButtonBox::~ButtonBox()
|
||||
clear();
|
||||
}
|
||||
|
||||
void ButtonBox::add(Button *button)
|
||||
void ButtonBox::add(IconButton *button)
|
||||
{
|
||||
buttons.push_back(button);
|
||||
}
|
||||
@ -25,12 +24,12 @@ void ButtonBox::clear()
|
||||
|
||||
void ButtonBox::paint(unsigned int posX)
|
||||
{
|
||||
for (ButtonList::const_iterator it = buttons.begin(); it != buttons.end(); ++it)
|
||||
posX = gmenu2x->drawButton(*it, posX);
|
||||
for (auto button : buttons)
|
||||
posX = gmenu2x->drawButton(button, posX);
|
||||
}
|
||||
|
||||
void ButtonBox::handleTS()
|
||||
{
|
||||
for (ButtonList::iterator it = buttons.begin(); it != buttons.end(); ++it)
|
||||
(*it)->handleTS();
|
||||
for (auto button : buttons)
|
||||
button->handleTS();
|
||||
}
|
||||
|