aboutsummaryrefslogtreecommitdiff
path: root/generic/Draw.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/Draw.c')
-rw-r--r--generic/Draw.c100
1 files changed, 50 insertions, 50 deletions
diff --git a/generic/Draw.c b/generic/Draw.c
index f0ace86..26d952f 100644
--- a/generic/Draw.c
+++ b/generic/Draw.c
@@ -140,14 +140,14 @@ SetLineStyle(Display *display,
**********************************************************************************
*/
void
-GetLineShape(RadarPoint *p1,
- RadarPoint *p2,
+GetLineShape(ZnPoint *p1,
+ ZnPoint *p2,
unsigned int line_width,
LineShape shape,
- RadarBBox *bbox,
- RadarList to_points)
+ ZnBBox *bbox,
+ ZnList to_points)
{
- RadarPoint *points;
+ ZnPoint *points;
int num_points, i;
/*
@@ -162,8 +162,8 @@ GetLineShape(RadarPoint *p1,
double temp;
num_points = LIGHTNING_POINTS;
- RadarListAssertSize(to_points, num_points);
- points = (RadarPoint *) RadarListArray(to_points);
+ ZnListAssertSize(to_points, num_points);
+ points = (ZnPoint *) ZnListArray(to_points);
points[0] = *p1;
points[3] = *p2;
@@ -193,8 +193,8 @@ GetLineShape(RadarPoint *p1,
else if (shape == LINE_LEFT_CORNER ||
shape == LINE_RIGHT_CORNER) {
num_points = CORNER_POINTS;
- RadarListAssertSize(to_points, num_points);
- points = (RadarPoint *) RadarListArray(to_points);
+ ZnListAssertSize(to_points, num_points);
+ points = (ZnPoint *) ZnListArray(to_points);
points[0] = *p1;
points[2] = *p2;
@@ -213,8 +213,8 @@ GetLineShape(RadarPoint *p1,
int dx, dy;
num_points = DOUBLE_CORNER_POINTS;
- RadarListAssertSize(to_points, num_points);
- points = (RadarPoint *) RadarListArray(to_points);
+ ZnListAssertSize(to_points, num_points);
+ points = (ZnPoint *) ZnListArray(to_points);
points[0] = *p1;
points[3] = *p2;
@@ -234,8 +234,8 @@ GetLineShape(RadarPoint *p1,
}
else /* if (shape) == LINE_STRAIGHT) */ {
num_points = STRAIGHT_POINTS;
- RadarListAssertSize(to_points, num_points);
- points = (RadarPoint *) RadarListArray(to_points);
+ ZnListAssertSize(to_points, num_points);
+ points = (ZnPoint *) ZnListArray(to_points);
points[0] = *p1;
points[1] = *p2;
@@ -279,10 +279,10 @@ void
DrawLineShape(Display *display,
Drawable draw_buffer,
GC gc,
- RadarPoint *p,
+ ZnPoint *p,
int num_p,
LineStyle line_style,
- RadarColor foreground,
+ ZnColor foreground,
unsigned int line_width,
LineShape shape)
{
@@ -294,7 +294,7 @@ DrawLineShape(Display *display,
* Setup GC.
*/
SetLineStyle(display, gc, line_style);
- values.foreground = RadarPixel(foreground);
+ values.foreground = ZnPixel(foreground);
values.line_width = (line_width == 1) ? 0 : line_width;
values.fill_style = FillSolid;
values.join_style = JoinRound;
@@ -321,7 +321,7 @@ DrawLineShape(Display *display,
void
DrawRectangleRelief(WidgetInfo *wi,
ReliefStyle relief,
- RadarColorGradient gradient,
+ ZnColorGradient gradient,
XRectangle *bbox,
unsigned int line_width)
{
@@ -362,10 +362,10 @@ DrawRectangleRelief(WidgetInfo *wi,
gc_values.fill_style = FillSolid;
if (relief == RELIEF_BEVEL_IN) {
- gc_values.foreground = RadarColorGradientPixel(gradient, wi->win, -1);
+ gc_values.foreground = ZnColorGradientPixel(gradient, wi->win, -1);
}
else {
- gc_values.foreground = RadarColorGradientPixel(gradient, wi->win, 0);
+ gc_values.foreground = ZnColorGradientPixel(gradient, wi->win, 0);
}
XChangeGC(wi->dpy, wi->gc, GCFillStyle|GCForeground, &gc_values);
XFillRectangle(wi->dpy, wi->draw_buffer, wi->gc,
@@ -376,10 +376,10 @@ DrawRectangleRelief(WidgetInfo *wi,
line_width, bbox->height);
if (relief == RELIEF_BEVEL_IN) {
- gc_values.foreground = RadarColorGradientPixel(gradient, wi->win, 0);
+ gc_values.foreground = ZnColorGradientPixel(gradient, wi->win, 0);
}
else {
- gc_values.foreground = RadarColorGradientPixel(gradient, wi->win, -1);
+ gc_values.foreground = ZnColorGradientPixel(gradient, wi->win, -1);
}
XChangeGC(wi->dpy, wi->gc, GCFillStyle|GCForeground, &gc_values);
top_points[0].x = top_points[1].x = top_points[6].x = bbox->x;
@@ -396,45 +396,45 @@ DrawRectangleRelief(WidgetInfo *wi,
static void
-DoPolygonRelief(RadarPoint *p,
+DoPolygonRelief(ZnPoint *p,
int num_points,
unsigned int line_width,
int what_to_do,
...)
{
int i, j, processed_points, *result;
- RadarPoint *p1, *p2;
- RadarPoint pp1, pp2, new_pp1, new_pp2;
- RadarPoint perp, c, shift1, shift2;
- RadarPoint bevel_points[4];
+ ZnPoint *p1, *p2;
+ ZnPoint pp1, pp2, new_pp1, new_pp2;
+ ZnPoint perp, c, shift1, shift2;
+ ZnPoint bevel_points[4];
XPoint bevel_xpoints[4];
- RadarBool parallel, closed;
+ ZnBool parallel, closed;
WidgetInfo *wi = NULL;
ReliefStyle relief = 0;
- RadarColorGradient gradient = NULL;
- RadarPoint *pp = NULL;
+ ZnColorGradient gradient = NULL;
+ ZnPoint *pp = NULL;
double *dist = NULL;
- RadarBBox *bbox = NULL;
+ ZnBBox *bbox = NULL;
va_list var;
va_start(var, what_to_do);
if (what_to_do == POLYGON_RELIEF_DIST) {
- pp = va_arg(var, RadarPoint *);
+ pp = va_arg(var, ZnPoint *);
dist = va_arg(var, double *);
*dist = 1.0e40;
}
if (what_to_do == POLYGON_RELIEF_IN_BBOX) {
- bbox = va_arg(var, RadarBBox *);
+ bbox = va_arg(var, ZnBBox *);
result = va_arg(var, int *);
}
else if (what_to_do == POLYGON_RELIEF_BBOX) {
- bbox = va_arg(var, RadarBBox *);
+ bbox = va_arg(var, ZnBBox *);
ResetBBox(bbox);
}
else if (what_to_do == POLYGON_RELIEF_DRAW) {
wi = va_arg(var, WidgetInfo *);
relief = va_arg(var, int);
- gradient = va_arg(var, RadarColorGradient);
+ gradient = va_arg(var, ZnColorGradient);
}
va_end(var);
@@ -556,7 +556,7 @@ DoPolygonRelief(RadarPoint *p,
if ((processed_points >= 2) || (!closed && (processed_points == 1))) {
if (what_to_do == POLYGON_RELIEF_DIST) {
- double new_dist;
+ double new_dist;
new_dist = PolygonToPointDist(bevel_points, 4, pp);
if (new_dist < 0) {
@@ -586,8 +586,8 @@ DoPolygonRelief(RadarPoint *p,
}
}
else if (what_to_do == POLYGON_RELIEF_DRAW) {
- RadarReal dx, dy;
- RadarBool light_on_left;
+ ZnReal dx, dy;
+ ZnBool light_on_left;
XGCValues gc_values;
dx = bevel_points[3].x - bevel_points[0].x;
@@ -601,10 +601,10 @@ DoPolygonRelief(RadarPoint *p,
gc_values.fill_style = FillSolid;
if (light_on_left ^ (relief == RELIEF_BEVEL_OUT)) {
- gc_values.foreground = RadarColorGradientPixel(gradient, wi->win, -1);
+ gc_values.foreground = ZnColorGradientPixel(gradient, wi->win, -1);
}
else {
- gc_values.foreground = RadarColorGradientPixel(gradient, wi->win, 0);
+ gc_values.foreground = ZnColorGradientPixel(gradient, wi->win, 0);
}
XChangeGC(wi->dpy, wi->gc, GCFillStyle|GCForeground, &gc_values);
@@ -641,11 +641,11 @@ DoPolygonRelief(RadarPoint *p,
**********************************************************************************
*/
void
-GetPolygonReliefBBox(RadarList points,
+GetPolygonReliefBBox(ZnList points,
unsigned int line_width,
- RadarBBox *bbox)
+ ZnBBox *bbox)
{
- DoPolygonRelief(RadarListArray(points), RadarListSize(points),
+ DoPolygonRelief(ZnListArray(points), ZnListSize(points),
line_width, POLYGON_RELIEF_BBOX, bbox);
}
@@ -660,13 +660,13 @@ GetPolygonReliefBBox(RadarList points,
**********************************************************************************
*/
int
-PolygonReliefInBBox(RadarList points,
+PolygonReliefInBBox(ZnList points,
unsigned int line_width,
- RadarBBox *area)
+ ZnBBox *area)
{
int result;
- DoPolygonRelief(RadarListArray(points), RadarListSize(points),
+ DoPolygonRelief(ZnListArray(points), ZnListSize(points),
line_width, POLYGON_RELIEF_IN_BBOX, area, &result);
return result;
@@ -683,13 +683,13 @@ PolygonReliefInBBox(RadarList points,
**********************************************************************************
*/
double
-PolygonReliefToPointDist(RadarList points,
+PolygonReliefToPointDist(ZnList points,
unsigned int line_width,
- RadarPoint *pp)
+ ZnPoint *pp)
{
double dist;
- DoPolygonRelief(RadarListArray(points), RadarListSize(points),
+ DoPolygonRelief(ZnListArray(points), ZnListSize(points),
line_width, POLYGON_RELIEF_DIST, pp, &dist);
return dist;
@@ -707,8 +707,8 @@ PolygonReliefToPointDist(RadarList points,
void
DrawPolygonRelief(WidgetInfo *wi,
ReliefStyle relief,
- RadarColorGradient gradient,
- RadarPoint *points,
+ ZnColorGradient gradient,
+ ZnPoint *points,
int num_points,
int line_width)
{