Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
/hilight-color-alpha 0.6 def
2
 
3
/border-create {
4
  <<
5
    /left <<
6
      /width 2 px
7
      /color 0 0 0 0 color-create
8
      /style /none
9
    >>
10
 
11
    /right <<
12
      /width 2 px
13
      /color 0 0 0 0 color-create
14
      /style /none
15
    >>
16
 
17
    /top <<
18
      /width 2 px
19
      /color 0 0 0 0 color-create
20
      /style /none
21
    >>
22
 
23
    /bottom <<
24
      /width 2 px
25
      /color 0 0 0 0 color-create
26
      /style /none
27
    >>
28
  >>
29
} def
30
 
31
/border-show {                     % => Box Viewport Border
32
  exch pop                         % => Box Border
33
 
34
% LEFT
35
  dup /left get /width get 0 gt
36
  1 index /left get /style get /none ne
37
  and
38
  {
39
    dup /left get /style get
40
    true
41
    2  index /left get /color get
42
    3  index /left get /width get
43
    5  index get-left-border
44
    6  index get-bottom-border
45
    7  index get-left-border
46
    8  index get-top-border
47
    9  index get-left-border    9 index /left get /width get add
48
    10 index get-top-border    10 index /top get /width get sub
49
    11 index get-left-border   11 index /left get /width get add
50
    12 index get-bottom-border 12 index /bottom get /width get add
51
    edge-show
52
  } if
53
 
54
% RIGHT
55
  dup /right get /width get 0 gt
56
  1 index /right get /style get /none ne
57
  and
58
  {
59
    dup /right get /style get
60
    false
61
    2  index /right get /color get
62
    3  index /right get /width get
63
    5  index get-right-border
64
    6  index get-bottom-border
65
    7  index get-right-border
66
    8  index get-top-border
67
    9  index get-right-border   9 index /right get /width get sub
68
    10 index get-top-border    10 index /top get /width get sub
69
    11 index get-right-border  11 index /right get /width get sub
70
    12 index get-bottom-border 12 index /bottom get /width get add
71
    edge-show
72
  } if
73
 
74
% TOP
75
  dup /top get /width get 0 gt
76
  1 index /top get /style get /none ne
77
  and
78
  {
79
    dup /top get /style get
80
    true
81
    2  index /top get /color get
82
    3  index /top get /width get
83
    5  index get-left-border
84
    6  index get-top-border
85
    7  index get-right-border
86
    8  index get-top-border
87
    9  index get-right-border   9 index /right get /width get sub
88
    10 index get-top-border    10 index /top get /width get sub
89
    11 index get-left-border   11 index /left get /width get add
90
    12 index get-top-border    12 index /top get /width get sub
91
    edge-show
92
  } if
93
 
94
% BOTTOM
95
  dup /bottom get /width get 0 gt
96
  1 index /bottom get /style get /none ne
97
  and
98
  {
99
    dup /bottom get /style get
100
    false
101
    2  index /bottom get /color get
102
    3  index /bottom get /width get
103
    5  index get-left-border
104
    6  index get-bottom-border
105
    7  index get-right-border
106
    8  index get-bottom-border
107
    9  index get-right-border   9 index /right get /width get sub
108
    10 index get-bottom-border 10 index /bottom get /width get add
109
    11 index get-left-border   11 index /left get /width get add
110
    12 index get-bottom-border 12 index /bottom get /width get add
111
    edge-show
112
  } if
113
 
114
  pop pop
115
} def
116
 
117
/edge-get-width {                  % => Edge
118
  dup /style get /none eq {
119
    pop 0
120
  } {
121
    /width get
122
  } ifelse
123
} def
124
 
125
/edge-show {
126
% If this border have 'transparent' color value, we just will not draw it
127
  9 index color-is-transparent {
128
    pop pop pop
129
    pop
130
    pop pop pop pop pop pop pop pop
131
  } {
132
    edge-show-in
133
  } ifelse
134
} def
135
 
136
/edge-show-in {                       % => Style HI Color Width X1 Y1 X2 Y2 X3 Y3 X4 Y4
137
  newpath
138
  11 index /dashed eq {
139
    9 index color-apply
140
    8 index 4 mul 1 array astore 0 setdash
141
    8 index setlinewidth
142
 
143
    7 index 2 index add 2 div
144
    7 index 2 index add 2 div
145
    moveto
146
 
147
    5 index 4 index add 2 div
148
    5 index 4 index add 2 div
149
    lineto
150
 
151
    stroke
152
 
153
    [] 0 setdash
154
  } if
155
 
156
  11 index /dotted eq {
157
    9 index color-apply
158
    8 index 1 array astore 0 setdash
159
    8 index setlinewidth
160
 
161
    7 index 2 index add 2 div
162
    7 index 2 index add 2 div
163
    moveto
164
 
165
    5 index 4 index add 2 div
166
    5 index 4 index add 2 div
167
    lineto
168
 
169
    stroke
170
 
171
    [] 0 setdash
172
  } if
173
 
174
  11 index /solid eq {
175
    9 index color-apply
176
 
177
    7 index 7 index moveto
178
    5 index 5 index lineto
179
    3 index 3 index lineto
180
    1 index 1 index lineto
181
    closepath
182
    fill
183
  } if
184
 
185
  11 index /double eq {
186
    9 index color-apply
187
    1 px setlinewidth
188
 
189
    7 index 7 index moveto
190
    5 index 5 index lineto
191
    stroke
192
 
193
    3 index 3 index moveto
194
    1 index 1 index lineto
195
    stroke
196
  } if
197
 
198
  11 index /inset eq {
199
    10 index {
200
      9 index color-apply
201
    } {
202
      9 index
203
      [1.0 1.0 1.0 1.0] hilight-color-alpha color-blend
204
      color-apply
205
    } ifelse
206
 
207
    7 index 7 index moveto
208
    5 index 5 index lineto
209
    3 index 3 index lineto
210
    1 index 1 index lineto
211
    closepath
212
    fill
213
  } if
214
 
215
  11 index /outset eq {
216
    10 index not {
217
      9 index color-apply
218
    } {
219
      9 index
220
      [1.0 1.0 1.0 1.0] hilight-color-alpha color-blend
221
      color-apply
222
    } ifelse
223
 
224
    7 index 7 index moveto
225
    5 index 5 index lineto
226
    3 index 3 index lineto
227
    1 index 1 index lineto
228
    closepath
229
    fill
230
  } if
231
 
232
  11 index /groove eq {
233
    9 index
234
    [1.0 1.0 1.0 1.0] hilight-color-alpha color-blend
235
    color-apply
236
 
237
    7 index 7 index moveto
238
    5 index 5 index lineto
239
    3 index 3 index lineto
240
    1 index 1 index lineto
241
    closepath
242
    fill
243
 
244
    9 index aload pop
245
    setrgbcolor
246
 
247
    1 px setlinewidth
248
 
249
    10 index {
250
      7 index 7 index moveto
251
      5 index 5 index lineto
252
      stroke
253
    } {
254
      3 index 3 index moveto
255
      1 index 1 index lineto
256
      stroke
257
    } ifelse
258
  } if
259
 
260
  11 index /ridge eq {
261
    9 index aload pop
262
    setrgbcolor
263
 
264
    7 index 7 index moveto
265
    5 index 5 index lineto
266
    3 index 3 index lineto
267
    1 index 1 index lineto
268
    closepath
269
    fill
270
 
271
    9 index aload pop
272
    [1.0 1.0 1.0 1.0] hilight-color-alpha color-blend
273
    color-apply
274
 
275
    1 px setlinewidth
276
 
277
    10 index {
278
      7 index 7 index moveto
279
      5 index 5 index lineto
280
      stroke
281
    } {
282
      3 index 3 index moveto
283
      1 index 1 index lineto
284
      stroke
285
    } ifelse
286
  } if
287
 
288
  pop pop pop pop pop
289
  pop pop pop pop pop
290
  pop pop
291
} def