comparison GD/Group.pm @ 0:e94de0ea3351 draft default tip

Uploaded
author dereeper
date Wed, 11 Sep 2013 09:08:15 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:e94de0ea3351
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;