Ross McFarland > Gtk2-1.043 > tools/podifyenums.pl

Download:
Gtk2-Perl/Gtk2-1.043.tar.gz

Annotate this POD

CPAN RT

New  2
Open  6
View/Report Bugs
Source   Latest Release: Gtk2-1.203

DESCRIPTION ^

Just a listing of all enum and flags types defined for $NAME, in one place for convenience. For more information, see the description of flags and enums in Glib.

LISTING ^

";

while (<>) { s/#.*//; (undef, $cname, $base, undef) = split; next unless $cname; next unless $base eq 'GFlags' or $base eq 'GEnum';

        eval {
                # do the name to package conversion first, in case we have
                # hijacked enum registrations with names that aren't the same
                # as the C type names.  (i've pulled that trick in a couple
                # of places, can't remember exactly where, so play it safe.)
                my $name = Glib::GenPod::convert_type ($cname);
                my @values = Glib::Type->list_values ($name);
                next unless @values;
                my $type = UNIVERSAL::isa ($name, 'Glib::Flags')
                         ? 'flags' : 'enum';
                print "=head2 $type $name\n\n"
                    . "=over\n\n"
                    . join ("\n\n",
                            map { "=item * '$_->{nick}' / '$_->{name}'" }
                                  @values)
                    . "\n\n=back\n\n";
        } or print STDERR $@;
}

print " =head1 SEE ALSO

Glib, Glib::Flags

AUTHOR ^

Generated ".scalar(localtime)." by $0, using Gtk2 compiled against GTK+ version ".join (".", Gtk2->get_version_info).".

syntax highlighting: