summaryrefslogtreecommitdiffstats
path: root/xlib/xdraw.c
diff options
context:
space:
mode:
authorrjohnson <rjohnson>1998-04-01 09:51:44 (GMT)
committerrjohnson <rjohnson>1998-04-01 09:51:44 (GMT)
commit066ea7fd88d49cb456f74da71dbe875e4fc0aabb (patch)
tree8fb30cb152c4dc191be47fa043d2e6f5ea38c7ba /xlib/xdraw.c
parent13242623d2ff3ea02ab6a62bfb48a7dbb5c27e22 (diff)
downloadtk-066ea7fd88d49cb456f74da71dbe875e4fc0aabb.zip
tk-066ea7fd88d49cb456f74da71dbe875e4fc0aabb.tar.gz
tk-066ea7fd88d49cb456f74da71dbe875e4fc0aabb.tar.bz2
Initial revision
Diffstat (limited to 'xlib/xdraw.c')
-rw-r--r--xlib/xdraw.c82
1 files changed, 82 insertions, 0 deletions
diff --git a/xlib/xdraw.c b/xlib/xdraw.c
new file mode 100644
index 0000000..8e78011
--- /dev/null
+++ b/xlib/xdraw.c
@@ -0,0 +1,82 @@
+/*
+ * 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.
+ *
+ * SCCS: @(#) xdraw.c 1.2 96/02/15 18:55:46
+ */
+
+#include "tk.h"
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * XDrawLine --
+ *
+ * Draw a single line between two points in a given drawable.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Draws a single line segment.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+XDrawLine(display, d, gc, x1, y1, x2, y2)
+ Display* display;
+ Drawable d;
+ GC gc;
+ int x1, y1, x2, y2; /* Coordinates of line segment. */
+{
+ XPoint points[2];
+
+ points[0].x = x1;
+ points[0].y = y1;
+ points[1].x = x2;
+ points[1].y = y2;
+ 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.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+XFillRectangle(display, d, gc, x, y, width, height)
+ 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;
+ XFillRectangles(display, d, gc, &rectangle, 1);
+}