This file is indexed.

/usr/share/axiom-20170501/src/algebra/VIEWDEF.spad is in axiom-source 20170501-3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
)abbrev package VIEWDEF ViewDefaultsPackage
++ Author: Jim Wen
++ Date Created: 15 January 1990
++ Date Last Updated:
++ Description: 
++ ViewportDefaultsPackage describes default and user definable 
++ values for graphics

ViewDefaultsPackage() : SIG == CODE where

  I       ==> Integer
  C       ==> Color
  PAL     ==> Palette
  L       ==> List
  S       ==> String
  E       ==> Expression
  PI      ==> PositiveInteger
  NNI     ==> NonNegativeInteger
  SF      ==> DoubleFloat
  B       ==> Boolean

  writeAvailable ==>  (["PIXMAP","BITMAP","POSTSCRIPT","IMAGE"]::L S)
    -- need not worry about case of letters

  SIG ==> with

    pointColorDefault : () -> PAL
      ++ pointColorDefault() returns the default color of points in a 2D 
      ++ viewport.

    pointColorDefault : PAL -> PAL
      ++ pointColorDefault(p) sets the default color of points in a 2D viewport
      ++ to the palette p.

    lineColorDefault : () -> PAL
      ++ lineColorDefault() returns the default color of lines connecting 
      ++ points in a 2D viewport.

    lineColorDefault : PAL -> PAL
      ++ lineColorDefault(p) sets the default color of lines connecting points
      ++ in a 2D viewport to the palette p.

    axesColorDefault : () -> PAL
      ++ axesColorDefault() returns the default color of the axes in a 
      ++ 2D viewport.

    axesColorDefault : PAL -> PAL
      ++ axesColorDefault(p) sets the default color of the axes in a 2D 
      ++ viewport to the palette p.

    unitsColorDefault : () -> PAL
      ++ unitsColorDefault() returns the default color of the unit ticks in 
      ++ a 2D viewport.

    unitsColorDefault : PAL -> PAL
      ++ unitsColorDefault(p) sets the default color of the unit ticks in 
      ++ a 2D viewport to the palette p.

    pointSizeDefault : () -> PI
      ++ pointSizeDefault() returns the default size of the points in 
      ++ a 2D viewport.

    pointSizeDefault : PI -> PI
      ++ pointSizeDefault(i) sets the default size of the points in a 2D 
      ++ viewport to i.

    viewPosDefault : () -> L NNI
      ++ viewPosDefault() returns the default x and y position of a
      ++ viewport window unless overriden explicityly, newly created
      ++ viewports will have this x and y coordinate.

    viewPosDefault : L NNI -> L NNI
      ++ viewPosDefault([x,y]) sets the default x and y position of a
      ++ viewport window unless overriden explicityly, newly created
      ++ viewports will have the x and y coordinates x, y.

    viewSizeDefault : () -> L PI
      ++ viewSizeDefault() returns the default viewport width and height.

    viewSizeDefault : L PI -> L PI
      ++ viewSizeDefault([w,h]) sets the default viewport width to w and height
      ++ to h.

    viewDefaults : () -> Void
      ++ viewDefaults() resets all the default graphics settings.

    viewWriteDefault : () -> L S
      ++ viewWriteDefault() returns the list of things to write in a viewport
      ++ data file; a viewalone file is always generated.

    viewWriteDefault : L S -> L S
      ++ viewWriteDefault(l) sets the default list of things to write in a 
      ++ viewport data file to the strings in l; a viewalone file is always 
      ++ genereated.

    viewWriteAvailable : () -> L S
      ++ viewWriteAvailable() returns a list of available methods for writing,
      ++ such as BITMAP, POSTSCRIPT, etc.

    var1StepsDefault : () -> PI
      ++ var1StepsDefault() is the current setting for the number of steps to 
      ++ take when creating a 3D mesh in the direction of the first defined 
      ++ free variable (a free variable is considered defined when its 
      ++ range is specified (for example, x=0..10)).

    var2StepsDefault : () -> PI
      ++ var2StepsDefault() is the current setting for the number of steps to 
      ++ take when creating a 3D mesh in the direction of the first defined 
      ++ free variable (a free variable is considered defined when its 
      ++ range is specified (for example, x=0..10)).

    var1StepsDefault : PI -> PI
      ++ var1StepsDefault(i) sets the number of steps to take when creating a 
      ++ 3D mesh in the direction of the first defined free variable to i
      ++ (a free variable is considered defined when its range is specified 
      ++ (for example, x=0..10)).

    var2StepsDefault : PI -> PI
      ++ var2StepsDefault(i) sets the number of steps to take when creating a 
      ++ 3D mesh in the direction of the first defined free variable to i
      ++ (a free variable is considered defined when its range is specified 
      ++ (for example, x=0..10)).

    tubePointsDefault : PI -> PI
      ++ tubePointsDefault(i) sets the number of points to use when creating 
      ++ the circle to be used in creating a 3D tube plot to i.

    tubePointsDefault : () -> PI
      ++ tubePointsDefault() returns the number of points to be used when 
      ++ creating the circle to be used in creating a 3D tube plot.

    tubeRadiusDefault : Float -> SF   -- current tube.spad asks for SF
      ++ tubeRadiusDefault(r) sets the default radius for a 3D tube plot to r.

    tubeRadiusDefault : () -> SF
      ++ tubeRadiusDefault() returns the radius used for a 3D tube plot.

  CODE ==> add

    import Color()
    import Palette()
    --import StringManipulations()

    defaultPointColor : Reference(PAL)  := ref bright red()
    defaultLineColor  : Reference(PAL)  := ref pastel green() --bright blue()
    defaultAxesColor  : Reference(PAL)  := ref dim red()
    defaultUnitsColor : Reference(PAL)  := ref dim yellow()
    defaultPointSize  : Reference(PI)   := ref(3::PI)
    defaultXPos       : Reference(NNI)  := ref(0::NNI)
    defaultYPos       : Reference(NNI)  := ref(0::NNI)
    defaultWidth      : Reference(PI)   := ref(400::PI)
    defaultHeight     : Reference(PI)   := ref(400::PI)
    defaultThingsToWrite : Reference(L S) := ref([]::L S)
    defaultVar1Steps  : Reference(PI)   := ref(27::PI)
    defaultVar2Steps  : Reference(PI)   := ref(27::PI)
    defaultTubePoints : Reference(PI)   := ref(6::PI)
    defaultTubeRadius : Reference(SF)   := ref(convert(0.5)@SF)
    defaultClosed     : Reference(B)    := ref(false)

--%Viewport window dimensions specifications
    viewPosDefault   == [defaultXPos(),defaultYPos()]

    viewPosDefault l ==
      #l < 2 => error "viewPosDefault expects a list with two elements"
      [defaultXPos() := first l,defaultYPos() := last l]

    viewSizeDefault   == [defaultWidth(),defaultHeight()]

    viewSizeDefault l ==
      #l < 2 => error "viewSizeDefault expects a list with two elements"
      [defaultWidth() := first l,defaultHeight() := last l]

    viewDefaults ==
      defaultPointColor : Reference(PAL)  := ref bright red()
      defaultLineColor  : Reference(PAL)  := ref pastel green() --bright blue()
      defaultAxesColor  : Reference(PAL)  := ref dim red()
      defaultUnitsColor : Reference(PAL)  := ref dim yellow()
      defaultPointSize  : Reference(PI)   := ref(3::PI)
      defaultXPos       : Reference(NNI)  := ref(0::NNI)
      defaultYPos       : Reference(NNI)  := ref(0::NNI)
      defaultWidth      : Reference(PI)   := ref(400::PI)
      defaultHeight     : Reference(PI)   := ref(427::PI)

--%2D graphical output specifications
    pointColorDefault   == defaultPointColor()

    pointColorDefault p == defaultPointColor() := p

    lineColorDefault   == defaultLineColor()

    lineColorDefault p == defaultLineColor() := p

    axesColorDefault   == defaultAxesColor()

    axesColorDefault p == defaultAxesColor() := p

    unitsColorDefault   == defaultUnitsColor()

    unitsColorDefault p == defaultUnitsColor() := p

    pointSizeDefault   == defaultPointSize()

    pointSizeDefault x == defaultPointSize() := x


--%3D specific stuff
    var1StepsDefault   == defaultVar1Steps()

    var1StepsDefault i == defaultVar1Steps() := i

    var2StepsDefault   == defaultVar2Steps()

    var2StepsDefault i == defaultVar2Steps() := i

    tubePointsDefault   == defaultTubePoints()

    tubePointsDefault i == defaultTubePoints() := i

    tubeRadiusDefault   == defaultTubeRadius()

    tubeRadiusDefault f == defaultTubeRadius() := convert(f)@SF

--%File output stuff
    viewWriteAvailable == writeAvailable

    viewWriteDefault == defaultThingsToWrite()

    viewWriteDefault listOfThings ==
      thingsToWrite : L S := []
      for aTypeOfFile in listOfThings repeat
        if (writeTypeInt := _
            position(upperCase aTypeOfFile,viewWriteAvailable())) < 0 then
          sayBrightly(["  > ",concat(aTypeOfFile,
                     " is not a valid file type for writing a viewport")])$Lisp
        else
          thingsToWrite := append(thingsToWrite,[aTypeOfFile])
      defaultThingsToWrite() := thingsToWrite