/* $XConsortium: updatews.pi,v 5.3 94/04/17 20:47:51 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. ******************************************************************/ ## updatews.pi - ## Test requirements: ## test update workstation with regeneration flags POSTPONE and PERFORM source macro.pi source dcmacro.pi source xpmacro.pi tbegintest("updatews","update workstation with structure content modification"); # INITIALIZE: data for a line, ws window 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); # SETUP: open phigs and a workstation, open a structure i_open_phigs(NULL,0); i_open_x_ws(1,&xdisplay,&xwindow,0,0,200,200); dynmod = i_get_struct_dyn_mod(1,"structure content modification"); popen_struct(1); #OPERATION: update workstation with POSTPONE pupd_ws(1,PFLAG_POSTPONE); #VERIFICATION: verify visual rep state is PVISUAL_ST_CORRECT im_confirm_visual_rep(1,PVISUAL_ST_CORRECT, "failed: POSTPONE update,visual=%d,expected PVISUAL_ST_CORRECT before poststruct\n"); #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: POSTPONE update,visual=%d,expected PVISUAL_ST_CORRECT before poststruct\n"); #VERIFICATION: verify surface is PSURF_EMPTY im_confirm_surface_emptiness(PSURF_EMPTY, "failed: POSTPONE update,surface=%d,expected PSURF_EMPTY before poststruct\n"); #OPERATION: post structure, set display update state to WAIT/UQUM, # insert a polyline element ppost_struct(1,1,1.0); pset_disp_upd_st(1, PDEFER_WAIT, PMODE_UQUM); ppolyline(&pl); #VERIFICATION: if (dynmod == PDYN_IRG) # if structure content mod's dynamic modification is IRG # verify that visual rep state is PVISUAL_ST_DEFER im_confirm_visual_rep(1,PVISUAL_ST_DEFER, "failed: visual=%d,expected PVISUAL_ST_DEFER after poststruct\n"); # Verify that line is not rendered status = i_check_line3(xdisplay,xwindow,1,0,line3,5,1); im_ifneq(status,0, "failed: line is rendered before updatews\n",NULL); endif if (dynmod == PDYN_CBS) # if structure content mod's dynamic modification is CBS # verify that visual rep state is PVISUAL_ST_SIMULATED im_confirm_visual_rep(1,PVISUAL_ST_SIMULATED, "failed: visual=%d,expected PVISUAL_ST_SIMULATED after poststruct\n"); endif if (dynmod == PDYN_IMM) # if structure content mod's dynamic modification is IMM # verify that visual rep state is PVISUAL_ST_CORRECT im_confirm_visual_rep(1,PVISUAL_ST_CORRECT, "failed: visual=%d,expected PVISUAL_ST_CORRECT after poststruct\n"); # Verify that line is rendered im_confirm_line3(xdisplay,xwindow,1,0,line3,5,1, "failed: line is not rendered before updatews\n",NULL); endif tvprintf(2,"before updatews, after polyline under WAIT/UQUM\n"); i_pause(); #OPERATION: update workstation with POSTPONE pupd_ws(1,PFLAG_POSTPONE); #VERIFICATION: if (dynmod == PDYN_IRG) # if structure content mod's dynamic modification is IRG # verify that visual rep state is PVISUAL_ST_DEFER im_confirm_visual_rep(1,PVISUAL_ST_DEFER, "failed: POSTPONE update,visual=%d,expected PVISUAL_ST_DEFER after poststruct\n"); endif if (dynmod == PDYN_CBS) # if structure content mod's dynamic modification is CBS # verify that visual rep state is PVISUAL_ST_SIMULATED im_confirm_visual_rep(1,PVISUAL_ST_SIMULATED, "failed: POSTPONE update,visual=%d,expected PVISUAL_ST_SIMULATED after poststruct\n"); endif if (dynmod == PDYN_IMM) # if structure content mod's dynamic modification is IMM # verify that visual rep state is PVISUAL_ST_CORRECT im_confirm_visual_rep(1,PVISUAL_ST_CORRECT, "failed: POSTPONE update,visual=%d,expected PVISUAL_ST_CORRECT after poststruct\n"); endif tvprintf(2,"after updatews with POSTPONE \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: PERFORM update,visual=%d,expected PVISUAL_ST_CORRECT after poststruct\n"); # verify surface is PSURF_NOT_EMPTY im_confirm_surface_emptiness(PSURF_NOT_EMPTY, "failed: PERFORM update,surface=%d,expected PSURF_NOT_EMPTY after poststruct\n"); # Verify that line is rendered im_confirm_line3(xdisplay,xwindow,1,0,line3,5,1, "failed: line is not rendered after updatews\n",NULL); tvprintf(2,"after updatews with PERFORM \n"); i_pause(); tendtest();