home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / tsw / TSW_3.4.0.exe / Apache2 / perl / Constants.pm < prev    next >
Encoding:
Perl POD Document  |  2004-01-30  |  3.6 KB  |  139 lines

  1. #============================================================= -*-Perl-*-
  2. #
  3. # Template::Plugin::GD::Constants
  4. #
  5. # DESCRIPTION
  6. #
  7. #   Simple Template Toolkit plugin interfacing to the GD constants
  8. #   in the GD.pm module.
  9. #
  10. # AUTHOR
  11. #   Craig Barratt   <craig@arraycomm.com>
  12. #
  13. # COPYRIGHT
  14. #   Copyright (C) 2001 Craig Barratt.  All Rights Reserved.
  15. #
  16. #   This module is free software; you can redistribute it and/or
  17. #   modify it under the same terms as Perl itself.
  18. #
  19. #----------------------------------------------------------------------------
  20. #
  21. # $Id: Constants.pm,v 1.55 2004/01/13 16:20:46 abw Exp $
  22. #
  23. #============================================================================
  24.  
  25. package Template::Plugin::GD::Constants;
  26.  
  27. require 5.004;
  28.  
  29. use strict;
  30. use GD qw(/^gd/ /^GD/);
  31. use Template::Plugin;
  32. use base qw( Template::Plugin );
  33. use vars qw( @ISA $VERSION );
  34.  
  35. $VERSION = sprintf("%d.%02d", q$Revision: 1.55 $ =~ /(\d+)\.(\d+)/);
  36.  
  37. sub new
  38. {
  39.     my $class   = shift;
  40.     my $context = shift;
  41.     my $self    = { };
  42.     bless $self, $class;
  43.  
  44.     #
  45.     # GD has exported various gd* and GD_* contstants.  Find them.
  46.     #
  47.     foreach my $v ( keys(%Template::Plugin::GD::Constants::) ) {
  48.         $self->{$v} = eval($v) if ( $v =~ /^gd/ || $v =~ /^GD_/ );
  49.     }
  50.     return $self;
  51. }
  52.  
  53. 1;
  54.  
  55. __END__
  56.  
  57.  
  58. #------------------------------------------------------------------------
  59. # IMPORTANT NOTE
  60. #   This documentation is generated automatically from source
  61. #   templates.  Any changes you make here may be lost.
  62. #   The 'docsrc' documentation source bundle is available for download
  63. #   from http://www.template-toolkit.org/docs.html and contains all
  64. #   the source templates, XML files, scripts, etc., from which the
  65. #   documentation for the Template Toolkit is built.
  66. #------------------------------------------------------------------------
  67.  
  68. =head1 NAME
  69.  
  70. Template::Plugin::GD::Constants - Interface to GD module constants
  71.  
  72. =head1 SYNOPSIS
  73.  
  74.     [% USE gdc = GD.Constants %]
  75.  
  76.     # --> the constants gdc.gdBrushed, gdc.gdSmallFont, gdc.GD_CMP_IMAGE
  77.     #     are now available
  78.  
  79. =head1 EXAMPLES
  80.  
  81.     [% FILTER null;
  82.         USE gdc = GD.Constants;
  83.         USE im  = GD.Image(200,100);
  84.         black = im.colorAllocate(0  ,0,  0);
  85.         red   = im.colorAllocate(255,0,  0);
  86.         r = im.string(gdc.gdLargeFont, 10, 10, "Large Red Text", red);
  87.         im.png | stdout(1);
  88.        END;
  89.     -%]
  90.  
  91. =head1 DESCRIPTION
  92.  
  93. The GD.Constants plugin provides access to the various GD module's
  94. constants (such as gdBrushed, gdSmallFont, gdTransparent, GD_CMP_IMAGE
  95. etc).  When GD.pm is used in perl it exports various contstants
  96. into the caller's namespace.  This plugin makes those exported
  97. constants available as template variables.
  98.  
  99. See L<Template::Plugin::GD::Image> and L<GD> for further examples and
  100. details.
  101.  
  102. =head1 AUTHOR
  103.  
  104. Craig Barratt E<lt>craig@arraycomm.comE<gt>
  105.  
  106.  
  107. Lincoln D. Stein wrote the GD.pm interface to the GD library.
  108.  
  109.  
  110. =head1 VERSION
  111.  
  112. 1.55, distributed as part of the
  113. Template Toolkit version 2.13, released on 30 January 2004.
  114.  
  115. =head1 COPYRIGHT
  116.  
  117.  
  118. Copyright (C) 2001 Craig Barratt E<lt>craig@arraycomm.comE<gt>
  119.  
  120. The GD.pm interface is copyright 1995-2000, Lincoln D. Stein.
  121.  
  122. This module is free software; you can redistribute it and/or
  123. modify it under the same terms as Perl itself.
  124.  
  125. =head1 SEE ALSO
  126.  
  127. L<Template::Plugin|Template::Plugin>, L<Template::Plugin::GD|Template::Plugin::GD>, L<Template::Plugin::GD::Image|Template::Plugin::GD::Image>, L<Template::Plugin::GD::Polygon|Template::Plugin::GD::Polygon>, L<GD|GD>
  128.  
  129. =cut
  130.  
  131. # Local Variables:
  132. # mode: perl
  133. # perl-indent-level: 4
  134. # indent-tabs-mode: nil
  135. # End:
  136. #
  137. # vim: expandtab shiftwidth=4:
  138.