summaryrefslogtreecommitdiff
path: root/apps/plugins/lua/action_helper.pl
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2009-05-22 22:44:34 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2009-05-22 22:44:34 +0000
commit0f7e4e36aeb95f3e39a940d6e19748d910d40d92 (patch)
tree72df574e93dc33babc1107da581c3b0e30837acc /apps/plugins/lua/action_helper.pl
parent475b5dc2bbddd31f4fee8935a0e903147e05fd08 (diff)
downloadrockbox-0f7e4e36aeb95f3e39a940d6e19748d910d40d92.tar.gz
rockbox-0f7e4e36aeb95f3e39a940d6e19748d910d40d92.zip
Lua:
* add action_get_touchscreen_press wrapper * fix kbd_input wrapper * rework luaL_loadfile * add rb.contexts git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21046 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/lua/action_helper.pl')
-rwxr-xr-xapps/plugins/lua/action_helper.pl31
1 files changed, 24 insertions, 7 deletions
diff --git a/apps/plugins/lua/action_helper.pl b/apps/plugins/lua/action_helper.pl
index 8460b6cb2a..f1a1e12d60 100755
--- a/apps/plugins/lua/action_helper.pl
+++ b/apps/plugins/lua/action_helper.pl
@@ -22,21 +22,38 @@ $input = $ARGV[0] . "/../../action.h";
22 22
23open(ACTION, "<$input") or die "Can't open $input!"; 23open(ACTION, "<$input") or die "Can't open $input!";
24 24
25print "-- Don't change this file!\n";
26print "-- It is automatically generated of action.h\n";
27print "rb.actions = {\n";
28
29$i = 0; 25$i = 0;
26$j = 0;
30while(my $line = <ACTION>) 27while(my $line = <ACTION>)
31{ 28{
32 chomp($line); 29 chomp($line);
33 if($line =~ /^\s*(ACTION_[^\s]+)(\s*=.*)?,$/) 30 if($line =~ /^\s*(ACTION_[^\s]+)(\s*=.*)?,\s*$/)
34 { 31 {
35 printf "\t%s = %d,\n", $1, $i; 32 $actions[$i] = sprintf("\t%s = %d,\n", $1, $i);
36 $i++; 33 $i++;
37 } 34 }
35 elsif($line =~ /^\s*(CONTEXT_[^\s]+)(\s*=.*)?,\s*$/)
36 {
37 $contexts[$j] = sprintf("\t%s = %d,\n", $1, $j);
38 $j++;
39 }
38} 40}
39 41
42close(ACTION);
43
44print "-- Don't change this file!\n";
45printf "-- It is automatically generated of action.h %s\n", '$Revision';
46
47print "rb.actions = {\n";
48foreach $action(@actions)
49{
50 print $action;
51}
40print "}\n"; 52print "}\n";
41 53
42close(ACTION); 54print "rb.contexts = {\n";
55foreach $context(@contexts)
56{
57 print $context;
58}
59print "}\n";