From ccb7f4903325f92555a9722bba74b58346654ba0 Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Mon, 2 Mar 2009 00:43:35 -0500 Subject: [PATCH] http://ftp.ksu.edu.tw/FTP/FreeBSD/distfiles/xscreensaver-4.24.tar.gz -rw-r--r-- 1 zblaxell zblaxell 4936993 Feb 8 2006 xscreensaver-4.24.tar.gz 9573a5c561422fed2845d37f3ad43fa3e2b62247 xscreensaver-4.24.tar.gz --- README | 8 + driver/Makefile.in | 1 + driver/XScreenSaver.ad.in | 6 +- driver/XScreenSaver_ad.h | 2 +- driver/demo-Gtk.c | 53 +- driver/exec.c | 53 +- driver/passwd-pam.c | 6 +- driver/setuid.c | 11 +- driver/subprocs.c | 1 + driver/test-uid.c | 7 +- driver/timers.c | 7 + driver/xscreensaver-getimage-video | 4 +- driver/xscreensaver-text | 4 +- driver/xscreensaver-text.man | 10 +- driver/xscreensaver.h | 2 + hacks/Makefile.in | 6 +- hacks/apple2.man | 10 +- hacks/attraction.man | 2 +- hacks/bubbles.man | 8 +- hacks/celtic.c | 260 +- hacks/celtic.man | 2 +- hacks/cloudlife.man | 6 +- hacks/config/README | 4 +- hacks/config/anemotaxis.xml | 2 +- hacks/config/atlantis.xml | 5 +- hacks/config/blinkbox.xml | 2 +- hacks/config/boing.xml | 4 +- hacks/config/bouncingcow.xml | 2 +- hacks/config/cloudlife.xml | 2 +- hacks/config/coral.xml | 2 +- hacks/config/crystal.xml | 2 +- hacks/config/flyingtoasters.xml | 2 +- hacks/config/glforestfire.xml | 2 +- hacks/config/glhanoi.xml | 2 +- hacks/config/glsnake.xml | 2 +- hacks/config/jigglypuff.xml | 4 +- hacks/config/juggle.xml | 2 +- hacks/config/juggler3d.xml | 2 +- hacks/config/lightning.xml | 2 +- hacks/config/lissie.xml | 4 +- hacks/config/lmorph.xml | 2 +- hacks/config/mirrorblob.xml | 3 +- hacks/config/mountain.xml | 2 +- hacks/config/pinion.xml | 2 +- hacks/config/polyhedra.xml | 16 +- hacks/config/pong.xml | 2 +- hacks/config/rd-bomb.xml | 2 +- hacks/config/rotzoomer.xml | 2 +- hacks/config/sierpinski3d.xml | 2 +- hacks/config/spheremonics.xml | 2 +- hacks/config/substrate.xml | 2 +- hacks/config/tangram.xml | 2 +- hacks/config/timetunnel.xml | 2 +- hacks/config/whirlwindwarp.xml | 2 +- hacks/config/wormhole.xml | 6 +- hacks/config/xss.dtd | 105 + hacks/config/xss.xsd | 375 +++ hacks/config/zoom.xml | 4 +- hacks/coral.man | 2 +- hacks/crystal.man | 2 +- hacks/deco.man | 1 - hacks/drift.man | 2 +- hacks/fontglide.c | 7 +- hacks/fontglide.man | 10 +- hacks/forest.man | 2 +- hacks/glx/Makefile.in | 7 +- hacks/glx/antmaze.man | 5 +- hacks/glx/atlantis.man | 4 +- hacks/glx/blinkbox.man | 2 +- hacks/glx/boing.man | 4 +- hacks/glx/carousel.man | 2 +- hacks/glx/cube21-tex.h | 4106 ---------------------------- hacks/glx/cube21.c | 208 +- hacks/glx/cubenetic.man | 2 +- hacks/glx/fliptext.man | 10 +- hacks/glx/glhanoi.c | 2 +- hacks/glx/glhanoi.man | 8 +- hacks/glx/glknots.man | 2 +- hacks/glx/glmatrix.man | 4 +- hacks/glx/glplanet.man | 10 +- hacks/glx/glslideshow.man | 2 +- hacks/glx/glsnake.c | 830 +++--- hacks/glx/glsnake.man | 14 +- hacks/glx/hypertorus.man | 4 +- hacks/glx/jigglypuff.man | 2 +- hacks/glx/juggler3d.man | 2 +- hacks/glx/mirrorblob.man | 15 +- hacks/glx/pinion.man | 2 +- hacks/glx/pipes.man | 2 +- hacks/glx/polytopes.man | 4 +- hacks/glx/pulsar.man | 4 +- hacks/glx/sballs.man | 10 - hacks/glx/sierpinski3d.man | 2 +- hacks/glx/spheremonics.man | 2 +- hacks/glx/starwars.man | 10 +- hacks/glx/tangram.man | 5 +- hacks/glx/timetunnel.man | 4 +- hacks/goop.man | 6 +- hacks/grav.man | 4 +- hacks/helix.man | 8 - hacks/hyperball.man | 8 +- hacks/hypercube.man | 6 +- hacks/ifs.man | 5 +- hacks/interaggregate.man | 22 +- hacks/jigsaw.man | 2 +- hacks/juggle.man | 2 +- hacks/kaleidescope.man | 2 +- hacks/lissie.man | 4 +- hacks/ljlatest.man | 10 +- hacks/metaballs.man | 2 +- hacks/mismunch.man | 2 +- hacks/mountain.man | 2 +- hacks/munch.man | 6 +- hacks/penrose.man | 6 +- hacks/phosphor.c | 16 +- hacks/phosphor.man | 10 +- hacks/piecewise.c | 5 + hacks/pong.man | 4 +- hacks/pyro.man | 4 +- hacks/qix.man | 2 +- hacks/rd-bomb.man | 14 +- hacks/rorschach.man | 6 +- hacks/rotzoomer.man | 6 +- hacks/shadebobs.man | 2 +- hacks/slidescreen.man | 2 +- hacks/slip.man | 2 +- hacks/sonar.c | 9 +- hacks/strange.man | 2 +- hacks/substrate.man | 2 +- hacks/t3d.man | 2 +- hacks/truchet.man | 8 +- hacks/vines.man | 2 +- hacks/webcollage.man | 2 +- hacks/whirlygig.man | 4 +- hacks/worm.man | 2 +- hacks/wormhole.c | 8 +- hacks/wormhole.man | 4 +- hacks/xanalogtv.man | 12 +- hacks/xlyap.man | 27 +- hacks/xmatrix.man | 4 +- hacks/xteevee.man | 8 +- po/POTFILES.in | 2 +- utils/version.h | 2 +- xscreensaver.spec | 2 +- 144 files changed, 1590 insertions(+), 5047 deletions(-) create mode 100644 hacks/config/xss.dtd create mode 100644 hacks/config/xss.xsd delete mode 100644 hacks/glx/cube21-tex.h diff --git a/README b/README index 0df5d685..ea9b4c4a 100644 --- a/README +++ b/README @@ -76,6 +76,14 @@ the XScreenSaver FAQ about that: http://www.jwz.org/xscreensaver/faq.html ============ +Changes since 4.23: * New versions of `cube21', `glsnake', `celtic'. + * Backed out a DPMS-related patch that cause desktop + flickering with some X servers. + * Fixed startup crash in getgroups() when running setuid. + * Default to not displaying stderr on the saver window. + * Fixed bad free() in "Documentation" button. + * Don't try to run hacks that aren't installed. + * Minor fixes to various XML config files and man pages. Changes since 4.22: * New hacks, `glhanoi', `cube21', `timetunnel', `juggler3d', and `celtic'. * New versions of `tangram', `webcollage', `hypertorus', diff --git a/driver/Makefile.in b/driver/Makefile.in index aa02e51b..eb478b0b 100644 --- a/driver/Makefile.in +++ b/driver/Makefile.in @@ -379,6 +379,7 @@ install-man: $(MEN) instname=`echo $$man | sed 's/\.man$$/\.$(mansuffix)/'` ; \ sed -e "s/^\.TH.*/$$TH/" \ -e 's/^\(\.BR xscr.*(\)[^()]\(.*\)/\1$(mansuffix)\2/' \ + -e 's@(MANSUFFIX)@($(mansuffix))@g' \ < $(srcdir)/$$man > $$T ; \ echo $(INSTALL_DATA) $(srcdir)/$$man \ $(install_prefix)$(manNdir)/$$instname ; \ diff --git a/driver/XScreenSaver.ad.in b/driver/XScreenSaver.ad.in index 6f608c30..4d110644 100644 --- a/driver/XScreenSaver.ad.in +++ b/driver/XScreenSaver.ad.in @@ -4,8 +4,8 @@ ! a screen saver and locker for the X window system ! by Jamie Zawinski ! -! version 4.23 -! 21-Oct-2005 +! version 4.24 +! 08-Feb-2006 ! ! See "man xscreensaver" for more info. The latest version is always ! available at http://www.jwz.org/xscreensaver/ @@ -54,7 +54,7 @@ *splash: True *splashDuration: 0:00:05 *visualID: default -*captureStderr: True +*captureStderr: False *ignoreUninstalledPrograms: False *textMode: file diff --git a/driver/XScreenSaver_ad.h b/driver/XScreenSaver_ad.h index c05ccf84..75717cfc 100644 --- a/driver/XScreenSaver_ad.h +++ b/driver/XScreenSaver_ad.h @@ -27,7 +27,7 @@ "*splash: True", "*splashDuration: 0:00:05", "*visualID: default", -"*captureStderr: True", +"*captureStderr: False", "*ignoreUninstalledPrograms: False", "*textMode: file", "*textLiteral: XScreenSaver", diff --git a/driver/demo-Gtk.c b/driver/demo-Gtk.c index 4a6f3cf1..61e9aa28 100644 --- a/driver/demo-Gtk.c +++ b/driver/demo-Gtk.c @@ -1,5 +1,5 @@ /* demo-Gtk.c --- implements the interactive demo-mode and options dialogs. - * xscreensaver, Copyright (c) 1993-2005 Jamie Zawinski + * xscreensaver, Copyright (c) 1993-2006 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 @@ -144,6 +144,7 @@ enum { /* from exec.c */ extern void exec_command (const char *shell, const char *command, int nice); +extern int on_path_p (const char *program); static void hack_subproc_environment (Window preview_window_id, Bool debug_p); @@ -1029,6 +1030,7 @@ manual_cb (GtkButton *button, gpointer user_data) int list_elt = selected_list_element (s); int hack_number; char *name, *name2, *cmd, *str; + char *oname = 0; if (list_elt < 0) return; hack_number = s->list_elt_to_hack_number[list_elt]; @@ -1037,6 +1039,7 @@ manual_cb (GtkButton *button, gpointer user_data) name = strdup (p->screenhacks[hack_number]->command); name2 = name; + oname = name; while (isspace (*name2)) name2++; str = name2; while (*str && !isspace (*str)) str++; @@ -1064,7 +1067,7 @@ manual_cb (GtkButton *button, gpointer user_data) False, 100); } - free (name); + free (oname); } @@ -2354,52 +2357,6 @@ scroll_to_current_hack (state *s) } -static Bool -on_path_p (const char *program) -{ - int result = False; - struct stat st; - char *cmd = strdup (program); - char *token = strchr (cmd, ' '); - char *path = 0; - int L; - - if (token) *token = 0; - token = 0; - - if (strchr (cmd, '/')) - { - result = (0 == stat (cmd, &st)); - goto DONE; - } - - path = getenv("PATH"); - if (!path || !*path) - goto DONE; - - L = strlen (cmd); - path = strdup (path); - token = strtok (path, ":"); - - while (token) - { - char *p2 = (char *) malloc (strlen (token) + L + 3); - strcpy (p2, token); - strcat (p2, "/"); - strcat (p2, cmd); - result = (0 == stat (p2, &st)); - if (result) - goto DONE; - token = strtok (0, ":"); - } - - DONE: - free (cmd); - if (path) free (path); - return result; -} - - static void populate_hack_list (state *s) { diff --git a/driver/exec.c b/driver/exec.c index 0798ea83..c9c95500 100644 --- a/driver/exec.c +++ b/driver/exec.c @@ -1,5 +1,5 @@ /* exec.c --- executes a program in *this* pid, without an intervening process. - * xscreensaver, Copyright (c) 1991-2002 Jamie Zawinski + * xscreensaver, Copyright (c) 1991-2005 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 @@ -58,6 +58,7 @@ #include #include #include +#include #ifndef ESRCH # include @@ -246,3 +247,53 @@ nice_process (int nice_level) #endif } + + +/* Whether the given command exists on $PATH. + (Anything before the first space is considered to be the program name.) + */ +int +on_path_p (const char *program) +{ + int result = 0; + struct stat st; + char *cmd = strdup (program); + char *token = strchr (cmd, ' '); + char *path = 0; + int L; + + if (token) *token = 0; + token = 0; + + if (strchr (cmd, '/')) + { + result = (0 == stat (cmd, &st)); + goto DONE; + } + + path = getenv("PATH"); + if (!path || !*path) + goto DONE; + + L = strlen (cmd); + path = strdup (path); + token = strtok (path, ":"); + + while (token) + { + char *p2 = (char *) malloc (strlen (token) + L + 3); + strcpy (p2, token); + strcat (p2, "/"); + strcat (p2, cmd); + result = (0 == stat (p2, &st)); + if (result) + goto DONE; + token = strtok (0, ":"); + } + + DONE: + free (cmd); + if (path) free (path); + return result; +} + diff --git a/driver/passwd-pam.c b/driver/passwd-pam.c index 52347aad..2452bbc6 100644 --- a/driver/passwd-pam.c +++ b/driver/passwd-pam.c @@ -339,7 +339,11 @@ pam_priv_init (int argc, char **argv, Bool verbose_p) const char file2[] = "/etc/pam.conf"; struct stat st; - if (stat (dir, &st) == 0 && st.st_mode & S_IFDIR) +# ifndef S_ISDIR +# define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) +# endif + + if (stat (dir, &st) == 0 && S_ISDIR(st.st_mode)) { if (stat (file, &st) != 0) fprintf (stderr, diff --git a/driver/setuid.c b/driver/setuid.c index 86d3535a..3ac78e4f 100644 --- a/driver/setuid.c +++ b/driver/setuid.c @@ -93,11 +93,13 @@ static int setgroups_needed_p (uid_t target_group) { gid_t groups[1024]; - int n = getgroups (sizeof(groups)-1, groups); + int n, size; + size = sizeof(groups) / sizeof(gid_t); + n = getgroups (size - 1, groups); if (n < 0) { char buf [1024]; - sprintf (buf, "%s: getgroups(%ld, ...)", blurb(), (long)sizeof(groups)-1); + sprintf (buf, "%s: getgroups(%ld, ...)", blurb(), (long int)(size - 1)); perror (buf); return 1; } @@ -161,7 +163,7 @@ set_ids_by_number (uid_t uid, gid_t gid, char **message_ret) { char buf [1024]; gid_t groups[1024]; - int n; + int n, size; if (sgs_errno) { @@ -178,7 +180,8 @@ set_ids_by_number (uid_t uid, gid_t gid, char **message_ret) } fprintf (stderr, "%s: effective group list: ", blurb()); - n = getgroups (sizeof(groups)-1, groups); + size = sizeof(groups) / sizeof(gid_t); + n = getgroups (size - 1, groups); if (n < 0) fprintf (stderr, "unknown!\n"); else diff --git a/driver/subprocs.c b/driver/subprocs.c index 01329d0e..64317982 100644 --- a/driver/subprocs.c +++ b/driver/subprocs.c @@ -954,6 +954,7 @@ spawn_screenhack_1 (saver_screen_info *ssi, Bool first_time_p) if (!force && (!hack->enabled_p || + !on_path_p (hack->command) || !select_visual_of_hack (ssi, hack))) { if (++retry_count > (p->screenhacks_count*4)) diff --git a/driver/test-uid.c b/driver/test-uid.c index dd4893e8..b4db41dd 100644 --- a/driver/test-uid.c +++ b/driver/test-uid.c @@ -37,7 +37,7 @@ print(void) struct passwd *p = 0; struct group *g = 0; gid_t groups[1024]; - int n; + int n, size; p = getpwuid (uid); g = getgrgid (gid); @@ -51,7 +51,8 @@ print(void) (p && p->pw_name ? p->pw_name : "???"), (g && g->gr_name ? g->gr_name : "???")); - n = getgroups(sizeof(groups)-1, groups); + size = sizeof(groups) / sizeof(gid_t) + n = getgroups(size - 1, groups); if (n < 0) perror("getgroups failed"); else @@ -63,7 +64,7 @@ print(void) g = getgrgid (groups[i]); fprintf(stderr, "%s%s=%ld", (i == 0 ? "" : ", "), (g->gr_name ? g->gr_name : "???"), - groups[i]); + (long) groups[i]); } fprintf (stderr, "]\n"); } diff --git a/driver/timers.c b/driver/timers.c index f64190bc..521929a6 100644 --- a/driver/timers.c +++ b/driver/timers.c @@ -336,11 +336,18 @@ reset_timers (saver_info *si) DPMS timer. Without this, the -deactivate clientmessage would prevent xscreensaver from blanking, but would not prevent the monitor from powering down. */ +#if 0 + /* #### With some servers, this causes the screen to flicker every + time a key is pressed! Ok, I surrender. I give up on ever + having DPMS work properly. + */ XForceScreenSaver (si->dpy, ScreenSaverReset); /* And if the monitor is already powered off, turn it on. You'd think the above would do that, but apparently not? */ monitor_power_on (si); +#endif + } diff --git a/driver/xscreensaver-getimage-video b/driver/xscreensaver-getimage-video index 3a8b59c7..468bf3af 100755 --- a/driver/xscreensaver-getimage-video +++ b/driver/xscreensaver-getimage-video @@ -29,7 +29,7 @@ use diagnostics; use strict; my $progname = $0; $progname =~ s@.*/@@g; -my $version = q{ $Revision: 1.14 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/; +my $version = q{ $Revision: 1.16 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/; my $verbose = 0; @@ -50,6 +50,8 @@ my @programs = ( "qcam > $tmpfile", # Connectix Qcam "gqcam -t PPM -d $tmpfile", # GTK+ Qcam clone + "v4lctl snap ppm full $tmpfile", # XawTV 3.94. + "streamer -a -s 768x576 -o $tmpfile", # XawTV # the "-a" option ("mute audio") arrived with XawTV 3.76. diff --git a/driver/xscreensaver-text b/driver/xscreensaver-text index 4449f9c9..49602956 100755 --- a/driver/xscreensaver-text +++ b/driver/xscreensaver-text @@ -24,7 +24,7 @@ use Text::Wrap qw(wrap); use bytes; my $progname = $0; $progname =~ s@.*/@@g; -my $version = q{ $Revision: 1.6 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/; +my $version = q{ $Revision: 1.7 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/; my $verbose = 0; my $http_proxy = undef; @@ -308,7 +308,7 @@ sub output() { safe_system ("date", "+%c"); print "\n"; my $ut = `uptime`; - $ut =~ s/^[ \d:]*//; + $ut =~ s/^[ \d:]*(am|pm)?//i; $ut =~ s/,\s*(load)/\n$1/; print "$ut\n"; } diff --git a/driver/xscreensaver-text.man b/driver/xscreensaver-text.man index eeb3cb2d..0193ddb3 100644 --- a/driver/xscreensaver-text.man +++ b/driver/xscreensaver-text.man @@ -60,12 +60,12 @@ URLs should be cached, use "If-Modified-Since", and obey "Expires". .BR xscreensaver-demo (1), .BR xscreensaver (1), .BR fortune (1), -.BR phosphor (1), -.BR apple2 (1), -.BR starwars (1), -.BR fontglide (1), +.BR phosphor (MANSUFFIX), +.BR apple2 (MANSUFFIX), +.BR starwars (MANSUFFIX), +.BR fontglide (MANSUFFIX), .BR dadadodo (1), -.BR webcollage (1), +.BR webcollage (MANSUFFIX), .I http://www.livejournal.com/stats/latest-rss.bml, .BR driftnet (1), .BR EtherPEG , diff --git a/driver/xscreensaver.h b/driver/xscreensaver.h index d80be101..1c37af55 100644 --- a/driver/xscreensaver.h +++ b/driver/xscreensaver.h @@ -427,6 +427,8 @@ extern void store_saver_status (saver_info *si); extern const char *signal_name (int signal); extern void exec_command (const char *shell, const char *command, int nice_level); +extern int on_path_p (const char *program); + /* ======================================================================= subprocs diagnostics diff --git a/hacks/Makefile.in b/hacks/Makefile.in index 0e5fde95..c2601134 100644 --- a/hacks/Makefile.in +++ b/hacks/Makefile.in @@ -213,6 +213,8 @@ EXTRAS = README Makefile.in xlock_23.h xml2man.pl .gdbinit \ euler2d.tex \ config/README \ config/$(STAR).xml \ + config/$(STAR).dtd \ + config/$(STAR).xsd \ images/$(STAR).xbm \ images/$(STAR).xpm \ images/bubbles/$(STAR).pov \ @@ -323,7 +325,9 @@ install-man: $(MEN) \ for man in $$men; do \ instname=`echo $$man | sed 's/\.man$$/\.$(mansuffix)/'` ; \ - sed "s/^\.TH.*/$$TH/" < $(srcdir)/$$man > $$T ; \ + sed -e "s/^\.TH.*/$$TH/" \ + -e 's@(MANSUFFIX)@($(mansuffix))@g' \ + < $(srcdir)/$$man > $$T ; \ echo $(INSTALL_DATA) $(srcdir)/$$man \ $(install_prefix)$(manNdir)/$$instname ; \ $(INSTALL_DATA) $$T \ diff --git a/hacks/apple2.man b/hacks/apple2.man index b464e43d..932c2b4c 100644 --- a/hacks/apple2.man +++ b/hacks/apple2.man @@ -175,14 +175,14 @@ Apple ][ and Applesoft are trademarks of Apple Computer. .SH SEE ALSO .BR xscreensaver (1), -.BR bsod (1), +.BR bsod (MANSUFFIX), .BR xscreensaver-text (1), .BR fortune (1), -.BR phosphor (1), -.BR starwars (1), -.BR ljlatest (1), +.BR phosphor (MANSUFFIX), +.BR starwars (MANSUFFIX), +.BR ljlatest (MANSUFFIX), .BR dadadodo (1), -.BR webcollage (1), +.BR webcollage (MANSUFFIX), .BR driftnet (1) .BR EtherPEG , .BR EtherPeek , diff --git a/hacks/attraction.man b/hacks/attraction.man index 5e19f757..0099a627 100644 --- a/hacks/attraction.man +++ b/hacks/attraction.man @@ -88,7 +88,7 @@ of the balls controls their mass. .TP 8 .B \-segments integer If in \fIlines\fP or \fIpolygons\fP mode, how many sets of line segments -or polygons should be drawn. Default 100. This has no effect in \fIballs\fP +or polygons should be drawn. Default 500. This has no effect in \fIballs\fP mode. If \fIsegments\fP is 0, then no segments will ever be erased (this is only useful in color.) .TP 8 diff --git a/hacks/bubbles.man b/hacks/bubbles.man index 5b83e21d..268929de 100644 --- a/hacks/bubbles.man +++ b/hacks/bubbles.man @@ -16,7 +16,7 @@ bubbles - frying pan / soft drink simulation .SH SYNOPSIS .B bubbles -[\-display \fIhost:display.screen\fP] [\-foreground \fIcolor\fP] [\-background \fIcolor\fP] [\-window] [\-root] [\-mono] [\-install] [\-visual \fIvisual\fP] [\-simple] [\-broken] [\-3D] +[\-display \fIhost:display.screen\fP] [\-foreground \fIcolor\fP] [\-background \fIcolor\fP] [\-window] [\-root] [\-mono] [\-install] [\-visual \fIvisual\fP] [\-simple] [\-broken] [\-3D] [\-rise|\-drop] [-trails] .SH DESCRIPTION \fIBubbles\fP sprays lots of little random bubbles all over the window which then grow until they reach their maximum size and go pop. The inspiration @@ -53,7 +53,7 @@ or the id number (decimal or hex) of a specific visual. .TP 8 .B \-delay microseconds How much of a delay should be introduced between steps of the animation. -Default 1, or about 1 microsecond. Actually, this is the delay between each +Default 800, or about 800 microsecond. Actually, this is the delay between each group of 15 new bubbles since such a delay between each step results in a very slow animation rate. .TP 8 @@ -81,6 +81,10 @@ mileage may vary. .B \-quiet Don't print messages explaining why one or several command line options were ignored. This is disabled by default. +.TP 8 +.B \-rise | \-drop +.TP 8 +.B \-trails .SH NOTES If you find the pace of things too slow, remember that there is a delay even though you specify no \fI\-delay\fP option. Try using \fI\-nodelay\fP diff --git a/hacks/celtic.c b/hacks/celtic.c index deb3f332..5e8e361f 100644 --- a/hacks/celtic.c +++ b/hacks/celtic.c @@ -1,4 +1,4 @@ -/* celtic, Copyright (c) 2005 Max Froumentin +/* celtic, Copyright (c) 2006 Max Froumentin * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -7,6 +7,10 @@ * documentation. No representations are made about the suitability of this * software for any purpose. It is provided "as is" without express or * implied warranty. + * + * A celtic pattern programme inspired by "Les Entrelacs Celtes", by + * Christian Mercat, Dossier Pour La Science, no. 47, april/june 2005. + * See */ #include @@ -14,7 +18,7 @@ #include "screenhack.h" #include "erase.h" -#define SQRT3_2 .86602540378443864676 +#define SQRT_3 1.73205080756887729352 /*-----------------------------------------*/ Display *dpy; @@ -33,6 +37,7 @@ struct params { unsigned long cluster_size; /* only used if type is kennicott */ unsigned long delay; /* controls curve drawing speed (step delay * in microsecs) */ + unsigned long nsteps; /* only if triangle: number of subdivisions along the side */ unsigned long nb_orbits; /* only used if type is polar */ unsigned long nb_nodes_per_orbit; /* only used if type is polar */ @@ -384,52 +389,50 @@ static Graph make_grid_graph(int xmin, int ymin, int width, int height, int step } - -static Graph make_triangle_graph(int xmin, int ymin, int width, int height, int step) - /* make a simple grid graph */ +static Graph make_triangle_graph(int xmin, int ymin, int width, int height, int edge_size) { Graph g; - int row,col,x,y; - int size=widthx1=x1; ss->x2=x2; ss->x3=x3; ss->x4=x4; @@ -543,7 +546,7 @@ static void spline_to_s(Spline s, FILE *f) for (i=0;isegments->nb_elements;i++) { ss=s->segments->elements[i]; fprintf(f," - segment %d: (%g, %g),(%g, %g),(%g, %g),(%g, %g)\n", - i,ss->x1,ss->y1,ss->x2,ss->y2,ss->x3,ss->y3,ss->x4,ss->y4); + i,ss->x1,ss->y1,ss->x2,ss->y2,ss->x3,ss->y3,ss->x4,ss->y4); } } #endif @@ -633,8 +636,8 @@ static void pattern_edge_couple_set(Pattern p, Edge e, Direction d, int value) } static void pattern_draw_spline_direction(Pattern p, Spline s, - Node node, Edge edge1, Edge edge2, - Direction direction) + Node node, Edge edge1, Edge edge2, + Direction direction) { double x1=(edge1->node1->x+edge1->node2->x)/2.0; double y1=(edge1->node1->y+edge1->node2->y)/2.0; @@ -716,7 +719,7 @@ static void pattern_make_curves(Pattern p) /* add the spline segment to the spline */ pattern_draw_spline_direction(p,s,current_node, - current_edge,next_edge,current_direction); + current_edge,next_edge,current_direction); /* cross the edge */ current_edge = next_edge; @@ -738,9 +741,9 @@ static void pattern_animate(Pattern p, unsigned long delay) int i,segment,unused; int ticks = 0; double step=0.0001; /* TODO: set the step (or the delay) as a - * function of the spline length, so that - * drawing speed is constant - */ + * function of the spline length, so that + * drawing speed is constant + */ Spline s; XSetLineAttributes(dpy,gc,params.curve_width,LineSolid,CapRound,JoinRound); @@ -749,33 +752,33 @@ static void pattern_animate(Pattern p, unsigned long delay) for (t=0.0;t<1;t+=step) { for (i=0;isplines->nb_elements;i++) if ((s=p->splines->elements[i])) { /* skip if one-point spline */ - spline_value_at(s, &x, &y, fmod(t,1.0),&segment); - spline_value_at(s, &x2, &y2, fmod(t+step,1.0),&unused); - - /* look ahead for the shadow segment */ - t2=t+step; - if (t2<=1.0) { - spline_value_at(s, &x3, &y3, fmod(t2,1.0),&unused); - while (t2+step<1.0 && (x3-x2)*(x3-x2)+(y3-y2)*(y3-y2) < params.shadow_width*params.shadow_width) { - t2+=step; - spline_value_at(s, &x3, &y3, fmod(t2,1.0),&unused); - } - - spline_value_at(s, &x4, &y4, fmod(t2+step,1.0),&unused); - - /* draw shadow line */ - XDrawLine(dpy,window,shadow_gc, - (int)rint(x3),(int)rint(y3), - (int)rint(x4),(int)rint(y4)); - } - /* draw line segment */ - if (p->splines->nb_elements==1) - XSetForeground(dpy, gc, colors[segment%(ncolors-3)+2].pixel); - else - XSetForeground(dpy, gc, colors[s->color].pixel); - XDrawLine(dpy,window,gc, - (int)rint(x),(int)rint(y), - (int)rint(x2),(int)rint(y2)); + spline_value_at(s, &x, &y, fmod(t,1.0),&segment); + spline_value_at(s, &x2, &y2, fmod(t+step,1.0),&unused); + + /* look ahead for the shadow segment */ + t2=t+step; + if (t2<=1.0) { + spline_value_at(s, &x3, &y3, fmod(t2,1.0),&unused); + while (t2+step<1.0 && (x3-x2)*(x3-x2)+(y3-y2)*(y3-y2) < params.shadow_width*params.shadow_width) { + t2+=step; + spline_value_at(s, &x3, &y3, fmod(t2,1.0),&unused); + } + + spline_value_at(s, &x4, &y4, fmod(t2+step,1.0),&unused); + + /* draw shadow line */ + XDrawLine(dpy,window,shadow_gc, + (int)rint(x3),(int)rint(y3), + (int)rint(x4),(int)rint(y4)); + } + /* draw line segment */ + if (p->splines->nb_elements==1) + XSetForeground(dpy, gc, colors[segment%(p->ncolors-3)+2].pixel); + else + XSetForeground(dpy, gc, colors[s->color].pixel); + XDrawLine(dpy,window,gc, + (int)rint(x),(int)rint(y), + (int)rint(x2),(int)rint(y2)); } if (++ticks > 100) { @@ -796,8 +799,8 @@ static void pattern_animate(Pattern p, unsigned long delay) spline_value_at(s, &x2, &y2, fmod(t-offset,1.0),&unused); while ((x2-x)*(x2-x)+(y2-y)*(y2-y) < params.shadow_width*params.shadow_width) { - offset+=step; - spline_value_at(s, &x2, &y2, fmod(t-offset,1.0),&unused); + offset+=step; + spline_value_at(s, &x2, &y2, fmod(t-offset,1.0),&unused); } XDrawLine(dpy,window,gc, (int)rint(x),(int)rint(y), (int)rint(x2),(int)rint(y2)); @@ -861,6 +864,19 @@ static void params_to_s(FILE *f) } #endif +#if 0 +static void colormap_to_s(int ncolors, XColor *colors) +{ + int i; + printf("-- colormap (%d colors):\n",ncolors); + for (i=0;i 2) - make_smooth_colormap (dpy, xgwa.visual, xgwa.colormap, - colors, &ncolors, True, 0, True); - } - + ncolors = get_integer_resource ("ncolors", "Integer"); + if (ncolors > 2) + make_smooth_colormap (dpy, xgwa.visual, xgwa.colormap, + colors, &ncolors, True, 0, True); } } diff --git a/hacks/celtic.man b/hacks/celtic.man index 7f564fa9..3afc0bf2 100644 --- a/hacks/celtic.man +++ b/hacks/celtic.man @@ -2,7 +2,7 @@ .SH NAME celtic - draws celtic cross-stich patterns .SH SYNOPSIS -.B ifs +.B celtic [\-display \fIhost:display.screen\fP] [\-visual \fIvisual\fP] [\-window] diff --git a/hacks/cloudlife.man b/hacks/cloudlife.man index 24c8bd48..00cbfec2 100644 --- a/hacks/cloudlife.man +++ b/hacks/cloudlife.man @@ -37,12 +37,8 @@ Time in microseconds to sleep between ticks. Default 25000. How many ticks should elapse between cycling colors. 0 to disable color cycling. Default 2. .TP 8 -.B \-cycle-colors \fIinteger\fP -How many ticks should elapse between cycling colors. 0 to use -just one color. Default 1. -.TP 8 .B \-ncolors \fIinteger\fP -How many colors should be used (if possible). Default 32. +How many colors should be used (if possible). Default 64. The colors are chosen randomly. .TP 8 .B \-cell-size \fIinteger\fP diff --git a/hacks/config/README b/hacks/config/README index 955f5c1a..cdc4eedf 100644 --- a/hacks/config/README +++ b/hacks/config/README @@ -4,8 +4,8 @@ a screen saver and locker for the X window system by Jamie Zawinski - version 4.23 - 21-Oct-2005 + version 4.24 + 08-Feb-2006 http://www.jwz.org/xscreensaver/ diff --git a/hacks/config/anemotaxis.xml b/hacks/config/anemotaxis.xml index 7e65852b..6d9a242a 100644 --- a/hacks/config/anemotaxis.xml +++ b/hacks/config/anemotaxis.xml @@ -11,7 +11,7 @@ + low="10" high="250" default="40"/> - + low="0" high="1000" default="100"/> + _label="Box Size" low="1" high="8" default="2"/>
diff --git a/hacks/config/boing.xml b/hacks/config/boing.xml index 6a741c39..6e367a24 100644 --- a/hacks/config/boing.xml +++ b/hacks/config/boing.xml @@ -15,9 +15,9 @@
+ _label="Meridians" low="1" high="90" default="16"/> + _label="Parallels" low="1" high="90" default="8"/>
diff --git a/hacks/config/bouncingcow.xml b/hacks/config/bouncingcow.xml index 0edbaf47..652df7ce 100644 --- a/hacks/config/bouncingcow.xml +++ b/hacks/config/bouncingcow.xml @@ -10,7 +10,7 @@ + low="1" high="99" default="30"/> + low="1" high="100" default="20"/> <_description> Simulates coral growth, albeit somewhat slowly. Written by Frederick Roeber. diff --git a/hacks/config/crystal.xml b/hacks/config/crystal.xml index bd5e8fe5..ac4be6a2 100644 --- a/hacks/config/crystal.xml +++ b/hacks/config/crystal.xml @@ -17,7 +17,7 @@ _label="Horizontal Symmetries" low="-10" high="10" default="-3"/> + _label="Vertical Symmetries" low="-10" high="10" default="-3"/> diff --git a/hacks/config/flyingtoasters.xml b/hacks/config/flyingtoasters.xml index 55b09b17..09938762 100644 --- a/hacks/config/flyingtoasters.xml +++ b/hacks/config/flyingtoasters.xml @@ -10,7 +10,7 @@ + low="0" high="20" default="5"/> -