- advance = get_integer_resource ("advance", "Integer");
- density = get_integer_resource ("density", "Integer");
- if (density < 1) density = 1;
- reset = get_integer_resource ("reset", "Integer");
- if (reset < 100) reset = 100;
- circles = get_boolean_resource ("circles", "Boolean");
- size = get_integer_resource ("size", "Integer");
- if (size < 1) size = 1;
- width = width / size;
- height = height / size;
- length = get_integer_resource ("length", "Integer");
- if (length < 1) length = 1;
- XSetForeground (display, context, colors [color_index].pixel);
+ st->advance = get_integer_resource (st->dpy, "advance", "Integer");
+ st->density = get_integer_resource (st->dpy, "density", "Integer");
+ if (st->density < 1) st->density = 1;
+ st->reset = get_integer_resource (st->dpy, "reset", "Integer");
+ if (st->reset < 100) st->reset = 100;
+ st->circles = get_boolean_resource (st->dpy, "circles", "Boolean");
+ st->size = get_integer_resource (st->dpy, "size", "Integer");
+ if (st->size < 1) st->size = 1;
+ st->width = st->width / st->size;
+ st->height = st->height / st->size;
+ st->length = get_integer_resource (st->dpy, "length", "Integer");
+ if (st->length < 1) st->length = 1;
+ XSetForeground (st->dpy, st->context, st->colors [st->color_index].pixel);
+
+
+ st->x = random () % st->width;
+ st->y = random () % st->height;
+ st->last_x = st->x;
+ st->last_y = st->y;
+ st->width_1 = st->width - 1;
+ st->height_1 = st->height - 1;
+ st->length_limit = st->length;
+ st->reset_limit = st->reset;
+ st->color_index = random () % st->color_count;
+ st->color = st->colors [random () % st->color_count].pixel;
+ st->pixmap = XCreatePixmap (st->dpy, window, st->size,
+ st->size, st->depth);
+
+ XSetForeground (st->dpy, st->context,
+ BlackPixel (st->dpy, DefaultScreen (st->dpy)));
+ XFillRectangle (st->dpy, st->pixmap, st->context, 0, 0,
+ st->width * st->size, st->height * st->size);
+ XSetForeground (st->dpy, st->context, st->color);
+ XFillArc (st->dpy, st->pixmap, st->context, 0, 0, st->size, st->size, 0, 360*64);
+
+ return st;