|
Packit |
5bd3a9 |
'\" e
|
|
Packit |
5bd3a9 |
.\" Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1994, 1996 X Consortium
|
|
Packit |
5bd3a9 |
.\"
|
|
Packit |
5bd3a9 |
.\" Permission is hereby granted, free of charge, to any person obtaining
|
|
Packit |
5bd3a9 |
.\" a copy of this software and associated documentation files (the
|
|
Packit |
5bd3a9 |
.\" "Software"), to deal in the Software without restriction, including
|
|
Packit |
5bd3a9 |
.\" without limitation the rights to use, copy, modify, merge, publish,
|
|
Packit |
5bd3a9 |
.\" distribute, sublicense, and/or sell copies of the Software, and to
|
|
Packit |
5bd3a9 |
.\" permit persons to whom the Software is furnished to do so, subject to
|
|
Packit |
5bd3a9 |
.\" the following conditions:
|
|
Packit |
5bd3a9 |
.\"
|
|
Packit |
5bd3a9 |
.\" The above copyright notice and this permission notice shall be included
|
|
Packit |
5bd3a9 |
.\" in all copies or substantial portions of the Software.
|
|
Packit |
5bd3a9 |
.\"
|
|
Packit |
5bd3a9 |
.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
Packit |
5bd3a9 |
.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
Packit |
5bd3a9 |
.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
Packit |
5bd3a9 |
.\" IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
Packit |
5bd3a9 |
.\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
Packit |
5bd3a9 |
.\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
Packit |
5bd3a9 |
.\" OTHER DEALINGS IN THE SOFTWARE.
|
|
Packit |
5bd3a9 |
.\"
|
|
Packit |
5bd3a9 |
.\" Except as contained in this notice, the name of the X Consortium shall
|
|
Packit |
5bd3a9 |
.\" not be used in advertising or otherwise to promote the sale, use or
|
|
Packit |
5bd3a9 |
.\" other dealings in this Software without prior written authorization
|
|
Packit |
5bd3a9 |
.\" from the X Consortium.
|
|
Packit |
5bd3a9 |
.\"
|
|
Packit |
5bd3a9 |
.\" Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991 by
|
|
Packit |
5bd3a9 |
.\" Digital Equipment Corporation
|
|
Packit |
5bd3a9 |
.\"
|
|
Packit |
5bd3a9 |
.\" Portions Copyright \(co 1990, 1991 by
|
|
Packit |
5bd3a9 |
.\" Tektronix, Inc.
|
|
Packit |
5bd3a9 |
.\"
|
|
Packit |
5bd3a9 |
.\" Permission to use, copy, modify and distribute this documentation for
|
|
Packit |
5bd3a9 |
.\" any purpose and without fee is hereby granted, provided that the above
|
|
Packit |
5bd3a9 |
.\" copyright notice appears in all copies and that both that copyright notice
|
|
Packit |
5bd3a9 |
.\" and this permission notice appear in all copies, and that the names of
|
|
Packit |
5bd3a9 |
.\" Digital and Tektronix not be used in in advertising or publicity pertaining
|
|
Packit |
5bd3a9 |
.\" to this documentation without specific, written prior permission.
|
|
Packit |
5bd3a9 |
.\" Digital and Tektronix makes no representations about the suitability
|
|
Packit |
5bd3a9 |
.\" of this documentation for any purpose.
|
|
Packit |
5bd3a9 |
.\" It is provided ``as is'' without express or implied warranty.
|
|
Packit |
5bd3a9 |
.\"
|
|
Packit |
5bd3a9 |
.\"
|
|
Packit |
5bd3a9 |
.ds xT X Toolkit Intrinsics \- C Language Interface
|
|
Packit |
5bd3a9 |
.ds xW Athena X Widgets \- C Language X Toolkit Interface
|
|
Packit |
5bd3a9 |
.ds xL Xlib \- C Language X Interface
|
|
Packit |
5bd3a9 |
.ds xC Inter-Client Communication Conventions Manual
|
|
Packit |
5bd3a9 |
.na
|
|
Packit |
5bd3a9 |
.de Ds
|
|
Packit |
5bd3a9 |
.nf
|
|
Packit |
5bd3a9 |
.\\$1D \\$2 \\$1
|
|
Packit |
5bd3a9 |
.ft CW
|
|
Packit |
5bd3a9 |
.\".ps \\n(PS
|
|
Packit |
5bd3a9 |
.\".if \\n(VS>=40 .vs \\n(VSu
|
|
Packit |
5bd3a9 |
.\".if \\n(VS<=39 .vs \\n(VSp
|
|
Packit |
5bd3a9 |
..
|
|
Packit |
5bd3a9 |
.de De
|
|
Packit |
5bd3a9 |
.ce 0
|
|
Packit |
5bd3a9 |
.if \\n(BD .DF
|
|
Packit |
5bd3a9 |
.nr BD 0
|
|
Packit |
5bd3a9 |
.in \\n(OIu
|
|
Packit |
5bd3a9 |
.if \\n(TM .ls 2
|
|
Packit |
5bd3a9 |
.sp \\n(DDu
|
|
Packit |
5bd3a9 |
.fi
|
|
Packit |
5bd3a9 |
..
|
|
Packit |
5bd3a9 |
.de IN \" send an index entry to the stderr
|
|
Packit |
5bd3a9 |
..
|
|
Packit |
5bd3a9 |
.de Pn
|
|
Packit |
5bd3a9 |
.ie t \\$1\fB\^\\$2\^\fR\\$3
|
|
Packit |
5bd3a9 |
.el \\$1\fI\^\\$2\^\fP\\$3
|
|
Packit |
5bd3a9 |
..
|
|
Packit |
5bd3a9 |
.de ZN
|
|
Packit |
5bd3a9 |
.ie t \fB\^\\$1\^\fR\\$2
|
|
Packit |
5bd3a9 |
.el \fI\^\\$1\^\fP\\$2
|
|
Packit |
5bd3a9 |
..
|
|
Packit |
5bd3a9 |
.de hN
|
|
Packit |
5bd3a9 |
.ie t <\fB\\$1\fR>\\$2
|
|
Packit |
5bd3a9 |
.el <\fI\\$1\fP>\\$2
|
|
Packit |
5bd3a9 |
..
|
|
Packit |
5bd3a9 |
.ny0
|
|
Packit |
5bd3a9 |
.de EX
|
|
Packit |
5bd3a9 |
.sp
|
|
Packit |
5bd3a9 |
.nf
|
|
Packit |
5bd3a9 |
.ft CW
|
|
Packit |
5bd3a9 |
..
|
|
Packit |
5bd3a9 |
.de EE
|
|
Packit |
5bd3a9 |
.ft R
|
|
Packit |
5bd3a9 |
.fi
|
|
Packit |
5bd3a9 |
.sp
|
|
Packit |
5bd3a9 |
..
|
|
Packit |
5bd3a9 |
'\" e
|
|
Packit |
5bd3a9 |
.TH XDrawArc __libmansuffix__ __xorgversion__ "XLIB FUNCTIONS"
|
|
Packit |
5bd3a9 |
.SH NAME
|
|
Packit |
5bd3a9 |
XDrawArc, XDrawArcs, XArc \- draw arcs and arc structure
|
|
Packit |
5bd3a9 |
.SH SYNTAX
|
|
Packit |
5bd3a9 |
.HP
|
|
Packit |
5bd3a9 |
int XDrawArc\^(\^Display *\fIdisplay\fP\^, Drawable \fId\fP\^, GC \fIgc\fP\^,
|
|
Packit |
5bd3a9 |
int \fIx\fP\^, int \fIy\fP\^, unsigned int \fIwidth\fP\^, unsigned int
|
|
Packit |
5bd3a9 |
\fIheight\fP\^, int \fIangle1\fP\^, int \fIangle2\fP\^);
|
|
Packit |
5bd3a9 |
.HP
|
|
Packit |
5bd3a9 |
int XDrawArcs\^(\^Display *\fIdisplay\fP\^, Drawable \fId\fP\^, GC \fIgc\fP\^,
|
|
Packit |
5bd3a9 |
XArc *\fIarcs\fP\^, int \fInarcs\fP\^);
|
|
Packit |
5bd3a9 |
.SH ARGUMENTS
|
|
Packit |
5bd3a9 |
.IP \fIangle1\fP 1i
|
|
Packit |
5bd3a9 |
Specifies the start of the arc relative to the three-o'clock position
|
|
Packit |
5bd3a9 |
from the center, in units of degrees * 64.
|
|
Packit |
5bd3a9 |
.IP \fIangle2\fP 1i
|
|
Packit |
5bd3a9 |
Specifies the path and extent of the arc relative to the start of the
|
|
Packit |
5bd3a9 |
arc, in units of degrees * 64.
|
|
Packit |
5bd3a9 |
.IP \fIarcs\fP 1i
|
|
Packit |
5bd3a9 |
Specifies an array of arcs.
|
|
Packit |
5bd3a9 |
.IP \fId\fP 1i
|
|
Packit |
5bd3a9 |
Specifies the drawable.
|
|
Packit |
5bd3a9 |
.IP \fIdisplay\fP 1i
|
|
Packit |
5bd3a9 |
Specifies the connection to the X server.
|
|
Packit |
5bd3a9 |
.IP \fIgc\fP 1i
|
|
Packit |
5bd3a9 |
Specifies the GC.
|
|
Packit |
5bd3a9 |
.IP \fInarcs\fP 1i
|
|
Packit |
5bd3a9 |
Specifies the number of arcs in the array.
|
|
Packit |
5bd3a9 |
.ds Wh , which are the major and minor axes of the arc
|
|
Packit |
5bd3a9 |
.IP \fIwidth\fP 1i
|
|
Packit |
5bd3a9 |
.br
|
|
Packit |
5bd3a9 |
.ns
|
|
Packit |
5bd3a9 |
.IP \fIheight\fP 1i
|
|
Packit |
5bd3a9 |
Specify the width and height\*(Wh.
|
|
Packit |
5bd3a9 |
.ds Xy , which are relative to the origin of the drawable \
|
|
Packit |
5bd3a9 |
and specify the upper-left corner of the bounding rectangle
|
|
Packit |
5bd3a9 |
.IP \fIx\fP 1i
|
|
Packit |
5bd3a9 |
.br
|
|
Packit |
5bd3a9 |
.ns
|
|
Packit |
5bd3a9 |
.IP \fIy\fP 1i
|
|
Packit |
5bd3a9 |
Specify the x and y coordinates\*(Xy.
|
|
Packit |
5bd3a9 |
.SH DESCRIPTION
|
|
Packit |
5bd3a9 |
.EQ
|
|
Packit |
5bd3a9 |
delim %%
|
|
Packit |
5bd3a9 |
.EN
|
|
Packit |
5bd3a9 |
.ZN XDrawArc
|
|
Packit |
5bd3a9 |
draws a single circular or elliptical arc, and
|
|
Packit |
5bd3a9 |
.ZN XDrawArcs
|
|
Packit |
5bd3a9 |
draws multiple circular or elliptical arcs.
|
|
Packit |
5bd3a9 |
Each arc is specified by a rectangle and two angles.
|
|
Packit |
5bd3a9 |
The center of the circle or ellipse is the center of the
|
|
Packit |
5bd3a9 |
rectangle, and the major and minor axes are specified by the width and height.
|
|
Packit |
5bd3a9 |
Positive angles indicate counterclockwise motion,
|
|
Packit |
5bd3a9 |
and negative angles indicate clockwise motion.
|
|
Packit |
5bd3a9 |
If the magnitude of angle2 is greater than 360 degrees,
|
|
Packit |
5bd3a9 |
.ZN XDrawArc
|
|
Packit |
5bd3a9 |
or
|
|
Packit |
5bd3a9 |
.ZN XDrawArcs
|
|
Packit |
5bd3a9 |
truncates it to 360 degrees.
|
|
Packit |
5bd3a9 |
.LP
|
|
Packit |
5bd3a9 |
For an arc specified as %[ ~x, ~y, ~width , ~height, ~angle1, ~angle2 ]%,
|
|
Packit |
5bd3a9 |
the origin of the major and minor axes is at
|
|
Packit |
5bd3a9 |
% [ x +^ {width over 2} , ~y +^ {height over 2} ]%,
|
|
Packit |
5bd3a9 |
and the infinitely thin path describing the entire circle or ellipse
|
|
Packit |
5bd3a9 |
intersects the horizontal axis at % [ x, ~y +^ {height over 2} ]% and
|
|
Packit |
5bd3a9 |
% [ x +^ width , ~y +^ { height over 2 }] %
|
|
Packit |
5bd3a9 |
and intersects the vertical axis at % [ x +^ { width over 2 } , ~y ]% and
|
|
Packit |
5bd3a9 |
% [ x +^ { width over 2 }, ~y +^ height ]%.
|
|
Packit |
5bd3a9 |
These coordinates can be fractional
|
|
Packit |
5bd3a9 |
and so are not truncated to discrete coordinates.
|
|
Packit |
5bd3a9 |
The path should be defined by the ideal mathematical path.
|
|
Packit |
5bd3a9 |
For a wide line with line-width lw,
|
|
Packit |
5bd3a9 |
the bounding outlines for filling are given
|
|
Packit |
5bd3a9 |
by the two infinitely thin paths consisting of all points whose perpendicular
|
|
Packit |
5bd3a9 |
distance from the path of the circle/ellipse is equal to lw/2
|
|
Packit |
5bd3a9 |
(which may be a fractional value).
|
|
Packit |
5bd3a9 |
The cap-style and join-style are applied the same as for a line
|
|
Packit |
5bd3a9 |
corresponding to the tangent of the circle/ellipse at the endpoint.
|
|
Packit |
5bd3a9 |
.LP
|
|
Packit |
5bd3a9 |
For an arc specified as % [ ~x, ~y, ~width, ~height, ~angle1, ~angle2 ]%,
|
|
Packit |
5bd3a9 |
the angles must be specified
|
|
Packit |
5bd3a9 |
in the effectively skewed coordinate system of the ellipse (for a
|
|
Packit |
5bd3a9 |
circle, the angles and coordinate systems are identical). The
|
|
Packit |
5bd3a9 |
relationship between these angles and angles expressed in the normal
|
|
Packit |
5bd3a9 |
coordinate system of the screen (as measured with a protractor) is as
|
|
Packit |
5bd3a9 |
follows:
|
|
Packit |
5bd3a9 |
.LP
|
|
Packit |
5bd3a9 |
.Ds
|
|
Packit |
5bd3a9 |
% roman "skewed-angle" ~ = ~ atan left ( tan ( roman "normal-angle" )
|
|
Packit |
5bd3a9 |
* width over height right ) +^ adjust%
|
|
Packit |
5bd3a9 |
.De
|
|
Packit |
5bd3a9 |
.LP
|
|
Packit |
5bd3a9 |
The skewed-angle and normal-angle are expressed in radians (rather
|
|
Packit |
5bd3a9 |
than in degrees scaled by 64) in the range % [ 0 , ~2 pi ]% and where atan
|
|
Packit |
5bd3a9 |
returns a value in the range % [ - pi over 2 , ~pi over 2 ] %
|
|
Packit |
5bd3a9 |
and adjust is:
|
|
Packit |
5bd3a9 |
.LP
|
|
Packit |
5bd3a9 |
.TS
|
|
Packit |
5bd3a9 |
l l.
|
|
Packit |
5bd3a9 |
%0% for normal-angle in the range % [ 0 , ~pi over 2 ]%
|
|
Packit |
5bd3a9 |
%pi% for normal-angle in the range % [ pi over 2 , ~{3 pi} over 2 ]%
|
|
Packit |
5bd3a9 |
%2 pi% for normal-angle in the range % [ {3 pi} over 2 , ~2 pi ]%
|
|
Packit |
5bd3a9 |
.TE
|
|
Packit |
5bd3a9 |
.LP
|
|
Packit |
5bd3a9 |
For any given arc,
|
|
Packit |
5bd3a9 |
.ZN XDrawArc
|
|
Packit |
5bd3a9 |
and
|
|
Packit |
5bd3a9 |
.ZN XDrawArcs
|
|
Packit |
5bd3a9 |
do not draw a pixel more than once.
|
|
Packit |
5bd3a9 |
If two arcs join correctly and if the line-width is greater than zero
|
|
Packit |
5bd3a9 |
and the arcs intersect,
|
|
Packit |
5bd3a9 |
.ZN XDrawArc
|
|
Packit |
5bd3a9 |
and
|
|
Packit |
5bd3a9 |
.ZN XDrawArcs
|
|
Packit |
5bd3a9 |
do not draw a pixel more than once.
|
|
Packit |
5bd3a9 |
Otherwise,
|
|
Packit |
5bd3a9 |
the intersecting pixels of intersecting arcs are drawn multiple times.
|
|
Packit |
5bd3a9 |
Specifying an arc with one endpoint and a clockwise extent draws the same pixels
|
|
Packit |
5bd3a9 |
as specifying the other endpoint and an equivalent counterclockwise extent,
|
|
Packit |
5bd3a9 |
except as it affects joins.
|
|
Packit |
5bd3a9 |
.LP
|
|
Packit |
5bd3a9 |
If the last point in one arc coincides with the first point in the following
|
|
Packit |
5bd3a9 |
arc, the two arcs will join correctly.
|
|
Packit |
5bd3a9 |
If the first point in the first arc coincides with the last point in the last
|
|
Packit |
5bd3a9 |
arc, the two arcs will join correctly.
|
|
Packit |
5bd3a9 |
By specifying one axis to be zero, a horizontal or vertical line can be
|
|
Packit |
5bd3a9 |
drawn.
|
|
Packit |
5bd3a9 |
Angles are computed based solely on the coordinate system and ignore the
|
|
Packit |
5bd3a9 |
aspect ratio.
|
|
Packit |
5bd3a9 |
.LP
|
|
Packit |
5bd3a9 |
Both functions use these GC components:
|
|
Packit |
5bd3a9 |
function, plane-mask, line-width, line-style, cap-style, join-style,
|
|
Packit |
5bd3a9 |
fill-style, subwindow-mode, clip-x-origin, clip-y-origin, and clip-mask.
|
|
Packit |
5bd3a9 |
They also use these GC mode-dependent components:
|
|
Packit |
5bd3a9 |
foreground, background, tile, stipple, tile-stipple-x-origin,
|
|
Packit |
5bd3a9 |
tile-stipple-y-origin, dash-offset, and dash-list.
|
|
Packit |
5bd3a9 |
.LP
|
|
Packit |
5bd3a9 |
.ZN XDrawArc
|
|
Packit |
5bd3a9 |
and
|
|
Packit |
5bd3a9 |
.ZN XDrawArcs
|
|
Packit |
5bd3a9 |
can generate
|
|
Packit |
5bd3a9 |
.ZN BadDrawable ,
|
|
Packit |
5bd3a9 |
.ZN BadGC ,
|
|
Packit |
5bd3a9 |
and
|
|
Packit |
5bd3a9 |
.ZN BadMatch
|
|
Packit |
5bd3a9 |
errors.
|
|
Packit |
5bd3a9 |
.SH STRUCTURES
|
|
Packit |
5bd3a9 |
The
|
|
Packit |
5bd3a9 |
.ZN XArc
|
|
Packit |
5bd3a9 |
structure contains:
|
|
Packit |
5bd3a9 |
.LP
|
|
Packit |
5bd3a9 |
.EX
|
|
Packit |
5bd3a9 |
typedef struct {
|
|
Packit |
5bd3a9 |
short x, y;
|
|
Packit |
5bd3a9 |
unsigned short width, height;
|
|
Packit |
5bd3a9 |
short angle1, angle2; /\&* Degrees * 64 */
|
|
Packit |
5bd3a9 |
} XArc;
|
|
Packit |
5bd3a9 |
.EE
|
|
Packit |
5bd3a9 |
.LP
|
|
Packit |
5bd3a9 |
All x and y members are signed integers.
|
|
Packit |
5bd3a9 |
The width and height members are 16-bit unsigned integers.
|
|
Packit |
5bd3a9 |
You should be careful not to generate coordinates and sizes
|
|
Packit |
5bd3a9 |
out of the 16-bit ranges, because the protocol only has 16-bit fields
|
|
Packit |
5bd3a9 |
for these values.
|
|
Packit |
5bd3a9 |
.SH DIAGNOSTICS
|
|
Packit |
5bd3a9 |
.TP 1i
|
|
Packit |
5bd3a9 |
.ZN BadDrawable
|
|
Packit |
5bd3a9 |
A value for a Drawable argument does not name a defined Window or Pixmap.
|
|
Packit |
5bd3a9 |
.TP 1i
|
|
Packit |
5bd3a9 |
.ZN BadGC
|
|
Packit |
5bd3a9 |
A value for a GContext argument does not name a defined GContext.
|
|
Packit |
5bd3a9 |
.TP 1i
|
|
Packit |
5bd3a9 |
.ZN BadMatch
|
|
Packit |
5bd3a9 |
An
|
|
Packit |
5bd3a9 |
.ZN InputOnly
|
|
Packit |
5bd3a9 |
window is used as a Drawable.
|
|
Packit |
5bd3a9 |
.TP 1i
|
|
Packit |
5bd3a9 |
.ZN BadMatch
|
|
Packit |
5bd3a9 |
Some argument or pair of arguments has the correct type and range but fails
|
|
Packit |
5bd3a9 |
to match in some other way required by the request.
|
|
Packit |
5bd3a9 |
.SH "SEE ALSO"
|
|
Packit |
5bd3a9 |
XDrawLine(__libmansuffix__),
|
|
Packit |
5bd3a9 |
XDrawPoint(__libmansuffix__),
|
|
Packit |
5bd3a9 |
XDrawRectangle(__libmansuffix__)
|
|
Packit |
5bd3a9 |
.br
|
|
Packit |
5bd3a9 |
\fI\*(xL\fP
|