/nx-3.5.0/nx-X11/lib/X11/DrArc.c

# · C · 84 lines · 42 code · 10 blank · 32 comment · 0 complexity · 9cd021808639548de2fc5392ccc8f4a6 MD5 · raw file

  1. /* $Xorg: DrArc.c,v 1.4 2001/02/09 02:03:32 xorgcvs Exp $ */
  2. /*
  3. Copyright 1986, 1998 The Open Group
  4. Permission to use, copy, modify, distribute, and sell this software and its
  5. documentation for any purpose is hereby granted without fee, provided that
  6. the above copyright notice appear in all copies and that both that
  7. copyright notice and this permission notice appear in supporting
  8. documentation.
  9. The above copyright notice and this permission notice shall be included in
  10. all copies or substantial portions of the Software.
  11. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14. OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  15. AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  16. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  17. Except as contained in this notice, the name of The Open Group shall not be
  18. used in advertising or otherwise to promote the sale, use or other dealings
  19. in this Software without prior written authorization from The Open Group.
  20. */
  21. /* $XFree86: xc/lib/X11/DrArc.c,v 1.3 2001/01/17 19:41:34 dawes Exp $ */
  22. /* Note to future maintainers: XDrawArc does NOT batch successive PolyArc
  23. requests into a single request like XDrawLine, XDrawPoint, etc.
  24. We don't do this because X_PolyArc applies the GC's join-style if
  25. the last point in one arc coincides with the first point in another.
  26. The client wouldn't expect this and would have no easy way to defeat it. */
  27. #ifdef HAVE_CONFIG_H
  28. #include <config.h>
  29. #endif
  30. #include "Xlibint.h"
  31. int
  32. XDrawArc(dpy, d, gc, x, y, width, height, angle1, angle2)
  33. register Display *dpy;
  34. Drawable d;
  35. GC gc;
  36. int x, y; /* INT16 */
  37. unsigned int width, height; /* CARD16 */
  38. int angle1, angle2; /* INT16 */
  39. {
  40. register xPolyArcReq *req;
  41. register xArc *arc;
  42. #ifdef MUSTCOPY
  43. xArc arcdata;
  44. long len = SIZEOF(xArc);
  45. arc = &arcdata;
  46. #endif /* MUSTCOPY */
  47. LockDisplay(dpy);
  48. FlushGC(dpy, gc);
  49. GetReqExtra (PolyArc, SIZEOF(xArc), req);
  50. req->drawable = d;
  51. req->gc = gc->gid;
  52. #ifndef MUSTCOPY
  53. arc = (xArc *) NEXTPTR(req,xPolyArcReq);
  54. #endif /* MUSTCOPY */
  55. arc->x = x;
  56. arc->y = y;
  57. arc->width = width;
  58. arc->height = height;
  59. arc->angle1 = angle1;
  60. arc->angle2 = angle2;
  61. #ifdef MUSTCOPY
  62. dpy->bufptr -= SIZEOF(xArc);
  63. Data (dpy, (char *) arc, len);
  64. #endif /* MUSTCOPY */
  65. UnlockDisplay(dpy);
  66. SyncHandle();
  67. return 1;
  68. }