# $Id$ # Captive project doc macros. # Copyright (C) 2003-2005 Jan Kratochvil # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; exactly version 2 of June 1991 is required # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA package project::captive::doc::Macros; require 5.6.0; # at least 'use warnings;' but we need some 5.6.0+ modules anyway our $VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; }; our $CVS_ID=q$Id$; use strict; use warnings; use Exporter; our @EXPORT=qw( &doc_img &productname &captive_srcfile $freespeech $freebeer $Wine $ReactOS $LinuxNTFS $GnomeVFS $GnomeVFSmodule $gnulinux ); our @ISA=qw(Exporter); use My::Web; Wrequire 'project::Lib'; our $HTML_TEST=0; sub navigate ($;$) { my($class,$where)=@_; print ''."\n"; # FIXME: print ''."\n" for (qw(10 20 40 20 10)); # causes whole invisible icons in: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/20050719 Galeon/1.3.21 print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n"; print '
'; print img "/My/arrow-left" ,"Previous document","a_href"=>$My::Web::W->{"rel_prev"} if $My::Web::W->{"rel_prev"}; print ''; print img "/My/arrow-up" ,"Parent","a_href"=>$My::Web::W->{"rel_up"} if $My::Web::W->{"rel_up"} && !($where && $where eq "footer"); print ''; print img "/My/arrow-right","Next document","a_href"=>$My::Web::W->{"rel_next"} if $My::Web::W->{"rel_next"}; print '
'."\n"; } sub doc_img ($$) { my($img_base,$caption)=@_; my $r=""; $r.=''."\n"; $r.="\t\n"; $r.="\t".'\n"; $r.='
$caption
'.img($img_base,$caption)."
'."\n"; $r.=vskip "2ex"; return $r; } sub captive_srcfile ($;$) { my($filename,$text)=@_; a_href 'http://cvs.jankratochvil.net/viewcvs/*checkout*/captive/'.$filename.'?rev=HEAD&content-type=text/plain', ($text || $filename); } sub productname { my($url,$name)=@_; return ''.a_href($url,escapeHTML($name)).''; } our($Wine,$ReactOS,$LinuxNTFS,$GnomeVFS,$GnomeVFSmodule,$gnulinux,$freespeech,$freebeer); sub _footer { print vskip "2ex"; project::captive::doc::Macros->navigate("footer"); } sub init ($%) { my($class,%args)=@_; My::Web->init( "css_push"=>"./Macros.css", "heading_novskip"=>1, "rel_start"=>"..", # possibly overridable "rel_up"=>".", # possibly overridable "footing_delimit_sub_push"=>\&_footer, "__PACKAGE__"=>caller(), # possibly overridable %args, ); $Wine=productname 'http://www.winehq.com/','Wine'; $ReactOS=productname 'http://www.reactos.com/','ReactOS'; $LinuxNTFS=productname 'http://linux-ntfs.sourceforge.net/','Linux NTFS'; $GnomeVFS=productname 'http://developer.gnome.org/doc/API/gnome-vfs/','Gnome-VFS'; $GnomeVFSmodule=productname 'http://developer.gnome.org/doc/API/gnome-vfs/modules.html','Gnome-VFS-module'; $gnulinux='GNU/Linux'; $freespeech=a_href 'http://www.gnu.org/philosophy/free-sw.html','Free'; $freebeer=a_href 'http://www.gnu.org/philosophy/free-sw.html','free (as in beer)'; My::Web->heading(); print(project::Lib->section("captive")); $class->navigate(); } 1;