diff options
author | Dan Nicholson <dbn.lists@gmail.com> | 2009-09-16 12:20:41 -0700 |
---|---|---|
committer | Dan Nicholson <dbn.lists@gmail.com> | 2009-09-16 12:20:41 -0700 |
commit | 704eb8d4cbfa2f8c47882a8ea6c7732cf5fa20d1 (patch) | |
tree | 1f48212ecf5556fbff17172c6904e525481e8653 /xts5/SHAPE | |
parent | 5d01bd434ff7186701c931883b110c179d4fa8b8 (diff) |
xts5: Move tests out of tset directory
The tset directory was mostly useless and causes extra baggage if the
scenario files are going to be used on an installed package. The test
directories are now flattened into xts5.
Diffstat (limited to 'xts5/SHAPE')
-rw-r--r-- | xts5/SHAPE/XShapeCombineMask/XShapeCombineMask.m | 154 | ||||
-rw-r--r-- | xts5/SHAPE/XShapeCombineRectangles/XShapeCombineRectangles.m | 147 | ||||
-rw-r--r-- | xts5/SHAPE/XShapeCombineRegion/XShapeCombineRegion.m | 185 | ||||
-rw-r--r-- | xts5/SHAPE/XShapeCombineShape/XShapeCombineShape.m | 146 | ||||
-rw-r--r-- | xts5/SHAPE/XShapeGetRectangles/XShapeGetRectangles.m | 145 | ||||
-rw-r--r-- | xts5/SHAPE/XShapeInputSelected/XShapeInputSelected.m | 88 | ||||
-rw-r--r-- | xts5/SHAPE/XShapeOffsetShape/XShapeOffsetShape.m | 157 | ||||
-rw-r--r-- | xts5/SHAPE/XShapeQueryExtension/XShapeQueryExtension.m | 96 | ||||
-rw-r--r-- | xts5/SHAPE/XShapeQueryExtents/XShapeQueryExtents.m | 138 | ||||
-rw-r--r-- | xts5/SHAPE/XShapeQueryVersion/XShapeQueryVersion.m | 104 | ||||
-rw-r--r-- | xts5/SHAPE/XShapeSelectInput/XShapeSelectInput.m | 85 |
11 files changed, 1445 insertions, 0 deletions
diff --git a/xts5/SHAPE/XShapeCombineMask/XShapeCombineMask.m b/xts5/SHAPE/XShapeCombineMask/XShapeCombineMask.m new file mode 100644 index 00000000..62fa1c32 --- /dev/null +++ b/xts5/SHAPE/XShapeCombineMask/XShapeCombineMask.m @@ -0,0 +1,154 @@ +Copyright (c) 2005 X.Org Foundation LLC + +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. +$Header: /cvs/xtest/xtest/xts5/tset/SHAPE/XShapeCombineMask/XShapeCombineMask.m,v 1.1 2005-02-12 14:37:16 anderson Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1993, 1994, 1995 +Copyright (c) 88open Consortium, Ltd. 1990, 1991, 1992, 1993 +All Rights Reserved. + +>># +>># Project: VSW5 +>># +>># File: tset/SHAPE/XShapeCombineMask/XShapeCombineMask.m +>># +>># Description: +>># Tests for XShapeCombineMask() +>># +>># Modifications: +>># $Log: tshpcmask.m,v $ +>># Revision 1.1 2005-02-12 14:37:16 anderson +>># Initial revision +>># +>># Revision 8.0 1998/12/23 23:31:26 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:51:08 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:06 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:19:38 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:02:09 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.2 1995/12/15 01:47:50 andy +>># Prepare for GA Release +>># + +>>EXTERN +#include <X11/Xlib.h> +#include <X11/Xutil.h> +#include <X11/extensions/shape.h> + +extern Display *display; + +int avs2; + +/* +** Pixmaps +** essentially a rect with dimensions 16x16 +*/ +#define rect_width 16 +#define rect_height 16 +static unsigned char rect_bits[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; +>>TITLE XShapeCombineMask ShapeExt +void +XShapeCombineMask(display, dest, dest_kind, x_off, y_off, src, op) +>>ASSERTION Good A +A call to XShapeCombineMask(display, dest, dest_kind, x_off, y_off, src, op) +shall perform a CombineMask operation by converting the pixmap src to a +region with bits set to one included in the region and bits set to zero +excluded with an offset from the window origin by amount x_off and y_off, +the resulting region shall be combined as specified by the operator +op with the existing client region as specified by dest_kind of the +destination window dest, and the result shall be stored as the client +region of the destination window. +>>CODE +Window window; +GC gc; +Window root_window; +int x, y; +unsigned int width, height; +unsigned int border_width; +unsigned int depth; +Window dest; +XSetWindowAttributes xswa; +unsigned long mask; +Pixmap src_pixmap; +XRectangle *rect_return; +int count, order; +int BorderPixel, BackgroundPixel; +pid_t pid2; + + FORK(pid2); + tet_infoline("PREP: Open display and create window"); + window = (Window) avs_xext_init(); + tet_infoline("PREP: Get geometry of parent window"); + XGetGeometry(display, window, + &root_window, + &x, &y, + &width, &height, + &border_width, + &depth + ); + tet_infoline("PREP: Create source pixmap"); + src_pixmap = XCreateBitmapFromData(display, window, + (char *)rect_bits, rect_width, + rect_height); + tet_infoline("PREP: Create destination window"); + BorderPixel = XWhitePixel(display,XDefaultScreen(display)); + BackgroundPixel = XBlackPixel(display,XDefaultScreen(display)); + dest = XCreateSimpleWindow(display, window, + (x+10), (y+10), + (width - 200 ), (height - 200 ), 0, + BorderPixel, + BackgroundPixel + ); + XSync(display, 0); + /* + ** Combining a pixmap with defaut shapeclip region shall yield + ** region which is a pixmap only, the number of rectangles is + ** one on destination window. + */ + tet_infoline("PREP: Combine pixmap with default region"); + XShapeCombineMask(display, + dest, + ShapeClip, + 100, + 100, + src_pixmap, + ShapeSet); + XMapWindow(display, dest); + XSync(display, 0); + tet_infoline("PREP: Get count and order of rectangles"); + rect_return = (XRectangle *)XShapeGetRectangles(display, + dest, ShapeClip, + &count, &order); + tet_infoline("TEST: Count and order values"); + check_dec(1, count, "count"); + check_dec(YXBanded, order, "order"); + LKROF(pid2, AVSXTTIMEOUT); + tet_result(TET_PASS); diff --git a/xts5/SHAPE/XShapeCombineRectangles/XShapeCombineRectangles.m b/xts5/SHAPE/XShapeCombineRectangles/XShapeCombineRectangles.m new file mode 100644 index 00000000..4863cab1 --- /dev/null +++ b/xts5/SHAPE/XShapeCombineRectangles/XShapeCombineRectangles.m @@ -0,0 +1,147 @@ +Copyright (c) 2005 X.Org Foundation LLC + +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. +$Header: /cvs/xtest/xtest/xts5/tset/SHAPE/XShapeCombineRectangles/XShapeCombineRectangles.m,v 1.1 2005-02-12 14:37:16 anderson Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1993, 1994, 1995 +Copyright (c) 88open Consortium, Ltd. 1990, 1991, 1992, 1993 +All Rights Reserved. + +>># +>># Project: VSW5 +>># +>># File: tset/SHAPE/XShapeCombineRectangles/XShapeCombineRectangles.m +>># +>># Description: +>># Tests for XShapeCombineRectangles() +>># +>># Modifications: +>># $Log: tshpcrect.m,v $ +>># Revision 1.1 2005-02-12 14:37:16 anderson +>># Initial revision +>># +>># Revision 8.0 1998/12/23 23:31:27 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:51:09 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:06 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:19:39 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:02:10 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.2 1995/12/15 01:47:51 andy +>># Prepare for GA Release +>># + +>>EXTERN +#include <X11/Xlib.h> +#include <X11/Xutil.h> +#include <X11/extensions/shape.h> +extern Display *display; + +>>TITLE XShapeCombineRectangles ShapeExt +void +XShapeCombineRectangles(display, dest, dest_kind, x_off, y_off, rectangles, n_rects, op, ordering) +>>ASSERTION Good A +A call to void XShapeCombineRectangles(display, dest, dest_kind, x_off, +y_off, rectangles, n_rects, op, ordering) shall perform a +CombineRectangles operation by combining rectangles as +specified by operator op relative to origin of the window plus the +specified offset x_off and y_off and the result shall be stored as +the specified client region of the destination window dest. +>>CODE +Window window; +XRectangle rects[] = { 0,0, 100, 100, 100, 100, 100, 100 }; +GC gc; +Window root_window; +int x, y; +unsigned int width, height; +unsigned int border_width; +unsigned int depth; +Window window_good; +XSetWindowAttributes xswa; +unsigned long mask; +XRectangle *rect_return; +int count, order; +pid_t pid2; + + FORK(pid2); + tet_infoline("PREP: Open display and create window"); + window = (Window) avs_xext_init(); + tet_infoline("PREP: Get geometry of parent window"); + XGetGeometry(display, window, + &root_window, + &x, &y, + &width, &height, + &border_width, + &depth + ); + tet_infoline("PREP: Create destination window"); + xswa.event_mask = ExposureMask; + xswa.background_pixel = XBlackPixel(display, + XDefaultScreen (display)); + mask = CWEventMask | CWBackPixel; + window_good = XCreateWindow(display, window, + (x+10), (y+10), + (width - 50 ), (height - 50 ), 0, + CopyFromParent, + CopyFromParent, + CopyFromParent, + mask, &xswa + ); + tet_infoline("PREP: Combine two rectangles and map window"); + XShapeCombineRectangles(display, + window_good, + ShapeBounding, 0, 0, + rects, + sizeof (rects) / sizeof (rects[0]), + ShapeSet, YXBanded); + XMapWindow(display, window_good); + XSync(display, 0); + tet_infoline("PREP: Get count and order of rectangles"); + rect_return = (XRectangle *)XShapeGetRectangles(display, + window_good, ShapeBounding, + &count, &order); + tet_infoline("TEST: Count and order values"); + check_dec(2, count, "count"); + check_dec(YXBanded, order, "order"); + tet_infoline("TEST: First rectangle values"); + check_dec(rects[0].x, rect_return->x, "rect_return->x"); + check_dec(rects[0].y, rect_return->y, "rect_return->y"); + check_dec(rects[0].width, rect_return->width, + "rect_return->width"); + check_dec(rects[0].height, rect_return->height, + "rect_return->height"); + tet_infoline("TEST: Second rectangle values"); + rect_return++; + check_dec(rects[1].x, rect_return->x, "rect_return->x"); + check_dec(rects[1].y, rect_return->y, "rect_return->y"); + check_dec(rects[1].width, rect_return->width, + "rect_return->width"); + check_dec(rects[1].height, rect_return->height, + "rect_return->height"); + + LKROF(pid2, AVSXTTIMEOUT); + tet_result(TET_PASS); diff --git a/xts5/SHAPE/XShapeCombineRegion/XShapeCombineRegion.m b/xts5/SHAPE/XShapeCombineRegion/XShapeCombineRegion.m new file mode 100644 index 00000000..06cb3ba1 --- /dev/null +++ b/xts5/SHAPE/XShapeCombineRegion/XShapeCombineRegion.m @@ -0,0 +1,185 @@ +Copyright (c) 2005 X.Org Foundation LLC + +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. +$Header: /cvs/xtest/xtest/xts5/tset/SHAPE/XShapeCombineRegion/XShapeCombineRegion.m,v 1.1 2005-02-12 14:37:16 anderson Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1993, 1994, 1995 +Copyright (c) 88open Consortium, Ltd. 1990, 1991, 1992, 1993 +All Rights Reserved. + +>># +>># Project: VSW5 +>># +>># File: tset/SHAPE/XShapeCombineRegion/XShapeCombineRegion.m +>># +>># Description: +>># Tests for XShapeCombineRegion() +>># +>># Modifications: +>># $Log: tshpcregn.m,v $ +>># Revision 1.1 2005-02-12 14:37:16 anderson +>># Initial revision +>># +>># Revision 8.0 1998/12/23 23:31:27 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:51:10 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:06 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:19:39 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:02:11 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.2 1995/12/15 01:47:51 andy +>># Prepare for GA Release +>># + +>>EXTERN +#include <X11/Xlib.h> +#include <X11/Xutil.h> +#include <X11/extensions/shape.h> +extern Display *display ; + +>>TITLE XShapeCombineRegion ShapeExt +void +XShapeCombineRegion(display, dest, dest_kind, x_off, y_off, region, op) +>>ASSERTION Good A +A call to void XShapeCombineRegion(display, dest, dest_kind, x_off, y_off, +region, op) shall convert the specified region into a list of rectangles +and and perform a CombineRectangles operation by combining rectangles as +specified by operator op relative to origin of the window plus the specified +offset x_off and y_off and the result is store as the specified client region +of the destination window dest. +>>CODE +Window window; +Window root_window; +int x, y; +unsigned int width, height; +unsigned int border_width; +unsigned int depth; +Window window_good; +XSetWindowAttributes xswa; +unsigned long mask; +Region region; +Region region1, region2; +Region dst_region; +static XPoint src1_points[] = { {0,0}, {100,0}, {100,100}, {0,100} }; +static XPoint src2_points[] = { {100,100},{200,100}, {200,200}, {100,200} }; +/* expected rectangles */ +XRectangle rects[] = { 0,0, 100, 100, 100, 100, 100, 100 }; +XRectangle *rect_return; +int count, order; +pid_t pid2; + +>># Two regions with common point at (100,100) +>># +>># +>># | +>># | X a x i s +>># (0,0) 100 200 +>># ---------------------------------------------------------------> +>># | | +>># | Reg1 | * = Common point at (100, 100) +>># | | Reg1 = {0,0}, {100,0}, {100,100}, {0,100} +>># 00 --------*------- Reg2 = {100,100},{200,100}, {200,200}, {100,200} +>># Y ! | | No of Rects = 2; +>># ! | Reg2 | Rectangle offset and size in pixel +>># a ! | | { 0,0, 100, 100, 100, 100, 100, 100 }; +>># x ! --------- +>># i ! (200,200) +>># s ! +>># ! +>># ! +>># ! +>># ! +>># ! +>># ! +>># ! +>># ! +>># V + + FORK(pid2); + tet_infoline("PREP: Open display and create window"); + window = (Window) avs_xext_init(); + tet_infoline("PREP: Get geometry of parent window"); + XGetGeometry(display, window, + &root_window, + &x, &y, + &width, &height, + &border_width, + &depth + ); + tet_infoline("PREP: Create destination window"); + xswa.event_mask = ExposureMask; + xswa.background_pixel = XBlackPixel(display, + XDefaultScreen (display)); + mask = CWEventMask | CWBackPixel; + window_good = XCreateWindow(display, window, + (x+10), (y+10), + (width - 100 ), (height - 100 ), 0, + CopyFromParent, + CopyFromParent, + CopyFromParent, + mask, &xswa + ); + tet_infoline("PREP: Create region"); + region1 = XPolygonRegion(src1_points, 4, EvenOddRule); + region2 = XPolygonRegion(src2_points, 4, EvenOddRule); + dst_region = XCreateRegion(); + XUnionRegion(region1, region2, dst_region); + XSync(display, 0); + tet_infoline("TEST: Testing XShapeCombineRegion"); + XShapeCombineRegion(display, + window_good, + ShapeBounding, + 0, + 0, + dst_region, + Unsorted); + XMapWindow(display, window_good); + XSync(display, 0); + tet_infoline("PREP: Get count and order of rectangles"); + rect_return = (XRectangle *)XShapeGetRectangles(display, + window_good, ShapeBounding, + &count, &order); + tet_infoline("TEST: Count and order values"); + check_dec(2, count, "count"); + check_dec(YXBanded, order, "order"); + tet_infoline("TEST: Check first rectangle values"); + check_dec(rects[0].x, rect_return->x, "rect_return->x"); + check_dec(rects[0].y, rect_return->y, "rect_return->y"); + check_dec(rects[0].width, rect_return->width, + "rect_return->width"); + check_dec(rects[0].height, rect_return->height, + "rect_return->height"); + tet_infoline("TEST: Second rectangle values"); + rect_return++; + check_dec(rects[1].x, rect_return->x, "rect_return->x"); + check_dec(rects[1].y, rect_return->y, "rect_return->y"); + check_dec(rects[1].width, rect_return->width, + "rect_return->width"); + check_dec(rects[1].height, rect_return->height, "rect_return->height"); + + LKROF(pid2, AVSXTTIMEOUT); + tet_result(TET_PASS); diff --git a/xts5/SHAPE/XShapeCombineShape/XShapeCombineShape.m b/xts5/SHAPE/XShapeCombineShape/XShapeCombineShape.m new file mode 100644 index 00000000..e41f365d --- /dev/null +++ b/xts5/SHAPE/XShapeCombineShape/XShapeCombineShape.m @@ -0,0 +1,146 @@ +Copyright (c) 2005 X.Org Foundation LLC + +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. +$Header: /cvs/xtest/xtest/xts5/tset/SHAPE/XShapeCombineShape/XShapeCombineShape.m,v 1.1 2005-02-12 14:37:16 anderson Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1993, 1994, 1995 +Copyright (c) 88open Consortium, Ltd. 1990, 1991, 1992, 1993 +All Rights Reserved. + +>># +>># Project: VSW5 +>># +>># File: tset/SHAPE/XShapeCombineShape/XShapeCombineShape.m +>># +>># Description: +>># Tests for XShapeCombineShape() +>># +>># Modifications: +>># $Log: tshpcshap.m,v $ +>># Revision 1.1 2005-02-12 14:37:16 anderson +>># Initial revision +>># +>># Revision 8.0 1998/12/23 23:31:28 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:51:12 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:07 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:19:39 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:02:12 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.2 1995/12/15 01:47:52 andy +>># Prepare for GA Release +>># + +>>EXTERN +#include <X11/Xlib.h> +#include <X11/Xutil.h> +#include <X11/extensions/shape.h> +extern Display *display; + +>>TITLE XShapeCombineShape ShapeExt +void +XShapeCombineShape(display, dest, dest_kind, x_off, y_off, src, src_kind, op) +>>ASSERTION Good A +A call to void XShapeCombineShape(display, dest, dest_kind, x_off, y_off, +src, src_kind, op) shall perform a CombineShape operation by combining +the client region indicated by src_kind, of the source window src having +an offset from the window origin by x_off and y_off with the client +region, indicated by dest_kind of the destination window dest, and the +result is stored as the client region of the destination window dest. +>>CODE +Window window; +Window dest; +Window src; +/* x_off , y_off, height and width */ +XRectangle rects[] = { 150, 150, 100, 100 }; +XRectangle *rect_return; +int count, order; +Window root; +int x, y; +unsigned int width, height; +unsigned int border_width; +unsigned int depth; +int BorderPixel, BackgroundPixel; +pid_t pid2; + + FORK(pid2); + tet_infoline("PREP: Open display and create window"); + window = (Window) avs_xext_init(); + tet_infoline("PREP: Get geometry of window"); + XGetGeometry(display, + window, + &root, + &x, &y, + &width, &height, + &border_width, + &depth + ); + tet_infoline("PREP: Create src window"); + BorderPixel = XWhitePixel(display,XDefaultScreen(display)); + BackgroundPixel = XBlackPixel(display,XDefaultScreen(display)); + src = XCreateSimpleWindow(display, + (Window)XRootWindow(display, XDefaultScreen(display)), + x, + y, + 100, + 100, + 0, + BorderPixel, + BackgroundPixel + ); + tet_infoline("PREP: Create destination window"); + dest = XCreateSimpleWindow(display, + (Window)XRootWindow(display, XDefaultScreen(display)), + (x + 100), + (y + 100), + 200, + 200, + 0, + BorderPixel, + BackgroundPixel + ); + tet_infoline("PREP: Combine shape using default regions"); + XShapeCombineShape(display, dest, ShapeBounding, + 150, 150, src, + ShapeBounding, ShapeSet); + XMapWindow (display, dest); + XSync (display, 0); + tet_infoline("PREP: Get count and order of rectangles"); + rect_return = (XRectangle *)XShapeGetRectangles(display, + dest, ShapeBounding, + &count, &order); + tet_infoline("TEST: Check number of rectangles in default region is one"); + check_dec(1, count, "count"); + tet_infoline("TEST: Rectangle values"); + check_dec(rects[0].x, rect_return->x, "rect_return->x"); + check_dec(rects[0].y, rect_return->y, "rect_return->y"); + check_dec(rects[0].width, rect_return->width, + "rect_return->width"); + check_dec(rects[0].height, rect_return->height, "rect_return->height"); + + LKROF(pid2, AVSXTTIMEOUT); + tet_result(TET_PASS); diff --git a/xts5/SHAPE/XShapeGetRectangles/XShapeGetRectangles.m b/xts5/SHAPE/XShapeGetRectangles/XShapeGetRectangles.m new file mode 100644 index 00000000..af71d174 --- /dev/null +++ b/xts5/SHAPE/XShapeGetRectangles/XShapeGetRectangles.m @@ -0,0 +1,145 @@ +Copyright (c) 2005 X.Org Foundation LLC + +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. +$Header: /cvs/xtest/xtest/xts5/tset/SHAPE/XShapeGetRectangles/XShapeGetRectangles.m,v 1.1 2005-02-12 14:37:16 anderson Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1993, 1994, 1995 +Copyright (c) 88open Consortium, Ltd. 1990, 1991, 1992, 1993 +All Rights Reserved. + +>># +>># Project: VSW5 +>># +>># File: tset/SHAPE/XShapeGetRectangles/XShapeGetRectangles.m +>># +>># Description: +>># Tests for XShapeGetRectangles() +>># +>># Modifications: +>># $Log: tshpgtrec.m,v $ +>># Revision 1.1 2005-02-12 14:37:16 anderson +>># Initial revision +>># +>># Revision 8.0 1998/12/23 23:31:28 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:51:13 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:07 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:19:40 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:02:14 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.2 1995/12/15 01:47:53 andy +>># Prepare for GA Release +>># + +>>EXTERN +#include <X11/Xlib.h> +#include <X11/Xutil.h> +#include <X11/extensions/shape.h> +extern Display *display; + +>>TITLE XShapeGetRectangles ShapeExt +XRectangle * +XShapeGetRectangles(display, window, kind, count, ordering) +>>ASSERTION Good A +A call to XRectangle *XShapeGetRectangles(display, window, kind, count, +ordering) shall return the list of rectangles as specified by count +and ordering order +describing the region specified by kind."); +>>CODE +Window window; +XRectangle rects[] = { 0,0, 100, 100, 100, 100, 100, 100 }; +GC gc; +Window root_window; +int x, y; +unsigned int width, height; +unsigned int border_width; +unsigned int depth; +Window window_good; +XSetWindowAttributes xswa; +unsigned long mask; +XRectangle *rect_return; +int count, order; +pid_t pid2; + + FORK(pid2); + tet_infoline("PREP: Open display and create window"); + window = (Window) avs_xext_init(); + tet_infoline("PREP: Get geometry of parent window"); + XGetGeometry(display, window, + &root_window, + &x, &y, + &width, &height, + &border_width, + &depth + ); + tet_infoline("PREP: Create destination window"); + xswa.event_mask = ExposureMask; + xswa.background_pixel = XBlackPixel(display, + XDefaultScreen (display)); + mask = CWEventMask | CWBackPixel; + window_good = XCreateWindow(display, window, + (x+10), (y+10), + (width - 50 ), (height - 50 ), 0, + CopyFromParent, + CopyFromParent, + CopyFromParent, + mask, &xswa + ); + tet_infoline("PREP: Combine two rectangles and map window"); + XShapeCombineRectangles(display, + window_good, + ShapeBounding, 0, 0, + rects, + sizeof (rects) / sizeof (rects[0]), + ShapeSet, YXBanded); + XMapWindow(display, window_good); + XSync(display, 0); + tet_infoline("PREP: Get count and order of rectangles"); + rect_return = (XRectangle *)XShapeGetRectangles(display, + window_good, ShapeBounding, + &count, &order); + tet_infoline("TEST: Count and order values"); + check_dec(2, count, "count"); + check_dec(YXBanded, order, "order"); + tet_infoline("TEST: Check first rectangle values"); + check_dec(rects[0].x, rect_return->x, "rect_return->x"); + check_dec(rects[0].y, rect_return->y, "rect_return->y"); + check_dec(rects[0].width, rect_return->width, + "rect_return->width"); + check_dec(rects[0].height, rect_return->height, + "rect_return->height"); + tet_infoline("TEST: Second rectangle values"); + rect_return++; + check_dec(rects[1].x, rect_return->x, "rect_return->x"); + check_dec(rects[1].y, rect_return->y, "rect_return->y"); + check_dec(rects[1].width, rect_return->width, + "rect_return->width"); + check_dec(rects[1].height, rect_return->height, + "rect_return->height"); + + LKROF(pid2, AVSXTTIMEOUT); + tet_result(TET_PASS); diff --git a/xts5/SHAPE/XShapeInputSelected/XShapeInputSelected.m b/xts5/SHAPE/XShapeInputSelected/XShapeInputSelected.m new file mode 100644 index 00000000..5f6d022c --- /dev/null +++ b/xts5/SHAPE/XShapeInputSelected/XShapeInputSelected.m @@ -0,0 +1,88 @@ +Copyright (c) 2005 X.Org Foundation LLC + +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. +$Header: /cvs/xtest/xtest/xts5/tset/SHAPE/XShapeInputSelected/XShapeInputSelected.m,v 1.1 2005-02-12 14:37:16 anderson Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1993, 1994, 1995 +Copyright (c) 88open Consortium, Ltd. 1990, 1991, 1992, 1993 +All Rights Reserved. + +>># +>># Project: VSW5 +>># +>># File: tset/SHAPE/XShapeOffsetShape/tshpinsel.m +>># +>># Description: +>># Tests for XShapeInputSelected() +>># +>># Modifications: +>># $Log: tshpinsel.m,v $ +>># Revision 1.1 2005-02-12 14:37:16 anderson +>># Initial revision +>># +>># Revision 8.0 1998/12/23 23:31:29 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:51:14 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:08 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:19:40 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.1 1997/10/26 22:38:10 andy +>># Corrected file name +>># +>># Revision 4.0 1995/12/15 09:02:15 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.2 1995/12/15 01:47:53 andy +>># Prepare for GA Release +>># + +>>EXTERN +#include <X11/Xlib.h> +#include <X11/Xutil.h> +#include <X11/extensions/shape.h> +extern Display *display ; + +>>TITLE XShapeInputSelected ShapeExt +unsigned long +XShapeInputSelected(display, window) +>>ASSERTION Good A +A call to unsigned long XShapeInputSelected(display, window) shall return the +current input mask for extension events on the specified window. +>>CODE +Window window ; +unsigned long mask_good ; +pid_t pid2; + + FORK(pid2); + tet_infoline("PREP: Open display and create window"); + window = (Window) avs_xext_init(); + tet_infoline("PREP: Set ShapeNotifyMask mask"); + XShapeSelectInput(display, window, ShapeNotifyMask) ; + tet_infoline("PREP: Get mask of current window"); + mask_good = XShapeInputSelected(display, window); + tet_infoline("TEST: Mask value is ShapeNotifyMask"); + check_dec(ShapeNotifyMask,mask_good, "mask value"); + LKROF(pid2, AVSXTTIMEOUT); + tet_result(TET_PASS); diff --git a/xts5/SHAPE/XShapeOffsetShape/XShapeOffsetShape.m b/xts5/SHAPE/XShapeOffsetShape/XShapeOffsetShape.m new file mode 100644 index 00000000..16478ad1 --- /dev/null +++ b/xts5/SHAPE/XShapeOffsetShape/XShapeOffsetShape.m @@ -0,0 +1,157 @@ +Copyright (c) 2005 X.Org Foundation LLC + +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. +$Header: /cvs/xtest/xtest/xts5/tset/SHAPE/XShapeOffsetShape/XShapeOffsetShape.m,v 1.1 2005-02-12 14:37:16 anderson Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1993, 1994, 1995 +Copyright (c) 88open Consortium, Ltd. 1990, 1991, 1992, 1993 +All Rights Reserved. + +>># +>># Project: VSW5 +>># +>># File: tset/SHAPE/XShapeOffsetShape/XShapeOffsetShape.m +>># +>># Description: +>># Tests for XShapeOffsetShape() +>># +>># Modifications: +>># $Log: tshoffshp.m,v $ +>># Revision 1.1 2005-02-12 14:37:16 anderson +>># Initial revision +>># +>># Revision 8.0 1998/12/23 23:31:26 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:51:07 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:05 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:19:38 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:02:07 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.2 1995/12/15 01:47:50 andy +>># Prepare for GA Release +>># + +>>EXTERN +#include <X11/Xlib.h> +#include <X11/Xutil.h> +#include <X11/extensions/shape.h> +extern Display *display ; + +>>TITLE XShapeOffsetShape ShapeExt +void +XShapeOffsetShape(display, dest, dest_kind, x_off, y_off) +>>ASSERTION Good A +A call to XShapeOffsetShape(display, dest, dest_kind, x_off, y_off) shall +perform an OffsetShape operation by moving the client region, specified +by dest, relative to its current position by the amounts x_off and y_off. +>>CODE +Window window; +XRectangle rects[] = { 0,0, 100, 100, 100, 100, 100, 100 }; +GC gc; +Window root_window; +int x, y; +unsigned int width, height; +unsigned int border_width; +unsigned int depth; +Window window_good; +XSetWindowAttributes xswa; +unsigned long mask; +XRectangle *rect_return; +int count, order; +int x_off; +int y_off; +pid_t pid2; + + FORK(pid2); + tet_infoline("PREP: Open display and create window"); + window = (Window) avs_xext_init(); + tet_infoline("PREP: Get geometry of parent window"); + XGetGeometry(display, window, + &root_window, + &x, &y, + &width, &height, + &border_width, + &depth + ); + tet_infoline("PREP: Create destination window"); + xswa.event_mask = ExposureMask; + xswa.background_pixel = XBlackPixel(display, XDefaultScreen (display)); + mask = CWEventMask | CWBackPixel; + window_good = XCreateWindow(display, window, + (x+10), (y+10), + (width - 50 ), (height - 50 ), 0, + CopyFromParent, + CopyFromParent, + CopyFromParent, + mask, &xswa + ); + tet_infoline("PREP: Combine two rectangles"); + XShapeCombineRectangles(display, + window_good, + ShapeBounding, 0, 0, + rects, + sizeof (rects) / sizeof (rects[0]), + ShapeSet, YXBanded); + tet_infoline("PREP: Perform offset operation of x_off = 100 and y = 100"); + x_off = 100; + y_off = 100; + XShapeOffsetShape(display, + window_good, + ShapeBounding, + x_off, + y_off + ); + XMapWindow(display, window_good); + XSync(display, 0); + tet_infoline("PREP: Get count and order of rectangles"); + rect_return = (XRectangle *)XShapeGetRectangles(display, + window_good, ShapeBounding, + &count, &order); + tet_infoline("TEST: Count and order values"); + check_dec(2, count, "count"); + check_dec(YXBanded, order, "order"); + tet_infoline("TEST: First rectangle values after offset"); + check_dec((rects[0].x + x_off), rect_return->x, + "rect_return->x"); + check_dec((rects[0].y + y_off), rect_return->y, + "rect_return->y"); + check_dec(rects[0].width, rect_return->width, + "rect_return->width"); + check_dec(rects[0].height, rect_return->height, + "rect_return->height"); + tet_infoline("TEST: Second rectangle values after offset"); + rect_return++; + check_dec((rects[1].x + x_off), rect_return->x, + "rect_return->x"); + check_dec((rects[1].y + y_off), rect_return->y, + "rect_return->y"); + check_dec(rects[1].width, rect_return->width, + "rect_return->width"); + check_dec(rects[1].height, rect_return->height, + "rect_return->height"); + LKROF(pid2, AVSXTTIMEOUT); + tet_result(TET_PASS); diff --git a/xts5/SHAPE/XShapeQueryExtension/XShapeQueryExtension.m b/xts5/SHAPE/XShapeQueryExtension/XShapeQueryExtension.m new file mode 100644 index 00000000..34b3aa91 --- /dev/null +++ b/xts5/SHAPE/XShapeQueryExtension/XShapeQueryExtension.m @@ -0,0 +1,96 @@ +Copyright (c) 2005 X.Org Foundation LLC + +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. +$Header: /cvs/xtest/xtest/xts5/tset/SHAPE/XShapeQueryExtension/XShapeQueryExtension.m,v 1.1 2005-02-12 14:37:16 anderson Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1993, 1994, 1995 +Copyright (c) 88open Consortium, Ltd. 1990, 1991, 1992, 1993 +All Rights Reserved. + +>># +>># Project: VSW5 +>># +>># File: tset/SHAPE/XShapeQueryExtension/XShapeQueryExtension.m +>># +>># Description: +>># Tests for XShapeQueryExtension() +>># +>># Modifications: +>># $Log: tshpqyetn.m,v $ +>># Revision 1.1 2005-02-12 14:37:16 anderson +>># Initial revision +>># +>># Revision 8.0 1998/12/23 23:31:29 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:51:15 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:08 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:19:41 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:02:16 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.2 1995/12/15 01:47:54 andy +>># Prepare for GA Release +>># + +>>EXTERN +#include <X11/Xlib.h> +#include <X11/Xutil.h> +#include <X11/extensions/shape.h> +extern Display *display ; + +>>TITLE XShapeQueryExtension ShapeExt +Boolean +XShapeQueryExtension(display, event_base, error_base) +>>ASSERTION Good C +If the specified display supports the SHAPE extension, +a call to Boolean XShapeQueryExtension(display, event_base, error_base) +shall set event_base to the event and *error_base to the error extension, +and return True. +>>CODE +Window window; +int value_good; +int event_base, error_base; +pid_t pid2; + + FORK(pid2); + tet_infoline("PREP: Open display and create window"); + window = (Window) avs_xext_init(); + tet_infoline("TEST: SHAPE extension is supported"); + value_good = XShapeQueryExtension(display, + &event_base, &error_base) ; + check_dec(True, value_good, "SHAPE extension supported"); + /* + * As no errors are defined for this version of the extension + * the value for error_base is not defined nor useful + */ + tet_infoline("TEST: Event_base is set to valid value"); + if (event_base <= 0) { + sprintf(ebuf, "ERROR: Expected non zero returned %d", event_base); + tet_infoline(ebuf); + tet_result(TET_FAIL); + } + LKROF(pid2, AVSXTTIMEOUT); + tet_result(TET_PASS); diff --git a/xts5/SHAPE/XShapeQueryExtents/XShapeQueryExtents.m b/xts5/SHAPE/XShapeQueryExtents/XShapeQueryExtents.m new file mode 100644 index 00000000..65da1894 --- /dev/null +++ b/xts5/SHAPE/XShapeQueryExtents/XShapeQueryExtents.m @@ -0,0 +1,138 @@ +Copyright (c) 2005 X.Org Foundation LLC + +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. +$Header: /cvs/xtest/xtest/xts5/tset/SHAPE/XShapeQueryExtents/XShapeQueryExtents.m,v 1.1 2005-02-12 14:37:16 anderson Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1993, 1994, 1995 +Copyright (c) 88open Consortium, Ltd. 1990, 1991, 1992, 1993 +All Rights Reserved. + +>># +>># Project: VSW5 +>># +>># File: tset/SHAPE/XShapeQueryExtents/XShapeQueryExtents.m +>># +>># Description: +>># Tests for XShapeQueryExtents() +>># +>># Modifications: +>># $Log: tshpqyets.m,v $ +>># Revision 1.1 2005-02-12 14:37:16 anderson +>># Initial revision +>># +>># Revision 8.0 1998/12/23 23:31:30 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:51:16 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:09 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:19:41 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:02:17 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.2 1995/12/15 01:47:55 andy +>># Prepare for GA Release +>># + +>>EXTERN +#include <X11/Xlib.h> +#include <X11/Xutil.h> +#include <X11/extensions/shape.h> +extern Display *display ; + +>>TITLE XShapeQueryExtents ShapeExt +Status +XShapeQueryExtents(display, window, bounding_shaped, x_bounding, y_bounding, w_bounding, h_bounding, clip_shaped, x_clip, y_clip, w_clip, h_clip ) +>>ASSERTION Good A +A call to Status XShapeQueryExtents(display, window, bounding_shaped, +x_bounding, y_bounding, w_bounding, h_bounding, clip_shaped, x_clip, y_clip, +w_clip, h_clip) shall return a non-zero value, and set x_bounding, + y_bounding, w_bounding, h_bounding to the extents of the bounding +shape, and x_clip, y_clip, w_clip, h_clip to extents of the clip shape. +>>CODE +Window window; +int value_good; +int bounding_shaped, clip_shaped; +int x_bounding, y_bounding; +unsigned int w_bounding, h_bounding; +int x_clip, y_clip; +unsigned int w_clip, h_clip; +Window root; +int x, y; +unsigned int width, height; +unsigned int border_width; +unsigned int depth; +pid_t pid2; + + +>># Definition for default bounding and clip regions for the rectangles +>># +>># bounding.x = -bwidth +>># bounding.y = -bwidth +>># bounding.width = width + 2 * bwidth +>># bounding.height = height + 2 * bwidth +>># +>># clip.x = 0 +>># clip.y = 0 +>># clip.width = width +>># clip.heigth = height + + FORK(pid2); + tet_infoline("PREP: Open display and create window"); + window = (Window) avs_xext_init(); + tet_infoline("PREP: XShapeQueryExtents"); + value_good = XShapeQueryExtents(display, window, + &bounding_shaped, + &x_bounding, &y_bounding, + &w_bounding, &h_bounding, + &clip_shaped, + &x_clip, &y_clip, + &w_clip, &h_clip); + tet_infoline("TEST: Non zero value is returned"); + if (value_good <= 0) { + sprintf(ebuf, "ERROR: Expected non zero value, returned %d", value_good); + tet_infoline(ebuf); + tet_result(TET_FAIL); + } + tet_infoline("PREP: Get geometry of window"); + XGetGeometry(display, + window, + &root, + &x, &y, + &width, &height, + &border_width, + &depth + ); + tet_infoline("TEST: Bounding shape and clip shape value"); + check_dec(-1, x_bounding, "x_bounding"); + check_dec(-1, y_bounding, "y_bounding"); + check_dec((width +(2 * border_width)), w_bounding, "w_bounding"); + check_dec((height+(2 * border_width)), h_bounding, "h_bounding"); + check_dec(0, x_clip, "x_clip"); + check_dec(0, y_clip, "y_clip"); + check_dec(width, w_clip, "w_clip"); + check_dec(height, h_clip, "h_clip"); + + LKROF(pid2, AVSXTTIMEOUT); + tet_result(TET_PASS); diff --git a/xts5/SHAPE/XShapeQueryVersion/XShapeQueryVersion.m b/xts5/SHAPE/XShapeQueryVersion/XShapeQueryVersion.m new file mode 100644 index 00000000..88b17a1e --- /dev/null +++ b/xts5/SHAPE/XShapeQueryVersion/XShapeQueryVersion.m @@ -0,0 +1,104 @@ +Copyright (c) 2005 X.Org Foundation LLC + +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. +$Header: /cvs/xtest/xtest/xts5/tset/SHAPE/XShapeQueryVersion/XShapeQueryVersion.m,v 1.1 2005-02-12 14:37:16 anderson Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1993, 1994, 1995 +Copyright (c) 88open Consortium, Ltd. 1990, 1991, 1992, 1993 +All Rights Reserved. + +>># +>># Project: VSW5 +>># +>># File: tset/SHAPE/XShapeQueryVersion/XShapeQueryVersion.m +>># +>># Description: +>># Tests for XShapeQueryVersion() +>># +>># Modifications: +>># $Log: tshpqyver.m,v $ +>># Revision 1.1 2005-02-12 14:37:16 anderson +>># Initial revision +>># +>># Revision 8.0 1998/12/23 23:31:30 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:51:16 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:09 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:19:42 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:02:19 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.2 1995/12/15 01:47:55 andy +>># Prepare for GA Release +>># + +>>EXTERN +#include <X11/Xlib.h> +#include <X11/Xutil.h> +#include <X11/extensions/shape.h> +extern Display *display ; + +>>TITLE XShapeQueryVersion ShapeExt +Status +XShapeQueryVersion(display, major_version, minor_version) +>>ASSERTION Good A +A call to Status XShapeQueryVersion(display, major_version, minor_version) +shall return a non-zero value and set the major and minor version +numbers of the extension supported by the display. +>>CODE +Window window; +int value_good; +int major_version; +int minor_version; +pid_t pid2; + + FORK(pid2); + tet_infoline("PREP: Open display and create window"); + window = (Window) avs_xext_init(); + tet_infoline("TEST: XShapeQueryVersion"); + value_good = XShapeQueryVersion(display, + &major_version, &minor_version) ; + tet_infoline("TEST: Non zero value is returned"); + if (value_good <=0 ) { + sprintf(ebuf, "ERROR: Expected non zero, returned %d", value_good); + tet_infoline(ebuf); + tet_result(TET_FAIL); + } + tet_infoline("TESTING: major_version is set to valid value"); + if (major_version <= 0) { + sprintf(ebuf, "ERROR: Expected non zero returned %d", major_version); + tet_infoline(ebuf); + tet_result(TET_FAIL); + } + tet_infoline("TESTING: minor_version is set to valid value"); + if (minor_version < 0) { + sprintf(ebuf, "ERROR: Expected positive number returned %d", minor_version); + tet_infoline(ebuf); + tet_result(TET_FAIL); + } + + LKROF(pid2, AVSXTTIMEOUT); + tet_result(TET_PASS); diff --git a/xts5/SHAPE/XShapeSelectInput/XShapeSelectInput.m b/xts5/SHAPE/XShapeSelectInput/XShapeSelectInput.m new file mode 100644 index 00000000..14584328 --- /dev/null +++ b/xts5/SHAPE/XShapeSelectInput/XShapeSelectInput.m @@ -0,0 +1,85 @@ +Copyright (c) 2005 X.Org Foundation LLC + +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. +$Header: /cvs/xtest/xtest/xts5/tset/SHAPE/XShapeSelectInput/XShapeSelectInput.m,v 1.1 2005-02-12 14:37:16 anderson Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1993, 1994, 1995 +Copyright (c) 88open Consortium, Ltd. 1990, 1991, 1992, 1993 +All Rights Reserved. + +>># +>># Project: VSW5 +>># +>># File: tset/SHAPE/XShapeSelectInput/XShapeSelectInput.m +>># +>># Description: +>># Tests for XShapeSelectInput() +>># +>># Modifications: +>># $Log: tshpstinp.m,v $ +>># Revision 1.1 2005-02-12 14:37:16 anderson +>># Initial revision +>># +>># Revision 8.0 1998/12/23 23:31:31 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:51:17 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:09 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:19:42 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:02:20 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.2 1995/12/15 01:47:56 andy +>># Prepare for GA Release +>># + +>>EXTERN +#include <X11/Xlib.h> +#include <X11/Xutil.h> +#include <X11/extensions/shape.h> +extern Display *display ; + +>>TITLE XShapeSelectInput ShapeExt +void +XShapeSelectInput(display, window, mask) +>>ASSERTION Good A +A call to void XShapeSelectInput(display, window, mask) shall set the +shape mask for the specified display and window. +>>CODE +Window window; +unsigned long mask_good; +pid_t pid2; + + FORK(pid2); + tet_infoline("PREP: Open display and create window"); + window = (Window) avs_xext_init(); + tet_infoline("TEST: Set ShapeNotifyMask mask"); + XShapeSelectInput(display, window, ShapeNotifyMask) ; + tet_infoline("PREP: Get mask of current window"); + mask_good = XShapeInputSelected(display, window); + tet_infoline("TEST: Mask value is ShapeNotifyMask"); + check_dec(ShapeNotifyMask, mask_good, "mask value"); + LKROF(pid2, AVSXTTIMEOUT); + tet_result(TET_PASS); |