1 package LaTeX::TikZ::Interface;
8 LaTeX::TikZ::Interface - LaTeX::TikZ public interface register and loader.
16 our $VERSION = '0.01';
22 =head2 C<< register $keyword => $code >>
24 Registers C<$code> to be available with C<< Tikz->$keyword >>.
32 my ($name, $code) = splice @_, 0, 2;
34 unless (defined $name and $name =~ /^[a-z_][a-z0-9_]+$/i) {
36 Carp::confess('Invalid interface name');
39 if (do { no strict 'refs'; defined &{__PACKAGE__."::$name"} }) {
41 Carp::confess("'$name' is already defined in the interface");
44 unless (defined $code and ref $code eq 'CODE') {
46 Carp::confess('Invalid code reference');
49 Sub::Name::subname($name => $code);
53 *{__PACKAGE__.'::'.$name} = $code;
62 Load all the modules of the L<LaTeX::TikZ> official suite that register a keyword in the interface.
67 require LaTeX::TikZ::Formatter; # formatter
68 require LaTeX::TikZ::Functor; # functor
70 require LaTeX::TikZ::Set::Raw; # raw
72 require LaTeX::TikZ::Set::Path; # path
73 require LaTeX::TikZ::Set::Sequence; # seq
75 require LaTeX::TikZ::Set::Point; # point
76 require LaTeX::TikZ::Set::Line; # line
77 require LaTeX::TikZ::Set::Polyline; # polyline, closed_polyline
78 require LaTeX::TikZ::Set::Rectangle; # rectangle
79 require LaTeX::TikZ::Set::Circle; # circle
80 require LaTeX::TikZ::Set::Arc; # arc
81 require LaTeX::TikZ::Set::Arrow; # arrow
83 require LaTeX::TikZ::Mod::Raw; # raw_mod
85 require LaTeX::TikZ::Mod::Clip; # clip
86 require LaTeX::TikZ::Mod::Layer; # layer
88 require LaTeX::TikZ::Mod::Width; # width
89 require LaTeX::TikZ::Mod::Color; # color
90 require LaTeX::TikZ::Mod::Fill; # fill
91 require LaTeX::TikZ::Mod::Pattern; # pattern
100 Vincent Pit, C<< <perl at profvince.com> >>, L<http://www.profvince.com>.
102 You can contact me by mail or on C<irc.perl.org> (vincent).
106 Please report any bugs or feature requests to C<bug-latex-tikz at rt.cpan.org>, or through the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=LaTeX-TikZ>.
107 I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
111 You can find documentation for this module with the perldoc command.
115 =head1 COPYRIGHT & LICENSE
117 Copyright 2010 Vincent Pit, all rights reserved.
119 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
123 1; # End of LaTeX::TikZ::Interface