1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-07-04 21:05:27 +03:00
Commit Graph

619 Commits

Author SHA1 Message Date
Maarten ter Huurne
63029d85d7 Use shared_ptr for layers
This allows transient layers to be deleted automatically when they are
dismissed, while persistent layers will be kept alive by their other
owner(s).
2013-08-06 02:34:03 +02:00
Maarten ter Huurne
6d868a895a Implemented layer system for painting and events
The long term goal is to be able to use a single event loop regardless
of which submenu or alternative mode is active.
2013-08-06 01:55:32 +02:00
Maarten ter Huurne
074668336e Handle menu-related buttons inside Menu class 2013-08-05 16:43:22 +02:00
Maarten ter Huurne
d588b97b34 Removed InputManager::waitForReleasedButton()
This method was never called.

And I cannot really think of a scenario in which it is useful to wait
for any button to be released: a particular button or all buttons I can
imagine, but not any button.
2013-08-05 16:01:50 +02:00
Maarten ter Huurne
e6300ab07a Changed section headers to be displayed in a circular fashion
Instead of having a list and wrapping between beginning and end, always
put the current section in the middle and show the previous and next
sections using wrap-around.
2013-08-05 14:54:42 +02:00
Maarten ter Huurne
903ccc2cfe Switch from mega to giga when showing large disk/card sizes
Also made our use of 1024-based prefixes explicit by using MiB/GiB.
2013-08-05 02:02:04 +02:00
Maarten ter Huurne
bdf3cfdf86 Moved linkColumns and linkRows fields into Menu class 2013-08-05 00:51:36 +02:00
Maarten ter Huurne
8d7ac6e0ba Center links horizontally 2013-08-05 00:42:59 +02:00
Maarten ter Huurne
f65a59a02f Fixed scrollbar size for links area
Made sure it fills the space between the top and bottom bar. Use a one
pixel margin; I tried without margins but it didn't look nice.

Also cleaned up the paint code a bit.
2013-08-05 00:02:56 +02:00
Maarten ter Huurne
41b0551595 Moved menu touch handling code into Menu class 2013-08-04 23:19:15 +02:00
Maarten ter Huurne
1eeba171dd Moved menu painting code into Menu class 2013-08-04 21:14:29 +02:00
Maarten ter Huurne
cbe7735f73 Put main loop painting code in separate methods
Also declare the relevant variables with a reduced scope, where
possible.
2013-08-04 03:47:23 +02:00
Maarten ter Huurne
f8dc4c7bb8 Don't construct non-functional Font objects
Replaced Font constructor with factory method, so that if the TTF
cannot be loaded, the Font object is not constructed. The normal C++
way of handling this is with exceptions, but we're compiling with
-fno-exceptions.
2013-08-04 00:58:32 +02:00
Maarten ter Huurne
724aefe482 Renamed ASFont class to just Font
Originally the font implementation was based on SFont, but it was
recently replaced by an SDL_ttf based implementation, so the name
no longer made sense.
2013-08-03 22:30:12 +02:00
Maarten ter Huurne
0046fa9e19 Made ASFont::utf8Code() a function in inputdialog.cpp instead
The implementation doesn't make sense to me, but that's something for
another day; at least it is together with the code that calls it now.
2013-08-03 22:02:50 +02:00
Maarten ter Huurne
a9b5d8bd19 Moved most Menu::loadIcons() code into Link/LinkApp classes
The code still has a lot of overlap with the other methods of Link and
LinkApp, but at least it is in the same place now.

Since this was the last outside use, setIconPath() could be declared
as 'protected'.
2013-08-02 21:24:20 +02:00
Maarten ter Huurne
40372d14ef Cleaned up Menu::loadIcons()
Most changes involve not calling the same method with the same
arguments again and again. Also use C++11 range-based loops.
2013-08-02 20:53:38 +02:00
Maarten ter Huurne
a7b31669bb Restrict access to Link::recalcCoordinates()
This method was only called from within the Link class itself.
2013-08-02 20:53:02 +02:00
Maarten ter Huurne
dd55b7290b Do not draw NULL icon
If for whatever reason no icon at all could be loaded, then skip
drawing the icon rather than crashing on the NULL pointer.
2013-08-01 14:37:56 +02:00
Maarten ter Huurne
fb8f4e6e72 The "tr1" namespace is no longer needed now that we're on C++11 2013-08-01 14:37:56 +02:00
Paul Cercueil
de9b3cd27d Make sure the joystick subsystem is inited before InputManager starts 2013-07-29 16:54:12 -04:00
Paul Cercueil
fcb2618286 Open all available joysticks 2013-07-29 13:21:36 -04:00
Paul Cercueil
50b3bb2b7f Revert the log level to INFO
It was modified by error to DEBUG by commit 88f54e1ccc
2013-07-29 13:02:06 -04:00
Paul Cercueil
88f54e1ccc Drop incredibly dirty and huge file FastDelegate.h
It's way too over-engineered for what we need to do, and we can
do much simpler using C++11.
2013-07-29 12:58:25 -04:00
Paul Cercueil
9951ab2ab5 Switched to C++11 2013-07-29 12:55:58 -04:00
Paul Cercueil
152ed5cb29 Drop enum constants of unsupported button actions 2013-07-29 12:51:42 -04:00
Paul Cercueil
e0109dfe55 Initialize the timers subsystem of SDL at the beginning
This fixes a bug where disabling the backlight timeout would
prevent the clock from working correctly.
2013-07-22 00:20:18 -04:00
Paul Cercueil
47bbc0b673 Added a clock on the bottom bar 2013-07-21 23:54:09 -04:00
Paul Cercueil
b0fa6db97d Use an enum instead of hardcoded values for the user-injected codes 2013-07-21 23:52:35 -04:00
Paul Cercueil
a0515ad356 Make the file selector accept all files by default 2013-07-21 15:43:41 -04:00
Paul Cercueil
a682d10657 Load the localized title and description of an OPK if available 2013-07-20 21:21:36 -04:00
Paul Cercueil
bec8d8756f Don't prepend the mounpoint to the binary path if not inside the OPK 2013-07-19 15:25:54 -04:00
Paul Cercueil
5255bf6de3 Destroy all registered Monitor objects when the Menu is destroyed 2013-07-19 14:50:46 -04:00
Paul Cercueil
9dae4b76df Accept meta-data named *.all.desktop in OPK files
This could be used to create platform-independent packages. It can
be useful for instance in the case where the executable is a script,
or when the package points to an executable that is present on all
systems on which OPKs are supposed to run.
2013-07-19 14:41:17 -04:00
Paul Cercueil
b6dfdc6ef5 Stop watching a directory when it has been reported as removed 2013-07-19 14:35:45 -04:00
Paul Cercueil
ebce540dfc Exit the thread properly in the destructor of Monitor objects 2013-07-19 14:29:51 -04:00
Paul Cercueil
d5280ebc7b Use sigaction() instead of deprecated function signal() 2013-07-19 13:58:12 -04:00
Paul Cercueil
84a987e9d5 When loading multiple OPKs, don't order links each time one is added 2013-07-19 12:50:20 -04:00
Paul Cercueil
41e4cff7ac Add a MediaMonitor, which will watch CARD_ROOT for mountpoints
Each time a directory will appear in CARD_ROOT, the MediaMonitor
will try to load all OPKs found in CARD_ROOT/${directory}/apps
2013-07-19 12:37:56 -04:00
Paul Cercueil
69b9657af4 Add function openPackagesFromDir() to simplify constructor of Menu 2013-07-19 12:01:25 -04:00
Paul Cercueil
36c4205e0e Don't try to read OPKs in /media/./apps and /media/../apps 2013-07-19 11:57:35 -04:00
Paul Cercueil
04d9d9322d Remove trailing slash from CARD_ROOT 2013-07-19 11:54:09 -04:00
Paul Cercueil
0264b724d6 Start inotify with working mask (fixes previous commit) 2013-07-19 11:47:27 -04:00
Paul Cercueil
5e7bcf3a1f Remove all links of an "apps" dir when it is removed or renamed 2013-07-18 21:34:03 -04:00
Paul Cercueil
f308ed983b Prepare the Monitor class for proper inheritance 2013-07-18 21:32:23 -04:00
Paul Cercueil
cc869c07a8 Fix link insertion/deletion when OPKs are overwritten from SSH/FTP 2013-07-18 21:27:27 -04:00
Paul Cercueil
91f381fa07 Allow an OPK to use an icon provided by the theme 2013-07-18 17:49:33 -04:00
Paul Cercueil
bcb3e98ddc Order the links in alphabetical order 2013-07-18 17:38:09 -04:00
Paul Cercueil
9029deceeb Fix translations in user directory not correctly loaded 2013-07-18 17:14:21 -04:00
Paul Cercueil
32d100ee2a Change the "GMenu2X starting" message
It contained outdated instructions.
2013-07-18 17:03:01 -04:00
Paul Cercueil
504641a6cf Fix the function that sets the icon of a Link 2013-07-18 17:00:18 -04:00
Paul Cercueil
dfad7c39a7 Remove all links of an OPK when moved out of the monitored folder
It was previously removing only one link, but an OPK can provide
multiples links.
2013-07-18 16:29:56 -04:00
Paul Cercueil
13b3d8e0ca Monitor OPK folders using inotify and automatically add/delete links 2013-07-16 13:36:18 -04:00
Paul Cercueil
1467c9b9d7 Don't try to find OPKs inside non-existing directories 2013-07-16 12:44:30 -04:00
Paul Cercueil
78ad051756 Split huge function readPackages into two functions 2013-07-10 18:57:56 -04:00
Paul Cercueil
1337eb5ed8 Update filter of manual selection dialog to *.man.png *.txt 2013-07-08 12:21:43 -04:00
Paul Cercueil
ca811ea43d Match only *.png files for the application icon selector 2013-07-08 12:20:30 -04:00
Paul Cercueil
e1968c3830 Add *.elf to the filter of the explorer and the "add link" dialog 2013-07-08 02:27:53 -04:00
Paul Cercueil
aa8b21e076 Update file extension filter for manually added applications
Updated to *.bin *.dge *.sh *.py and extension-less files.
2013-07-08 02:24:55 -04:00
Paul Cercueil
5790740af6 Match all files by default in the file dialog
Due to recent changes, it was displaying only files without
extension.
2013-07-08 02:24:09 -04:00
Paul Cercueil
6d44fb3a75 Use the "*" filter to match all files
The empty "" filter was previously matching all the files; since
a few commits it now matches the files without extensions. The
new "*" filter allows again to match all files.
2013-07-08 02:21:42 -04:00
Paul Cercueil
9737810bcb Remove the "unlock VT" feature; it has been moved to its own program 2013-07-05 17:51:59 -04:00
Paul Cercueil
4ed21f27e5 Fix extension filter of the wallpaper dialog 2013-07-05 17:08:09 -04:00
Paul Cercueil
3558dfbfa2 Fix extension filters of the Explorer
It will now list files without extension, *.bin, *.sh, *.dge, and
*.py files.
2013-07-05 14:48:13 -04:00
Paul Cercueil
dad8d1bad5 Fix extension filter in file selection dialog
This fixes commit eb63294231
2013-07-05 14:42:55 -04:00
Paul Cercueil
46386a2054 Drop the bitmap font; use a TTF font instead
This allows to display UTF-8 characters, and is as such a good
step towards full internationalization.
2013-07-05 14:07:46 -04:00
Paul Cercueil
eb63294231 Don't call tolower() on the whole filenames, only on extensions
tolower() will trigger an assertion failure in the case where the
string contains UTF-8 codes. This is not a problem as only the
file extension needs to be processed, and that one should contain
only ASCII.
2013-07-05 14:00:46 -04:00
Paul Cercueil
abc461bf95 Fix build on 32-bit targets...
This fixes commit 59a456690b
which introduced a regression.
2013-07-03 23:45:38 -04:00
Paul Cercueil
59a456690b Fix build on 64-bit systems 2013-07-03 23:17:24 -04:00
Paul Cercueil
a0690ba59e Remove useless clipper 2013-06-16 20:52:20 -04:00
Paul Cercueil
4347c340a6 Align the links the same way whether or not a scrollbar is present
Previously, when a scrollbar was present, the links were starting
at a different X position than without the scrollbar.
2013-06-16 20:48:37 -04:00
Paul Cercueil
c58b3a535e Update GMenu2X to use the latest libopk v1.0 API 2013-05-26 19:06:53 -04:00
Paul Cercueil
2cef732602 Fix crash occuring when an unknown MIME type is specified in OPK 2013-04-19 14:25:23 -03:00
Maarten ter Huurne
bcbedc8f40 Updated code calling opk_extract_file().
I changed the return type from char* to void* in libopk, now updating
the gmenu2x code to match.
2013-02-05 19:05:44 +01:00
Maarten ter Huurne
90ec4b9ace Ignore OPK files of which the name starts with a dot
These are not actual OPK files, but metadata (I assume) storage that
Mac OS X adds to vfat file systems. The current version of libopk has
extremely poor error handling, so ignoring these files avoids a crash.
But even when libopk is fixed, not trying to open these files as OPKs
will be useful since it saves time.
2013-01-24 23:26:30 +01:00
Maarten ter Huurne
e4d78bee60 Made GMenu2X::menu private
There was only one outside use; turned that into a new public method
on the GMenu2X class.
2012-12-20 22:01:30 +01:00
Maarten ter Huurne
a18730ee13 Changed text color of warnings from yellow to magenta
Yellow is almost unreadable if the console background is white.
2012-12-20 17:54:15 +01:00
Paul Cercueil
610b489d51 Add support of text manuals (.man.txt files) inside OPK archives 2012-12-08 04:26:48 -03:00
Paul Cercueil
f2e3efd359 Hide the 'Edit' option if there's nothing to configure 2012-12-08 01:59:11 -03:00
Paul Cercueil
a60d97fbff Hide the selector dir/browser link options if OPK doesn't open a file 2012-12-08 01:45:21 -03:00
Paul Cercueil
c9fc163bea Add --disable-cpufreq switch to disable clock management 2012-12-08 01:03:33 -03:00
Paul Cercueil
473949bb4f Remove hardcoded MHz values, use the defined main/max clocks instead 2012-12-06 20:53:39 -03:00
Paul Cercueil
389253b4c6 Load the skin's wallpaper if the default one is not yet defined 2012-12-04 14:21:22 -03:00
Paul Cercueil
efdf766102 Enable support for multiple .desktop for one platform inside OPKs 2012-11-29 23:44:58 -03:00
Paul Cercueil
6629a63871 Renamed 'dingux' platform to 'a320'
Dingux being now replaced by OpenDingux, which covers other platforms
than the A320, the platform corresponding to the A320 is now named
accordingly.
2012-11-27 02:14:08 -03:00
Paul Cercueil
c6a83e1ed7 Open OPKs only if compatible with the current platform 2012-11-18 18:52:23 -03:00
Paul Cercueil
d4c086a64d Add initial support for the GCW Zero 2012-11-18 18:41:20 -03:00
Paul Cercueil
77046f3553 Add support for reading manuals located inside OPK archives 2012-11-11 19:47:45 -03:00
Paul Cercueil
8d96f3c261 Update to use the latest libopk API, and simplify loadPNG 2012-11-05 18:48:48 -03:00
Paul Cercueil
0b922e97f3 For non-OPK programs, chdir() to the app's directory as well 2012-10-23 16:34:01 +02:00
Paul Cercueil
b8112d1a73 Fix a bug where having multiple MIME types would crash GMenu2X 2012-10-23 16:19:00 +02:00
Paul Cercueil
df981eb03a Drop the 'remove link' option on the context menu of OPKs 2012-10-23 06:45:56 +02:00
Paul Cercueil
64eb86f8e8 Default the 'browser' option to 'true'.
This permits the 'browser' option to be saved for OPK packages
as well.
2012-10-23 06:39:51 +02:00
Paul Cercueil
4c4f452abb Hide parameters not suitable for OPKs on the context menu 2012-10-23 06:33:27 +02:00
Paul Cercueil
dec1a8956a Assign an icon for a given link only if it hasn't been done before 2012-10-23 06:20:03 +02:00
Paul Cercueil
c94968f533 Memorize the selector's directory as the default one for later use
When a app is launched with a file selected with the built-in file
selector, we memorize the directory on which the file was found,
so that a future launch of that application will directly open
that directory.
2012-10-23 05:34:21 +02:00
Paul Cercueil
a04b9e3ab3 Save changes made on the link of an OPK on the user directory. 2012-10-23 05:32:48 +02:00
Paul Cercueil
5f1cff6d0f Build file extensions filter from the MIME types present on the OPK
This feature is enabled only if libxdgmime is available.
2012-10-22 23:40:09 +02:00
Paul Cercueil
e7e21b424b Use the '%f' token to insert the selected file on the params.
Other tokens available are '%F', '%u' and '%U'.
It replaces the previous token '[selFile]'.
2012-10-22 23:34:33 +02:00
Paul Cercueil
0fc6ac67f0 Hide the 'params' option from the user on the contextual menu
The user shouldn't care at all about what is given as a parameter.
The 'params' option is only used by the links provided with GMenu2X.
2012-10-22 23:12:21 +02:00
Paul Cercueil
d6cdb90c81 Before launching any app, update the standard I/O file descriptors 2012-10-20 17:32:17 +02:00
Paul Cercueil
6a9f429f32 Update "exec" to aim the binary if a change of directory if needed 2012-10-17 23:48:11 +02:00
Paul Cercueil
0ddc562bf1 Fix icon not appearing on loading menu of OPK packages based links 2012-10-17 23:43:44 +02:00
Paul Cercueil
170a7dc4c6 Add "editable" parameter: when "false", the link can't be modified.
If omitted, the default value is "true".
2012-10-17 23:43:32 +02:00
Paul Cercueil
c1a95a2fa6 Removed unused class variable 'useRamTimings' from LinkApp 2012-10-17 23:43:27 +02:00
Paul Cercueil
4a60aa000d Load the OPK in the section defined by their "Categories" parameter 2012-10-09 01:41:57 +02:00
Paul Cercueil
ef18841eb1 Fix build when libopk is not present. 2012-10-08 19:46:50 +02:00
Paul Cercueil
f6c19d0aa1 Mount the OPK packages in order to execute the binary included. 2012-10-08 08:22:48 +02:00
Paul Cercueil
909fef2f3a Update to use the latest libopk API. 2012-10-08 08:19:59 +02:00
Paul Cercueil
876f2cff86 Fix a bug where only some parameters were read from the links files. 2012-10-08 06:09:37 +02:00
Paul Cercueil
cd4809343b During init, load all packages in CARD_ROOT/*/apps 2012-10-07 21:51:25 +02:00
Paul Cercueil
61d22e26e6 LinkApp: Added support for reading OPK packages. 2012-10-07 21:50:07 +02:00
Paul Cercueil
e3837fce68 If a filename contains '#' don't check if the file exists. 2012-10-07 20:08:25 +02:00
Paul Cercueil
0cbb5ee09a Make loadPNG() able to read files from OPK packages.
The filename passed to it should contain the filename of the squashfs
image, the character '#', and the filename of the .png file contained
inside the package.

E.g.:
/tmp/package.opk#icon.png
2012-10-07 20:04:30 +02:00
Paul Cercueil
3dc12d06ea menu.cpp: Don't use stat() to know if a FS entry is a directory
The pointer returned by readdir() already informs us of the type
of the FS entry.
2012-10-06 17:38:58 +02:00
Paul Cercueil
16d66d0dbc Remove unused (proprietary-licensed for some) XCF fonts. 2012-06-25 00:39:37 +02:00
Paul Cercueil
1241523105 Removed variable/function to get the directory of the executable.
The application shouldn't care from which directory it is being
executed.
2012-06-24 23:19:45 +02:00
Paul Cercueil
cf20f3673e Use function getSkinPath() instead of reading the dir of the binary
... which was certain to fail as the skins are not located on
/usr/bin.
2012-06-24 23:18:02 +02:00
Paul Cercueil
a21650d6b3 Don't re-execute gmenu2x on error, just call main() again. 2012-06-24 23:01:28 +02:00
Paul Cercueil
0d9977e54c Open battery/USB file handlers only when needed. 2012-06-24 22:48:50 +02:00
Paul Cercueil
7484ad2ef0 Check if USB cable is plugged before returning the battery level. 2012-06-24 22:41:16 +02:00
Paul Cercueil
64db1d7912 Don't scan the NAND as it's already done elsewhere.
If mounted, the NAND should be present as /media/ccnandb1 (dingux
build) but /media is already scanned.
2012-06-24 22:19:36 +02:00
Paul Cercueil
d6621584e3 Removed last bits of the "backlight" feature. 2012-06-15 00:13:59 +02:00
Paul Cercueil
21fee6ccd1 Removed last bits of the "volume" feature. 2012-06-14 23:59:39 +02:00
Paul Cercueil
dd047010ed Removed old commented code. 2012-06-14 23:53:19 +02:00
Paul Cercueil
9263c782e7 Drop GP2X platform support.
The GP2X build was unused and totally broken.
2012-06-14 23:45:57 +02:00
Paul Cercueil
374371c1d2 Removed unused (and broken) TV-out feature. 2012-06-14 22:53:50 +02:00
Paul Cercueil
bc2b5d51ed Removed unused function GMenu2X:setGamma() 2012-06-14 20:14:19 +02:00
Paul Cercueil
1080527822 Don't log the console-based apps. 2012-06-14 17:39:59 +02:00
Paul Cercueil
c2576d418b Read the credits from the "about.txt" file.
The credits have also been updated.
2012-04-27 17:42:09 +02:00
Paul Cercueil
d1328d791c Switch to tty1 for console apps (Dingux build only).
Console apps are always launched on tty1. However it can occur that
the console displayed on the framebuffer is another one, so we have
to explicitely activate tty1.
2012-04-18 01:35:46 +02:00
Paul Cercueil
e6ca072c46 Added a "show console" link parameter (Dingux build only). 2012-04-13 19:21:49 +02:00
Paul Cercueil
7687212b4e Removed the "wrapper" feature.
It is up to the system to restart GMenu2X when the application exits.
2012-04-13 18:12:30 +02:00
Maarten ter Huurne
8f57afcf53 Explicitly convert 32-bit integers to 16-bit.
GCC 4.7.0 warns that C++11 considers doing this implicitly ill-formed.
2012-04-10 23:01:16 +02:00
Maarten ter Huurne
46f2edbc76 BrowseDialog: Code layout cleanup.
No functional changes, except for fetching "topBarHeight" only once.
2012-04-10 22:55:19 +02:00
Maarten ter Huurne
58d6077e5c Touchscreen: Avoid constructing an SDL_Rect for is-inside tests.
Made the SDL_Rect versions of the methods call the plain-int versions
instead of vice versa.
2012-04-10 22:44:56 +02:00
Maarten ter Huurne
b248aaf808 Surface cleanup.
Use unsigned ints for width and height, like SDL does.
We're using the SDL typedefs there after all.

Include argument names in header when type name does tell everything.

Use whitespace in argument lists.
2012-04-10 22:33:43 +02:00
Maarten ter Huurne
fd642ffe9a SettingsDialog: Code layout cleanup.
No functional changes, except for fetching "topBarHeight" only once.
2012-04-10 22:09:20 +02:00
Maarten ter Huurne
ed8b0c38ba Don't overwrite link action provided to constructor.
Fixes bug introduced in 57ad81e3df.
This bug would prevent applications from launching, so it's pretty serious.
I did test before committing, but apparently I didn't test the right binary.
2012-04-10 20:30:36 +02:00
Maarten ter Huurne
92d221a1bd Fixed GCC warning about initialization order. 2012-04-10 19:28:01 +02:00
Maarten ter Huurne
d2413d8233 Added missing #includes.
Fixes compilation with GCC 4.7.0.
2012-03-24 12:00:25 +01:00
Maarten ter Huurne
57ad81e3df Merged LinkAction class into its base class.
LinkApp now calls its launch method via the delegate mechanism instead of
via an overridden virtual method. This should make it easier to move the
launch method out of LinkApp and into the GMenu2X main class.
2012-03-24 11:57:21 +01:00
Paul Cercueil
2d81b13459 Reinitialize the powersaver timer when a suspend has been detected. 2012-02-02 23:36:26 +01:00
Paul Cercueil
a0b9fc026b Fix the filename for the user-specified input conf file. 2012-01-23 12:29:58 +01:00
Paul Cercueil
273770dad3 InputManager: prevent unmapped buttons from generating events. 2012-01-22 21:49:52 +01:00
Maarten ter Huurne
0043ea5909 Made LinkApp::launch() private.
It was already never called outside the class.
2011-12-23 15:51:54 +01:00
Maarten ter Huurne
4ae4fc675e Mark Link::run() as pure virtual.
This is better than providing an empty default implementation, since it
forces subclasses to override the method.
2011-12-23 15:49:09 +01:00
Maarten ter Huurne
d90ed635be Removed per-app gamma setting.
This functionality was half-removed already: some code missing, other
essential parts commented out.

I don't see the point of this either: RGB graphics are created for a certain
gamma value; if that differs from the screen gamma it is up to the application
to do something about it: gamma correct the graphics and/or change the screen
gamma. It doesn't make sense to make this user configurable.
2011-12-23 15:39:53 +01:00
Maarten ter Huurne
0622c4227f Removed ability to configure custom working directory.
Working directory was only configurable in the ini files, not in the GUI.

Many GP2X/Dingoo applications break if the working directory is changed
because they use relative paths for locating their data files.

I don't see a reason to keep this feature, since I don't know of a realistic
scenario where it would be useful. In any case, the functionality can be
re-created by using a wrapper script to change the working directory based on
a parameter value.
2011-12-23 15:20:28 +01:00
Maarten ter Huurne
c2afbfdc91 Made two fields that are only used on GP2X available only on that platform.
It seems the "#endif" was inserted at the wrong spot.
2011-12-23 14:07:06 +01:00
Maarten ter Huurne
1ad6b2f25a Made GMenu2X::ts private.
Pass Touchscreen reference to constructors instead of pulling it from
the GMenu2X class.
2011-12-23 14:03:05 +01:00
Maarten ter Huurne
944ab86f9c Cleanup of touch screen code.
Initialize in constructor and clean up in destructor instead of having separate init() and deinit() methods.
Don't close file descriptor if open failed (ts_fd == -1).
Renamed initialized() to available(), since it tests whether the touch screen was found, not whether an initialization was attempted.
Improved code layout and minor other cleanups.
2011-12-23 12:30:15 +01:00
Ayla
c7af4b1aea Removed per-application volume setting.
The volume should not depend of the application which is in use.
2011-11-19 14:47:55 +01:00
Xiangfu Liu
5d6dcfb2bf update nanonote backlight to new driver 2011-11-10 15:05:37 +08:00
Xiangfu Liu
1cd60895d5 use the contrast for brightness in nanonote 2011-11-10 14:59:45 +08:00
Maarten ter Huurne
cf8ebbca5e gmenu2x.cpp: Re-ordered includes.
Put our own header includes before system includes, to avoid masking missing
system includes in our own headers.
2011-10-23 17:32:46 +02:00
Maarten ter Huurne
f28e4f6d89 Minimized gmenu2x.h.
Everything that does not need to be shared was moved to gmenu2x.cpp.
2011-10-23 17:27:29 +02:00
Maarten ter Huurne
aea1c44020 utilities: Replace min/max functions by the versions from STL. 2011-10-23 17:00:23 +02:00
Maarten ter Huurne
40c510a28a utilities: Removed unused functions. 2011-10-23 16:51:59 +02:00
Maarten ter Huurne
a01d892eb6 More header cleanups.
This time the focus was on removing namespace imports from headers.
2011-10-23 16:43:56 +02:00
Maarten ter Huurne
e0e7e87ebc Massive header cleanup.
The main goal is to avoid including "gmenu2x.h" from headers.
But I did various other cleanups as well while I was at it.
2011-10-23 16:13:02 +02:00
Maarten ter Huurne
33e7f1ef56 cpu: Include header instead of repeating function declaration. 2011-10-23 15:24:35 +02:00
Maarten ter Huurne
14bae043c0 LinkApp: various cleanups.
Log a warning message if setsid() fails.
Also improved code layout.
2011-10-23 13:03:11 +02:00
Maarten ter Huurne
40fcd5137e InputDialog: header cleanup. 2011-10-23 12:46:52 +02:00
Maarten ter Huurne
cfd294b9ae IconButton: header cleanup. 2011-10-23 12:37:39 +02:00
Maarten ter Huurne
62facf4dc7 IconButton: removed unused functionality.
Labels were always right-aligned: this was the default and no other alignment
was ever selected.
Also removed unused getter and setter methods.
2011-10-23 12:30:20 +02:00
Maarten ter Huurne
abe9130de9 IconButton: fixed up-to-date check in setPosition().
Recalculate size if either x or y changed, not necessarily both of them.
2011-10-23 12:06:59 +02:00
Maarten ter Huurne
76613d1810 IconButton: removed unused local variable. 2011-10-23 12:05:27 +02:00
Maarten ter Huurne
55cabcea49 InputDialog: do not return anything from drawVirtualKeyboard().
The returned value (action) was ignored, so don't bother returning it.
2011-10-23 12:00:46 +02:00
Maarten ter Huurne
fa5a9816db InputDialog: re-layouted code.
No functional changes.
2011-10-23 11:57:50 +02:00
Maarten ter Huurne
0b878c1b77 SettingsDialog: removed unused action variable and macros. 2011-10-23 11:41:44 +02:00
Maarten ter Huurne
9e876a6f90 MessageBox: header cleanups. 2011-10-23 11:32:16 +02:00
Maarten ter Huurne
3252c777c3 MessageBox: Use arrays instead of vectors for buttons.
There is no need for the overhead of std::vector if we know the number
of elements at compile time.
This shaves off about 2 kB of the stripped binary size.
2011-10-23 11:24:20 +02:00
Maarten ter Huurne
28f6cd2122 InputManager: removed "clear" and "manual" logical buttons.
These are not used in the GUI anymore.
2011-10-23 11:12:34 +02:00
Maarten ter Huurne
a685b436ec InputManager: improved config file parsing.
Do not test whether config file exists; just open it and handle failure.
Config file was not closed on errors, fixed now.
Make sure unconfigured entries of the button map are properly initialized.
Ignore lines with invalid keywords instead of aborting parsing.
Made log messages more specific.
2011-10-23 10:46:26 +02:00
Maarten ter Huurne
9548aa0a41 InputManager: Don't break if joystick support is disabled in SDL.
Early Dingux versions had joystick support disabled, but many programs
broke on that, so booboo enabled joystick support later.
2011-10-23 10:35:33 +02:00
Maarten ter Huurne
433be5daf7 InputManager: have "joystick" as a member instead of a global. 2011-10-23 09:59:22 +02:00
Maarten ter Huurne
641c989934 MenuSettingBool: Support toggling of boolean settings using left/right. 2011-10-23 09:47:51 +02:00
Maarten ter Huurne
a38c283e17 SettingsDialog: simplify code using InputManager::waitForPressedButton().
Replaced MenuSetting::manageInput() by handleButtonPress(), because we will
only pass pressed buttons to it, not the entire input event.
2011-10-23 09:38:59 +02:00
Maarten ter Huurne
40fd35d764 MessageBox: minor cleanup.
Declare local variables where they are used, not way in advance.
2011-10-23 09:24:42 +02:00
Maarten ter Huurne
ccf55e5d61 BrowseDialog: simplify code using InputManager::waitForPressedButton(). 2011-10-23 09:11:06 +02:00
Maarten ter Huurne
315bf0a180 InputManager: C++-style type definitions.
There is no need to typedef enums and structs in C++.
Put types defined by InputManager inside the class namespace.
Changed type names to CamelCase.
2011-10-23 09:04:12 +02:00
Maarten ter Huurne
c6db9ff21b InputManager: reduce namespace pollution.
Moved dependency on SDL to implementation file.
Don't import std namespace in header.
If we need std::string, import <string>, not something else.
2011-10-23 08:15:23 +02:00
Maarten ter Huurne
ba6003606e Include SDL header as <SDL.h> instead of <SDL/SDL.h>.
SDL headers are located using "sdl-config --cflags", which outputs
the actual directory that the headers are in, not its parent.
2011-10-23 07:54:10 +02:00
Maarten ter Huurne
f9696971ad InputManager: re-layouted code.
I don't really care for tabs vs spaces, but it's impractical to use tabs
in one source file and spaces in another.
2011-10-23 07:51:41 +02:00
Maarten ter Huurne
0cb1645c03 InputManager: SDL_NumJoysticks is a function, try calling it. 2011-10-23 07:22:55 +02:00
Maarten ter Huurne
ae685a9729 PowerSaver: re-layouted code.
No functional changes.
2011-10-23 07:05:54 +02:00
Maarten ter Huurne
e73a8d06ea Removed per-application brightness setting.
The desired backlight level depends on the amount of light coming in from
the environment, not on the application that is run. Setting the brightness
when launching an application discards what is probably the right value
for this location (indoor/outdoor) and time of day. So we decided that this
is not a desirable feature and therefore removed it.
2011-09-23 01:51:53 +02:00
Maarten ter Huurne
7a978222b8 Use existing brightness value instead of overriding it. 2011-09-23 01:36:56 +02:00
Maarten ter Huurne
84ec66c7ce Minor cleanup: better usage of fscanf.
Instead of having fscanf() read into a string buffer (with the risk of
overflowing it if sysfs returns an unexpectedly long string) and converting
the value to integer with atoi() afterwards, just use fscanf() to read
an integer.
2011-09-23 01:23:53 +02:00
Maarten ter Huurne
799bb13f0f Minor cleanup: group handle init code together. 2011-09-23 01:01:57 +02:00
Maarten ter Huurne
0acbd35fb4 Corrected name of USB power supply device.
As far as I can see in the 3.0 kernel sources, both the Dingoo and
the NanoNote use "usb" in lower case.
2011-09-23 00:57:27 +02:00
Maarten ter Huurne
53a73cabc7 Call deinit() method on exit.
This prevents file descriptors to sysfs files from staying open as the
selected application is executed.
2011-09-23 00:48:13 +02:00
Maarten ter Huurne
b997485859 Backlight: use different sysfs name for NanoNote and Dingoo.
Fixes backlight control on Dingoo.
2011-09-23 00:38:43 +02:00
Maarten ter Huurne
6729e30acb Fixed mistake in 8bcd03962f.
"iclock" is not a local variable: it is a field, so it should be updated.
2011-09-19 16:49:30 +02:00
Maarten ter Huurne
03ea679a1d Corrected capitalization of megahertz.
"Mhz" -> "MHz"
2011-09-19 16:33:19 +02:00
Maarten ter Huurne
8bcd03962f Do not constrain the max CPU frequency for apps on setting the string value.
It is already constrained on editing and when actually applying the frequency.
The string value constrain is problematic because it happens in a class that
has no knowledge of the actual CPU limits, so it can only contrain to
hardcoded limits.

With this change you'll actually be able to run apps at 432 MHz.
2011-09-19 16:27:53 +02:00
Maarten ter Huurne
8d04cf1064 Removed one last occurrence of hardcoded minimum CPU frequency.
Well, I hope it was really the last one now.
2011-09-19 16:26:42 +02:00
Maarten ter Huurne
a014a331f4 Put platform specific defaults in systemwide gmenu2x.conf.
It is simpler to maintain them there instead of in the code.
2011-09-19 01:12:34 +02:00
Maarten ter Huurne
19064b4c4a Work around lack of vsynced page flipping in OpenDingux kernel. 2011-09-18 21:16:12 +02:00
Maarten ter Huurne
41650aaad7 Use 16 bpp by default on the Dingoo.
Other platforms keep using 32 bpp.
2011-09-18 18:42:53 +02:00
Maarten ter Huurne
d354eb85a4 Improved CPU frequency control.
The maximum frequency for applications was set to 430 MHz before,
while some Dingoos can handle higher frequencies. Now the limit is set to
the theoretical maximum frequency of 500 MHz.

For the menu itself the maximum frequency is set to a safer 408 MHz,
to avoid over-eager users from putting their system in an unusable state
that is difficult to recover from.

Also the frequency settings are now done in 24 MHz increments, to match
the limitations of the current JZ4740 kernel. Note that only new entries
are rounded to 24 MHz multiples, existing entries stay as they are.
2011-09-18 18:27:03 +02:00
Ayla
3995133fa5 When deleting a link, check if the icon is used elsewhere before unloading it. 2011-09-18 13:22:02 +02:00
Ayla
cf8bd84362 Added debug message which is displayed when surfaces are deleted from memory. 2011-09-18 13:21:03 +02:00
Ayla
cca367745b Dingux port: The SD card root is now hardcoded to /boot for the getDiskFree() function only.
That function was not working as CARD_ROOT does not necessarily point to the mount point of a filesystem.
2011-09-18 12:42:08 +02:00
Ayla
759eefd676 The files "a.png" and "b.png" have been renamed to "cancel.png" and "accept.png". 2011-09-18 03:40:33 +02:00
Ayla
16b050be05 Modified the key shortcuts for the small popups (deleting a link...). 2011-09-18 03:33:10 +02:00
Ayla
826d622285 Modified the key shortcuts for the generic file/dir selector class. 2011-09-18 03:23:47 +02:00
Ayla
38cfd321f6 Modified the key shortcuts for the wallpaper dialog. 2011-09-18 03:16:08 +02:00
Ayla
d0cfe7c60d Modified the key shortcuts for the text display dialog. 2011-09-18 03:05:25 +02:00
Ayla
5dd6d31b25 Modified the key shortcuts of the file input dialog. 2011-09-18 02:21:04 +02:00
Ayla
b5131c1db9 Modified the key shortcuts of the text input dialog, so that the X and Y keys are not used. 2011-09-18 02:05:15 +02:00
Ayla
87106cdf56 Modified the button icons displayed when modifying an integer parameter. 2011-09-18 01:47:29 +02:00
Ayla
1aac93f36d The (gp2x) A button is now used instead of X to clear string inputs (like link names). 2011-09-18 01:40:23 +02:00
Ayla
c9a51af4a6 The WallpaperDialog object now uses a ButtonBox to print the key mapping at the bottom of the screen. 2011-09-18 01:34:19 +02:00
Ayla
d82e262662 Rewrite of the MenuSettingRGBA class so that it won't use the CLEAR/MENU buttons. 2011-09-18 01:33:11 +02:00
Ayla
7f2c7db8e2 Rewrite of how the events are handled by the menusetting* objects. 2011-09-15 20:20:35 +02:00
Ayla
fdee206d93 The ButtonBox now features a clear() function which empties the list of buttons. 2011-09-15 20:12:02 +02:00
Ayla
6ac012348d Disactivate the binding of the app's manual on the 'Y' button. 2011-09-15 11:33:46 +02:00
Ayla
5f69930d07 The contextual menu now features a "show manual" entry. 2011-09-15 11:18:07 +02:00
Ayla
03a26a859b Dingoo port: The help menu now displays help for dingoo's controls. 2011-09-04 03:02:17 +02:00
Ayla
9768a74d07 The conf file does not need to be saved on exit. 2011-09-04 02:37:10 +02:00
Xiangfu Liu
46d680990a gmenu2x wallpaper only support .png 2011-08-22 15:13:44 +08:00
Ayla
8c1f4abb5b The input manager should check whether a powersaver instance is running, to not create one when it's not needed. 2011-08-17 00:46:43 +02:00
Ayla
fca8c8e8a1 Create the powersaver instance on demand and destroy it when not needed. 2011-08-17 00:46:11 +02:00
Ayla
f31828667f Added a boolean function to know if the powersaver is running. 2011-08-17 00:44:45 +02:00
Ayla
bffef7cfea GMenu2X does not need to init the audio subsystem of SDL. 2011-08-16 02:18:09 +02:00
Ayla
e282f8a55d Enable the SDL timer subsystem only if the backlight timeout is enabled. 2011-08-16 02:17:21 +02:00
Ayla
4fd4b234dc Set card root to /media by default for the Dingux port. 2011-08-11 03:42:18 +02:00
Ayla
3d3e0fa566 Read config file(s) present on both system and user-specific directories. 2011-08-11 03:40:36 +02:00
Ayla
7f08e854ea Shorted a too long caption on the contextual menu. (2) 2011-08-08 23:34:43 +02:00
Ayla
5b49bf0afb Shorted a too long caption on the contextual menu. 2011-08-08 17:40:27 +02:00
Ayla
5f77e3baf7 Cleaned GP2X-specific code that was built on all platforms.
There was a lot of gp2x-specific code which was built for
all platform. For instance, the code was compiled for all
the platforms with the constant "TARGET_GP2X" defined.
This obviously had to be fixed.
2011-07-29 01:13:35 +02:00
Ayla
f6c456f35b GMenu2X now won't clear the framebuffer on exit.
Instead, the loading screen image will remain even when GMenu2X is not running anymore.

This require a patched SDL; the patch can be found at
https://github.com/mthuurne/opendingux-buildroot/blob/opendingux-2010.11/package/sdl/sdl-fbcon-clear-onexit.patch
2011-07-28 01:48:12 +02:00
Ayla
4636a84eef Create the "sections" user directory if required, when creating a new link.
It previously assumed that this directory was present, which isn't
the case all the time.
2011-07-25 12:05:24 +02:00
Ayla
81a607c36e Fixed a good number of memory leaks.
The objects created with "new" were destroyed with "free()",
instead of "delete"; as a result, the destructors were never called.
2011-07-20 13:43:25 +02:00
Ayla
3a85cabf37 The SurfaceCollection won't load the files selection.png, bottombar.png or topbar.png from the Default skin if they are missing in the current skin. 2011-07-11 18:16:38 +02:00
Ayla
11e58c8ca5 Revert "GMenu2X now won't load skin files from the Default skin when using another skin."
This reverts commit 439d25c292.
Refusing to load files of the Default skin for a different one is a bad idea; it requires
that skin to provide every single PNG file needed by gmenu2x.
2011-07-11 18:14:27 +02:00
Ayla
00d8a04e00 Removed a bug where the Default skin was chosen even if another (working) skin was defined on the config file. 2011-07-11 12:39:31 +02:00
Ayla
0993a48eca Add a function which unlocks the virtual terminal before and after each execution of a binary.
It ensures that GMenu2X can restart after a SDL program segfaulted or crashed.
It also allow GMenu2X to exit without clearing the screen, so that the "loading" screen appears
until the launched binary starts using the framebuffer.
2011-07-11 11:27:38 +02:00
Ayla
55dad4171d Merge branch 'install_locations'
Conflicts:
	configure.in
2011-07-11 11:19:18 +02:00
Ayla
f7817b19ab The links will now be loaded from both the system and the user-specific directories. 2011-07-11 02:49:44 +02:00
Ayla
439d25c292 GMenu2X now won't load skin files from the Default skin when using another skin.
This was causing trouble when the current skin does not provide graphical files on purpose (ie. skin with no top/bottom bar).
2011-07-09 01:49:09 +02:00
Sergey Kukunin
28fe39ce54 Fix segmentation fault when try show Manual on Explorer or other service apps 2011-06-11 02:41:52 +03:00
kyak
6646525731 Zero-pad hex values when saving config
writeSkinConfig() had a very naughty bug when RGBA values were written
to config file unpadded. This lead to a problem that, for example,
0x00000080 was written as 0x00080 in config file (Somehow gmenu2x
reads and re-saves config on selection). This, in turn, led
to problem when reading skin config file in strtorgba function,
because it parses the color string in token of two symbols
(substr(0,2) and etc).
2011-06-06 11:38:26 +04:00
Maarten ter Huurne
7aeb7a4f0a PNG: Use libpng directly instead of via SDL_image.
This eliminates the build-time dependency on SDL_image and the run-time
dependencies on all libraries used by SDL_image except SDL and libpng.

In addition we now let libpng convert to ARGB format while decoding the
image, rather than letting SDL convert the surface afterwards.
2011-06-05 05:58:47 +02:00
Maarten ter Huurne
2394a075d7 Surface: Work around bug in SDL that loses per-surface alpha.
A bug in SDL_ConvertSurface() leaves the per-surface alpha undefined when
converting from RGBA to RGBA. This can cause problems if the surface is
later converted to a format without an alpha channel, such as the display
format.
2011-06-05 05:27:28 +02:00
Maarten ter Huurne
36260e999d PNG: Only add alpha channel on surface if loaded image has an alpha channel.
This fixes a bug where a loaded image could have an alpha of 0.
Also it avoids expensive alpha blending where it is unnecessary.
2011-06-03 12:47:49 +02:00
Maarten ter Huurne
8a81837c04 Surface: Make pixel format conversion explicit.
Instead of having the copy constructor convert to display format, the new
copy constructor preserves the pixel format and a separate method was
introduced to convert surfaces to display format.

The code was made more robust as well: it should no longer crash if the
wallpaper cannot be loaded.
2011-06-03 11:46:36 +02:00
Maarten ter Huurne
7861e07eb0 Surface: Made "raw" field private.
I cheated a bit by declaring ASFont as friend, but all other outside
access now happens via methods.

I removed the "saveScreenshot" method since the code calling it is
commented out and I never heard anyone complain about missing this
feature.
2011-06-02 22:44:04 +02:00