Commit graph

64 commits

Author SHA1 Message Date
William Wilgus
cb94b3ae2e keyboard add ability to specify temporary custom layouts
rb core allows you to load custom keyboard layouts

this patch adds the ability to load a keyboard layout in a buffer
the custom layout is temporary and does not overwrite the current layout

use like so:

    unsigned short kbd[64];
    unsigned short *kbd_p = kbd;
    if (!kbd_create_layout("ABCD1234\n", kbd, sizeof(kbd)))
        kbd_p = NULL;

    rb->kbd_input(buf,sizeof(buf), kbd_p);

Change-Id: I7be2bd4a1b4797a147fa70228a9749dc56ac052a
2020-07-22 06:48:28 -04:00
Boris Gjenero
1b4ee1f33a Fix Samsung YH92X/YH820 keypad conditional in text_editor
All the *_PAD values are always #defined. So the change made in
5e91ec1 was applied to all devices instead of only those it was
meant to be applied to.

Change-Id: Iba72316ecf2e3c83132b47484731cd177686b19e
2017-05-06 21:34:21 -04:00
Sebastian Leonhardt
e6cd53ad53 Replace SAMSUNG_YH920_PAD with YH92X
seems more logical to me, and is more consistent, since
"SAMSUNG_YH92X_PAD" is already used in the tex files.

Change-Id: Ie9a9d850ea86155a7dcf86c88a22a420a10a3837
2016-01-25 09:23:09 +01:00
Sebastian Leonhardt
5e91ec1401 Samsung YH820/92x keymap bugfixes
This patch fixes some (mostly small) plugin issues with the "big"
YH-keymap patch (a507b). Only one fix affects the main keymaps
(virtual keyboard "DONE" now exits after long key /release/ instead
of long button /press/).

Change-Id: Id34f925ebfa97ae4974cd9405fbe1fee4f597833
2015-12-27 18:14:41 +01:00
Nils Wallménius
7803f31c53 Don't reinvent ctype.h functions
Remove ctype.h functions in text_editor and rockboy,
fix #define name clash in mpegplayer.

Change-Id: Icb40cf45e27b793c62cb095197757a27f508f344
2012-05-07 18:43:12 +02:00
Teruaki Kawashima
15e8460053 text editor: decrease size of extension to reduce stack usage.
this could solve crash in text editor (FS#10078).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28189 a1c6a512-1295-4272-9138-f99709370657
2010-10-01 14:40:28 +00:00
Thomas Martitz
cae4ae2c71 Second try: Introduce plugin_crt0.c that every plugin links.
It handles exit() properly, calling the handler also when the plugin returns
normally (also make exit() more standard compliant while at it).
It also holds PLUGIN_HEADER, so that it doesn't need to be in each plugin anymore.

To work better together with callbacks passed to rb->default_event_handler_ex() introduce exit_on_usb() which will call the exit handler before showing the usb screen and exit() after it.
In most cases rb->default_event_handler_ex() was passed a callback which was manually called at all other return points. This can now be done via atexit().

In future plugin_crt0.c could also handle clearing bss, initializing iram and more.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27873 a1c6a512-1295-4272-9138-f99709370657
2010-08-24 14:30:46 +00:00
Thomas Martitz
93cb949372 Revert "Introduce plugin_crt0.c that every plugin links."
Too much errors and no time to fix them now.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27863 a1c6a512-1295-4272-9138-f99709370657
2010-08-23 17:12:26 +00:00
Thomas Martitz
abdc5935be Introduce plugin_crt0.c that every plugin links.
It handles exit() properly, calling the handler also when the plugin returns
normally (also it makes exit() more standard compliant while at it).
It also holds PLUGIN_HEADER, so that it doesn't need to be in each plugin anymore.

To work better together with callbacks passed to rb->default_event_handler_ex introduce exit_on_usb() which will call the exit handler before showing the usb screen and exit() after it.
In most cases it was passed a callback which was manually called at all other return points. This can now be done via atexit().

In future plugin_crt0.c could also handle clearing bss, initializing iram and more.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27862 a1c6a512-1295-4272-9138-f99709370657
2010-08-23 16:56:49 +00:00
Teruaki Kawashima
8e68e223a4 text_editor: make functions and variables static. slightly reduce plugin size.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27400 a1c6a512-1295-4272-9138-f99709370657
2010-07-12 14:29:40 +00:00
Teruaki Kawashima
f06f6543c6 text editor: use plugin_get_buffer() to allocate buffer. if size of the file is bigger than the buffer, use the audio buffer.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27213 a1c6a512-1295-4272-9138-f99709370657
2010-07-01 12:08:47 +00:00
Thomas Martitz
0a1d7c28b7 Make open() posix compliant api-wise. A few calls (those with O_CREAT) need the additional optional mode parameter so add it. Impact for the core is almost zero, as open() is a wrapper macro for the real open function which doesn't take the variable parameter.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25844 a1c6a512-1295-4272-9138-f99709370657
2010-05-06 17:35:13 +00:00
Teruaki Kawashima
dc010201a5 make sure plugin reset backlight setting before exit. do code polish.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24076 a1c6a512-1295-4272-9138-f99709370657
2009-12-18 14:17:28 +00:00
Teruaki Kawashima
cc9e336fa1 text editor: Return pointer to buffer but position in buffer for ACTION_GET to simpify code.
Use strlcpy instead of strcpy to prevent buffer overflow.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23845 a1c6a512-1295-4272-9138-f99709370657
2009-12-04 12:53:14 +00:00
Teruaki Kawashima
f6999b8f2a text editor: optimize a bit and try to reduce size.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22449 a1c6a512-1295-4272-9138-f99709370657
2009-08-21 14:56:23 +00:00
Nils Wallménius
3200d04d75 Make the formatter functions used by the settings return a pointer to avoid usless copying of lang strings, this brought with it a long chain of const correctness and a few random cleanups
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22440 a1c6a512-1295-4272-9138-f99709370657
2009-08-20 16:47:44 +00:00
Thomas Martitz
18e40e0f4c Make kbd_input() show a cancel splash to indicate user abort better and for better consistency all over the place. Change checking for its return value (style-wise) at some places too.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22269 a1c6a512-1295-4272-9138-f99709370657
2009-08-12 14:38:25 +00:00
Frank Gevaerts
308522b60e Decrease the text buffer a tiny bit to make it fit again on archos. This really should use plugin_get_buffer() (and possibly plugin_get_audio_buffer() for big files) though.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21996 a1c6a512-1295-4272-9138-f99709370657
2009-07-21 21:19:42 +00:00
Teruaki Kawashima
3f7dfeed3a text_editor: don't set filename "/" before input new filename so that user can easily create copy in same directory.
select new last line if last line is cut/deleted or concatenated to above line.
fix bugs when changes are not saved (FS#9692, patch by Johannes Linke).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21994 a1c6a512-1295-4272-9138-f99709370657
2009-07-21 14:35:29 +00:00
Nils Wallménius
3d4701a6e4 FS#10080
* Move strncpy() from core to the pluginlib
* Introduce strlcpy() and use that instead in most places (use memcpy in a few) in core and some plugins
* Drop strncpy() from the codec api as no codec used it
* Bump codec and plugin api versions


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21863 a1c6a512-1295-4272-9138-f99709370657
2009-07-14 13:57:45 +00:00
Alexander Levin
119cfdaa0a Do not unnecessarily change and restore the status bar setting (part of FS#10138 by Teruaki Kawashima)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21493 a1c6a512-1295-4272-9138-f99709370657
2009-06-24 20:17:17 +00:00
Alexander Levin
763a7d7457 Ensure that the file handle is always closed in text editor plugin (part of FS#10138 by Teruaki Kawashima, minor modifications by me)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21491 a1c6a512-1295-4272-9138-f99709370657
2009-06-24 15:18:32 +00:00
Alexander Levin
249800c1ae Fix a typo in the comment
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20422 a1c6a512-1295-4272-9138-f99709370657
2009-03-21 09:24:40 +00:00
Alexander Levin
56086db778 Fix yellow
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20408 a1c6a512-1295-4272-9138-f99709370657
2009-03-20 19:37:11 +00:00
Alexander Levin
2d77fde363 Accept some improvements to the text editor plugin (FS#9988 with minor modifications by me)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20405 a1c6a512-1295-4272-9138-f99709370657
2009-03-20 18:59:03 +00:00
Alex Parker
788ace2ec6 Change spelling to British English in the filetype colours section
of text_editor


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20327 a1c6a512-1295-4272-9138-f99709370657
2009-03-16 21:24:29 +00:00
Andrew Mahone
23d9812273 loader-initialized global plugin API:
struct plugin_api *rb is declared in PLUGIN_HEADER, and pointed to by
__header.api

the loader uses this pointer to initialize rb before calling entry_point

entry_point is no longer passed a pointer to the plugin API

all plugins, and pluginlib functions, are modified to refer to the
global rb

pluginlib functions which only served to copy the API pointer are
removed

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19776 a1c6a512-1295-4272-9138-f99709370657
2009-01-16 10:34:40 +00:00
Björn Stenberg
a36cdf5b37 Removed the sim_ prefix from the plugin api.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19704 a1c6a512-1295-4272-9138-f99709370657
2009-01-07 09:53:46 +00:00
Björn Stenberg
c6b3d38a15 New makefile solution: A single invocation of 'make' to build the entire tree. Fully controlled dependencies give faster and more correct recompiles.
Many #include lines adjusted to conform to the new standards.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19146 a1c6a512-1295-4272-9138-f99709370657
2008-11-20 11:27:31 +00:00
Nils Wallménius
01729e7a18 FS#9281 Rename of splash functions.
* Remove gui_splash()
* Rename gui_syncsplash() to splashf() and remove its voice 
capabilities.
* Rename the internal splash() to splash_internal() and introduce an 
externally visible splash() that handles simple splashing  without 
printf functionality e.g. splash(HZ, ID2P(LANG_FOO)); or splash(HZ, 
"foo"); if a LANG_* id is passed it will be voiced.
* Adjust all places that called gui_syncsplash() to use the correct 
variant from above.
* Export both new functions to plugins and adjust places calling 
rb->splash() to use the correct variant so that we now have naming 
consistency between the core and plugins.
* Fix one latent bug that would cause my sim to crash with the above 
changes and correct P2STR and P2ID macros, thanks to pondlife.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18282 a1c6a512-1295-4272-9138-f99709370657
2008-08-15 08:27:39 +00:00
Daniel Stenberg
2acc0ac542 Updated our source code header to explicitly mention that we are GPL v2 or
later. We still need to hunt down snippets used that are not. 1324 modified
files...
http://www.rockbox.org/mail/archive/rockbox-dev-archive-2008-06/0060.shtml


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17847 a1c6a512-1295-4272-9138-f99709370657
2008-06-28 18:10:04 +00:00
Steve Bavin
6526577818 Plugin parameters should be const.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17492 a1c6a512-1295-4272-9138-f99709370657
2008-05-13 09:57:56 +00:00
Jonathan Gordon
33b785e40b allow the plugin playback control menu to be put in a viewport.
fix text editor so it is actually possible to get to the control menu if the file hasnt been changed (its in the regular menu now)


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17221 a1c6a512-1295-4272-9138-f99709370657
2008-04-23 10:28:34 +00:00
Nils Wallménius
6848961aa5 Pass the buffer length to the list_get_name callback functions instead of using hardcoded MAX_PATH
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17049 a1c6a512-1295-4272-9138-f99709370657
2008-04-09 15:25:17 +00:00
Jonathan Gordon
5ca1539969 the menu and list now accepts a parent viewport to draw in (and the menu can be told to not show status/button bars). This lays the groundwork to fix colour problems with plugin menus (see star.c for an example.) This hopefully fixes some button bar issues as well as theme problems.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16812 a1c6a512-1295-4272-9138-f99709370657
2008-03-26 03:35:24 +00:00
Dave Chapman
e92d2c51ed Add a general-purpose parse_list function to parse a string containing a delimited list of items and adapt the parse_image_load() function in the WPS parser to use it. This function will also be used to parse the upcoming WPS %V viewport tag, but I'm committing it separately as these changes are unrelated to the viewport implementation itself.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16728 a1c6a512-1295-4272-9138-f99709370657
2008-03-21 13:41:35 +00:00
Paul Louden
31bf5cc8e5 Oops. Was thinking _TREE_ not _STD_, so no changes to the text editor
after all.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15708 a1c6a512-1295-4272-9138-f99709370657
2007-11-20 02:11:13 +00:00
Paul Louden
92b6ee91fa Fix keymapping inconsistencies generated by my previous keymap change,
this touches the FM Radio, Recording, and Text Editors.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15706 a1c6a512-1295-4272-9138-f99709370657
2007-11-20 01:59:06 +00:00
Dave Chapman
a076da6efc Remove an unneeded #include - action.h is already included by plugin.h
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15388 a1c6a512-1295-4272-9138-f99709370657
2007-10-31 22:33:28 +00:00
Nils Wallménius
d969a420b6 Do not display the backdrop in text viewer and editor plugins
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14835 a1c6a512-1295-4272-9138-f99709370657
2007-09-23 19:15:56 +00:00
Jonathan Gordon
cf1cef5f57 minor update to gui_synclist_do_button() which will hopefully simplify things later.
Now returns true if the action was handled in that function instead of returning the handled action.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14733 a1c6a512-1295-4272-9138-f99709370657
2007-09-17 10:08:50 +00:00
Jonathan Gordon
744f07f554 fix FS#6754 - the standard context menu action will now delete the selected line
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14137 a1c6a512-1295-4272-9138-f99709370657
2007-08-02 11:07:06 +00:00
Jonathan Gordon
cafffb5b65 FS#5809:
add playback menu to text editor, 
make the filename saving in rockpaint a bit better, automatically adds .bmp if its not there


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13993 a1c6a512-1295-4272-9138-f99709370657
2007-07-26 08:04:28 +00:00
Jonathan Gordon
f22dd51956 unused variable
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13902 a1c6a512-1295-4272-9138-f99709370657
2007-07-15 06:53:17 +00:00
Jonathan Gordon
9dca6aafb3 convert the last of the menus in text_editor to the new api
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13901 a1c6a512-1295-4272-9138-f99709370657
2007-07-15 06:45:12 +00:00
Paul Louden
f8b5913ae7 Make user-visible spelling "colours" rather than "colors".
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13671 a1c6a512-1295-4272-9138-f99709370657
2007-06-19 04:21:06 +00:00
Jonathan Gordon
1b947de1ad s/icons/colors
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13666 a1c6a512-1295-4272-9138-f99709370657
2007-06-18 13:57:05 +00:00
Jonathan Gordon
46e186fa61 extend the text editor plugin to be able to modify the .colors file
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13665 a1c6a512-1295-4272-9138-f99709370657
2007-06-18 13:37:57 +00:00
Jonathan Gordon
77a458a464 Move the old api out of the core and into the plugin lib.
ew plugins shuold use the new api and not this one.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13358 a1c6a512-1295-4272-9138-f99709370657
2007-05-08 11:55:43 +00:00
Jonathan Gordon
f34495deca Dont boost so often, fixes FS#6845
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12832 a1c6a512-1295-4272-9138-f99709370657
2007-03-18 13:25:18 +00:00