"*divisorPoisson: 0.4",
"*sizeFactorMin: 1.05",
"*sizeFactorMax: 2.05",
+#ifdef USE_IPHONE
+ "*ignoreRotation: True",
+#endif
0
};
}
-static void
-oom(struct state *st)
-{
- fprintf(stderr, "Failed to allocate memory!\n");
- exit(-1);
-}
-
-
/* Construct a circle or die.
*/
static Circle *
new_body(struct state *st)
{
Body *p = malloc(sizeof(Body));
- if (NULL == p)
- oom(st);
+ if (!p) abort();
p->epicycles = new_circle_chain(st);
p->current_color = 0; /* ?? start them all on different colors? */
p->next = NULL;
*/
if (st->colors)
{
- free_colors(st->dpy, st->cmap, st->colors, st->ncolors);
+ free_colors(pxgwa->screen, st->cmap, st->colors, st->ncolors);
st->colors = 0;
st->ncolors = 0;
}
if (!mono_p)
{
st->colors = (XColor *) malloc(sizeof(*st->colors) * (st->ncolors+1));
- if (!st->colors)
- oom(st);
+ if (!st->colors) abort();
- make_smooth_colormap (st->dpy, pxgwa->visual, st->cmap, st->colors, &st->ncolors,
+ make_smooth_colormap (pxgwa->screen, pxgwa->visual, st->cmap,
+ st->colors, &st->ncolors,
True, /* allocate */
False, /* not writable */
True); /* verbose (complain about failure) */
epicycle_event (Display *dpy, Window window, void *closure, XEvent *e)
{
struct state *st = (struct state *) closure;
- if (e->type == ButtonPress)
+ if (screenhack_event_helper (dpy, window, e))
{
st->restart = 1;
return True;