X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fqix.c;h=1498af76d35f61578c2b6d5caf6fb8433b8b05a9;hb=d6b0217f2417bd19187f0ebc389d6c5c2233b11c;hp=c25d21e18a0970bcffc0e484cdeb39eace2d7741;hpb=49f5b54f312fe4ac2e9bc47581a72451bd0e8439;p=xscreensaver diff --git a/hacks/qix.c b/hacks/qix.c index c25d21e1..1498af76 100644 --- a/hacks/qix.c +++ b/hacks/qix.c @@ -1,5 +1,4 @@ -/* xscreensaver, Copyright (c) 1992, 1995, 1996, 1997, 1998, 2006 - * Jamie Zawinski +/* xscreensaver, Copyright (c) 1992-2008 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -81,7 +80,7 @@ init_one_qix (struct state *st, int nlines) qix->lines[i].p = (struct qpoint *) calloc(qix->npoly, sizeof(struct qpoint)); -# ifndef HAVE_COCOA +# ifndef HAVE_JWXYZ if (!mono_p && !st->transparent_p) # endif { @@ -130,7 +129,7 @@ init_one_qix (struct state *st, int nlines) qix->lines[i].color = qix->lines[0].color; qix->lines[i].dead = qix->lines[0].dead; -# ifndef HAVE_COCOA +# ifndef HAVE_JWXYZ if (!mono_p && !st->transparent_p) # endif if (!XAllocColor (st->dpy, st->cmap, &qix->lines[i].color)) @@ -213,7 +212,7 @@ qix_init (Display *dpy, Window window) st->additive_p = get_boolean_resource (st->dpy, "additive", "Boolean"); st->cmap_p = has_writable_cells (xgwa.screen, xgwa.visual); -# ifndef HAVE_COCOA +# ifndef HAVE_JWXYZ if (st->transparent_p) { unsigned long *plane_masks = 0; @@ -275,7 +274,7 @@ qix_init (Display *dpy, Window window) st->gcs [1][i] = XCreateGC (st->dpy, st->window, GCForeground|GCPlaneMask, &gcv); -# ifdef HAVE_COCOA +# ifdef HAVE_JWXYZ /* jwxyz_XSetAntiAliasing (st->dpy, st->gcs [0][i], False); jwxyz_XSetAntiAliasing (st->dpy, st->gcs [1][i], False); */ if (st->transparent_p) @@ -283,7 +282,7 @@ qix_init (Display *dpy, Window window) jwxyz_XSetAlphaAllowed (dpy, st->gcs [0][i], True); jwxyz_XSetAlphaAllowed (dpy, st->gcs [1][i], True); } -# endif /* HAVE_COCOA */ +# endif /* HAVE_JWXYZ */ } } @@ -294,10 +293,10 @@ qix_init (Display *dpy, Window window) XClearWindow (st->dpy, st->window); } else -#endif /* !HAVE_COCOA */ +#endif /* !HAVE_JWXYZ */ if (st->xor_p) { -#ifndef HAVE_COCOA +#ifndef HAVE_JWXYZ NON_TRANSPARENT_XOR: #endif gcv.function = GXxor; @@ -308,7 +307,7 @@ qix_init (Display *dpy, Window window) } else { -#ifndef HAVE_COCOA +#ifndef HAVE_JWXYZ NON_TRANSPARENT: #endif st->draw_gc = XCreateGC (st->dpy, st->window, GCForeground, &gcv); @@ -317,7 +316,7 @@ qix_init (Display *dpy, Window window) st->erase_gc = XCreateGC (st->dpy, st->window, GCForeground, &gcv); } -#ifdef HAVE_COCOA +#ifdef HAVE_JWXYZ if (st->transparent_p) jwxyz_XSetAlphaAllowed (dpy, st->draw_gc, True); #endif @@ -330,7 +329,7 @@ qix_init (Display *dpy, Window window) st->qixes [st->count]->id = st->count; } -# ifdef HAVE_COCOA +# ifdef HAVE_JWXYZ /* line-mode leaves turds without this. */ jwxyz_XSetAntiAliasing (st->dpy, st->erase_gc, False); jwxyz_XSetAntiAliasing (st->dpy, st->draw_gc, False); @@ -438,7 +437,7 @@ add_qline (struct state *st, - (st->random_p ? random() % st->max_spread : 0); } -#ifndef HAVE_COCOA +#ifndef HAVE_JWXYZ if (!mono_p && !st->transparent_p) #endif { @@ -471,17 +470,17 @@ add_qline (struct state *st, abort (); /* same color should work */ } -# ifdef HAVE_COCOA +# ifdef HAVE_JWXYZ if (st->transparent_p) { /* give a non-opaque alpha to the color */ unsigned long pixel = qline->color.pixel; - unsigned long amask = BlackPixelOfScreen (0); + unsigned long amask = BlackPixel (st->dpy, 0); unsigned long a = (0xBBBBBBBB & amask); pixel = (pixel & (~amask)) | a; qline->color.pixel = pixel; } -# endif /* HAVE_COCOA */ +# endif /* HAVE_JWXYZ */ XSetForeground (st->dpy, st->draw_gc, qline->color.pixel); } @@ -579,27 +578,23 @@ qix_free (Display *dpy, Window window, void *closure) static const char *qix_defaults [] = { ".background: black", ".foreground: white", -#if 0 - "*count: 1", -#else - "*count: 5", -#endif - "*segments: 50", + "*fpsSolid: true", + "*count: 4", + "*segments: 250", "*poly: 2", "*spread: 8", - "*size: 0", + "*size: 200", "*colorShift: 3", - "*solid: false", + "*solid: true", "*delay: 10000", - "*random: true", + "*random: false", "*xor: false", -#if 0 - "*transparent:false", -#else "*transparent:true", -#endif "*gravity: false", "*additive: true", +#ifdef HAVE_MOBILE + "*ignoreRotation: True", +#endif 0 };