mirror of https://github.com/GNOME/gimp.git
synced with glib-mkenums (execept for the newly added template feature).
2004-07-28 Sven Neumann <sven@gimp.org> * tools/gimp-mkenums: synced with glib-mkenums (execept for the newly added template feature).
This commit is contained in:
parent
80a40f0b96
commit
2adc9be23f
|
@ -89,7 +89,9 @@ sub parse_entries {
|
||||||
if (m@^\s*
|
if (m@^\s*
|
||||||
(\w+)\s* # name
|
(\w+)\s* # name
|
||||||
(?:=( # value
|
(?:=( # value
|
||||||
(?:[^,/]|/(?!\*))*
|
\s*\w+\s*\(.*\)\s* # macro with multiple args
|
||||||
|
| # OR
|
||||||
|
(?:[^,/]|/(?!\*))* # anything but a comma or comment
|
||||||
))?,?\s*
|
))?,?\s*
|
||||||
(?:/\*< # options
|
(?:/\*< # options
|
||||||
(([^*]|\*(?!/))*)
|
(([^*]|\*(?!/))*)
|
||||||
|
@ -195,7 +197,7 @@ while ($_ = $ARGV[0], /^-/) {
|
||||||
if (length($fhead)) {
|
if (length($fhead)) {
|
||||||
my $prod = $fhead;
|
my $prod = $fhead;
|
||||||
|
|
||||||
$prod =~ s/\@filename\@/$ARGV/g;
|
$prod =~ s/\@filename\@/$ARGV[0]/g;
|
||||||
$prod =~ s/\\a/\a/g; $prod =~ s/\\b/\b/g; $prod =~ s/\\t/\t/g; $prod =~ s/\\n/\n/g;
|
$prod =~ s/\\a/\a/g; $prod =~ s/\\b/\b/g; $prod =~ s/\\t/\t/g; $prod =~ s/\\n/\n/g;
|
||||||
$prod =~ s/\\f/\f/g; $prod =~ s/\\r/\r/g;
|
$prod =~ s/\\f/\f/g; $prod =~ s/\\r/\r/g;
|
||||||
|
|
||||||
|
@ -230,9 +232,11 @@ while (<>) {
|
||||||
next if defined $options{"skip"};
|
next if defined $options{"skip"};
|
||||||
$enum_prefix = $options{prefix};
|
$enum_prefix = $options{prefix};
|
||||||
$flags = $options{flags};
|
$flags = $options{flags};
|
||||||
|
$option_lowercase_name = $options{lowercase_name};
|
||||||
} else {
|
} else {
|
||||||
$enum_prefix = undef;
|
$enum_prefix = undef;
|
||||||
$flags = undef;
|
$flags = undef;
|
||||||
|
$option_lowercase_name = undef;
|
||||||
}
|
}
|
||||||
# Didn't have trailing '{' look on next lines
|
# Didn't have trailing '{' look on next lines
|
||||||
if (!defined $1) {
|
if (!defined $1) {
|
||||||
|
@ -313,6 +317,11 @@ while (<>) {
|
||||||
$enumlong = uc($enspace) . "_" . $enumshort;
|
$enumlong = uc($enspace) . "_" . $enumshort;
|
||||||
$enumsym = lc($enspace) . "_" . lc($enumshort);
|
$enumsym = lc($enspace) . "_" . lc($enumshort);
|
||||||
|
|
||||||
|
#The options might override the lower case name if it could not be generated correctly:
|
||||||
|
if (defined($option_lowercase_name)) {
|
||||||
|
$enumsym = $option_lowercase_name;
|
||||||
|
}
|
||||||
|
|
||||||
if ($firstenum) {
|
if ($firstenum) {
|
||||||
$firstenum = 0;
|
$firstenum = 0;
|
||||||
|
|
||||||
|
@ -366,7 +375,7 @@ while (<>) {
|
||||||
$prod =~ s/\\f/\f/g; $prod =~ s/\\r/\r/g;
|
$prod =~ s/\\f/\f/g; $prod =~ s/\\r/\r/g;
|
||||||
for (@entries) {
|
for (@entries) {
|
||||||
my ($name,$nick,$desc) = @{$_};
|
my ($name,$nick,$desc) = @{$_};
|
||||||
my $tmp_prod = $vprod;
|
my $tmp_prod = $prod;
|
||||||
|
|
||||||
$tmp_prod =~ s/\@VALUENAME\@/$name/g;
|
$tmp_prod =~ s/\@VALUENAME\@/$name/g;
|
||||||
$tmp_prod =~ s/\@valuenick\@/$nick/g;
|
$tmp_prod =~ s/\@valuenick\@/$nick/g;
|
||||||
|
|
Loading…
Reference in New Issue