summaryrefslogtreecommitdiff
path: root/xc/unsupported/test/InsPEX/testcases/dispctl/dcinvis.pi
blob: 02740788a0c54bf9a5f17f34b4d2a309a2c8c108 (plain)
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

/* $XConsortium: dcinvis.pi,v 5.3 94/04/17 20:47:48 hersh Exp $ */

/*****************************************************************

Copyright (c) 1989, 1990, 1991,1990  X Consortium

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Except as contained in this notice, the name of the X Consortium shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from the X Consortium.

Copyright (c) 1989, 1990, 1991,1990 by Sun Microsystems, Inc.

                        All Rights Reserved

Permission to use, copy, modify, and distribute this software and its 
documentation for any purpose and without fee is hereby granted, 
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in 
supporting documentation, and that the names of Sun Microsystems,
and the X Consortium, not be used in advertising or publicity 
pertaining to distribution of the software without specific, written 
prior permission.  

SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT 
SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL 
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.

******************************************************************/


## dcinvis.pi -  
## Test requirements:
##   test display update with invisibility filter modification 

source macro.pi
source dcmacro.pi
source xpmacro.pi

tbegintest("dcinvis",
	"display update with invisibility filter modification");

# INITIALIZE: data for a line, and include and exclude filters
line = IA_Ppoint(2, 0.25,0.25, 0.75,0.75);
line3 = IA_Ppoint3(2, 0.25,0.25,0.0, 0.75,0.75,0.0);
pl = I_Ppoint_list(2,line);
exfilt = I_Pint_list(0,NULL);
infilt2 = I_Pint_list(0,NULL);
iarray = IA_Pint(1,1);
infilt1 = I_Pint_list(1,iarray);
nameset = I_Pint_list(1,iarray);
filter1 = I_Pfilter(infilt1,exfilt);
filter2 = I_Pfilter(infilt2,exfilt);

# SETUP: open phigs and a workstation, 
#   set the invisibility filter and add an element to the name set in such a 
#   way to make the following primitives invisible
#   create structure 1, which contains a polyline element, post structure 1

i_open_phigs(NULL,0);
i_open_x_ws(1,&xdisplay,&xwindow,0,0,200,200);
pset_invis_filter(1,&filter1);
popen_struct(1);
padd_names_set(&nameset);
ppolyline(&pl);
pclose_struct();
ppost_struct(1,1,1.0);

#OPERATION: set display update modes to WAIT/UQUM, 
#  change invisibility filter such that invisibility is disabled
pset_disp_upd_st(1,PDEFER_WAIT,PMODE_UQUM);
pset_invis_filter(1,&filter2);

#VERIFICATION: 
dynmod = i_get_ws_dyn_mod(1,"invisibility filter modification");
if (dynmod == PDYN_IRG) # if dynamic modification is IRG

	# verify that visual rep state is PVISUAL_ST_DEFER
	im_confirm_visual_rep(1,PVISUAL_ST_DEFER,
  		"failed: visual rep=%d,expected PVISUAL_ST_DEFER before updatews\n");
	#  Verify that line is invisible 
	status = i_check_line3(xdisplay,xwindow,1,0,line3,5,1);
	im_ifneq(status,0,
		"failed: line is visible before updatews\n",NULL);
endif

if (dynmod == PDYN_CBS) # if dynamic modification is CBS
	# verify that visual rep state is PVISUAL_ST_SIMULATED
	im_confirm_visual_rep(1,PVISUAL_ST_SIMULATED,
  		"failed: visual rep=%d,expected PVISUAL_ST_SIMULATED before updatews\n");
endif

if (dynmod == PDYN_IMM) # if dynamic modification is IMM
	# verify that visual rep state is PVISUAL_ST_CORRECT
	im_confirm_visual_rep(1,PVISUAL_ST_CORRECT,
  		"failed: visual rep=%d,expected PVISUAL_ST_CORRECT before updatews\n");
	#  Verify that line is visible
	im_confirm_line3(xdisplay,xwindow,1,0,line3,5,1,
		"failed: line is invisible before updatews\n",NULL);
endif
tvprintf(2,"before updatews\n");
i_pause();

#OPERATION: update workstation with PERFORM
pupd_ws(1,PFLAG_PERFORM);

#VERIFICATION: 
#verify visual rep state is PVISUAL_ST_CORRECT
im_confirm_visual_rep(1,PVISUAL_ST_CORRECT,
  "failed: visual rep=%d,expected PVISUAL_ST_CORRECT after updatews\n");

#  Verify that line is visible
im_confirm_line3(xdisplay,xwindow,1,0,line3,5,1,
	"failed: line is invisible after updatews\n",NULL);
tvprintf(2,"after updatews\n");
i_pause();

tendtest();