File: Group.pm

package info (click to toggle)
libgd-perl 2.84-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,060 kB
  • sloc: perl: 2,693; pascal: 336; sh: 18; makefile: 9
file content (40 lines) | stat: -rw-r--r-- 671 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package GD::Group;

=head1 NAME

GD::Group - Simple object for recursive grouping

=head1 DESCRIPTION

Does absolutely nothing with GD, but works nicely with GD::SVG.

=cut

use strict;

our $AUTOLOAD;
our $VERSION = 1.00;

sub AUTOLOAD {
    my ($pack,$func_name) = $AUTOLOAD =~ /(.+)::([^:]+)$/;
    my $this = shift;
    $this->{gd}->currentGroup($this->{group});
    $this->{gd}->$func_name(@_);
}

sub new {
    my $this        = shift;
    my ($gd,$group) = @_;
    return bless {gd    => $gd,
		  group => $group},ref $this || $this;
}

sub DESTROY {
    my $this = shift;
    my $gd   = $this->{gd};
    my $grp  = $this->{group};
    $gd->endGroup($grp);
}


1;