summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl.straw/lib/GD/Group.pm
blob: 93506bb3bc1bafab71203998737e43324f7dcb94 (plain)
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;