aboutsummaryrefslogtreecommitdiff
path: root/Bezier.c
diff options
context:
space:
mode:
Diffstat (limited to 'Bezier.c')
-rw-r--r--Bezier.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/Bezier.c b/Bezier.c
index 2789366..0c0bf3d 100644
--- a/Bezier.c
+++ b/Bezier.c
@@ -77,7 +77,7 @@ typedef struct _BezierItemStruct {
Pixmap fill_pattern;
ZnGradient *fill_color;
Pixmap line_pattern;
- ZnColor line_color;
+ ZnGradient *line_color;
char *tile_name;
/* Private data */
@@ -108,7 +108,7 @@ static ZnAttrConfig bz_attrs[] = {
Tk_Offset(BezierItemStruct, first_end), 0, ZN_COORDS_FLAG, False },
{ ZN_CONFIG_LINE_END, "-lastend", NULL,
Tk_Offset(BezierItemStruct, last_end), 0, ZN_COORDS_FLAG, False },
- { ZN_CONFIG_COLOR, "-linecolor", NULL,
+ { ZN_CONFIG_GRADIENT, "-linecolor", NULL,
Tk_Offset(BezierItemStruct, line_color), 0,
ZN_DRAW_FLAG, False },
{ ZN_CONFIG_PATTERN, "-linepattern", NULL,
@@ -228,9 +228,8 @@ Init(Item item,
bz->line_pattern = ZnUnspecifiedPattern;
bz->cap_style = CapRound;
- bz->fill_color = ZnGetGradient(wi->interp, wi->win,
- ZnNameOfColor(wi->fore_color));
- bz->line_color = ZnGetColorByValue(wi->win, wi->fore_color);
+ bz->fill_color = ZnGetGradientByValue(wi->fore_gradient);
+ bz->line_color = ZnGetGradientByValue(wi->fore_gradient);
return ZN_OK;
}
@@ -279,7 +278,7 @@ Clone(Item item)
bz->fill_pattern = Tk_GetBitmap(wi->interp, wi->win,
Tk_NameOfBitmap(wi->dpy, bz->fill_pattern));
}
- bz->line_color = ZnGetColorByValue(wi->win, bz->line_color);
+ bz->line_color = ZnGetGradientByValue(bz->line_color);
bz->fill_color = ZnGetGradientByValue(bz->fill_color);
}
@@ -326,7 +325,7 @@ Destroy(Item item)
Tk_FreeBitmap(wi->dpy, bz->fill_pattern);
}
ZnFreeGradient(bz->fill_color);
- ZnFreeColor(bz->line_color);
+ ZnFreeGradient(bz->line_color);
}
@@ -386,8 +385,7 @@ Configure(Item item,
}
if ((bz->relief != RELIEF_FLAT) && !bz->gradient) {
bz->gradient = ZnGetReliefGradient(wi->interp, wi->win,
- ZnNameOfColor(ZnGetGradientColor(wi->win,
- bz->fill_color,
+ ZnNameOfColor(ZnGetGradientColor(bz->fill_color,
50.0, NULL)));
if (bz->gradient == NULL) {
status = ZN_ERROR;
@@ -692,7 +690,7 @@ Draw(Item item)
* Fill if requested.
*/
if (ISSET(bz->flags, FILLED_OK)) {
- values.foreground = ZnPixel(ZnGetGradientColor(wi->win, bz->fill_color, 0.0, NULL));
+ values.foreground = ZnPixel(ZnGetGradientColor(bz->fill_color, 0.0, NULL));
gc_mask = GCFillStyle;
if (bz->tile != ZnUnspecifiedImage) { /* Fill tiled */
Pixmap pmap = GetImagePixmap(wi->win, bz->tile_name, bz->tile, NULL);
@@ -743,7 +741,7 @@ Draw(Item item)
}
else {
SetLineStyle(wi, bz->line_style);
- values.foreground = ZnPixel(bz->line_color);
+ values.foreground = ZnPixel(ZnGetGradientColor(bz->line_color, 0, NULL));
values.line_width = (lw == 1) ? 0 : lw;
values.join_style = JoinRound;
values.cap_style = bz->cap_style;
@@ -946,9 +944,10 @@ static ZnBool
GetClipVertices(Item item,
ZnTriStrip *tristrip)
{
+#ifdef GPC_TODO
BezierItem bz = (BezierItem) item;
WidgetInfo *wi = item->wi;
-#ifndef GPC_TODO
+#else
ZnPoint *points;
#endif