1
0
Fork 0
forked from len0rd/rockbox
foxbox/apps/plugins/lua
William Wilgus 3e2b50ed3b lua events from rockbox
This library allows events to be subscribed / recieved within a lua script
most events in rb are synchronous so flags are set and later checked by a
secondary thread to make them (semi?) asynchronous.

There are a few caveats to be aware of:

FIRST, The main lua state is halted till the lua callback(s) are finished
 Yielding will not return control to your script from within a callback
 Also, subsequent callbacks may be delayed by the code in your lua callback
SECOND, You must store the value returned from the event_register function
 you might get away with it for a bit but gc will destroy your callback
 eventually if you do not store the event
THIRD, You only get one cb per event type
 ["action", "button", "custom", "playback", "timer"]
 (Re-registration of an event overwrites the previous one)

Usage:
 possible events =["action", "button", "custom", "playback", "timer"]

 local evX = rockev.register("event", cb_function, [timeout / flags])
  cb_function([id] [, data]) ... end

 rockev.suspend(["event"/nil][true/false]) passing nil affects all events
  stops event from executing, any but the last event before
  re-enabling will be lost, passing false, unregistering or re-registering
  an event will clear the suspend

 rockev.trigger("event", [true/false], [id])
  sets an event to triggered,
  NOTE!, CUSTOM_EVENT must be unset manually
  id is only passed to callback by custom and playback events

 rockev.unregister(evX)
  Use unregister(evX) to remove an event
  Unregistering is not necessary before script end, it will be
  cleaned up on script exit

Change-Id: Iea12a5cc0c0295b955dcc1cdf2eec835ca7e354d
2019-07-19 20:48:34 -05:00
..
include_lua lua add LCD_DEFAULT_FG, fix 2-bit screen fg/bg inversion 2018-11-24 16:40:23 -05:00
action_helper.pl Lua: Add pluginlib_actions wrapper for lua scripts. 2012-01-27 09:15:05 +01:00
button_helper.pl Lua: always expose BUTTON_TOUCHSCREEN and remove BUTTON_ constants from rocklib.c 2009-07-03 23:03:07 +00:00
lapi.c Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
lapi.h Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
lauxlib.c lua late bound cfunction tables 2019-07-11 00:09:54 -05:00
lauxlib.h lua update to 5.1.5 2018-11-11 19:42:30 -05:00
lbaselib.c lua update to 5.1.5 2018-11-11 19:42:30 -05:00
lbitlib.c Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
lcode.c lua update to 5.1.5 2018-11-11 19:42:30 -05:00
lcode.h Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
ldebug.c Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
ldebug.h Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
ldo.c lua update to 5.1.5 2018-11-11 19:42:30 -05:00
ldo.h Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
ldump.c lua disable bytecode dump & undump functions 2019-07-18 14:56:00 -05:00
lfunc.c Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
lfunc.h Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
lgc.c lua inbinary strings 2019-07-11 00:31:41 +02:00
lgc.h Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
liolib.c lua update to 5.1.5 2018-11-11 19:42:30 -05:00
llex.c lua inbinary strings 2019-07-11 00:31:41 +02:00
llex.h Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
llimits.h Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
lmathlib.c lua update to 5.1.5 2018-11-11 19:42:30 -05:00
lmem.c Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
lmem.h Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
loadlib.c lua update to 5.1.5 2018-11-11 19:42:30 -05:00
lobject.c lua inbinary strings 2019-07-11 00:31:41 +02:00
lobject.h lua inbinary strings 2019-07-11 00:31:41 +02:00
lopcodes.c Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
lopcodes.h Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
loslib.c lua close state on os.exit 2019-07-13 07:46:32 -05:00
lparser.c lua update to 5.1.5 2018-11-11 19:42:30 -05:00
lparser.h Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
lstate.c Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
lstate.h Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
lstring.c lua inbinary strings 2019-07-11 00:31:41 +02:00
lstring.h lua inbinary strings 2019-07-11 00:31:41 +02:00
lstrlib.c lua update to 5.1.5 2018-11-11 19:42:30 -05:00
ltable.c Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
ltable.h Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
ltablib.c Fix misleading indentation as pointed out by the new gcc warning 2016-08-12 15:33:28 +02:00
ltm.c lua inbinary strings 2019-07-11 00:31:41 +02:00
ltm.h Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
lua.h lua update to 5.1.5 2018-11-11 19:42:30 -05:00
lua.make lua move constants out of binary image 2019-07-18 08:42:00 -05:00
luaconf.h lua disable bytecode dump & undump functions 2019-07-18 14:56:00 -05:00
luadir.c Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
luadir.h FS#11347 by me: *dir LUA functions: luadir module 2010-06-18 13:10:14 +00:00
lualib.h Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
lundump.c lua disable bytecode dump & undump functions 2019-07-18 14:56:00 -05:00
lundump.h lua disable bytecode dump & undump functions 2019-07-18 14:56:00 -05:00
lvm.c lua update to 5.1.5 2018-11-11 19:42:30 -05:00
lvm.h Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
lzio.c Lua fix reader bug in lzio 2018-11-15 11:20:54 +01:00
lzio.h Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
Makefile FS#12144, Use -fPIC -fvisibility=hidden only for plugins on sim and app builds and enable it for 32 bit too. Fixes linking errors on simbuilds. 2011-06-07 11:56:23 +00:00
rbdefines_helper.pl lua events from rockbox 2019-07-19 20:48:34 -05:00
README Lua remove strncat.c & strcspn.c 2018-10-30 04:17:06 +01:00
rockaux.c lua events from rockbox 2019-07-19 20:48:34 -05:00
rockconf.h lua inbinary strings 2019-07-11 00:31:41 +02:00
rocklib.c lua events from rockbox 2019-07-19 20:48:34 -05:00
rocklib.h lua events from rockbox 2019-07-19 20:48:34 -05:00
rocklib_aux.pl lua alphabetically sort perl generated rocklib_aux functions 2019-07-17 10:22:21 -05:00
rocklib_events.c lua events from rockbox 2019-07-19 20:48:34 -05:00
rocklib_events.h lua events from rockbox 2019-07-19 20:48:34 -05:00
rocklib_img.c lua fix rlimage FB_SCALARPACK() 2018-11-02 00:42:57 -04:00
rocklib_img.h lua move rocklib_img to its own separate loadable module 2018-10-22 14:00:58 -04:00
rocklibc.h lua update to 5.1.5 2018-11-11 19:42:30 -05:00
rocklua.c lua events from rockbox 2019-07-19 20:48:34 -05:00
settings_helper.pl Lua Fix settings_helper for the gigaBeastS 2018-12-17 09:41:15 -06:00
SOURCES lua events from rockbox 2019-07-19 20:48:34 -05:00
strftime.c Lua update strftime.c from dietlibc source 2018-10-30 02:39:11 -04:00
strpbrk.c Initial commit of the Samsung YP-R0 port. 2011-12-24 11:56:46 +00:00
strstr.c Commit FS#9174: Lua scripting language by Dan Everton 2009-05-21 19:01:41 +00:00
strtol.c Commit FS#9174: Lua scripting language by Dan Everton 2009-05-21 19:01:41 +00:00
strtoul.c Commit FS#9174: Lua scripting language by Dan Everton 2009-05-21 19:01:41 +00:00
tlsf_helper.c lua: Switch memory allocator from dl to tlsf 2013-08-26 09:42:47 +02:00

The following files are (with slight modifications for Rockbox) from dietlibc
version 0.31 which is licensed under the GPL version 2:

    gmtime.c
    strftime.c
    strpbrk.c
    strtol.c
    strtoul.c
    strstr.c