X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fpedal.c;h=5d11097da502fc5c272a9dbe94fad3c98846dd2a;hb=c6b273ef7292ba10943694df1656b05203d7b62f;hp=8cde8d53666bd617bf224b809a5a682016174faa;hpb=ccbc9f87eb59497b23bd0424ee1ed20ad7c7db54;p=xscreensaver diff --git a/hacks/pedal.c b/hacks/pedal.c index 8cde8d53..5d11097d 100644 --- a/hacks/pedal.c +++ b/hacks/pedal.c @@ -9,7 +9,7 @@ * Dale Moore * 24-Jun-1994 * - * Copyright \(co 1994, by Carnegie Mellon University. Permission to use, + * Copyright (c) 1994, by Carnegie Mellon University. Permission to use, * copy, modify, distribute, and sell this software and its documentation * for any purpose is hereby granted without fee, provided fnord that the * above copyright notice appear in all copies and that both that copyright @@ -72,12 +72,8 @@ static Bool fade_p; #define rand_range(a, b) (a + random() % (b - a)) -static int gcd (m, n) - int m; - int n; -/* - * Greatest Common Divisor (also Greates common factor). - */ +static int +gcd(int m, int n) /* Greatest Common Divisor (also Greates common factor). */ { int r; @@ -89,10 +85,7 @@ static int gcd (m, n) } } -static int numlines (a, b, d) - int a; - int b; - int d; +static int numlines (int a, int b, int d) /* * Description: * @@ -123,9 +116,7 @@ static int numlines (a, b, d) } static int -compute_pedal(points, maxpoints) -XPoint *points; -int maxpoints; +compute_pedal(XPoint *points, int maxpoints) /* * Description: * @@ -199,9 +190,7 @@ int maxpoints; } static void -init_pedal (dpy, window) - Display *dpy; - Window window; +init_pedal (Display *dpy, Window window) { XGCValues gcv; XWindowAttributes xgwa; @@ -230,14 +219,9 @@ init_pedal (dpy, window) cmap = xgwa.colormap; gcv.function = GXcopy; - gcv.subwindow_mode = IncludeInferiors; gcv.foreground = get_pixel_resource ("foreground", "Foreground", dpy, cmap); gcv.background = get_pixel_resource ("background", "Background", dpy, cmap); - gc = XCreateGC ( - dpy, - window, - GCForeground | GCBackground |GCFunction | GCSubwindowMode , - &gcv); + gc = XCreateGC (dpy, window, GCForeground | GCBackground |GCFunction, &gcv); if (fade_p) { @@ -272,12 +256,8 @@ init_pedal (dpy, window) } static void -fade_foreground (dpy, cmap, from, to, steps) - Display *dpy; - Colormap cmap; - XColor from; - XColor to; - int steps; +fade_foreground (Display *dpy, Colormap cmap, + XColor from, XColor to, int steps) /* * This routine assumes that we have a writeable colormap. * That means that the default colormap is not full, and that @@ -302,9 +282,7 @@ fade_foreground (dpy, cmap, from, to, steps) } static void -pedal (dpy, window) - Display *dpy; - Window window; +pedal (Display *dpy, Window window) /* * Since the XFillPolygon doesn't require that the last * point == first point, the number of points is the same @@ -345,7 +323,8 @@ pedal (dpy, window) foreground.red = color.red; foreground.green = color.green; foreground.blue = color.blue; - XStoreColor (dpy, cmap, &foreground); + /* don't do this here -- let fade_foreground() bring it up! */ + /* XStoreColor (dpy, cmap, &foreground); */ } else if (XAllocColor (dpy, cmap, &color)) { @@ -372,8 +351,8 @@ char *progclass = "Pedal"; * should be dark. */ char *defaults [] = { - "Pedal.background: black", /* to placate SGI */ - "Pedal.foreground: white", + "*background: black", + "*foreground: white", "*delay: 5", "*fadedelay: 200000", "*maxlines: 1000", @@ -386,14 +365,11 @@ XrmOptionDescRec options [] = { { "-maxlines", ".maxlines", XrmoptionSepArg, 0 }, { "-foreground", ".foreground", XrmoptionSepArg, 0 }, { "-background", ".background", XrmoptionSepArg, 0 }, + { 0, 0, 0, 0 } }; -int options_size = (sizeof (options) / sizeof (options[0])); - void -screenhack (dpy, window) - Display *dpy; - Window window; +screenhack (Display *dpy, Window window) { init_pedal (dpy, window); for (;;) {