no more submodule
This commit is contained in:
28
GtkSharp/Source/OldStuff/parser/gen_keysyms
Normal file
28
GtkSharp/Source/OldStuff/parser/gen_keysyms
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/perl -w
|
||||
# Generates a C# Key enum from the Gdk headers (gdkkeysyms.h)
|
||||
# Usage: ./gen_keysyms < gdkkeysyms.h > Key.cs
|
||||
# Alp Toker <alp@atoker.com>
|
||||
|
||||
print "// Generated File. Do not modify.\n\n";
|
||||
print "namespace Gdk\n";
|
||||
print "{\n";
|
||||
print "\tpublic enum Key {\n";
|
||||
|
||||
while(<>) {
|
||||
chomp;
|
||||
|
||||
if (m/^\W*#define\W+GDK_(\w+)\W+(\w+)\W*$/) {
|
||||
$key = $1;
|
||||
$value = $2;
|
||||
|
||||
# keys can't start with a digit
|
||||
if ($key =~ m/^\d.*$/) {
|
||||
$key = "Key_$key";
|
||||
}
|
||||
|
||||
print "\t\t$key = $value,\n";
|
||||
}
|
||||
}
|
||||
|
||||
print "\t}\n";
|
||||
print "}\n";
|
||||
Reference in New Issue
Block a user