File: Group.pm

package info (click to toggle)
libgd-perl 2.53-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,028 kB
  • ctags: 191
  • sloc: perl: 3,002; makefile: 44
file content (33 lines) | stat: -rw-r--r-- 624 bytes parent folder | download | duplicates (4)
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
package GD::Group;

# Simple object for recursive grouping. Does absolutely nothing with GD,
# but works nicely with GD::SVG.

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;