File: extensions.psw

package info (click to toggle)
gnustep-back 0.32.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,320 kB
  • sloc: objc: 42,426; ansic: 6,623; xml: 258; makefile: 130; sh: 120
file content (105 lines) | stat: -rw-r--r-- 2,657 bytes parent folder | download | duplicates (10)
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
98
99
100
101
102
103
104
105
/*
   general.psw

   Copyright (C) 2000 Free Software Foundation, Inc.

   Author: Adam Fedor <fedor@gnu.org>
   Date: May 2000
   
   This file is part of the GNUstep GUI X/DPS Library.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 3 of the License, or (at your option) any later version.

   This library 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
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; see the file COPYING.LIB.
   If not, see <http://www.gnu.org/licenses/> or write to the 
   Free Software Foundation, 51 Franklin Street, Fifth Floor, 
   Boston, MA 02110-1301, USA.
*/

#include <DPS/dpsclient.h>

defineps DPSWKnownExtensions (DPSContext ctxt | int *extflag)

  0
  systemdict /alphaimage known {1 add} if
  systemdict /composite known {2 add} if
  systemdict /compositerect known {4 add} if
  systemdict /dissolve known {8 add} if
  systemdict /readimage known {16 add} if
  systemdict /setalpha known {32 add} if
  systemdict /flushpage known {64 add} if
  extflag

endps

defineps DPSWWorkingExtensions(DPSContext ctxt | boolean *supported)

  {
    0 0 10 10 null 10 10 2 composite
  } stopped not 
  supported

endps

/* Define our own versions of NeXT extension wrappers since they 
   aren't neccesarily in the DPS library 
*/

defineps PSWalphaimage ()
  alphaimage
endps

defineps PSWcomposite (float x, y, w, h; int gstateNum; float dx, dy; int op)
  x y w h 
  gstateNum dup 0 eq {null} {execuserobject} ifelse
  dx dy op composite
endps

defineps PSWcompositerect (float x, y, w, h; int op)
  x y w h op compositerect
endps

defineps PSWdissolve (float x, y, w, h; int gstateNum; float dx, dy, delta)
  x y w h 
  gstateNum dup 0 eq {null} {execuserobject} ifelse
  dx dy delta dissolve
endps

defineps PSWreadimage ()
  readimage
endps

defineps PSWsetalpha (float alpha)
  alpha setalpha
endps

defineps PSWcurrentalpha (| float *alpha)
  currentalpha alpha
endps

defineps PSWflushpage ()
  flushpage
endps

/* Image helper wrappers */

defineps PSWColorImageHeader(int width, height, bps, spp)
  width height bps
  [width 0 0 height neg 0 height]
  currentfile false spp colorimage
endps

defineps PSWImageHeader(int width, height, bps)
  width height bps
  [width 0 0 height neg 0 height]
  currentfile image
endps