comparison GD/Group.pm @ 7:98e4922caaa9 draft default tip

Uploaded
author dereeper
date Wed, 26 Jun 2013 09:39:53 -0400
parents
children
comparison
equal deleted inserted replaced
6:cc85d97aeb55 7:98e4922caaa9
1 package GD::Group;
2
3 # Simple object for recursive grouping. Does absolutely nothing with GD,
4 # but works nicely with GD::SVG.
5
6 use strict;
7
8 our $AUTOLOAD;
9 our $VERSION = 1.00;
10
11 sub AUTOLOAD {
12 my ($pack,$func_name) = $AUTOLOAD =~ /(.+)::([^:]+)$/;
13 my $this = shift;
14 $this->{gd}->currentGroup($this->{group});
15 $this->{gd}->$func_name(@_);
16 }
17
18 sub new {
19 my $this = shift;
20 my ($gd,$group) = @_;
21 return bless {gd => $gd,
22 group => $group},ref $this || $this;
23 }
24
25 sub DESTROY {
26 my $this = shift;
27 my $gd = $this->{gd};
28 my $grp = $this->{group};
29 $gd->endGroup($grp);
30 }
31
32
33 1;