1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-10-04 02:23:15 +03:00
Commit Graph

254 Commits

Author SHA1 Message Date
Paul Cercueil
8bb58f6270 Sort links once they have all been added to the menu 2014-01-19 23:07:54 +01:00
Paul Cercueil
cb82d55350 Set default link size to 80x50 2014-01-16 16:23:26 +01:00
Paul Cercueil
ad30fae321 Remove "scan for applications and games" feature
It's been broken for a long time now.
2014-01-16 16:07:06 +01:00
Paul Cercueil
cfb96dd697 Pass a Surface to ButtonBox' and IconButton's paint function 2014-01-16 01:19:34 +01:00
Paul Cercueil
67ac54e970 Handle the skin: prefix on the font path 2014-01-15 22:02:30 +01:00
Paul Cercueil
af258530db Allow the skin to change the font and font size 2014-01-15 20:32:17 +01:00
Paul Cercueil
246fd8630c Output log to /var/log/gmenu2x.log 2013-11-08 11:27:34 +01:00
Paul Cercueil
8452c037ac Remove calls to sync()
This is not a low-level tool to deal with the filesystem, using
sync() here is nonsense and just bogs down the system for nuts.
2013-09-26 18:58:12 -03:00
Paul Cercueil
6947997d44 Fix build for platforms without libopk 2013-09-19 17:26:32 +02:00
Paul Cercueil
0e4180460b Recover last session from main() instead of constructor
This fixes a bug where the apps using the file selector wouldn't be
launched at all when selecting a new file after a session recover.
2013-09-07 17:02:38 -04:00
Paul Cercueil
dba6c32109 Change API of InputManager: we don't care about key release events 2013-09-07 11:00:57 -04:00
Maarten ter Huurne
965340a39c Fixed bug with launch screen and double buffering
LinkApp::drawRun() assumes the layers below are already painted when
it is called, but this was not the case. With single buffering, the
previous frame was still there so it still looked good, but with
double buffering the buffer typically contains an outdated screen.

Long term I think the launch should happen at the outermost scope,
so all destructors get a chance to run. This commit is a small step
in that direction, by exiting the main loop before launching.
2013-08-16 10:41:16 +02:00
Maarten ter Huurne
6c80a663e1 Check for empty strings using empty() instead of comparing to "" 2013-08-16 09:16:04 +02:00
Maarten ter Huurne
91dd708476 Added method GMenu2X::getContentArea() 2013-08-14 12:56:15 +02:00
Maarten ter Huurne
19fc3cb4d1 Added "bottomBarHeight" item to skin
There was already "topBarHeight", but the height of the bottom bar was
still hardcoded.
2013-08-14 12:23:15 +02:00
Maarten ter Huurne
1ffae36004 Made Surface argument to drawTopBar/drawBottomBar() mandatory 2013-08-14 11:47:29 +02:00
Maarten ter Huurne
b18e3fa6a8 Don't pass screen coordinates to drawScrollBar()
The scroll bar always spans the content area of the screen: the
position and height depend only on the theme and not on who is
drawing it.

Note that the coordinates passed were wrong in most cases, so this
commit fixes the scroll bar positioning for several dialogs.
2013-08-14 11:47:29 +02:00
Maarten ter Huurne
9c497e7867 Remove "don't leave" feature
If the application in question daemonizes, it will continue running
no matter whether we start it with system() or execlp(). So I don't
see a reason for this feature to exist and removing it means less
code paths to worry about.
2013-08-14 11:47:28 +02:00
Maarten ter Huurne
dfa5413b5b Removed the word "Color" from the labels in the skin settings menu
The labels were longer than the space before the RGBA controls and
the fact that these are colors is already clear from the context
(such as having an RGBA control after it ;).

I tried to update the translated versions of these labels as well.
However, since I don't speak most of these languages, it is possible
the result is grammatically incorrect. If this is the case, please
mail me a correction.
2013-08-14 11:47:28 +02:00
Maarten ter Huurne
06ee35bb7a Make ButtonBox deal with IconButtons instead of generic Buttons
Nowhere in the code do we actually mix IconButtons and Links (the other
Button subclass), so I'm thinking of breaking up this class hierarchy
or at least making the inheritance private.

Also switched to C++11 style loops.
2013-08-13 00:34:04 +02:00
Maarten ter Huurne
90afa096e7 Query animation status instead of storing it
This makes it a lot easier to support more than one possible animation
in the same layer.
2013-08-12 19:41:56 +02:00
Maarten ter Huurne
de30b3f98f Define LinkApp::isOpk() also when OPK support is disabled
This reduces the number of required preprocessor directives, leading to
more readable code and more code being examined by the compiler (useful
to spot problems). Since the method is inlined, the compiler should be
able to eliminate the same amount of code that the preprocessor would,
only at a later stage of the compilation.
2013-08-12 00:13:18 +02:00
Maarten ter Huurne
271ef00c18 Call Menu::selLinkApp() only once in GMenu2X::editLink() 2013-08-12 00:08:28 +02:00
Maarten ter Huurne
76117663ff Converted the context menu to a Layer
This fixes a bug with the captured background being wrong when using
double buffering. Also it ensures that for example the clock in the
status bar is updated when the context menu is open.
2013-08-11 23:46:04 +02:00
Maarten ter Huurne
945e29986a Cleaned up GMenu2X::contextMenu() 2013-08-11 20:57:13 +02:00
Maarten ter Huurne
f414ce4685 Allow layers to play animations 2013-08-11 01:35:43 +02:00
Maarten ter Huurne
71f4391cda Moved all code for opening the context menu into the Menu class
All of the entries in the context menu affect sections and links, so
the context menu should be considered part of the main menu, not of
the global / background context.
2013-08-09 19:09:57 +02:00
Maarten ter Huurne
3f299f62b6 Set initial key repeat delay to a more sensible value
Previously it was set to 1 ms, which in practice means "as fast as
you can" and leads to a lot of unintended repeats.
2013-08-09 18:18:51 +02:00
Maarten ter Huurne
346067896a Put background painting and global keys in new Background layer
The battery status was put into a separate class instead of directly
into the Background class.
2013-08-09 18:01:51 +02:00
Maarten ter Huurne
a15339d425 Cleanups of Clock class
Don't make Clock a singleton. While there should be no reason to
instantiate this class more than once, there is no problem with doing
that either. Removing the singleton makes it easier to control access
to the instance. It also avoids the rather nasty construct that was
used to delete it.

Make sure the timer callback function is a proper C function, since
SDL is a C library. This requires some trickery to be able to call
a private method from the callback, but I found a way using an
intermediate nested class. The compiler should be able to inline this
to eliminate any overhead.

Also some minor cleanups.
2013-08-07 02:55:23 +02:00
Maarten ter Huurne
f71ea3bcee Call Menu::skinUpdated() earlier in initMenu()
That method initializes linkColumns, which is divided by in
setLinkIndex().
2013-08-06 19:59:35 +02:00
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
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
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
Paul Cercueil
de9b3cd27d Make sure the joystick subsystem is inited before InputManager starts 2013-07-29 16:54:12 -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
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
d5280ebc7b Use sigaction() instead of deprecated function signal() 2013-07-19 13:58:12 -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
04d9d9322d Remove trailing slash from CARD_ROOT 2013-07-19 11:54: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
13b3d8e0ca Monitor OPK folders using inotify and automatically add/delete links 2013-07-16 13:36:18 -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
9737810bcb Remove the "unlock VT" feature; it has been moved to its own program 2013-07-05 17:51:59 -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
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
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
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
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
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
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
df981eb03a Drop the 'remove link' option on the context menu of OPKs 2012-10-23 06:45:56 +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
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
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
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
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
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
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
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
a0b9fc026b Fix the filename for the user-specified input conf file. 2012-01-23 12:29:58 +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
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
a01d892eb6 More header cleanups.
This time the focus was on removing namespace imports from headers.
2011-10-23 16:43:56 +02:00