home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / lib / X / XDrArc.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-01-29  |  2.0 KB  |  67 lines

  1. /* $XConsortium: XDrArc.c,v 11.15 91/01/06 11:45:10 rws Exp $ */
  2. /* Copyright    Massachusetts Institute of Technology    1986    */
  3.  
  4. /*
  5. Permission to use, copy, modify, distribute, and sell this software and its
  6. documentation for any purpose is hereby granted without fee, provided that
  7. the above copyright notice appear in all copies and that both that
  8. copyright notice and this permission notice appear in supporting
  9. documentation, and that the name of M.I.T. not be used in advertising or
  10. publicity pertaining to distribution of the software without specific,
  11. written prior permission.  M.I.T. makes no representations about the
  12. suitability of this software for any purpose.  It is provided "as is"
  13. without express or implied warranty.
  14. */
  15.  
  16. /* Note to future maintainers:  XDrawArc does NOT batch successive PolyArc
  17.    requests into a single request like XDrawLine, XDrawPoint, etc.
  18.    We don't do this because X_PolyArc applies the GC's join-style if
  19.    the last point in one arc coincides with the first point in another.
  20.    The client wouldn't expect this and would have no easy way to defeat it. */
  21.    
  22. #include "Xlibint.h"
  23.  
  24. XDrawArc(dpy, d, gc, x, y, width, height, angle1, angle2)
  25.     register Display *dpy;
  26.     Drawable d;
  27.     GC gc;
  28.     int x, y; /* INT16 */
  29.     unsigned int width, height; /* CARD16 */
  30.     int angle1, angle2; /* INT16 */
  31. {
  32.     register xPolyArcReq *req;
  33.     register xArc *arc;
  34. #ifdef MUSTCOPY
  35.     xArc arcdata;
  36.     long len = SIZEOF(xArc);
  37.  
  38.     arc = &arcdata;
  39. #endif /* MUSTCOPY */
  40.  
  41.     LockDisplay(dpy);
  42.     FlushGC(dpy, gc);
  43.     GetReqExtra (PolyArc, SIZEOF(xArc), req);
  44.  
  45.     req->drawable = d;
  46.     req->gc = gc->gid;
  47.  
  48. #ifndef MUSTCOPY
  49.     arc = (xArc *) NEXTPTR(req,xPolyArcReq);
  50. #endif /* MUSTCOPY */
  51.  
  52.     arc->x = x;
  53.     arc->y = y;
  54.     arc->width = width;
  55.     arc->height = height;
  56.     arc->angle1 = angle1;
  57.     arc->angle2 = angle2;
  58.  
  59. #ifdef MUSTCOPY
  60.     dpy->bufptr -= SIZEOF(xArc);
  61.     Data (dpy, (char *) arc, len);
  62. #endif /* MUSTCOPY */
  63.  
  64.     UnlockDisplay(dpy);
  65.     SyncHandle();
  66. }
  67.