Google
 

Trailing-Edge - PDP-10 Archives - BB-K818A-BM_1981 - sources/boxes.for
There are no other files named boxes.for in the archive.
C  Copyright (C) 1980, by Digital Equipment Corporation, Maynard, Mass.
C operating-system-dependent switches
C  Copyright (C) 1980, by Digital Equipment Corporation, Maynard, Mass.
C 
C 
C   			C O P Y R I G H T
C 
C 
C   		Copyright (C) 1980 by
C   		Digital Equipment Corporation, Maynard, Mass.
C 
C 
C   	This software is furnished under a license and may be used and
C   	copied  only  in accordance with the terms of such license and
C   	with the  inclusion  of  the  above  copyright  notice.   This
C   	software  or  any  other copies thereof may not be provided or
C   	otherwise made available to any other person.  No title to and
C   	ownership of the software is hereby transferred.
C 
C   	The information in this software is subject to change  without
C   	notice  and should not be construed as a commitment by Digital
C   	Equipment Corporation.
C 
C   	DIGITAL assumes no responsibility for the use  or  reliability
C   	of its software on equipment that is not supplied by DIGITAL.
C 
C 	define char byte
C  27+128
C  w(riting) opt(ion)s come groups of 8:
C 	(1) replace(0)/erase(1)/complement(2)/overlay(3)
C 	(2) negative image 0/1
C 	(3) pattern  < 256	bit mask (e.g. 192 = P11000000)
C 		    >= 256	canned pattern * 256 (e.g. 512 = P2)
C 				if value >= 256, low 8 bits are ignored
C 	(4) pattern multiplier, different from 6(?)
C 	(5) shading flag, sim pattern+ >= 10 use char
C 	(6) if shading != 0 this is y reference val
C 	(7) pixel multiplier, 1 <= value <= 10
C 	(8) alternating 0/1
C 	(9) foreground intensity, 0 <= value <= 7
C 	(10) background intensity, 0 <= value <= 7
C 
C   offsets from gwopsp...
C   Inktypes...
C   Inkolors...
C Text options
C 	RSTSONLY	define Maxgels 1000	# due to limited RAM on RSTS
C   drawing primitive gels...
C   attribute/marker/other gels...
C   writing attribute gels : Woptbase + wopindex
C   similarly topts...
C maximum # of characters in a filespec
C maximum # of characters in a command line
C max length of prompt buffer
C max number of characters in file record
C size of record buffers (Fbufsz + 1)
C 	include logdef
C ========================================================================
C ========================================================================
      integer function boxes ( wrtopt , prmt )
      integer curdx , curdy , smalld , larged
      integer scf , lorng , hirng
      integer cname ( 75 )
      common / keypad / curdx , curdy , smalld , larged , scf , lorng , 
     *hirng , cname
      integer wrtopt ( 10 )
      integer prmt ( 1 )
      integer x1 , y1 , wid , hgt , pf
      common / cboxes / x1 , y1 , wid , hgt , pf
      integer enterd
      integer attrw , helper
C  pf (control) point flag - points labeled cw from ul
      integer boxf
      integer cx , cy
      integer inch , key , c
      integer adjust
      integer redef
C string boxid box
C string boxhlp box
      integer boxid ( 4 )
      integer boxhlp ( 4 )
      data boxid ( 1 ) , boxid ( 2 ) , boxid ( 3 ) , boxid ( 4 ) / 98 , 
     *111 , 120 , 0 /
      data boxhlp ( 1 ) , boxhlp ( 2 ) , boxhlp ( 3 ) , boxhlp ( 4 ) / 9
     *8 , 111 , 120 , 0 /
      boxf = 1
      enterd = 0
      call pushxo
      redef = 1
      call prompt ( prmt , boxid )
      continue
23000 if(.not.( boxf .ne. 0 ))goto 23001
      if(.not.( redef .ne. 0 ))goto 23002
      call defmac ( 79 )
      call drwbox ( x1 , y1 , wid , hgt )
      call fedmac ( 79 )
      redef = 0
23002 continue
      if(.not.( pf .eq. 0 .or. pf .eq. 3 ))goto 23004
      cx = x1
      goto 23005
23004 continue
      cx = x1 + wid
23005 continue
      if(.not.( pf .eq. 0 .or. pf .eq. 1 ))goto 23006
      cy = y1
      goto 23007
23006 continue
      cy = y1 + hgt
23007 continue
      call positn ( cx , cy )
      key = inch ( c )
      if(.not.( key .ge. 256 .and. key .le. 267 ))goto 23008
      call usemac ( 79 )
      if(.not.( pf .eq. 0 .or. pf .eq. 2 ))goto 23010
C   ...dragging
      x1 = x1 + curdx
      y1 = y1 + curdy
      goto 23011
23010 continue
      if(.not.( pf .eq. 1 ))goto 23012
C   ...then ur corner
      wid = wid + curdx
      if(.not.( wid .lt. 0 ))goto 23014
      wid = 1
23014 continue
      y1 = y1 + curdy
      hgt = hgt - curdy
      if(.not.( hgt .lt. 0 ))goto 23016
      hgt = 1
23016 continue
      goto 23013
23012 continue
      if(.not.( pf .eq. 3 ))goto 23018
C   ...then ll corner
      hgt = hgt + curdy
      if(.not.( hgt .lt. 0 ))goto 23020
      hgt = 1
23020 continue
      x1 = x1 + curdx
      wid = wid - curdx
      if(.not.( wid .lt. 0 ))goto 23022
      wid = 1
23022 continue
23018 continue
23013 continue
23011 continue
      call clip ( x1 , y1 )
      redef = 1
      goto 23009
23008 continue
      if(.not.( key .eq. 269 .or. key .eq. 270 ))goto 23024
C   adjust width...
      adjust = 5
      if(.not.( key .eq. 269 ))goto 23026
      adjust = - 5
23026 continue
      wid = wid + adjust
      if(.not.( pf .eq. 1 .or. pf .eq. 2 ))goto 23028
      x1 = x1 - adjust
23028 continue
      call usemac ( 79 )
      redef = 1
      goto 23025
23024 continue
      if(.not.( key .eq. 271 .or. key .eq. 272 ))goto 23030
C   adjust height...
      adjust = 5
      if(.not.( key .eq. 271 ))goto 23032
      adjust = - 5
23032 continue
      hgt = hgt + adjust
      if(.not.( pf .eq. 2 .or. pf .eq. 3 ))goto 23034
      y1 = y1 - adjust
23034 continue
      call usemac ( 79 )
      redef = 1
      goto 23031
23030 continue
      if(.not.( key .eq. 274 ))goto 23036
      pf = pf + 1
      if(.not.( pf .gt. 3 ))goto 23038
      pf = 0
23038 continue
      goto 23037
23036 continue
      if(.not.( key .eq. 276 ))goto 23040
      pf = pf - 1
      if(.not.( pf .lt. 0 ))goto 23042
      pf = 3
23042 continue
      goto 23041
23040 continue
      if(.not.( key .eq. 273 ))goto 23044
      enterd = enterd + attrw ( wrtopt )
      goto 23045
23044 continue
      if(.not.( key .eq. 268 ))goto 23046
      boxf = 0
      enterd = 1
      goto 23047
23046 continue
      if(.not.( key .eq. 277 ))goto 23048
      if(.not.( helper ( boxhlp ) .eq. ( - 1 ) ))goto 23050
      boxf = 0
23050 continue
      goto 23049
23048 continue
      if(.not.( key .eq. 271 .or. key .eq. 270 .or. key .eq. 269 .or. ke
     *y .eq. 275 .or.  key .eq. 273 .or. key .eq. 277 .or. key .eq. 272 
     *))goto 23052
      goto 23053
23052 continue
      boxf = 0
23053 continue
23049 continue
23047 continue
23045 continue
23041 continue
23037 continue
23031 continue
23025 continue
23009 continue
      goto 23000
23001 continue
      call usemac ( 79 )
      call usemac ( 80 )
      call popwo
      boxes = enterd
      if(.not.( enterd .eq. 0 ))goto 23054
      return
23054 continue
      if(.not.( wrtopt ( 5 ) .ne. 0 ))goto 23056
      wrtopt ( 6 ) = y1
23056 continue
      call pushwo ( wrtopt )
      call drwbox ( x1 , y1 , wid , hgt )
      call popwo
      return
      end