16ea72052Smrg/* 26ea72052Smrg 36ea72052SmrgCopyright 1993, 1998 The Open Group 46ea72052Smrg 56ea72052SmrgPermission to use, copy, modify, distribute, and sell this software and its 66ea72052Smrgdocumentation for any purpose is hereby granted without fee, provided that 76ea72052Smrgthe above copyright notice appear in all copies and that both that 86ea72052Smrgcopyright notice and this permission notice appear in supporting 96ea72052Smrgdocumentation. 106ea72052Smrg 116ea72052SmrgThe above copyright notice and this permission notice shall be included 126ea72052Smrgin all copies or substantial portions of the Software. 136ea72052Smrg 146ea72052SmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 156ea72052SmrgOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 166ea72052SmrgMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 176ea72052SmrgIN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 186ea72052SmrgOTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 196ea72052SmrgARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 206ea72052SmrgOTHER DEALINGS IN THE SOFTWARE. 216ea72052Smrg 226ea72052SmrgExcept as contained in this notice, the name of The Open Group shall 236ea72052Smrgnot be used in advertising or otherwise to promote the sale, use or 246ea72052Smrgother dealings in this Software without prior written authorization 256ea72052Smrgfrom The Open Group. 266ea72052Smrg 276ea72052Smrg*/ 286ea72052Smrg 296ea72052Smrg 306ea72052Smrg/* 316ea72052Smrg * header file for transformed coordinate system. No rotations 32f3e6ffc5Smrg * supported, as ellipses cannot be rotated in X. 336ea72052Smrg */ 346ea72052Smrg 356ea72052Smrgtypedef struct _transform { 366ea72052Smrg double mx, bx; 376ea72052Smrg double my, by; 386ea72052Smrg} Transform; 396ea72052Smrg 406ea72052Smrgtypedef struct _TPoint { 416ea72052Smrg double x, y; 426ea72052Smrg} TPoint; 436ea72052Smrg 446ea72052Smrgtypedef struct _TRectangle { 456ea72052Smrg double x, y, width, height; 466ea72052Smrg} TRectangle; 476ea72052Smrg 486ea72052Smrg# define Xx(x,y,t) ((int)((t)->mx * (x) + (t)->bx + 0.5)) 496ea72052Smrg# define Xy(x,y,t) ((int)((t)->my * (y) + (t)->by + 0.5)) 506ea72052Smrg# define Xwidth(w,h,t) ((int)((t)->mx * (w) + 0.5)) 516ea72052Smrg# define Xheight(w,h,t) ((int)((t)->my * (h) + 0.5)) 526ea72052Smrg# define Tx(x,y,t) ((((double) (x)) - (t)->bx) / (t)->mx) 536ea72052Smrg# define Ty(x,y,t) ((((double) (y)) - (t)->by) / (t)->my) 546ea72052Smrg# define Twidth(w,h,t) (((double) (w)) / (t)->mx) 556ea72052Smrg# define Theight(w,h,t) (((double) (h)) / (t)->my) 566ea72052Smrg 5749e82cebSmrgextern void TFillPolygon ( Display *dpy, Drawable d, GC gc, Transform *t, 586ea72052Smrg TPoint *points, int n_points, int shape, int mode ); 5949e82cebSmrgextern void TFillArc ( Display *dpy, Drawable d, GC gc, Transform *t, 6049e82cebSmrg double x, double y, double width, double height, 616ea72052Smrg int angle1, int angle2 ); 6249e82cebSmrgextern void SetTransform ( Transform *t, int xx1, int xx2, int xy1, int xy2, 636ea72052Smrg double tx1, double tx2, double ty1, double ty2 ); 64