summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvips.def
blob: 75e0a857445335e81d21a9e1a87d44727b4a15a7 (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
\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-dvips.def,v 1.10 2005/10/25 08:18:14 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 dvips

\def\pgfsys@invoke#1{\special{ps:: #1}}
\def\pgfsys@outerinvoke#1{\special{ps: #1}}
\def\pgf@sys@postscript@header#1{\special{! #1}}
\def\pgf@sys@postscript@object#1{\special{! #1}}


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


%
% dvips-specific stuff:
%

\def\pgfsys@beginpicture{\special{ps: }\special{ps::[begin]}\pgfsys@invoke{pgfo}}
\def\pgfsys@endpicture{\pgfsys@invoke{pgfc}\special{ps::[end]}}
\def\pgfsys@hbox#1{%
  \pgfsys@invoke{pgfs}%
    \special{ps::[end]}%
      \wd#1=0pt%
      \ht#1=0pt%
      \dp#1=0pt%
      \box#1
    \special{ps::[begin]}%
  \pgfsys@invoke{pgfr}%
}
\def\pgfsys@begininvisible{%
  \special{ps::[begin]}%
  \pgfsys@invoke{gsave nulldevice}%
  \special{ps::[end]}}
\def\pgfsys@endinvisible{%
  \special{ps::[begin]}%
  \pgfsys@invoke{grestore}%
  \special{ps::[end]}%
}
\def\pgfsys@color@unstacked#1{\special{ps: \XC@usecolor{#1}}}
\def\pgfsys@imagesuffixlist{epsi:eps:ps}

\AtBeginDocument{
  % Always present specials.
  \special{!
    /pgfsc{}B% stroke color is empty by default
    /pgffc{}B% fill color is empty by default
    /pgfstr{stroke}B%
    /pgffill{fill}B%
    /pgfeofill{eofill}B%
    /pgfe{a dup 0 rlineto exch 0 exch rlineto neg 0 rlineto closepath}B% rectangle
    /pgfw{setlinewidth}B% setlinewidth
    /pgfs{save pgfpd 72 Resolution div 72 VResolution div neg scale 
      magscale{1 DVImag div dup scale}if 
      pgfx neg pgfy neg translate pgffoa .setopacityalpha}B% save
    /pgfr{pgfsd restore}B %restore
    userdict begin%
    /pgfo{pgfsd /pgfx currentpoint /pgfy exch def def @beginspecial}B %open
    /pgfc{newpath @endspecial pgfpd}B %close
    /pgfsd{globaldict /pgfdelta /delta where {pop delta} {0} ifelse put}B% save delta
    /pgfpd{/delta globaldict /pgfdelta get def}B % put delta
    /.setopacityalpha where {pop} {/.setopacityalpha{pop}def} ifelse % install .setopacityalpha 
    /.pgfsetfillopacityalpha{/pgffoa exch def
      /pgffill{gsave pgffoa .setopacityalpha fill 1 .setopacityalpha newpath fill grestore}B
      /pgfeofill{gsave pgffoa .setopacityalpha eofill1 .setopacityalpha newpath eofill grestore}B}B
    /.pgfsetstrokeopacityalpha{/pgfsoa exch def
      /pgfstr{gsave pgfsoa .setopacityalpha stroke grestore}B}B
    /pgffoa 1 def
    /pgfsoa 1 def
    end
    }
}

\endinput

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