cairo/Xr.h

191 lines
5 KiB
C
Raw Normal View History

2002-06-11 04:02:23 +00:00
/*
* $XFree86: $
*
* Copyright <EFBFBD> 2002 Carl D. Worth
2002-06-11 04:02:23 +00:00
*
* Permission to use, copy, modify, distribute, and sell this software
* and its documentation for any purpose is hereby granted without
* fee, provided that the above copyright notice appear in all copies
* and that both that copyright notice and this permission notice
* appear in supporting documentation, and that the name of Carl
* D. Worth not be used in advertising or publicity pertaining to
* distribution of the software without specific, written prior
* permission. Carl D. Worth makes no representations about the
* suitability of this software for any purpose. It is provided "as
* is" without express or implied warranty.
2002-06-11 04:02:23 +00:00
*
* CARL D. WORTH DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL CARL D. WORTH BE LIABLE FOR ANY SPECIAL,
* INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
* RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
2002-06-11 04:02:23 +00:00
#ifndef _XR_H_
#define _XR_H_
2002-07-23 07:22:23 +00:00
#include <X11/Xc/Xc.h>
2002-06-11 04:02:23 +00:00
typedef struct _XrState XrState;
/* Functions for manipulating state objects */
XrState *
XrCreate(Display *dpy);
2002-06-11 04:02:23 +00:00
void
XrDestroy(XrState *xrs);
void
XrSave(XrState *xrs);
void
XrRestore(XrState *xrs);
2002-07-23 07:22:23 +00:00
/* XXX: NYI: XrClone */
2002-06-11 04:02:23 +00:00
/* Modify state */
void
XrSetDrawable(XrState *xrs, Drawable drawable);
void
XrSetVisual(XrState *xrs, Visual *visual);
2002-06-11 04:02:23 +00:00
2002-07-23 07:22:23 +00:00
typedef enum _XrFormat {
XrFormatARGB32 = PictStandardARGB32,
XrFormatRGB32 = PictStandardRGB24,
XrFormatA8 = PictStandardA8,
XrFormatA1 = PictStandardA1
} XrFormat;
2002-06-11 04:02:23 +00:00
void
XrSetFormat(XrState *xrs, XrFormat format);
2002-07-23 07:22:23 +00:00
typedef enum _XrOperator {
XrOperatorClear = PictOpClear,
XrOperatorSrc = PictOpSrc,
XrOperatorDst = PictOpDst,
XrOperatorOver = PictOpOver,
XrOperatorOverReverse = PictOpOverReverse,
XrOperatorIn = PictOpIn,
XrOperatorInReverse = PictOpInReverse,
XrOperatorOut = PictOpOut,
XrOperatorOutReverse = PictOpOutReverse,
XrOperatorAtop = PictOpAtop,
XrOperatorAtopReverse = PictOpAtopReverse,
XrOperatorXor = PictOpXor,
XrOperatorAdd = PictOpAdd,
XrOperatorSaturate = PictOpSaturate,
XrOperatorDisjointClear = PictOpDisjointClear,
XrOperatorDisjointSrc = PictOpDisjointSrc,
XrOperatorDisjointDst = PictOpDisjointDst,
XrOperatorDisjointOver = PictOpDisjointOver,
XrOperatorDisjointOverReverse = PictOpDisjointOverReverse,
XrOperatorDisjointIn = PictOpDisjointIn,
XrOperatorDisjointInReverse = PictOpDisjointInReverse,
XrOperatorDisjointOut = PictOpDisjointOut,
XrOperatorDisjointOutReverse = PictOpDisjointOutReverse,
XrOperatorDisjointAtop = PictOpDisjointAtop,
XrOperatorDisjointAtopReverse = PictOpDisjointAtopReverse,
XrOperatorDisjointXor = PictOpDisjointXor,
XrOperatorConjointClear = PictOpConjointClear,
XrOperatorConjointSrc = PictOpConjointSrc,
XrOperatorConjointDst = PictOpConjointDst,
XrOperatorConjointOver = PictOpConjointOver,
XrOperatorConjointOverReverse = PictOpConjointOverReverse,
XrOperatorConjointIn = PictOpConjointIn,
XrOperatorConjointInReverse = PictOpConjointInReverse,
XrOperatorConjointOut = PictOpConjointOut,
XrOperatorConjointOutReverse = PictOpConjointOutReverse,
XrOperatorConjointAtop = PictOpConjointAtop,
XrOperatorConjointAtopReverse = PictOpConjointAtopReverse,
XrOperatorConjointXor = PictOpConjointXor
} XrOperator;
void
XrSetOperator(XrState *xrs, XrOperator operator);
void
XrSetRGBColor(XrState *xrs, double red, double green, double blue);
2002-06-11 04:02:23 +00:00
void
XrSetAlpha(XrState *xrs, double alpha);
void
XrSetLineWidth(XrState *xrs, double width);
2002-07-23 07:22:23 +00:00
typedef enum _XrLineCap { XrLineCapButt, XrLineCapRound, XrLineCapSquare } XrLineCap;
void
XrSetLineCap(XrState *xrs, XrLineCap line_cap);
typedef enum _XrLineJoin { XrLineJoinMiter, XrLineJoinRound, XrLineJoinBevel } XrLineJoin;
void
XrSetLineJoin(XrState *xrs, XrLineJoin line_join);
void
XrSetDash(XrState *xrs, double *dashes, int ndash, double offset);
2002-07-23 07:22:23 +00:00
void
XrSetMiterLimit(XrState *xrs, double limit);
2002-06-11 04:02:23 +00:00
void
XrTranslate(XrState *xrs, double tx, double ty);
void
XrScale(XrState *xrs, double sx, double sy);
void
XrRotate(XrState *xrs, double angle);
2002-07-23 07:22:23 +00:00
/* XXX: NYI: XrSetDash, ... */
2002-06-11 04:02:23 +00:00
/* Path creation */
void
XrNewPath(XrState *xrs);
void
XrMoveTo(XrState *xrs, double x, double y);
void
XrLineTo(XrState *xrs, double x, double y);
void
XrCurveTo(XrState *xrs,
double x1, double y1,
double x2, double y2,
double x3, double y3);
2002-06-11 04:02:23 +00:00
void
XrRelMoveTo(XrState *xrs, double x, double y);
void
XrRelLineTo(XrState *xrs, double x, double y);
void
XrRelCurveTo(XrState *xrs,
double x1, double y1,
double x2, double y2,
double x3, double y3);
2002-06-11 04:02:23 +00:00
void
XrClosePath(XrState *xrs);
2002-07-23 07:22:23 +00:00
/* XXX: NYI: XrArcTo, XrCurveTo, XrRelCurveTo, ... */
2002-06-11 04:02:23 +00:00
/* Render current path */
void
XrStroke(XrState *xrs);
void
XrFill(XrState *xrs);
2002-07-23 07:22:23 +00:00
/* XXX: NYI: Error querys XrGetErrors, XrClearErrors */
2002-06-11 04:02:23 +00:00
#endif
2002-07-23 07:22:23 +00:00