From a94c2af8f070cae9aaf24cf562dae34cea5cb3b1 Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Mon, 28 Sep 2009 23:35:17 -0700 Subject: xts5: Flatten Xlib6 directory more --- xts5/Xlib6/.gitignore | 16 +- xts5/Xlib6/Makefile.am | 16 +- xts5/Xlib6/XCreateFontCursor.m | 183 ++++++ xts5/Xlib6/XCreateFontCursor/XCreateFontCursor.m | 183 ------ xts5/Xlib6/XCreateGlyphCursor.m | 675 +++++++++++++++++++++ xts5/Xlib6/XCreateGlyphCursor/XCreateGlyphCursor.m | 675 --------------------- xts5/Xlib6/XCreatePixmap.m | 280 +++++++++ xts5/Xlib6/XCreatePixmap/XCreatePixmap.m | 280 --------- xts5/Xlib6/XCreatePixmapCursor.m | 565 +++++++++++++++++ .../XCreatePixmapCursor/XCreatePixmapCursor.m | 565 ----------------- xts5/Xlib6/XFreeCursor.m | 212 +++++++ xts5/Xlib6/XFreeCursor/XFreeCursor.m | 212 ------- xts5/Xlib6/XFreePixmap.m | 189 ++++++ xts5/Xlib6/XFreePixmap/XFreePixmap.m | 189 ------ xts5/Xlib6/XQueryBestCursor.m | 271 +++++++++ xts5/Xlib6/XQueryBestCursor/XQueryBestCursor.m | 271 --------- xts5/Xlib6/XRecolorCursor.m | 166 +++++ xts5/Xlib6/XRecolorCursor/XRecolorCursor.m | 166 ----- xts5/scenarios/Xlib6_scen | 16 +- xts5/tet_scen | 16 +- 20 files changed, 2573 insertions(+), 2573 deletions(-) create mode 100644 xts5/Xlib6/XCreateFontCursor.m delete mode 100644 xts5/Xlib6/XCreateFontCursor/XCreateFontCursor.m create mode 100644 xts5/Xlib6/XCreateGlyphCursor.m delete mode 100644 xts5/Xlib6/XCreateGlyphCursor/XCreateGlyphCursor.m create mode 100644 xts5/Xlib6/XCreatePixmap.m delete mode 100644 xts5/Xlib6/XCreatePixmap/XCreatePixmap.m create mode 100644 xts5/Xlib6/XCreatePixmapCursor.m delete mode 100644 xts5/Xlib6/XCreatePixmapCursor/XCreatePixmapCursor.m create mode 100644 xts5/Xlib6/XFreeCursor.m delete mode 100644 xts5/Xlib6/XFreeCursor/XFreeCursor.m create mode 100644 xts5/Xlib6/XFreePixmap.m delete mode 100644 xts5/Xlib6/XFreePixmap/XFreePixmap.m create mode 100644 xts5/Xlib6/XQueryBestCursor.m delete mode 100644 xts5/Xlib6/XQueryBestCursor/XQueryBestCursor.m create mode 100644 xts5/Xlib6/XRecolorCursor.m delete mode 100644 xts5/Xlib6/XRecolorCursor/XRecolorCursor.m (limited to 'xts5') diff --git a/xts5/Xlib6/.gitignore b/xts5/Xlib6/.gitignore index e0121367..54504df3 100644 --- a/xts5/Xlib6/.gitignore +++ b/xts5/Xlib6/.gitignore @@ -1,8 +1,8 @@ -XCreateFontCursor/XCreateFontCursor -XCreateGlyphCursor/XCreateGlyphCursor -XCreatePixmap/XCreatePixmap -XCreatePixmapCursor/XCreatePixmapCursor -XFreeCursor/XFreeCursor -XFreePixmap/XFreePixmap -XQueryBestCursor/XQueryBestCursor -XRecolorCursor/XRecolorCursor +XCreateFontCursor +XCreateGlyphCursor +XCreatePixmap +XCreatePixmapCursor +XFreeCursor +XFreePixmap +XQueryBestCursor +XRecolorCursor diff --git a/xts5/Xlib6/Makefile.am b/xts5/Xlib6/Makefile.am index 99832a63..ff749ce1 100644 --- a/xts5/Xlib6/Makefile.am +++ b/xts5/Xlib6/Makefile.am @@ -9,11 +9,11 @@ BUILT_SOURCES = $(tprogs:$(EXEEXT)=.c) CLEANFILES = $(BUILT_SOURCES) tprogs = \ - XCreateFontCursor/XCreateFontCursor \ - XCreateGlyphCursor/XCreateGlyphCursor \ - XCreatePixmap/XCreatePixmap \ - XCreatePixmapCursor/XCreatePixmapCursor \ - XFreeCursor/XFreeCursor \ - XFreePixmap/XFreePixmap \ - XQueryBestCursor/XQueryBestCursor \ - XRecolorCursor/XRecolorCursor + XCreateFontCursor \ + XCreateGlyphCursor \ + XCreatePixmap \ + XCreatePixmapCursor \ + XFreeCursor \ + XFreePixmap \ + XQueryBestCursor \ + XRecolorCursor diff --git a/xts5/Xlib6/XCreateFontCursor.m b/xts5/Xlib6/XCreateFontCursor.m new file mode 100644 index 00000000..0dc584bd --- /dev/null +++ b/xts5/Xlib6/XCreateFontCursor.m @@ -0,0 +1,183 @@ +Copyright (c) 2005 X.Org Foundation L.L.C. + +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 +AUTHORS OR COPYRIGHT HOLDERS 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. + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/Xlib6/XCreateFontCursor.m +>># +>># Description: +>># Tests for XCreateFontCursor() +>># +>># Modifications: +>># $Log: crtfntcrsr.m,v $ +>># Revision 1.2 2005-11-03 08:43:40 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:29 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:26:51 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:45:09 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:19:04 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:15:35 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 08:48:54 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 00:47:51 andy +>># Prepare for GA Release +>># +/* +Portions of this software are based on Xlib and X Protocol Test Suite. +We have used this material under the terms of its copyright, which grants +free use, subject to the conditions below. Note however that those +portions of this software that are based on the original Test Suite have +been significantly revised and that all such revisions are copyright (c) +1995 Applied Testing and Technology, Inc. Insomuch as the proprietary +revisions cannot be separated from the freely copyable material, the net +result is that use of this software is governed by the ApTest copyright. + +Copyright (c) 1990, 1991 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. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +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 name of UniSoft not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. UniSoft +makes no representations about the suitability of this software for any +purpose. It is provided "as is" without express or implied warranty. +*/ +>>TITLE XCreateFontCursor Xlib6 +Cursor +XCreateFontCursor(display, shape) +Display *display = Dsp; +unsigned int shape; +>>SET startup fontstartup +>>SET cleanup fontcleanup +>>ASSERTION Good B 1 +When the +.A shape +argument is +a defined glyph in the standard cursor font, +then a call to xname creates a +.S Cursor +with a black foreground and a white background +corresponding to the +.A shape +argument +and returns the cursor ID. +>>STRATEGY +Get TET variable XT_FONTCURSOR_GOOD. +Call XCreateFontCursor with shape of this value. +Verify that XCreateFontCursor returns non-zero. +>>CODE +Cursor qstat; + +/* Get TET variable XT_FONTCURSOR_GOOD */ + /* UNSUPPORTED is not allowed */ + shape = config.fontcursor_good; + if (shape == -1) { + delete("A value of UNSUPPORTED is not allowed for XT_FONTCURSOR_GOOD"); + return; + } + + trace("Shape used is %x", shape); +/* Call XCreateFontCursor with shape of this value, */ +/* else call XCreateFontCursor with shape of zero. */ + + qstat = XCALL; + +/* Verify that XCreateFontCursor returns non-zero. */ + if (qstat == 0) { + report("Returned wrong value %ld", (long) qstat); + FAIL; + } else + CHECK; + + CHECKUNTESTED(1); +>>ASSERTION Bad A +When the +.A shape +argument is not +a defined glyph in the standard cursor font, +then a +.S BadValue +error occurs. +>>STRATEGY +Get TET variable XT_FONTCURSOR_BAD. +Call XCreateFontCursor with shape of this value. +Verify that a BadValue error occurs. +>>CODE BadValue +Cursor qstat; + +/* Get TET variable XT_FONTCURSOR_BAD */ + shape = config.fontcursor_bad; + if (shape == -1) { + unsupported("There are no invalid cursor glyph values"); + return; + } + + trace("Shape used is %x", shape); +/* Call XCreateFontCursor with shape of this value, */ +/* else call XCreateFontCursor with shape of zero. */ + XCALL; + +/* Verify that a BadValue error occurs. */ + if (geterr() == BadValue) + PASS; + else + FAIL; +>>ASSERTION Bad B 1 +.ER BadAlloc +>># HISTORY kieron Completed Reformat to pass ca, plus correction +>># HISTORY peterc Completed Wrote STRATEGY and CODE. diff --git a/xts5/Xlib6/XCreateFontCursor/XCreateFontCursor.m b/xts5/Xlib6/XCreateFontCursor/XCreateFontCursor.m deleted file mode 100644 index 8f3ccf65..00000000 --- a/xts5/Xlib6/XCreateFontCursor/XCreateFontCursor.m +++ /dev/null @@ -1,183 +0,0 @@ -Copyright (c) 2005 X.Org Foundation L.L.C. - -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 -AUTHORS OR COPYRIGHT HOLDERS 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. - -Copyright (c) Applied Testing and Technology, Inc. 1995 -All Rights Reserved. - ->># Project: VSW5 ->># ->># File: xts5/Xlib6/XCreateFontCursor/XCreateFontCursor.m ->># ->># Description: ->># Tests for XCreateFontCursor() ->># ->># Modifications: ->># $Log: crtfntcrsr.m,v $ ->># Revision 1.2 2005-11-03 08:43:40 jmichael ->># clean up all vsw5 paths to use xts5 instead. ->># ->># Revision 1.1.1.2 2005/04/15 14:05:29 anderson ->># Reimport of the base with the legal name in the copyright fixed. ->># ->># Revision 8.0 1998/12/23 23:26:51 mar ->># Branch point for Release 5.0.2 ->># ->># Revision 7.0 1998/10/30 22:45:09 mar ->># Branch point for Release 5.0.2b1 ->># ->># Revision 6.0 1998/03/02 05:19:04 tbr ->># Branch point for Release 5.0.1 ->># ->># Revision 5.0 1998/01/26 03:15:35 tbr ->># Branch point for Release 5.0.1b1 ->># ->># Revision 4.0 1995/12/15 08:48:54 tbr ->># Branch point for Release 5.0.0 ->># ->># Revision 3.1 1995/12/15 00:47:51 andy ->># Prepare for GA Release ->># -/* -Portions of this software are based on Xlib and X Protocol Test Suite. -We have used this material under the terms of its copyright, which grants -free use, subject to the conditions below. Note however that those -portions of this software that are based on the original Test Suite have -been significantly revised and that all such revisions are copyright (c) -1995 Applied Testing and Technology, Inc. Insomuch as the proprietary -revisions cannot be separated from the freely copyable material, the net -result is that use of this software is governed by the ApTest copyright. - -Copyright (c) 1990, 1991 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. - -Permission to use, copy, modify, distribute, and sell this software and -its documentation for any purpose is hereby granted without fee, -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 name of UniSoft not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. UniSoft -makes no representations about the suitability of this software for any -purpose. It is provided "as is" without express or implied warranty. -*/ ->>TITLE XCreateFontCursor Xlib6 -Cursor -XCreateFontCursor(display, shape) -Display *display = Dsp; -unsigned int shape; ->>SET startup fontstartup ->>SET cleanup fontcleanup ->>ASSERTION Good B 1 -When the -.A shape -argument is -a defined glyph in the standard cursor font, -then a call to xname creates a -.S Cursor -with a black foreground and a white background -corresponding to the -.A shape -argument -and returns the cursor ID. ->>STRATEGY -Get TET variable XT_FONTCURSOR_GOOD. -Call XCreateFontCursor with shape of this value. -Verify that XCreateFontCursor returns non-zero. ->>CODE -Cursor qstat; - -/* Get TET variable XT_FONTCURSOR_GOOD */ - /* UNSUPPORTED is not allowed */ - shape = config.fontcursor_good; - if (shape == -1) { - delete("A value of UNSUPPORTED is not allowed for XT_FONTCURSOR_GOOD"); - return; - } - - trace("Shape used is %x", shape); -/* Call XCreateFontCursor with shape of this value, */ -/* else call XCreateFontCursor with shape of zero. */ - - qstat = XCALL; - -/* Verify that XCreateFontCursor returns non-zero. */ - if (qstat == 0) { - report("Returned wrong value %ld", (long) qstat); - FAIL; - } else - CHECK; - - CHECKUNTESTED(1); ->>ASSERTION Bad A -When the -.A shape -argument is not -a defined glyph in the standard cursor font, -then a -.S BadValue -error occurs. ->>STRATEGY -Get TET variable XT_FONTCURSOR_BAD. -Call XCreateFontCursor with shape of this value. -Verify that a BadValue error occurs. ->>CODE BadValue -Cursor qstat; - -/* Get TET variable XT_FONTCURSOR_BAD */ - shape = config.fontcursor_bad; - if (shape == -1) { - unsupported("There are no invalid cursor glyph values"); - return; - } - - trace("Shape used is %x", shape); -/* Call XCreateFontCursor with shape of this value, */ -/* else call XCreateFontCursor with shape of zero. */ - XCALL; - -/* Verify that a BadValue error occurs. */ - if (geterr() == BadValue) - PASS; - else - FAIL; ->>ASSERTION Bad B 1 -.ER BadAlloc ->># HISTORY kieron Completed Reformat to pass ca, plus correction ->># HISTORY peterc Completed Wrote STRATEGY and CODE. diff --git a/xts5/Xlib6/XCreateGlyphCursor.m b/xts5/Xlib6/XCreateGlyphCursor.m new file mode 100644 index 00000000..29350924 --- /dev/null +++ b/xts5/Xlib6/XCreateGlyphCursor.m @@ -0,0 +1,675 @@ +Copyright (c) 2005 X.Org Foundation L.L.C. + +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 +AUTHORS OR COPYRIGHT HOLDERS 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. + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/Xlib6/XCreateGlyphCursor.m +>># +>># Description: +>># Tests for XCreateGlyphCursor() +>># +>># Modifications: +>># $Log: crtglyphcr.m,v $ +>># Revision 1.2 2005-11-03 08:43:40 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:29 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:26:51 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:45:09 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:19:05 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:15:36 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 08:48:56 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 00:47:54 andy +>># Prepare for GA Release +>># +/* +Portions of this software are based on Xlib and X Protocol Test Suite. +We have used this material under the terms of its copyright, which grants +free use, subject to the conditions below. Note however that those +portions of this software that are based on the original Test Suite have +been significantly revised and that all such revisions are copyright (c) +1995 Applied Testing and Technology, Inc. Insomuch as the proprietary +revisions cannot be separated from the freely copyable material, the net +result is that use of this software is governed by the ApTest copyright. + +Copyright (c) 1990, 1991 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. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +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 name of UniSoft not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. UniSoft +makes no representations about the suitability of this software for any +purpose. It is provided "as is" without express or implied warranty. +*/ +>>TITLE XCreateGlyphCursor Xlib6 +Cursor +XCreateGlyphCursor (display, source_font, mask_font, source_char, mask_char, foreground_color, background_color) +Display *display = Dsp; +Font source_font; +Font mask_font; +unsigned int source_char; +unsigned int mask_char; +XColor *foreground_color = mkcolor(1); +XColor *background_color = mkcolor(0); +>>SET startup fontstartup +>>SET cleanup fontcleanup +>>EXTERN +static char xtfont0[] = "xtfont0"; /* known font, used for source font */ +static unsigned int good_char0 = 1; /* known defined glyph in xtfont0 */ +static unsigned int goodblank_char0 = 1;/* blank defined glyph in xtfont0 */ +static unsigned int bad_char0 = 0; /* undefined glyph xtfont0 */ +static unsigned int bounding0 = 4; /* diff. bounding box than good_char0 */ + +static char xtfont1[] = "xtfont1"; /* font sometimes used for mask font */ +static unsigned int good_char1 = 1; /* known defined glyph in xtfont1 */ + +static char xtfont6[] = "xtfont6"; /* known 2-byte matrix font */ +static unsigned int good_char6 = 504; /* known defined glyph in xtfont6 */ + +/* + * mkcolor() - return a pointer to a color structure. + * flag indicates whether or not color is foreground + */ +static XColor * +mkcolor(flag) +{ + static XColor fore; + static XColor back; + static int first = 1; + + if (first) + { + first = 0; + + fore.pixel = BlackPixel(display, DefaultScreen(display)); + XQueryColor(display, DefaultColormap(display, DefaultScreen(display)), &fore); + back.pixel = WhitePixel(display, DefaultScreen(display)); + XQueryColor(display, DefaultColormap(display, DefaultScreen(display)), &back); + } + return(flag ? &fore : &back); +} +>>ASSERTION Good B 1 +A call to xname creates a +.S Cursor +with colours defined by +.A foreground_color +and +.A background_color +and returns its ID. +>>STRATEGY +Load xtfont0 using XLoadFont. +Call XCreateGlyphCursor with foreground colour W_FG and +background colour W_BG. +Verify that XCreateGlyphCursor returns non-zero. +>>CODE +Cursor qstat; + +/* Load xtfont0 using XLoadFont. */ + source_font = XLoadFont(display, xtfont0); + mask_font = source_font; + source_char = good_char0; + mask_char = good_char0; + +/* Call XCreateGlyphCursor with foreground colour W_FG and */ +/* background colour W_BG. */ + qstat = XCALL; + +/* Verify that XCreateGlyphCursor returns non-zero. */ + if (qstat == (Cursor) 0) { + report("Returned wrong value %ld", (long) qstat); + FAIL; + } else + CHECK; + + CHECKUNTESTED(1); +>>ASSERTION Good B 1 +The +.A source_char +specifies the glyph in the +.A source_font +from which the source bitmap is obtained. +>>STRATEGY +Load xtfont0 using XLoadFont. +Call XCreateGlyphCursor with source_char set to +a known defined glyph in font xtfont0. +Verify that XCreateGlyphCursor returns non-zero. +>># +>># This code is identical to the code for the previous assertion...pc +>># +>>CODE +Cursor qstat; + +/* Load xtfont0 using XLoadFont. */ + source_font = XLoadFont(display, xtfont0); + mask_font = source_font; + source_char = good_char0; + mask_char = good_char0; + +/* Call XCreateGlyphCursor with source_char set to */ +/* a known defined glyph in font xtfont0. */ + qstat = XCALL; + +/* Verify that XCreateGlyphCursor returns non-zero. */ + if (qstat == (Cursor) 0) { + report("Returned wrong value %ld", (long) qstat); + FAIL; + } else + CHECK; + + CHECKUNTESTED(1); +>>ASSERTION Good B 1 +The +.A mask_char +specifies the glyph in the +.A mask_font +from which the mask bitmap is obtained. +>>STRATEGY +Load xtfont0 using XLoadFont. +Load xtfont1 using XLoadFont. +Call XCreateGlyphCursor with mask_char set to +a known defined glyph in font xtfont1. +Verify that XCreateGlyphCursor returns non-zero. +>>CODE +Cursor qstat; + +/* Load xtfont0 using XLoadFont. */ + source_font = XLoadFont(display, xtfont0); +/* Load xtfont1 using XLoadFont. */ + mask_font = XLoadFont(display, xtfont1); + + source_char = good_char0; + mask_char = good_char1; + +/* Call XCreateGlyphCursor with mask_char set to */ +/* a known defined glyph in font xtfont1. */ + qstat = XCALL; + +/* Verify that XCreateGlyphCursor returns non-zero. */ + if (qstat == (Cursor) 0) { + report("Returned wrong value %ld", (long) qstat); + FAIL; + } else + CHECK; + + CHECKUNTESTED(1); +>>ASSERTION Good B 1 +When +.A mask_char +is zero, then all pixels of the source are displayed. +>>STRATEGY +Load xtfont0 using XLoadFont. +Load xtfont1 using XLoadFont. +Call XCreateGlyphCursor with mask_char set to zero. +Verify that XCreateGlyphCursor returns non-zero. +>>CODE +Cursor qstat; + +/* Load xtfont0 using XLoadFont. */ + source_font = XLoadFont(display, xtfont0); +/* Load xtfont1 using XLoadFont. */ + mask_font = XLoadFont(display, xtfont1); + + source_char = good_char0; + mask_char = 0; + +/* Call XCreateGlyphCursor with mask_char set to zero. */ + qstat = XCALL; + +/* Verify that XCreateGlyphCursor returns non-zero. */ + if (qstat == (Cursor) 0) { + report("Returned wrong value %ld", (long) qstat); + FAIL; + } else + CHECK; + + CHECKUNTESTED(1); +>>ASSERTION Good B 1 +When +.A mask_char +and +.A mask_font +are non-zero and a given bit in the mask bitmap is 1, then +the corresponding pixel of the source is displayed. +>>STRATEGY +Load xtfont0 using XLoadFont. +Load xtfont1 using XLoadFont. +Call XCreateGlyphCursor with mask_font set to non-zero and +mask_char corresponding to a glyph in mask_font which +has at least one bit set to non-zero. +Verify that XCreateGlyphCursor returns non-zero. +>># +>># This code is identical to the code in an assertion which, +>># at one time, was located two assertions previous. +>># +>>CODE +Cursor qstat; + +/* Load xtfont0 using XLoadFont. */ + source_font = XLoadFont(display, xtfont0); +/* Load xtfont1 using XLoadFont. */ + mask_font = XLoadFont(display, xtfont1); + + source_char = good_char0; + mask_char = good_char1; + +/* Call XCreateGlyphCursor with mask_font set to non-zero and */ +/* mask_char corresponding to a glyph in mask_font which */ +/* has at least one bit set to non-zero. */ + qstat = XCALL; + +/* Verify that XCreateGlyphCursor returns non-zero. */ + if (qstat == (Cursor) 0) { + report("Returned wrong value %ld", (long) qstat); + FAIL; + } else + CHECK; + + CHECKUNTESTED(1); +>>ASSERTION Good B 1 +When +.A mask_char +and +.A mask_font +are non-zero and a given bit in the mask bitmap is 0, then +the corresponding pixel of the source is not displayed. +>>STRATEGY +Load xtfont0 using XLoadFont. +Load xtfont1 using XLoadFont. +Call XCreateGlyphCursor with mask_font set to non-zero and +mask_char corresponding to a glyph in mask_font which +has at least one bit set to zero. +Verify that XCreateGlyphCursor returns non-zero. +>># +>># This code is identical to that for the previous assertion. +>># +>>CODE +Cursor qstat; + +/* Load xtfont0 using XLoadFont. */ + source_font = XLoadFont(display, xtfont0); +/* Load xtfont1 using XLoadFont. */ + mask_font = XLoadFont(display, xtfont1); + + source_char = good_char0; + mask_char = good_char1; + +/* Call XCreateGlyphCursor with mask_font set to non-zero and */ +/* mask_char corresponding to a glyph in mask_font which */ +/* has at least one bit set to zero. */ + qstat = XCALL; + +/* Verify that XCreateGlyphCursor returns non-zero. */ + if (qstat == (Cursor) 0) { + report("Returned wrong value %ld", (long) qstat); + FAIL; + } else + CHECK; + + CHECKUNTESTED(1); +>>ASSERTION Good B 1 +When a bit in the source bitmap is 1, then +.A foreground_color +is used. +>>STRATEGY +Load xtfont0 using XLoadFont. +Load xtfont1 using XLoadFont. +Call XCreateGlyphCursor with glyph with at least +one bit in the source bitmap set to 1. +Verify that XCreateGlyphCursor returns non-zero. +>># +>># This code is identical to that for the previous assertion. +>># +>>CODE +Cursor qstat; + +/* Load xtfont0 using XLoadFont. */ + source_font = XLoadFont(display, xtfont0); +/* Load xtfont1 using XLoadFont. */ + mask_font = XLoadFont(display, xtfont1); + + source_char = good_char0; + mask_char = good_char1; + +/* Call XCreateGlyphCursor with glyph with at least */ +/* one bit in the source bitmap set to 1. */ + qstat = XCALL; + +/* Verify that XCreateGlyphCursor returns non-zero. */ + if (qstat == (Cursor) 0) { + report("Returned wrong value %ld", (long) qstat); + FAIL; + } else + CHECK; + + CHECKUNTESTED(1); +>>ASSERTION Good B 1 +When a bit in the source bitmap is 0, then +.A background_color +is used. +>>STRATEGY +Load xtfont0 using XLoadFont. +Load xtfont1 using XLoadFont. +Call XCreateGlyphCursor with source char corresponding to glyph which +has at least one bit set to zero. +Verify that XCreateGlyphCursor returns non-zero. +>>CODE +Cursor qstat; + +/* Load xtfont0 using XLoadFont. */ + source_font = XLoadFont(display, xtfont0); +/* Load xtfont1 using XLoadFont. */ + mask_font = XLoadFont(display, xtfont1); + + source_char = goodblank_char0; + mask_char = good_char1; + +/* Call XCreateGlyphCursor with source char corresponding to glyph which */ +/* has at least one bit set to zero. */ + qstat = XCALL; + +/* Verify that XCreateGlyphCursor returns non-zero. */ + if (qstat == (Cursor) 0) { + report("Returned wrong value %ld", (long) qstat); + FAIL; + } else + CHECK; + + CHECKUNTESTED(1); +>>ASSERTION Good B 1 +When +.A mask_char +is non-zero, then its glyph +.M origin +is positioned coincidently with +that of +.A source_char . +>>STRATEGY +Load xtfont0 using XLoadFont. +Load xtfont1 using XLoadFont. +Call XCreateGlyphCursor with non-zero mask_char. +Verify that XCreateGlyphCursor returns non-zero. +>># +>># This code is identical to that for the previous assertion. +>># +>>CODE +Cursor qstat; + +/* Load xtfont0 using XLoadFont. */ + source_font = XLoadFont(display, xtfont0); +/* Load xtfont1 using XLoadFont. */ + mask_font = XLoadFont(display, xtfont1); + + source_char = goodblank_char0; + mask_char = good_char1; + +/* Call XCreateGlyphCursor with non-zero mask_char. */ + qstat = XCALL; + +/* Verify that XCreateGlyphCursor returns non-zero. */ + if (qstat == (Cursor) 0) { + report("Returned wrong value %ld", (long) qstat); + FAIL; + } else + CHECK; + + CHECKUNTESTED(1); +>>ASSERTION Good B 1 +The +.M origin +of the +.A source_char +defines the hotspot. +>># +>># Don't think we need to repeat yet another test for this case...pc +>># +>>ASSERTION Good B 1 +The +.A source_char +and +.A mask_char +need not have the same bounding box metrics. +>>STRATEGY +Load xtfont0 using XLoadFont. +Call XCreateGlyphCursor with source_char and mask_char +with different bounding boxes. +Verify that XCreateGlyphCursor returns non-zero. +>>CODE +Cursor qstat; + +/* Load xtfont0 using XLoadFont. */ + source_font = XLoadFont(display, xtfont0); + mask_font = source_font; + source_char = good_char0; + mask_char = bounding0; +/* Call XCreateGlyphCursor with source_char and mask_char */ +/* with different bounding boxes. */ + + qstat = XCALL; + +/* Verify that XCreateGlyphCursor returns non-zero. */ + if (qstat == (Cursor) 0) { + report("Returned wrong value %ld", (long) qstat); + FAIL; + } else + CHECK; + + CHECKUNTESTED(1); +>>ASSERTION Good B 1 +When a cursor is created by a call to xname, +and the +.A source_font +or +.A mask_font +argument is freed be a subsequent call to +.F XFreeFont , +then the cursor is unaffected. +>>STRATEGY +Load xtfont0 using XLoadQueryFont. +Verify that XLoadQueryFont returns non-zero. +Load xtfont1 using XLoadQueryFont. +Verify that XLoadQueryFont returns non-zero. +Call XCreateGlyphCursor with foreground colour W_FG and background colour W_BG. +Verify that XCreateGlyphCursor returns non-zero. +Call XFreeFont for xtfont0. +Call XFreeFont for xtfont1. +>>CODE +Cursor qstat; +XFontStruct *font_struct0; +XFontStruct *font_struct1; + +/* Load xtfont0 using XLoadQueryFont. */ + font_struct0 = XLoadQueryFont(display, xtfont0); +/* Verify that XLoadQueryFont returns non-zero. */ + if (font_struct0 == (XFontStruct *) 0) { + delete("Could not load and query font \"%s\".", xtfont0); + return; + } + else + CHECK; +/* Load xtfont1 using XLoadQueryFont. */ + font_struct1 = XLoadQueryFont(display, xtfont1); +/* Verify that XLoadQueryFont returns non-zero. */ + if (font_struct1 == (XFontStruct *) 0) { + delete("Could not load and query font \"%s\".", xtfont1); + return; + } + else + CHECK; + source_font = font_struct0->fid; + mask_font = font_struct1->fid; + source_char = good_char0; + mask_char = good_char1; +/* Call XCreateGlyphCursor with foreground colour W_FG and background colour W_BG. */ + + qstat = XCALL; + +/* Verify that XCreateGlyphCursor returns non-zero. */ + if (qstat == (Cursor) 0) { + report("Returned wrong value %ld", (long) qstat); + FAIL; + } else + CHECK; + +/* Call XFreeFont for xtfont0. */ + XFreeFont(display, font_struct0); +/* Call XFreeFont for xtfont1. */ + XFreeFont(display, font_struct1); + + CHECKUNTESTED(3); +>>ASSERTION Good B 1 +For 2-byte matrix fonts, +the 16-bit value should be formed with the byte1 member +in the most significant byte and the byte2 member in the +least significant byte. +>>STRATEGY +Load 2-byte matrix font xtfont6 using XLoadFont. +Call XCreateGlyphCursor with foreground colour W_FG and +background colour W_BG. +Verify that XCreateGlyphCursor returns non-zero. +>>CODE +Cursor qstat; + +/* Load 2-byte matrix font xtfont6 using XLoadFont. */ + source_font = XLoadFont(display, xtfont6); + mask_font = source_font; + source_char = good_char6; + mask_char = good_char6; +/* Call XCreateGlyphCursor with foreground colour W_FG and */ +/* background colour W_BG. */ + + qstat = XCALL; + +/* Verify that XCreateGlyphCursor returns non-zero. */ + if (qstat == (Cursor) 0) { + report("Returned wrong value %ld", (long) qstat); + FAIL; + } else + CHECK; + + CHECKUNTESTED(1); +>>ASSERTION Bad B 1 +.ER BadAlloc +>>ASSERTION Bad A +When the +.A source_char +argument is not +a defined glyph in +.A source_font , +then a +.S BadValue +error occurs. +>>STRATEGY +Load xtfont0 using XLoadFont. +Call XCreateGlyphCursor with a source_char which is +an undefined glyph in source_font. +Verify that a BadValue error occurs. +>>CODE BadValue +Cursor qstat; + +/* Load xtfont0 using XLoadFont. */ + source_font = XLoadFont(display, xtfont0); + mask_font = source_font; + source_char = bad_char0; + mask_char = good_char0; + +/* Call XCreateGlyphCursor with a source_char which is */ +/* an undefined glyph in source_font. */ + XCALL; + +/* Verify that a BadValue error occurs. */ + if (geterr() == BadValue) + PASS; + else + FAIL; +>>ASSERTION Bad A +When +.A mask_font +is non-zero and +.A mask_char +is non-zero and not a defined glyph in +.A mask_font , +then a +.S BadValue +error occurs. +>>STRATEGY +Load xtfont0 using XLoadFont. +Call XCreateGlyphCursor with a mask_char which is +an undefined glyph in mask_font. +Verify that a BadValue error occurs. +>>CODE BadValue +Cursor qstat; + +/* Load xtfont0 using XLoadFont. */ + source_font = XLoadFont(display, xtfont0); + mask_font = source_font; + source_char = good_char0; + mask_char = bad_char0; + +/* Call XCreateGlyphCursor with a mask_char which is */ +/* an undefined glyph in mask_font. */ + XCALL; + +/* Verify that a BadValue error occurs. */ + if (geterr() == BadValue) + PASS; + else + FAIL; +>>ASSERTION Bad A +.ER BadFont bad-font +>>#HISTORY peterc Completed Updated as per RTCB#3 diff --git a/xts5/Xlib6/XCreateGlyphCursor/XCreateGlyphCursor.m b/xts5/Xlib6/XCreateGlyphCursor/XCreateGlyphCursor.m deleted file mode 100644 index a972fe1b..00000000 --- a/xts5/Xlib6/XCreateGlyphCursor/XCreateGlyphCursor.m +++ /dev/null @@ -1,675 +0,0 @@ -Copyright (c) 2005 X.Org Foundation L.L.C. - -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 -AUTHORS OR COPYRIGHT HOLDERS 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. - -Copyright (c) Applied Testing and Technology, Inc. 1995 -All Rights Reserved. - ->># Project: VSW5 ->># ->># File: xts5/Xlib6/XCreateGlyphCursor/XCreateGlyphCursor.m ->># ->># Description: ->># Tests for XCreateGlyphCursor() ->># ->># Modifications: ->># $Log: crtglyphcr.m,v $ ->># Revision 1.2 2005-11-03 08:43:40 jmichael ->># clean up all vsw5 paths to use xts5 instead. ->># ->># Revision 1.1.1.2 2005/04/15 14:05:29 anderson ->># Reimport of the base with the legal name in the copyright fixed. ->># ->># Revision 8.0 1998/12/23 23:26:51 mar ->># Branch point for Release 5.0.2 ->># ->># Revision 7.0 1998/10/30 22:45:09 mar ->># Branch point for Release 5.0.2b1 ->># ->># Revision 6.0 1998/03/02 05:19:05 tbr ->># Branch point for Release 5.0.1 ->># ->># Revision 5.0 1998/01/26 03:15:36 tbr ->># Branch point for Release 5.0.1b1 ->># ->># Revision 4.0 1995/12/15 08:48:56 tbr ->># Branch point for Release 5.0.0 ->># ->># Revision 3.1 1995/12/15 00:47:54 andy ->># Prepare for GA Release ->># -/* -Portions of this software are based on Xlib and X Protocol Test Suite. -We have used this material under the terms of its copyright, which grants -free use, subject to the conditions below. Note however that those -portions of this software that are based on the original Test Suite have -been significantly revised and that all such revisions are copyright (c) -1995 Applied Testing and Technology, Inc. Insomuch as the proprietary -revisions cannot be separated from the freely copyable material, the net -result is that use of this software is governed by the ApTest copyright. - -Copyright (c) 1990, 1991 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. - -Permission to use, copy, modify, distribute, and sell this software and -its documentation for any purpose is hereby granted without fee, -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 name of UniSoft not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. UniSoft -makes no representations about the suitability of this software for any -purpose. It is provided "as is" without express or implied warranty. -*/ ->>TITLE XCreateGlyphCursor Xlib6 -Cursor -XCreateGlyphCursor (display, source_font, mask_font, source_char, mask_char, foreground_color, background_color) -Display *display = Dsp; -Font source_font; -Font mask_font; -unsigned int source_char; -unsigned int mask_char; -XColor *foreground_color = mkcolor(1); -XColor *background_color = mkcolor(0); ->>SET startup fontstartup ->>SET cleanup fontcleanup ->>EXTERN -static char xtfont0[] = "xtfont0"; /* known font, used for source font */ -static unsigned int good_char0 = 1; /* known defined glyph in xtfont0 */ -static unsigned int goodblank_char0 = 1;/* blank defined glyph in xtfont0 */ -static unsigned int bad_char0 = 0; /* undefined glyph xtfont0 */ -static unsigned int bounding0 = 4; /* diff. bounding box than good_char0 */ - -static char xtfont1[] = "xtfont1"; /* font sometimes used for mask font */ -static unsigned int good_char1 = 1; /* known defined glyph in xtfont1 */ - -static char xtfont6[] = "xtfont6"; /* known 2-byte matrix font */ -static unsigned int good_char6 = 504; /* known defined glyph in xtfont6 */ - -/* - * mkcolor() - return a pointer to a color structure. - * flag indicates whether or not color is foreground - */ -static XColor * -mkcolor(flag) -{ - static XColor fore; - static XColor back; - static int first = 1; - - if (first) - { - first = 0; - - fore.pixel = BlackPixel(display, DefaultScreen(display)); - XQueryColor(display, DefaultColormap(display, DefaultScreen(display)), &fore); - back.pixel = WhitePixel(display, DefaultScreen(display)); - XQueryColor(display, DefaultColormap(display, DefaultScreen(display)), &back); - } - return(flag ? &fore : &back); -} ->>ASSERTION Good B 1 -A call to xname creates a -.S Cursor -with colours defined by -.A foreground_color -and -.A background_color -and returns its ID. ->>STRATEGY -Load xtfont0 using XLoadFont. -Call XCreateGlyphCursor with foreground colour W_FG and -background colour W_BG. -Verify that XCreateGlyphCursor returns non-zero. ->>CODE -Cursor qstat; - -/* Load xtfont0 using XLoadFont. */ - source_font = XLoadFont(display, xtfont0); - mask_font = source_font; - source_char = good_char0; - mask_char = good_char0; - -/* Call XCreateGlyphCursor with foreground colour W_FG and */ -/* background colour W_BG. */ - qstat = XCALL; - -/* Verify that XCreateGlyphCursor returns non-zero. */ - if (qstat == (Cursor) 0) { - report("Returned wrong value %ld", (long) qstat); - FAIL; - } else - CHECK; - - CHECKUNTESTED(1); ->>ASSERTION Good B 1 -The -.A source_char -specifies the glyph in the -.A source_font -from which the source bitmap is obtained. ->>STRATEGY -Load xtfont0 using XLoadFont. -Call XCreateGlyphCursor with source_char set to -a known defined glyph in font xtfont0. -Verify that XCreateGlyphCursor returns non-zero. ->># ->># This code is identical to the code for the previous assertion...pc ->># ->>CODE -Cursor qstat; - -/* Load xtfont0 using XLoadFont. */ - source_font = XLoadFont(display, xtfont0); - mask_font = source_font; - source_char = good_char0; - mask_char = good_char0; - -/* Call XCreateGlyphCursor with source_char set to */ -/* a known defined glyph in font xtfont0. */ - qstat = XCALL; - -/* Verify that XCreateGlyphCursor returns non-zero. */ - if (qstat == (Cursor) 0) { - report("Returned wrong value %ld", (long) qstat); - FAIL; - } else - CHECK; - - CHECKUNTESTED(1); ->>ASSERTION Good B 1 -The -.A mask_char -specifies the glyph in the -.A mask_font -from which the mask bitmap is obtained. ->>STRATEGY -Load xtfont0 using XLoadFont. -Load xtfont1 using XLoadFont. -Call XCreateGlyphCursor with mask_char set to -a known defined glyph in font xtfont1. -Verify that XCreateGlyphCursor returns non-zero. ->>CODE -Cursor qstat; - -/* Load xtfont0 using XLoadFont. */ - source_font = XLoadFont(display, xtfont0); -/* Load xtfont1 using XLoadFont. */ - mask_font = XLoadFont(display, xtfont1); - - source_char = good_char0; - mask_char = good_char1; - -/* Call XCreateGlyphCursor with mask_char set to */ -/* a known defined glyph in font xtfont1. */ - qstat = XCALL; - -/* Verify that XCreateGlyphCursor returns non-zero. */ - if (qstat == (Cursor) 0) { - report("Returned wrong value %ld", (long) qstat); - FAIL; - } else - CHECK; - - CHECKUNTESTED(1); ->>ASSERTION Good B 1 -When -.A mask_char -is zero, then all pixels of the source are displayed. ->>STRATEGY -Load xtfont0 using XLoadFont. -Load xtfont1 using XLoadFont. -Call XCreateGlyphCursor with mask_char set to zero. -Verify that XCreateGlyphCursor returns non-zero. ->>CODE -Cursor qstat; - -/* Load xtfont0 using XLoadFont. */ - source_font = XLoadFont(display, xtfont0); -/* Load xtfont1 using XLoadFont. */ - mask_font = XLoadFont(display, xtfont1); - - source_char = good_char0; - mask_char = 0; - -/* Call XCreateGlyphCursor with mask_char set to zero. */ - qstat = XCALL; - -/* Verify that XCreateGlyphCursor returns non-zero. */ - if (qstat == (Cursor) 0) { - report("Returned wrong value %ld", (long) qstat); - FAIL; - } else - CHECK; - - CHECKUNTESTED(1); ->>ASSERTION Good B 1 -When -.A mask_char -and -.A mask_font -are non-zero and a given bit in the mask bitmap is 1, then -the corresponding pixel of the source is displayed. ->>STRATEGY -Load xtfont0 using XLoadFont. -Load xtfont1 using XLoadFont. -Call XCreateGlyphCursor with mask_font set to non-zero and -mask_char corresponding to a glyph in mask_font which -has at least one bit set to non-zero. -Verify that XCreateGlyphCursor returns non-zero. ->># ->># This code is identical to the code in an assertion which, ->># at one time, was located two assertions previous. ->># ->>CODE -Cursor qstat; - -/* Load xtfont0 using XLoadFont. */ - source_font = XLoadFont(display, xtfont0); -/* Load xtfont1 using XLoadFont. */ - mask_font = XLoadFont(display, xtfont1); - - source_char = good_char0; - mask_char = good_char1; - -/* Call XCreateGlyphCursor with mask_font set to non-zero and */ -/* mask_char corresponding to a glyph in mask_font which */ -/* has at least one bit set to non-zero. */ - qstat = XCALL; - -/* Verify that XCreateGlyphCursor returns non-zero. */ - if (qstat == (Cursor) 0) { - report("Returned wrong value %ld", (long) qstat); - FAIL; - } else - CHECK; - - CHECKUNTESTED(1); ->>ASSERTION Good B 1 -When -.A mask_char -and -.A mask_font -are non-zero and a given bit in the mask bitmap is 0, then -the corresponding pixel of the source is not displayed. ->>STRATEGY -Load xtfont0 using XLoadFont. -Load xtfont1 using XLoadFont. -Call XCreateGlyphCursor with mask_font set to non-zero and -mask_char corresponding to a glyph in mask_font which -has at least one bit set to zero. -Verify that XCreateGlyphCursor returns non-zero. ->># ->># This code is identical to that for the previous assertion. ->># ->>CODE -Cursor qstat; - -/* Load xtfont0 using XLoadFont. */ - source_font = XLoadFont(display, xtfont0); -/* Load xtfont1 using XLoadFont. */ - mask_font = XLoadFont(display, xtfont1); - - source_char = good_char0; - mask_char = good_char1; - -/* Call XCreateGlyphCursor with mask_font set to non-zero and */ -/* mask_char corresponding to a glyph in mask_font which */ -/* has at least one bit set to zero. */ - qstat = XCALL; - -/* Verify that XCreateGlyphCursor returns non-zero. */ - if (qstat == (Cursor) 0) { - report("Returned wrong value %ld", (long) qstat); - FAIL; - } else - CHECK; - - CHECKUNTESTED(1); ->>ASSERTION Good B 1 -When a bit in the source bitmap is 1, then -.A foreground_color -is used. ->>STRATEGY -Load xtfont0 using XLoadFont. -Load xtfont1 using XLoadFont. -Call XCreateGlyphCursor with glyph with at least -one bit in the source bitmap set to 1. -Verify that XCreateGlyphCursor returns non-zero. ->># ->># This code is identical to that for the previous assertion. ->># ->>CODE -Cursor qstat; - -/* Load xtfont0 using XLoadFont. */ - source_font = XLoadFont(display, xtfont0); -/* Load xtfont1 using XLoadFont. */ - mask_font = XLoadFont(display, xtfont1); - - source_char = good_char0; - mask_char = good_char1; - -/* Call XCreateGlyphCursor with glyph with at least */ -/* one bit in the source bitmap set to 1. */ - qstat = XCALL; - -/* Verify that XCreateGlyphCursor returns non-zero. */ - if (qstat == (Cursor) 0) { - report("Returned wrong value %ld", (long) qstat); - FAIL; - } else - CHECK; - - CHECKUNTESTED(1); ->>ASSERTION Good B 1 -When a bit in the source bitmap is 0, then -.A background_color -is used. ->>STRATEGY -Load xtfont0 using XLoadFont. -Load xtfont1 using XLoadFont. -Call XCreateGlyphCursor with source char corresponding to glyph which -has at least one bit set to zero. -Verify that XCreateGlyphCursor returns non-zero. ->>CODE -Cursor qstat; - -/* Load xtfont0 using XLoadFont. */ - source_font = XLoadFont(display, xtfont0); -/* Load xtfont1 using XLoadFont. */ - mask_font = XLoadFont(display, xtfont1); - - source_char = goodblank_char0; - mask_char = good_char1; - -/* Call XCreateGlyphCursor with source char corresponding to glyph which */ -/* has at least one bit set to zero. */ - qstat = XCALL; - -/* Verify that XCreateGlyphCursor returns non-zero. */ - if (qstat == (Cursor) 0) { - report("Returned wrong value %ld", (long) qstat); - FAIL; - } else - CHECK; - - CHECKUNTESTED(1); ->>ASSERTION Good B 1 -When -.A mask_char -is non-zero, then its glyph -.M origin -is positioned coincidently with -that of -.A source_char . ->>STRATEGY -Load xtfont0 using XLoadFont. -Load xtfont1 using XLoadFont. -Call XCreateGlyphCursor with non-zero mask_char. -Verify that XCreateGlyphCursor returns non-zero. ->># ->># This code is identical to that for the previous assertion. ->># ->>CODE -Cursor qstat; - -/* Load xtfont0 using XLoadFont. */ - source_font = XLoadFont(display, xtfont0); -/* Load xtfont1 using XLoadFont. */ - mask_font = XLoadFont(display, xtfont1); - - source_char = goodblank_char0; - mask_char = good_char1; - -/* Call XCreateGlyphCursor with non-zero mask_char. */ - qstat = XCALL; - -/* Verify that XCreateGlyphCursor returns non-zero. */ - if (qstat == (Cursor) 0) { - report("Returned wrong value %ld", (long) qstat); - FAIL; - } else - CHECK; - - CHECKUNTESTED(1); ->>ASSERTION Good B 1 -The -.M origin -of the -.A source_char -defines the hotspot. ->># ->># Don't think we need to repeat yet another test for this case...pc ->># ->>ASSERTION Good B 1 -The -.A source_char -and -.A mask_char -need not have the same bounding box metrics. ->>STRATEGY -Load xtfont0 using XLoadFont. -Call XCreateGlyphCursor with source_char and mask_char -with different bounding boxes. -Verify that XCreateGlyphCursor returns non-zero. ->>CODE -Cursor qstat; - -/* Load xtfont0 using XLoadFont. */ - source_font = XLoadFont(display, xtfont0); - mask_font = source_font; - source_char = good_char0; - mask_char = bounding0; -/* Call XCreateGlyphCursor with source_char and mask_char */ -/* with different bounding boxes. */ - - qstat = XCALL; - -/* Verify that XCreateGlyphCursor returns non-zero. */ - if (qstat == (Cursor) 0) { - report("Returned wrong value %ld", (long) qstat); - FAIL; - } else - CHECK; - - CHECKUNTESTED(1); ->>ASSERTION Good B 1 -When a cursor is created by a call to xname, -and the -.A source_font -or -.A mask_font -argument is freed be a subsequent call to -.F XFreeFont , -then the cursor is unaffected. ->>STRATEGY -Load xtfont0 using XLoadQueryFont. -Verify that XLoadQueryFont returns non-zero. -Load xtfont1 using XLoadQueryFont. -Verify that XLoadQueryFont returns non-zero. -Call XCreateGlyphCursor with foreground colour W_FG and background colour W_BG. -Verify that XCreateGlyphCursor returns non-zero. -Call XFreeFont for xtfont0. -Call XFreeFont for xtfont1. ->>CODE -Cursor qstat; -XFontStruct *font_struct0; -XFontStruct *font_struct1; - -/* Load xtfont0 using XLoadQueryFont. */ - font_struct0 = XLoadQueryFont(display, xtfont0); -/* Verify that XLoadQueryFont returns non-zero. */ - if (font_struct0 == (XFontStruct *) 0) { - delete("Could not load and query font \"%s\".", xtfont0); - return; - } - else - CHECK; -/* Load xtfont1 using XLoadQueryFont. */ - font_struct1 = XLoadQueryFont(display, xtfont1); -/* Verify that XLoadQueryFont returns non-zero. */ - if (font_struct1 == (XFontStruct *) 0) { - delete("Could not load and query font \"%s\".", xtfont1); - return; - } - else - CHECK; - source_font = font_struct0->fid; - mask_font = font_struct1->fid; - source_char = good_char0; - mask_char = good_char1; -/* Call XCreateGlyphCursor with foreground colour W_FG and background colour W_BG. */ - - qstat = XCALL; - -/* Verify that XCreateGlyphCursor returns non-zero. */ - if (qstat == (Cursor) 0) { - report("Returned wrong value %ld", (long) qstat); - FAIL; - } else - CHECK; - -/* Call XFreeFont for xtfont0. */ - XFreeFont(display, font_struct0); -/* Call XFreeFont for xtfont1. */ - XFreeFont(display, font_struct1); - - CHECKUNTESTED(3); ->>ASSERTION Good B 1 -For 2-byte matrix fonts, -the 16-bit value should be formed with the byte1 member -in the most significant byte and the byte2 member in the -least significant byte. ->>STRATEGY -Load 2-byte matrix font xtfont6 using XLoadFont. -Call XCreateGlyphCursor with foreground colour W_FG and -background colour W_BG. -Verify that XCreateGlyphCursor returns non-zero. ->>CODE -Cursor qstat; - -/* Load 2-byte matrix font xtfont6 using XLoadFont. */ - source_font = XLoadFont(display, xtfont6); - mask_font = source_font; - source_char = good_char6; - mask_char = good_char6; -/* Call XCreateGlyphCursor with foreground colour W_FG and */ -/* background colour W_BG. */ - - qstat = XCALL; - -/* Verify that XCreateGlyphCursor returns non-zero. */ - if (qstat == (Cursor) 0) { - report("Returned wrong value %ld", (long) qstat); - FAIL; - } else - CHECK; - - CHECKUNTESTED(1); ->>ASSERTION Bad B 1 -.ER BadAlloc ->>ASSERTION Bad A -When the -.A source_char -argument is not -a defined glyph in -.A source_font , -then a -.S BadValue -error occurs. ->>STRATEGY -Load xtfont0 using XLoadFont. -Call XCreateGlyphCursor with a source_char which is -an undefined glyph in source_font. -Verify that a BadValue error occurs. ->>CODE BadValue -Cursor qstat; - -/* Load xtfont0 using XLoadFont. */ - source_font = XLoadFont(display, xtfont0); - mask_font = source_font; - source_char = bad_char0; - mask_char = good_char0; - -/* Call XCreateGlyphCursor with a source_char which is */ -/* an undefined glyph in source_font. */ - XCALL; - -/* Verify that a BadValue error occurs. */ - if (geterr() == BadValue) - PASS; - else - FAIL; ->>ASSERTION Bad A -When -.A mask_font -is non-zero and -.A mask_char -is non-zero and not a defined glyph in -.A mask_font , -then a -.S BadValue -error occurs. ->>STRATEGY -Load xtfont0 using XLoadFont. -Call XCreateGlyphCursor with a mask_char which is -an undefined glyph in mask_font. -Verify that a BadValue error occurs. ->>CODE BadValue -Cursor qstat; - -/* Load xtfont0 using XLoadFont. */ - source_font = XLoadFont(display, xtfont0); - mask_font = source_font; - source_char = good_char0; - mask_char = bad_char0; - -/* Call XCreateGlyphCursor with a mask_char which is */ -/* an undefined glyph in mask_font. */ - XCALL; - -/* Verify that a BadValue error occurs. */ - if (geterr() == BadValue) - PASS; - else - FAIL; ->>ASSERTION Bad A -.ER BadFont bad-font ->>#HISTORY peterc Completed Updated as per RTCB#3 diff --git a/xts5/Xlib6/XCreatePixmap.m b/xts5/Xlib6/XCreatePixmap.m new file mode 100644 index 00000000..b866f106 --- /dev/null +++ b/xts5/Xlib6/XCreatePixmap.m @@ -0,0 +1,280 @@ +Copyright (c) 2005 X.Org Foundation L.L.C. + +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 +AUTHORS OR COPYRIGHT HOLDERS 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. + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/Xlib6/XCreatePixmap.m +>># +>># Description: +>># Tests for XCreatePixmap() +>># +>># Modifications: +>># $Log: crtpxmp.m,v $ +>># Revision 1.2 2005-11-03 08:43:41 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:29 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:26:50 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:45:08 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:19:04 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:15:35 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 08:48:53 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 00:47:49 andy +>># Prepare for GA Release +>># +/* +Portions of this software are based on Xlib and X Protocol Test Suite. +We have used this material under the terms of its copyright, which grants +free use, subject to the conditions below. Note however that those +portions of this software that are based on the original Test Suite have +been significantly revised and that all such revisions are copyright (c) +1995 Applied Testing and Technology, Inc. Insomuch as the proprietary +revisions cannot be separated from the freely copyable material, the net +result is that use of this software is governed by the ApTest copyright. + +Copyright (c) 1990, 1991 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. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +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 name of UniSoft not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. UniSoft +makes no representations about the suitability of this software for any +purpose. It is provided "as is" without express or implied warranty. +*/ +>>TITLE XCreatePixmap Xlib6 +void +XCreatePixmap(display, d, width, height, depth) +Display *display = Dsp; +Drawable d = DRW(display); +unsigned int width = 13; +unsigned int height = 17; +unsigned int depth; +>>ASSERTION Good A +A call to xname creates a pixmap of width +.A width , +height +.A height , +and depth +.A depth +on the same screen as the drawable argument +.A d , +and returns a pixmap ID. +>>STRATEGY +For each supported pixmap depth: + Create a pixmap of height 13, width 17. + Verify the depth, height and width with XGetGeometry. +>>CODE +XVisualInfo *vp; +Status gstat; +Window root_ret; +int x_ret, y_ret; +unsigned int w_ret, h_ret, bw_ret, bh_ret, dep_ret; +Pixmap pmap; + + + for(resetvinf(VI_PIX); nextvinf(&vp); ) { + depth = vp->depth; + d = DRW(display); + pmap = XCALL; + gstat = XGetGeometry(display, pmap, &root_ret, &x_ret, &y_ret, &w_ret, &h_ret, &bw_ret, &dep_ret); + + if(gstat != True) { + delete("XGetGeometry did not return True for pixmap ID 0x%x",pmap); + return; + } else + CHECK; + + if(w_ret != width) { + report("XGetGeometry returned width of %u instead of %u for pixmap of depth %u", w_ret, width, depth); + FAIL; + } else + CHECK; + + if(h_ret != height) { + report("XGetGeometry returned height of %u instead of %u for pixmap of depth %u", h_ret, height, depth); + FAIL; + } else + CHECK; + + if(dep_ret != depth) { + report("XGetGeometry returned depth of %u instead of depth %u", dep_ret, depth); + FAIL; + } else + CHECK; + + } + + CHECKPASS(4 * nvinf()); + +>>ASSERTION Good A +When the drawable argument +.A d +is an +.S InputOnly +window, then no error occurs. +>>STRATEGY +For each supported pixmap depth: + Create an InputOnly window. + Call XCreatePixmap with the window as the drawable argument. + Verify that no error occurred. +>>CODE +XVisualInfo *vp; + + for(resetvinf(VI_PIX); nextvinf(&vp); ) { + d = iponlywin(display); + depth = vp->depth; + XCALL; + + if(geterr() != Success) { + report("XCreatePixmap() produced error %s with an InputOnly Window as the drawable",errorname(geterr())); + FAIL; + } else + CHECK; + } + + CHECKPASS(nvinf()); + +>>ASSERTION Bad A +When either the +.A width +argument or +.A height +argument is zero, then a +.S BadValue +error occurs. +>>STRATEGY +For each supported pixmap depth: + Create a pixmap with height = 17 and width = 0 with XCreatePixmap. + Verify that a BadValue error occurred. + Create a pixmap with height = 0 and width = 19 with XCreatePixmap. + Verify that a BadValue error occurred. +>>CODE BadValue +XVisualInfo *vp; +unsigned int depth; + + for(resetvinf(VI_PIX); nextvinf(&vp); ) { + depth = vp->depth; + + d = DRW(display); + height = 17; + width = 0; + XCALL; + if(geterr() != BadValue) { + report("When XCreatePixmap called with zero width"); + report("Got %s, Expecting BadValue error", + errorname(geterr())); + FAIL; + } else + CHECK; + + width = 19; + height = 0; + XCALL; + if(geterr() != BadValue) { + report("When XCreatePixmap called with zero height"); + report("Got %s, Expecting BadValue error", + errorname(geterr())); + FAIL; + } else + CHECK; + } + + CHECKPASS(nvinf() * 2); + +>>ASSERTION Bad A +When the depth +.A depth +is not supported by the screen of the drawable +.A d, +then a +.S BadValue +error occurs. +>>STRATEGY +Call XCreatePixmap with depth argument set to the + sum of all supported pixmap depths plus 1. +Verify that a BadValue error occurred. +>>CODE BadValue +XVisualInfo *vp; +unsigned int depth, nondepth; + + nondepth = 1; + for(resetvinf(VI_PIX); nextvinf(&vp); ) + nondepth += vp->depth; + + trace("Selected unsupported depth is %u", nondepth); + d = DRW(display); + depth = nondepth; + XCALL; + if(geterr() != BadValue) { + report("When XCreatePixmap called with unsupported depth %d", + depth); + report("Got %s, Expecting BadValue error", errorname(geterr())); + FAIL; + } else + CHECK; + + CHECKPASS(1); + +>>ASSERTION Bad B 1 +.ER Alloc +>>ASSERTION Bad A +.ER Drawable +>>#HISTORY Cal Completed Written in new format and style. +>>#HISTORY Kieron Action +>>#HISTORY Cal Action Writing code. diff --git a/xts5/Xlib6/XCreatePixmap/XCreatePixmap.m b/xts5/Xlib6/XCreatePixmap/XCreatePixmap.m deleted file mode 100644 index f4536aef..00000000 --- a/xts5/Xlib6/XCreatePixmap/XCreatePixmap.m +++ /dev/null @@ -1,280 +0,0 @@ -Copyright (c) 2005 X.Org Foundation L.L.C. - -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 -AUTHORS OR COPYRIGHT HOLDERS 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. - -Copyright (c) Applied Testing and Technology, Inc. 1995 -All Rights Reserved. - ->># Project: VSW5 ->># ->># File: xts5/Xlib6/XCreatePixmap/XCreatePixmap.m ->># ->># Description: ->># Tests for XCreatePixmap() ->># ->># Modifications: ->># $Log: crtpxmp.m,v $ ->># Revision 1.2 2005-11-03 08:43:41 jmichael ->># clean up all vsw5 paths to use xts5 instead. ->># ->># Revision 1.1.1.2 2005/04/15 14:05:29 anderson ->># Reimport of the base with the legal name in the copyright fixed. ->># ->># Revision 8.0 1998/12/23 23:26:50 mar ->># Branch point for Release 5.0.2 ->># ->># Revision 7.0 1998/10/30 22:45:08 mar ->># Branch point for Release 5.0.2b1 ->># ->># Revision 6.0 1998/03/02 05:19:04 tbr ->># Branch point for Release 5.0.1 ->># ->># Revision 5.0 1998/01/26 03:15:35 tbr ->># Branch point for Release 5.0.1b1 ->># ->># Revision 4.0 1995/12/15 08:48:53 tbr ->># Branch point for Release 5.0.0 ->># ->># Revision 3.1 1995/12/15 00:47:49 andy ->># Prepare for GA Release ->># -/* -Portions of this software are based on Xlib and X Protocol Test Suite. -We have used this material under the terms of its copyright, which grants -free use, subject to the conditions below. Note however that those -portions of this software that are based on the original Test Suite have -been significantly revised and that all such revisions are copyright (c) -1995 Applied Testing and Technology, Inc. Insomuch as the proprietary -revisions cannot be separated from the freely copyable material, the net -result is that use of this software is governed by the ApTest copyright. - -Copyright (c) 1990, 1991 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. - -Permission to use, copy, modify, distribute, and sell this software and -its documentation for any purpose is hereby granted without fee, -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 name of UniSoft not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. UniSoft -makes no representations about the suitability of this software for any -purpose. It is provided "as is" without express or implied warranty. -*/ ->>TITLE XCreatePixmap Xlib6 -void -XCreatePixmap(display, d, width, height, depth) -Display *display = Dsp; -Drawable d = DRW(display); -unsigned int width = 13; -unsigned int height = 17; -unsigned int depth; ->>ASSERTION Good A -A call to xname creates a pixmap of width -.A width , -height -.A height , -and depth -.A depth -on the same screen as the drawable argument -.A d , -and returns a pixmap ID. ->>STRATEGY -For each supported pixmap depth: - Create a pixmap of height 13, width 17. - Verify the depth, height and width with XGetGeometry. ->>CODE -XVisualInfo *vp; -Status gstat; -Window root_ret; -int x_ret, y_ret; -unsigned int w_ret, h_ret, bw_ret, bh_ret, dep_ret; -Pixmap pmap; - - - for(resetvinf(VI_PIX); nextvinf(&vp); ) { - depth = vp->depth; - d = DRW(display); - pmap = XCALL; - gstat = XGetGeometry(display, pmap, &root_ret, &x_ret, &y_ret, &w_ret, &h_ret, &bw_ret, &dep_ret); - - if(gstat != True) { - delete("XGetGeometry did not return True for pixmap ID 0x%x",pmap); - return; - } else - CHECK; - - if(w_ret != width) { - report("XGetGeometry returned width of %u instead of %u for pixmap of depth %u", w_ret, width, depth); - FAIL; - } else - CHECK; - - if(h_ret != height) { - report("XGetGeometry returned height of %u instead of %u for pixmap of depth %u", h_ret, height, depth); - FAIL; - } else - CHECK; - - if(dep_ret != depth) { - report("XGetGeometry returned depth of %u instead of depth %u", dep_ret, depth); - FAIL; - } else - CHECK; - - } - - CHECKPASS(4 * nvinf()); - ->>ASSERTION Good A -When the drawable argument -.A d -is an -.S InputOnly -window, then no error occurs. ->>STRATEGY -For each supported pixmap depth: - Create an InputOnly window. - Call XCreatePixmap with the window as the drawable argument. - Verify that no error occurred. ->>CODE -XVisualInfo *vp; - - for(resetvinf(VI_PIX); nextvinf(&vp); ) { - d = iponlywin(display); - depth = vp->depth; - XCALL; - - if(geterr() != Success) { - report("XCreatePixmap() produced error %s with an InputOnly Window as the drawable",errorname(geterr())); - FAIL; - } else - CHECK; - } - - CHECKPASS(nvinf()); - ->>ASSERTION Bad A -When either the -.A width -argument or -.A height -argument is zero, then a -.S BadValue -error occurs. ->>STRATEGY -For each supported pixmap depth: - Create a pixmap with height = 17 and width = 0 with XCreatePixmap. - Verify that a BadValue error occurred. - Create a pixmap with height = 0 and width = 19 with XCreatePixmap. - Verify that a BadValue error occurred. ->>CODE BadValue -XVisualInfo *vp; -unsigned int depth; - - for(resetvinf(VI_PIX); nextvinf(&vp); ) { - depth = vp->depth; - - d = DRW(display); - height = 17; - width = 0; - XCALL; - if(geterr() != BadValue) { - report("When XCreatePixmap called with zero width"); - report("Got %s, Expecting BadValue error", - errorname(geterr())); - FAIL; - } else - CHECK; - - width = 19; - height = 0; - XCALL; - if(geterr() != BadValue) { - report("When XCreatePixmap called with zero height"); - report("Got %s, Expecting BadValue error", - errorname(geterr())); - FAIL; - } else - CHECK; - } - - CHECKPASS(nvinf() * 2); - ->>ASSERTION Bad A -When the depth -.A depth -is not supported by the screen of the drawable -.A d, -then a -.S BadValue -error occurs. ->>STRATEGY -Call XCreatePixmap with depth argument set to the - sum of all supported pixmap depths plus 1. -Verify that a BadValue error occurred. ->>CODE BadValue -XVisualInfo *vp; -unsigned int depth, nondepth; - - nondepth = 1; - for(resetvinf(VI_PIX); nextvinf(&vp); ) - nondepth += vp->depth; - - trace("Selected unsupported depth is %u", nondepth); - d = DRW(display); - depth = nondepth; - XCALL; - if(geterr() != BadValue) { - report("When XCreatePixmap called with unsupported depth %d", - depth); - report("Got %s, Expecting BadValue error", errorname(geterr())); - FAIL; - } else - CHECK; - - CHECKPASS(1); - ->>ASSERTION Bad B 1 -.ER Alloc ->>ASSERTION Bad A -.ER Drawable ->>#HISTORY Cal Completed Written in new format and style. ->>#HISTORY Kieron Action ->>#HISTORY Cal Action Writing code. diff --git a/xts5/Xlib6/XCreatePixmapCursor.m b/xts5/Xlib6/XCreatePixmapCursor.m new file mode 100644 index 00000000..5f8946ec --- /dev/null +++ b/xts5/Xlib6/XCreatePixmapCursor.m @@ -0,0 +1,565 @@ +Copyright (c) 2005 X.Org Foundation L.L.C. + +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 +AUTHORS OR COPYRIGHT HOLDERS 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. + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/Xlib6/XCreatePixmapCursor.m +>># +>># Description: +>># Tests for XCreatePixmapCursor() +>># +>># Modifications: +>># $Log: crtpxmpcrs.m,v $ +>># Revision 1.2 2005-11-03 08:43:41 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:29 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:26:52 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:45:10 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:19:05 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:15:36 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 08:48:58 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 00:47:58 andy +>># Prepare for GA Release +>># +/* +Portions of this software are based on Xlib and X Protocol Test Suite. +We have used this material under the terms of its copyright, which grants +free use, subject to the conditions below. Note however that those +portions of this software that are based on the original Test Suite have +been significantly revised and that all such revisions are copyright (c) +1995 Applied Testing and Technology, Inc. Insomuch as the proprietary +revisions cannot be separated from the freely copyable material, the net +result is that use of this software is governed by the ApTest copyright. + +Copyright (c) 1990, 1991 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. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +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 name of UniSoft not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. UniSoft +makes no representations about the suitability of this software for any +purpose. It is provided "as is" without express or implied warranty. +*/ +>>TITLE XCreatePixmapCursor Xlib6 +Cursor +XCreatePixmapCursor(display, source, mask, foreground_color, background_color, x, y) +Display *display = Dsp; +Pixmap source; +Pixmap mask; +XColor *foreground_color = mkcolor(1); +XColor *background_color = mkcolor(0); +unsigned int x = 0; +unsigned int y = 0; +>>EXTERN +static XVisualInfo depth1; + +/* + * mkcolor() - return a pointer to a color structure. + * flag indicates whether or not color is foreground + */ +static XColor * +mkcolor(flag) +{ + static XColor fore; + static XColor back; + static int first = 1; + + if (first) + { + first = 0; + + fore.pixel = BlackPixel(display, DefaultScreen(display)); + XQueryColor(display, DefaultColormap(display, DefaultScreen(display)), &fore); + back.pixel = WhitePixel(display, DefaultScreen(display)); + XQueryColor(display, DefaultColormap(display, DefaultScreen(display)), &back); + } + return(flag ? &fore : &back); +} +>>ASSERTION Good B 1 +A call to xname creates a +.S Cursor +from the +.A source +and +.A mask +pixmaps +with colours defined by +.A foreground_color +and +.A background_color +and hotspot position given by +.A x +and +.A y +and returns the cursor ID. +>>STRATEGY +Create source pixmap. +Create mask pixmap. +Call XCreatePixmapCursor with foreground colour W_FG and +background colour W_BG and hotspot at (0,0). +Verify that XCreatePixmapCursor returns non-zero. +>>CODE +Cursor qstat; + + depth1.depth = 1; +/* Create source pixmap. */ + source = makepixm(display, &depth1); + +/* Create mask pixmap. */ + mask = makepixm(display, &depth1); + +/* Call XCreatePixmapCursor with foreground colour W_FG and */ +/* background colour W_BG and hotspot at (0,0). */ + qstat = XCALL; + +/* Verify that XCreatePixmapCursor returns non-zero. */ + if (qstat == (Cursor) 0) { + report("Returned incorrect value %ld", (long) qstat); + FAIL; + } else + CHECK; + + CHECKUNTESTED(1); +>>ASSERTION Good B 1 +When +.A mask +is +.S None , +then all pixels of the +.A source +are displayed. +>>STRATEGY +Create source pixmap. +Call XCreatePixmapCursor with mask None. +Verify that XCreatePixmapCursor returns non-zero. +>>CODE +Cursor qstat; + + depth1.depth = 1; +/* Create source pixmap. */ + source = makepixm(display, &depth1); + + mask = None; +/* Call XCreatePixmapCursor with mask None. */ + qstat = XCALL; + +/* Verify that XCreatePixmapCursor returns non-zero. */ + if (qstat == (Cursor) 0) { + report("Returned incorrect value %ld", (long) qstat); + FAIL; + } else + CHECK; + + CHECKUNTESTED(1); +>>ASSERTION Good B 1 +When +.A mask +is other than +.S None +and a given bit in the +.A mask +bitmap is 1, then +the corresponding pixel of +.A source +is displayed. +>>STRATEGY +Create source pixmap. +Create mask pixmap. +Call XCreatePixmapCursor with mask other than none and +mask with at least one bit set. +Verify that XCreatePixmapCursor returns non-zero. +>>CODE +Cursor qstat; + + depth1.depth = 1; +/* Create source pixmap. */ + source = makepixm(display, &depth1); +/* Create mask pixmap. */ + mask = makepixm(display, &depth1); + +/* Call XCreatePixmapCursor with mask other than none and */ +/* mask with at least one bit set. */ + qstat = XCALL; + +/* Verify that XCreatePixmapCursor returns non-zero. */ + if (qstat == (Cursor) 0) { + report("Returned incorrect value %ld", (long) qstat); + FAIL; + } else + CHECK; + + CHECKUNTESTED(1); +>>ASSERTION Good B 1 +When +.A mask +is other than +.S None +and a given bit in the +.A mask +bitmap is 0, then +the corresponding pixel of +.A source +is not displayed. +>>STRATEGY +Create source pixmap. +Create mask pixmap. +Call XCreatePixmapCursor with mask other than none and +mask with at least one bit not set. +Verify that XCreatePixmapCursor returns non-zero. +>>CODE +Cursor qstat; + + depth1.depth = 1; +/* Create source pixmap. */ + source = makepixm(display, &depth1); +/* Create mask pixmap. */ + mask = makepixm(display, &depth1); + dset(display, (Drawable) mask, (unsigned long) 0); + +/* Call XCreatePixmapCursor with mask other than none and */ +/* mask with at least one bit not set. */ + qstat = XCALL; + +/* Verify that XCreatePixmapCursor returns non-zero. */ + if (qstat == (Cursor) 0) { + report("Returned incorrect value %ld", (long) qstat); + FAIL; + } else + CHECK; + + CHECKUNTESTED(1); +>>ASSERTION Good B 1 +When a bit in the +.A source +bitmap is 1, then +.A foreground_color +is used. +>>STRATEGY +Create source pixmap. +Create mask pixmap. +Call XCreatePixmapCursor with source bitmap containing +at least one bit set to 1. +Verify that XCreatePixmapCursor returns non-zero. +>>CODE +Cursor qstat; + + depth1.depth = 1; +/* Create source pixmap. */ + source = makepixm(display, &depth1); +/* Create mask pixmap. */ + mask = makepixm(display, &depth1); + +/* Call XCreatePixmapCursor with source bitmap containing */ +/* at least one bit set to 1. */ + qstat = XCALL; + +/* Verify that XCreatePixmapCursor returns non-zero. */ + if (qstat == (Cursor) 0) { + report("Returned incorrect value %ld", (long) qstat); + FAIL; + } else + CHECK; + + CHECKUNTESTED(1); +>>ASSERTION Good B 1 +When a bit in the +.A source +bitmap is 0, then +.A background_color +is used. +>>STRATEGY +Create source pixmap. +Create mask pixmap. +Call XCreatePixmapCursor with source bitmap containing +at least one bit set to 0. +Verify that XCreatePixmapCursor returns non-zero. +>>CODE +Cursor qstat; + + depth1.depth = 1; +/* Create source pixmap. */ + source = makepixm(display, &depth1); + dset(display, (Drawable) source, 0); +/* Create mask pixmap. */ + mask = makepixm(display, &depth1); + +/* Call XCreatePixmapCursor with source bitmap containing */ +/* at least one bit set to 0. */ + qstat = XCALL; + +/* Verify that XCreatePixmapCursor returns non-zero. */ + if (qstat == (Cursor) 0) { + report("Returned incorrect value %ld", (long) qstat); + FAIL; + } else + CHECK; + + CHECKUNTESTED(1); +>>ASSERTION Good B 1 +When a +.S Cursor +is created by a call to xname, +and the +.A source +and/or +.A mask +argument is freed by a subsequent call to +.F XFreePixmap , +then the cursor is unaffected. +>>STRATEGY +Create source pixmap. +Create mask pixmap. +Call XCreatePixmapCursor with mask other than none and +mask with at least one bit set. +Verify that XCreatePixmapCursor returns non-zero. +Call XFreePixmap with source pixmap. +Call XFreePixmap with mask pixmap. +>>CODE +Cursor qstat; + +/* Create source pixmap. */ + source = XCreatePixmap(display, DRW(display), 2, 2, 1); +/* Create mask pixmap. */ + mask = XCreatePixmap(display, DRW(display), 2, 2, 1); + +/* Call XCreatePixmapCursor with mask other than none and */ +/* mask with at least one bit set. */ + qstat = XCALL; + +/* Verify that XCreatePixmapCursor returns non-zero. */ + if (qstat == (Cursor) 0) { + report("Returned incorrect value %ld", (long) qstat); + FAIL; + } else + CHECK; + +/* Call XFreePixmap with source pixmap. */ + XFreePixmap(display, source); + +/* Call XFreePixmap with mask pixmap. */ + XFreePixmap(display, mask); + + CHECKUNTESTED(1); +>># Assertion should mention that test is only +>># appropriate for servers which support depth!= 1 +>>ASSERTION Bad C +If multiple window depths are supported: +When +.A source +does not have depth one, then a +.S BadMatch +error occurs. +>>STRATEGY +If only one depth supported report UNSUPPORTED. +Create source pixmap of depth not equal to one. +Create mask pixmap. +Call XCreatePixmapCursor with source pixmap. +Verify that BadMatch error occurred. +>>CODE BadMatch +XVisualInfo *vp; +Cursor qstat; + + depth1.depth = 1; +/* If only one depth supported report UNSUPPORTED. */ + for (resetvinf(VI_PIX); nextvinf(&vp); ) { + if (vp->depth != 1) { + depth1.depth = vp->depth; + break; + } + } + if (depth1.depth == 1) { + unsupported("Only one depth of window is supported"); + return; + } +/* Create source pixmap of depth not equal to one. */ + source = makepixm(display, &depth1); +/* Create mask pixmap. */ + depth1.depth = 1; + mask = makepixm(display, &depth1); + +/* Call XCreatePixmapCursor with source pixmap. */ + XCALL; + +/* Verify that BadMatch error occurred. */ + if (geterr() == BadMatch) + PASS; + else + FAIL; +>>ASSERTION Bad A +When +.A mask +is not +.S None +and +.A mask +does not have depth one, then a +.S BadMatch +error occurs. +>>STRATEGY +If only one depth supported report UNSUPPORTED. +Create mask pixmap of depth not equal to one. +Create source pixmap. +Call XCreatePixmapCursor with mask pixmap. +Verify that BadMatch error occurred. +>>CODE BadMatch +XVisualInfo *vp; +Cursor qstat; + + depth1.depth = 1; +/* If only one depth supported report UNSUPPORTED. */ + for (resetvinf(VI_PIX); nextvinf(&vp); ) { + if (vp->depth != 1) { + depth1.depth = vp->depth; + break; + } + } + if (depth1.depth == 1) { + report("Only one depth supported"); + tet_result(TET_UNSUPPORTED); + return; + } +/* Create mask pixmap of depth not equal to one. */ + mask = makepixm(display, &depth1); +/* Create source pixmap. */ + depth1.depth = 1; + source = makepixm(display, &depth1); + +/* Call XCreatePixmapCursor with mask pixmap. */ + XCALL; + +/* Verify that BadMatch error occurred. */ + if (geterr() == BadMatch) + PASS; + else + FAIL; +>>ASSERTION Bad A +When +.A mask +is not +.S None +and both +.A source +and +.A mask +are not the same size, then a +.S BadMatch +error occurs. +>>STRATEGY +Create source pixmap of size 1x1. +Create mask pixmap of size 2x2. +Call XCreatePixmapCursor with mask pixmap. +Verify that BadMatch error occurred. +>>CODE BadMatch +Cursor qstat; + + depth1.depth = 1; +/* Create source pixmap of size 1x1. */ + source = XCreatePixmap(display, DRW(display), 1, 1, 1); + regid(display, (union regtypes *)&source, REG_PIXMAP); +/* Create mask pixmap of size 2x2. */ + mask = XCreatePixmap(display, DRW(display), 2, 2, 1); + regid(display, (union regtypes *)&mask, REG_PIXMAP); + +/* Call XCreatePixmapCursor with mask pixmap. */ + XCALL; + +/* Verify that BadMatch error occurred. */ + if (geterr() == BadMatch) + PASS; + else + FAIL; +>>ASSERTION Bad A +When the hotspot position is not a point within the +.A source +pixmap, +then a +.S BadMatch +error occurs. +>>STRATEGY +Create source pixmap. +Create mask pixmap. +Call XCreatePixmapCursor with hotspot outside the source pixmap. +Verify that BadMatch error occurred. +>>CODE BadMatch +Cursor qstat; + + depth1.depth = 1; +/* Create source pixmap. */ + source = makepixm(display, &depth1); +/* Create mask pixmap. */ + mask = makepixm(display, &depth1); + + x = 2 * W_STDWIDTH + 1; + y = 2 * W_STDHEIGHT + 1; + +/* Call XCreatePixmapCursor with hotspot outside the source pixmap. */ + XCALL; + +/* Verify that BadMatch error occurred. */ + if (geterr() == BadMatch) + PASS; + else + FAIL; +>>ASSERTION Bad B 1 +.ER BadAlloc +>>ASSERTION Bad A +.ER BadPixmap +>>#HISTORY peterc Completed Updated as per RTCB#3 +>>#HISTORY peterc Completed Wrote STRATEGY and CODE diff --git a/xts5/Xlib6/XCreatePixmapCursor/XCreatePixmapCursor.m b/xts5/Xlib6/XCreatePixmapCursor/XCreatePixmapCursor.m deleted file mode 100644 index a27471d5..00000000 --- a/xts5/Xlib6/XCreatePixmapCursor/XCreatePixmapCursor.m +++ /dev/null @@ -1,565 +0,0 @@ -Copyright (c) 2005 X.Org Foundation L.L.C. - -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 -AUTHORS OR COPYRIGHT HOLDERS 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. - -Copyright (c) Applied Testing and Technology, Inc. 1995 -All Rights Reserved. - ->># Project: VSW5 ->># ->># File: xts5/Xlib6/XCreatePixmapCursor/XCreatePixmapCursor.m ->># ->># Description: ->># Tests for XCreatePixmapCursor() ->># ->># Modifications: ->># $Log: crtpxmpcrs.m,v $ ->># Revision 1.2 2005-11-03 08:43:41 jmichael ->># clean up all vsw5 paths to use xts5 instead. ->># ->># Revision 1.1.1.2 2005/04/15 14:05:29 anderson ->># Reimport of the base with the legal name in the copyright fixed. ->># ->># Revision 8.0 1998/12/23 23:26:52 mar ->># Branch point for Release 5.0.2 ->># ->># Revision 7.0 1998/10/30 22:45:10 mar ->># Branch point for Release 5.0.2b1 ->># ->># Revision 6.0 1998/03/02 05:19:05 tbr ->># Branch point for Release 5.0.1 ->># ->># Revision 5.0 1998/01/26 03:15:36 tbr ->># Branch point for Release 5.0.1b1 ->># ->># Revision 4.0 1995/12/15 08:48:58 tbr ->># Branch point for Release 5.0.0 ->># ->># Revision 3.1 1995/12/15 00:47:58 andy ->># Prepare for GA Release ->># -/* -Portions of this software are based on Xlib and X Protocol Test Suite. -We have used this material under the terms of its copyright, which grants -free use, subject to the conditions below. Note however that those -portions of this software that are based on the original Test Suite have -been significantly revised and that all such revisions are copyright (c) -1995 Applied Testing and Technology, Inc. Insomuch as the proprietary -revisions cannot be separated from the freely copyable material, the net -result is that use of this software is governed by the ApTest copyright. - -Copyright (c) 1990, 1991 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. - -Permission to use, copy, modify, distribute, and sell this software and -its documentation for any purpose is hereby granted without fee, -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 name of UniSoft not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. UniSoft -makes no representations about the suitability of this software for any -purpose. It is provided "as is" without express or implied warranty. -*/ ->>TITLE XCreatePixmapCursor Xlib6 -Cursor -XCreatePixmapCursor(display, source, mask, foreground_color, background_color, x, y) -Display *display = Dsp; -Pixmap source; -Pixmap mask; -XColor *foreground_color = mkcolor(1); -XColor *background_color = mkcolor(0); -unsigned int x = 0; -unsigned int y = 0; ->>EXTERN -static XVisualInfo depth1; - -/* - * mkcolor() - return a pointer to a color structure. - * flag indicates whether or not color is foreground - */ -static XColor * -mkcolor(flag) -{ - static XColor fore; - static XColor back; - static int first = 1; - - if (first) - { - first = 0; - - fore.pixel = BlackPixel(display, DefaultScreen(display)); - XQueryColor(display, DefaultColormap(display, DefaultScreen(display)), &fore); - back.pixel = WhitePixel(display, DefaultScreen(display)); - XQueryColor(display, DefaultColormap(display, DefaultScreen(display)), &back); - } - return(flag ? &fore : &back); -} ->>ASSERTION Good B 1 -A call to xname creates a -.S Cursor -from the -.A source -and -.A mask -pixmaps -with colours defined by -.A foreground_color -and -.A background_color -and hotspot position given by -.A x -and -.A y -and returns the cursor ID. ->>STRATEGY -Create source pixmap. -Create mask pixmap. -Call XCreatePixmapCursor with foreground colour W_FG and -background colour W_BG and hotspot at (0,0). -Verify that XCreatePixmapCursor returns non-zero. ->>CODE -Cursor qstat; - - depth1.depth = 1; -/* Create source pixmap. */ - source = makepixm(display, &depth1); - -/* Create mask pixmap. */ - mask = makepixm(display, &depth1); - -/* Call XCreatePixmapCursor with foreground colour W_FG and */ -/* background colour W_BG and hotspot at (0,0). */ - qstat = XCALL; - -/* Verify that XCreatePixmapCursor returns non-zero. */ - if (qstat == (Cursor) 0) { - report("Returned incorrect value %ld", (long) qstat); - FAIL; - } else - CHECK; - - CHECKUNTESTED(1); ->>ASSERTION Good B 1 -When -.A mask -is -.S None , -then all pixels of the -.A source -are displayed. ->>STRATEGY -Create source pixmap. -Call XCreatePixmapCursor with mask None. -Verify that XCreatePixmapCursor returns non-zero. ->>CODE -Cursor qstat; - - depth1.depth = 1; -/* Create source pixmap. */ - source = makepixm(display, &depth1); - - mask = None; -/* Call XCreatePixmapCursor with mask None. */ - qstat = XCALL; - -/* Verify that XCreatePixmapCursor returns non-zero. */ - if (qstat == (Cursor) 0) { - report("Returned incorrect value %ld", (long) qstat); - FAIL; - } else - CHECK; - - CHECKUNTESTED(1); ->>ASSERTION Good B 1 -When -.A mask -is other than -.S None -and a given bit in the -.A mask -bitmap is 1, then -the corresponding pixel of -.A source -is displayed. ->>STRATEGY -Create source pixmap. -Create mask pixmap. -Call XCreatePixmapCursor with mask other than none and -mask with at least one bit set. -Verify that XCreatePixmapCursor returns non-zero. ->>CODE -Cursor qstat; - - depth1.depth = 1; -/* Create source pixmap. */ - source = makepixm(display, &depth1); -/* Create mask pixmap. */ - mask = makepixm(display, &depth1); - -/* Call XCreatePixmapCursor with mask other than none and */ -/* mask with at least one bit set. */ - qstat = XCALL; - -/* Verify that XCreatePixmapCursor returns non-zero. */ - if (qstat == (Cursor) 0) { - report("Returned incorrect value %ld", (long) qstat); - FAIL; - } else - CHECK; - - CHECKUNTESTED(1); ->>ASSERTION Good B 1 -When -.A mask -is other than -.S None -and a given bit in the -.A mask -bitmap is 0, then -the corresponding pixel of -.A source -is not displayed. ->>STRATEGY -Create source pixmap. -Create mask pixmap. -Call XCreatePixmapCursor with mask other than none and -mask with at least one bit not set. -Verify that XCreatePixmapCursor returns non-zero. ->>CODE -Cursor qstat; - - depth1.depth = 1; -/* Create source pixmap. */ - source = makepixm(display, &depth1); -/* Create mask pixmap. */ - mask = makepixm(display, &depth1); - dset(display, (Drawable) mask, (unsigned long) 0); - -/* Call XCreatePixmapCursor with mask other than none and */ -/* mask with at least one bit not set. */ - qstat = XCALL; - -/* Verify that XCreatePixmapCursor returns non-zero. */ - if (qstat == (Cursor) 0) { - report("Returned incorrect value %ld", (long) qstat); - FAIL; - } else - CHECK; - - CHECKUNTESTED(1); ->>ASSERTION Good B 1 -When a bit in the -.A source -bitmap is 1, then -.A foreground_color -is used. ->>STRATEGY -Create source pixmap. -Create mask pixmap. -Call XCreatePixmapCursor with source bitmap containing -at least one bit set to 1. -Verify that XCreatePixmapCursor returns non-zero. ->>CODE -Cursor qstat; - - depth1.depth = 1; -/* Create source pixmap. */ - source = makepixm(display, &depth1); -/* Create mask pixmap. */ - mask = makepixm(display, &depth1); - -/* Call XCreatePixmapCursor with source bitmap containing */ -/* at least one bit set to 1. */ - qstat = XCALL; - -/* Verify that XCreatePixmapCursor returns non-zero. */ - if (qstat == (Cursor) 0) { - report("Returned incorrect value %ld", (long) qstat); - FAIL; - } else - CHECK; - - CHECKUNTESTED(1); ->>ASSERTION Good B 1 -When a bit in the -.A source -bitmap is 0, then -.A background_color -is used. ->>STRATEGY -Create source pixmap. -Create mask pixmap. -Call XCreatePixmapCursor with source bitmap containing -at least one bit set to 0. -Verify that XCreatePixmapCursor returns non-zero. ->>CODE -Cursor qstat; - - depth1.depth = 1; -/* Create source pixmap. */ - source = makepixm(display, &depth1); - dset(display, (Drawable) source, 0); -/* Create mask pixmap. */ - mask = makepixm(display, &depth1); - -/* Call XCreatePixmapCursor with source bitmap containing */ -/* at least one bit set to 0. */ - qstat = XCALL; - -/* Verify that XCreatePixmapCursor returns non-zero. */ - if (qstat == (Cursor) 0) { - report("Returned incorrect value %ld", (long) qstat); - FAIL; - } else - CHECK; - - CHECKUNTESTED(1); ->>ASSERTION Good B 1 -When a -.S Cursor -is created by a call to xname, -and the -.A source -and/or -.A mask -argument is freed by a subsequent call to -.F XFreePixmap , -then the cursor is unaffected. ->>STRATEGY -Create source pixmap. -Create mask pixmap. -Call XCreatePixmapCursor with mask other than none and -mask with at least one bit set. -Verify that XCreatePixmapCursor returns non-zero. -Call XFreePixmap with source pixmap. -Call XFreePixmap with mask pixmap. ->>CODE -Cursor qstat; - -/* Create source pixmap. */ - source = XCreatePixmap(display, DRW(display), 2, 2, 1); -/* Create mask pixmap. */ - mask = XCreatePixmap(display, DRW(display), 2, 2, 1); - -/* Call XCreatePixmapCursor with mask other than none and */ -/* mask with at least one bit set. */ - qstat = XCALL; - -/* Verify that XCreatePixmapCursor returns non-zero. */ - if (qstat == (Cursor) 0) { - report("Returned incorrect value %ld", (long) qstat); - FAIL; - } else - CHECK; - -/* Call XFreePixmap with source pixmap. */ - XFreePixmap(display, source); - -/* Call XFreePixmap with mask pixmap. */ - XFreePixmap(display, mask); - - CHECKUNTESTED(1); ->># Assertion should mention that test is only ->># appropriate for servers which support depth!= 1 ->>ASSERTION Bad C -If multiple window depths are supported: -When -.A source -does not have depth one, then a -.S BadMatch -error occurs. ->>STRATEGY -If only one depth supported report UNSUPPORTED. -Create source pixmap of depth not equal to one. -Create mask pixmap. -Call XCreatePixmapCursor with source pixmap. -Verify that BadMatch error occurred. ->>CODE BadMatch -XVisualInfo *vp; -Cursor qstat; - - depth1.depth = 1; -/* If only one depth supported report UNSUPPORTED. */ - for (resetvinf(VI_PIX); nextvinf(&vp); ) { - if (vp->depth != 1) { - depth1.depth = vp->depth; - break; - } - } - if (depth1.depth == 1) { - unsupported("Only one depth of window is supported"); - return; - } -/* Create source pixmap of depth not equal to one. */ - source = makepixm(display, &depth1); -/* Create mask pixmap. */ - depth1.depth = 1; - mask = makepixm(display, &depth1); - -/* Call XCreatePixmapCursor with source pixmap. */ - XCALL; - -/* Verify that BadMatch error occurred. */ - if (geterr() == BadMatch) - PASS; - else - FAIL; ->>ASSERTION Bad A -When -.A mask -is not -.S None -and -.A mask -does not have depth one, then a -.S BadMatch -error occurs. ->>STRATEGY -If only one depth supported report UNSUPPORTED. -Create mask pixmap of depth not equal to one. -Create source pixmap. -Call XCreatePixmapCursor with mask pixmap. -Verify that BadMatch error occurred. ->>CODE BadMatch -XVisualInfo *vp; -Cursor qstat; - - depth1.depth = 1; -/* If only one depth supported report UNSUPPORTED. */ - for (resetvinf(VI_PIX); nextvinf(&vp); ) { - if (vp->depth != 1) { - depth1.depth = vp->depth; - break; - } - } - if (depth1.depth == 1) { - report("Only one depth supported"); - tet_result(TET_UNSUPPORTED); - return; - } -/* Create mask pixmap of depth not equal to one. */ - mask = makepixm(display, &depth1); -/* Create source pixmap. */ - depth1.depth = 1; - source = makepixm(display, &depth1); - -/* Call XCreatePixmapCursor with mask pixmap. */ - XCALL; - -/* Verify that BadMatch error occurred. */ - if (geterr() == BadMatch) - PASS; - else - FAIL; ->>ASSERTION Bad A -When -.A mask -is not -.S None -and both -.A source -and -.A mask -are not the same size, then a -.S BadMatch -error occurs. ->>STRATEGY -Create source pixmap of size 1x1. -Create mask pixmap of size 2x2. -Call XCreatePixmapCursor with mask pixmap. -Verify that BadMatch error occurred. ->>CODE BadMatch -Cursor qstat; - - depth1.depth = 1; -/* Create source pixmap of size 1x1. */ - source = XCreatePixmap(display, DRW(display), 1, 1, 1); - regid(display, (union regtypes *)&source, REG_PIXMAP); -/* Create mask pixmap of size 2x2. */ - mask = XCreatePixmap(display, DRW(display), 2, 2, 1); - regid(display, (union regtypes *)&mask, REG_PIXMAP); - -/* Call XCreatePixmapCursor with mask pixmap. */ - XCALL; - -/* Verify that BadMatch error occurred. */ - if (geterr() == BadMatch) - PASS; - else - FAIL; ->>ASSERTION Bad A -When the hotspot position is not a point within the -.A source -pixmap, -then a -.S BadMatch -error occurs. ->>STRATEGY -Create source pixmap. -Create mask pixmap. -Call XCreatePixmapCursor with hotspot outside the source pixmap. -Verify that BadMatch error occurred. ->>CODE BadMatch -Cursor qstat; - - depth1.depth = 1; -/* Create source pixmap. */ - source = makepixm(display, &depth1); -/* Create mask pixmap. */ - mask = makepixm(display, &depth1); - - x = 2 * W_STDWIDTH + 1; - y = 2 * W_STDHEIGHT + 1; - -/* Call XCreatePixmapCursor with hotspot outside the source pixmap. */ - XCALL; - -/* Verify that BadMatch error occurred. */ - if (geterr() == BadMatch) - PASS; - else - FAIL; ->>ASSERTION Bad B 1 -.ER BadAlloc ->>ASSERTION Bad A -.ER BadPixmap ->>#HISTORY peterc Completed Updated as per RTCB#3 ->>#HISTORY peterc Completed Wrote STRATEGY and CODE diff --git a/xts5/Xlib6/XFreeCursor.m b/xts5/Xlib6/XFreeCursor.m new file mode 100644 index 00000000..e64def0c --- /dev/null +++ b/xts5/Xlib6/XFreeCursor.m @@ -0,0 +1,212 @@ +Copyright (c) 2005 X.Org Foundation L.L.C. + +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 +AUTHORS OR COPYRIGHT HOLDERS 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. + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/Xlib6/XFreeCursor.m +>># +>># Description: +>># Tests for XFreeCursor() +>># +>># Modifications: +>># $Log: frcrsr.m,v $ +>># Revision 1.2 2005-11-03 08:43:41 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:29 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:26:52 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:45:11 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:19:06 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:15:37 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 08:49:00 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 00:48:01 andy +>># Prepare for GA Release +>># +/* +Portions of this software are based on Xlib and X Protocol Test Suite. +We have used this material under the terms of its copyright, which grants +free use, subject to the conditions below. Note however that those +portions of this software that are based on the original Test Suite have +been significantly revised and that all such revisions are copyright (c) +1995 Applied Testing and Technology, Inc. Insomuch as the proprietary +revisions cannot be separated from the freely copyable material, the net +result is that use of this software is governed by the ApTest copyright. + +Copyright (c) 1990, 1991 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. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +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 name of UniSoft not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. UniSoft +makes no representations about the suitability of this software for any +purpose. It is provided "as is" without express or implied warranty. +*/ +>>TITLE XFreeCursor Xlib6 +void +XFreeCursor(display, cursor) +Display *display = Dsp; +Cursor cursor; +>>SET startup fontstartup +>>SET cleanup fontcleanup +>>ASSERTION Good B 1 +When another resource ID references the +.A cursor , +then a call to xname +deletes the association between the +.A cursor +resource ID +and the specified cursor. +>>STRATEGY +Create cursor and cursor2 as same cursors. +Create window. +Define cursor for window. +Call XFreeCursor with cursor. +Call XFreeCursor with cursor2. +>>CODE +Cursor cursor2; +Window w; +XVisualInfo *vp; +unsigned int shape; + + + /* UNSUPPORTED is not allowed */ + shape = config.fontcursor_good; + if (shape == -1) { + delete("A value of UNSUPPORTED is not allowed for XT_FONTCURSOR_GOOD"); + return; + } + + for (resetvinf(VI_WIN); nextvinf(&vp); ) { +/* Create cursor and cursor2 as same cursors. */ + cursor = XCreateFontCursor(display, shape); + cursor2 = XCreateFontCursor(display, shape); + +/* Create window. */ + w = makewin(display, vp); + +/* Define cursor for window. */ + XDefineCursor(display, w, cursor); + +/* Call XFreeCursor with cursor. */ + XCALL; + if (geterr() == Success) + CHECK; + else + FAIL; + +/* Call XFreeCursor with cursor2. */ + cursor = cursor2; + XCALL; + + if (geterr() == Success) + CHECK; + else + FAIL; + } + + CHECKUNTESTED(2*nvinf()); +>>ASSERTION Good B 1 +When no other resource ID references the +.A cursor , +then a call to xname +deletes the association between the +.A cursor +resource ID +and the specified cursor, +and the cursor storage is freed. +>>STRATEGY +Create cursor and cursor2 as same cursors. +Call XFreeCursor with cursor. +Call XFreeCursor with cursor2. +>>CODE +Cursor cursor2; +unsigned int shape; + + /* UNSUPPORTED is not allowed */ + shape = config.fontcursor_good; + if (shape == -1) { + delete("A value of UNSUPPORTED is not allowed for XT_FONTCURSOR_GOOD"); + return; + } + +/* Create cursor and cursor2 as same cursors. */ + cursor = XCreateFontCursor(display, shape); + cursor2 = XCreateFontCursor(display, shape); + +/* Call XFreeCursor with cursor. */ + XCALL; + if (geterr() == Success) + CHECK; + else + FAIL; + +/* Call XFreeCursor with cursor2. */ + cursor = cursor2; + XCALL; + + if (geterr() == Success) + CHECK; + else + FAIL; + + CHECKUNTESTED(2); +>>ASSERTION Bad A +.ER BadCursor +>># HISTORY kieron Completed Check format and pass ac +>>#HISTORY peterc Completed Wrote STRATEGY and CODE diff --git a/xts5/Xlib6/XFreeCursor/XFreeCursor.m b/xts5/Xlib6/XFreeCursor/XFreeCursor.m deleted file mode 100644 index 98f9b430..00000000 --- a/xts5/Xlib6/XFreeCursor/XFreeCursor.m +++ /dev/null @@ -1,212 +0,0 @@ -Copyright (c) 2005 X.Org Foundation L.L.C. - -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 -AUTHORS OR COPYRIGHT HOLDERS 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. - -Copyright (c) Applied Testing and Technology, Inc. 1995 -All Rights Reserved. - ->># Project: VSW5 ->># ->># File: xts5/Xlib6/XFreeCursor/XFreeCursor.m ->># ->># Description: ->># Tests for XFreeCursor() ->># ->># Modifications: ->># $Log: frcrsr.m,v $ ->># Revision 1.2 2005-11-03 08:43:41 jmichael ->># clean up all vsw5 paths to use xts5 instead. ->># ->># Revision 1.1.1.2 2005/04/15 14:05:29 anderson ->># Reimport of the base with the legal name in the copyright fixed. ->># ->># Revision 8.0 1998/12/23 23:26:52 mar ->># Branch point for Release 5.0.2 ->># ->># Revision 7.0 1998/10/30 22:45:11 mar ->># Branch point for Release 5.0.2b1 ->># ->># Revision 6.0 1998/03/02 05:19:06 tbr ->># Branch point for Release 5.0.1 ->># ->># Revision 5.0 1998/01/26 03:15:37 tbr ->># Branch point for Release 5.0.1b1 ->># ->># Revision 4.0 1995/12/15 08:49:00 tbr ->># Branch point for Release 5.0.0 ->># ->># Revision 3.1 1995/12/15 00:48:01 andy ->># Prepare for GA Release ->># -/* -Portions of this software are based on Xlib and X Protocol Test Suite. -We have used this material under the terms of its copyright, which grants -free use, subject to the conditions below. Note however that those -portions of this software that are based on the original Test Suite have -been significantly revised and that all such revisions are copyright (c) -1995 Applied Testing and Technology, Inc. Insomuch as the proprietary -revisions cannot be separated from the freely copyable material, the net -result is that use of this software is governed by the ApTest copyright. - -Copyright (c) 1990, 1991 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. - -Permission to use, copy, modify, distribute, and sell this software and -its documentation for any purpose is hereby granted without fee, -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 name of UniSoft not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. UniSoft -makes no representations about the suitability of this software for any -purpose. It is provided "as is" without express or implied warranty. -*/ ->>TITLE XFreeCursor Xlib6 -void -XFreeCursor(display, cursor) -Display *display = Dsp; -Cursor cursor; ->>SET startup fontstartup ->>SET cleanup fontcleanup ->>ASSERTION Good B 1 -When another resource ID references the -.A cursor , -then a call to xname -deletes the association between the -.A cursor -resource ID -and the specified cursor. ->>STRATEGY -Create cursor and cursor2 as same cursors. -Create window. -Define cursor for window. -Call XFreeCursor with cursor. -Call XFreeCursor with cursor2. ->>CODE -Cursor cursor2; -Window w; -XVisualInfo *vp; -unsigned int shape; - - - /* UNSUPPORTED is not allowed */ - shape = config.fontcursor_good; - if (shape == -1) { - delete("A value of UNSUPPORTED is not allowed for XT_FONTCURSOR_GOOD"); - return; - } - - for (resetvinf(VI_WIN); nextvinf(&vp); ) { -/* Create cursor and cursor2 as same cursors. */ - cursor = XCreateFontCursor(display, shape); - cursor2 = XCreateFontCursor(display, shape); - -/* Create window. */ - w = makewin(display, vp); - -/* Define cursor for window. */ - XDefineCursor(display, w, cursor); - -/* Call XFreeCursor with cursor. */ - XCALL; - if (geterr() == Success) - CHECK; - else - FAIL; - -/* Call XFreeCursor with cursor2. */ - cursor = cursor2; - XCALL; - - if (geterr() == Success) - CHECK; - else - FAIL; - } - - CHECKUNTESTED(2*nvinf()); ->>ASSERTION Good B 1 -When no other resource ID references the -.A cursor , -then a call to xname -deletes the association between the -.A cursor -resource ID -and the specified cursor, -and the cursor storage is freed. ->>STRATEGY -Create cursor and cursor2 as same cursors. -Call XFreeCursor with cursor. -Call XFreeCursor with cursor2. ->>CODE -Cursor cursor2; -unsigned int shape; - - /* UNSUPPORTED is not allowed */ - shape = config.fontcursor_good; - if (shape == -1) { - delete("A value of UNSUPPORTED is not allowed for XT_FONTCURSOR_GOOD"); - return; - } - -/* Create cursor and cursor2 as same cursors. */ - cursor = XCreateFontCursor(display, shape); - cursor2 = XCreateFontCursor(display, shape); - -/* Call XFreeCursor with cursor. */ - XCALL; - if (geterr() == Success) - CHECK; - else - FAIL; - -/* Call XFreeCursor with cursor2. */ - cursor = cursor2; - XCALL; - - if (geterr() == Success) - CHECK; - else - FAIL; - - CHECKUNTESTED(2); ->>ASSERTION Bad A -.ER BadCursor ->># HISTORY kieron Completed Check format and pass ac ->>#HISTORY peterc Completed Wrote STRATEGY and CODE diff --git a/xts5/Xlib6/XFreePixmap.m b/xts5/Xlib6/XFreePixmap.m new file mode 100644 index 00000000..e1e0aaf7 --- /dev/null +++ b/xts5/Xlib6/XFreePixmap.m @@ -0,0 +1,189 @@ +Copyright (c) 2005 X.Org Foundation L.L.C. + +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 +AUTHORS OR COPYRIGHT HOLDERS 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. + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/Xlib6/XFreePixmap.m +>># +>># Description: +>># Tests for XFreePixmap() +>># +>># Modifications: +>># $Log: frpxmp.m,v $ +>># Revision 1.2 2005-11-03 08:43:41 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:29 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:26:53 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:45:11 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:19:06 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:15:37 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 08:49:01 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 00:48:03 andy +>># Prepare for GA Release +>># +/* +Portions of this software are based on Xlib and X Protocol Test Suite. +We have used this material under the terms of its copyright, which grants +free use, subject to the conditions below. Note however that those +portions of this software that are based on the original Test Suite have +been significantly revised and that all such revisions are copyright (c) +1995 Applied Testing and Technology, Inc. Insomuch as the proprietary +revisions cannot be separated from the freely copyable material, the net +result is that use of this software is governed by the ApTest copyright. + +Copyright (c) 1990, 1991 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. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +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 name of UniSoft not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. UniSoft +makes no representations about the suitability of this software for any +purpose. It is provided "as is" without express or implied warranty. +*/ +>>TITLE XFreePixmap Xlib6 +void +XFreePixmap(display, pixmap) +Display *display = Dsp; +Pixmap pixmap; +>>ASSERTION Good A +A call to xname removes the association between the pixmap ID +.A pixmap +and the specified pixmap. +>>STRATEGY +For all supported depths of pixmap: + Create a pixmap. + Create a gc using the pixmap as the drawable. + Free the pixmap with XFreePixmap. + Plot (0,0) in the pixmap. + Verify that a BadDrawable error occurred. +>>CODE +XGCValues gcv; +XVisualInfo *vp; +GC gc; + + for(resetvinf(VI_PIX); nextvinf(&vp); ) { + pixmap = XCreatePixmap(display, DRW(display), 1, 1, vp->depth); + gc = makegc(display, pixmap); + XCALL; + + startcall(Dsp); + XDrawPoint(display, pixmap, gc, 0, 0); + endcall(Dsp); + if(geterr() != BadDrawable) { + report("Got %s instead of BadDrawable when drawing on a freed pixmap. ", errorname(geterr())); + FAIL; + } else + CHECK; + } + + CHECKPASS(nvinf()); + +>>ASSERTION Good A +The storage allocated to the pixmap is not recovered until all references to it +have been removed. +>>STRATEGY +Create a window. +Create a pixmap of the same dimensions as the window. +Pattern the pixmap. +Create a gc with the pixmap as the tile and the fill_mode set to FillTiled. +Free the pixmap with XFreePixmap. +Tile the entire window with XFillRectangle. +Verify that the tiled pattern matches the pixmap. +>>CODE +Window win; +XVisualInfo *vp; +XGCValues gcv; +GC gc, gc2; + + for(resetvinf(VI_WIN); nextvinf(&vp);) { + win = makewin(display, vp); + pixmap = XCreatePixmap(display, DRW(display), W_STDWIDTH, W_STDHEIGHT, vp->depth); + dset(display, pixmap, W_BG); + pattern(display, pixmap); + + gcv.fill_style = FillTiled; + gcv.tile = pixmap; + gcv.foreground = W_FG; + gcv.background = W_BG; + + /* + * Create the GC with the window of the same depth because + * the root window could be of a different depth. + */ + gc = XCreateGC(display, win, GCFillStyle|GCTile|GCForeground|GCBackground, &gcv); + XCALL; + + XFillRectangle(display, win, gc, 0, 0, W_STDWIDTH+1, W_STDHEIGHT+1); + + if( checkpattern(display, win, (struct area *) 0 ) != True) { + report("Tiled pattern on window was not correct after"); + report("tile component in GC was freed by XFreePixmap"); + FAIL; + } else + CHECK; + + } + CHECKPASS(nvinf()); + +>>ASSERTION Bad A +.ER BadPixmap +>>#HISTORY Cal Completed Written in new format and style. +>>#HISTORY Kieron Completed +>>#HISTORY Cal Action Writing code. diff --git a/xts5/Xlib6/XFreePixmap/XFreePixmap.m b/xts5/Xlib6/XFreePixmap/XFreePixmap.m deleted file mode 100644 index 8896f15b..00000000 --- a/xts5/Xlib6/XFreePixmap/XFreePixmap.m +++ /dev/null @@ -1,189 +0,0 @@ -Copyright (c) 2005 X.Org Foundation L.L.C. - -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 -AUTHORS OR COPYRIGHT HOLDERS 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. - -Copyright (c) Applied Testing and Technology, Inc. 1995 -All Rights Reserved. - ->># Project: VSW5 ->># ->># File: xts5/Xlib6/XFreePixmap/XFreePixmap.m ->># ->># Description: ->># Tests for XFreePixmap() ->># ->># Modifications: ->># $Log: frpxmp.m,v $ ->># Revision 1.2 2005-11-03 08:43:41 jmichael ->># clean up all vsw5 paths to use xts5 instead. ->># ->># Revision 1.1.1.2 2005/04/15 14:05:29 anderson ->># Reimport of the base with the legal name in the copyright fixed. ->># ->># Revision 8.0 1998/12/23 23:26:53 mar ->># Branch point for Release 5.0.2 ->># ->># Revision 7.0 1998/10/30 22:45:11 mar ->># Branch point for Release 5.0.2b1 ->># ->># Revision 6.0 1998/03/02 05:19:06 tbr ->># Branch point for Release 5.0.1 ->># ->># Revision 5.0 1998/01/26 03:15:37 tbr ->># Branch point for Release 5.0.1b1 ->># ->># Revision 4.0 1995/12/15 08:49:01 tbr ->># Branch point for Release 5.0.0 ->># ->># Revision 3.1 1995/12/15 00:48:03 andy ->># Prepare for GA Release ->># -/* -Portions of this software are based on Xlib and X Protocol Test Suite. -We have used this material under the terms of its copyright, which grants -free use, subject to the conditions below. Note however that those -portions of this software that are based on the original Test Suite have -been significantly revised and that all such revisions are copyright (c) -1995 Applied Testing and Technology, Inc. Insomuch as the proprietary -revisions cannot be separated from the freely copyable material, the net -result is that use of this software is governed by the ApTest copyright. - -Copyright (c) 1990, 1991 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. - -Permission to use, copy, modify, distribute, and sell this software and -its documentation for any purpose is hereby granted without fee, -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 name of UniSoft not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. UniSoft -makes no representations about the suitability of this software for any -purpose. It is provided "as is" without express or implied warranty. -*/ ->>TITLE XFreePixmap Xlib6 -void -XFreePixmap(display, pixmap) -Display *display = Dsp; -Pixmap pixmap; ->>ASSERTION Good A -A call to xname removes the association between the pixmap ID -.A pixmap -and the specified pixmap. ->>STRATEGY -For all supported depths of pixmap: - Create a pixmap. - Create a gc using the pixmap as the drawable. - Free the pixmap with XFreePixmap. - Plot (0,0) in the pixmap. - Verify that a BadDrawable error occurred. ->>CODE -XGCValues gcv; -XVisualInfo *vp; -GC gc; - - for(resetvinf(VI_PIX); nextvinf(&vp); ) { - pixmap = XCreatePixmap(display, DRW(display), 1, 1, vp->depth); - gc = makegc(display, pixmap); - XCALL; - - startcall(Dsp); - XDrawPoint(display, pixmap, gc, 0, 0); - endcall(Dsp); - if(geterr() != BadDrawable) { - report("Got %s instead of BadDrawable when drawing on a freed pixmap. ", errorname(geterr())); - FAIL; - } else - CHECK; - } - - CHECKPASS(nvinf()); - ->>ASSERTION Good A -The storage allocated to the pixmap is not recovered until all references to it -have been removed. ->>STRATEGY -Create a window. -Create a pixmap of the same dimensions as the window. -Pattern the pixmap. -Create a gc with the pixmap as the tile and the fill_mode set to FillTiled. -Free the pixmap with XFreePixmap. -Tile the entire window with XFillRectangle. -Verify that the tiled pattern matches the pixmap. ->>CODE -Window win; -XVisualInfo *vp; -XGCValues gcv; -GC gc, gc2; - - for(resetvinf(VI_WIN); nextvinf(&vp);) { - win = makewin(display, vp); - pixmap = XCreatePixmap(display, DRW(display), W_STDWIDTH, W_STDHEIGHT, vp->depth); - dset(display, pixmap, W_BG); - pattern(display, pixmap); - - gcv.fill_style = FillTiled; - gcv.tile = pixmap; - gcv.foreground = W_FG; - gcv.background = W_BG; - - /* - * Create the GC with the window of the same depth because - * the root window could be of a different depth. - */ - gc = XCreateGC(display, win, GCFillStyle|GCTile|GCForeground|GCBackground, &gcv); - XCALL; - - XFillRectangle(display, win, gc, 0, 0, W_STDWIDTH+1, W_STDHEIGHT+1); - - if( checkpattern(display, win, (struct area *) 0 ) != True) { - report("Tiled pattern on window was not correct after"); - report("tile component in GC was freed by XFreePixmap"); - FAIL; - } else - CHECK; - - } - CHECKPASS(nvinf()); - ->>ASSERTION Bad A -.ER BadPixmap ->>#HISTORY Cal Completed Written in new format and style. ->>#HISTORY Kieron Completed ->>#HISTORY Cal Action Writing code. diff --git a/xts5/Xlib6/XQueryBestCursor.m b/xts5/Xlib6/XQueryBestCursor.m new file mode 100644 index 00000000..ea4a4315 --- /dev/null +++ b/xts5/Xlib6/XQueryBestCursor.m @@ -0,0 +1,271 @@ +Copyright (c) 2005 X.Org Foundation L.L.C. + +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 +AUTHORS OR COPYRIGHT HOLDERS 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. + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/Xlib6/XQueryBestCursor.m +>># +>># Description: +>># Tests for XQueryBestCursor() +>># +>># Modifications: +>># $Log: qrybstcrsr.m,v $ +>># Revision 1.2 2005-11-03 08:43:41 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:29 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:26:53 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:45:11 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:19:06 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:15:38 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 08:49:02 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 00:48:05 andy +>># Prepare for GA Release +>># +/* +Portions of this software are based on Xlib and X Protocol Test Suite. +We have used this material under the terms of its copyright, which grants +free use, subject to the conditions below. Note however that those +portions of this software that are based on the original Test Suite have +been significantly revised and that all such revisions are copyright (c) +1995 Applied Testing and Technology, Inc. Insomuch as the proprietary +revisions cannot be separated from the freely copyable material, the net +result is that use of this software is governed by the ApTest copyright. + +Copyright (c) 1990, 1991 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. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +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 name of UniSoft not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. UniSoft +makes no representations about the suitability of this software for any +purpose. It is provided "as is" without express or implied warranty. +*/ +>>TITLE XQueryBestCursor Xlib6 +Status +XQueryBestCursor(display, d, width, height, rwidth, rheight) +Display *display = Dsp; +Drawable d; +unsigned int width; +unsigned int height; +unsigned int *rwidth = &cwidth; +unsigned int *rheight = &cheight; +>>EXTERN +static unsigned int cheight, cwidth; +>>ASSERTION Good B 1 +A call to xname returns in the +.A width_return +and +.A height_return +arguments the largest cursor height and width to those specified in +.A height +and +.A width +that can be fully displayed on the specified screen. +>>STRATEGY +Call XQueryBestCursor with width twice that of DisplayWidth and +height twice that of DisplayHeight. +Verify that XQueryBestCursor returns non-zero. +Call XQueryBestCursor with returned values of width and height. +Verify that XQueryBestCursor returns non-zero. +Verify that XQueryBestCursor returns the previously returned +values for width and height. +Verify that returned values for width and height are small enough +to be fully displayed on the specified screen. +Repeat with initial width and height both set to zero. +>>CODE +unsigned int swidth; +unsigned int sheight; +Status qstat; + + d = DRW(display); + +/* Dynamically determine width and height values */ + swidth = DisplayWidth(display, DefaultScreen(display)); + sheight = DisplayHeight(display, DefaultScreen(display)); + width = 2 * swidth; + height = 2 * sheight; + +/* Call XQueryBestCursor with width twice that of DisplayWidth and */ +/* twice that of DisplayHeight. */ + qstat = XCALL; + +/* Verify that XQueryBestCursor returns non-zero. */ + if (qstat == 0) { + report("%s returned wrong value %ld", TestName, (long) qstat); + FAIL; + } else + CHECK; + + trace("Status returned was %d", qstat); + trace("Best height (for %d ) = %d", height, cheight); + trace("Best width (for %d) = %d", width, cwidth); + + width = cwidth; + height = cheight; + + cwidth = cheight = 0; + +/* Call XQueryBestCursor with returned values of width and height. */ + qstat = XCALL; + +/* Verify that XQueryBestCursor returns non-zero. */ + if(qstat == 0) { + report("%s returned wrong value %ld", TestName, (long) qstat); + FAIL; + } else + CHECK; + + trace("Status returned was %d", qstat); + trace("Best height (for %d ) = %d", height, cheight); + trace("Best width (for %d) = %d", width, cwidth); + +/* Verify that XQueryBestCursor returns the previously returned */ + if(width != cwidth) { + report("%s returned best width %d", TestName, cwidth); + report("after previously returning best width %d", width); + FAIL; + } else + CHECK; + + if(height != cheight) { + report("%s returned best height %d", TestName, cheight); + report("after previously returning best height %d", height); + FAIL; + } else + CHECK; +/* Verify that returned values for width and height are small enough */ +/* to be fully displayed on the specified screen. */ + if (cwidth > swidth) { + report("%s returned non-fully displayable width %d", + TestName, cwidth); + FAIL; + } else + CHECK; + if (cheight > sheight) { + report("%s returned non-fully displayable height %d", + TestName, cheight); + FAIL; + } else + CHECK; + +/* Repeat with initial width and height both set to zero. */ + width = 0; + height = 0; + + qstat = XCALL; + + if(qstat == 0) { + report("%s returned wrong value %ld", TestName, (long) qstat); + FAIL; + } else + CHECK; + + trace("Status returned was %d", qstat); + trace("Best height (for %d ) = %d", height, cheight); + trace("Best width (for %d) = %d", width, cwidth); + + width = cwidth; + height = cheight; + + cwidth = cheight = 0; + + qstat = XCALL; + + if(qstat == 0) { + report("%s returned wrong value %ld", TestName, (long) qstat); + FAIL; + } else + CHECK; + + trace("Status returned was %d", qstat); + trace("Best height (for %d ) = %d", height, cheight); + trace("Best width (for %d) = %d", width, cwidth); + + if(width != cwidth) { + report("%s returned best width %d", TestName, cwidth); + report("after previously returning best width %d", width); + FAIL; + } else + CHECK; + + if(height != cheight) { + report("%s returned best height %d", TestName, cheight); + report("after previously returning best height %d", height); + FAIL; + } else + CHECK; + if (cwidth > swidth) { + report("%s returned non-fully displayable width %d", + TestName, cwidth); + FAIL; + } else + CHECK; + if (cheight > sheight) { + report("%s returned non-fully displayable height %d", + TestName, cheight); + FAIL; + } else + CHECK; + + CHECKUNTESTED(12); +>>ASSERTION Bad A +.ER BadDrawable +>>#HISTORY peterc Completed Updated as per RTCB#3 +>>#HISTORY peterc Completed engineering diff --git a/xts5/Xlib6/XQueryBestCursor/XQueryBestCursor.m b/xts5/Xlib6/XQueryBestCursor/XQueryBestCursor.m deleted file mode 100644 index b235e124..00000000 --- a/xts5/Xlib6/XQueryBestCursor/XQueryBestCursor.m +++ /dev/null @@ -1,271 +0,0 @@ -Copyright (c) 2005 X.Org Foundation L.L.C. - -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 -AUTHORS OR COPYRIGHT HOLDERS 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. - -Copyright (c) Applied Testing and Technology, Inc. 1995 -All Rights Reserved. - ->># Project: VSW5 ->># ->># File: xts5/Xlib6/XQueryBestCursor/XQueryBestCursor.m ->># ->># Description: ->># Tests for XQueryBestCursor() ->># ->># Modifications: ->># $Log: qrybstcrsr.m,v $ ->># Revision 1.2 2005-11-03 08:43:41 jmichael ->># clean up all vsw5 paths to use xts5 instead. ->># ->># Revision 1.1.1.2 2005/04/15 14:05:29 anderson ->># Reimport of the base with the legal name in the copyright fixed. ->># ->># Revision 8.0 1998/12/23 23:26:53 mar ->># Branch point for Release 5.0.2 ->># ->># Revision 7.0 1998/10/30 22:45:11 mar ->># Branch point for Release 5.0.2b1 ->># ->># Revision 6.0 1998/03/02 05:19:06 tbr ->># Branch point for Release 5.0.1 ->># ->># Revision 5.0 1998/01/26 03:15:38 tbr ->># Branch point for Release 5.0.1b1 ->># ->># Revision 4.0 1995/12/15 08:49:02 tbr ->># Branch point for Release 5.0.0 ->># ->># Revision 3.1 1995/12/15 00:48:05 andy ->># Prepare for GA Release ->># -/* -Portions of this software are based on Xlib and X Protocol Test Suite. -We have used this material under the terms of its copyright, which grants -free use, subject to the conditions below. Note however that those -portions of this software that are based on the original Test Suite have -been significantly revised and that all such revisions are copyright (c) -1995 Applied Testing and Technology, Inc. Insomuch as the proprietary -revisions cannot be separated from the freely copyable material, the net -result is that use of this software is governed by the ApTest copyright. - -Copyright (c) 1990, 1991 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. - -Permission to use, copy, modify, distribute, and sell this software and -its documentation for any purpose is hereby granted without fee, -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 name of UniSoft not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. UniSoft -makes no representations about the suitability of this software for any -purpose. It is provided "as is" without express or implied warranty. -*/ ->>TITLE XQueryBestCursor Xlib6 -Status -XQueryBestCursor(display, d, width, height, rwidth, rheight) -Display *display = Dsp; -Drawable d; -unsigned int width; -unsigned int height; -unsigned int *rwidth = &cwidth; -unsigned int *rheight = &cheight; ->>EXTERN -static unsigned int cheight, cwidth; ->>ASSERTION Good B 1 -A call to xname returns in the -.A width_return -and -.A height_return -arguments the largest cursor height and width to those specified in -.A height -and -.A width -that can be fully displayed on the specified screen. ->>STRATEGY -Call XQueryBestCursor with width twice that of DisplayWidth and -height twice that of DisplayHeight. -Verify that XQueryBestCursor returns non-zero. -Call XQueryBestCursor with returned values of width and height. -Verify that XQueryBestCursor returns non-zero. -Verify that XQueryBestCursor returns the previously returned -values for width and height. -Verify that returned values for width and height are small enough -to be fully displayed on the specified screen. -Repeat with initial width and height both set to zero. ->>CODE -unsigned int swidth; -unsigned int sheight; -Status qstat; - - d = DRW(display); - -/* Dynamically determine width and height values */ - swidth = DisplayWidth(display, DefaultScreen(display)); - sheight = DisplayHeight(display, DefaultScreen(display)); - width = 2 * swidth; - height = 2 * sheight; - -/* Call XQueryBestCursor with width twice that of DisplayWidth and */ -/* twice that of DisplayHeight. */ - qstat = XCALL; - -/* Verify that XQueryBestCursor returns non-zero. */ - if (qstat == 0) { - report("%s returned wrong value %ld", TestName, (long) qstat); - FAIL; - } else - CHECK; - - trace("Status returned was %d", qstat); - trace("Best height (for %d ) = %d", height, cheight); - trace("Best width (for %d) = %d", width, cwidth); - - width = cwidth; - height = cheight; - - cwidth = cheight = 0; - -/* Call XQueryBestCursor with returned values of width and height. */ - qstat = XCALL; - -/* Verify that XQueryBestCursor returns non-zero. */ - if(qstat == 0) { - report("%s returned wrong value %ld", TestName, (long) qstat); - FAIL; - } else - CHECK; - - trace("Status returned was %d", qstat); - trace("Best height (for %d ) = %d", height, cheight); - trace("Best width (for %d) = %d", width, cwidth); - -/* Verify that XQueryBestCursor returns the previously returned */ - if(width != cwidth) { - report("%s returned best width %d", TestName, cwidth); - report("after previously returning best width %d", width); - FAIL; - } else - CHECK; - - if(height != cheight) { - report("%s returned best height %d", TestName, cheight); - report("after previously returning best height %d", height); - FAIL; - } else - CHECK; -/* Verify that returned values for width and height are small enough */ -/* to be fully displayed on the specified screen. */ - if (cwidth > swidth) { - report("%s returned non-fully displayable width %d", - TestName, cwidth); - FAIL; - } else - CHECK; - if (cheight > sheight) { - report("%s returned non-fully displayable height %d", - TestName, cheight); - FAIL; - } else - CHECK; - -/* Repeat with initial width and height both set to zero. */ - width = 0; - height = 0; - - qstat = XCALL; - - if(qstat == 0) { - report("%s returned wrong value %ld", TestName, (long) qstat); - FAIL; - } else - CHECK; - - trace("Status returned was %d", qstat); - trace("Best height (for %d ) = %d", height, cheight); - trace("Best width (for %d) = %d", width, cwidth); - - width = cwidth; - height = cheight; - - cwidth = cheight = 0; - - qstat = XCALL; - - if(qstat == 0) { - report("%s returned wrong value %ld", TestName, (long) qstat); - FAIL; - } else - CHECK; - - trace("Status returned was %d", qstat); - trace("Best height (for %d ) = %d", height, cheight); - trace("Best width (for %d) = %d", width, cwidth); - - if(width != cwidth) { - report("%s returned best width %d", TestName, cwidth); - report("after previously returning best width %d", width); - FAIL; - } else - CHECK; - - if(height != cheight) { - report("%s returned best height %d", TestName, cheight); - report("after previously returning best height %d", height); - FAIL; - } else - CHECK; - if (cwidth > swidth) { - report("%s returned non-fully displayable width %d", - TestName, cwidth); - FAIL; - } else - CHECK; - if (cheight > sheight) { - report("%s returned non-fully displayable height %d", - TestName, cheight); - FAIL; - } else - CHECK; - - CHECKUNTESTED(12); ->>ASSERTION Bad A -.ER BadDrawable ->>#HISTORY peterc Completed Updated as per RTCB#3 ->>#HISTORY peterc Completed engineering diff --git a/xts5/Xlib6/XRecolorCursor.m b/xts5/Xlib6/XRecolorCursor.m new file mode 100644 index 00000000..a991433f --- /dev/null +++ b/xts5/Xlib6/XRecolorCursor.m @@ -0,0 +1,166 @@ +Copyright (c) 2005 X.Org Foundation L.L.C. + +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 +AUTHORS OR COPYRIGHT HOLDERS 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. + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/Xlib6/XRecolorCursor.m +>># +>># Description: +>># Tests for XRecolorCursor() +>># +>># Modifications: +>># $Log: rclrcrsr.m,v $ +>># Revision 1.2 2005-11-03 08:43:41 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:29 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:26:54 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:45:12 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:19:07 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:15:38 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 08:49:04 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 00:48:08 andy +>># Prepare for GA Release +>># +/* +Portions of this software are based on Xlib and X Protocol Test Suite. +We have used this material under the terms of its copyright, which grants +free use, subject to the conditions below. Note however that those +portions of this software that are based on the original Test Suite have +been significantly revised and that all such revisions are copyright (c) +1995 Applied Testing and Technology, Inc. Insomuch as the proprietary +revisions cannot be separated from the freely copyable material, the net +result is that use of this software is governed by the ApTest copyright. + +Copyright (c) 1990, 1991 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. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +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 name of UniSoft not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. UniSoft +makes no representations about the suitability of this software for any +purpose. It is provided "as is" without express or implied warranty. +*/ +>>TITLE XRecolorCursor Xlib6 +void +XRecolorCursor(display, cursor, foreground_color, background_color) +Display *display = Dsp; +Cursor cursor; +XColor *foreground_color = mkcolor(1); +XColor *background_color = mkcolor(0); +>>SET startup fontstartup +>>SET cleanup fontcleanup +>>EXTERN + +/* + * mkcolor() - return a pointer to a color structure. + * flag indicates whether or not color is foreground + */ +static XColor * +mkcolor(flag) +{ + static XColor fore; + static XColor back; + static int first = 1; + + if (first) + { + first = 0; + + fore.pixel = BlackPixel(display, DefaultScreen(display)); + XQueryColor(display, DefaultColormap(display, DefaultScreen(display)), &fore); + back.pixel = WhitePixel(display, DefaultScreen(display)); + XQueryColor(display, DefaultColormap(display, DefaultScreen(display)), &back); + } + return(flag ? &fore : &back); +} +>>ASSERTION Good B 1 +A call to xname changes the color of the specified cursor, +.A cursor , +to the specified +.A foreground_color +and +.A background_color . +>>STRATEGY +Create cursor. +Call XRecolorCursor to change foreground to W_BG and +background to W_FG. +>>CODE + +/* Create cursor. */ + cursor = makecur(display); + +/* Call XRecolorCursor to change foreground to W_BG and */ +/* background to W_FG. */ + + XCALL; + + if (geterr() != Success) + FAIL; + else + CHECK; + + CHECKUNTESTED(1); +>>ASSERTION Good B 1 +When the cursor is being displayed on a screen, then +the change is visible immediately. +>>ASSERTION Bad A +.ER BadCursor +>># HISTORY kieron Completed Reformat and tidy to ca pass +>># HISTORY peterc Completed Wrote STRATEGY and CODE diff --git a/xts5/Xlib6/XRecolorCursor/XRecolorCursor.m b/xts5/Xlib6/XRecolorCursor/XRecolorCursor.m deleted file mode 100644 index a9eafcb0..00000000 --- a/xts5/Xlib6/XRecolorCursor/XRecolorCursor.m +++ /dev/null @@ -1,166 +0,0 @@ -Copyright (c) 2005 X.Org Foundation L.L.C. - -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 -AUTHORS OR COPYRIGHT HOLDERS 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. - -Copyright (c) Applied Testing and Technology, Inc. 1995 -All Rights Reserved. - ->># Project: VSW5 ->># ->># File: xts5/Xlib6/XRecolorCursor/XRecolorCursor.m ->># ->># Description: ->># Tests for XRecolorCursor() ->># ->># Modifications: ->># $Log: rclrcrsr.m,v $ ->># Revision 1.2 2005-11-03 08:43:41 jmichael ->># clean up all vsw5 paths to use xts5 instead. ->># ->># Revision 1.1.1.2 2005/04/15 14:05:29 anderson ->># Reimport of the base with the legal name in the copyright fixed. ->># ->># Revision 8.0 1998/12/23 23:26:54 mar ->># Branch point for Release 5.0.2 ->># ->># Revision 7.0 1998/10/30 22:45:12 mar ->># Branch point for Release 5.0.2b1 ->># ->># Revision 6.0 1998/03/02 05:19:07 tbr ->># Branch point for Release 5.0.1 ->># ->># Revision 5.0 1998/01/26 03:15:38 tbr ->># Branch point for Release 5.0.1b1 ->># ->># Revision 4.0 1995/12/15 08:49:04 tbr ->># Branch point for Release 5.0.0 ->># ->># Revision 3.1 1995/12/15 00:48:08 andy ->># Prepare for GA Release ->># -/* -Portions of this software are based on Xlib and X Protocol Test Suite. -We have used this material under the terms of its copyright, which grants -free use, subject to the conditions below. Note however that those -portions of this software that are based on the original Test Suite have -been significantly revised and that all such revisions are copyright (c) -1995 Applied Testing and Technology, Inc. Insomuch as the proprietary -revisions cannot be separated from the freely copyable material, the net -result is that use of this software is governed by the ApTest copyright. - -Copyright (c) 1990, 1991 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. - -Permission to use, copy, modify, distribute, and sell this software and -its documentation for any purpose is hereby granted without fee, -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 name of UniSoft not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. UniSoft -makes no representations about the suitability of this software for any -purpose. It is provided "as is" without express or implied warranty. -*/ ->>TITLE XRecolorCursor Xlib6 -void -XRecolorCursor(display, cursor, foreground_color, background_color) -Display *display = Dsp; -Cursor cursor; -XColor *foreground_color = mkcolor(1); -XColor *background_color = mkcolor(0); ->>SET startup fontstartup ->>SET cleanup fontcleanup ->>EXTERN - -/* - * mkcolor() - return a pointer to a color structure. - * flag indicates whether or not color is foreground - */ -static XColor * -mkcolor(flag) -{ - static XColor fore; - static XColor back; - static int first = 1; - - if (first) - { - first = 0; - - fore.pixel = BlackPixel(display, DefaultScreen(display)); - XQueryColor(display, DefaultColormap(display, DefaultScreen(display)), &fore); - back.pixel = WhitePixel(display, DefaultScreen(display)); - XQueryColor(display, DefaultColormap(display, DefaultScreen(display)), &back); - } - return(flag ? &fore : &back); -} ->>ASSERTION Good B 1 -A call to xname changes the color of the specified cursor, -.A cursor , -to the specified -.A foreground_color -and -.A background_color . ->>STRATEGY -Create cursor. -Call XRecolorCursor to change foreground to W_BG and -background to W_FG. ->>CODE - -/* Create cursor. */ - cursor = makecur(display); - -/* Call XRecolorCursor to change foreground to W_BG and */ -/* background to W_FG. */ - - XCALL; - - if (geterr() != Success) - FAIL; - else - CHECK; - - CHECKUNTESTED(1); ->>ASSERTION Good B 1 -When the cursor is being displayed on a screen, then -the change is visible immediately. ->>ASSERTION Bad A -.ER BadCursor ->># HISTORY kieron Completed Reformat and tidy to ca pass ->># HISTORY peterc Completed Wrote STRATEGY and CODE diff --git a/xts5/scenarios/Xlib6_scen b/xts5/scenarios/Xlib6_scen index 0a6e9108..5c170354 100644 --- a/xts5/scenarios/Xlib6_scen +++ b/xts5/scenarios/Xlib6_scen @@ -55,18 +55,18 @@ # "VSW5TESTSUITE CASE XCreatePixmap 6" - /Xlib6/XCreatePixmap/XCreatePixmap + /Xlib6/XCreatePixmap "VSW5TESTSUITE CASE XCreateFontCursor 3" - /Xlib6/XCreateFontCursor/XCreateFontCursor + /Xlib6/XCreateFontCursor "VSW5TESTSUITE CASE XCreateGlyphCursor 17" - /Xlib6/XCreateGlyphCursor/XCreateGlyphCursor + /Xlib6/XCreateGlyphCursor "VSW5TESTSUITE CASE XCreatePixmapCursor 13" - /Xlib6/XCreatePixmapCursor/XCreatePixmapCursor + /Xlib6/XCreatePixmapCursor "VSW5TESTSUITE CASE XFreeCursor 3" - /Xlib6/XFreeCursor/XFreeCursor + /Xlib6/XFreeCursor "VSW5TESTSUITE CASE XFreePixmap 3" - /Xlib6/XFreePixmap/XFreePixmap + /Xlib6/XFreePixmap "VSW5TESTSUITE CASE XQueryBestCursor 2" - /Xlib6/XQueryBestCursor/XQueryBestCursor + /Xlib6/XQueryBestCursor "VSW5TESTSUITE CASE XRecolorCursor 3" - /Xlib6/XRecolorCursor/XRecolorCursor + /Xlib6/XRecolorCursor diff --git a/xts5/tet_scen b/xts5/tet_scen index 59392c2e..0d623672 100644 --- a/xts5/tet_scen +++ b/xts5/tet_scen @@ -2494,35 +2494,35 @@ XTranslateCoordinates XCreatePixmap "VSW5TESTSUITE CASE XCreatePixmap 6" - /Xlib6/XCreatePixmap/XCreatePixmap + /Xlib6/XCreatePixmap XCreateFontCursor "VSW5TESTSUITE CASE XCreateFontCursor 3" - /Xlib6/XCreateFontCursor/XCreateFontCursor + /Xlib6/XCreateFontCursor XCreateGlyphCursor "VSW5TESTSUITE CASE XCreateGlyphCursor 17" - /Xlib6/XCreateGlyphCursor/XCreateGlyphCursor + /Xlib6/XCreateGlyphCursor XCreatePixmapCursor "VSW5TESTSUITE CASE XCreatePixmapCursor 13" - /Xlib6/XCreatePixmapCursor/XCreatePixmapCursor + /Xlib6/XCreatePixmapCursor XFreeCursor "VSW5TESTSUITE CASE XFreeCursor 3" - /Xlib6/XFreeCursor/XFreeCursor + /Xlib6/XFreeCursor XFreePixmap "VSW5TESTSUITE CASE XFreePixmap 3" - /Xlib6/XFreePixmap/XFreePixmap + /Xlib6/XFreePixmap XQueryBestCursor "VSW5TESTSUITE CASE XQueryBestCursor 2" - /Xlib6/XQueryBestCursor/XQueryBestCursor + /Xlib6/XQueryBestCursor XRecolorCursor "VSW5TESTSUITE CASE XRecolorCursor 3" - /Xlib6/XRecolorCursor/XRecolorCursor + /Xlib6/XRecolorCursor # Discrete tests for Xlib Chapter 7-Color Management Functions -- cgit v1.2.3