summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-vtex.def
blob: 197a3e14e0a37f7be76b1b5e28fec5e560330e89 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-vtex.def,v 1.4 2005/10/25 08:39:23 tantau Exp $

% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>.
%
% This program can be redistributed and/or modified under the terms
% of the GNU Public License, version 2.




% Driver commands for vtex

% Invoking things:
\def\pgfsys@invoke#1{\special{pS: grestore #1 gsave}} % to protect against things happeing in between
\def\pgfsys@outerinvoke#1{\special{pS: #1}}
\def\pgf@sys@postscript@header#1{\special{pS: #1}}
\def\pgf@sys@postscript@object#1{\special{pS: #1}}


%
% Load common postscript commands:
%
\input pgfsys-common-postscript.def


%
% vtex-specific stuff:
%


% Starting and ending a picture:
\def\pgfsys@beginpicture{\special{pS: 
  save 
    /pgfx currentpoint /pgfy exch def def 
    currentpoint translate 
    gsave}%
  \let\set@color=\pgf@sys@vtex@set@color%
  \let\reset@color=\pgf@sys@vtex@reset@color%
}
\def\pgf@sys@vtex@setcolor#1{%
  \colorlet{pgf@tempcolor}{#1}%
  \@ifundefined{applycolormixins}{}{\applycolormixins{pgf@tempcolor}}%
  \expandafter\expandafter\expandafter\pgf@sys@vtex@@setcolor\csname\string\color@pgf@tempcolor\endcsname%
}
\def\pgf@sys@vtex@@setcolor#1#2#3#4#5{%
  \pgfsysps@color@resetnow%
  \expandafter\ifx\csname pgfsys@color@#4\endcsname\relax%
    \PackageError{pgfbase}{Unsupported color model `#4'. Sorry}{}%
  \else%
    \edef\pgf@colmarshal{\expandafter\noexpand\csname pgfsys@color@#4\endcsname}%
    \pgf@uncomma#5,,%
    \pgf@colmarshal%
  \fi}
\def\pgf@sys@vtex@set@color{\pgf@sys@vtex@setcolor{.}\aftergroup\reset@color}
\def\pgf@sys@vtex@reset@color{\pgf@sys@vtex@setcolor{.}}
\def\pgfsys@endpicture{\special{pS:
    newpath
    grestore
  newpath 
  restore}}

% Graphics:
\def\pgfsys@imagesuffixlist{epsi:eps:ps:pdf}

% Starting and ending a box:
\def\pgfsys@hbox#1{%
  \pgfsys@invoke{save pgfx neg pgfy neg translate}%
      \wd#1=0pt%
      \ht#1=0pt%
      \dp#1=0pt%
      \box#1
  \pgfsys@invoke{restore}%
}

\def\pgfsys@color@unstacked#1{\special{pS: \XC@usecolor{#1}}}

\def\pgfsys@fill@opacity#1{\pgf@sys@fail{opacity}}
\def\pgfsys@stroke@opacity#1{\pgf@sys@fail{opacity}}

\AtBeginDocument{
  % Always present specials.
  \special{pS:
    /pgfsc{} bind def% stroke color is empty by default
    /pgffc{} bind def% fill color is empty by default
    /pgfstr{stroke} bind def%
    /pgffill{fill} bind def%
    /pgfeofill{eofill} bind def%
    /pgfe{moveto dup 0 rlineto exch 0 exch rlineto neg 0 rlineto closepath} bind def% rectangle
    /pgfw{setlinewidth} bind def % setlinewidth
    }
}

\endinput

%%% Local Variables: 
%%% mode: latex
%%% End: