summaryrefslogtreecommitdiffstats
path: root/tk8.6/xlib/xdraw.c
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2018-01-02 21:03:49 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2018-01-02 21:03:49 (GMT)
commit914501b5b992e7b6c7e0a4c958712a8ba9cab41c (patch)
treeedbc059b9557d5fdb79e5a5c47889bc54708da53 /tk8.6/xlib/xdraw.c
parentf88c190a01bc7f57e79dfaf91a3c0c48c2031549 (diff)
downloadblt-914501b5b992e7b6c7e0a4c958712a8ba9cab41c.zip
blt-914501b5b992e7b6c7e0a4c958712a8ba9cab41c.tar.gz
blt-914501b5b992e7b6c7e0a4c958712a8ba9cab41c.tar.bz2
upgrade to tcl/tk 8.6.8
Diffstat (limited to 'tk8.6/xlib/xdraw.c')
-rw-r--r--tk8.6/xlib/xdraw.c88
1 files changed, 88 insertions, 0 deletions
diff --git a/tk8.6/xlib/xdraw.c b/tk8.6/xlib/xdraw.c
new file mode 100644
index 0000000..b8d7973
--- /dev/null
+++ b/tk8.6/xlib/xdraw.c
@@ -0,0 +1,88 @@
+/*
+ * xdraw.c --
+ *
+ * This file contains generic procedures related to X drawing primitives.
+ *
+ * Copyright (c) 1995 Sun Microsystems, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+#include "tk.h"
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * XDrawLine --
+ *
+ * Draw a single line between two points in a given drawable.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Draws a single line segment.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+XDrawLine(
+ Display *display,
+ Drawable d,
+ GC gc,
+ int x1, int y1,
+ int x2, int y2) /* Coordinates of line segment. */
+{
+ XPoint points[2];
+
+ points[0].x = x1;
+ points[0].y = y1;
+ points[1].x = x2;
+ points[1].y = y2;
+ return XDrawLines(display, d, gc, points, 2, CoordModeOrigin);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * XFillRectangle --
+ *
+ * Fills a rectangular area in the given drawable. This procedure is
+ * implemented as a call to XFillRectangles.
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * Fills the specified rectangle.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+XFillRectangle(
+ Display *display,
+ Drawable d,
+ GC gc,
+ int x,
+ int y,
+ unsigned int width,
+ unsigned int height)
+{
+ XRectangle rectangle;
+ rectangle.x = x;
+ rectangle.y = y;
+ rectangle.width = width;
+ rectangle.height = height;
+ return XFillRectangles(display, d, gc, &rectangle, 1);
+}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */