PageRenderTime 149ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/brlcad/tags/rel-5-0/libtk/xlib/xdraw.c

https://bitbucket.org/vrrm/brl-cad-copy-for-fast-history-browsing-in-git
C | 82 lines | 34 code | 4 blank | 44 comment | 0 complexity | b898f01313df68c65d213b8f93800556 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.0, LGPL-2.1, Apache-2.0, AGPL-3.0, LGPL-3.0, GPL-3.0, MPL-2.0-no-copyleft-exception, CC-BY-SA-3.0, 0BSD, BSD-3-Clause
  1. /*
  2. * xdraw.c --
  3. *
  4. * This file contains generic procedures related to X drawing
  5. * primitives.
  6. *
  7. * Copyright (c) 1995 Sun Microsystems, Inc.
  8. *
  9. * See the file "license.terms" for information on usage and redistribution
  10. * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  11. *
  12. * SCCS: @(#) xdraw.c 1.2 96/02/15 18:55:46
  13. */
  14. #include "tk.h"
  15. /*
  16. *----------------------------------------------------------------------
  17. *
  18. * XDrawLine --
  19. *
  20. * Draw a single line between two points in a given drawable.
  21. *
  22. * Results:
  23. * None.
  24. *
  25. * Side effects:
  26. * Draws a single line segment.
  27. *
  28. *----------------------------------------------------------------------
  29. */
  30. void
  31. XDrawLine(display, d, gc, x1, y1, x2, y2)
  32. Display* display;
  33. Drawable d;
  34. GC gc;
  35. int x1, y1, x2, y2; /* Coordinates of line segment. */
  36. {
  37. XPoint points[2];
  38. points[0].x = x1;
  39. points[0].y = y1;
  40. points[1].x = x2;
  41. points[1].y = y2;
  42. XDrawLines(display, d, gc, points, 2, CoordModeOrigin);
  43. }
  44. /*
  45. *----------------------------------------------------------------------
  46. *
  47. * XFillRectangle --
  48. *
  49. * Fills a rectangular area in the given drawable. This procedure
  50. * is implemented as a call to XFillRectangles.
  51. *
  52. * Results:
  53. * None
  54. *
  55. * Side effects:
  56. * Fills the specified rectangle.
  57. *
  58. *----------------------------------------------------------------------
  59. */
  60. void
  61. XFillRectangle(display, d, gc, x, y, width, height)
  62. Display* display;
  63. Drawable d;
  64. GC gc;
  65. int x;
  66. int y;
  67. unsigned int width;
  68. unsigned int height;
  69. {
  70. XRectangle rectangle;
  71. rectangle.x = x;
  72. rectangle.y = y;
  73. rectangle.width = width;
  74. rectangle.height = height;
  75. XFillRectangles(display, d, gc, &rectangle, 1);
  76. }