mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-02 07:18:05 +02:00
Added XrGetRGBColor and XrGetAlpha
This commit is contained in:
parent
991d444754
commit
1fc2dabbd0
6 changed files with 59 additions and 1 deletions
|
|
@ -1,3 +1,8 @@
|
|||
2003-07-03 Carl Worth <cworth@isi.edu>
|
||||
|
||||
* src/xr.c (XrGetAlpha): Added XrGetAlpha
|
||||
(XrGetRGBColor): Added XrGetRGBColor
|
||||
|
||||
2003-06-12 Carl Worth <cworth@isi.edu>
|
||||
|
||||
* src/xrgstate.c (_XrGStateScale): Scale by 0 now causes an
|
||||
|
|
|
|||
6
src/Xr.h
6
src/Xr.h
|
|
@ -130,6 +130,9 @@ XrSetOperator(XrState *xrs, XrOperator op);
|
|||
void
|
||||
XrSetRGBColor(XrState *xrs, double red, double green, double blue);
|
||||
|
||||
void
|
||||
XrGetRGBColor(XrState *xrs, double *red, double *green, double *blue);
|
||||
|
||||
/* XXX: Do we want XrGetPattern as well? */
|
||||
void
|
||||
XrSetPattern(XrState *xrs, XrSurface *pattern);
|
||||
|
|
@ -140,6 +143,9 @@ XrSetTolerance(XrState *xrs, double tolerance);
|
|||
void
|
||||
XrSetAlpha(XrState *xrs, double alpha);
|
||||
|
||||
double
|
||||
XrGetAlpha(XrState *xrs);
|
||||
|
||||
typedef enum _XrFillRule { XrFillRuleWinding, XrFillRuleEvenOdd } XrFillRule;
|
||||
|
||||
void
|
||||
|
|
|
|||
18
src/xr.c
18
src/xr.c
|
|
@ -183,6 +183,16 @@ XrSetRGBColor(XrState *xrs, double red, double green, double blue)
|
|||
xrs->status = _XrGStateSetRGBColor(_XR_CURRENT_GSTATE(xrs), red, green, blue);
|
||||
}
|
||||
|
||||
void
|
||||
XrGetRGBColor(XrState *xrs, double *red, double *green, double *blue)
|
||||
{
|
||||
/* XXX: Should we do anything with the return values in the error case? */
|
||||
if (xrs->status)
|
||||
return;
|
||||
|
||||
xrs->status = _XrGStateGetRGBColor(_XR_CURRENT_GSTATE(xrs), red, green, blue);
|
||||
}
|
||||
|
||||
void
|
||||
XrSetPattern(XrState *xrs, XrSurface *pattern)
|
||||
{
|
||||
|
|
@ -220,6 +230,12 @@ XrSetAlpha(XrState *xrs, double alpha)
|
|||
xrs->status = _XrGStateSetAlpha(_XR_CURRENT_GSTATE(xrs), alpha);
|
||||
}
|
||||
|
||||
double
|
||||
XrGetAlpha(XrState *xrs)
|
||||
{
|
||||
return _XrGStateGetAlpha(_XR_CURRENT_GSTATE(xrs));
|
||||
}
|
||||
|
||||
void
|
||||
XrSetFillRule(XrState *xrs, XrFillRule fill_rule)
|
||||
{
|
||||
|
|
@ -501,7 +517,7 @@ XrClosePath(XrState *xrs)
|
|||
void
|
||||
XrGetCurrentPoint(XrState *xrs, double *x, double *y)
|
||||
{
|
||||
/* XXX: Should we do anything with the return value in the error case? */
|
||||
/* XXX: Should we do anything with the return values in the error case? */
|
||||
if (xrs->status)
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -61,6 +61,14 @@ _XrColorSetRGB(XrColor *color, double red, double green, double blue)
|
|||
_XrColorComputeXcColor(color);
|
||||
}
|
||||
|
||||
void
|
||||
_XrColorGetRGB(XrColor *color, double *red, double *green, double *blue)
|
||||
{
|
||||
*red = color->red;
|
||||
*green = color->green;
|
||||
*blue = color->blue;
|
||||
}
|
||||
|
||||
void
|
||||
_XrColorSetAlpha(XrColor *color, double alpha)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -357,6 +357,14 @@ _XrGStateSetRGBColor(XrGState *gstate, double red, double green, double blue)
|
|||
return XrStatusSuccess;
|
||||
}
|
||||
|
||||
XrStatus
|
||||
_XrGStateGetRGBColor(XrGState *gstate, double *red, double *green, double *blue)
|
||||
{
|
||||
_XrColorGetRGB(&gstate->color, red, green, blue);
|
||||
|
||||
return XrStatusSuccess;
|
||||
}
|
||||
|
||||
XrStatus
|
||||
_XrGStateSetTolerance(XrGState *gstate, double tolerance)
|
||||
{
|
||||
|
|
@ -391,6 +399,12 @@ _XrGStateSetAlpha(XrGState *gstate, double alpha)
|
|||
return XrStatusSuccess;
|
||||
}
|
||||
|
||||
double
|
||||
_XrGStateGetAlpha(XrGState *gstate)
|
||||
{
|
||||
return gstate->alpha;
|
||||
}
|
||||
|
||||
XrStatus
|
||||
_XrGStateSetFillRule(XrGState *gstate, XrFillRule fill_rule)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -348,6 +348,9 @@ _XrGStateGetOperator(XrGState *gstate);
|
|||
XrStatus
|
||||
_XrGStateSetRGBColor(XrGState *gstate, double red, double green, double blue);
|
||||
|
||||
XrStatus
|
||||
_XrGStateGetRGBColor(XrGState *gstate, double *red, double *green, double *blue);
|
||||
|
||||
XrStatus
|
||||
_XrGStateSetTolerance(XrGState *gstate, double tolerance);
|
||||
|
||||
|
|
@ -357,6 +360,9 @@ _XrGStateGetTolerance(XrGState *gstate);
|
|||
XrStatus
|
||||
_XrGStateSetAlpha(XrGState *gstate, double alpha);
|
||||
|
||||
double
|
||||
_XrGStateGetAlpha(XrGState *gstate);
|
||||
|
||||
XrStatus
|
||||
_XrGStateSetFillRule(XrGState *gstate, XrFillRule fill_rule);
|
||||
|
||||
|
|
@ -501,6 +507,9 @@ _XrColorDeinit(XrColor *color);
|
|||
void
|
||||
_XrColorSetRGB(XrColor *color, double red, double green, double blue);
|
||||
|
||||
void
|
||||
_XrColorGetRGB(XrColor *color, double *red, double *green, double *blue);
|
||||
|
||||
void
|
||||
_XrColorSetAlpha(XrColor *color, double alpha);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue