Remove screen.png, which was commented out anyway.

2001-08-10  Richard Hestilow  <hestilow@ximian.com>

	* Makefile.am (pixmaps_DATA): Remove screen.png,
	  which was commented out anyway.

	* preferences.c (screensaver_clone): Added.
	  (copy_screensavers): Added.
	  (preferences_clone): Copy screensaver list.
	  (screensaver_destroy): Destroy new fields.
	* prefs-widget.c (prefs_widget_set_screensavers): Translate
	  strings and utf8ize ahead of time.
	  (prefs_widget_destroy): Free translated strings.
	  (model_value_at): Return pre-translated string.
	  (about_cb): Call gettext on desc, name, and title.
	* screensaver-prefs-dialog.c (screensaver_prefs_dialog_new):
	  Call gettext on label and desc.
	* capplets/screensavers/Makefile.am: Fixes for make distcheck.
	* capplets/screensavers/magic.pl.in: Fix description parsing bug,
	  and fakepreview lost bug.
This commit is contained in:
Richard Hestilow 2001-08-10 17:55:36 +00:00 committed by Rachel Hestilow
parent 6d643347af
commit b35c2cf932
26 changed files with 177 additions and 58 deletions

View file

@ -1,3 +1,23 @@
2001-08-10 Richard Hestilow <hestilow@ximian.com>
* Makefile.am (pixmaps_DATA): Remove screen.png,
which was commented out anyway.
* preferences.c (screensaver_clone): Added.
(copy_screensavers): Added.
(preferences_clone): Copy screensaver list.
(screensaver_destroy): Destroy new fields.
* prefs-widget.c (prefs_widget_set_screensavers): Translate
strings and utf8ize ahead of time.
(prefs_widget_destroy): Free translated strings.
(model_value_at): Return pre-translated string.
(about_cb): Call gettext on desc, name, and title.
* screensaver-prefs-dialog.c (screensaver_prefs_dialog_new):
Call gettext on label and desc.
* capplets/screensavers/Makefile.am: Fixes for make distcheck.
* capplets/screensavers/magic.pl.in: Fix description parsing bug,
and fakepreview lost bug.
2001-08-10 Carlos Perelló Marín <carlos@gnome-db.org>
* Makefile.am: Disabled desktop.png. It doesn't exists.

View file

@ -20,7 +20,6 @@ screensaver_properties_capplet_SOURCES = \
XScreenSaver_ad.h
pixmaps_DATA = no-hack.png blank-screen.png
#screen.png
##
## You should not need to modify anything below this line

View file

@ -251,6 +251,59 @@ clone_cb (gchar *key, gchar *value, Preferences *new_prefs)
return 0;
}
static Screensaver*
screensaver_clone (Screensaver *oldsaver)
{
Screensaver *saver;
GList *l;
g_return_val_if_fail (oldsaver != NULL, NULL);
saver = screensaver_new ();
saver->id = oldsaver->id;
saver->name = g_strdup (oldsaver->name);
saver->filename = g_strdup (oldsaver->filename);
saver->label = g_strdup (oldsaver->label);
saver->description = g_strdup (oldsaver->description);
if (oldsaver->command_line)
saver->command_line = g_strdup (oldsaver->command_line);
if (oldsaver->compat_command_line)
saver->compat_command_line = g_strdup (oldsaver->compat_command_line);
if (oldsaver->visual)
saver->visual = g_strdup (oldsaver->name);
saver->enabled = oldsaver->enabled;
if (oldsaver->fakepreview)
saver->fakepreview = g_strdup (oldsaver->fakepreview);
for (l = oldsaver->fakes; l != NULL; l = l->next)
{
saver->fakes = g_list_prepend (saver->fakes, g_strdup (l->data));
}
saver->fakes = g_list_reverse (saver->fakes);
return saver;
}
static GList*
copy_screensavers (GList *screensavers, GHashTable *savers_hash)
{
GList *ret = NULL, *l;
Screensaver *saver;
g_return_val_if_fail (savers_hash != NULL, NULL);
for (l = screensavers; l != NULL; l = l->next)
{
saver = screensaver_clone (l->data);
ret = g_list_prepend (ret, saver);
g_hash_table_insert (savers_hash, saver->name, saver);
saver->link = ret;
}
ret = g_list_reverse (ret);
return ret;
}
Preferences *
preferences_clone (Preferences *prefs)
{
@ -271,6 +324,9 @@ preferences_clone (Preferences *prefs)
g_tree_traverse (prefs->config_db, (GTraverseFunc) clone_cb,
G_IN_ORDER, new_prefs);
new_prefs->screensavers = copy_screensavers (prefs->screensavers,
new_prefs->savers_hash);
read_prefs_from_db (new_prefs);
return new_prefs;
}
@ -514,14 +570,27 @@ screensaver_new (void)
void
screensaver_destroy (Screensaver *saver)
{
GList *l;
if (!saver) return;
if (saver->visual) g_free (saver->visual);
if (saver->name) g_free (saver->name);
if (saver->filename) g_free (saver->filename);
if (saver->command_line) g_free (saver->command_line);
if (saver->compat_command_line) g_free (saver->compat_command_line);
if (saver->label) g_free (saver->label);
if (saver->description) g_free (saver->description);
if (saver->fakepreview) g_free (saver->fakepreview);
for (l = saver->fakes; l != NULL; l = l->next)
{
g_free (l->data);
}
if (saver->fakes)
g_list_free (saver->fakes);
g_free (saver);
}

View file

@ -34,6 +34,7 @@
#include "rc-parse.h"
#include <gal/e-table/e-table.h>
#include <gal/e-table/e-table-simple.h>
#include <gal/widgets/e-unicode.h>
#define WID(str) (glade_xml_get_widget (prefs_widget->priv->xml, str))
@ -53,6 +54,7 @@ struct _PrefsWidgetPrivate
guint random_timeout;
GList *random_current;
GtkWindow *parent;
gchar **translated;
/* Copied from Preferences...for OK/Cancel support in dialog */
gboolean power_management;
@ -171,8 +173,20 @@ guint prefs_widget_get_type (void)
static void
prefs_widget_destroy (PrefsWidget *prefs_widget)
{
int i;
if (prefs_widget->priv->xml)
gtk_object_destroy (GTK_OBJECT (prefs_widget->priv->xml));
if (prefs_widget->priv->translated)
{
for (i = 0; prefs_widget->priv->translated[i] != NULL; i++)
g_free (prefs_widget->priv->translated[i]);
g_free (prefs_widget->priv->translated);
}
close_preview ();
g_free (prefs_widget->priv);
if (GTK_OBJECT_CLASS (prefs_widget_parent_class)->destroy)
@ -534,7 +548,27 @@ prefs_widget_set_mode (PrefsWidget *prefs_widget, SelectionMode mode)
void
prefs_widget_set_screensavers (PrefsWidget *prefs_widget, GList *screensavers)
{
int i;
GList *l;
Screensaver *saver;
if (prefs_widget->priv->translated)
{
for (i = 0; prefs_widget->priv->translated[i] != NULL; i++)
g_free (prefs_widget->priv->translated[i]);
g_free (prefs_widget->priv->translated);
}
prefs_widget->screensavers = screensavers;
/* Good thing this is called infrequently */
prefs_widget->priv->translated = g_new0 (gchar*,
g_list_length (screensavers) + 1);
for (l = screensavers, i = 0; l != NULL; l = l->next, i++)
{
saver = l->data;
prefs_widget->priv->translated[i] = e_utf8_from_locale_string (gettext (saver->label));
}
e_table_model_changed (prefs_widget->priv->etm);
}
@ -583,14 +617,16 @@ model_value_at (ETableModel *etm, int col, int row, void *data)
{
PrefsWidget *prefs_widget = PREFS_WIDGET (data);
Screensaver *saver = g_list_nth_data (prefs_widget->screensavers, row);
if (!saver)
return NULL;
if (col == 0)
return GINT_TO_POINTER (saver->enabled);
else
return saver->label;
{
return prefs_widget->priv->translated[row];
}
}
static void
@ -872,15 +908,15 @@ about_cb (GtkWidget *widget, PrefsWidget *prefs_widget)
gchar *desc, *name;
desc = screensaver_get_desc (prefs_widget->selected_saver);
label = gtk_label_new (desc);
label = gtk_label_new (gettext (desc));
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
#if 0
name = screensaver_get_label (prefs_widget->selected_saver->name);
#endif
name = g_strdup (prefs_widget->selected_saver->label);
name = g_strdup (gettext (prefs_widget->selected_saver->label));
title = g_strdup_printf ("About %s\n", name);
title = g_strdup_printf (_("About %s\n"), name);
g_free (name);
dlg = gnome_dialog_new (title, GNOME_STOCK_BUTTON_CLOSE, NULL);

View file

@ -271,9 +271,9 @@ screensaver_prefs_dialog_new (Screensaver *saver)
dialog->saver = saver;
title = g_strdup_printf ("%s properties", saver->label);
title = g_strdup_printf (_("%s properties"), gettext (saver->label));
gtk_entry_set_text (GTK_ENTRY (dialog->name_entry),
saver->label);
gettext (saver->label));
if (arg_mapping_exists (saver)) {
dialog->cli_args_db =
@ -308,7 +308,7 @@ screensaver_prefs_dialog_new (Screensaver *saver)
settings_widget);
gtk_label_set_text (GTK_LABEL (dialog->description),
screensaver_get_desc (saver));
gettext (screensaver_get_desc (saver)));
if (dialog->argument_data)
place_screensaver_properties (dialog, dialog->argument_data);

View file

@ -8,7 +8,6 @@ pixmaps_DATA = \
vidwhacker.png \
webcollage.png
# This is not _DATA because we install _all_ xml files in install-data-local
Screensavers = \
3d_clock.xml \
ant.xml \
@ -147,11 +146,12 @@ Screensavers = \
xteevee.xml \
zoom.xml
EXTRA_DIST = $(Screensavers) README
saversdir = $(GNOMECC_SCREENSAVERS_DIR)
savers_DATA = $(Screensavers)
EXTRA_DIST = $(Screensavers) README $(pixmaps_DATA)
ADFILE = $(XSCREENSAVER_PREFIX)/lib/X11/app-defaults/XScreenSaver
install-data-local:
$(mkinstalldirs) $(DESTDIR)$(GNOMECC_SCREENSAVERS_DIR)
$(INSTALL_DATA) *.xml $(DESTDIR)$(GNOMECC_SCREENSAVERS_DIR)
@PERL@ $(top_srcdir)/capplets/screensaver/screensavers/magic.pl --adfile $(ADFILE) --merge $(DESTDIR)$(GNOMECC_SCREENSAVERS_DIR)
@PERL@ magic.pl --adfile $(ADFILE) --merge $(GNOMECC_SCREENSAVERS_DIR)

View file

@ -3,8 +3,6 @@
<fullcommand arg="-root"/>
<_description>Draws fireworks and zooming, fading flares. By Tom Campbell. You can find it at &lt;http://www.mindspring.com/~campbell/cosmos/&gt;.
! (xrdb prevention kludge: whole file) */</_description>
</screensaver>
<_description>Draws fireworks and zooming, fading flares. By Tom Campbell. You can find it at &lt;http://www.mindspring.com/~campbell/cosmos/&gt;.</_description>
</screensaver>

View file

@ -3,6 +3,6 @@
<fullcommand arg="-root"/>
<_description>Draws a ball that periodically extrudes many random spikes. Ouch! Written by Jamie Zawinski.</_description>
</screensaver>
<_description>Draws a ball that periodically extrudes many random spikes. Ouch! Written by Jamie Zawinski.</_description>
</screensaver>

View file

@ -12,5 +12,8 @@
id="monochrome" test="mono" arg-set="-mono"/>
<fakepreview>decayscreen.png</fakepreview>
<_description>This takes an image and makes it melt. You've no doubt seen this effect before, but no screensaver would really be complete without it. It works best if there's something colorful visible. Warning, if the effect continues after the screen saver is off, seek medical attention. Written by David Wald and Vivek Khera.</_description>
</screensaver>
<_description>This grabs an image of whatever is on your screen, and makes it melt. You've no doubt seen this effect before, but no screensaver would really be complete without it. It works best if there's something colorful visible. Warning, if the effect continues after the screen saver is off, seek medical attention. Written by David Wald and Vivek Khera.
A number of these screenhacks have the ability to take an image of your desktop and manipulate it in some way. On SGI systems, these programs are able to (at random) pull their source image from the system's video input instead! This works nicely if you leave some some random television station plugged in.</_description>
</screensaver>

View file

@ -7,4 +7,4 @@
<fakepreview>distort.png</fakepreview>
<_description>This hack grabs an image of the screen, and then lets a transparent lens wander around the screen, magnifying whatever is underneath. Written by Jonas Munsin.</_description>
</screensaver>
</screensaver>

View file

@ -3,6 +3,6 @@
<fullcommand arg="-root"/>
<_description>Draws a rippling waves on a rotating wireframe grid, using GL. Written by Josiah Pease.</_description>
</screensaver>
<_description>Draws a rippling waves on a rotating wireframe grid, using GL. Written by Josiah Pease.</_description>
</screensaver>

View file

@ -3,7 +3,7 @@
<fullcommand arg="-root"/>
<_description>Displays a few lines of text spinning around in a solid 3D font. Written by Jamie Zawinski.</_description>
<_description>Displays a few lines of text spinning around in a solid 3D font. Written by Jamie Zawinski.</_description>
<fake name="GLText (clock)"/>
</screensaver>
</screensaver>

View file

@ -3,6 +3,6 @@
<fullcommand arg="-root"/>
<_description>Hyperball is to hypercube as dodecahedron is to cube: this displays a 2D projection of the sequence of 3D objects which are the projections of the 4D analog to the dodecahedron. Written by Joe Keane.</_description>
</screensaver>
<_description>Hyperball is to hypercube as dodecahedron is to cube: this displays a 2D projection of the sequence of 3D objects which are the projections of the 4D analog to the dodecahedron. Written by Joe Keane.</_description>
</screensaver>

View file

@ -11,4 +11,4 @@
<fakepreview>jigsaw.png</fakepreview>
<_description>This grabs a screen image, carves it up into a jigsaw puzzle, shuffles it, and then solves the puzzle. This works especially well when you feed it an external video signal instead of letting it grab the screen image (actually, I guess this is generally true...) When it is grabbing a video image, it is sometimes pretty hard to guess what the image is going to look like once the puzzle is solved. Written by Jamie Zawinski.</_description>
</screensaver>
</screensaver>

View file

@ -150,20 +150,16 @@ if ($thefile)
}
elsif ($_ =~ /\-?(\w[\w\-]+) ((.+\w)?)[\t ]+/)
{
if ($1 eq "-") { print "$1 $2\n";}
my %saver = ("name" => $1,
"command" => $2);
$savers{$1} = \%saver;
next;
}
if ($name eq "rd-bomb") { print "$label $name $command\n";}
if ($name eq "cosmos") { print "$label $name $command\n";}
if ($name)
{
if ($savers{$name} and $label)
{
if ($name eq "xmountains") { print "erk\n"};
my %saver = %{$savers{$name}};
my @fakes;
if ($saver{"fakes"})
@ -226,7 +222,10 @@ if ($adfile)
$_ =~ s/\</&lt;/g;
$_ =~ s/\>/&gt;/g;
$_ =~ s/[\t ]*\n$//g;
# lame
$_ =~ s/\n\n\! \(xrdb prevention kludge\: whole file\) \*\///g;
$_ =~ s/\n\n\n\!\=+[\w\n\t \!]+\=+//g;
my $desc;
my $label;
if ($type eq "documentation")
@ -277,10 +276,6 @@ foreach $key (keys %savers)
my %saver = %{$savers{$key}};
my $name = $saver{"name"};
my $label = $saver{"label"};
if ($key eq "xmountains")
{
print "$name\n";
}
my $command = $saver{"command"};
my $desc = $saver{"desc"};
my @fakes;
@ -395,7 +390,7 @@ foreach $key (keys %savers)
print OUTFILE $str;
}
}
elsif ($foo =~ /\<fake/)
elsif ($foo =~ /\<fake name/)
{
# we handle the fakes later
}

View file

@ -3,7 +3,7 @@
<fullcommand arg="-root"/>
<_description>Draws several different representations of molecules. Some common molecules are built in, and it can also read PDB (Protein Data Base) files as input. Written by Jamie Zawinski.</_description>
<_description>Draws several different representations of molecules. Some common molecules are built in, and it can also read PDB (Protein Data Base) files as input. Written by Jamie Zawinski.</_description>
<fake name="Molecule (lumpy)"/>
</screensaver>
</screensaver>

View file

@ -3,8 +3,8 @@
<fullcommand arg="-root"/>
<_description>Creates a collage of rotated and scaled portions of the screen. Written by Claudio Matsuoka.</_description>
<_description>Creates a collage of rotated and scaled portions of the screen. Written by Claudio Matsuoka.</_description>
<fake name="RotZoomer (mobile)"/>
<fake name="RotZoomer (sweep)"/>
</screensaver>
</screensaver>

View file

@ -4,5 +4,5 @@
<command arg="-root"/>
<_description>This takes an image, divides it into a grid, and then randomly shuffles the squares around as if it was one of those annoying ``16-puzzle'' games, where there is a grid of squares, one of which is missing. I hate trying to solve those puzzles, but watching one permute itself is more amusing. Written by Jamie Zawinski.</_description>
<_description>This grabs an image of whatever is on your screen, divides it into a grid, and then randomly shuffles the squares around as if it was one of those annoying ``16-puzzle'' games, where there is a grid of squares, one of which is missing. I hate trying to solve those puzzles, but watching one permute itself is more amusing. Written by Jamie Zawinski.</_description>
</screensaver>

View file

@ -5,4 +5,4 @@
<command arg="-root"/>
<fakepreview>slip.png</fakepreview>
<_description>This program throws some random bits on the screen, then sucks them through a jet engine and spews them out the other side. To avoid turning the image completely to mush, every now and then it will and then it interjects some splashes of color into the scene, or go into a spin cycle, or stretch the image like taffy, or (this is my addition) grab an image of your current desktop to chew on. Originally written by Scott Draves; whacked on by Jamie Zawinski.</_description>
</screensaver>
</screensaver>

View file

@ -3,6 +3,6 @@
<fullcommand arg="-root"/>
<_description>Draws a stream of text slowly scrolling into the distance at an angle, over a star field, like at the beginning of the movie of the same name. Written by Jamie Zawinski and Claudio Matauoka.</_description>
</screensaver>
<_description>Draws a stream of text slowly scrolling into the distance at an angle, over a star field, like at the beginning of the movie of the same name. Written by Jamie Zawinski and Claudio Matauoka.</_description>
</screensaver>

View file

@ -3,6 +3,6 @@
<fullcommand arg="-root"/>
<_description>Chains of colorful squares dance around each other in complex spiral patterns. Written by Andrew Plotkin, based on SGI's `electropaint' screensaver.</_description>
</screensaver>
<_description>Chains of colorful squares dance around each other in complex spiral patterns. Written by Andrew Plotkin, based on SGI's `electropaint' screensaver.</_description>
</screensaver>

View file

@ -8,4 +8,4 @@
<_description>This is actually just a shell script that grabs a frame of video from the system's video input, and then uses some PBM filters (chosen at random) to manipulate and recombine the video frame in various ways (edge detection, subtracting the image from a rotated version of itself, etc.) Then it displays that image for a few seconds, and does it again. This works really well if you just feed broadcast television into it.
Currently, the three lines of the script that actually grab the source picture are SGI specific, but it should be trivial to adapt it to work on other systems that can grab video (please send me the changes if you do this...)</_description>
</screensaver>
</screensaver>

View file

@ -4,9 +4,8 @@
<command arg="-root"/>
<fakepreview>webcollage.png</fakepreview>
<_description>This program makes collages out of random images pulled off of the World Wide Web. It finds these images by doing random web searches, and then extracting images from the returned pages. It can also be set up to filter the images through the `VidWhacker' program, above, which looks really great.
(Note that most of the images it finds are text, and not pictures. This is because most of the web is pictures of text. Which is pretty sad.) Written by Jamie Zawinski.</_description>
<fake name="WebCollage (whacked)"/>
</screensaver>
</screensaver>

View file

@ -3,6 +3,6 @@
<fullcommand arg="-root"/>
<_description>Floating stars are acted upon by a mixture of simple 2D forcefields. The strength of each forcefield changes continuously, and it is also switched on and off at random. By Paul 'Joey' Clark.</_description>
</screensaver>
<_description>Floating stars are acted upon by a mixture of simple 2D forcefields. The strength of each forcefield changes continuously, and it is also switched on and off at random. By Paul 'Joey' Clark.</_description>
</screensaver>

View file

@ -3,6 +3,6 @@
<fullcommand arg="-root"/>
<_description>Draws a few swarms of critters flying around the screen, with nicely faded color trails behind them. Written by Chris Leger.</_description>
</screensaver>
<_description>Draws a few swarms of critters flying around the screen, with nicely faded color trails behind them. Written by Chris Leger.</_description>
</screensaver>

View file

@ -3,7 +3,7 @@
<fullcommand arg="-root"/>
<_description>Zooms in on a part of the screen and then moves around. With the -lenses option the result is like looking through many overlapping lenses rather than just a simple zoom. Written by James Macnicol.</_description>
<_description>Zooms in on a part of the screen and then moves around. With the -lenses option the result is like looking through many overlapping lenses rather than just a simple zoom. Written by James Macnicol.</_description>
<fake name="Zoom (Lenses)"/>
</screensaver>
</screensaver>