aboutsummaryrefslogtreecommitdiff
path: root/sys/gio/stdgraph/stgescape.x
blob: b52ffd0c87207c8152b0c7009063798848f52212 (plain) (blame)
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
# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.

# STGESCAPE.X -- Stdgraph kernel escape handing code.  This is the interface
# between the stdgraph kernel and any supported escape packages.  These driver
# routines return TRUE if they recognize the escape and it is private to the
# package, FALSE if the other escape packages may also be interested in the
# routine.
#
#	stg_escape		standard GKI escape entry point
#
#	sge_wstran		transform and output escape
#	sge_spoolesc		process and escape into frame buffer	
#
# To add support for a new package of escapes, and entry for the driver routine
# for each family of escapes must be added to each of these procedures.


# STG_ESCAPE -- Pass a device dependent instruction on to the kernel.  
# The stdgraph kernel does not have any escape functions at present.

procedure stg_escape (fn, instruction, nwords)

int	fn			#I function code
short	instruction[ARB]	#I instruction data words
int	nwords			#I length of instruction

bool	sgm_execute()		# GIM (Gterm) imaging excapes

begin
	if (sgm_execute (fn, instruction, nwords))
	    return
end


# SGE_WSTRAN -- Stdgraph escape handling routine called by an interactive
# client (e.g the CL in cursor mode) to apply the workstation transformation
# to a escape and execute the escape.  This routine is called for all
# escapes regardless of whether any transformation is necessary, leaving
# it up to the escape code to decide what to do.

procedure sge_wstran (fn, instruction, x1,y1, x2,y2)

int	fn			#I escape sequence function opcode
short	instruction[ARB]	#I escape instruction data
real	x1, y1			#I NDC coords of display rect
real	x2, y2			#I NDC coords of display rect

bool	sgm_wstran()		# GIM (Gterm) imaging excapes

begin
	if (sgm_wstran (fn, instruction, x1,y1, x2,y2))
	    return
end


# SGE_WSENABLE -- Stdgraph escape handling routine called by an
# interactive client (e.g the CL in cursor mode) to test whether cursor mode
# scaling of graphics instructions is enabled when cursor mode zoom/pan is
# done.  Cursor mode scaling may be disabled if the kernel or graphics device
# does the scaling itself.

bool procedure sge_wsenable ()

bool	enable
bool	sgm_wsenable()

begin
	if (sgm_wsenable (enable))
	    return (enable)
end


# SGE_SPOOLESC -- Stdgraph escape handling routine called by an interactive
# client (e.g the CL in cursor mode) to retain, delete, or edit an escape
# instruction stored in a frame buffer.  Ordinary drawing instructions are
# normally retained.  If the instruction should only be executed when issued
# it should be deleted.  Sometimes an instruction is edited or replaced by
# a different one to be executed the next time the buffered graphics is drawn.
# Sometimes when an instruction is seen earlier instructions must be edited
# or deleted.  This routine is called for all escapes, it is up to the escape
# code to decide what to do.  The delete instruction callback is called as
# delete_fcn(tr,gki) to delete the instruction pointed to by GKI.

procedure sge_spoolesc (tr, gki, fn, instruction, bp, buftop, delete_fcn)

pointer	tr			#I arg to delete_fcn
pointer	gki			#I pointer to escape instruction
int	fn			#U escape sequence function opcode
short	instruction[ARB]	#U escape instruction data
pointer	bp			#I frame buffer pointer
pointer	buftop			#I top+1 of buffered data
int	delete_fcn		#I function called to delete an instruction

bool	sgm_spoolesc()		# GIM (Gterm) imaging excapes

begin
	if (sgm_spoolesc (tr, gki, fn, instruction, bp, buftop, delete_fcn))
	    return
end