+
+ st->draw_i += st->draw_inc;
+ if (st->draw_i >= st->grid_size)
+ {
+ st->draw_i = 0;
+
+ switch (st->draw_dir)
+ {
+ case DOWN: st->hole_y += st->draw_size; break;
+ case LEFT: st->hole_x--; break;
+ case UP: st->hole_y--; break;
+ case RIGHT: st->hole_x += st->draw_size; break;
+ }
+
+ this_delay = st->delay2;
+ }
+
+ return this_delay;
+}
+
+static void
+slidescreen_reshape (Display *dpy, Window window, void *closure,
+ unsigned int w, unsigned int h)
+{
+ struct state *st = (struct state *) closure;
+ st->max_width = w;
+ st->max_height = h;
+ if (! st->img_loader) {
+ XWindowAttributes xgwa;
+ XGetWindowAttributes (st->dpy, st->window, &xgwa);
+ st->img_loader = load_image_async_simple (0, xgwa.screen, st->window,
+ st->window, 0, 0);
+ st->start_time = time ((time_t *) 0);
+ }
+}
+
+static Bool
+slidescreen_event (Display *dpy, Window window, void *closure, XEvent *event)
+{
+ struct state *st = (struct state *) closure;
+ if (screenhack_event_helper (dpy, window, event))
+ {
+ st->start_time = 0;
+ return True;
+ }
+ return False;
+}
+
+static void
+slidescreen_free (Display *dpy, Window window, void *closure)
+{
+ struct state *st = (struct state *) closure;
+ XFreeGC (dpy, st->gc);
+ free (st);