diff -Nru xscreensaver-5.30/android/generate_files.pl xscreensaver-5.34/android/generate_files.pl --- xscreensaver-5.30/android/generate_files.pl 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/generate_files.pl 2015-08-28 22:09:44.000000000 -0400 @@ -0,0 +1,1723 @@ +#!/usr/bin/perl -w +# Copyright © 2008-2015 Jamie Zawinski +# Copyright © 2015 Dennis Sheil +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation. No representations are made about the suitability of this +# software for any purpose. It is provided "as is" without express or +# implied warranty. +# +# This parses the .c and .xml files and makes sure they are in sync: that +# options are spelled the same, and that all the numbers are in sync. +# Some of that functionality may be removed in the future. +# +# This also generates necessary Android files based on the information in +# those source and XML files. +# +# For the moment, the get_keys_and_values() subroutine is where support for +# previously unsupported Android live wallpapers is added. +# +# Created: 13-May-2015. + +require 5; +use diagnostics; +use strict; + +my $progname = $0; $progname =~ s@.*/@@g; +my ($version) = ('$Revision: 1.1 $' =~ m/\s(\d[.\d]+)\s/s); + +my $verbose = 0; + + +my $xlockmore_default_opts = ''; +foreach (qw(count cycles delay ncolors size font)) { + $xlockmore_default_opts .= "{\"-$_\", \".$_\", XrmoptionSepArg, 0},\n"; +} +$xlockmore_default_opts .= + "{\"-wireframe\", \".wireframe\", XrmoptionNoArg, \"true\"},\n" . + "{\"-3d\", \".use3d\", XrmoptionNoArg, \"true\"},\n" . + "{\"-no-3d\", \".use3d\", XrmoptionNoArg, \"false\"},\n"; + +my $thread_default_opts = + "{\"-threads\", \".useThreads\", XrmoptionNoArg, \"True\"},\n" . + "{\"-no-threads\", \".useThreads\", XrmoptionNoArg, \"False\"},\n"; + +my $analogtv_default_opts = ''; +foreach (qw(color tint brightness contrast)) { + $analogtv_default_opts .= "{\"-tv-$_\", \".TV$_\", XrmoptionSepArg, 0},\n"; +} + +$analogtv_default_opts .= $thread_default_opts; + + +sub parse_settings_xml($) { + + my ($saver) = @_; + + my $file = "project/xscreensaver/res/values/settings.xml"; + my $body = ''; + + local *IN; + + if (-e $file) { + open (IN, '<', $file) || error ("$file: $!"); + } + else { + my @short; + return @short; + } + + while () { $body .= $_; } + close IN; + $file =~ s@^.*/@@; + $body =~ s// /gsi; + $body =~ s/\s+/ /gs; + $body =~ s/([^\"]+)/); + $loop = $name; + + if ($name =~ /^$saver/) { + error ("$saver: $saver already in $file"); + } + + } elsif ($type eq 'item') { + + my ($item_value) = ($args =~ m/>(.+)/); + my $item = $loop . " = " . $item_value; + push @all, $item; + + } else { + error ("$file: unknown type \"$type\" for no arg"); + } + } + + return @all; + +} + + +sub parse_items_xml($) { + + my ($saver) = @_; + + my $file = "project/xscreensaver/res/values/items.xml"; + my $body = ''; + my (%pixkeys) ; + + local *IN; + + if (-e $file) { + open (IN, '<', $file) || error ("$file: $!"); + } + else { + my %short; + return %short; + } + + while () { $body .= $_; } + close IN; + $file =~ s@^.*/@@; + $body =~ s// /gsi; + + $body =~ s/\s+/ /gs; + $body =~ s/([^\"]+)/); + + if ($name =~ /^$saver/) { + error ("$saver: $saver already in $file"); + } + + $pixkeys{$name} = $value; + + } else { + error ("$file: unknown type \"$type\" for no arg"); + } + } + + return (%pixkeys); +} + + +sub parse_glue($) { + my ($saver) = @_; + my $file = "gen/glue.c"; + my $in; + + if (-e $file) { + open ($in, '<', $file) || error ("$file: $!"); + } + else { + my @short; + return @short; + } + + my $body = ''; + while (<$in>) { $body .= $_; } + close $in; + $file =~ s@^.*/@@; + $body =~ s@^#\s*(if|ifdef|ifndef|elif|else|endif).*$@@gm; + + my (@hacks); + if ($body =~ m/table\s*\*([a-z,\s\*_]+)xscreensaver_function_table;/s) { + foreach (split (/,\s*\n/, $1)) { + s/^\s*//s; + s/\*//s; + my @ftables = split (/_/, $_); + my $ftable = $ftables[0]; + if ($ftable eq $saver) { + error("$saver is already in glue"); + } + push @hacks, $ftable; + } + } + return @hacks; +} + +# Returns two tables: +# - A table of the default resource values. +# - A table of "-switch" => "resource: value", or "-switch" => "resource: %" +# +sub parse_src($) { + my ($saver) = @_; + my $ffile = lc($saver) . ".c"; + + # kludge... + $ffile = 'apple2-main.c' if ($ffile eq 'apple2.c'); + $ffile = 'sproingiewrap.c' if ($ffile eq 'sproingies.c'); + $ffile = 'b_lockglue.c' if ($ffile eq 'bubble3d.c'); + $ffile = 'polyhedra-gl.c' if ($ffile eq 'polyhedra.c'); + $ffile = 'companion.c' if ($ffile eq 'companioncube.c'); + + my $file = "../hacks/" . $ffile; + + $file = "../hacks/glx/$ffile" unless (-f $file); + my $body = ''; + open (my $in, '<', $file) || error ("$file: $!"); + while (<$in>) { $body .= $_; } + close $in; + $file =~ s@^.*/@@; + + my $xlockmore_p = 0; + my $thread_p = ($body =~ m/THREAD_DEFAULTS/); + my $analogtv_p = ($body =~ m/ANALOGTV_DEFAULTS/); + + $body =~ s@/\*.*?\*/@@gs; + $body =~ s@^#\s*(if|ifdef|ifndef|elif|else|endif).*$@@gm; + $body =~ s/(THREAD|ANALOGTV)_(DEFAULTS|OPTIONS)(_XLOCK)?//gs; + + print STDERR "$progname: $file: defaults:\n" if ($verbose > 2); + my %res_to_val; + if ($body =~ m/_defaults\s*\[\]\s*=\s*{(.*?)}\s*;/s) { + foreach (split (/,\s*\n/, $1)) { + s/^\s*//s; + s/\s*$//s; + next if m/^0?$/s; + my ($key, $val) = m@^\"([^:\s]+)\s*:\s*(.*?)\s*\"$@; + print STDERR "$progname: $file: unparsable: $_\n" unless $key; + $key =~ s/^[.*]//s; + $res_to_val{$key} = $val; + print STDERR "$progname: $file: $key = $val\n" if ($verbose > 2); + } + } elsif ($body =~ m/\#\s*define\s*DEFAULTS\s*\\?\s*(.*?)\n[\n#]/s) { + $xlockmore_p = 1; + my $str = $1; + $str =~ s/\"\s*\\\n\s*\"//gs; + $str =~ m/^\s*\"(.*?)\"\s*\\?\s*$/ || + error ("$file: unparsable defaults: $str"); + $str = $1; + $str =~ s/\s*\\n\s*/\n/gs; + foreach (split (/\n/, $str)) { + my ($key, $val) = m@^([^:\s]+)\s*:\s*(.*?)\s*$@; + print STDERR "$progname: $file: unparsable: $_\n" unless $key; + $key =~ s/^[.*]//s; + $res_to_val{$key} = $val; + print STDERR "$progname: $file: $key = $val\n" if ($verbose > 2); + } + + while ($body =~ s/^#\s*define\s+(DEF_([A-Z\d_]+))\s+\"([^\"]+)\"//m) { + my ($key1, $key2, $val) = ($1, lc($2), $3); + $key2 =~ s/_(.)/\U$1/gs; # "foo_bar" -> "fooBar" + $key2 =~ s/Rpm/RPM/; # kludge + $res_to_val{$key2} = $val; + print STDERR "$progname: $file: $key1 ($key2) = $val\n" + if ($verbose > 2); + } + + } else { + error ("$file: no defaults"); + } + + $body =~ m/XSCREENSAVER_MODULE(_2)?\s*\(\s*\"([^\"]+)\"/ || + error ("$file: no module name"); + $res_to_val{progclass} = $2; + $res_to_val{doFPS} = 'false'; + print STDERR "$progname: $file: progclass = $2\n" if ($verbose > 2); + + print STDERR "$progname: $file: switches to resources:\n" + if ($verbose > 2); + my %switch_to_res; + $switch_to_res{-fps} = 'doFPS: true'; + $switch_to_res{-fg} = 'foreground: %'; + $switch_to_res{-bg} = 'background: %'; + + my ($ign, $opts) = ($body =~ m/(_options|\bopts)\s*\[\]\s*=\s*{(.*?)}\s*;/s); + if ($xlockmore_p || $thread_p || $analogtv_p || $opts) { + $opts = '' unless $opts; + $opts .= ",\n$xlockmore_default_opts" if ($xlockmore_p); + $opts .= ",\n$thread_default_opts" if ($thread_p); + $opts .= ",\n$analogtv_default_opts" if ($analogtv_p); + + foreach (split (/,\s*\n/, $opts)) { + s/^\s*//s; + s/\s*$//s; + next if m/^$/s; + next if m/^{\s*0\s*,/s; + my ($switch, $res, $type, $v0, $v1, $v2) = + m@^ \s* { \s * \"([^\"]+)\" \s* , + \s * \"([^\"]+)\" \s* , + \s * ([^\s]+) \s* , + \s * (\"([^\"]*)\"|([a-zA-Z\d_]+)) \s* }@xi; + print STDERR "$progname: $file: unparsable: $_\n" unless $switch; + my $val = defined($v1) ? $v1 : $v2; + $val = '%' if ($type eq 'XrmoptionSepArg'); + $res =~ s/^[.*]//s; + $res =~ s/^[a-z\d]+\.//si; + $switch =~ s/^\+/-no-/s; + + $val = "$res: $val"; + if (defined ($switch_to_res{$switch})) { + print STDERR "$progname: $file: DUP! $switch = \"$val\"\n" + if ($verbose > 2); + } else { + $switch_to_res{$switch} = $val; + print STDERR "$progname: $file: $switch = \"$val\"\n" + if ($verbose > 2); + } + } + } else { + error ("$file: no options"); + } + + return (\%res_to_val, \%switch_to_res); +} + +# Returns a list of: +# "resource = default value" +# or "resource != non-default value" +# +sub parse_manifest_xml($$) { + my @result = (); + my ($saver, $switch_to_res) = @_; + my $file = "project/xscreensaver/AndroidManifest.xml"; + my $body = ''; + local *IN; + + if (-e $file) { + open (IN, "<$file") || error ("$file: $!"); + } + else { + return @result; + } + + while () { $body .= $_; } + close IN; + $file =~ s@^.*/@@; + + $body =~ s// /gsi; + + $body =~ s/\s+/ /gs; + $body =~ s/ 2); + + foreach (split (m/\001/, $body)) { + next if (m/^\s*$/s); + my ($type, $args) = m@^<([?/]?[-_a-z]+)\b\s*(.*)$@si; + error ("$progname: $file: unparsable: $_") unless $type; + next if ($type =~ m@^/@); + if ($type eq 'meta-data') { + my ($value) = ($args =~ m/\@xml\/([^\"]+)\"/); + push @result, $value; + } + } + return @result; +} + +# Returns a list of: +# "resource = default value" +# or "resource != non-default value" +# +sub parse_strings_xml($$) { + my @result = (); + my ($saver, $switch_to_res) = @_; + my $file = "project/xscreensaver/res/values/strings.xml"; + my $body = ''; + local *IN; + + if (-e $file) { + open (IN, "<$file") || error ("$file: $!"); + } + else { + return @result; + } + + while () { $body .= $_; } + close IN; + $file =~ s@^.*/@@; + + $body =~ s// /gsi; + + $body =~ s/\s+/ /gs; + $body =~ s/ 2); + + my $saver_name = $saver . "_name"; + + foreach (split (m/\001/, $body)) { + next if (m/^\s*$/s); + my ($type, $args) = m@^<([?/]?[-_a-z]+)\b\s*(.*)$@si; + error ("$progname: $file: unparsable: $_") unless $type; + next if ($type =~ m@^/@); + + if ($type =~ m/^([hv]group|\?xml|resources|xscreensaver-(image|text|updater))/s) { + + } elsif ($type eq 'string') { + my ($name) = ($args =~ m/\bname\s*=\s*\"([^\"]+)\"/); + my ($value) = ($args =~ m/>([^\"]+)/); + my ($val) = "$name = $value"; + if ($saver_name eq $name) { + error ("$saver: $saver already in $file"); + } + push @result, $val; + } elsif ($type eq 'item') { + # ignore + } else { + error ("$file: unknown type \"$type\" for no arg"); + } + } + + return @result; +} + + + +# Returns a list of: +# "resource = default value" +# or "resource != non-default value" +# +sub parse_xml($$) { + my ($saver, $switch_to_res) = @_; + my $file = "../hacks/config/" . lc($saver) . ".xml"; + my $body = ''; + local *IN; + open (IN, "<$file") || error ("$file: $!"); + while () { $body .= $_; } + close IN; + $file =~ s@^.*/@@; + + my @result = (); + + $body =~ s// /gsi; + + $body =~ s/\s+/ /gs; + $body =~ s/ 2); + foreach (split (m/\001/, $body)) { + next if (m/^\s*$/s); + my ($type, $args) = m@^<([?/]?[-_a-z]+)\b\s*(.*)$@si; + + my $type_val; + error ("$progname: $file: unparsable: $_") unless $type; + next if ($type =~ m@^/@); + + if ($type =~ m/^([hv]group|\?xml|command|string|file|_description|xscreensaver-(image|text|updater))/s) { + + } elsif ($type eq 'screensaver') { + my ($name) = ($args =~ m/\b_label\s*=\s*\"([^\"]+)\"/); + my $val = "progclass = $name"; + push @result, $val; + print STDERR "$progname: $file: name: $name\n" if ($verbose > 2); + + } elsif ($type eq 'video') { + error ("$file: multiple videos") if $video; + ($video) = ($args =~ m/\bhref="(.*?)"/); + error ("$file: unparsable video") unless $video; + error ("$file: unparsable video URL") + unless ($video =~ m@^https?://www\.youtube\.com/watch\?v=[^?&]+$@s); + + } elsif ($type eq 'number') { + my ($arg) = ($args =~ m/\barg\s*=\s*\"([^\"]+)\"/); + my ($val) = ($args =~ m/\bdefault\s*=\s*\"([^\"]+)\"/); + $val = '' unless defined($val); + + my ($low) = ($args =~ m/\blow\s*=\s*\"([^\"]+)\"/); + my ($high) = ($args =~ m/\bhigh\s*=\s*\"([^\"]+)\"/); + + my ($ll) = ($args =~ m/\b_low-label\s*=\s*\"([^\"]+)\"/); + my ($hl) = ($args =~ m/\b_high-label\s*=\s*\"([^\"]+)\"/); + + my $switch = $arg; + $switch =~ s/\s+.*$//; + my ($res) = $switch_to_res->{$switch}; + error ("$file: no resource for $type switch \"$arg\"") unless $res; + $res =~ s/: \%$//; + error ("$file: unparsable value: $res") if ($res =~ m/:/); + + $type_val = "$res" . "_type = $type"; + push @result, $type_val; + $val = "$res = $val"; + push @result, $val; + $val = "$res" . "_low = $low"; + push @result, $val; + $val = "$res" . "_high = $high"; + push @result, $val; + $val = "$res" . "_low-label = $ll"; + push @result, $val; + $val = "$res" . "_high-label = $hl"; + push @result, $val; + + print STDERR "$progname: $file: number: $val\n" if ($verbose > 2); + + } elsif ($type eq 'boolean') { + my ($set) = ($args =~ m/\barg-set\s*=\s*\"([^\"]+)\"/); + my ($unset) = ($args =~ m/\barg-unset\s*=\s*\"([^\"]+)\"/); + my ($arg) = $set || $unset || error ("$file: unparsable: $args"); + my ($res) = $switch_to_res->{$arg}; + error ("$file: no resource for boolean switch \"$arg\"") unless $res; + my ($res2, $val) = ($res =~ m/^(.*?): (.*)$/s); + error ("$file: unparsable boolean resource: $res") unless $res2; + $res = $res2; + $type_val = "$res" . "_type = $type"; + push @result, $type_val; +# $val = ($set ? "$res != $val" : "$res = $val"); + $val = "$res != $val"; + push @result, $val; + + print STDERR "$progname: $file: boolean: $val\n" if ($verbose > 2); + + } elsif ($type eq 'select') { + $args =~ s/{$set}; + error ("$file: no resource for select switch \"$set\"") unless $res; + + my ($res2, $val2) = ($res =~ m/^(.*?): (.*)$/s); + error ("$file: unparsable select resource: $res") unless $res2; + $res = $res2; + $type_val = "$res" . "_type = $type"; + push @result, $type_val; + $val = $val2 unless ($val2 eq '%'); + + error ("$file: mismatched resources: $res vs $this_res") + if (defined($this_res) && $this_res ne $res); + $this_res = $res; + + $val = "$res != $val"; + push @result, $val; + $val = "$res" . "_type = $type"; + push @result, $val; + + print STDERR "$progname: $file: select: $val\n" if ($verbose > 2); + + } else { + error ("$file: multiple default options: $set") if ($unset_p); + $unset_p++; + } + } + + } else { + error ("$file: unknown type \"$type\" for no arg"); + } + } + +# error ("$file: no video") unless $video; + print STDERR "\n$file: WARNING: no video\n\n" unless $video; + + return @result; +} + + +sub parse_then_make($) { + my ($saver) = @_; + + # kludge + return 0 if ($saver =~ m/(-helper)$/); + + my ($src_opts, $switchmap) = parse_src ($saver); + my (@xml_opts) = parse_xml ($saver, $switchmap); + + # tests if hack is supported yet + my (@test) = get_keys_and_values($saver, @xml_opts); + my (@strings_xml_opts) = parse_strings_xml ($saver, $switchmap); + my (%pixkeys) = parse_items_xml($saver); + my (@manifest_xml_opts) = parse_manifest_xml ($saver, $switchmap); + my (@glue_hacks) = parse_glue($saver); + my (@settings_xml_opts) = parse_settings_xml($saver); + + my (@all_settings) = get_settings($saver, $switchmap, \@xml_opts); + + make_settings($saver); + make_service($saver); + make_wallpaper($saver, @xml_opts); + + make_manifest($saver, @manifest_xml_opts); + + make_hack_xml($saver); + make_hack_settings_xml($saver, @xml_opts); + make_strings_xml($saver, \@xml_opts, \@strings_xml_opts); + make_items_xml($saver, \@xml_opts, \%pixkeys); + make_settings_xml($saver, \@all_settings, \@settings_xml_opts); + + make_glue($saver, @glue_hacks); + + return 0; +} + + +sub make_manifest($$) { + my ($saver, @manifest_opts) = @_; + push @manifest_opts, $saver unless grep{$_ eq $saver} @manifest_opts; + my $hack = ucfirst($saver); + my $file = "project/xscreensaver/AndroidManifest.xml"; + open (my $in, '>', $file) || error ("$file: $!"); + + my $body = ("\n" . + "\n" . + "\n" . + "\n\n"); + + foreach my $save (@manifest_opts) { + my $hac = ucfirst($save); + $body = $body . ("\n" . + " \n" . + " \n" . + " \n" . + " \n" . + "\n" . + "\n" . + "\n\n"); + + } + + $body = $body . ("\n\n" . + "\n" . + "\n" . + "\n"); + + print $in $body; + close $in; +} + + +sub make_hack_settings_xml($$) { + + my ($saver, @xml_opts) = @_; + my $hack = ucfirst($saver); + my $file = "project/xscreensaver/res/xml/" . $saver . "_settings.xml"; + my (%saver_keys) = get_keys_and_values($saver, @xml_opts); + + open (my $in, '>', $file) || error ("$file: $!"); + + my $body = ("\n" . + "\n" . + " \n"); + + my @keyarray = keys %saver_keys; + + + foreach my $sgkey (@keyarray) { + + my $type = get_type($sgkey, @xml_opts); + + + if ($type eq "number") { + $body = $body . " \n"; + } else { + $body = $body . " \n"; + } + } + + $body = $body . " \n" . + "\n"; + + print $in $body; + close $in; +} + + +sub make_items_xml($\@\%) { + my $saver = $_[0]; + my @xml_opts = @{$_[1]}; + my %pixkeys = %{$_[2]}; + + my $file = "project/xscreensaver/res/values/items.xml"; + + my $body = ("\n" . + "\n"); + + while(my($key, $value) = each %pixkeys) { + $body = $body . " ". $value . "\n"; + + } + + my (%saver_keys) = get_keys_and_values($saver, @xml_opts); + my @keyarray = keys %saver_keys; + + foreach my $item_key (@keyarray) { + + my $type = get_type($item_key, @xml_opts); + + if ($type eq "number") { + + my ($low, $high, $default) = get_low_high_def($item_key, @xml_opts); + my $float = ($default - $low) / ($high - $low); + + $body = ($body . + " $float\n"); + } + } + + $body = ($body . + "\n"); + open (my $in, '>', $file) || error ("$file: $!"); + print $in $body; + close $in; +} + + +sub get_type($@) { + + my($type_key, @xml_opts) = @_; + my $type=''; + + foreach my $claim (@xml_opts) { + + my ($res, $compare, $xval) = ($claim =~ m/^(.*) (=|!=) (.*)$/s); + if ($res eq $type_key . "_type") { + $type = $xval; + } + + } + return $type; + +} + + +sub get_low_high_def($@) { + + my($sgkey, @xml_opts) = @_; + + my $low; + my $high; + my $default; + + foreach my $claim (@xml_opts) { + my ($res, $compare, $xval) = ($claim =~ m/^(.*) (=|!=) (.*)$/s); + if ($res eq $sgkey . "_low") { + $low = $xval; + } + elsif ($res eq $sgkey . "_high") { + $high = $xval; + } + elsif ($res eq $sgkey) { + $default = $xval; + } + } + + return ($low, $high, $default); + +} + + +sub make_settings_xml($\@\@) { + + my $saver = $_[0]; + my @xml_opts = @{$_[1]}; + my @old_settings_xml = @{$_[2]}; + my $file = "project/xscreensaver/res/values/settings.xml"; + + my $body = ("\n" . + "\n"); + + my $arrays_from_old_settings = old_settings_string_arrays(@old_settings_xml); + + $body = $body . $arrays_from_old_settings; + + my (%saver_keys) = get_keys_and_values($saver, @xml_opts); + my @key_array = keys %saver_keys; + + my ($low, $high, $low_label, $high_label, $type); + my @selects; + + # for each setting of the hack which we chose to add + foreach my $selected_setting_key (@key_array) { + # see what values were in the relevant xml in hacks/config for this hack + foreach my $claim (@xml_opts) { + my ($xres, $xcompare, $xval) = ($claim =~ m/^(.*) (=|!=) (.*)$/s); + if ($xres =~ /^$selected_setting_key/) { + my $one, my $two; + if ($xres =~ /_/ ) { + ($one, $two) = ($xres =~ m/^(.*)_(.*)$/s); + if ($two eq "type") { + $type = $xval; + } elsif ($two eq "low-label") { + $low_label = $xval; + } elsif ($two eq "high-label") { + $high_label = $xval; + } elsif ($two eq "low") { + $low = $xval; + } elsif ($two eq "high") { + $high = $xval; + } + } else { + $one = $xres; + if ($type eq "select") { + push @selects, $xval; + } + } + } + } + + # add setting values based on the setting type (boolean, number, select) + if ($type eq "boolean") { + $body = $body . " \n" . + " \"True\"\n" . + " \"False\"\n" . + " \n" . + " \n" . + " \@string/t\n" . + " \@string/f\n" . + " \n"; + } elsif ($type eq "number") { + $body = $body . " \n" . + " \"" . $low_label . "\"\n" . + " \"" . $high_label . "\"\n" . + " \n" . + " \n" . + " \"" . $low . "\"\n" . + " \"" . $high . "\"\n" . + " \n"; + } elsif ($type eq "select") { + $body = $body . " \n"; + + foreach my $item (@selects) { + $body = $body . " \"" . $item . "\"\n" ; + } + + $body = $body . " \n" . + " \n"; + + foreach my $item (@selects) { + $body = $body . " \"" . $item . "\"\n" ; + } + + $body = $body . " \n"; + } + + @selects=(); + } + + $body = ($body . + "\n"); + + open (my $in, '>', $file) || error ("$file: $!"); + print $in $body; + close $in; + +} + + +sub old_settings_string_arrays(@) { + + my (@old_settings_file) = @_; + + my $body = ''; + my $current_string_array=''; + + + foreach my $claim (@old_settings_file) { + my ($res, $compare, $xval) = ($claim =~ m/^(.*) (=) (.*)$/s); + error ("unparsable xml claim: $_") unless $compare; + + if ($current_string_array ne $res) { + if (length($current_string_array) > 0) { + $body = $body . " \n"; + } + + $current_string_array = $res; + $body = $body . " \n"; + } + + $body = $body . " " . $xval . "\n"; + } + + if ($#old_settings_file > -1) { + $body = $body . " \n"; + } + + + return $body; + +} + + +# TODO: This adds the proper parameters to settings such as hilbert's, but it +# does not remove the improper parameters from hacks such as Hilbert yet. +# +sub get_settings($$\@) { + my $saver = $_[0]; + my $switchmap = $_[1]; + my @xml_opts = @{$_[2]}; + + my @keys = keys % { $switchmap}; + + my $res_seen = 0; + my $val_seen = 0; + my @also; + foreach my $sgkey (@keys) { + my ($k, $v) = ($switchmap->{$sgkey} =~ m/^(.*): (.*)$/); + + if ($v ne '%') { + foreach my $claim (@xml_opts) { + my ($res, $compare, $val) = ($claim =~ m/^(.*) (=|!=) (.*)$/s); + if ($res eq $k && $val eq $v) { + $val_seen = $val_seen + 1; + } + elsif ($res eq $k) { + $res_seen = $res_seen + 1; + } + } + + if ($val_seen eq 0 && $res_seen > 0) { + my $so = "$k != $v"; + push @also, $so; + } + + $val_seen = 0; + $res_seen = 0; + } + } + + my @all = (@xml_opts, @also); + return @all; + +} + + +sub make_strings_xml($\@\@) { + + my $saver = $_[0]; + my @xml_opts = @{$_[1]}; + my @strings_xml_opts = @{$_[2]}; + + my $saver_name = $saver . "_name"; + my $hack = ucfirst($saver); + my $file = "project/xscreensaver/res/values/strings.xml"; + my (%saver_keys) = get_keys_and_values($saver, @xml_opts); + + my $body = ("\n" . + "\n" . + " Hello World!\n" . + " Xscreensaver\n" . + " A live wallpaper\n\n" . + " Xscreensaver\n" . + " jwz and helpers\n" . + " True\n" . + " False\n"); + + foreach my $claim (@strings_xml_opts) { + my ($res, $compare, $xval) = ($claim =~ m/^(.*) (=|!=) (.*)$/s); + error ("$saver: unparsable xml claim: $_") unless $compare; + if ($res eq 'hello' || + $res eq 'service_label' || + $res eq 'description' || + $res eq 'app_name' || + $res eq 'author' || + $res eq 't' || + $res eq 'f') { + } + elsif ($res eq $saver_name) { + error ("$saver: $saver already in $file"); + } + else { + $body = ($body . + " " . $xval . "\n"); + } + } + + $body = ($body . + " " . $hack . + "\n" . + " Settings\n" . + " " . $hack . + + "\n"); + + my @keyarray = keys %saver_keys; + + foreach my $sgkey (@keyarray) { + + my $type = get_type($sgkey, @xml_opts); + + if ($type eq "number") { + + my ($low, $high, $default) = get_low_high_def($sgkey, @xml_opts); + my $float = ($default - $low) / ($high - $low); + + $body = ($body . " " . "Set " . $sgkey . "\n" . + " " . "Choose " . $sgkey . "\n" . + " " . $low . "\n" . + " " . $high . "\n" . + " " . $saver_keys{$sgkey} . "\n"); + } + else { + + $body = ($body . " " . "Set " . $sgkey . "\n" . + " " . "Choose " . $sgkey . "\n" . + " " . $saver_keys{$sgkey} . "\n"); + } + } + + $body = ($body . + "\n"); + + open (my $in, '>', $file) || error ("$file: $!"); + print $in $body; + close $in; +} + + +sub make_hack_xml($) { + my ($saver) = @_; + my $hack = ucfirst($saver); + + my $dir = "project/xscreensaver/res/xml/"; + my $file = $dir . $saver . ".xml"; + my $in; + + if (-d $dir) { + open ($in, '>', $file) || error ("$file: $!"); + } + else { + mkdir $dir; + open ($in, '>', $file) || error ("$file: $!"); + } + + my $body = ("\n" . + "\n"); + + print $in $body; + close $in; +} + + +sub make_glue($$) { + my ($saver, @glue_hacks) = @_; + my (@hacks) = @glue_hacks; + + push @hacks, $saver; + + my $dir = "gen/"; + my $file = $dir . "glue.c"; + my $in; + + if (-d $dir) { + open ($in, '>', $file) || error ("$file: $!"); + } + else { + mkdir $dir; + open ($in, '>', $file) || error ("$file: $!"); + } + + + my $body = ("#include \n" . + "#include \n" . + "#include \n" . + "#include \n" . + "#include \n" . + "#include \n" . + "#include \n\n" . + "#include \"screenhackI.h\"\n" . + "#include \"jwzglesI.h\"\n" . + "#include \"version.h\"\n\n" . + "void drawXscreensaver();\n\n" . + "int sWindowWidth = 0;\n" . + "int sWindowHeight = 0;\n" . + "int initTried = 0;\n" . + "int renderTried = 0;\n" . + "int resetTried = 0;\n" . + "int currentFlip = 0;\n\n" . + "pthread_mutex_t mutg = PTHREAD_MUTEX_INITIALIZER;\n\n" . + "extern struct xscreensaver_function_table " . + "*xscreensaver_function_table;\n\n" . + "// if adding a table here, increase the magic number\n" . + "struct xscreensaver_function_table\n"); + + for my $i (0 .. $#hacks) { + $body = $body . " *" . $hacks[$i] ; + $body = $body . "_xscreensaver_function_table"; + if ($i eq $#hacks ) { + $body = $body . ";\n\n"; + } + else { + $body = $body . ",\n"; + } + } + + $body = $body . "struct running_hack {\n" . + " struct xscreensaver_function_table *xsft;\n" . + " Display *dpy;\n" . + " Window window;\n" . + " void *closure;\n" . + "};\n\n" . + "const char *progname;\n" . + "const char *progclass;\n\n" . + "struct running_hack rh["; + $body = $body . scalar(@hacks); + $body = $body . "];\n" . + "// ^ magic number of hacks - TODO: remove magic number\n\n\n" . + "int chosen;\n" . + "JNIEXPORT void JNICALL\n" . + " Java_org_jwz_xscreensaver_CallNative_nativeInit\n" . + " (JNIEnv * env);\n" . + "JNIEXPORT void JNICALL\n" . + " Java_org_jwz_xscreensaver_CallNative_nativeResize\n" . + " (JNIEnv * env, jobject thiz, jint w, jint h);\n" . + "JNIEXPORT void JNICALL\n" . + " Java_org_jwz_xscreensaver_CallNative_nativeRender\n" . + " (JNIEnv * env);\n" . + "JNIEXPORT void JNICALL\n" . + " Java_org_jwz_xscreensaver_CallNative_nativeDone\n" . + " (JNIEnv * env);\n"; + + foreach my $bighack (@hacks) { + my $bh = ucfirst($bighack); + $body = $body . "JNIEXPORT void JNICALL\n" . + " Java_org_jwz_xscreensaver_gen_" . $bh . + "Wallpaper_allnativeSettings\n" . + " (JNIEnv * env, jobject thiz, jstring jhack," . + " jstring hackPref,\n" . + " jint draw, jstring key);\n"; + + } + + $body = $body . "\n\n\nvoid doinit()\n{\n\n" ; + + for my $j (0 .. $#hacks) { + if ($j == 0) { + $body = $body . " if (chosen == " . $j . ") {\n" ; + } elsif ($j == $#hacks) { + $body = $body . " } else {\n" ; + } else { + $body = $body . " } else if (chosen == " . $j . ") {\n"; + } + $body = $body . " progname = \"" . $hacks[$j] . "\";\n" . + " rh[chosen].xsft = &" . $hacks[$j] . + "_xscreensaver_function_table;\n" ; + } + + $body = $body . " }\n\n" ; + $body = $body . " rh[chosen].dpy = jwxyz_make_display(0, 0);\n" . + " rh[chosen].window = XRootWindow(rh[chosen].dpy, 0);\n" . + "// TODO: Zero looks right, " . + "but double-check that is the right number\n\n" . + " progclass = rh[chosen].xsft->progclass;\n\n" . + " if (rh[chosen].xsft->setup_cb)\n" . + " rh[chosen].xsft->setup_cb(rh[chosen].xsft,\n" . + " rh[chosen].xsft->setup_arg);\n\n" . + " if (resetTried < 1) {\n" . + " resetTried++;\n" . + " jwzgles_reset();\n" . + " }\n\n" . + " void *(*init_cb) (Display *, Window, void *) =\n" . + " (void *(*)(Display *, Window, void *)) " . + "rh[chosen].xsft->init_cb;\n\n" . + " rh[chosen].closure =\n" . + " init_cb(rh[chosen].dpy, rh[chosen].window,\n" . + " rh[chosen].xsft->setup_arg);\n\n}\n\n\n" . + "void drawXscreensaver()\n{\n" . + " pthread_mutex_lock(&mutg);\n" . + " rh[chosen].xsft->draw_cb(rh[chosen].dpy, " . + "rh[chosen].window,\n" . + " rh[chosen].closure);\n" . + " pthread_mutex_unlock(&mutg);\n\n}\n\n\n" . + "JNIEXPORT void JNICALL\n" . + " Java_org_jwz_xscreensaver_CallNative_nativeInit\n" . + " (JNIEnv * env) {\n\n" . + " if (initTried < 1) {\n" . + " initTried++;\n" . + " } else {\n" . + " if (!rh[chosen].dpy) {\n" . + " doinit();\n" . + " } else {\n" . + " rh[chosen].xsft->free_cb(rh[chosen].dpy, " . + "rh[chosen].window,\n" . + " rh[chosen].closure);\n" . + " jwxyz_free_display(rh[chosen].dpy);\n" . + " rh[chosen].dpy = NULL;\n" . + " rh[chosen].window = NULL;\n" . + " if (!rh[chosen].dpy) {\n" . + " doinit();\n" . + " }\n\n }\n" . + " }\n\n}\n\n\n" . + "JNIEXPORT void JNICALL\n" . + " Java_org_jwz_xscreensaver_CallNative_nativeResize\n" . + " (JNIEnv * env, jobject thiz, jint w, jint h) {\n\n" . + " sWindowWidth = w;\n" . + " sWindowHeight = h;\n\n" . + " if (!rh[chosen].dpy) {\n" . + " doinit();\n" . + " }\n\n" . + " jwxyz_window_resized(rh[chosen].dpy, " . + "rh[chosen].window, 0, 0, w, h, 0);\n\n" . + " rh[chosen].xsft->reshape_cb(rh[chosen].dpy, " . + "rh[chosen].window,\n" . + " rh[chosen].closure, w, h);\n}\n\n" . + "JNIEXPORT void JNICALL\n" . + " Java_org_jwz_xscreensaver_CallNative_nativeRender\n" . + " (JNIEnv * env) {\n" . + " if (renderTried < 1) {\n" . + " renderTried++;\n" . + " } else {\n" . + " drawXscreensaver();\n" . + " }\n}\n\n" . + "// TODO: Check Java side is calling this properly\n" . + "JNIEXPORT void JNICALL\n" . + " Java_org_jwz_xscreensaver_CallNative_nativeDone\n" . + " (JNIEnv * env) {\n\n" . + " rh[chosen].xsft->free_cb(rh[chosen].dpy, " . + "rh[chosen].window,\n" . + " rh[chosen].closure);\n" . + " jwxyz_free_display(rh[chosen].dpy);\n" . + " rh[chosen].dpy = NULL;\n" . + " rh[chosen].window = NULL;\n\n}\n\n" ; + + for my $j (0 .. $#hacks) { + my $jhack = ucfirst($hacks[$j]); + + $body = $body . "JNIEXPORT void JNICALL\n" . + " Java_org_jwz_xscreensaver_gen_" . $jhack . + "Wallpaper_allnativeSettings\n" . + " (JNIEnv * env, jobject thiz, jstring jhack," . + " jstring hackPref,\n" . + " jint draw, jstring key) {\n\n" . + " const char *chack = " . + "(*env)->GetStringUTFChars(env, hackPref, NULL);\n" . + " char *hck = (char *) chack;\n" . + " const char *kchack = " . + "(*env)->GetStringUTFChars(env, key, NULL);\n" . + " char *khck = (char *) kchack;\n\n" . + " if (draw == 2) {\n" . + " set" . $jhack . "Settings(hck, khck);\n" . + " }\n\n" . + " chosen = " . $j . ";\n}\n\n"; + + } + + + print $in $body; + close $in; +} + +sub make_wallpaper($$) { + my ($saver, @xml_opts) = @_; + my $hack = ucfirst($saver); + my $file = "project/xscreensaver/src/org/jwz/xscreensaver/gen/"; + $file = $file . $hack . "Wallpaper.java"; + my (%saver_keys) = get_keys_and_values($saver, @xml_opts); + + open (my $in, '>', $file) || error ("$file: $!"); + + my $body = ("package org.jwz.xscreensaver.gen;\n" . + "import javax.microedition.khronos.egl.EGLConfig;\n" . + "import javax.microedition.khronos.opengles.GL10;\n" . + "import net.rbgrn.android.glwallpaperservice.*;\n" . + "import android.opengl.GLU;\n" . + "import android.content.Context;\n" . + "import android.content.SharedPreferences;\n" . + "import org.jwz.xscreensaver.*;\n" . + "public class " . $hack . + "Wallpaper extends ARenderer {\n" . + " private static native void allnativeSettings(" . + "String hack, String hackPref, int draw, String key);\n" . + " public static final String SHARED_PREFS_NAME=\"" . $saver . + "settings\";\n" . + " CallNative cn;\n" . + " public void onSurfaceCreated(" . + "GL10 gl, EGLConfig config) {\n" . + " super.onSurfaceCreated(gl, config);\n" . + " cn = new CallNative();\n" . + " NonSurfaceCreated();\n" . + " }\n" . + " public void onDrawFrame(GL10 gl) {\n" . + " super.onDrawFrame(gl);\n" . + " allnativeSettings(\"bogus\", \"bogus\", 1, \"bogus\");\n" . + " NonDrawFrame();\n" . + " }\n" . + " void NonDrawFrame() {\n" . + " cn.nativeRender();\n" . + " }\n" . + " void doSP(SharedPreferences sspp) {\n" . + + + " String hack = \"" . $saver . "\";\n"); + + my @keyarray = keys %saver_keys; + foreach my $sgkey (@keyarray) { + + my $type = get_type($sgkey, @xml_opts); + + if ($type eq "number") { + + my ($low, $high, $default) = get_low_high_def($sgkey, @xml_opts); + my $float = ($default - $low) / ($high - $low); + + $body = $body . + " String " . $sgkey . + "_low = sspp.getString(\"" . $saver . + "_" . $sgkey . "_low\", \"". $low . "\");\n" . + " String " . $sgkey . + "_high = sspp.getString(\"" . $saver . + "_" . $sgkey . "_high\", \"" . $high . "\");\n" . + " Float " . $sgkey . "PrefF = sspp.getFloat(\"" . $saver . + "_" . $sgkey . "\", " . $float . "f);\n" . + " String " . $sgkey . "Pref = getNumber(" . $sgkey . + "_low, " . $sgkey . "_high, " . $sgkey . "PrefF);\n" . + " allnativeSettings(hack, " . $sgkey . + "Pref, 2, \"" . $saver . "_" . $sgkey . "\");\n"; + } + elsif ($type eq "boolean") { + + $body = $body . " String " . $sgkey . + "Pref = sspp.getString(\"" . $saver . "_" . $sgkey . + "\", \"" . $saver_keys{$sgkey} . "\");\n" . + " allnativeSettings(hack, " . $sgkey . + "Pref, 2, \"" . $saver . "_" . $sgkey . "\");\n"; + + } + elsif ($type eq "select") { + + $body = $body . " String " . $sgkey . + "Pref = sspp.getString(\"" . $saver . "_" . $sgkey . + "\", \"" . $saver_keys{$sgkey} . "\");\n" . + " allnativeSettings(hack, " . $sgkey . + "Pref, 2, \"" . $saver . "_" . $sgkey . "\");\n"; + + } + else { + print STDERR "$progname: type $type not yet implemented \n"; + } + + } + + $body = $body . " }\n" . + " String getNumber(String low, String high, Float pref) {\n" . + " Float lowF = Float.parseFloat(low);\n" . + " Float lowH = Float.parseFloat(high);\n" . + " Float diff = lowH - lowF;\n" . + " Float mult = pref * diff;\n" . + " Float add = mult + lowF;\n" . + " int i;\n" . + " String s;\n" . + " if (diff > 2.0) {\n" . + " i = (Integer) Math.round(add);\n" . + " s = Integer.toString(i);\n}\n" . + " else {\n" . + " s = Float.toString(add);\n}\n" . + " return s;\n" . + " }\n\n" . + " static\n" . + " {\n" . + " System.loadLibrary (\"xscreensaver\");\n" . + " }\n" . + "}\n"; + + print $in $body; + close $in; + +} + +sub get_keys_and_values($$) { + + my ($saver, @xml_opts) = @_; + my (%saver_keys) ; + + foreach my $claim (@xml_opts) { + my ($res, $compare, $xval) = ($claim =~ m/^(.*) (=|!=) (.*)$/s); + error ("$saver: unparsable xml claim: $_") unless $compare; + + if ($saver eq "sproingies") { + if ($res eq "count") { + $saver_keys{$res} = $xval; + } + elsif ($res eq "wireframe") { + #$saver_keys{$res} = $xval; + $saver_keys{$res} = "False"; + } + + } + elsif ($saver eq "hilbert") { + if ($res eq "mode") { + $saver_keys{$res} = $xval; + } + } + elsif ($saver eq "stonerview") { + if ($res eq "transparent") { + #$saver_keys{$res} = $xval; + $saver_keys{$res} = "False"; + } + } + elsif ($saver eq "superquadrics") { + # spinspeed/speed. float/int + if ($res eq "spinspeed") { + $saver_keys{$res} = $xval; + } + } + elsif ($saver eq "bouncingcow") { + if ($res eq "count") { + $saver_keys{$res} = "3"; + } + elsif ($res eq "speed") { + $saver_keys{$res} = "0.1"; + } + } + elsif ($saver eq "unknownpleasures") { + if ($res eq "wireframe") { + $saver_keys{$res} = "True"; + } + elsif ($res eq "speed") { + $saver_keys{$res} = "3.0"; + } + #elsif ($res eq "count") { + # $saver_keys{$res} = $xval; + #} + #elsif ($res eq "resolution") { + # $saver_keys{$res} = $xval; + #} + #elsif ($res eq "ortho") { + # $saver_keys{$res} = $xval; + #} + + } + elsif ($saver eq "hypertorus") { + if ($res =~ /^(displayMode|appearance|colors|projection3d|projection4d|speedwx|speedwy|speedwz|speedxy|speedxz|speedyz)$/) { + $saver_keys{$res} = $xval; + } + } + elsif ($saver eq "glhanoi") { + if ($res =~ /^(light|fog|trails|poles|speed)$/) { + # TODO: check in xval for true/false should be higher up in logic + if ($xval =~ /^(true|false)$/) { + $saver_keys{$res} = ucfirst($xval); + } + else { + $saver_keys{$res} = $xval; + } + } + } + else { + error ("$saver: not yet supported for Android"); + } + + } + + return (%saver_keys); +} + + +sub make_service($) { + my ($saver) = @_; + my $hack = ucfirst($saver); + my $file = "project/xscreensaver/src/org/jwz/xscreensaver/gen/"; + $file = $file . $hack . "Service.java"; + open (my $in, '>', $file) || error ("$file: $!"); + + my $body = ("package org.jwz.xscreensaver.gen;\n\n" . + "import net.rbgrn.android.glwallpaperservice.*;\n" . + "import android.content.SharedPreferences;\n" . + "import org.jwz.xscreensaver.*;\n\n" . + "// Original code provided by Robert Green\n" . + "// http://www.rbgrn.net/content/354-glsurfaceview-adapted-3d-live-wallpapers\n" . + "public class " . $hack . + "Service extends GLWallpaperService {\n\n" . + " SharedPreferences sp;\n\n" . + " public " . $hack . + "Service() {\n" . + " super();\n" . + " }\n\n" . + " \@Override\n" . + " public void onCreate() {\n" . + " sp = ((XscreensaverApp)getApplication())." . + "getThePrefs($hack" . "Wallpaper.SHARED_PREFS_NAME);\n" . + " }\n\n" . + " public Engine onCreateEngine() {\n" . + " MyEngine engine = new MyEngine();\n" . + " return engine;\n" . + " }\n\n" . + " class MyEngine extends GLEngine {\n" . + " " . $hack . + "Wallpaper renderer;\n" . + " public MyEngine() {\n" . + " super();\n" . + " // handle prefs, other initialization\n" . + " renderer = new " . $hack . + "Wallpaper();\n" . + " setEGLConfigChooser(8, 8, 8, 8, 16, 0);\n" . + " setRenderer(renderer);\n" . + " setRenderMode(RENDERMODE_CONTINUOUSLY);\n" . + " }\n\n" . + " public void onDestroy() {\n" . + " super.onDestroy();\n" . + " if (renderer != null) {\n" . + " renderer.release(); " . + "// assuming yours has this method - it should!\n" . + " }\n" . + " renderer = null;\n" . + " }\n\n" . + " \@Override\n" . + " public void onVisibilityChanged(boolean visible) {\n" . + " super.onVisibilityChanged(visible);\n" . + " if (visible) {\n" . + " renderer.doSP(sp);\n" . + " }\n" . + " }\n\n" . + " }\n" . + " static\n" . + " {\n" . + " System.loadLibrary (\"xscreensaver\");\n" . + " }\n\n\n" . + "}\n"); + + print $in $body; + close $in; + +} + +sub make_settings($) { + my ($saver) = @_; + my $hack = ucfirst($saver); + my $dir = "project/xscreensaver/src/org/jwz/xscreensaver/gen/"; + my $file = $dir . $hack . "Settings.java"; + my $in; + + if (-d $dir) { + open ($in, '>', $file) || error ("$file: $!"); + } + else { + mkdir $dir; + open ($in, '>', $file) || error ("$file: $!"); + } + + my $body = ("/*\n" . + " * Copyright (C) 2009 Google Inc.\n" . + " *\n" . + " * Licensed under the Apache License, Version 2.0 " . + "(the \"License\"); you may not\n" . + " * use this file except in compliance with the License. " . + "You may obtain a copy of\n" . + " * the License at\n" . + " *\n" . + " * http://www.apache.org/licenses/LICENSE-2.0\n" . + " *\n" . + " * Unless required by applicable law or agreed to in writing," . + " software\n" . + " * distributed under the License is distributed" . + " on an \"AS IS\" BASIS, WITHOUT\n" . + " * WARRANTIES OR CONDITIONS OF ANY KIND," . + " either express or implied. See the\n" . + " * License for the specific language governing" . + "permissions and limitations under\n" . + " * the License.\n" . + " */\n\n" . + "package org.jwz.xscreensaver.gen;\n\n" . + "import org.jwz.xscreensaver.R;\n\n" . + "import android.content.SharedPreferences;\n" . + "import android.os.Bundle;\n" . + "import android.preference.PreferenceActivity;\n\n" . + "public class " . $hack . + "Settings extends PreferenceActivity\n" . + " implements " . + "SharedPreferences.OnSharedPreferenceChangeListener {\n\n" . + " \@Override\n" . + " protected void onCreate(Bundle icicle) {\n" . + " super.onCreate(icicle);\n" . + " getPreferenceManager().setSharedPreferencesName(\n" . + " " . $hack . + "Wallpaper.SHARED_PREFS_NAME);\n" . + " addPreferencesFromResource(R.xml." . $saver . + "_settings);\n" . + " getPreferenceManager().getSharedPreferences()." . + "registerOnSharedPreferenceChangeListener(\n" . + " this);\n" . + " }\n\n" . + " \@Override\n" . + " protected void onResume() {\n" . + " super.onResume();\n" . + " }\n\n" . + " \@Override\n" . + " protected void onDestroy() {\n" . + " getPreferenceManager().getSharedPreferences()." . + "unregisterOnSharedPreferenceChangeListener(\n" . + " this);\n" . + " super.onDestroy();\n" . + " }\n\n" . + " public void onSharedPreferenceChanged(" . + "SharedPreferences sharedPreferences,\n" . + " String key) {\n" . + " }\n" . + "}\n"); + + print $in $body; + close $in; +} + + +sub error($) { + my ($err) = @_; + print STDERR "$progname: $err\n"; + exit 1; +} + +sub usage() { + print STDERR "usage: $progname [--verbose] files ...\n"; + exit 1; +} + +sub main() { + my @files = (); + while ($#ARGV >= 0) { + $_ = shift @ARGV; + if (m/^--?verbose$/) { $verbose++; } + elsif (m/^-v+$/) { $verbose += length($_)-1; } + elsif (m/^-./) { usage; } + else { push @files, $_; } +# else { usage; } + } + + usage unless ($#files >= 0); + my $failures = 0; + foreach (@files) { $failures += parse_then_make($_); } + exit ($failures); +} + +main(); diff -Nru xscreensaver-5.30/android/glue.c xscreensaver-5.34/android/glue.c --- xscreensaver-5.30/android/glue.c 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/glue.c 2015-06-25 14:52:41.000000000 -0400 @@ -0,0 +1,306 @@ +#include +#include +#include +#include +#include +#include +#include + +#include "screenhackI.h" +#include "jwzglesI.h" +#include "version.h" + +void drawXscreensaver(); + +int sWindowWidth = 0; +int sWindowHeight = 0; +int initTried = 0; +int renderTried = 0; +int resetTried = 0; +int currentFlip = 0; + +pthread_mutex_t mutg = PTHREAD_MUTEX_INITIALIZER; + +extern struct xscreensaver_function_table *xscreensaver_function_table; + +// if adding a table here, increase the magic number +struct xscreensaver_function_table +*hypertorus_xscreensaver_function_table, + *hilbert_xscreensaver_function_table, + *endgame_xscreensaver_function_table, + *stonerview_xscreensaver_function_table, + *sproingies_xscreensaver_function_table, + *blinkbox_xscreensaver_function_table, + *bouncingcow_xscreensaver_function_table, + *superquadrics_xscreensaver_function_table; + +struct running_hack { + struct xscreensaver_function_table *xsft; + Display *dpy; + Window window; + void *closure; +}; + +const char *progname; +const char *progclass; + +struct running_hack rh[8]; +// ^ magic number of hacks - TODO: remove magic number + + +int chosen; +// 0 superquadrics +// 1 stonerview +// 2 sproingies +// 3 hilbert + +JNIEXPORT void JNICALL + Java_org_jwz_xscreensaver_CallNative_nativeInit + (JNIEnv * env); +JNIEXPORT void JNICALL + Java_org_jwz_xscreensaver_CallNative_nativeResize + (JNIEnv * env, jobject thiz, jint w, jint h); +JNIEXPORT void JNICALL + Java_org_jwz_xscreensaver_CallNative_nativeRender + (JNIEnv * env); +JNIEXPORT void JNICALL + Java_org_jwz_xscreensaver_CallNative_nativeDone + (JNIEnv * env); +JNIEXPORT void JNICALL + Java_org_jwz_xscreensaver_gen_SproingiesWallpaper_allnativeSettings + (JNIEnv * env, jobject thiz, jstring jhack, jstring hackPref, + jint draw, jstring key); +JNIEXPORT void JNICALL + Java_org_jwz_xscreensaver_gen_SuperquadricsWallpaper_allnativeSettings + (JNIEnv * env, jobject thiz, jstring jhack, jstring hackPref, + jint draw, jstring key); +JNIEXPORT void JNICALL + Java_org_jwz_xscreensaver_gen_HilbertWallpaper_allnativeSettings + (JNIEnv * env, jobject thiz, jstring jhack, jstring hackPref, + jint draw, jstring key); +JNIEXPORT void JNICALL + Java_org_jwz_xscreensaver_gen_StonerviewWallpaper_allnativeSettings + (JNIEnv * env, jobject thiz, jstring jhack, jstring hackPref, + jint draw, jstring key); +JNIEXPORT void JNICALL + Java_org_jwz_xscreensaver_gen_BouncingcowWallpaper_allnativeSettings + (JNIEnv * env, jobject thiz, jstring jhack, jstring hackPref, + jint draw, jstring key); + + + +void doinit() +{ + + if (chosen == 0) { + progname = "superquadrics"; + rh[chosen].xsft = &superquadrics_xscreensaver_function_table; + } else if (chosen == 1) { + progname = "stonerview"; + rh[chosen].xsft = &stonerview_xscreensaver_function_table; + + } else if (chosen == 2) { + progname = "sproingies"; + rh[chosen].xsft = &sproingies_xscreensaver_function_table; + + } else if (chosen == 3) { + progname = "hilbert"; + rh[chosen].xsft = &hilbert_xscreensaver_function_table; + } else if (chosen == 4) { + progname = "bouncingcow"; + rh[chosen].xsft = &bouncingcow_xscreensaver_function_table; + } else { + progname = "sproingies"; + rh[chosen].xsft = &sproingies_xscreensaver_function_table; + } + + rh[chosen].dpy = jwxyz_make_display(0, 0); + rh[chosen].window = XRootWindow(rh[chosen].dpy, 0); +// TODO: Zero looks right, but double-check that is the right number + + progclass = rh[chosen].xsft->progclass; + + if (rh[chosen].xsft->setup_cb) + rh[chosen].xsft->setup_cb(rh[chosen].xsft, + rh[chosen].xsft->setup_arg); + + if (resetTried < 1) { + resetTried++; + jwzgles_reset(); + } + + void *(*init_cb) (Display *, Window, void *) = + (void *(*)(Display *, Window, void *)) rh[chosen].xsft->init_cb; + + rh[chosen].closure = + init_cb(rh[chosen].dpy, rh[chosen].window, + rh[chosen].xsft->setup_arg); + +} + + + +void drawXscreensaver() +{ + pthread_mutex_lock(&mutg); + rh[chosen].xsft->draw_cb(rh[chosen].dpy, rh[chosen].window, + rh[chosen].closure); + pthread_mutex_unlock(&mutg); + +} + + +JNIEXPORT void JNICALL + Java_org_jwz_xscreensaver_CallNative_nativeInit + (JNIEnv * env) { + + if (initTried < 1) { + initTried++; + } else { + if (!rh[chosen].dpy) { + doinit(); + } else { + rh[chosen].xsft->free_cb(rh[chosen].dpy, rh[chosen].window, + rh[chosen].closure); + jwxyz_free_display(rh[chosen].dpy); + rh[chosen].dpy = NULL; + rh[chosen].window = NULL; + if (!rh[chosen].dpy) { + doinit(); + } + + } + } + +} + + +JNIEXPORT void JNICALL + Java_org_jwz_xscreensaver_CallNative_nativeResize + (JNIEnv * env, jobject thiz, jint w, jint h) { + + sWindowWidth = w; + sWindowHeight = h; + + if (!rh[chosen].dpy) { + doinit(); + } + + jwxyz_window_resized(rh[chosen].dpy, rh[chosen].window, 0, 0, w, h, 0); + + rh[chosen].xsft->reshape_cb(rh[chosen].dpy, rh[chosen].window, + rh[chosen].closure, w, h); +} + +JNIEXPORT void JNICALL + Java_org_jwz_xscreensaver_CallNative_nativeRender + (JNIEnv * env) { + if (renderTried < 1) { + renderTried++; + } else { + drawXscreensaver(); + } +} + +// TODO: Check Java side is calling this properly +JNIEXPORT void JNICALL + Java_org_jwz_xscreensaver_CallNative_nativeDone + (JNIEnv * env) { + + rh[chosen].xsft->free_cb(rh[chosen].dpy, rh[chosen].window, + rh[chosen].closure); + jwxyz_free_display(rh[chosen].dpy); + rh[chosen].dpy = NULL; + rh[chosen].window = NULL; + +} + +JNIEXPORT void JNICALL + Java_org_jwz_xscreensaver_gen_HilbertWallpaper_allnativeSettings + (JNIEnv * env, jobject thiz, jstring jhack, jstring hackPref, + jint draw, jstring key) { + + + const char *chack = (*env)->GetStringUTFChars(env, hackPref, NULL); + char *hck = (char *) chack; + const char *kchack = (*env)->GetStringUTFChars(env, key, NULL); + char *khck = (char *) kchack; + + if (draw == 2) { + setHilbertSettings(hck, khck); + } + + chosen = 3; +} + +JNIEXPORT void JNICALL + Java_org_jwz_xscreensaver_gen_SuperquadricsWallpaper_allnativeSettings + (JNIEnv * env, jobject thiz, jstring jhack, jstring hackPref, + jint draw, jstring key) { + + const char *chack = (*env)->GetStringUTFChars(env, hackPref, NULL); + char *hck = (char *) chack; + + const char *kchack = (*env)->GetStringUTFChars(env, key, NULL); + char *khck = (char *) kchack; + + if (draw == 2) { + setSuperquadricsSettings(hck, khck); + } + + chosen = 0; +} + + +JNIEXPORT void JNICALL + Java_org_jwz_xscreensaver_gen_SproingiesWallpaper_allnativeSettings + (JNIEnv * env, jobject thiz, jstring jhack, jstring hackPref, + jint draw, jstring key) { + + const char *chack = (*env)->GetStringUTFChars(env, hackPref, NULL); + char *hck = (char *) chack; + + const char *kchack = (*env)->GetStringUTFChars(env, key, NULL); + char *khck = (char *) kchack; + + if (draw == 2) { + setSproingiesSettings(hck, khck); + } + + chosen = 2; +} + +JNIEXPORT void JNICALL + Java_org_jwz_xscreensaver_gen_StonerviewWallpaper_allnativeSettings + (JNIEnv * env, jobject thiz, jstring jhack, jstring hackPref, + jint draw, jstring key) { + + const char *chack = (*env)->GetStringUTFChars(env, hackPref, NULL); + char *hck = (char *) chack; + const char *kchack = (*env)->GetStringUTFChars(env, key, NULL); + char *khck = (char *) kchack; + + if (draw == 2) { + setStonerviewSettings(hck, khck); + } + + chosen = 1; +} + +JNIEXPORT void JNICALL + Java_org_jwz_xscreensaver_gen_BouncingcowWallpaper_allnativeSettings + (JNIEnv * env, jobject thiz, jstring jhack, jstring hackPref, + jint draw, jstring key) { + + const char *chack = (*env)->GetStringUTFChars(env, hackPref, NULL); + char *hck = (char *) chack; + const char *kchack = (*env)->GetStringUTFChars(env, key, NULL); + char *khck = (char *) kchack; + + if (draw == 2) { + setBouncingcowSettings(hck, khck); + } + + chosen = 4; +} + diff -Nru xscreensaver-5.30/android/jwxyz.c xscreensaver-5.34/android/jwxyz.c --- xscreensaver-5.30/android/jwxyz.c 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/jwxyz.c 2015-08-28 21:57:21.000000000 -0400 @@ -0,0 +1,467 @@ +/* xscreensaver, Copyright (c) 1991-2015 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 + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation. No representations are made about the suitability of this + * software for any purpose. It is provided "as is" without express or + * implied warranty. + */ + +/* JWXYZ Is Not Xlib. + + But it's a bunch of function definitions that bear some resemblance to + Xlib and that do things that bear some resemblance to the + things that Xlib might have done. + */ + +#include +#include +#include +#include + +#include "jwxyz.h" +#include "jwxyz-timers.h" +#include "yarandom.h" +#include "screenhackI.h" + +typedef signed char BOOL; +#define YES (BOOL)1 +#define NO (BOOL)0 + +struct CGPoint { + float x; + float y; +}; +typedef struct CGPoint CGPoint; + +struct CGSize { + float width; + float height; +}; +typedef struct CGSize CGSize; + +struct CGRect { + CGPoint origin; + CGSize size; +}; +typedef struct CGRect CGRect; + +struct jwxyz_Drawable { + enum { WINDOW, PIXMAP } type; + CGRect frame; + union { + struct { + unsigned long background; + int last_mouse_x, last_mouse_y; + } window; + struct { + int depth; + void *cgc_buffer; + } pixmap; + }; +}; + +struct jwxyz_Display { + Window main_window; + Screen *screen; + int screen_count; + struct jwxyz_sources_data *timers_data; +}; + +struct jwxyz_Screen { + Display *dpy; + Visual *visual; + unsigned long black, white; + int screen_number; +}; + + +Screen * +XDefaultScreenOfDisplay (Display *dpy) +{ + return dpy->screen; +} + +unsigned long +XBlackPixelOfScreen(Screen *screen) +{ + return screen->black; +} + +unsigned long +XWhitePixelOfScreen(Screen *screen) +{ + return screen->white; +} + + +static void draw_rect(Display *, Drawable, GC, + int x, int y, unsigned int width, + unsigned int height, BOOL foreground_p, BOOL fill_p); + +Status +XParseColor(Display * dpy, Colormap cmap, const char *spec, XColor * ret) +{ + unsigned char r = 0, g = 0, b = 0; + if (*spec == '#' && strlen(spec) == 7) { + static unsigned const char hex[] = { // yeah yeah, shoot me. + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 0, + 0, 10, 11, 12, 13, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 10, 11, 12, 13, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + }; + r = (hex[spec[1]] << 4) | hex[spec[2]]; + g = (hex[spec[3]] << 4) | hex[spec[4]]; + b = (hex[spec[5]] << 4) | hex[spec[6]]; + } else if (!strcasecmp(spec, "black")) { +// r = g = b = 0; + } else if (!strcasecmp(spec, "white")) { + r = g = b = 255; + } else if (!strcasecmp(spec, "red")) { + r = 255; + } else if (!strcasecmp(spec, "green")) { + g = 255; + } else if (!strcasecmp(spec, "blue")) { + b = 255; + } else if (!strcasecmp(spec, "cyan")) { + g = b = 255; + } else if (!strcasecmp(spec, "magenta")) { + r = b = 255; + } else if (!strcasecmp(spec, "yellow")) { + r = g = 255; + } else { + return 0; + } + + ret->red = (r << 8) | r; + ret->green = (g << 8) | g; + ret->blue = (b << 8) | b; + ret->flags = DoRed | DoGreen | DoBlue; + return 1; +} + +Status XAllocColor(Display * dpy, Colormap cmap, XColor * color) +{ + // store 32 bit ARGB in the pixel field. + // (The uint32_t is so that 0xFF000000 doesn't become 0xFFFFFFFFFF000000) + color->pixel = (uint32_t) + ((0xFF << 24) | + (((color->red >> 8) & 0xFF) << 16) | + (((color->green >> 8) & 0xFF) << 8) | + (((color->blue >> 8) & 0xFF))); + return 1; +} + +// needs to be implemented in Android... +int +XFillRectangle(Display * dpy, Drawable d, GC gc, int x, int y, + unsigned int width, unsigned int height) +{ + return 0; +} + +// needs to be implemented in Android... +int +XDrawString(Display * dpy, Drawable d, GC gc, int x, int y, + const char *str, int len) +{ + return 0; // try this for now... +} + + +// needs to be implemented in Android... +int XFreeGC(Display * dpy, GC gc) +{ + return 0; +} + + + +int XFreeFont(Display * dpy, XFontStruct * f) +{ + return 0; +} + +int XFreeFontInfo(char **names, XFontStruct * info, int n) +{ + int i; + if (names) { + for (i = 0; i < n; i++) + if (names[i]) + free(names[i]); + free(names); + } + if (info) { + for (i = 0; i < n; i++) + if (info[i].per_char) + free(info[i].per_char); + free(info); + } + return 0; +} + + +// needs to be implemented in Android... +int XUnloadFont(Display * dpy, Font fid) +{ + return 0; +} + + +// needs to be implemented in Android... +GC +XCreateGC(Display * dpy, Drawable d, unsigned long mask, XGCValues * xgcv) +{ +} + + +// needs to be implemented in Android... +XFontStruct *XLoadQueryFont(Display * dpy, const char *name) +{ +} + + +Status +XGetWindowAttributes(Display * dpy, Window w, XWindowAttributes * xgwa) +{ + +// Assert (w && w->type == WINDOW, "not a window"); + + memset(xgwa, 0, sizeof(*xgwa)); + xgwa->x = w->frame.origin.x; + xgwa->y = w->frame.origin.y; + xgwa->width = w->frame.size.width; + xgwa->height = w->frame.size.height; + xgwa->depth = 32; + xgwa->screen = dpy->screen; + xgwa->visual = dpy->screen->visual; + + return 0; +} + +// needs to be implemented in Android... +int XSetFont(Display * dpy, GC gc, Font fid) +{ + return 0; +} + + +// needs to be implemented in Android... +int XClearWindow(Display * dpy, Window win) +{ +} + +// declared in utils/visual.h +int has_writable_cells(Screen * s, Visual * v) +{ + return 0; +} + +Status +XAllocColorCells(Display * dpy, Colormap cmap, Bool contig, + unsigned long *pmret, unsigned int npl, + unsigned long *pxret, unsigned int npx) +{ + return 0; +} + +int XStoreColors(Display * dpy, Colormap cmap, XColor * colors, int n) +{ + //Assert(0, "XStoreColors called"); + return 0; +} + +int +XFreeColors(Display * dpy, Colormap cmap, unsigned long *px, int npixels, + unsigned long planes) +{ + return 0; +} + +int XFlush(Display * dpy) +{ + return 0; +} + +Display *XDisplayOfScreen(Screen * s) +{ + return s->dpy; +} + +// needs to be implemented in Android... +int +XLookupString(XKeyEvent * e, char *buf, int size, KeySym * k_ret, + XComposeStatus * xc) +{ + return 0; +} + +int XScreenNumberOfScreen(Screen * s) +{ + return s->screen_number; +} + +int jwxyz_ScreenCount(Display * dpy) +{ + return dpy->screen_count; +} + + +/* +// should this be defined? +static Display *jwxyz_live_displays[20] = { 0, }; +*/ + +Display * jwxyz_make_display (void *nsview_arg, void *cgc_arg) +{ + Display *d = (Display *) calloc(1, sizeof(*d)); + d->screen = (Screen *) calloc(1, sizeof(Screen)); + d->screen->dpy = d; + + d->screen_count = 1; + d->screen->screen_number = 0; + d->screen->black = 0xFF000000; + d->screen->white = 0xFFFFFFFF; + + Visual *v = (Visual *) calloc(1, sizeof(Visual)); + v->class = TrueColor; + v->red_mask = 0x00FF0000; + v->green_mask = 0x0000FF00; + v->blue_mask = 0x000000FF; + v->bits_per_rgb = 8; + d->screen->visual = v; + + Window w = (Window) calloc(1, sizeof(*w)); + w->type = WINDOW; + w->window.background = BlackPixelOfScreen(d->screen); + + d->main_window = w; + + return d; +} + +void +jwxyz_free_display (Display *dpy) +{ + free (dpy->screen->visual); + free (dpy->screen); + free (dpy->main_window); + free (dpy); +} + + +/* Call this when the Renderer calls onSurfaceChanged + */ +void +jwxyz_window_resized (Display *dpy, Window w, + int new_x, int new_y, int new_width, int new_height, + void *cgc_arg) +{ + w->frame.origin.x = new_x; + w->frame.origin.y = new_y; + w->frame.size.width = new_width; + w->frame.size.height = new_height; +} + +Window XRootWindow(Display * dpy, int screen) +{ + return dpy->main_window; +} + +/* Handle an abort on Android + TODO: Test that Android handles aborts properly + */ +void +jwxyz_abort (const char *fmt, ...) +{ + char s[10240]; + if (!fmt || !*fmt) + strcpy (s, "abort"); + else + { + va_list args; + va_start (args, fmt); + vsprintf (s, fmt, args); + va_end (args); + } + /* Send error to Android device log */ + __android_log_write(ANDROID_LOG_ERROR, "xscreensaver", s); + + abort(); +} + +Pixmap +XCreatePixmap (Display *dpy, Drawable d, + unsigned int width, unsigned int height, unsigned int depth) +{ +} + +int +XDestroyImage (XImage *ximage) +{ + if (ximage->data) free (ximage->data); + free (ximage); + return 0; +} + +int +XDrawString16 (Display *dpy, Drawable d, GC gc, int x, int y, + const XChar2b *str, int len) +{ +} + +int +XFreePixmap (Display *d, Pixmap p) +{ +} + +XImage * +XGetImage (Display *dpy, Drawable d, int x, int y, + unsigned int width, unsigned int height, + unsigned long plane_mask, int format) +{ +} + +unsigned long +XGetPixel (XImage *ximage, int x, int y) +{ +} + +int +XSetForeground (Display *dpy, GC gc, unsigned long fg) +{ +} + +int +XTextExtents16 (XFontStruct *f, const XChar2b *s, int length, + int *dir_ret, int *ascent_ret, int *descent_ret, + XCharStruct *cs) +{ +} + +int +XPutPixel (XImage *ximage, int x, int y, unsigned long pixel) +{ +} + +XImage * +XCreateImage (Display *dpy, Visual *visual, unsigned int depth, + int format, int offset, char *data, + unsigned int width, unsigned int height, + int bitmap_pad, int bytes_per_line) +{ +} diff -Nru xscreensaver-5.30/android/jwxyz.h xscreensaver-5.34/android/jwxyz.h --- xscreensaver-5.30/android/jwxyz.h 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/jwxyz.h 2014-11-12 21:31:39.000000000 -0500 @@ -0,0 +1,4 @@ +/* Android does not have __dead2 defined + TODO: Test Android ability to abort properly */ +#define __dead2 +#include "../OSX/jwxyz.h" diff -Nru xscreensaver-5.30/android/jwxyz-timers.h xscreensaver-5.34/android/jwxyz-timers.h --- xscreensaver-5.30/android/jwxyz-timers.h 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/jwxyz-timers.h 2014-11-10 23:22:31.000000000 -0500 @@ -0,0 +1,28 @@ +/* xscreensaver, Copyright (c) 2006-2012 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 + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation. No representations are made about the suitability of this + * software for any purpose. It is provided "as is" without express or + * implied warranty. + */ + +/* This is an implementation of Xt timers, for libjwxyz. + */ + +#ifndef __JWXYZ_TIMERS_H__ +#define __JWXYZ_TIMERS_H__ + +#include "jwxyz.h" + +typedef struct jwxyz_sources_data jwxyz_sources_data; + +extern jwxyz_sources_data *jwxyz_sources_init (XtAppContext); +extern void jwxyz_sources_free (jwxyz_sources_data *); +extern void jwxyz_sources_run (jwxyz_sources_data *); + +extern void jwxyz_XtRemoveInput_all (Display *); + +#endif /* __JWXYZ_TIMERS_H__ */ diff -Nru xscreensaver-5.30/android/Makefile xscreensaver-5.34/android/Makefile --- xscreensaver-5.30/android/Makefile 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/Makefile 2015-10-23 14:32:30.000000000 -0400 @@ -0,0 +1,44 @@ +# XScreenSaver for Android + + +TARGET = project + +default: apk + +clean:: gradle_clean + +distclean:: + +distdepend:: + +all: + cd project ; ./gradlew assembleDebug + +# TODO: +# check_versions: +# update_thumbs: + +echo_tarfiles: + @echo `find \ + Makefile \ + README \ + *.[ch] *.pl \ + project \ + project/xscreensaver/res/drawable/*.png \ + project/xscreensaver/res/values/settings.xml \ + project/xscreensaver/res/values/strings.xml \ + \( \( -name '.??*' -o -name build -o -name gen \ + -o -name libs -o -name obj -o -name '*~*' \) \ + -prune \) \ + -o \( -type f -o -type l \) -print \ + | sed 's@^\./@@' \ + | sort` + +apk: apk_raw_debug + +apk_raw_debug: + cd $(TARGET); ./gradlew assembleDebug + +gradle_clean: + -cd $(TARGET); ./gradlew clean + diff -Nru xscreensaver-5.30/android/project/build.gradle xscreensaver-5.34/android/project/build.gradle --- xscreensaver-5.30/android/project/build.gradle 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/build.gradle 2015-06-01 21:41:39.000000000 -0400 @@ -0,0 +1,9 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.1.0' + } +} diff -Nru xscreensaver-5.30/android/project/GLWallpaperService/AndroidManifest.xml xscreensaver-5.34/android/project/GLWallpaperService/AndroidManifest.xml --- xscreensaver-5.30/android/project/GLWallpaperService/AndroidManifest.xml 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/GLWallpaperService/AndroidManifest.xml 2015-06-01 21:41:39.000000000 -0400 @@ -0,0 +1,12 @@ + + + + + + + + + diff -Nru xscreensaver-5.30/android/project/GLWallpaperService/build.gradle xscreensaver-5.34/android/project/GLWallpaperService/build.gradle --- xscreensaver-5.30/android/project/GLWallpaperService/build.gradle 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/GLWallpaperService/build.gradle 2015-08-28 21:54:11.000000000 -0400 @@ -0,0 +1,43 @@ +apply plugin: 'android-library' + +dependencies { + compile fileTree(include: '*.jar', dir: 'libs') +} + +android { + compileSdkVersion 21 + buildToolsVersion "21.1.2" + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_7 + targetCompatibility JavaVersion.VERSION_1_7 + } + sourceSets { + main { + manifest.srcFile 'AndroidManifest.xml' + java.srcDirs = ['src'] + resources.srcDirs = ['src'] + aidl.srcDirs = ['src'] + renderscript.srcDirs = ['src'] + res.srcDirs = ['res'] + assets.srcDirs = ['assets'] + } + + // Move the tests to tests/java, tests/res, etc... + instrumentTest.setRoot('tests') + + // Move the build types to build-types/ + // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ... + // This moves them out of them default location under src//... which would + // conflict with src/ being used by the main source set. + // Adding new build types or product flavors should be accompanied + // by a similar customization. + debug.setRoot('build-types/debug') + release.setRoot('build-types/release') + } + defaultConfig { + minSdkVersion 15 + targetSdkVersion 21 + } + productFlavors { + } +} diff -Nru xscreensaver-5.30/android/project/GLWallpaperService/build.xml xscreensaver-5.34/android/project/GLWallpaperService/build.xml --- xscreensaver-5.30/android/project/GLWallpaperService/build.xml 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/GLWallpaperService/build.xml 2014-10-27 03:25:28.000000000 -0400 @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru xscreensaver-5.30/android/project/GLWallpaperService/default.properties xscreensaver-5.34/android/project/GLWallpaperService/default.properties --- xscreensaver-5.30/android/project/GLWallpaperService/default.properties 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/GLWallpaperService/default.properties 2014-10-27 03:25:28.000000000 -0400 @@ -0,0 +1,12 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system use, +# "build.properties", and override values to adapt the script to your +# project structure. + +# Project target. +target=android-7 +android.library=true diff -Nru xscreensaver-5.30/android/project/GLWallpaperService/LICENSE xscreensaver-5.34/android/project/GLWallpaperService/LICENSE --- xscreensaver-5.30/android/project/GLWallpaperService/LICENSE 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/GLWallpaperService/LICENSE 2014-10-27 03:25:28.000000000 -0400 @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff -Nru xscreensaver-5.30/android/project/GLWallpaperService/NOTICE xscreensaver-5.34/android/project/GLWallpaperService/NOTICE --- xscreensaver-5.30/android/project/GLWallpaperService/NOTICE 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/GLWallpaperService/NOTICE 2014-10-27 03:25:28.000000000 -0400 @@ -0,0 +1,21 @@ +Copyright 2008 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +Portions of this software were developed by Robert Green. The original +software is available from + http://www.rbgrn.net/content/354-glsurfaceview-adapted-3d-live-wallpapers + +Other contributors include + Mark Guerra - http://www.markguerra.net + TaDaa - https://github.com/TaDaa diff -Nru xscreensaver-5.30/android/project/GLWallpaperService/project.properties xscreensaver-5.34/android/project/GLWallpaperService/project.properties --- xscreensaver-5.30/android/project/GLWallpaperService/project.properties 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/GLWallpaperService/project.properties 2014-10-27 03:25:28.000000000 -0400 @@ -0,0 +1,15 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system edit +# "ant.properties", and override values to adapt the script to your +# project structure. +# +# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): +#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt + +android.library=true +# Project target. +target=android-7 diff -Nru xscreensaver-5.30/android/project/GLWallpaperService/readme-contribute.txt xscreensaver-5.34/android/project/GLWallpaperService/readme-contribute.txt --- xscreensaver-5.30/android/project/GLWallpaperService/readme-contribute.txt 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/GLWallpaperService/readme-contribute.txt 2014-10-27 03:25:28.000000000 -0400 @@ -0,0 +1,127 @@ +Project Setup - GLWallpaperService +================================== + +Discussion Group: +http://groups.google.com/group/glwallpaperservice + +Repository: +https://github.com/markfguerra/GLWallpaperService/ + +Intended Audience +----------------- +This document is for developers who want to improve GLWallpaperService. It shows you how to download the source code to to improve it (or break it) as you please using Eclipse. +If you're only interested in using the software to make an OpenGL Wallpaper, this isn't for you. Instead, look at readme.txt for info on how to get and install the Jar. + + +Install required software +------------------------- +To start, make sure install Eclipse the latest Android SDK are installed. Optionally, install git. Follow the instructions provided by those software projects to do so. + Eclipse: http://wiki.eclipse.org/FAQ_Where_do_I_get_and_install_Eclipse%3F + Android SDK: http://developer.android.com/sdk/installing.html + Git: http://git-scm.com/ + +Also, if you plan on using git, we recommend you make an account on github. + http://github.com/ + + +Folder Setup +------------ +We are going to make two folders in this document. One will contain the code itself, and another will contain the Eclipse workspace. If you prefer that they both be in the same folder, do so. As if I could stop you ;) + +Go to where you're putting all this stuff. + cd /path/to/your/folder + +Make a folder for your workspace. + mkdir workspace + + +Get the code +------------ +Download the source code. You can do so using git or just a regular old download. + +For a direct download, go here. Extract the zip into a sub folder: + https://github.com/markfguerra/GLWallpaperService/zipball/master + +If you use github, please fork this code from their web interface: + https://github.com/markfguerra/GLWallpaperService + +Then you want to make a local clone of your github fork. Github will provide you with your own Url. My clone command looks like this: + git clone git@github.com:markfguerra/GLWallpaperService.git + +A new folder will be created automatically, called GLWallpaperService/ containing your source code. + +Visit this link if you need help using github: + http://help.github.com/ + + +Start Eclipse +------------- +Open Eclipse and choose the folder you just created for your workspace. When it finishes loading, click the Arrow to go to the workbench. + + +Set up the Android SDK +---------------------- +To set up the Android SDK for this project: +In the menu, go to Eclipse->Preferences. Go to the Android section. +Give it the location of your Android SDK folder. Give it a minute to figure things out. +Select Android 2.1 (Api level 7) then click Ok. + + +Import the code into the workspace +---------------------------------- +In the Eclipse menu, choose File->New->"Android Project" +Choose "Create new project from existing source" +For the location click browse and select the "GLWallpaperService" folder. To be clear, this is a sub-folder of the folder that contains the LICENSE file. +Select "Android 2.1-update1" as your build target. This is API Level 7. +For the Project Name, type "GLWallpaperService" +Repeat these steps for the "GLWallpaperTest" folder. Use the project name "GLWallpaperTest" + +The code will now be in your workspace. + + +Resolving build errors +---------------------- +Most people should have a working project at this point. However, some folks encounter build errors when they first import the code into their workspace. There are a couple of tricks to help you fix them. +First and foremost, make sure you have the latest versions of the Android SDK and Eclipse plugin. This is important, because older versions of the developer tools handle Library Projects differently, so if you have an old version this may cause problems. +You may have to fix the Project Properties. Right-click on the "GLWallpaperService" project in the Package Explorer. Select "Android Tools"->"Fix Project Properties". +Also fix the project properties for "GLWallpaperTest" the same way. +In the menu, click on Project->Clean to clean all projects. +In Package Explorer, right-click on the GLWallpaperService project and click on "Refresh". Do the same for GLWallpaperTest. +You may need to click on Project->Clean to clean all projects again after the refresh. +Your errors should go away at this point. If not, try using a programming Q&A site such as stackoverflow.com and also search Google. + + +To Run +------ +Save your work. By default, saving will also compile your code in Eclipse. + +Plug in your Android Device to your computer, if you have one. If you don't plug in an Android device, the emulator will launch when you run the code. You may need create an Android Emulator if you havn't done so already. + +In the Menu, choose Run->"Run Configurations". +Choose "Android Application" +Click on the "New" button. This is the button with the plus sign on it. +The name of the run configuration is New_configuration. Change it if you like. +Click "Browse..." to choose a project. Select GLWallpaperTest. This is a sample wallpaper that comes with the code. +Click Apply. Click Run. +The wallpaper will now install on your device or emulator. Use the regular Android live wallpaper picker to select "GL Wallpaper Test Project". You should see a 3D rotating cube. + +Now that your run configuration is set up, you can run New_configuration any time by using the Toolbar icon. + + +Creating GLWallpaperService.jar +------------------------------- +Do the following to create the JAR file, which is convenient for use in projects. +In the Eclipse menu, click File -> Export +Choose "JAR File" +On the "JAR Export" screen, choose only GLWallpaperService.java. You do not need to include other files. +Make note of where the JAR will be saved and click Finish + + +Contribute your code +-------------------- +If you do something cool with this software, we would love it if you would share your changes with us. Even if your changes still need some polishing. Don't worry, we're friendly :) + +If you are using git and github, push your changes to your fork and send us a pull request. If you're not using those fancy things, we want to hear from you anyway. Send us a message and we'll work something out. + +Thanks for your interest in this project. Good luck coding! + diff -Nru xscreensaver-5.30/android/project/GLWallpaperService/readme.txt xscreensaver-5.34/android/project/GLWallpaperService/readme.txt --- xscreensaver-5.30/android/project/GLWallpaperService/readme.txt 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/GLWallpaperService/readme.txt 2014-10-27 03:25:28.000000000 -0400 @@ -0,0 +1,41 @@ +Truly Excellent Live Wallpaper - Version 0.1 + + +Upstream codebases +------------------ + +This is a port of Xscreensaver 5.29 to Android. + +On the Android side, it uses Ben Gruver's version of Mark Guerra's GL +WallpaperService for Android. + +Xscreensaver's GLX hacks are OpenGL, and Android is OpenGL ES, +so we use the OpenGL to OpenGL ES translation shim that is in Xscreensaver. + + +Compiling +--------- + +We are compiling our APK with ant. If you have a problem getting this +to work with Eclipse, Android Studio, or some other IDE, let us know. +TrulyCreative is the Service, and GLWallpaperService is the library +which TrulyCreative uses. Also don't forget this uses C/C++ code via +the NDK, so you have to build both the C/C++ and Java/Dalvik code. + + + +Licenses +-------- + +Some code in gl1.c is based off code from +Jetro Lauha's San Angeles Observation project +which is under a BSD-style license. + +GLWallpaperService is under an Apache License, Version 2.0. + +Look in the TrulyExcellent/jni/xscreensaver to see what licenses are used. +MIT/X11 seems to be the primary license. + +The rest of the code is released under Apache License, Version 2.0. +Some of that code is from the Android Open Source Project, some is from +Dennis Sheil. Dennis Sheil dual-licenses his code as MIT/X11 license also. Binary files /tmp/gs4DIYvF9l/xscreensaver-5.30/android/project/GLWallpaperService/res/drawable-hdpi/icon.png and /tmp/S6QaQNxooT/xscreensaver-5.34/android/project/GLWallpaperService/res/drawable-hdpi/icon.png differ Binary files /tmp/gs4DIYvF9l/xscreensaver-5.30/android/project/GLWallpaperService/res/drawable-ldpi/icon.png and /tmp/S6QaQNxooT/xscreensaver-5.34/android/project/GLWallpaperService/res/drawable-ldpi/icon.png differ Binary files /tmp/gs4DIYvF9l/xscreensaver-5.30/android/project/GLWallpaperService/res/drawable-mdpi/icon.png and /tmp/S6QaQNxooT/xscreensaver-5.34/android/project/GLWallpaperService/res/drawable-mdpi/icon.png differ diff -Nru xscreensaver-5.30/android/project/GLWallpaperService/res/layout/main.xml xscreensaver-5.34/android/project/GLWallpaperService/res/layout/main.xml --- xscreensaver-5.30/android/project/GLWallpaperService/res/layout/main.xml 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/GLWallpaperService/res/layout/main.xml 2014-10-27 03:25:28.000000000 -0400 @@ -0,0 +1,12 @@ + + + + diff -Nru xscreensaver-5.30/android/project/GLWallpaperService/res/values/strings.xml xscreensaver-5.34/android/project/GLWallpaperService/res/values/strings.xml --- xscreensaver-5.30/android/project/GLWallpaperService/res/values/strings.xml 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/GLWallpaperService/res/values/strings.xml 2014-10-27 03:25:28.000000000 -0400 @@ -0,0 +1,5 @@ + + + Hello World! + GL Wallpaper Service + diff -Nru xscreensaver-5.30/android/project/GLWallpaperService/src/net/rbgrn/android/glwallpaperservice/GLWallpaperService.java xscreensaver-5.34/android/project/GLWallpaperService/src/net/rbgrn/android/glwallpaperservice/GLWallpaperService.java --- xscreensaver-5.30/android/project/GLWallpaperService/src/net/rbgrn/android/glwallpaperservice/GLWallpaperService.java 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/GLWallpaperService/src/net/rbgrn/android/glwallpaperservice/GLWallpaperService.java 2014-10-27 03:25:28.000000000 -0400 @@ -0,0 +1,357 @@ +/* + * Copyright (c) 2011 Ben Gruver + * All rights reserved. + * + * You may use this code at your option under the following BSD license + * or Apache 2.0 license terms + * + * [The "BSD license"] + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * [The "Apache 2.0 license"] + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package net.rbgrn.android.glwallpaperservice; + +import android.opengl.GLSurfaceView; +import android.service.wallpaper.WallpaperService; +import android.view.SurfaceHolder; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.List; + +public abstract class GLWallpaperService extends WallpaperService { + public interface Renderer extends GLSurfaceView.Renderer { + } + + public class GLEngine extends WallpaperService.Engine { + public final static int RENDERMODE_WHEN_DIRTY = 0; + public final static int RENDERMODE_CONTINUOUSLY = 1; + + private Object lock = new Object(); + private GLSurfaceView mGLSurfaceView = null; + + private int debugFlags; + private int renderMode; + + /** + * If we don't have a GLSurfaceView yet, then we queue up any operations that are requested, until the + * GLSurfaceView is created. + * + * Initially, we created the glSurfaceView in the GLEngine constructor, and things seemed to work. However, + * it turns out a few devices aren't set up to handle the surface related events at this point, and crash. + * + * This is a work around so that we can delay the creation of the GLSurfaceView until the surface is actually + * created, so that the underlying code should be in a state to be able to handle the surface related events + * that get fired when GLSurfaceView is created. + */ + private List pendingOperations = new ArrayList(); + + public GLEngine() { + } + + public void setGLWrapper(final GLSurfaceView.GLWrapper glWrapper) { + synchronized (lock) { + if (mGLSurfaceView != null) { + mGLSurfaceView.setGLWrapper(glWrapper); + } else { + pendingOperations.add(new Runnable() { + public void run() { + setGLWrapper(glWrapper); + } + }); + } + } + } + + public void setDebugFlags(final int debugFlags) { + synchronized (lock) { + if (mGLSurfaceView != null) { + mGLSurfaceView.setDebugFlags(debugFlags); + } else { + this.debugFlags = debugFlags; + pendingOperations.add(new Runnable() { + public void run() { + setDebugFlags(debugFlags); + } + }); + } + } + } + + public int getDebugFlags() { + synchronized (lock) { + if (mGLSurfaceView != null) { + return mGLSurfaceView.getDebugFlags(); + } else { + return debugFlags; + } + } + } + + public void setRenderer(final GLSurfaceView.Renderer renderer) { + synchronized (lock) { + if (mGLSurfaceView != null) { + mGLSurfaceView.setRenderer(renderer); + if (!isVisible()) { + mGLSurfaceView.onPause(); + } + } else { + pendingOperations.add(new Runnable() { + public void run() { + setRenderer(renderer); + } + }); + } + } + } + + public void queueEvent(final Runnable r) { + synchronized (lock) { + if (mGLSurfaceView != null) { + mGLSurfaceView.queueEvent(r); + } else { + pendingOperations.add(new Runnable() { + public void run() { + queueEvent(r); + } + }); + } + } + } + + public void setEGLContextFactory(final GLSurfaceView.EGLContextFactory factory) { + synchronized (lock) { + if (mGLSurfaceView != null) { + mGLSurfaceView.setEGLContextFactory(factory); + } else { + pendingOperations.add(new Runnable() { + public void run() { + setEGLContextFactory(factory); + } + }); + } + } + } + + public void setEGLWindowSurfaceFactory(final GLSurfaceView.EGLWindowSurfaceFactory factory) { + synchronized (lock) { + if (mGLSurfaceView != null) { + mGLSurfaceView.setEGLWindowSurfaceFactory(factory); + } else { + pendingOperations.add(new Runnable() { + public void run() { + setEGLWindowSurfaceFactory(factory); + } + }); + } + } + } + + public void setEGLConfigChooser(final GLSurfaceView.EGLConfigChooser configChooser) { + synchronized (lock) { + if (mGLSurfaceView != null) { + mGLSurfaceView.setEGLConfigChooser(configChooser); + } else { + pendingOperations.add(new Runnable() { + public void run() { + setEGLConfigChooser(configChooser); + } + }); + } + } + } + + public void setEGLConfigChooser(final boolean needDepth) { + synchronized (lock) { + if (mGLSurfaceView != null) { + mGLSurfaceView.setEGLConfigChooser(needDepth); + } else { + pendingOperations.add(new Runnable() { + public void run() { + setEGLConfigChooser(needDepth); + } + }); + } + } + } + + public void setEGLConfigChooser(final int redSize, final int greenSize, final int blueSize, + final int alphaSize, final int depthSize, final int stencilSize) { + synchronized (lock) { + if (mGLSurfaceView != null) { + mGLSurfaceView.setEGLConfigChooser(redSize, greenSize, blueSize, + alphaSize, depthSize, stencilSize); + } else { + pendingOperations.add(new Runnable() { + public void run() { + setEGLConfigChooser(redSize, greenSize, blueSize, alphaSize, depthSize, stencilSize); + } + }); + } + } + } + + public void setEGLContextClientVersion(final int version) { + synchronized (lock) { + Method method = null; + + try { + //the setEGLContextClientVersion method is first available in api level 8, but we would + //like to support compiling against api level 7 + method = GLSurfaceView.class.getMethod("setEGLContextClientVersion", int.class); + } catch (NoSuchMethodException ex) { + return; + } + + if (mGLSurfaceView != null) { + try { + method.invoke(mGLSurfaceView, version); + } catch (IllegalAccessException ex) { + return; + } catch (InvocationTargetException ex) { + return; + } + } else { + pendingOperations.add(new Runnable() { + public void run() { + setEGLContextClientVersion(version); + } + }); + } + } + } + + public void setRenderMode(final int renderMode) { + synchronized (lock) { + if (mGLSurfaceView != null) { + mGLSurfaceView.setRenderMode(renderMode); + } else { + this.renderMode = renderMode; + pendingOperations.add(new Runnable() { + public void run() { + setRenderMode(renderMode); + } + }); + } + } + } + + public int getRenderMode() { + synchronized (lock) { + if (mGLSurfaceView != null) { + return mGLSurfaceView.getRenderMode(); + } else { + return renderMode; + } + } + } + + public void requestRender() { + if (mGLSurfaceView != null) { + mGLSurfaceView.requestRender(); + } + } + + @Override + public void onVisibilityChanged(final boolean visible) { + super.onVisibilityChanged(visible); + + synchronized (lock) { + if (mGLSurfaceView != null) { + if (visible) { + mGLSurfaceView.onResume(); + } else { + mGLSurfaceView.onPause(); + } + } else { + pendingOperations.add(new Runnable() { + public void run() { + if (visible) { + mGLSurfaceView.onResume(); + } else { + mGLSurfaceView.onPause(); + } + } + }); + } + } + } + + @Override + public void onSurfaceChanged(final SurfaceHolder holder, final int format, final int width, final int height) { + synchronized (lock) { + if (mGLSurfaceView != null) { + mGLSurfaceView.surfaceChanged(holder, format, width, height); + } else { + pendingOperations.add(new Runnable() { + public void run() { + onSurfaceChanged(holder, format, width, height); + } + }); + } + } + } + + @Override + public void onSurfaceCreated(SurfaceHolder holder) { + synchronized (lock) { + if (mGLSurfaceView == null) { + mGLSurfaceView = new GLSurfaceView(GLWallpaperService.this) { + @Override + public SurfaceHolder getHolder() { + return GLEngine.this.getSurfaceHolder(); + } + }; + for (Runnable pendingOperation: pendingOperations) { + pendingOperation.run(); + } + pendingOperations.clear(); + } + mGLSurfaceView.surfaceCreated(holder); + } + } + + @Override + public void onSurfaceDestroyed(SurfaceHolder holder) { + synchronized (lock) { + if (mGLSurfaceView != null) { + mGLSurfaceView.surfaceDestroyed(holder); + } + } + } + } +} Binary files /tmp/gs4DIYvF9l/xscreensaver-5.30/android/project/gradle/wrapper/gradle-wrapper.jar and /tmp/S6QaQNxooT/xscreensaver-5.34/android/project/gradle/wrapper/gradle-wrapper.jar differ diff -Nru xscreensaver-5.30/android/project/gradle/wrapper/gradle-wrapper.properties xscreensaver-5.34/android/project/gradle/wrapper/gradle-wrapper.properties --- xscreensaver-5.30/android/project/gradle/wrapper/gradle-wrapper.properties 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/gradle/wrapper/gradle-wrapper.properties 2015-06-01 21:41:39.000000000 -0400 @@ -0,0 +1,7 @@ + +#Wed Apr 10 15:27:10 PDT 2013 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip diff -Nru xscreensaver-5.30/android/project/gradlew xscreensaver-5.34/android/project/gradlew --- xscreensaver-5.30/android/project/gradlew 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/gradlew 2015-06-01 21:41:39.000000000 -0400 @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# For Cygwin, ensure paths are in UNIX format before anything is touched. +if $cygwin ; then + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff -Nru xscreensaver-5.30/android/project/gradlew.bat xscreensaver-5.34/android/project/gradlew.bat --- xscreensaver-5.30/android/project/gradlew.bat 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/gradlew.bat 2015-06-01 21:41:39.000000000 -0400 @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff -Nru xscreensaver-5.30/android/project/local.properties xscreensaver-5.34/android/project/local.properties --- xscreensaver-5.30/android/project/local.properties 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/local.properties 2015-06-25 14:47:39.000000000 -0400 @@ -0,0 +1,11 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must *NOT* be checked into Version Control Systems, +# as it contains information specific to your local configuration. + +# location of the SDK. This is only used by Ant +# For customization when using a Version Control System, please read the +# header note. +sdk.dir=/Users/jwz/Library/Android/sdk +ndk.dir=/Users/jwz/Library/Android/sdk/ndk diff -Nru xscreensaver-5.30/android/project/settings.gradle xscreensaver-5.34/android/project/settings.gradle --- xscreensaver-5.30/android/project/settings.gradle 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/settings.gradle 2015-06-01 21:41:39.000000000 -0400 @@ -0,0 +1,2 @@ +include ':xscreensaver' +include ':GLWallpaperService' diff -Nru xscreensaver-5.30/android/project/xscreensaver/AndroidManifest.xml xscreensaver-5.34/android/project/xscreensaver/AndroidManifest.xml --- xscreensaver-5.30/android/project/xscreensaver/AndroidManifest.xml 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/xscreensaver/AndroidManifest.xml 2015-08-28 22:03:27.000000000 -0400 @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru xscreensaver-5.30/android/project/xscreensaver/build.gradle xscreensaver-5.34/android/project/xscreensaver/build.gradle --- xscreensaver-5.30/android/project/xscreensaver/build.gradle 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/xscreensaver/build.gradle 2015-08-28 21:57:21.000000000 -0400 @@ -0,0 +1,98 @@ +apply plugin: 'android' + +dependencies { + compile fileTree(include: '*.jar', dir: 'libs') + compile project(':GLWallpaperService') +} + +android { + compileSdkVersion 21 + buildToolsVersion "21.1.2" + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_7 + targetCompatibility JavaVersion.VERSION_1_7 + } + sourceSets { + main { + manifest.srcFile 'AndroidManifest.xml' + java.srcDirs = ['src'] + resources.srcDirs = ['src'] + aidl.srcDirs = ['src'] + renderscript.srcDirs = ['src'] + res.srcDirs = ['res'] + assets.srcDirs = ['assets'] + // jniLibs.srcDirs = ['jni'] + jniLibs.srcDirs = ['libs'] + jni.srcDirs = [] // disable automatic ndk-build call + } + + // Move the tests to tests/java, tests/res, etc... + instrumentTest.setRoot('tests') + + // Move the build types to build-types/ + // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ... + // This moves them out of them default location under src//... which would + // conflict with src/ being used by the main source set. + // Adding new build types or product flavors should be accompanied + // by a similar customization. + debug.setRoot('build-types/debug') + release.setRoot('build-types/release') + } + project.ext.versionCodes = ['armeabi': 1, 'armeabi-v7a': 2, 'arm64-v8a': 3, 'mips': 5, 'mips64': 6, 'x86': 8, 'x86_64': 9] + //versionCode digit for each supported ABI, with 64bit>32bit and x86>armeabi-* + + + // put ndk-build in build's path, or replace below with its full path + task ndkBuild(type: Exec) { + Properties properties = new Properties() + properties.load(project.rootProject.file('local.properties').newDataInputStream()) + def ndkDir = properties.getProperty('ndk.dir') + commandLine "$ndkDir/ndk-build", '-C', file('jni').absolutePath + } + + // generate files early in the process + task perlBuild(type: Exec) { + commandLine 'perl', '-x../..', '../../generate_files.pl', 'sproingies', 'superquadrics', 'stonerview', 'unknownpleasures', 'bouncingcow', 'hypertorus', 'glhanoi' + } + + + task perlClean(type: Exec) { + commandLine 'rm', '-f', '../../gen/glue.c', './res/values/items.xml', './res/values/strings.xml', './res/values/settings.xml' + } + + task perlCleaner(type: Exec) { + commandLine 'rm', '-rf', './res/xml', './src/org/jwz/xscreensaver/gen' + } + + task objlibClean(type: Exec) { + commandLine 'rm', '-rf', './obj/local', './libs/armeabi', './libs/armeabi-v7a', './libs/mips', './libs/x86' + } + + + // if perlBuild already generated file, do not run perlBuild again + if (! file("../../gen/glue.c").exists()) { + preBuild.dependsOn perlBuild + } + + clean.dependsOn perlClean + clean.dependsOn perlCleaner + clean.dependsOn objlibClean + + // + tasks.withType(JavaCompile) { + compileTask -> compileTask.dependsOn ndkBuild + } + + + defaultConfig { + minSdkVersion 15 + targetSdkVersion 21 + } + productFlavors { + } + buildTypes { + debug { + jniDebuggable true + } + } +} diff -Nru xscreensaver-5.30/android/project/xscreensaver/build.xml xscreensaver-5.34/android/project/xscreensaver/build.xml --- xscreensaver-5.30/android/project/xscreensaver/build.xml 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/xscreensaver/build.xml 2014-10-27 03:25:28.000000000 -0400 @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru xscreensaver-5.30/android/project/xscreensaver/jni/Android.mk xscreensaver-5.34/android/project/xscreensaver/jni/Android.mk --- xscreensaver-5.30/android/project/xscreensaver/jni/Android.mk 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/xscreensaver/jni/Android.mk 2015-08-28 21:57:21.000000000 -0400 @@ -0,0 +1,62 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := xscreensaver + +LOCAL_SRC_FILES := \ + xscreensaver/hacks/xlockmore.c \ + xscreensaver/hacks/fps.c \ + xscreensaver/hacks/glx/fps-gl.c \ + xscreensaver/hacks/glx/jwzgles.c \ + xscreensaver/hacks/glx/rotator.c \ + xscreensaver/hacks/glx/tube.c \ + xscreensaver/hacks/glx/sphere.c \ + xscreensaver/hacks/glx/sproingies.c \ + xscreensaver/hacks/glx/sproingiewrap.c \ + xscreensaver/hacks/glx/gllist.c \ + xscreensaver/hacks/glx/s1_1.c \ + xscreensaver/hacks/glx/s1_2.c \ + xscreensaver/hacks/glx/s1_3.c \ + xscreensaver/hacks/glx/s1_4.c \ + xscreensaver/hacks/glx/s1_5.c \ + xscreensaver/hacks/glx/s1_6.c \ + xscreensaver/hacks/glx/s1_b.c \ + xscreensaver/hacks/glx/superquadrics.c \ + xscreensaver/hacks/glx/trackball.c \ + xscreensaver/hacks/glx/gltrackball.c \ + xscreensaver/hacks/glx/texfont.c \ + xscreensaver/hacks/glx/stonerview.c \ + xscreensaver/hacks/glx/stonerview-move.c \ + xscreensaver/hacks/glx/stonerview-osc.c \ + xscreensaver/hacks/glx/stonerview-view.c \ + xscreensaver/hacks/glx/hilbert.c \ + xscreensaver/hacks/glx/xpm-ximage.c \ + xscreensaver/hacks/glx/cow_face.c \ + xscreensaver/hacks/glx/cow_hide.c \ + xscreensaver/hacks/glx/cow_hoofs.c \ + xscreensaver/hacks/glx/cow_horns.c \ + xscreensaver/hacks/glx/cow_tail.c \ + xscreensaver/hacks/glx/cow_udder.c \ + xscreensaver/hacks/glx/bouncingcow.c \ + xscreensaver/hacks/glx/unknownpleasures.c \ + xscreensaver/hacks/glx/glhanoi.c \ + xscreensaver/utils/minixpm.c \ + xscreensaver/utils/hsv.c \ + xscreensaver/utils/colors.c \ + xscreensaver/utils/resources.c \ + xscreensaver/utils/xft.c \ + xscreensaver/utils/utf8wc.c \ + xscreensaver/utils/yarandom.c \ + xscreensaver/android/XScreenSaverView.c \ + xscreensaver/android/XScreenSaverGLView.c \ + xscreensaver/android/jwxyz.c \ + xscreensaver/android/gen/glue.c + +LOCAL_LDLIBS := -lGLESv1_CM -ldl -llog + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/xscreensaver $(LOCAL_PATH)/xscreensaver/android $(LOCAL_PATH)/xscreensaver/utils $(LOCAL_PATH)/xscreensaver/hacks $(LOCAL_PATH)/xscreensaver/hacks/glx + +LOCAL_CFLAGS += -std=c99 -DSTANDALONE=1 -DUSE_GL=1 -DGETTIMEOFDAY_TWO_ARGS=1 -DHAVE_JWZGLES=1 -DHAVE_ANDROID=1 -DGL_VERSION_ES_CM_1_0 + +include $(BUILD_SHARED_LIBRARY) diff -Nru xscreensaver-5.30/android/project/xscreensaver/jni/Application.mk xscreensaver-5.34/android/project/xscreensaver/jni/Application.mk --- xscreensaver-5.30/android/project/xscreensaver/jni/Application.mk 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/xscreensaver/jni/Application.mk 2015-06-09 00:22:46.000000000 -0400 @@ -0,0 +1,8 @@ +#APP_ABI := armeabi-v7a +#APP_ABI := armeabi armeabi-v7a +APP_ABI := all +APP_STL := stlport_static +#APP_PLATFORM := android-10 +APP_PLATFORM := android-14 +# ^^ this can be increased + diff -Nru xscreensaver-5.30/android/project/xscreensaver/project.properties xscreensaver-5.34/android/project/xscreensaver/project.properties --- xscreensaver-5.30/android/project/xscreensaver/project.properties 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/xscreensaver/project.properties 2014-10-27 03:25:28.000000000 -0400 @@ -0,0 +1,15 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system edit +# "ant.properties", and override values to adapt the script to your +# project structure. +# +# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): +#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt + +android.library.reference.1=../GLWallpaperService +# Project target. +target=android-19 Binary files /tmp/gs4DIYvF9l/xscreensaver-5.30/android/project/xscreensaver/res/drawable/bouncingcow.png and /tmp/S6QaQNxooT/xscreensaver-5.34/android/project/xscreensaver/res/drawable/bouncingcow.png differ Binary files /tmp/gs4DIYvF9l/xscreensaver-5.30/android/project/xscreensaver/res/drawable/glhanoi.png and /tmp/S6QaQNxooT/xscreensaver-5.34/android/project/xscreensaver/res/drawable/glhanoi.png differ Binary files /tmp/gs4DIYvF9l/xscreensaver-5.30/android/project/xscreensaver/res/drawable/glmatrix.png and /tmp/S6QaQNxooT/xscreensaver-5.34/android/project/xscreensaver/res/drawable/glmatrix.png differ Binary files /tmp/gs4DIYvF9l/xscreensaver-5.30/android/project/xscreensaver/res/drawable/hilbert.png and /tmp/S6QaQNxooT/xscreensaver-5.34/android/project/xscreensaver/res/drawable/hilbert.png differ Binary files /tmp/gs4DIYvF9l/xscreensaver-5.30/android/project/xscreensaver/res/drawable/hypertorus.png and /tmp/S6QaQNxooT/xscreensaver-5.34/android/project/xscreensaver/res/drawable/hypertorus.png differ Binary files /tmp/gs4DIYvF9l/xscreensaver-5.30/android/project/xscreensaver/res/drawable/sproingies.png and /tmp/S6QaQNxooT/xscreensaver-5.34/android/project/xscreensaver/res/drawable/sproingies.png differ Binary files /tmp/gs4DIYvF9l/xscreensaver-5.30/android/project/xscreensaver/res/drawable/stonerview.png and /tmp/S6QaQNxooT/xscreensaver-5.34/android/project/xscreensaver/res/drawable/stonerview.png differ Binary files /tmp/gs4DIYvF9l/xscreensaver-5.30/android/project/xscreensaver/res/drawable/superquadrics.png and /tmp/S6QaQNxooT/xscreensaver-5.34/android/project/xscreensaver/res/drawable/superquadrics.png differ Binary files /tmp/gs4DIYvF9l/xscreensaver-5.30/android/project/xscreensaver/res/drawable/thumbnail.png and /tmp/S6QaQNxooT/xscreensaver-5.34/android/project/xscreensaver/res/drawable/thumbnail.png differ Binary files /tmp/gs4DIYvF9l/xscreensaver-5.30/android/project/xscreensaver/res/drawable/unknownpleasures.png and /tmp/S6QaQNxooT/xscreensaver-5.34/android/project/xscreensaver/res/drawable/unknownpleasures.png differ Binary files /tmp/gs4DIYvF9l/xscreensaver-5.30/android/project/xscreensaver/res/drawable-ldpi/icon.png and /tmp/S6QaQNxooT/xscreensaver-5.34/android/project/xscreensaver/res/drawable-ldpi/icon.png differ Binary files /tmp/gs4DIYvF9l/xscreensaver-5.30/android/project/xscreensaver/res/drawable-mdpi/icon.png and /tmp/S6QaQNxooT/xscreensaver-5.34/android/project/xscreensaver/res/drawable-mdpi/icon.png differ diff -Nru xscreensaver-5.30/android/project/xscreensaver/res/layout/main.xml xscreensaver-5.34/android/project/xscreensaver/res/layout/main.xml --- xscreensaver-5.30/android/project/xscreensaver/res/layout/main.xml 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/xscreensaver/res/layout/main.xml 2014-10-27 03:25:28.000000000 -0400 @@ -0,0 +1,12 @@ + + + + diff -Nru xscreensaver-5.30/android/project/xscreensaver/res/layout/slider_preference_dialog.xml xscreensaver-5.34/android/project/xscreensaver/res/layout/slider_preference_dialog.xml --- xscreensaver-5.30/android/project/xscreensaver/res/layout/slider_preference_dialog.xml 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/xscreensaver/res/layout/slider_preference_dialog.xml 2015-06-19 14:56:42.000000000 -0400 @@ -0,0 +1,29 @@ + + + + + + + + + \ No newline at end of file diff -Nru xscreensaver-5.30/android/project/xscreensaver/res/values/attrs.xml xscreensaver-5.34/android/project/xscreensaver/res/values/attrs.xml --- xscreensaver-5.30/android/project/xscreensaver/res/values/attrs.xml 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/xscreensaver/res/values/attrs.xml 2015-06-19 14:56:42.000000000 -0400 @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff -Nru xscreensaver-5.30/android/project/xscreensaver/res/values/items.xml xscreensaver-5.34/android/project/xscreensaver/res/values/items.xml --- xscreensaver-5.30/android/project/xscreensaver/res/values/items.xml 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/xscreensaver/res/values/items.xml 2015-08-28 22:03:27.000000000 -0400 @@ -0,0 +1,17 @@ + + + 0 + 0.487179487179487 + 0.7125 + 0.6625 + 0.328859060402685 + 0.7375 + 0.6875 + 0.310344827586207 + 0.6375 + 0.7625 + 0.241379310344828 + 0.2 + -0.107142857142857 + 0 + diff -Nru xscreensaver-5.30/android/project/xscreensaver/res/values/settings.xml xscreensaver-5.34/android/project/xscreensaver/res/values/settings.xml --- xscreensaver-5.30/android/project/xscreensaver/res/values/settings.xml 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/xscreensaver/res/values/settings.xml 2015-08-28 22:03:27.000000000 -0400 @@ -0,0 +1,207 @@ + + + + "One" + "Lots" + + + "1" + "30" + + + "True" + "False" + + + @string/t + @string/f + + + "Slow" + "Fast" + + + "0.1" + "15.0" + + + "True" + "False" + + + @string/t + @string/f + + + "Slow" + "Fast" + + + "0.1" + "3.0" + + + "True" + "False" + + + @string/t + @string/f + + + "Moo" + "Herd" + + + "1" + "9" + + + "Slow" + "Fast" + + + "0.05" + "2.0" + + + "-4.0" + "4.0" + + + "-4.0" + "4.0" + + + "wireframe" + "transparent" + "surface" + + + "wireframe" + "transparent" + "surface" + + + "orthographic" + "perspective" + + + "orthographic" + "perspective" + + + "-4.0" + "4.0" + + + "-4.0" + "4.0" + + + "solid" + "spirals-1" + "spirals-2" + "spirals-4" + "spirals-8" + "spirals-16" + "bands" + + + "solid" + "spirals-1" + "spirals-2" + "spirals-4" + "spirals-8" + "spirals-16" + "bands" + + + "twosided" + "colorwheel" + + + "twosided" + "colorwheel" + + + "-4.0" + "4.0" + + + "-4.0" + "4.0" + + + "-4.0" + "4.0" + + + "-4.0" + "4.0" + + + "orthographic" + "perspective" + + + "orthographic" + "perspective" + + + "-4.0" + "4.0" + + + "-4.0" + "4.0" + + + "-4.0" + "4.0" + + + "-4.0" + "4.0" + + + "True" + "False" + + + @string/t + @string/f + + + "0" + "10" + + + "0" + "10" + + + "True" + "False" + + + @string/t + @string/f + + + "0" + "31" + + + "3" + "31" + + + "1" + "20" + + + "1" + "20" + + diff -Nru xscreensaver-5.30/android/project/xscreensaver/res/values/strings.xml xscreensaver-5.34/android/project/xscreensaver/res/values/strings.xml --- xscreensaver-5.30/android/project/xscreensaver/res/values/strings.xml 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/xscreensaver/res/values/strings.xml 2015-08-28 22:03:27.000000000 -0400 @@ -0,0 +1,132 @@ + + + Hello World! + Xscreensaver + A live wallpaper + + Xscreensaver + jwz and helpers + True + False + Sproingies + Settings + Sproingies + Set count + Choose count + 1 + 30 + 8 + Set wireframe + Choose wireframe + False + Superquadrics + Settings + Superquadrics + Set spinspeed + Choose spinspeed + 0.1 + 15.0 + 5.0 + Stonerview + Settings + Stonerview + Set transparent + Choose transparent + False + Unknownpleasures + Settings + Unknownpleasures + Set speed + Choose speed + 0.1 + 3.0 + 3.0 + Set wireframe + Choose wireframe + True + Bouncingcow + Settings + Bouncingcow + Set count + Choose count + 1 + 9 + 3 + Set speed + Choose speed + 0.05 + 2.0 + 0.1 + Hypertorus + Settings + Hypertorus + Set speedwz + Choose speedwz + -4.0 + 4.0 + 1.5 + Set displayMode + Choose displayMode + transparent + Set projection4d + Choose projection4d + orthographic + Set speedwy + Choose speedwy + -4.0 + 4.0 + 1.3 + Set appearance + Choose appearance + spirals-16 + Set colors + Choose colors + twosided + Set speedxz + Choose speedxz + -4.0 + 4.0 + 1.9 + Set speedxy + Choose speedxy + -4.0 + 4.0 + 1.7 + Set projection3d + Choose projection3d + orthographic + Set speedyz + Choose speedyz + -4.0 + 4.0 + 2.1 + Set speedwx + Choose speedwx + -4.0 + 4.0 + 1.1 + Glhanoi + Settings + Glhanoi + Set fog + Choose fog + True + Set trails + Choose trails + 0 + 10 + 2 + Set light + Choose light + False + Set poles + Choose poles + 3 + 31 + 0 + Set speed + Choose speed + 1 + 20 + 1 + diff -Nru xscreensaver-5.30/android/project/xscreensaver/res/xml/bouncingcow_settings.xml xscreensaver-5.34/android/project/xscreensaver/res/xml/bouncingcow_settings.xml --- xscreensaver-5.30/android/project/xscreensaver/res/xml/bouncingcow_settings.xml 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/xscreensaver/res/xml/bouncingcow_settings.xml 2015-08-28 22:03:27.000000000 -0400 @@ -0,0 +1,19 @@ + + + + + + + diff -Nru xscreensaver-5.30/android/project/xscreensaver/res/xml/bouncingcow.xml xscreensaver-5.34/android/project/xscreensaver/res/xml/bouncingcow.xml --- xscreensaver-5.30/android/project/xscreensaver/res/xml/bouncingcow.xml 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/xscreensaver/res/xml/bouncingcow.xml 2015-08-28 22:03:27.000000000 -0400 @@ -0,0 +1,5 @@ + + diff -Nru xscreensaver-5.30/android/project/xscreensaver/res/xml/glhanoi_settings.xml xscreensaver-5.34/android/project/xscreensaver/res/xml/glhanoi_settings.xml --- xscreensaver-5.30/android/project/xscreensaver/res/xml/glhanoi_settings.xml 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/xscreensaver/res/xml/glhanoi_settings.xml 2015-08-28 22:03:27.000000000 -0400 @@ -0,0 +1,39 @@ + + + + + + + + + + diff -Nru xscreensaver-5.30/android/project/xscreensaver/res/xml/glhanoi.xml xscreensaver-5.34/android/project/xscreensaver/res/xml/glhanoi.xml --- xscreensaver-5.30/android/project/xscreensaver/res/xml/glhanoi.xml 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/xscreensaver/res/xml/glhanoi.xml 2015-08-28 22:03:27.000000000 -0400 @@ -0,0 +1,5 @@ + + diff -Nru xscreensaver-5.30/android/project/xscreensaver/res/xml/hypertorus_settings.xml xscreensaver-5.34/android/project/xscreensaver/res/xml/hypertorus_settings.xml --- xscreensaver-5.30/android/project/xscreensaver/res/xml/hypertorus_settings.xml 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/xscreensaver/res/xml/hypertorus_settings.xml 2015-08-28 22:03:27.000000000 -0400 @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + diff -Nru xscreensaver-5.30/android/project/xscreensaver/res/xml/hypertorus.xml xscreensaver-5.34/android/project/xscreensaver/res/xml/hypertorus.xml --- xscreensaver-5.30/android/project/xscreensaver/res/xml/hypertorus.xml 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/xscreensaver/res/xml/hypertorus.xml 2015-08-28 22:03:27.000000000 -0400 @@ -0,0 +1,5 @@ + + diff -Nru xscreensaver-5.30/android/project/xscreensaver/res/xml/sproingies_settings.xml xscreensaver-5.34/android/project/xscreensaver/res/xml/sproingies_settings.xml --- xscreensaver-5.30/android/project/xscreensaver/res/xml/sproingies_settings.xml 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/xscreensaver/res/xml/sproingies_settings.xml 2015-08-28 22:03:27.000000000 -0400 @@ -0,0 +1,20 @@ + + + + + + + diff -Nru xscreensaver-5.30/android/project/xscreensaver/res/xml/sproingies.xml xscreensaver-5.34/android/project/xscreensaver/res/xml/sproingies.xml --- xscreensaver-5.30/android/project/xscreensaver/res/xml/sproingies.xml 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/xscreensaver/res/xml/sproingies.xml 2015-08-28 22:03:27.000000000 -0400 @@ -0,0 +1,5 @@ + + diff -Nru xscreensaver-5.30/android/project/xscreensaver/res/xml/stonerview_settings.xml xscreensaver-5.34/android/project/xscreensaver/res/xml/stonerview_settings.xml --- xscreensaver-5.30/android/project/xscreensaver/res/xml/stonerview_settings.xml 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/xscreensaver/res/xml/stonerview_settings.xml 2015-08-28 22:03:27.000000000 -0400 @@ -0,0 +1,14 @@ + + + + + + diff -Nru xscreensaver-5.30/android/project/xscreensaver/res/xml/stonerview.xml xscreensaver-5.34/android/project/xscreensaver/res/xml/stonerview.xml --- xscreensaver-5.30/android/project/xscreensaver/res/xml/stonerview.xml 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/xscreensaver/res/xml/stonerview.xml 2015-08-28 22:03:27.000000000 -0400 @@ -0,0 +1,5 @@ + + diff -Nru xscreensaver-5.30/android/project/xscreensaver/res/xml/superquadrics_settings.xml xscreensaver-5.34/android/project/xscreensaver/res/xml/superquadrics_settings.xml --- xscreensaver-5.30/android/project/xscreensaver/res/xml/superquadrics_settings.xml 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/xscreensaver/res/xml/superquadrics_settings.xml 2015-08-28 22:03:27.000000000 -0400 @@ -0,0 +1,13 @@ + + + + + + diff -Nru xscreensaver-5.30/android/project/xscreensaver/res/xml/superquadrics.xml xscreensaver-5.34/android/project/xscreensaver/res/xml/superquadrics.xml --- xscreensaver-5.30/android/project/xscreensaver/res/xml/superquadrics.xml 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/xscreensaver/res/xml/superquadrics.xml 2015-08-28 22:03:27.000000000 -0400 @@ -0,0 +1,5 @@ + + diff -Nru xscreensaver-5.30/android/project/xscreensaver/res/xml/unknownpleasures_settings.xml xscreensaver-5.34/android/project/xscreensaver/res/xml/unknownpleasures_settings.xml --- xscreensaver-5.30/android/project/xscreensaver/res/xml/unknownpleasures_settings.xml 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/xscreensaver/res/xml/unknownpleasures_settings.xml 2015-08-28 22:03:27.000000000 -0400 @@ -0,0 +1,20 @@ + + + + + + + diff -Nru xscreensaver-5.30/android/project/xscreensaver/res/xml/unknownpleasures.xml xscreensaver-5.34/android/project/xscreensaver/res/xml/unknownpleasures.xml --- xscreensaver-5.30/android/project/xscreensaver/res/xml/unknownpleasures.xml 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/xscreensaver/res/xml/unknownpleasures.xml 2015-08-28 22:03:27.000000000 -0400 @@ -0,0 +1,5 @@ + + diff -Nru xscreensaver-5.30/android/project/xscreensaver/src/org/jwz/xscreensaver/ARenderer.java xscreensaver-5.34/android/project/xscreensaver/src/org/jwz/xscreensaver/ARenderer.java --- xscreensaver-5.30/android/project/xscreensaver/src/org/jwz/xscreensaver/ARenderer.java 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/xscreensaver/src/org/jwz/xscreensaver/ARenderer.java 2014-11-10 23:22:31.000000000 -0500 @@ -0,0 +1,132 @@ +package org.jwz.xscreensaver; + +import javax.microedition.khronos.egl.EGLConfig; +import javax.microedition.khronos.opengles.GL10; + +import net.rbgrn.android.glwallpaperservice.*; +import android.opengl.GLU; + +import android.content.Context; +import android.content.SharedPreferences; + + +// Original code provided by Robert Green +// http://www.rbgrn.net/content/354-glsurfaceview-adapted-3d-live-wallpapers +public class ARenderer implements GLWallpaperService.Renderer { + + CallNative cn; + boolean secondRun = false; + + // Used for Lighting + //private static float[] ambientComponent0 = {0.3f, 0.3f, 1.0f, 1.0f}; + //private static float[] ambientComponent0 = {0.3f, 0.3f, 0.3f, 1.0f}; + private static float[] ambientComponent0 = {0.5f, 0.5f, 0.5f, 1.0f}; + private static float[] diffuseComponent0 = {1.0f, 1.0f, 1.0f, 1.0f}; + private static float[] lightPosition0 = {1f, 1f, -1f, 0f}; + + public void onDrawFrame(GL10 gl) { + if (!secondRun) { + secondRun = true; + return; + } + //gl.glClearColor(0.2f, 0.6f, 0.2f, 1f); + gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); + } + + public void onSurfaceChanged(GL10 gl, int width, int height) { + + gl.glMatrixMode(GL10.GL_PROJECTION); + gl.glLoadIdentity(); + GLU.gluPerspective(gl, 60f, (float)width/(float)height, 1f, 100f); + + gl.glMatrixMode(GL10.GL_MODELVIEW); + gl.glLoadIdentity(); + + gl.glMatrixMode(GL10.GL_MODELVIEW); + gl.glTranslatef(0, 0, -5); + gl.glRotatef(30f, 1, 0, 0); + + gl.glEnable(GL10.GL_LIGHTING); + gl.glEnable(GL10.GL_RESCALE_NORMAL); + gl.glEnableClientState(GL10.GL_NORMAL_ARRAY); +//Set the color of light bouncing off of surfaces to respect the surface color + gl.glEnable(GL10.GL_COLOR_MATERIAL); + + setupLightSources(gl); + +// Turn on a global ambient light. The "Cosmic Background Radiation", if you will. + //float[] ambientLightRGB = {0.3f, 0.3f, 0.3f, 1.0f}; + float[] ambientLightRGB = {0.5f, 0.5f, 0.5f, 1.0f}; + gl.glLightModelfv(GL10.GL_LIGHT_MODEL_AMBIENT, ambientLightRGB, 0); + NonSurfaceChanged(width, height); + } + + public void onSurfaceCreated(GL10 gl, EGLConfig config) { + + if (!secondRun) { + return; + } + cn = new CallNative(); + + gl.glClearDepthf(1f); + gl.glEnable(GL10.GL_DEPTH_TEST); + gl.glDepthFunc(GL10.GL_LEQUAL); + +//Turn on culling, so OpenGL only draws one side of the primitives + gl.glEnable(GL10.GL_CULL_FACE); +//Define the front of a primitive to be the side where the listed vertexes are counterclockwise + gl.glFrontFace(GL10.GL_CCW); +//Do not draw the backs of primitives + gl.glCullFace(GL10.GL_BACK); + + } + + private void setupLightSources(GL10 gl) { + if (!secondRun) { + return; + } + //Enable Light source 0 + gl.glEnable(GL10.GL_LIGHT0); + + //Useful part of the Arrays start a 0 + gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_AMBIENT, ambientComponent0, 0); + gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_DIFFUSE, diffuseComponent0, 0); + + //Position the light in the scene + gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_POSITION, lightPosition0, 0); + } + + /** + * Called when the engine is destroyed. Do any necessary clean up because + * at this point your renderer instance is now done for. + */ + public void release() { + NonDone(); + + } + + public void NonSurfaceCreated() { + cn.nativeInit(); + } + + void NonSurfaceChanged(int w, int h) { + if (!secondRun) { + return; + } + cn.nativeResize(w, h); + } + + void NonDrawFrame() { + cn.nativeRender(); + } + + void NonDone() { + cn.nativeDone(); + } + + static + { + System.loadLibrary ("xscreensaver"); + } + +} diff -Nru xscreensaver-5.30/android/project/xscreensaver/src/org/jwz/xscreensaver/BufferFactory.java xscreensaver-5.34/android/project/xscreensaver/src/org/jwz/xscreensaver/BufferFactory.java --- xscreensaver-5.30/android/project/xscreensaver/src/org/jwz/xscreensaver/BufferFactory.java 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/xscreensaver/src/org/jwz/xscreensaver/BufferFactory.java 2014-10-27 03:25:28.000000000 -0400 @@ -0,0 +1,46 @@ +package org.jwz.xscreensaver; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.FloatBuffer; +import java.nio.ShortBuffer; + +/** + * A utility class to create buffers. + * + * All public methods are static. The Singleton pattern was avoided to avoid concerns about + * threading and the Android life cycle. If needed, It can be implemented later given some research. + */ +public class BufferFactory { + // This class cannot and should not be instantiated + private BufferFactory() {} + + // We use Buffer.allocateDirect() to get memory outside of + // the normal, garbage collected heap. I think this is done + // because the buffer is subject to native I/O. + // See http://download.oracle.com/javase/1.4.2/docs/api/java/nio/ByteBuffer.html#direct + + /** + * Creates a buffer of floats using memory outside the normal, garbage collected heap + * + * @param capacity The number of primitives to create in the buffer. + */ + public static FloatBuffer createFloatBuffer(int capacity) { + // 4 is the number of bytes in a float + ByteBuffer vbb = ByteBuffer.allocateDirect(capacity * 4); + vbb.order(ByteOrder.nativeOrder()); + return vbb.asFloatBuffer(); + } + + /** + * Creates a buffer of shorts using memory outside the normal, garbage collected heap + * + * @param capacity The number of primitives to create in the buffer. + */ + public static ShortBuffer createShortBuffer(int capacity) { + // 2 is the number of bytes in a short + ByteBuffer vbb = ByteBuffer.allocateDirect(capacity * 2); + vbb.order(ByteOrder.nativeOrder()); + return vbb.asShortBuffer(); + } +} diff -Nru xscreensaver-5.30/android/project/xscreensaver/src/org/jwz/xscreensaver/CallNative.java xscreensaver-5.34/android/project/xscreensaver/src/org/jwz/xscreensaver/CallNative.java --- xscreensaver-5.30/android/project/xscreensaver/src/org/jwz/xscreensaver/CallNative.java 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/xscreensaver/src/org/jwz/xscreensaver/CallNative.java 2014-10-27 03:25:28.000000000 -0400 @@ -0,0 +1,25 @@ +package org.jwz.xscreensaver; + +public class CallNative { + + void onSurfaceCreated() { + nativeInit(); + } + + void onSurfaceChanged(int w, int h) { + nativeResize(w, h); + } + + void onDrawFrame() { + nativeRender(); + } + + void onDone() { + nativeDone(); + } + + public static native void nativeInit(); + public static native void nativeResize(int w, int h); + public static native void nativeRender(); + public static native void nativeDone(); +} diff -Nru xscreensaver-5.30/android/project/xscreensaver/src/org/jwz/xscreensaver/SliderPreference.java xscreensaver-5.34/android/project/xscreensaver/src/org/jwz/xscreensaver/SliderPreference.java --- xscreensaver-5.30/android/project/xscreensaver/src/org/jwz/xscreensaver/SliderPreference.java 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/xscreensaver/src/org/jwz/xscreensaver/SliderPreference.java 2015-06-19 14:56:42.000000000 -0400 @@ -0,0 +1,151 @@ +/* + * Copyright 2012 Jay Weisskopf + * + * Licensed under the MIT License (see LICENSE.txt) + */ + +//package net.jayschwa.android.preference; +package org.jwz.xscreensaver; + + +import android.content.Context; +import android.content.res.TypedArray; +import android.preference.DialogPreference; +import android.util.AttributeSet; +import android.view.View; +import android.widget.SeekBar; + +/** + * @author Jay Weisskopf + */ +public class SliderPreference extends DialogPreference { + + protected final static int SEEKBAR_RESOLUTION = 10000; + + protected float mValue; + protected int mSeekBarValue; + protected CharSequence[] mSummaries; + + /** + * @param context + * @param attrs + */ + public SliderPreference(Context context, AttributeSet attrs) { + super(context, attrs); + setup(context, attrs); + } + + /** + * @param context + * @param attrs + * @param defStyle + */ + public SliderPreference(Context context, AttributeSet attrs, int defStyle) { + super(context, attrs, defStyle); + setup(context, attrs); + } + + private void setup(Context context, AttributeSet attrs) { + setDialogLayoutResource(R.layout.slider_preference_dialog); + TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.SliderPreference); + try { + setSummary(a.getTextArray(R.styleable.SliderPreference_android_summary)); + } catch (Exception e) { + // Do nothing + } + a.recycle(); + } + + @Override + protected Object onGetDefaultValue(TypedArray a, int index) { + return a.getFloat(index, 0); + } + + @Override + protected void onSetInitialValue(boolean restoreValue, Object defaultValue) { + setValue(restoreValue ? getPersistedFloat(mValue) : (Float) defaultValue); + } + + @Override + public CharSequence getSummary() { + if (mSummaries != null && mSummaries.length > 0) { + int index = (int) (mValue * mSummaries.length); + index = Math.min(index, mSummaries.length - 1); + return mSummaries[index]; + } else { + return super.getSummary(); + } + } + + public void setSummary(CharSequence[] summaries) { + mSummaries = summaries; + } + + @Override + public void setSummary(CharSequence summary) { + super.setSummary(summary); + mSummaries = null; + } + + @Override + public void setSummary(int summaryResId) { + try { + setSummary(getContext().getResources().getStringArray(summaryResId)); + } catch (Exception e) { + super.setSummary(summaryResId); + } + } + + public float getValue() { + return mValue; + } + + public void setValue(float value) { + value = Math.max(0, Math.min(value, 1)); // clamp to [0, 1] + if (shouldPersist()) { + persistFloat(value); + } + if (value != mValue) { + mValue = value; + notifyChanged(); + } + } + + @Override + protected View onCreateDialogView() { + mSeekBarValue = (int) (mValue * SEEKBAR_RESOLUTION); + View view = super.onCreateDialogView(); + SeekBar seekbar = (SeekBar) view.findViewById(R.id.slider_preference_seekbar); + seekbar.setMax(SEEKBAR_RESOLUTION); + seekbar.setProgress(mSeekBarValue); + seekbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { + + @Override + public void onStopTrackingTouch(SeekBar seekBar) { + } + + @Override + public void onStartTrackingTouch(SeekBar seekBar) { + } + + @Override + public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { + if (fromUser) { + SliderPreference.this.mSeekBarValue = progress; + } + } + }); + return view; + } + + @Override + protected void onDialogClosed(boolean positiveResult) { + final float newValue = (float) mSeekBarValue / SEEKBAR_RESOLUTION; + if (positiveResult && callChangeListener(newValue)) { + setValue(newValue); + } + super.onDialogClosed(positiveResult); + } + + // TODO: Save and restore preference state. +} diff -Nru xscreensaver-5.30/android/project/xscreensaver/src/org/jwz/xscreensaver/XscreensaverApp.java xscreensaver-5.34/android/project/xscreensaver/src/org/jwz/xscreensaver/XscreensaverApp.java --- xscreensaver-5.30/android/project/xscreensaver/src/org/jwz/xscreensaver/XscreensaverApp.java 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/project/xscreensaver/src/org/jwz/xscreensaver/XscreensaverApp.java 2015-06-25 14:46:50.000000000 -0400 @@ -0,0 +1,18 @@ +package org.jwz.xscreensaver; + +import android.app.Application; +import android.content.SharedPreferences; + +public class XscreensaverApp extends Application { + + public XscreensaverApp() { + super(); + } + + + public SharedPreferences getThePrefs(String p) { + SharedPreferences prefs = getApplicationContext().getSharedPreferences(p, 0); + return prefs; + } + +} diff -Nru xscreensaver-5.30/android/README xscreensaver-5.34/android/README --- xscreensaver-5.30/android/README 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/README 2015-06-19 15:10:52.000000000 -0400 @@ -0,0 +1,86 @@ + +This directory contains the Android-specific code for building xscreensaver. + +It is preliminary, and very much a work in progress. + +If you're messing with this, please let us know! + + dennis@panaceasupplies.com + jwz@jwz.org + + +To build: + + Install JDK 7 (http://www.oracle.com/technetwork/java/javase/downloads/) + Install Android Studio (http://developer.android.com/sdk/) + Install Android NDK (http://developer.android.com/ndk/downloads) + Rename or link the "android-ndk-*" directory to "ndk" inside your + $ANDROID_HOME (the "sdk/" directory that is the parent of + "build-tools/", etc.) That is, it should be "sdk/ndk/". + + set $ANDROID_HOME to where your SDK is installed, or + set "sdk.dir" in project/local.properties. + On MacOS, the value you want is probably ~/Library/Android/sdk/ + Also set "ndk.dir" in project/local.properties. + + cd android + make + + If it fails, try a "make clean" and then try make again. + Make sure you have the needed Android SDK platform versions installed. + + Hopefully an "xscreensaver-debug.apk" file will appear in + android/project/xscreensaver/build/outputs/apk/. + + Load that onto your device and go to: + Settings / Display / Wallpaper / Live Wallpapers. + + To launch the emulator: + $ANDROID_HOME/sdk/tools/emulator -avd Nexus_5_API_21_x86 + + To load it into the currently-running emulator: + $ANDROID_HOME/platform-tools/adb install -r \ + project/xscreensaver/build/outputs/apk/xscreensaver-debug.apk + + +The files in these subdirectories are source code, more or less: + + project/xscreensaver/*.xml + project/xscreensaver/src/org/jwz/xscreensaver/ + project/GLWallpaperService/ (a third-party library, unchanged) + +These directories are boilerplate for Android apps: + + project/xscreensaver/res/layout/ + project/xscreensaver/res/values/ + project/xscreensaver/res/xml/ + project/xscreensaver/res/drawable-ldpi/ + project/xscreensaver/res/drawable-mdpi/ + project/xscreensaver/res/drawable-hdpi/ + project/xscreensaver/res/drawable/thumbnail.png + +These are files that we generate: + + project/xscreensaver/src/org/jwz/xscreensaver/gen/ + +These too (intermediate build files): + + .gradle/ + gen/ + project/GLWallpaperService/build/ + project/build/ + project/xscreensaver/build/ + project/xscreensaver/libs/ + project/xscreensaver/obj/ + project/xscreensaver/res/xml/ + +These are files that we *will* generate but don't yet: + + project/xscreensaver/res/drawable/*.png + XScreenSaverView.c + +When adding a new hack, edit: + + project/xscreensaver/jni/Android.mk + project/xscreensaver/build.gradle + generate_files.pl diff -Nru xscreensaver-5.30/android/XScreenSaverGLView.c xscreensaver-5.34/android/XScreenSaverGLView.c --- xscreensaver-5.30/android/XScreenSaverGLView.c 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/XScreenSaverGLView.c 2015-08-28 22:09:08.000000000 -0400 @@ -0,0 +1,84 @@ +#include +#include "screenhackI.h" +#include "xlockmoreI.h" + +#if defined(USE_IPHONE) || (HAVE_ANDROID) +# include "jwzgles.h" +#else +# include +#endif + +/* used by the OpenGL screen savers + */ +extern GLXContext *init_GL (ModeInfo *); +extern void glXSwapBuffers (Display *, Window); +extern void glXMakeCurrent (Display *, Window, GLXContext); +extern void clear_gl_error (void); +extern void check_gl_error (const char *type); + +/* Does nothing - prepareContext already did the work. + */ +void +glXMakeCurrent (Display *dpy, Window window, GLXContext context) +{ +} + + +/* clear away any lingering error codes */ +void +clear_gl_error (void) +{ + while (glGetError() != GL_NO_ERROR) + ; +} + + +// needs to be implemented in Android... +/* Copy the back buffer to the front buffer. + */ +void +glXSwapBuffers (Display *dpy, Window window) +{ +} + + +/* Called by OpenGL savers using the XLockmore API. + */ +GLXContext * +init_GL (ModeInfo *mi) +{ + Window win = mi->window; + + // Caller expects a pointer to an opaque struct... which it dereferences. + // Don't ask me, it's historical... + static int blort = -1; + return (void *) &blort; +} + +/* report a GL error. */ +void +check_gl_error (const char *type) +{ + char buf[100]; + GLenum i; + const char *e; + switch ((i = glGetError())) { + case GL_NO_ERROR: return; + case GL_INVALID_ENUM: e = "invalid enum"; break; + case GL_INVALID_VALUE: e = "invalid value"; break; + case GL_INVALID_OPERATION: e = "invalid operation"; break; + case GL_STACK_OVERFLOW: e = "stack overflow"; break; + case GL_STACK_UNDERFLOW: e = "stack underflow"; break; + case GL_OUT_OF_MEMORY: e = "out of memory"; break; +#ifdef GL_TABLE_TOO_LARGE_EXT + case GL_TABLE_TOO_LARGE_EXT: e = "table too large"; break; +#endif +#ifdef GL_TEXTURE_TOO_LARGE_EXT + case GL_TEXTURE_TOO_LARGE_EXT: e = "texture too large"; break; +#endif + default: + e = buf; sprintf (buf, "unknown GL error %d", (int) i); break; + } + __android_log_write(ANDROID_LOG_ERROR, "xscreensaver", e); +} + diff -Nru xscreensaver-5.30/android/XScreenSaverView.c xscreensaver-5.34/android/XScreenSaverView.c --- xscreensaver-5.30/android/XScreenSaverView.c 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/android/XScreenSaverView.c 2015-08-28 21:57:21.000000000 -0400 @@ -0,0 +1,425 @@ +#include +#include +#include +//#include +#include "screenhackI.h" +#include "xlockmoreI.h" + +#ifndef isupper +# define isupper(c) ((c) >= 'A' && (c) <= 'Z') +#endif +#ifndef _tolower +# define _tolower(c) ((c) - 'A' + 'a') +#endif + +extern struct xscreensaver_function_table *xscreensaver_function_table; + +extern const char *progname; +extern const char *progclass; +int mono_p = 0; + +static char *hilbert_mode; +static char *sproingies_count; +static char *sproingies_wireframe; +static char *bouncingcow_count; +static char *bouncingcow_speed; +static char *superquadrics_spinspeed; +static char *stonerview_delay; +static char *stonerview_transparent; +static char *unknownpleasures_wireframe; +static char *unknownpleasures_speed; +static char *hypertorus_displayMode; +static char *hypertorus_appearance; +static char *hypertorus_colors; +static char *hypertorus_projection3d; +static char *hypertorus_projection4d; +static char *hypertorus_speedwx; +static char *hypertorus_speedwy; +static char *hypertorus_speedwz; +static char *hypertorus_speedxy; +static char *hypertorus_speedxz; +static char *hypertorus_speedyz; +static char *glhanoi_light; +static char *glhanoi_fog; +static char *glhanoi_trails; +static char *glhanoi_poles; +static char *glhanoi_speed; + + +Bool +get_boolean_resource (Display *dpy, char *res_name, char *res_class) +{ + char *tmp, buf [100]; + char *s = get_string_resource (dpy, res_name, res_class); + char *os = s; + if (! s) return 0; + for (tmp = buf; *s; s++) + *tmp++ = isupper (*s) ? _tolower (*s) : *s; + *tmp = 0; + //free (os); + + while (*buf && + (buf[strlen(buf)-1] == ' ' || + buf[strlen(buf)-1] == '\t')) + buf[strlen(buf)-1] = 0; + + if (!strcmp (buf, "on") || !strcmp (buf, "true") || !strcmp (buf, "yes")) + return 1; + if (!strcmp (buf,"off") || !strcmp (buf, "false") || !strcmp (buf,"no")) + return 0; + fprintf (stderr, "%s: %s must be boolean, not %s.\n", + progname, res_name, buf); + return 0; +} + +int +get_integer_resource (Display *dpy, char *res_name, char *res_class) +{ + int val; + char c, *s = get_string_resource (dpy, res_name, res_class); + char *ss = s; + if (!s) return 0; + + while (*ss && *ss <= ' ') ss++; /* skip whitespace */ + + if (ss[0] == '0' && (ss[1] == 'x' || ss[1] == 'X')) /* 0x: parse as hex */ + { + if (1 == sscanf (ss+2, "%x %c", (unsigned int *) &val, &c)) + { + //free (s); + return val; + } + } + else /* else parse as dec */ + { + if (1 == sscanf (ss, "%d %c", &val, &c)) + { + //free (s); + return val; + } + } + + fprintf (stderr, "%s: %s must be an integer, not %s.\n", + progname, res_name, s); + //free (s); + return 0; +} + +double +get_float_resource (Display *dpy, char *res_name, char *res_class) +{ + double val; + char c, *s = get_string_resource (dpy, res_name, res_class); + if (! s) return 0.0; + if (1 == sscanf (s, " %lf %c", &val, &c)) + { + //free (s); + return val; + } + fprintf (stderr, "%s: %s must be a float, not %s.\n", + progname, res_name, s); + //free (s); + return 0.0; +} + + +// TODO: fill in what is not here +char *get_string_resource(Display * dpy, char *name, char *class) +{ + char *implement; + //__android_log_print (ANDROID_LOG_INFO, "xscreensaver", "s %s %s %s", progname, name, class); + + if (strcmp(progname, "hilbert") == 0) { + if (strcmp(name, "mode") == 0 && strcmp(class, "Mode") == 0) { + implement = malloc(8 * sizeof(char)); + strcpy(implement, hilbert_mode); + } else if (strcmp(name, "ends") == 0 && strcmp(class, "Ends") == 0) { + implement = malloc(5 * sizeof(char)); + strcpy(implement, "open"); + } else if (strcmp(name, "speed") == 0 && strcmp(class, "Speed") == 0) { + return "1.0"; + } else if (strcmp(name, "thickness") == 0 + && strcmp(class, "Thickness") == 0) { + return "0.25"; + } else if (strcmp(name, "delay") == 0 && strcmp(class, "Usecs") == 0) { + return "30000"; + } else if (strcmp(name, "maxDepth") == 0 + && strcmp(class, "MaxDepth") == 0) { + // too deep is too much for less powerful Android phones + return "3"; + //return 5; + } else if (strcmp(name, "spin") == 0 && strcmp(class, "Spin") == 0) { + return "True"; + } else if (strcmp(name, "wireframe") == 0 + && strcmp(class, "Boolean") == 0) { + return "False"; + } else if (strcmp(name, "wander") == 0 + && strcmp(class, "Wander") == 0) { + return "False"; + } else { + return 0; + } + } + else if (strcmp(progname, "sproingies") == 0) { + if (strcmp(name, "count") == 0 && strcmp(class, "Int") == 0) { + return sproingies_count; + } else if (strcmp(name, "wireframe") == 0 + && strcmp(class, "Boolean") == 0) { + return sproingies_wireframe; + } else { + return 0; + } + } + else if (strcmp(progname, "superquadrics") == 0) { + if (strcmp(name, "spinspeed") == 0 + && strcmp(class, "Spinspeed") == 0) { + return superquadrics_spinspeed; + } else if (strcmp(name, "count") == 0 && strcmp(class, "Int") == 0) { + return "25"; + } else if (strcmp(name, "cycles") == 0 + && strcmp(class, "Int") == 0) { + return "40"; + } else if (strcmp(name, "delay") == 0 + && strcmp(class, "Usecs") == 0) { + return "40000"; + } else if (strcmp(name, "wireframe") == 0 + && strcmp(class, "Boolean") == 0) { + return "False"; + } else { + return 0; + } + } + else if (strcmp(progname, "stonerview") == 0) { + if (strcmp(name, "use3d") == 0 && strcmp(class, "Boolean") == 0) { + return "True"; + } else if (strcmp(name, "transparent") == 0 + && strcmp(class, "Transparent") == 0) { + return stonerview_transparent; + } else if (strcmp(name, "wireframe") == 0 + && strcmp(class, "Boolean") == 0) { + return "False"; + } else if (strcmp(name, "doFPS") == 0 + && strcmp(class, "DoFPS") == 0) { + return "False"; + } else { + return 0; + } + } + else if (strcmp(progname, "bouncingcow") == 0) { + if (strcmp(name, "count") == 0 + && strcmp(class, "Int") == 0) { + return bouncingcow_count; + } else if (strcmp(name, "speed") == 0 + && strcmp(class, "Speed") == 0) { + return bouncingcow_speed; + } else { + return 0; + } + } + else if (strcmp(progname, "unknownpleasures") == 0) { + + if (strcmp(name, "wireframe") == 0) { + return unknownpleasures_wireframe; + } else if (strcmp(name, "speed") == 0) { + return unknownpleasures_speed; + } else if (strcmp(name, "count") == 0) { + return "80"; + } else if (strcmp(name, "resolution") == 0) { + return "100"; + //return "200"; + } else if (strcmp(name, "ortho") == 0) { + return "True"; + //return "False"; + } else { + return 0; + } + + } + else if (strcmp(progname, "hypertorus") == 0) { + if (strcmp(name, "displayMode") == 0) { + return hypertorus_displayMode; + } else if (strcmp(name, "appearance") == 0) { + return hypertorus_appearance; + } else if (strcmp(name, "colors") == 0) { + return hypertorus_colors; + } else if (strcmp(name, "projection3d") == 0) { + return hypertorus_projection3d; + } else if (strcmp(name, "projection4d") == 0) { + return hypertorus_projection4d; + } else if (strcmp(name, "speedwx") == 0) { + return hypertorus_speedwz; + } else if (strcmp(name, "speedwy") == 0) { + return hypertorus_speedwy; + } else if (strcmp(name, "speedwz") == 0) { + return hypertorus_speedwz; + } else if (strcmp(name, "speedxy") == 0) { + return hypertorus_speedxy; + } else if (strcmp(name, "speedxz") == 0) { + return hypertorus_speedxz; + } else if (strcmp(name, "speedyz") == 0) { + return hypertorus_speedyz; + } else { + return 0; + } + } + else if (strcmp(progname, "glhanoi") == 0) { + if (strcmp(name, "light") == 0) { + return glhanoi_light; + } else if (strcmp(name, "fog") == 0) { + return glhanoi_fog; + } else if (strcmp(name, "trails") == 0) { + return glhanoi_trails; + } else if (strcmp(name, "poles") == 0) { + return glhanoi_poles; + } else if (strcmp(name, "speed") == 0) { + return glhanoi_speed; + } else { + return 0; + } + } + else { + implement = 0; + } + + return implement; +} + + +void setSuperquadricsSettings(char *hck, char *khck) +{ + if (strcmp(khck, "superquadrics_spinspeed") == 0) { + superquadrics_spinspeed = malloc(4 * sizeof(char)); + strcpy(superquadrics_spinspeed, hck); + } +} + +void setHilbertSettings(char *hck, char *khck) +{ + if (strcmp(khck, "hilbert_mode") == 0) { + if (!hilbert_mode) { + hilbert_mode = malloc(8 * sizeof(char)); + } + if (strcmp(hck, "3D") == 0) { + strcpy(hilbert_mode, "3D"); + } + else if (strcmp(hck, "2D") == 0) { + strcpy(hilbert_mode, "2D"); + } + } +} + +void setSproingiesSettings(char *hck, char *khck) +{ + if (strcmp(khck, "sproingies_count") == 0) { + sproingies_count = malloc(3 * sizeof(char)); + strcpy(sproingies_count, hck); + } + else if (strcmp(khck, "sproingies_wireframe") == 0) { + sproingies_wireframe = malloc(6 * sizeof(char)); + strcpy(sproingies_wireframe, hck); + } +} + +void setStonerviewSettings(char *hck, char *khck) +{ + if (strcmp(khck, "stonerview_transparent") == 0) { + stonerview_transparent = malloc(6 * sizeof(char)); + strcpy(stonerview_transparent, hck); + } +} + +void setBouncingcowSettings(char *hck, char *khck) +{ + if (strcmp(khck, "bouncingcow_count") == 0) { + bouncingcow_count = malloc(3 * sizeof(char)); + strcpy(bouncingcow_count, hck); + } + else if (strcmp(khck, "bouncingcow_speed") == 0) { + bouncingcow_speed = malloc(4 * sizeof(char)); + strcpy(bouncingcow_speed, hck); + } +} + +void setUnknownpleasuresSettings(char *hck, char *khck) +{ + if (strcmp(khck, "unknownpleasures_speed") == 0) { + unknownpleasures_speed = malloc(3 * sizeof(char)); + strcpy(unknownpleasures_speed, hck); + } + else if (strcmp(khck, "unknownpleasures_wireframe") == 0) { + unknownpleasures_wireframe = malloc(6 * sizeof(char)); + strcpy(unknownpleasures_wireframe, hck); + } +} + +void setHypertorusSettings(char *hck, char *khck) +{ + if (strcmp(khck, "hypertorus_displayMode") == 0) { + hypertorus_displayMode = malloc(13 * sizeof(char)); + strcpy(hypertorus_displayMode, hck); + } + else if (strcmp(khck, "hypertorus_appearance") == 0) { + hypertorus_appearance = malloc(12 * sizeof(char)); + strcpy(hypertorus_appearance, hck); + } + else if (strcmp(khck, "hypertorus_colors") == 0) { + hypertorus_colors = malloc(5 * sizeof(char)); + strcpy(hypertorus_colors, hck); + } + else if (strcmp(khck, "hypertorus_projection3d") == 0) { + hypertorus_projection3d = malloc(17 * sizeof(char)); + strcpy(hypertorus_projection3d, hck); + } + else if (strcmp(khck, "hypertorus_projection4d") == 0) { + hypertorus_projection4d = malloc(17 * sizeof(char)); + strcpy(hypertorus_projection4d, hck); + } + else if (strcmp(khck, "hypertorus_speedwx") == 0) { + hypertorus_speedwx = malloc(5 * sizeof(char)); + strcpy(hypertorus_speedwx, hck); + } + else if (strcmp(khck, "hypertorus_speedwy") == 0) { + hypertorus_speedwy = malloc(5 * sizeof(char)); + strcpy(hypertorus_speedwy, hck); + } + else if (strcmp(khck, "hypertorus_speedwz") == 0) { + hypertorus_speedwz = malloc(5 * sizeof(char)); + strcpy(hypertorus_speedwz, hck); + } + else if (strcmp(khck, "hypertorus_speedxy") == 0) { + hypertorus_speedxy = malloc(5 * sizeof(char)); + strcpy(hypertorus_speedxy, hck); + } + else if (strcmp(khck, "hypertorus_speedxz") == 0) { + hypertorus_speedxz = malloc(5 * sizeof(char)); + strcpy(hypertorus_speedxz, hck); + } + else if (strcmp(khck, "hypertorus_speedyz") == 0) { + hypertorus_speedyz = malloc(5 * sizeof(char)); + strcpy(hypertorus_speedyz, hck); + } +} + +void setGlhanoiSettings(char *hck, char *khck) { + + if (strcmp(khck, "glhanoi_light") == 0) { + glhanoi_light = malloc(6 * sizeof(char)); + strcpy(glhanoi_light , hck); + } + else if (strcmp(khck, "glhanoi_fog") == 0) { + glhanoi_fog = malloc(6 * sizeof(char)); + strcpy(glhanoi_fog , hck); + } + else if (strcmp(khck, "glhanoi_trails") == 0) { + glhanoi_trails = malloc(3 * sizeof(char)); + strcpy(glhanoi_trails , hck); + } + else if (strcmp(khck, "glhanoi_poles") == 0) { + glhanoi_poles = malloc(3 * sizeof(char)); + strcpy(glhanoi_poles , hck); + } + else if (strcmp(khck, "glhanoi_speed") == 0) { + glhanoi_speed = malloc(3 * sizeof(char)); + strcpy(glhanoi_speed , hck); + } +} diff -Nru xscreensaver-5.30/config.h.in xscreensaver-5.34/config.h.in --- xscreensaver-5.30/config.h.in 2014-08-02 17:08:46.000000000 -0400 +++ xscreensaver-5.34/config.h.in 2014-10-08 14:09:49.000000000 -0400 @@ -85,6 +85,9 @@ (gdk-pixbuf 2.12). */ #undef HAVE_GDK_PIXBUF_APPLY_EMBEDDED_ORIENTATION +/* Define to 1 if you have the `getaddrinfo' function. */ +#undef HAVE_GETADDRINFO + /* Define to 1 if you have the `getcwd' function. */ #undef HAVE_GETCWD @@ -223,6 +226,9 @@ /* Define to 1 if you have the `realpath' function. */ #undef HAVE_REALPATH +/* Define this to enable recording of videos. */ +#undef HAVE_RECORD_ANIM + /* Define to 1 if you have the `sbrk' function. */ #undef HAVE_SBRK @@ -263,6 +269,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H +/* Define to 1 if `sa_len' is a member of `struct sockaddr'. */ +#undef HAVE_STRUCT_SOCKADDR_SA_LEN + /* Define to 1 if you have the `syslog' function. */ #undef HAVE_SYSLOG @@ -320,6 +329,9 @@ XF86VidMode[GS]etGamma(). These appeared in XFree86 4.1.0. */ #undef HAVE_XF86VMODE_GAMMA_RAMP +/* Define this if you have libXft2. */ +#undef HAVE_XFT + /* Define this if you have the XHPDisableReset function (an HP only thing which allows the Ctrl-Sh-Reset key sequence to be temporarily disabled.) */ #undef HAVE_XHPDISABLERESET @@ -351,6 +363,9 @@ /* Define this if you have the X Shared Memory Extension. */ #undef HAVE_XSHM_EXTENSION +/* Define this if you have the function Xutf8DrawString(). */ +#undef HAVE_XUTF8DRAWSTRING + /* Define this to remove the option of locking the screen at all. */ #undef NO_LOCKING diff -Nru xscreensaver-5.30/configure xscreensaver-5.34/configure --- xscreensaver-5.30/configure 2014-09-11 13:07:53.000000000 -0400 +++ xscreensaver-5.34/configure 2015-10-24 15:14:58.000000000 -0400 @@ -625,6 +625,8 @@ DEPEND_FLAGS DEPEND APPDEFAULTS +ANIM_LIBS +ANIM_OBJS GTK_EXTRA_OBJS HACK_CONF_DIR PO_DATADIR @@ -649,6 +651,9 @@ SAVER_GL_LIBS SAVER_GL_OBJS SAVER_GL_SRCS +XFT_LIBS +XFT_OBJS +XFT_SRCS XMU_LIBS XMU_OBJS XMU_SRCS @@ -846,6 +851,7 @@ with_pixbuf with_xpm with_jpeg +with_xft with_xshm_ext with_xdbe_ext with_readdisplay @@ -853,6 +859,7 @@ with_text_file with_browser with_setuid_hacks +with_record_animation ' ac_precious_vars='build_alias host_alias @@ -1542,6 +1549,7 @@ --with-xpm Include support for XPM files in some demos. (Not needed if Pixbuf is used.) --with-jpeg Include support for the JPEG library. + --with-xft Include support for the X Freetype library. --with-xshm-ext Include support for the Shared Memory extension. --with-xdbe-ext Include support for the DOUBLE-BUFFER extension. --with-readdisplay Include support for the XReadDisplay extension. @@ -1552,6 +1560,8 @@ --with-setuid-hacks Allow some demos to be installed `setuid root' (which is needed in order to ping other hosts.) + --with-record-animation Include code for generating MP4 videos. + Some influential environment variables: CC C compiler command @@ -2045,6 +2055,63 @@ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func + +# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES +# ---------------------------------------------------- +# Tries to find if the field MEMBER exists in type AGGR, after including +# INCLUDES, setting cache variable VAR accordingly. +ac_fn_c_check_member () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 +$as_echo_n "checking for $2.$3... " >&6; } +if eval \${$4+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main () +{ +static $2 ac_aggr; +if (ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$4=yes" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main () +{ +static $2 ac_aggr; +if (sizeof ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$4=yes" +else + eval "$4=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$4 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_member cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. @@ -2553,6 +2620,12 @@ + + + + + + # After checking to see that --srcdir is correct (which AC_INIT does) # check for some random other files that come later in the tar file, # to make sure everything is here. @@ -5191,12 +5264,13 @@ done -for ac_header in unistd.h +for ac_header in unistd.h inttypes.h do : - ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" -if test "x$ac_cv_header_unistd_h" = xyes; then : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF -#define HAVE_UNISTD_H 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -5800,6 +5874,28 @@ fi done +for ac_func in getaddrinfo +do : + ac_fn_c_check_func "$LINENO" "getaddrinfo" "ac_cv_func_getaddrinfo" +if test "x$ac_cv_func_getaddrinfo" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GETADDRINFO 1 +_ACEOF + +fi +done + +ac_fn_c_check_member "$LINENO" "struct sockaddr" "sa_len" "ac_cv_member_struct_sockaddr_sa_len" "#include +" +if test "x$ac_cv_member_struct_sockaddr_sa_len" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_SOCKADDR_SA_LEN 1 +_ACEOF + + +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct icmp" >&5 $as_echo_n "checking for struct icmp... " >&6; } if ${ac_cv_have_icmp+:} false; then : @@ -6727,27 +6823,16 @@ if ${ac_cv_x_app_defaults+:} false; then : $as_echo_n "(cached) " >&6 else - - rm -fr conftestdir - if mkdir conftestdir; then - cd conftestdir 2>/dev/null - # Make sure to not put "make" in the Imakefile rules, since we grep it out. - cat > Imakefile <<'EOF' -acfindx: - @echo 'ac_x_app_defaults="${XAPPLOADDIR}"' -EOF - if (xmkmf) >/dev/null 2>&1 && test -f Makefile; then - # GNU make sometimes prints "make[1]: Entering...", which'd confuse us. - eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` - fi - cd .. 2>/dev/null - rm -fr conftestdir - fi + # skip this, it's always wrong these days. + # AC_PATH_X_APP_DEFAULTS_XMKMF if test x"$ac_x_app_defaults" = x; then - + true # Look for the directory under a standard set of common directories. # Check X11 before X11Rn because it's often a symlink to the current release. for ac_dir in \ + \ + /usr/share/X11/app-defaults \ + \ /usr/X11/lib/app-defaults \ /usr/X11R6/lib/app-defaults \ /usr/X11R6/lib/X11/app-defaults \ @@ -6761,6 +6846,8 @@ /usr/lib/X11R5/app-defaults \ /usr/lib/X11R4/app-defaults \ \ + /etc/X11/app-defaults \ + \ /usr/local/X11/lib/app-defaults \ /usr/local/X11R6/lib/app-defaults \ /usr/local/X11R5/lib/app-defaults \ @@ -6804,6 +6891,7 @@ fi if test x"$ac_x_app_defaults" = x; then + /bin/echo -n 'fallback: ' ac_cv_x_app_defaults="/usr/lib/X11/app-defaults" else # Record where we found app-defaults for the cache. @@ -11687,6 +11775,8 @@ with_login_manager_req=unspecified default_login_manager_1='gdmflexiserver -ls' default_login_manager_2='kdmctl reserve' +default_login_manager_3='lxdm -c USER_SWITCH' +default_login_manager_4='dm-tool switch-to-greeter' # Check whether --with-login-manager was given. @@ -11709,11 +11799,14 @@ ;; yes|unspecified) - # Try both defaults, use the one that exists. + # Try various defaults, use the first one that exists. - set dummy $default_login_manager_1 ; login_manager_tmp=$2 - unset ac_cv_path_login_manager_tmp # don't cache - # Extract the first word of "$login_manager_tmp", so it can be a program name with args. + with_login_manager="" + + if test -z "$with_login_manager" ; then + set dummy $default_login_manager_1 ; login_manager_tmp=$2 + unset ac_cv_path_login_manager_tmp # don't cache + # Extract the first word of "$login_manager_tmp", so it can be a program name with args. set dummy $login_manager_tmp; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } @@ -11753,9 +11846,12 @@ fi - if test ! -z "$login_manager_tmp" ; then - with_login_manager="$default_login_manager_1" - else + if test ! -z "$login_manager_tmp" ; then + with_login_manager="$default_login_manager_1" + fi + fi + + if test -z "$with_login_manager" ; then set dummy $default_login_manager_2 ; login_manager_tmp=$2 unset ac_cv_path_login_manager_tmp # don't cache # Extract the first word of "$login_manager_tmp", so it can be a program name with args. @@ -11800,10 +11896,105 @@ if test ! -z "$login_manager_tmp" ; then with_login_manager="$default_login_manager_2" - else - with_login_manager="" fi fi + + if test -z "$with_login_manager" ; then + set dummy $default_login_manager_3 ; login_manager_tmp=$2 + unset ac_cv_path_login_manager_tmp # don't cache + # Extract the first word of "$login_manager_tmp", so it can be a program name with args. +set dummy $login_manager_tmp; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_login_manager_tmp+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $login_manager_tmp in + [\\/]* | ?:[\\/]*) + ac_cv_path_login_manager_tmp="$login_manager_tmp" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_login_manager_tmp="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +login_manager_tmp=$ac_cv_path_login_manager_tmp +if test -n "$login_manager_tmp"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $login_manager_tmp" >&5 +$as_echo "$login_manager_tmp" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test ! -z "$login_manager_tmp" ; then + with_login_manager="$default_login_manager_3" + fi + fi + + if test -z "$with_login_manager" ; then + set dummy $default_login_manager_4 ; login_manager_tmp=$2 + unset ac_cv_path_login_manager_tmp # don't cache + # Extract the first word of "$login_manager_tmp", so it can be a program name with args. +set dummy $login_manager_tmp; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_login_manager_tmp+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $login_manager_tmp in + [\\/]* | ?:[\\/]*) + ac_cv_path_login_manager_tmp="$login_manager_tmp" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_login_manager_tmp="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +login_manager_tmp=$ac_cv_path_login_manager_tmp +if test -n "$login_manager_tmp"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $login_manager_tmp" >&5 +$as_echo "$login_manager_tmp" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test ! -z "$login_manager_tmp" ; then + with_login_manager="$default_login_manager_4" + fi + fi + ;; /*) @@ -13119,7 +13310,7 @@ $as_echo_n "(cached) " >&6 else cat > conftest.$ac_ext < #ifndef MESA_MAJOR_VERSION @@ -14377,6 +14568,295 @@ ############################################################################### # +# Check for -lXft +# +############################################################################### + +have_xutf8drawstring=no + + ac_save_CPPFLAGS="$CPPFLAGS" + ac_save_LDFLAGS="$LDFLAGS" +# ac_save_LIBS="$LIBS" + + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" + fi + # note: $X_CFLAGS includes $x_includes + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + + if test \! -z "$libdir" ; then + LDFLAGS="$LDFLAGS -L$libdir" + fi + # note: $X_LIBS includes $x_libraries + LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS" + + CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` + LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Xutf8DrawString in -lX11" >&5 +$as_echo_n "checking for Xutf8DrawString in -lX11... " >&6; } +if ${ac_cv_lib_X11_Xutf8DrawString+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lX11 -lX11 -lXext -lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char Xutf8DrawString (); +int +main () +{ +return Xutf8DrawString (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_X11_Xutf8DrawString=yes +else + ac_cv_lib_X11_Xutf8DrawString=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_X11_Xutf8DrawString" >&5 +$as_echo "$ac_cv_lib_X11_Xutf8DrawString" >&6; } +if test "x$ac_cv_lib_X11_Xutf8DrawString" = xyes; then : + have_xutf8drawstring=yes +else + true +fi + + CPPFLAGS="$ac_save_CPPFLAGS" + LDFLAGS="$ac_save_LDFLAGS" +# LIBS="$ac_save_LIBS" + +if test "$have_xutf8drawstring" = yes ; then + $as_echo "#define HAVE_XUTF8DRAWSTRING 1" >>confdefs.h + +fi + + +have_xft=no +with_xft_req=unspecified +xft_halfassed=no + +# Check whether --with-xft was given. +if test "${with_xft+set}" = set; then : + withval=$with_xft; with_xft="$withval"; with_xft_req="$withval" +else + with_xft=yes +fi + + + + case "$with_xft" in + yes) ;; + no) ;; + + /*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Xft headers" >&5 +$as_echo_n "checking for Xft headers... " >&6; } + d=$with_xft/include + if test -d $d; then + X_CFLAGS="-I$d $X_CFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 +$as_echo "$d" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 +$as_echo "not found ($d: no such directory)" >&6; } + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Xft libs" >&5 +$as_echo_n "checking for Xft libs... " >&6; } + d=$with_xft/lib + if test -d $d; then + X_LIBS="-L$d $X_LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 +$as_echo "$d" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 +$as_echo "not found ($d: no such directory)" >&6; } + fi + + # replace the directory string with "yes". + with_xft_req="yes" + with_xft=$with_xft_req + ;; + + *) + echo "" + echo "error: argument to --with-xft must be \"yes\", \"no\", or a directory." + echo " If it is a directory, then \`DIR/include' will be added to" + echo " the -I list, and \`DIR/lib' will be added to the -L list." + exit 1 + ;; + esac + + +if test "$with_xft" != yes -a "$with_xft" != no ; then + echo "error: must be yes or no: --with-xft=$with_xft" + exit 1 +fi + +if test "$with_xft" = yes; then + + pkgs='' + ok="yes" + pkg_check_version xft 2.1.0 + have_xft="$ok" + + if test "$have_xft" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Xft includes" >&5 +$as_echo_n "checking for Xft includes... " >&6; } +if ${ac_cv_xft_config_cflags+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_xft_config_cflags=`$pkg_config --cflags $pkgs` +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_xft_config_cflags" >&5 +$as_echo "$ac_cv_xft_config_cflags" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Xft libs" >&5 +$as_echo_n "checking for Xft libs... " >&6; } +if ${ac_cv_xft_config_libs+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_xft_config_libs=`$pkg_config --libs $pkgs` +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_xft_config_libs" >&5 +$as_echo "$ac_cv_xft_config_libs" >&6; } + fi + + ac_xft_config_cflags=$ac_cv_xft_config_cflags + ac_xft_config_libs=$ac_cv_xft_config_libs + + if test "$have_xft" = yes; then + # + # we appear to have Xft; check for headers/libs to be sure. + # + ac_save_xft_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $ac_xft_config_cflags" + + have_xft=no + + ac_save_CPPFLAGS="$CPPFLAGS" + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" + fi + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` + ac_fn_c_check_header_mongrel "$LINENO" "X11/Xft/Xft.h" "ac_cv_header_X11_Xft_Xft_h" "$ac_includes_default" +if test "x$ac_cv_header_X11_Xft_Xft_h" = xyes; then : + have_xft=yes +fi + + + CPPFLAGS="$ac_save_CPPFLAGS" + + CPPFLAGS="$ac_save_xft_CPPFLAGS" + fi + + if test "$have_xft" = yes; then + # we have the headers, now check for the libraries + have_xft=no + xft_halfassed=yes + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: checking for Xft usability..." >&5 +$as_echo "checking for Xft usability..." >&6; } + + ac_save_CPPFLAGS="$CPPFLAGS" + ac_save_LDFLAGS="$LDFLAGS" +# ac_save_LIBS="$LIBS" + + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" + fi + # note: $X_CFLAGS includes $x_includes + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + + if test \! -z "$libdir" ; then + LDFLAGS="$LDFLAGS -L$libdir" + fi + # note: $X_LIBS includes $x_libraries + LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS" + + CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` + LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XftDrawStringUtf8 in -lc" >&5 +$as_echo_n "checking for XftDrawStringUtf8 in -lc... " >&6; } +if ${ac_cv_lib_c_XftDrawStringUtf8+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lc $ac_xft_config_libs -lX11 -lXext -lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char XftDrawStringUtf8 (); +int +main () +{ +return XftDrawStringUtf8 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_c_XftDrawStringUtf8=yes +else + ac_cv_lib_c_XftDrawStringUtf8=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_XftDrawStringUtf8" >&5 +$as_echo "$ac_cv_lib_c_XftDrawStringUtf8" >&6; } +if test "x$ac_cv_lib_c_XftDrawStringUtf8" = xyes; then : + have_xft=yes +fi + + CPPFLAGS="$ac_save_CPPFLAGS" + LDFLAGS="$ac_save_LDFLAGS" +# LIBS="$ac_save_LIBS" + + fi + + if test "$have_xft" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: checking for Xft usability... no" >&5 +$as_echo "checking for Xft usability... no" >&6; } + fi +fi + +if test "$have_xft" = yes; then + INCLUDES="$INCLUDES $ac_xft_config_cflags" + XFT_LIBS="$ac_xft_config_libs" + XFT_SRCS='' + XFT_OBJS='' + $as_echo "#define HAVE_XFT 1" >>confdefs.h + +else + XFT_LIBS='' + XFT_SRCS='$(UTILS_SRC)/xft.c' + XFT_OBJS='$(UTILS_BIN)/xft.o' +fi + + +############################################################################### +# # Check for pty support: this allows 'phosphor' and 'apple2' # to run curses-based programs, or be used as terminal windows. # @@ -15195,6 +15675,88 @@ ############################################################################### # +# Check for --with-record-animation +# +############################################################################### + +record_anim_default=no +record_anim="$record_anim_default" + +# Check whether --with-record-animation was given. +if test "${with_record_animation+set}" = set; then : + withval=$with_record_animation; record_anim="$withval" +else + record_anim="$record_anim_default" +fi + + + + case "$record_anim" in + yes) ;; + no) ;; + + /*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for record animation headers" >&5 +$as_echo_n "checking for record animation headers... " >&6; } + d=$record_anim/include + if test -d $d; then + X_CFLAGS="-I$d $X_CFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 +$as_echo "$d" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 +$as_echo "not found ($d: no such directory)" >&6; } + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for record animation libs" >&5 +$as_echo_n "checking for record animation libs... " >&6; } + d=$record_anim/lib + if test -d $d; then + X_LIBS="-L$d $X_LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 +$as_echo "$d" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 +$as_echo "not found ($d: no such directory)" >&6; } + fi + + # replace the directory string with "yes". + record_anim_req="yes" + record_anim=$record_anim_req + ;; + + *) + echo "" + echo "error: argument to --with-record-animation must be \"yes\", \"no\", or a directory." + echo " If it is a directory, then \`DIR/include' will be added to" + echo " the -I list, and \`DIR/lib' will be added to the -L list." + exit 1 + ;; + esac + + +if test "$record_anim" = yes; then + true +elif test "$record_anim" != no; then + echo "error: must be yes or no: --with-record-animation=$record_anim" + exit 1 +fi + +if test "$record_anim" = yes; then + if test "$have_gdk_pixbuf" != yes; then + as_fn_error $? "--with-record-animation requires GDK-Pixbuf" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabling --with-record-animation" >&5 +$as_echo "enabling --with-record-animation" >&6; } + $as_echo "#define HAVE_RECORD_ANIM 1" >>confdefs.h + + ANIM_OBJS='$(ANIM_OBJS)' + ANIM_LIBS='$(ANIM_LIBS)' + fi +fi + +############################################################################### +# # Done testing. Now, set up the various -I and -L variables, # and decide which GUI program to build by default. # @@ -15436,6 +15998,11 @@ + + + + + APPDEFAULTS=$ac_x_app_defaults @@ -17068,6 +17635,28 @@ fi +if test "$have_xft" = no ; then + if test "$with_xft_req" = yes ; then + warnL "Use of libXft was requested, but it was not found." + elif test "$with_xft_req" = no ; then + noteL 'The Xft library is not being used.' + else + noteL "The Xft library was not found." + fi + + if test "$xft_halfassed" = yes ; then + echo '' + warn2 'More specifically, we found the headers, but not the' + warn2 'libraries; so either Xft is half-installed on this' + warn2 "system, or something else went wrong. The \`config.log'" + warn2 'file might contain some clues.' + echo '' + fi + + warn2 "This means that fonts won't be anti-aliased." +fi + + if test "$have_gl" = yes -a "$ac_have_mesa_gl" = yes ; then preferred_mesagl=3.4 mgv="$ac_mesagl_version_string" diff -Nru xscreensaver-5.30/configure.in xscreensaver-5.34/configure.in --- xscreensaver-5.30/configure.in 2014-09-10 17:42:23.000000000 -0400 +++ xscreensaver-5.34/configure.in 2015-10-23 14:26:53.000000000 -0400 @@ -169,6 +169,12 @@ of X, and if your vendor doesn't ship it, you should report that as a bug.]) +AH_TEMPLATE([HAVE_XUTF8DRAWSTRING], + [Define this if you have the function Xutf8DrawString().]) + +AH_TEMPLATE([HAVE_XFT], + [Define this if you have libXft2.]) + AH_TEMPLATE([HAVE_GL], [Define this if you have OpenGL. Some of the demos require it, so if you don't have it, then those particular demos won't be @@ -317,6 +323,9 @@ AH_TEMPLATE([HAVE_PTHREAD], [Define this if your system supports POSIX threads.]) +AH_TEMPLATE([HAVE_RECORD_ANIM], + [Define this to enable recording of videos.]) + # After checking to see that --srcdir is correct (which AC_INIT does) # check for some random other files that come later in the tar file, # to make sure everything is here. @@ -799,6 +808,9 @@ # Look for the directory under a standard set of common directories. # Check X11 before X11Rn because it's often a symlink to the current release. for ac_dir in \ + \ + /usr/share/X11/app-defaults \ + \ /usr/X11/lib/app-defaults \ /usr/X11R6/lib/app-defaults \ /usr/X11R6/lib/X11/app-defaults \ @@ -812,6 +824,8 @@ /usr/lib/X11R5/app-defaults \ /usr/lib/X11R4/app-defaults \ \ + /etc/X11/app-defaults \ + \ /usr/local/X11/lib/app-defaults \ /usr/local/X11R6/lib/app-defaults \ /usr/local/X11R5/lib/app-defaults \ @@ -857,11 +871,13 @@ AC_DEFUN([AC_PATH_X_APP_DEFAULTS], [AC_REQUIRE_CPP() AC_CACHE_CHECK([for X app-defaults directory], ac_cv_x_app_defaults, - [AC_PATH_X_APP_DEFAULTS_XMKMF + [# skip this, it's always wrong these days. + # AC_PATH_X_APP_DEFAULTS_XMKMF if test x"$ac_x_app_defaults" = x; then - AC_PATH_X_APP_DEFAULTS_DIRECT + true AC_PATH_X_APP_DEFAULTS_DIRECT fi if test x"$ac_x_app_defaults" = x; then + /bin/echo -n 'fallback: ' ac_cv_x_app_defaults="/usr/lib/X11/app-defaults" else # Record where we found app-defaults for the cache. @@ -1220,7 +1236,7 @@ # random libc stuff AC_HEADER_STDC -AC_CHECK_HEADERS(unistd.h) +AC_CHECK_HEADERS(unistd.h inttypes.h) AC_TYPE_MODE_T AC_TYPE_PID_T AC_TYPE_SIZE_T @@ -1233,6 +1249,8 @@ AC_CHECK_FUNCS(select fcntl uname nice setpriority getcwd getwd putenv sbrk) AC_CHECK_FUNCS(sigaction syslog realpath setrlimit) AC_CHECK_FUNCS(setlocale) +AC_CHECK_FUNCS(getaddrinfo) +AC_CHECK_MEMBERS([struct sockaddr.sa_len],,, [[#include ]]) AC_CHECK_ICMP AC_CHECK_ICMPHDR AC_CHECK_GETIFADDRS @@ -2438,6 +2456,8 @@ with_login_manager_req=unspecified default_login_manager_1='gdmflexiserver -ls' default_login_manager_2='kdmctl reserve' +default_login_manager_3='lxdm -c USER_SWITCH' +default_login_manager_4='dm-tool switch-to-greeter' AC_ARG_WITH(login-manager, [ --with-login-manager Put a "New Login" button on the unlock dialog that @@ -2457,23 +2477,46 @@ ;; yes|unspecified) - # Try both defaults, use the one that exists. + # Try various defaults, use the first one that exists. - set dummy $default_login_manager_1 ; login_manager_tmp=$2 - unset ac_cv_path_login_manager_tmp # don't cache - AC_PATH_PROG(login_manager_tmp, $login_manager_tmp, []) - if test ! -z "$login_manager_tmp" ; then - with_login_manager="$default_login_manager_1" - else + with_login_manager="" + + if test -z "$with_login_manager" ; then + set dummy $default_login_manager_1 ; login_manager_tmp=$2 + unset ac_cv_path_login_manager_tmp # don't cache + AC_PATH_PROG(login_manager_tmp, $login_manager_tmp, []) + if test ! -z "$login_manager_tmp" ; then + with_login_manager="$default_login_manager_1" + fi + fi + + if test -z "$with_login_manager" ; then set dummy $default_login_manager_2 ; login_manager_tmp=$2 unset ac_cv_path_login_manager_tmp # don't cache AC_PATH_PROG(login_manager_tmp, $login_manager_tmp, []) if test ! -z "$login_manager_tmp" ; then with_login_manager="$default_login_manager_2" - else - with_login_manager="" fi fi + + if test -z "$with_login_manager" ; then + set dummy $default_login_manager_3 ; login_manager_tmp=$2 + unset ac_cv_path_login_manager_tmp # don't cache + AC_PATH_PROG(login_manager_tmp, $login_manager_tmp, []) + if test ! -z "$login_manager_tmp" ; then + with_login_manager="$default_login_manager_3" + fi + fi + + if test -z "$with_login_manager" ; then + set dummy $default_login_manager_4 ; login_manager_tmp=$2 + unset ac_cv_path_login_manager_tmp # don't cache + AC_PATH_PROG(login_manager_tmp, $login_manager_tmp, []) + if test ! -z "$login_manager_tmp" ; then + with_login_manager="$default_login_manager_4" + fi + fi + ;; /*) @@ -3401,6 +3444,94 @@ ############################################################################### # +# Check for -lXft +# +############################################################################### + +have_xutf8drawstring=no +AC_CHECK_X_LIB(X11, Xutf8DrawString, + [have_xutf8drawstring=yes], + [true], -lX11 -lXext -lm) +if test "$have_xutf8drawstring" = yes ; then + AC_DEFINE(HAVE_XUTF8DRAWSTRING) +fi + + +have_xft=no +with_xft_req=unspecified +xft_halfassed=no +AC_ARG_WITH(xft, +[ --with-xft Include support for the X Freetype library.], + [with_xft="$withval"; with_xft_req="$withval"], + [with_xft=yes]) + +HANDLE_X_PATH_ARG(with_xft, --with-xft, Xft) + +if test "$with_xft" != yes -a "$with_xft" != no ; then + echo "error: must be yes or no: --with-xft=$with_xft" + exit 1 +fi + +if test "$with_xft" = yes; then + + pkgs='' + ok="yes" + pkg_check_version xft 2.1.0 + have_xft="$ok" + + if test "$have_xft" = yes; then + AC_CACHE_CHECK([for Xft includes], ac_cv_xft_config_cflags, + [ac_cv_xft_config_cflags=`$pkg_config --cflags $pkgs`]) + AC_CACHE_CHECK([for Xft libs], ac_cv_xft_config_libs, + [ac_cv_xft_config_libs=`$pkg_config --libs $pkgs`]) + fi + + ac_xft_config_cflags=$ac_cv_xft_config_cflags + ac_xft_config_libs=$ac_cv_xft_config_libs + + if test "$have_xft" = yes; then + # + # we appear to have Xft; check for headers/libs to be sure. + # + ac_save_xft_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $ac_xft_config_cflags" + + have_xft=no + AC_CHECK_X_HEADER(X11/Xft/Xft.h, [have_xft=yes]) + + CPPFLAGS="$ac_save_xft_CPPFLAGS" + fi + + if test "$have_xft" = yes; then + # we have the headers, now check for the libraries + have_xft=no + xft_halfassed=yes + + AC_MSG_RESULT(checking for Xft usability...) + AC_CHECK_X_LIB(c, XftDrawStringUtf8, [have_xft=yes],, + $ac_xft_config_libs -lX11 -lXext -lm) + fi + + if test "$have_xft" = no; then + AC_MSG_RESULT(checking for Xft usability... no) + fi +fi + +if test "$have_xft" = yes; then + INCLUDES="$INCLUDES $ac_xft_config_cflags" + XFT_LIBS="$ac_xft_config_libs" + XFT_SRCS='' + XFT_OBJS='' + AC_DEFINE(HAVE_XFT) +else + XFT_LIBS='' + XFT_SRCS='$(UTILS_SRC)/xft.c' + XFT_OBJS='$(UTILS_BIN)/xft.o' +fi + + +############################################################################### +# # Check for pty support: this allows 'phosphor' and 'apple2' # to run curses-based programs, or be used as terminal windows. # @@ -3739,6 +3870,39 @@ ############################################################################### # +# Check for --with-record-animation +# +############################################################################### + +record_anim_default=no +record_anim="$record_anim_default" +AC_ARG_WITH(record-animation, +[ --with-record-animation Include code for generating MP4 videos. +], + [record_anim="$withval"], [record_anim="$record_anim_default"]) + +HANDLE_X_PATH_ARG(record_anim, --with-record-animation, record animation) + +if test "$record_anim" = yes; then + true +elif test "$record_anim" != no; then + echo "error: must be yes or no: --with-record-animation=$record_anim" + exit 1 +fi + +if test "$record_anim" = yes; then + if test "$have_gdk_pixbuf" != yes; then + AC_MSG_ERROR(--with-record-animation requires GDK-Pixbuf) + else + AC_MSG_RESULT(enabling --with-record-animation) + AC_DEFINE(HAVE_RECORD_ANIM) + ANIM_OBJS='$(ANIM_OBJS)' + ANIM_LIBS='$(ANIM_LIBS)' + fi +fi + +############################################################################### +# # Done testing. Now, set up the various -I and -L variables, # and decide which GUI program to build by default. # @@ -3953,6 +4117,9 @@ AC_SUBST(XMU_SRCS) AC_SUBST(XMU_OBJS) AC_SUBST(XMU_LIBS) +AC_SUBST(XFT_SRCS) +AC_SUBST(XFT_OBJS) +AC_SUBST(XFT_LIBS) AC_SUBST(SAVER_GL_SRCS) AC_SUBST(SAVER_GL_OBJS) AC_SUBST(SAVER_GL_LIBS) @@ -3977,6 +4144,8 @@ AC_SUBST(PO_DATADIR) AC_SUBST(HACK_CONF_DIR) AC_SUBST(GTK_EXTRA_OBJS) +AC_SUBST(ANIM_OBJS) +AC_SUBST(ANIM_LIBS) APPDEFAULTS=$ac_x_app_defaults AC_SUBST(APPDEFAULTS) @@ -4286,6 +4455,28 @@ fi +if test "$have_xft" = no ; then + if test "$with_xft_req" = yes ; then + warnL "Use of libXft was requested, but it was not found." + elif test "$with_xft_req" = no ; then + noteL 'The Xft library is not being used.' + else + noteL "The Xft library was not found." + fi + + if test "$xft_halfassed" = yes ; then + echo '' + warn2 'More specifically, we found the headers, but not the' + warn2 'libraries; so either Xft is half-installed on this' + warn2 "system, or something else went wrong. The \`config.log'" + warn2 'file might contain some clues.' + echo '' + fi + + warn2 "This means that fonts won't be anti-aliased." +fi + + if test "$have_gl" = yes -a "$ac_have_mesa_gl" = yes ; then preferred_mesagl=3.4 mgv="$ac_mesagl_version_string" diff -Nru xscreensaver-5.30/debian/changelog xscreensaver-5.34/debian/changelog --- xscreensaver-5.30/debian/changelog 2015-11-01 14:09:30.000000000 -0500 +++ xscreensaver-5.34/debian/changelog 2015-11-01 14:09:33.000000000 -0500 @@ -1,3 +1,66 @@ +xscreensaver (5.34-1ubuntu1) xenial; urgency=medium + + * Merge from Debian unstable. Remaining changes: + - debian/control: + + Breaks/Replaces: the old changes are not needed anymore, but the + new changes the screensavers sets needs it. + - debian/rules: + + Use /usr/share/backgrounds as image directory. + + Add translation domain to .desktop files. + - debian/source_xscreensaver.py: + + Add apport hook. + - debian/xscreensaver.dirs: + + Install /usr/share/backgrounds. By default, settings search in + /usr/share/backgrounds and without it, it displays an error. + - debian/patch/90_ubuntu-branding.patch: Use Ubuntu branding. + - debian/patches/60_sequential_glslideshow.patch: + + Allow going through images sequentially rather than just at random in + the GLSlideshow hack. + + * Dropped changes, fixed in Debian: + - debian/patches/91_replace-gdmflexiserver.patch: + + Use dm-tool instead of gdmflexiserver for user-switching, + the latter is no longer provided by lightdm. + + -- Unit 193 Tue, 27 Oct 2015 20:23:19 -0400 + +xscreensaver (5.34-1) unstable; urgency=medium + + * New upstream release 5.34 + - Fixed a crash when hot-swapping monitors while locked. + (Closes: #802914) + - Fixed some incorrect output from xscreensaver-command -watch. + + -- Tormod Volden Sun, 25 Oct 2015 09:31:21 +0100 + +xscreensaver (5.33-1) unstable; urgency=low + + * New upstream release 5.33, changes since 5.30: + - New hacks, `geodesicgears', `binaryring', `cityflow', `splitflap' + and `romanboy'. + - UTF-8 text support (instead of only Latin1) and antialiased text + on X11 with Xft (instead of only on OSX/iOS) in `fontglide', + `noseguy', `fliptext', `starwars', and `winduprobot'. + The other text-displaying hacks (`apple2', `phosphor', `xmatrix', + and `gltext') also now accept UTF-8 input, though they convert it + to Latin1 or ASCII. (Closes: #180775) + - `glplanet' now has both day and night maps, and a sharp terminator. + - Fixed a transparency glitch in `winduprobot'. + - Better detection of user activity on modern GNOME systems. + * xscreensaver*.postrm/postinst/preinst: Remove obsolete parts used in + lenny->squeeze and potato->woody transitions + * Do not overwrite user-configured /etc/X11/app-defaults/XScreenSaver + Thanks to Bastien Roucariès for initial patch (Closes: #767019) + * Replace GNOME with MATE in desktop files stub (Closes: #766880, #774539) + * debian/copyright: Use unique short names for "other" licenses + * xscreensaver-wrapper.sh: Detect if launched from lightdm session + Thanks to Alexander Gerasiov for patch (Closes: #778470) + * debian/control: Recommend libgnomeui-0 package for xscreensaver-demo + Thanks to Michael Gilbert for patch (Closes: #661174) + * debian/rules: Hardcode app-defaults dir for configure + + -- Tormod Volden Tue, 28 Jul 2015 00:41:06 +0200 + xscreensaver (5.30-1ubuntu1) vivid; urgency=medium * Merge from Debian unstable. (LP: #1406825) Remaining changes: diff -Nru xscreensaver-5.30/debian/control xscreensaver-5.34/debian/control --- xscreensaver-5.30/debian/control 2015-11-01 14:09:30.000000000 -0500 +++ xscreensaver-5.34/debian/control 2015-11-01 14:09:33.000000000 -0500 @@ -13,7 +13,7 @@ Architecture: any Depends: ${shlibs:Depends}, xscreensaver-data, ${misc:Depends} Breaks: funny-manpages (<< 1.3-1), suidmanager (<< 0.50), xscreensaver-gnome (<< 4.09-2), xscreensaver-nognome (<< 4.09-2), gnome-control-center (<< 1:2) -Recommends: libjpeg-progs, perl5, miscfiles | wordlist +Recommends: libjpeg-progs, perl5, miscfiles | wordlist, libgnomeui-0 Suggests: xfishtank, xdaliclock, xscreensaver-gl, fortune, www-browser, qcam | streamer, gdm3 | kdm-gdmcompat Description: Screensaver daemon and frontend for X11 XScreenSaver is a modular screen saver and locker for X11, @@ -43,9 +43,9 @@ is used by both xscreensaver and gnome-screensaver. . This is the selected set of non-GL screensavers shipped by default: - abstractile, cwaves, deco, distort, fiberlamp, fuzzyflakes, galaxy, - hexadrop, m6502, metaballs, penrose, ripples, shadebobs, slidescreen, - swirl, tessellimage, xlyap. + abstractile, binaryring, cwaves, deco, distort, fiberlamp, fuzzyflakes, + galaxy, hexadrop, m6502, metaballs, penrose, ripples, shadebobs, + slidescreen, swirl, tessellimage, xlyap. . More display modes can be found in xscreensaver-data-extra, xscreensaver-gl and xscreensaver-gl-extra packages. @@ -99,13 +99,14 @@ . This is the set of GL screensavers shipped by default: antinspect, antspotlight, atunnel, blinkbox, bubble3d, circuit, - cubestorm, endgame, engine, flipflop, flipscreen3d, flyingtoasters, - gears, gflux, glblur, glcells, gleidescope, glknots, glmatrix, - glschool, glslideshow, glsnake, gltext, hypertorus, jigglypuff, - kaleidocycle, lavalite, lockward, mirrorblob, moebius, moebiusgears, - molecule, morph3d, pipes, polyhedra, polytopes, projectiveplane, - pulsar, quasicrystal, queens, sierpinski3d, sonar, spheremonics, - stonerview, superquadrics, topblock, voronoi, winduprobot. + cityring, cubestorm, endgame, engine, flipflop, flipscreen3d, + flyingtoasters, gears, geodesic, geodesicgears, gflux, glblur, glcells, + gleidescope, glknots, glmatrix, glschool, glslideshow, glsnake, gltext, + hypertorus, jigglypuff, kaleidocycle, lavalite, lockward, mirrorblob, + moebius, moebiusgears, molecule, morph3d, pipes, polyhedra, polytopes, + projectiveplane, pulsar, quasicrystal, queens, romanboy, sierpinski3d, + sonar, spheremonics, splitflap, stonerview, superquadrics, topblock, + voronoi, winduprobot. . More display modes can be found in the xscreensaver-data, xscreensaver-data-extra and xscreensaver-gl-extra packages. @@ -128,7 +129,7 @@ xscreensaver-gl: antmaze, atlantis, blocktube, boing, bouncingcow, boxed, cage, carousel, companioncube, crackberg, cube21, cubenetic, cubicgrid, - dangerball, extrusion, fliptext, flurry, geodesic, glhanoi, glplanet, + dangerball, extrusion, fliptext, flurry, glhanoi, glplanet, hilbert, hypnowheel, jigsaw, juggler3d, klein, lament, menger, noof, photopile, pinion, providence, rubik, rubikblocks, sballs, skytentacles, sproingies, stairs, starwars, surfaces, tangram, timetunnel, tronbit, diff -Nru xscreensaver-5.30/debian/copyright xscreensaver-5.34/debian/copyright --- xscreensaver-5.30/debian/copyright 2015-11-01 14:09:30.000000000 -0500 +++ xscreensaver-5.34/debian/copyright 2015-11-01 14:09:33.000000000 -0500 @@ -9,7 +9,7 @@ Copyright: 1991-2008 Jamie Zawinski 1985-1990 Dan Heller 2000 Joe Keane -License: Other +License: Other_1 Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that @@ -20,7 +20,7 @@ Files: hacks/flame.* hacks/bouboule.* hacks/hopalong.* Copyright: © 1988-1991 Patrick J. Naughton -License: Other +License: Other_2 Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that @@ -96,7 +96,7 @@ 2002 Tyler Pierce Jeremy English 1994 Carnegie Mellon University -License: Other +License: Other_3 Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright @@ -146,7 +146,7 @@ 1997 Tracy Camp 1993 Greg Bowering 1994 Darrick Brown -License: Other +License: Other_4 Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that @@ -161,7 +161,7 @@ Files: hacks/munch.* Copyright: © 1997 Tim Showalter -License: Other +License: Other_5 Permission is granted to copy, modify, and use this as long as this notice remains intact. No warranties are expressed or implied. CMU Sucks. @@ -195,7 +195,7 @@ Files: hacks/crystal.* Copyright: © 1997 Jouk Jansen -License: Other +License: Other_6 Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that @@ -214,7 +214,7 @@ Files: hacks/maze.* hacks/sphere.* Copyright: © 1988 Sun Microsystems -License: Other +License: Other_7 Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that @@ -257,7 +257,7 @@ Files: hacks/glx/glut* Copyright: © 1989-1995 Mark J. Kilgard -License: Other +License: Other_8 This program is freely distributable without licensing fees and is provided without guarantee or warrantee expressed or implied. This program is -not- in the public domain. diff -Nru xscreensaver-5.30/debian/patches/10_upstream_skip_retired_hacks.patch xscreensaver-5.34/debian/patches/10_upstream_skip_retired_hacks.patch --- xscreensaver-5.30/debian/patches/10_upstream_skip_retired_hacks.patch 2015-11-01 14:09:30.000000000 -0500 +++ xscreensaver-5.34/debian/patches/10_upstream_skip_retired_hacks.patch 2015-11-01 14:09:33.000000000 -0500 @@ -3,22 +3,22 @@ # Index: xscreensaver/hacks/Makefile.in =================================================================== ---- xscreensaver.orig/hacks/Makefile.in 2014-10-07 22:48:15.000000000 +0200 -+++ xscreensaver/hacks/Makefile.in 2014-10-07 22:48:15.000000000 +0200 -@@ -267,7 +267,7 @@ +--- xscreensaver.orig/hacks/Makefile.in 2015-07-19 11:23:04.000000000 +0200 ++++ xscreensaver/hacks/Makefile.in 2015-07-19 11:23:04.000000000 +0200 +@@ -273,7 +273,7 @@ default: all --all: $(EXES) $(RETIRED_EXES) +-all: $(EXES) $(RETIRED_EXES) testx11 +all: $(EXES) install: install-program install-scripts install-xml install-man uninstall: uninstall-program uninstall-xml uninstall-man Index: xscreensaver/hacks/glx/Makefile.in =================================================================== ---- xscreensaver.orig/hacks/glx/Makefile.in 2014-10-07 22:48:15.000000000 +0200 -+++ xscreensaver/hacks/glx/Makefile.in 2014-10-07 22:48:15.000000000 +0200 -@@ -238,7 +238,7 @@ +--- xscreensaver.orig/hacks/glx/Makefile.in 2015-07-19 11:23:04.000000000 +0200 ++++ xscreensaver/hacks/glx/Makefile.in 2015-07-19 11:23:04.000000000 +0200 +@@ -252,7 +252,7 @@ default: all diff -Nru xscreensaver-5.30/debian/patches/20_hacks_maze_xpm_libs.patch xscreensaver-5.34/debian/patches/20_hacks_maze_xpm_libs.patch --- xscreensaver-5.30/debian/patches/20_hacks_maze_xpm_libs.patch 2015-11-01 14:09:30.000000000 -0500 +++ xscreensaver-5.34/debian/patches/20_hacks_maze_xpm_libs.patch 2015-11-01 14:09:33.000000000 -0500 @@ -1,8 +1,8 @@ Index: xscreensaver/hacks/Makefile.in =================================================================== ---- xscreensaver.orig/hacks/Makefile.in 2014-08-11 21:23:44.000000000 +0200 -+++ xscreensaver/hacks/Makefile.in 2014-08-11 21:23:44.000000000 +0200 -@@ -608,7 +608,7 @@ +--- xscreensaver.orig/hacks/Makefile.in 2015-06-18 21:55:00.000000000 +0200 ++++ xscreensaver/hacks/Makefile.in 2015-06-18 21:55:00.000000000 +0200 +@@ -622,7 +622,7 @@ $(CC_HACK) -o $@ $@.o $(HACK_OBJS) $(HACK_LIBS) maze: maze.o $(HACK_OBJS) $(ERASE) $(LOGO) diff -Nru xscreensaver-5.30/debian/patches/23_hacks_glx_glsnake.patch xscreensaver-5.34/debian/patches/23_hacks_glx_glsnake.patch --- xscreensaver-5.30/debian/patches/23_hacks_glx_glsnake.patch 2015-11-01 14:09:30.000000000 -0500 +++ xscreensaver-5.34/debian/patches/23_hacks_glx_glsnake.patch 2015-11-01 14:09:33.000000000 -0500 @@ -3,9 +3,9 @@ Index: xscreensaver/hacks/glx/glsnake.c =================================================================== ---- xscreensaver.orig/hacks/glx/glsnake.c 2014-10-07 22:48:32.000000000 +0200 -+++ xscreensaver/hacks/glx/glsnake.c 2014-10-07 22:48:32.000000000 +0200 -@@ -537,7 +537,7 @@ +--- xscreensaver.orig/hacks/glx/glsnake.c 2015-06-18 21:55:09.000000000 +0200 ++++ xscreensaver/hacks/glx/glsnake.c 2015-06-18 21:55:09.000000000 +0200 +@@ -536,7 +536,7 @@ PIN, ZERO, RIGHT, RIGHT, ZERO, PIN, PIN, ZERO, PIN, PIN, ZERO, RIGHT, ZERO } }, @@ -14,7 +14,7 @@ { RIGHT, RIGHT, PIN, RIGHT, LEFT, RIGHT, PIN, RIGHT, LEFT, RIGHT, PIN, RIGHT, LEFT, RIGHT, PIN, RIGHT, LEFT, RIGHT, PIN, RIGHT, LEFT, RIGHT, PIN, ZERO } -@@ -562,22 +562,22 @@ +@@ -561,22 +561,22 @@ ZERO, PIN, ZERO, ZERO, ZERO, ZERO, PIN, ZERO, ZERO, ZERO, ZERO, ZERO, ZERO, ZERO } }, @@ -41,7 +41,7 @@ { RIGHT, ZERO, ZERO, ZERO, RIGHT, ZERO, ZERO, PIN, ZERO, ZERO, LEFT, ZERO, ZERO, ZERO, LEFT, ZERO, LEFT, PIN, LEFT, PIN, RIGHT, PIN, RIGHT, ZERO } -@@ -997,7 +997,7 @@ +@@ -996,7 +996,7 @@ { "Parrot", { ZERO, ZERO, ZERO, ZERO, RIGHT, RIGHT, ZERO, LEFT, PIN, RIGHT, ZERO, RIGHT, ZERO, RIGHT, ZERO, RIGHT, PIN, LEFT, ZERO, RIGHT, LEFT, ZERO, PIN, ZERO } }, diff -Nru xscreensaver-5.30/debian/patches/50_debian_branding.patch xscreensaver-5.34/debian/patches/50_debian_branding.patch --- xscreensaver-5.30/debian/patches/50_debian_branding.patch 2015-11-01 14:09:30.000000000 -0500 +++ xscreensaver-5.34/debian/patches/50_debian_branding.patch 2015-11-01 14:09:33.000000000 -0500 @@ -11,7 +11,7 @@ *textLiteral: XScreenSaver *textFile: @DEFAULT_TEXT_FILE@ *textProgram: fortune --*textURL: http://en.wikipedia.org/w/index.php?title=Special:NewPages&feed=rss +-*textURL: https://en.wikipedia.org/w/index.php?title=Special:NewPages&feed=rss +*textURL: http://planet.debian.org/rss20.xml *overlayTextForeground: #FFFF00 diff -Nru xscreensaver-5.30/debian/patches/53_default_newLoginCommand.patch xscreensaver-5.34/debian/patches/53_default_newLoginCommand.patch --- xscreensaver-5.30/debian/patches/53_default_newLoginCommand.patch 2015-11-01 14:09:30.000000000 -0500 +++ xscreensaver-5.34/debian/patches/53_default_newLoginCommand.patch 2015-11-01 14:09:33.000000000 -0500 @@ -1,10 +1,10 @@ Index: xscreensaver/driver/XScreenSaver.ad.in =================================================================== ---- xscreensaver.orig/driver/XScreenSaver.ad.in 2014-10-07 22:48:57.000000000 +0200 -+++ xscreensaver/driver/XScreenSaver.ad.in 2014-10-07 22:48:57.000000000 +0200 -@@ -143,7 +143,9 @@ - ! For Gnome: probably "gdmflexiserver -ls". KDE, probably "kdmctl reserve". +--- xscreensaver.orig/driver/XScreenSaver.ad.in 2015-07-19 11:29:34.000000000 +0200 ++++ xscreensaver/driver/XScreenSaver.ad.in 2015-07-19 11:29:34.000000000 +0200 +@@ -144,7 +144,9 @@ ! Or maybe yet another wheel-reinvention, "lxdm -c USER_SWITCH". + ! Oh wait, this wheel just keeps getting better: "dm-tool switch-to-greeter". ! -@NEW_LOGIN_COMMAND_P@*newLoginCommand: @NEW_LOGIN_COMMAND@ +! @NEW_LOGIN_COMMAND_P@*newLoginCommand: @NEW_LOGIN_COMMAND@ diff -Nru xscreensaver-5.30/debian/patches/54_no_dnalogo_hack.patch xscreensaver-5.34/debian/patches/54_no_dnalogo_hack.patch --- xscreensaver-5.30/debian/patches/54_no_dnalogo_hack.patch 2015-11-01 14:09:30.000000000 -0500 +++ xscreensaver-5.34/debian/patches/54_no_dnalogo_hack.patch 2015-11-01 14:09:33.000000000 -0500 @@ -1,8 +1,8 @@ Index: xscreensaver/driver/XScreenSaver.ad.in =================================================================== ---- xscreensaver.orig/driver/XScreenSaver.ad.in 2014-10-07 22:49:02.000000000 +0200 -+++ xscreensaver/driver/XScreenSaver.ad.in 2014-10-07 22:49:02.000000000 +0200 -@@ -262,7 +262,6 @@ +--- xscreensaver.orig/driver/XScreenSaver.ad.in 2015-07-19 11:29:38.000000000 +0200 ++++ xscreensaver/driver/XScreenSaver.ad.in 2015-07-19 11:29:38.000000000 +0200 +@@ -263,7 +263,6 @@ xspirograph -root \n\ @GL_KLUDGE@ GL: circuit -root \n\ @GL_KLUDGE@ GL: dangerball -root \n\ diff -Nru xscreensaver-5.30/debian/patches/55_add_unicode_hack.patch xscreensaver-5.34/debian/patches/55_add_unicode_hack.patch --- xscreensaver-5.30/debian/patches/55_add_unicode_hack.patch 2015-11-01 14:09:30.000000000 -0500 +++ xscreensaver-5.34/debian/patches/55_add_unicode_hack.patch 2015-11-01 14:09:33.000000000 -0500 @@ -1,8 +1,8 @@ Index: xscreensaver/driver/XScreenSaver.ad.in =================================================================== ---- xscreensaver.orig/driver/XScreenSaver.ad.in 2014-10-07 22:51:11.000000000 +0200 -+++ xscreensaver/driver/XScreenSaver.ad.in 2014-10-07 22:51:11.000000000 +0200 -@@ -195,6 +195,7 @@ +--- xscreensaver.orig/driver/XScreenSaver.ad.in 2015-07-19 11:29:42.000000000 +0200 ++++ xscreensaver/driver/XScreenSaver.ad.in 2015-07-19 11:29:42.000000000 +0200 +@@ -196,6 +196,7 @@ goop -root \n\ grav -root \n\ ifs -root \n\ diff -Nru xscreensaver-5.30/debian/patches/56_password_dialog_reworded.patch xscreensaver-5.34/debian/patches/56_password_dialog_reworded.patch --- xscreensaver-5.30/debian/patches/56_password_dialog_reworded.patch 2015-11-01 14:09:30.000000000 -0500 +++ xscreensaver-5.34/debian/patches/56_password_dialog_reworded.patch 2015-11-01 14:09:33.000000000 -0500 @@ -1,8 +1,8 @@ Index: xscreensaver/driver/XScreenSaver.ad.in =================================================================== ---- xscreensaver.orig/driver/XScreenSaver.ad.in 2014-10-07 22:51:38.000000000 +0200 -+++ xscreensaver/driver/XScreenSaver.ad.in 2014-10-07 22:51:38.000000000 +0200 -@@ -424,10 +424,11 @@ +--- xscreensaver.orig/driver/XScreenSaver.ad.in 2015-10-25 09:25:28.216004625 +0100 ++++ xscreensaver/driver/XScreenSaver.ad.in 2015-10-25 09:25:28.212004974 +0100 +@@ -431,10 +431,11 @@ *Dialog.shadowThickness: 2 *passwd.heading.label: XScreenSaver %s diff -Nru xscreensaver-5.30/debian/patches/80_Makefile_in-clean-fix.patch xscreensaver-5.34/debian/patches/80_Makefile_in-clean-fix.patch --- xscreensaver-5.30/debian/patches/80_Makefile_in-clean-fix.patch 2015-11-01 14:09:30.000000000 -0500 +++ xscreensaver-5.34/debian/patches/80_Makefile_in-clean-fix.patch 2015-11-01 14:09:33.000000000 -0500 @@ -7,9 +7,9 @@ # Index: xscreensaver/Makefile.in =================================================================== ---- xscreensaver.orig/Makefile.in 2010-04-13 01:06:00.000000000 +0200 -+++ xscreensaver/Makefile.in 2011-04-21 23:44:36.000000000 +0200 -@@ -55,8 +55,8 @@ +--- xscreensaver.orig/Makefile.in 2015-06-18 21:55:28.000000000 +0200 ++++ xscreensaver/Makefile.in 2015-06-18 21:55:28.000000000 +0200 +@@ -54,8 +54,8 @@ @$(MAKE_SUBDIR2) distclean:: clean diff -Nru xscreensaver-5.30/debian/patches/91_replace-gdmflexiserver.patch xscreensaver-5.34/debian/patches/91_replace-gdmflexiserver.patch --- xscreensaver-5.30/debian/patches/91_replace-gdmflexiserver.patch 2015-11-01 14:09:30.000000000 -0500 +++ xscreensaver-5.34/debian/patches/91_replace-gdmflexiserver.patch 1969-12-31 19:00:00.000000000 -0500 @@ -1,40 +0,0 @@ -Description: Replace gdmflexiserver with dm-tool - gdmflexiserver is no longer provided by lightdm. Replace it with dm-tool. -Author: Sean Davis -Bug-Ubuntu: https://launchpad.net/bugs/1320560 -Last-Update: 2014-09-07 ---- -This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ ---- a/driver/XScreenSaver.ad.in -+++ b/driver/XScreenSaver.ad.in -@@ -145,7 +145,7 @@ - ! - ! @NEW_LOGIN_COMMAND_P@*newLoginCommand: @NEW_LOGIN_COMMAND@ - ! Debian: Hard-wire the command in case the build machine does not have gdm --*newLoginCommand: gdmflexiserver -ls -+*newLoginCommand: dm-tool switch-to-greeter - - - ! Turning on "installColormap" on 8-bit systems interacts erratically with ---- a/configure -+++ b/configure -@@ -11685,7 +11685,7 @@ - ############################################################################### - - with_login_manager_req=unspecified --default_login_manager_1='gdmflexiserver -ls' -+default_login_manager_1='dm-tool switch-to-greeter' - default_login_manager_2='kdmctl reserve' - - ---- a/configure.in -+++ b/configure.in -@@ -2436,7 +2436,7 @@ - ############################################################################### - - with_login_manager_req=unspecified --default_login_manager_1='gdmflexiserver -ls' -+default_login_manager_1='dm-tool switch-to-greeter' - default_login_manager_2='kdmctl reserve' - - AC_ARG_WITH(login-manager, diff -Nru xscreensaver-5.30/debian/patches/series xscreensaver-5.34/debian/patches/series --- xscreensaver-5.30/debian/patches/series 2015-11-01 14:09:30.000000000 -0500 +++ xscreensaver-5.34/debian/patches/series 2015-11-01 14:09:33.000000000 -0500 @@ -23,4 +23,3 @@ 80_Makefile_in-clean-fix.patch 60_sequential_glslideshow.patch 90_ubuntu-branding.patch -91_replace-gdmflexiserver.patch diff -Nru xscreensaver-5.30/debian/rules xscreensaver-5.34/debian/rules --- xscreensaver-5.30/debian/rules 2015-11-01 14:09:30.000000000 -0500 +++ xscreensaver-5.34/debian/rules 2015-11-01 14:09:33.000000000 -0500 @@ -52,6 +52,7 @@ --with-hackdir=/usr/lib/xscreensaver \ --with-configdir=/usr/share/xscreensaver/config \ --mandir=/usr/share/man --with-login-manager \ + --with-x-app-defaults=/etc/X11/app-defaults \ --with-proc-interrupts cp driver/XScreenSaver.ad driver/XScreenSaver.ad-nogl # Configure for xscreensaver-gl @@ -62,6 +63,7 @@ --with-hackdir=/usr/lib/xscreensaver \ --with-configdir=/usr/share/xscreensaver/config \ --mandir=/usr/share/man --with-login-manager \ + --with-x-app-defaults=/etc/X11/app-defaults \ --with-proc-interrupts $(MAKE) touch build-stamp diff -Nru xscreensaver-5.30/debian/screensavers-desktop-files/binaryring.desktop xscreensaver-5.34/debian/screensavers-desktop-files/binaryring.desktop --- xscreensaver-5.30/debian/screensavers-desktop-files/binaryring.desktop 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/debian/screensavers-desktop-files/binaryring.desktop 2015-11-01 14:09:33.000000000 -0500 @@ -0,0 +1,6 @@ + +[Desktop Entry] +Name=BinaryRing +Exec=/usr/lib/xscreensaver/binaryring -root +TryExec=/usr/lib/xscreensaver/binaryring +Comment=A system of path tracing particles evolves continuously from an initial creation, alternating dark and light colors. Written by J. Tarbell and Emilio Del Tessandoro. diff -Nru xscreensaver-5.30/debian/screensavers-desktop-files/cityflow.desktop xscreensaver-5.34/debian/screensavers-desktop-files/cityflow.desktop --- xscreensaver-5.30/debian/screensavers-desktop-files/cityflow.desktop 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/debian/screensavers-desktop-files/cityflow.desktop 2015-11-01 14:09:33.000000000 -0500 @@ -0,0 +1,6 @@ + +[Desktop Entry] +Name=Cityflow +Exec=/usr/lib/xscreensaver/cityflow -root +TryExec=/usr/lib/xscreensaver/cityflow +Comment=Waves move across a sea of boxes. The city swells. The walls are closing in. Written by Jamie Zawinski. diff -Nru xscreensaver-5.30/debian/screensavers-desktop-files/geodesicgears.desktop xscreensaver-5.34/debian/screensavers-desktop-files/geodesicgears.desktop --- xscreensaver-5.30/debian/screensavers-desktop-files/geodesicgears.desktop 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/debian/screensavers-desktop-files/geodesicgears.desktop 2015-11-01 14:09:33.000000000 -0500 @@ -0,0 +1,6 @@ + +[Desktop Entry] +Name=GeodesicGears +Exec=/usr/lib/xscreensaver/geodesicgears -root +TryExec=/usr/lib/xscreensaver/geodesicgears +Comment=A set of meshed gears arranged on the surface of a sphere. http://en.wikipedia.org/wiki/Geodesic_dome http://en.wikipedia.org/wiki/Involute_gear Written by Jamie Zawinski. diff -Nru xscreensaver-5.30/debian/screensavers-desktop-files/romanboy.desktop xscreensaver-5.34/debian/screensavers-desktop-files/romanboy.desktop --- xscreensaver-5.30/debian/screensavers-desktop-files/romanboy.desktop 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/debian/screensavers-desktop-files/romanboy.desktop 2015-11-01 14:09:33.000000000 -0500 @@ -0,0 +1,6 @@ + +[Desktop Entry] +Name=RomanBoy +Exec=/usr/lib/xscreensaver/romanboy -root +TryExec=/usr/lib/xscreensaver/romanboy +Comment=A 3D immersion of the real projective plane that smoothly deforms between the Roman surface and the Boy surface. You can walk on the surface of the real projective plane or rotate it in 3D. Furthermore, it is possible to smoothly deform the real projective plane between the Roman surface and the Boy surface while turning it or walking on it. Inspired by François Apéry's book "Models of the Real Projective Plane", Vieweg, 1987. https://en.wikipedia.org/wiki/Boy%27s_surface https://en.wikipedia.org/wiki/Roman_surface http://mathworld.wolfram.com/BoySurface.html http://mathworld.wolfram.com/RomanSurface.html Written by Carsten Steger. diff -Nru xscreensaver-5.30/debian/screensavers-desktop-files/splitflap.desktop xscreensaver-5.34/debian/screensavers-desktop-files/splitflap.desktop --- xscreensaver-5.30/debian/screensavers-desktop-files/splitflap.desktop 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/debian/screensavers-desktop-files/splitflap.desktop 2015-11-01 14:09:33.000000000 -0500 @@ -0,0 +1,6 @@ + +[Desktop Entry] +Name=SplitFlap +Exec=/usr/lib/xscreensaver/splitflap -root +TryExec=/usr/lib/xscreensaver/splitflap +Comment=Simulates a split-flap display, an old style of electromechanical sign as seen in airports and train stations, and commonly used in alarm clocks in the 1960s and 1970s. https://en.wikipedia.org/wiki/Split-flap_display https://en.wikipedia.org/wiki/Flip_clock Written by Jamie Zawinski. diff -Nru xscreensaver-5.30/debian/screensavers-desktop.stub xscreensaver-5.34/debian/screensavers-desktop.stub --- xscreensaver-5.30/debian/screensavers-desktop.stub 2015-11-01 14:09:30.000000000 -0500 +++ xscreensaver-5.34/debian/screensavers-desktop.stub 2015-11-01 14:09:33.000000000 -0500 @@ -2,4 +2,4 @@ Terminal=false Type=Application Categories=Screensaver; -OnlyShowIn=GNOME; +OnlyShowIn=MATE; diff -Nru xscreensaver-5.30/debian/split-hacks.config xscreensaver-5.34/debian/split-hacks.config --- xscreensaver-5.30/debian/split-hacks.config 2015-11-01 14:09:30.000000000 -0500 +++ xscreensaver-5.34/debian/split-hacks.config 2015-11-01 14:09:33.000000000 -0500 @@ -14,6 +14,7 @@ attraction xscreensaver-data-extra atunnel xscreensaver-gl barcode xscreensaver-data-extra +binaryring xscreensaver-data blaster xscreensaver-data-extra blinkbox xscreensaver-gl blitspin xscreensaver-data-extra @@ -32,6 +33,7 @@ ccurve xscreensaver-data-extra celtic xscreensaver-data-extra circuit xscreensaver-gl +cityflow xscreensaver-gl cloudlife xscreensaver-data-extra companioncube xscreensaver-gl-extra compass xscreensaver-data-extra @@ -74,6 +76,7 @@ galaxy xscreensaver-data gears xscreensaver-gl geodesic xscreensaver-gl High CPU on Radeon +geodesicgears xscreensaver-gl gflux xscreensaver-gl glblur xscreensaver-gl glcells xscreensaver-gl @@ -158,6 +161,7 @@ rd-bomb xscreensaver-data-extra ripples xscreensaver-data rocks xscreensaver-data-extra +romanboy xscreensaver-gl rorschach xscreensaver-data-extra rotzoomer xscreensaver-data-extra rubik xscreensaver-gl-extra @@ -172,6 +176,7 @@ sonar xscreensaver-gl speedmine xscreensaver-data-extra spheremonics xscreensaver-gl +splitflap xscreensaver-gl spotlight xscreensaver-data-extra sproingies xscreensaver-gl-extra squiral xscreensaver-data-extra diff -Nru xscreensaver-5.30/debian/xscreensaver-gl.postinst xscreensaver-5.34/debian/xscreensaver-gl.postinst --- xscreensaver-5.30/debian/xscreensaver-gl.postinst 2015-11-01 14:09:30.000000000 -0500 +++ xscreensaver-5.34/debian/xscreensaver-gl.postinst 2015-11-01 14:09:33.000000000 -0500 @@ -2,21 +2,19 @@ set -e -# remove old link if it exists -if [ -L /usr/X11R6/lib/X11/app-defaults/XScreenSaver ]; then - rm /usr/X11R6/lib/X11/app-defaults/XScreenSaver +if [ -L /etc/X11/app-defaults/XScreenSaver ]; then + if [ "$(readlink /etc/X11/app-defaults/XScreenSaver)" = "XScreenSaver-nogl" ]; then + rm /etc/X11/app-defaults/XScreenSaver + fi fi cd /etc/X11/app-defaults -if [ -f XScreenSaver-gl ]; then - ln -sf XScreenSaver-gl XScreenSaver -else - ln -sf XScreenSaver-nogl XScreenSaver -fi - -# Remove /usr/doc symlink -if [ -d /usr/doc -a -h /usr/doc/xscreensaver-gl -a -d /usr/share/doc/xscreensaver-gl ]; then - rm -f /usr/doc/xscreensaver-gl +if [ ! -e XScreenSaver ]; then + if [ -f XScreenSaver-gl ]; then + ln -sf XScreenSaver-gl XScreenSaver + else + ln -sf XScreenSaver-nogl XScreenSaver + fi fi #DEBHELPER# diff -Nru xscreensaver-5.30/debian/xscreensaver-gl.postrm xscreensaver-5.34/debian/xscreensaver-gl.postrm --- xscreensaver-5.30/debian/xscreensaver-gl.postrm 2015-11-01 14:09:30.000000000 -0500 +++ xscreensaver-5.34/debian/xscreensaver-gl.postrm 2015-11-01 14:09:33.000000000 -0500 @@ -5,16 +5,14 @@ case "$1" in remove|purge) if [ -L /etc/X11/app-defaults/XScreenSaver ]; then - rm /etc/X11/app-defaults/XScreenSaver - if [ -f /etc/X11/app-defaults/XScreenSaver-nogl ]; then - ln -sf XScreenSaver-nogl /etc/X11/app-defaults/XScreenSaver - fi - fi - if [ -L /usr/X11R6/lib/X11/app-defaults/XScreenSaver ]; then - rm /usr/X11R6/lib/X11/app-defaults/XScreenSaver - fi - if [ -L /usr/doc/xscreensaver-gl ]; then - rm -f /usr/doc/xscreensaver-gl + if [ "$(readlink /etc/X11/app-defaults/XScreenSaver)" = "XScreenSaver-gl" ]; then + if [ -e /etc/X11/app-defaults/XScreenSaver-nogl ]; then + ln -sf XScreenSaver-nogl /etc/X11/app-defaults/XScreenSaver.dpkg-new + mv -f /etc/X11/app-defaults/XScreenSaver.dpkg-new /etc/X11/app-defaults/XScreenSaver + else + rm -f /etc/X11/app-defaults/XScreenSaver + fi + fi fi ;; esac diff -Nru xscreensaver-5.30/debian/xscreensaver.postinst xscreensaver-5.34/debian/xscreensaver.postinst --- xscreensaver-5.30/debian/xscreensaver.postinst 2015-11-01 14:09:30.000000000 -0500 +++ xscreensaver-5.34/debian/xscreensaver.postinst 2015-11-01 14:09:33.000000000 -0500 @@ -2,34 +2,14 @@ set -e -#fix up our old screwup -if dpkg-divert --list /usr/share/gnome/apps/Settings/Desktop/screensaver-properties.desktop | grep -q "diversion of /usr/share/gnome/apps/Settings/Desktop/screensaver-properties.desktop to /usr/share/gnome/apps/Settings/Desktop/screensaver-properties.desktop.orig by xscreensaver"; then - rm -f /usr/share/gnome/apps/Settings/Desktop/screensaver-properties.desktop - rm -f /usr/share/control-center/Desktop/screensaver-properties.desktop - dpkg-divert --package xscreensaver --remove --rename --divert \ - /usr/share/gnome/apps/Settings/Desktop/screensaver-properties.desktop.orig \ - /usr/share/gnome/apps/Settings/Desktop/screensaver-properties.desktop - dpkg-divert --package xscreensaver --remove --rename --divert \ - /usr/share/control-center/Desktop/screensaver-properties.desktop.orig \ - /usr/share/control-center/Desktop/screensaver-properties.desktop -fi - -# remove old link if it exists -if [ -L /usr/X11R6/lib/X11/app-defaults/XScreenSaver ]; then - rm /usr/X11R6/lib/X11/app-defaults/XScreenSaver -fi - # Use the correct app defaults cd /etc/X11/app-defaults -if [ -f XScreenSaver-gl ]; then +if [ ! -e XScreenSaver ]; then + if [ -f XScreenSaver-gl ]; then ln -sf XScreenSaver-gl XScreenSaver -else + else ln -sf XScreenSaver-nogl XScreenSaver -fi - -# Remove /usr/doc symlink -if [ -d /usr/doc -a -h /usr/doc/xscreensaver -a -d /usr/share/doc/xscreensaver ]; then - rm -f /usr/doc/xscreensaver + fi fi #DEBHELPER# diff -Nru xscreensaver-5.30/debian/xscreensaver.postrm xscreensaver-5.34/debian/xscreensaver.postrm --- xscreensaver-5.30/debian/xscreensaver.postrm 2015-11-01 14:09:30.000000000 -0500 +++ xscreensaver-5.34/debian/xscreensaver.postrm 2015-11-01 14:09:33.000000000 -0500 @@ -4,21 +4,11 @@ case "$1" in remove|purge) - if [ -x /usr/sbin/suidunregister ]; then - suidunregister -s xscreensaver /usr/X11R6/bin/xscreensaver - suidunregister -s xscreensaver /usr/X11R6/bin/sonar - suidunregister -s xscreensaver /usr/X11R6/lib/xscreensaver/sonar - suidunregister -s xscreensaver /usr/bin/xscreensaver - suidunregister -s xscreensaver /usr/lib/xscreensaver/sonar - fi if [ -L /etc/X11/app-defaults/XScreenSaver ]; then + if [ "$(readlink /etc/X11/app-defaults/XScreenSaver)" = "XScreenSaver-nogl" -o \ + "$(readlink /etc/X11/app-defaults/XScreenSaver)" = "XScreenSaver-gl" ]; then rm /etc/X11/app-defaults/XScreenSaver - fi - if [ -L /usr/X11R6/lib/X11/app-defaults/XScreenSaver ]; then - rm /usr/X11R6/lib/X11/app-defaults/XScreenSaver - fi - if [ -L /usr/doc/xscreensaver ]; then - rm -f /usr/doc/xscreensaver + fi fi ;; esac diff -Nru xscreensaver-5.30/debian/xscreensaver.preinst xscreensaver-5.34/debian/xscreensaver.preinst --- xscreensaver-5.30/debian/xscreensaver.preinst 2015-11-01 14:09:30.000000000 -0500 +++ xscreensaver-5.34/debian/xscreensaver.preinst 1969-12-31 19:00:00.000000000 -0500 @@ -1,43 +0,0 @@ -#!/bin/sh -# preinst script for xscreensaver -# -# see: dh_installdeb(1) - -set -e - -# Remove a no-longer used conffile -rm_conffile() { - local PKGNAME="$1" - local CONFFILE="$2" - - [ -e "$CONFFILE" ] || return 0 - - local md5sum="$(md5sum $CONFFILE | sed -e 's/ .*//')" - local old_md5sum="$(dpkg-query -W -f='${Conffiles}' $PKGNAME | \ - sed -n -e "\' $CONFFILE ' { s/ obsolete$//; s/.* //; p }")" - if [ "$md5sum" != "$old_md5sum" ]; then - echo "Obsolete conffile $CONFFILE has been modified by you." - echo "Saving as $CONFFILE.dpkg-bak ..." - mv -f "$CONFFILE" "$CONFFILE".dpkg-bak - else - echo "Removing obsolete conffile $CONFFILE ..." - rm -f "$CONFFILE" - fi -} - -case "$1" in -install|upgrade) - # Remove a file which was mistakenly shipped in 5.10-2 - # and kept in 5.10-3 but deleted unconditionally since 5.10-4 - if dpkg --compare-versions "$2" le "5.10-3"; then - rm_conffile xscreensaver "/etc/X11/Xsession.d/80xscreensaver_start" - fi - # Was shipped in -3,-4,-5 but deleted unconditionally since 5.10-6 - if dpkg --compare-versions "$2" le "5.10-5"; then - rm_conffile xscreensaver "/etc/xdg/autostart/xscreensaver-daemon.desktop" - fi -esac - -#DEBHELPER# - -exit 0 diff -Nru xscreensaver-5.30/debian/xscreensaver-wrapper.sh xscreensaver-5.34/debian/xscreensaver-wrapper.sh --- xscreensaver-5.30/debian/xscreensaver-wrapper.sh 2015-11-01 14:09:30.000000000 -0500 +++ xscreensaver-5.34/debian/xscreensaver-wrapper.sh 2015-11-01 14:09:33.000000000 -0500 @@ -1,7 +1,14 @@ #!/bin/sh -if [ -n "$GDMSESSION" ] && which gdmflexiserver > /dev/null; then - echo "XScreenSaver.newLoginCommand: gdmflexiserver -ls" | xrdb -merge +if [ -n "$GDMSESSION" ]; then + case "$XDG_GREETER_DATA_DIR" in + *lightdm*) + which dm-tool > /dev/null && echo "XScreenSaver.newLoginCommand: dm-tool switch-to-greeter" | xrdb -merge + ;; + *) + which gdmflexiserver > /dev/null && echo "XScreenSaver.newLoginCommand: gdmflexiserver -ls" | xrdb -merge + ;; + esac fi if [ -n "$KDE_FULL_SESSION" ] && which kdmctl > /dev/null; then diff -Nru xscreensaver-5.30/driver/demo-Gtk.c xscreensaver-5.34/driver/demo-Gtk.c --- xscreensaver-5.30/driver/demo-Gtk.c 2014-06-04 05:30:47.000000000 -0400 +++ xscreensaver-5.34/driver/demo-Gtk.c 2015-03-01 23:08:40.000000000 -0500 @@ -1557,7 +1557,7 @@ # define TEXT(FIELD,NAME) \ w = name_to_widget (s, (NAME)); \ - (FIELD) = (char *) gtk_entry_get_text (GTK_ENTRY (w)) + (FIELD) = (char *) g_strdup(gtk_entry_get_text (GTK_ENTRY (w))) MINUTES (&p2->timeout, "timeout_spinbutton"); MINUTES (&p2->cycle, "cycle_spinbutton"); diff -Nru xscreensaver-5.30/driver/demo-Gtk-conf.c xscreensaver-5.34/driver/demo-Gtk-conf.c --- xscreensaver-5.30/driver/demo-Gtk-conf.c 2013-12-04 15:30:13.000000000 -0500 +++ xscreensaver-5.34/driver/demo-Gtk-conf.c 2014-09-26 22:56:05.000000000 -0400 @@ -1,5 +1,5 @@ /* demo-Gtk-conf.c --- implements the dynamic configuration dialogs. - * xscreensaver, Copyright (c) 2001-2013 Jamie Zawinski + * xscreensaver, Copyright (c) 2001-2014 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 @@ -300,7 +300,8 @@ else if (!strcmp (name, "xscreensaver-text") || /* ignored in X11; */ !strcmp (name, "xscreensaver-image") || /* used in Cocoa. */ - !strcmp (name, "xscreensaver-updater")) + !strcmp (name, "xscreensaver-updater") || + !strcmp (name, "video")) { free (p); return 0; @@ -1169,7 +1170,7 @@ char q = s[0]; if (q != '\'' && q != '\"' && q != '`') abort(); - memmove (s, s+1, strlen (s)+1); + memmove (s, s+1, strlen (s)); while (*s && *s != q) { if (*s == '\\') diff -Nru xscreensaver-5.30/driver/prefs.h xscreensaver-5.34/driver/prefs.h --- xscreensaver-5.30/driver/prefs.h 2014-04-27 00:06:52.000000000 -0400 +++ xscreensaver-5.34/driver/prefs.h 2015-10-24 14:06:34.000000000 -0400 @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1993-2013 Jamie Zawinski +/* xscreensaver, Copyright (c) 1993-2015 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 @@ -28,7 +28,8 @@ char *make_hack_name (Display *, const char *shell_command); /* From dpms.c */ -extern void sync_server_dpms_settings (Display *, Bool enabled_p, Bool dpms_quickoff_p, +extern void sync_server_dpms_settings (Display *, Bool enabled_p, + Bool dpms_quickoff_p, int standby_secs, int suspend_secs, int off_secs, Bool verbose_p); diff -Nru xscreensaver-5.30/driver/subprocs.c xscreensaver-5.34/driver/subprocs.c --- xscreensaver-5.30/driver/subprocs.c 2014-05-30 20:41:44.000000000 -0400 +++ xscreensaver-5.34/driver/subprocs.c 2015-10-23 14:09:55.000000000 -0400 @@ -1,5 +1,5 @@ /* subprocs.c --- choosing, spawning, and killing screenhacks. - * xscreensaver, Copyright (c) 1991-2014 Jamie Zawinski + * xscreensaver, Copyright (c) 1991-2015 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 @@ -387,6 +387,11 @@ void unblock_sigchld (void) { + if (block_sigchld_handler <= 0) + abort(); + + if (block_sigchld_handler <= 1) /* only unblock if count going to 0 */ + { #ifdef HAVE_SIGACTION struct sigaction sa; sigset_t child_set; @@ -402,6 +407,7 @@ #else /* !HAVE_SIGACTION */ signal(SIGPIPE, SIG_DFL); #endif /* !HAVE_SIGACTION */ + } block_sigchld_handler--; } @@ -415,7 +421,7 @@ clean_job_list(); - if (block_sigchld_handler) + if (in_signal_handler_p) /* This function should not be called from the signal handler. */ abort(); diff -Nru xscreensaver-5.30/driver/timers.c xscreensaver-5.34/driver/timers.c --- xscreensaver-5.30/driver/timers.c 2014-04-27 00:06:52.000000000 -0400 +++ xscreensaver-5.34/driver/timers.c 2014-12-04 17:20:36.000000000 -0500 @@ -1,5 +1,5 @@ /* timers.c --- detecting when the user is idle, and other timer-related tasks. - * xscreensaver, Copyright (c) 1991-2013 Jamie Zawinski + * xscreensaver, Copyright (c) 1991-2014 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 @@ -140,9 +140,10 @@ XGetWindowAttributes (si->dpy, window, &attrs); events = ((attrs.all_event_masks | attrs.do_not_propagate_mask) - & KeyPressMask); + & (KeyPressMask | PropertyChangeMask)); /* Select for SubstructureNotify on all windows. + Select for PropertyNotify on all windows. Select for KeyPress on all windows that already have it selected. Note that we can't select for ButtonPress, because of X braindamage: @@ -161,7 +162,8 @@ systems that have it. Oh, if it's a PS/2 mouse, not serial or USB. This sucks! */ - XSelectInput (si->dpy, window, SubstructureNotifyMask | events); + XSelectInput (si->dpy, window, + SubstructureNotifyMask | PropertyChangeMask | events); if (top_p && p->debug_p && (events & KeyPressMask)) { @@ -687,6 +689,7 @@ explicitly informed by SGI SCREEN_SAVER server event; explicitly informed by MIT-SCREEN-SAVER server event; select events on all windows, and note events on any of them; + note that a client updated their window's _NET_WM_USER_TIME property; note that /proc/interrupts has changed; deactivated by clientmessage. @@ -984,6 +987,37 @@ break; + case PropertyNotify: + + if (event.x_event.xproperty.state == PropertyNewValue && + event.x_event.xproperty.atom == XA_NET_WM_USER_TIME) + { + /* Let's just assume that they only ever set USER_TIME to the + current time, and don't do something stupid like repeatedly + setting it to 20 minutes ago. */ + + why = "WM_USER_TIME"; + + if (p->debug_p) + { + Window w = event.x_event.xproperty.window; + XWindowAttributes xgwa; + int i; + XGetWindowAttributes (si->dpy, w, &xgwa); + for (i = 0; i < si->nscreens; i++) + if (xgwa.root == RootWindowOfScreen (si->screens[i].screen)) + break; + fprintf (stderr,"%s: %d: %s on 0x%lx\n", + blurb(), i, why, (unsigned long) w); + } + + if (until_idle_p) + reset_timers (si); + else + goto DONE; + } + break; + default: #ifdef HAVE_MIT_SAVER_EXTENSION diff -Nru xscreensaver-5.30/driver/windows.c xscreensaver-5.34/driver/windows.c --- xscreensaver-5.30/driver/windows.c 2014-09-10 17:45:07.000000000 -0400 +++ xscreensaver-5.34/driver/windows.c 2015-10-24 14:42:23.000000000 -0400 @@ -74,10 +74,10 @@ extern int kill (pid_t, int); /* signal() is in sys/signal.h... */ Atom XA_VROOT, XA_XSETROOT_ID, XA_ESETROOT_PMAP_ID, XA_XROOTPMAP_ID; +Atom XA_NET_WM_USER_TIME; Atom XA_SCREENSAVER, XA_SCREENSAVER_VERSION, XA_SCREENSAVER_ID; Atom XA_SCREENSAVER_STATUS; - extern saver_info *global_si_kludge; /* I hate C so much... */ static void maybe_transfer_grabs (saver_screen_info *ssi, @@ -1008,7 +1008,7 @@ status = (PROP32 *) calloc (size, sizeof(PROP32)); - status[0] = (PROP32) (si->screen_blanked_p + status[0] = (PROP32) (si->screen_blanked_p || si->locked_p ? (si->locked_p ? XA_LOCK : XA_BLANK) : 0); status[1] = (PROP32) si->blank_time; @@ -1681,7 +1681,7 @@ raise_window (si, False, False, False); si->screen_blanked_p = True; - si->blank_time = time ((time_t) 0); + si->blank_time = time ((time_t *) 0); si->last_wall_clock_time = 0; store_saver_status (si); /* store blank time */ @@ -1803,7 +1803,7 @@ XUnmapWindow (si->dpy, si->screens[i].screensaver_window); si->screen_blanked_p = False; - si->blank_time = time ((time_t) 0); + si->blank_time = time ((time_t *) 0); si->last_wall_clock_time = 0; store_saver_status (si); /* store unblank time */ diff -Nru xscreensaver-5.30/driver/XScreenSaver_ad.h xscreensaver-5.34/driver/XScreenSaver_ad.h --- xscreensaver-5.30/driver/XScreenSaver_ad.h 2014-09-11 13:07:53.000000000 -0400 +++ xscreensaver-5.34/driver/XScreenSaver_ad.h 2015-10-24 15:14:58.000000000 -0400 @@ -34,7 +34,7 @@ "*textLiteral: XScreenSaver", "*textFile: ", "*textProgram: fortune", -"*textURL: http://en.wikipedia.org/w/index.php?title=Special:NewPages&feed=rss", +"*textURL: https://en.wikipedia.org/w/index.php?title=Special:NewPages&feed=rss", "*overlayTextForeground: #FFFF00", "*overlayTextBackground: #000000", "*overlayStderr: True", @@ -112,7 +112,7 @@ distort -root \\n\ epicycle -root \\n\ flow -root \\n\ -- GL: glplanet -root \\n\ + GL: glplanet -root \\n\ interference -root \\n\ kumppa -root \\n\ GL: lament -root \\n\ @@ -127,7 +127,7 @@ compass -root \\n\ deluxe -root \\n\ - demon -root \\n\ -- GL: extrusion -root \\n\ + GL: extrusion -root \\n\ - loop -root \\n\ penetrate -root \\n\ petri -root \\n\ @@ -207,7 +207,7 @@ popsquares -root \\n\ GL: surfaces -root \\n\ xanalogtv -root \\n\ -- abstractile -root \\n\ + abstractile -root \\n\ anemotaxis -root \\n\ - GL: antinspect -root \\n\ fireworkx -root \\n\ @@ -258,9 +258,15 @@ GL: kaleidocycle -root \\n\ GL: quasicrystal -root \\n\ GL: unknownpleasures -root \\n\ + binaryring -root \\n\ + GL: cityflow -root \\n\ + GL: geodesicgears -root \\n\ GL: projectiveplane -root \\n\ + GL: romanboy -root \\n\ tessellimage -root \\n\ - GL: winduprobot -root \\n", + GL: winduprobot -root \\n\ + GL: splitflap -root \\n\ + testx11 -root \\n", "XScreenSaver.pointerPollTime: 0:00:05", "XScreenSaver.pointerHysteresis: 10", "XScreenSaver.initialDelay: 0:00:00", @@ -297,13 +303,14 @@ "*passwd.asterisks: True", "*passwd.uname: True", "*splash.heading.label: XScreenSaver %s", -"*splash.body.label: Copyright \\251 1991-2014 by", +"*splash.body.label: Copyright \\251 1991-2015 by", "*splash.body2.label: Jamie Zawinski ", "*splash.demo.label: Settings", "*splash.help.label: Help", "*hacks.antinspect.name: AntInspect", "*hacks.antmaze.name: AntMaze", "*hacks.antspotlight.name: AntSpotlight", +"*hacks.binaryring.name: BinaryRing", "*hacks.blinkbox.name: BlinkBox", "*hacks.blitspin.name: BlitSpin", "*hacks.blocktube.name: BlockTube", @@ -329,6 +336,7 @@ "*hacks.flyingtoasters.name: FlyingToasters", "*hacks.fontglide.name: FontGlide", "*hacks.fuzzyflakes.name: FuzzyFlakes", +"*hacks.geodesicgears.name: GeodesicGears", "*hacks.gflux.name: GFlux", "*hacks.gleidescope.name: Gleidescope", "*hacks.glforestfire.name: GLForestFire", @@ -353,6 +361,7 @@ "*hacks.quasicrystal.name: QuasiCrystal", "*hacks.rd-bomb.name: RDbomb", "*hacks.rdbomb.name: RDbomb", +"*hacks.romanboy.name: RomanBoy", "*hacks.rotzoomer.name: RotZoomer", "*hacks.rubikblocks.name: RubikBlocks", "*hacks.sballs.name: SBalls", @@ -361,9 +370,11 @@ "*hacks.skytentacles.name: SkyTentacles", "*hacks.slidescreen.name: SlideScreen", "*hacks.speedmine.name: SpeedMine", +"*hacks.splitflap.name: SplitFlap", "*hacks.starwars.name: StarWars", "*hacks.stonerview.name: StonerView", "*hacks.t3d.name: T3D", +"*hacks.testx11.name: TestX11", "*hacks.timetunnel.name: TimeTunnel", "*hacks.topblock.name: TopBlock", "*hacks.tronbit.name: TronBit", diff -Nru xscreensaver-5.30/driver/XScreenSaver.ad.in xscreensaver-5.34/driver/XScreenSaver.ad.in --- xscreensaver-5.30/driver/XScreenSaver.ad.in 2014-09-11 13:07:33.000000000 -0400 +++ xscreensaver-5.34/driver/XScreenSaver.ad.in 2015-10-24 14:55:33.000000000 -0400 @@ -4,8 +4,8 @@ ! a screen saver and locker for the X window system ! by Jamie Zawinski ! -! version 5.30 -! 11-Sep-2014 +! version 5.34 +! 24-Oct-2015 ! ! See "man xscreensaver" for more info. The latest version is always ! available at http://www.jwz.org/xscreensaver/ @@ -63,7 +63,7 @@ *textLiteral: XScreenSaver *textFile: @DEFAULT_TEXT_FILE@ *textProgram: fortune -*textURL: http://en.wikipedia.org/w/index.php?title=Special:NewPages&feed=rss +*textURL: https://en.wikipedia.org/w/index.php?title=Special:NewPages&feed=rss *overlayTextForeground: #FFFF00 *overlayTextBackground: #000000 @@ -134,6 +134,7 @@ ! (That button does not appear on the dialog if this program does not exist.) ! For Gnome: probably "gdmflexiserver -ls". KDE, probably "kdmctl reserve". ! Or maybe yet another wheel-reinvention, "lxdm -c USER_SWITCH". +! Oh wait, this wheel just keeps getting better: "dm-tool switch-to-greeter". ! @NEW_LOGIN_COMMAND_P@*newLoginCommand: @NEW_LOGIN_COMMAND@ @@ -216,7 +217,7 @@ distort -root \n\ epicycle -root \n\ flow -root \n\ -- GL: glplanet -root \n\ +@GL_KLUDGE@ GL: glplanet -root \n\ interference -root \n\ kumppa -root \n\ @GL_KLUDGE@ GL: lament -root \n\ @@ -311,7 +312,7 @@ popsquares -root \n\ @GL_KLUDGE@ GL: surfaces -root \n\ xanalogtv -root \n\ -- abstractile -root \n\ + abstractile -root \n\ anemotaxis -root \n\ - GL: antinspect -root \n\ fireworkx -root \n\ @@ -362,9 +363,15 @@ @GL_KLUDGE@ GL: kaleidocycle -root \n\ @GL_KLUDGE@ GL: quasicrystal -root \n\ @GL_KLUDGE@ GL: unknownpleasures -root \n\ + binaryring -root \n\ +@GL_KLUDGE@ GL: cityflow -root \n\ +@GL_KLUDGE@ GL: geodesicgears -root \n\ @GL_KLUDGE@ GL: projectiveplane -root \n\ +@GL_KLUDGE@ GL: romanboy -root \n\ tessellimage -root \n\ -@GL_KLUDGE@ GL: winduprobot -root \n +@GL_KLUDGE@ GL: winduprobot -root \n\ +@GL_KLUDGE@ GL: splitflap -root \n\ + testx11 -root \n @@ -423,7 +430,7 @@ *passwd.uname: True *splash.heading.label: XScreenSaver %s -*splash.body.label: Copyright \251 1991-2014 by +*splash.body.label: Copyright \251 1991-2015 by *splash.body2.label: Jamie Zawinski *splash.demo.label: Settings *splash.help.label: Help @@ -438,6 +445,7 @@ *hacks.antinspect.name: AntInspect *hacks.antmaze.name: AntMaze *hacks.antspotlight.name: AntSpotlight +*hacks.binaryring.name: BinaryRing *hacks.blinkbox.name: BlinkBox *hacks.blitspin.name: BlitSpin *hacks.blocktube.name: BlockTube @@ -463,6 +471,7 @@ *hacks.flyingtoasters.name: FlyingToasters *hacks.fontglide.name: FontGlide *hacks.fuzzyflakes.name: FuzzyFlakes +*hacks.geodesicgears.name: GeodesicGears *hacks.gflux.name: GFlux *hacks.gleidescope.name: Gleidescope *hacks.glforestfire.name: GLForestFire @@ -487,6 +496,7 @@ *hacks.quasicrystal.name: QuasiCrystal *hacks.rd-bomb.name: RDbomb *hacks.rdbomb.name: RDbomb +*hacks.romanboy.name: RomanBoy *hacks.rotzoomer.name: RotZoomer *hacks.rubikblocks.name: RubikBlocks *hacks.sballs.name: SBalls @@ -495,9 +505,11 @@ *hacks.skytentacles.name: SkyTentacles *hacks.slidescreen.name: SlideScreen *hacks.speedmine.name: SpeedMine +*hacks.splitflap.name: SplitFlap *hacks.starwars.name: StarWars *hacks.stonerview.name: StonerView *hacks.t3d.name: T3D +*hacks.testx11.name: TestX11 *hacks.timetunnel.name: TimeTunnel *hacks.topblock.name: TopBlock *hacks.tronbit.name: TronBit diff -Nru xscreensaver-5.30/driver/xscreensaver.c xscreensaver-5.34/driver/xscreensaver.c --- xscreensaver-5.30/driver/xscreensaver.c 2014-08-05 02:27:17.000000000 -0400 +++ xscreensaver-5.34/driver/xscreensaver.c 2015-10-24 14:43:43.000000000 -0400 @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1991-2013 Jamie Zawinski +/* xscreensaver, Copyright (c) 1991-2015 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 @@ -93,6 +93,14 @@ * subwindows. It is an incredible misdesign that one client can make * another client malfunction in this way. * + * But here's a new kink that started showing up in late 2014: GNOME programs + * don't actually select for or receive KeyPress events! They do it behind + * the scenes through some kind of Input Method magic, even when running in + * an en_US locale. However, in that case, those applications *do* seem to + * update the _NET_WM_USER_TIME on their own windows every time they have + * received a secret KeyPress, so we *also* monitor that property on every + * window, and treat changes to it as identical to KeyPress. + * * To detect mouse motion, we periodically wake up and poll the mouse * position and button/modifier state, and notice when something has * changed. We make this check every five seconds by default, and since the @@ -600,6 +608,16 @@ } } + /* Like MacOS, locking under Wayland's embedded X11 server does not work. + (X11 grabs don't work because the Wayland window manager lives at a + higher level than the X11 emulation layer.) + */ + if (!si->locking_disabled_p && getenv ("WAYLAND_DISPLAY")) + { + si->locking_disabled_p = True; + si->nolock_reason = "Cannot lock securely under Wayland"; + } + if (si->prefs.debug_p) /* But allow locking anyway in debug mode. */ si->locking_disabled_p = False; @@ -659,6 +677,7 @@ XA_XSETROOT_ID = XInternAtom (si->dpy, "_XSETROOT_ID", False); XA_ESETROOT_PMAP_ID = XInternAtom (si->dpy, "ESETROOT_PMAP_ID", False); XA_XROOTPMAP_ID = XInternAtom (si->dpy, "_XROOTPMAP_ID", False); + XA_NET_WM_USER_TIME = XInternAtom (si->dpy, "_NET_WM_USER_TIME", False); XA_ACTIVATE = XInternAtom (si->dpy, "ACTIVATE", False); XA_DEACTIVATE = XInternAtom (si->dpy, "DEACTIVATE", False); XA_RESTART = XInternAtom (si->dpy, "RESTART", False); @@ -1256,6 +1275,12 @@ "%s: unable to grab keyboard or mouse! Blanking aborted.\n", blurb()); + /* Since we were unable to blank, clearly we're not locked, + but we might have been prematurely marked as locked by + the LOCK ClientMessage. */ + if (si->locked_p) + set_locked_p (si, False); + schedule_wakeup_event (si, retry, p->debug_p); continue; } @@ -1526,7 +1551,7 @@ if (p->verbose_p) analyze_display (si); initialize_server_extensions (si); - si->blank_time = time ((time_t) 0); /* must be before ..._window */ + si->blank_time = time ((time_t *) 0); /* must be before ..._window */ initialize_screensaver_window (si); select_events (si); @@ -2044,7 +2069,16 @@ : "locking."); sprintf (buf, "LOCK ClientMessage received; %s", response); clientmessage_response (si, window, False, buf, response); + + /* Note that this leaves things in a slightly inconsistent state: + we are blanked but not locked. And blanking might actually + fail if we can't get the grab. */ set_locked_p (si, True); + + /* Have to set the time or xscreensaver-command doesn't + report the LOCK state change. */ + si->blank_time = time ((time_t *) 0); + si->selection_mode = 0; si->demoing_p = False; diff -Nru xscreensaver-5.30/driver/xscreensaver-demo.man xscreensaver-5.34/driver/xscreensaver-demo.man --- xscreensaver-5.30/driver/xscreensaver-demo.man 2013-12-07 17:42:02.000000000 -0500 +++ xscreensaver-5.34/driver/xscreensaver-demo.man 2015-03-30 21:21:41.000000000 -0400 @@ -138,6 +138,10 @@ If this is 0, then the graphics demo will never be changed: only one demo will run until the screensaver is deactivated by user activity. + +The running saver will be restarted every this-many minutes even in +\fIOnly One Screen Saver\fP mode, since some savers tend to converge +on a steady state. .TP 4 .B Lock Screen When this is checked, the screen will be locked when it activates. @@ -384,7 +388,7 @@ .BR xscreensaver\-getimage (1), .BR xscreensaver\-text (1) .SH COPYRIGHT -Copyright \(co 1992-2013 by Jamie Zawinski. +Copyright \(co 1992-2015 by 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 the above copyright notice appear in all copies and that diff -Nru xscreensaver-5.30/driver/xscreensaver-getimage-video xscreensaver-5.34/driver/xscreensaver-getimage-video --- xscreensaver-5.30/driver/xscreensaver-getimage-video 2013-07-27 21:35:52.000000000 -0400 +++ xscreensaver-5.34/driver/xscreensaver-getimage-video 2015-05-14 01:58:20.000000000 -0400 @@ -1,5 +1,5 @@ #!/usr/bin/perl -w -# Copyright © 2001-2013 Jamie Zawinski . +# Copyright © 2001-2015 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 @@ -30,7 +30,7 @@ use strict; my $progname = $0; $progname =~ s@.*/@@g; -my $version = q{ $Revision: 1.22 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/; +my $version = q{ $Revision: 1.23 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/; my $tmpdir = $ENV{TMPDIR} || "/tmp"; my $tmpfile = sprintf("%s/xssv.%08x.ppm", $tmpdir, rand(0xFFFFFFFF)); @@ -64,11 +64,14 @@ "motioneye -j $tmpfile", # Sony Vaio MotionEye # (hardware jpeg encoder) - "vidcat -b -f ppm -s 640x480 > $tmpfile 2>-", # w3cam/ovcam + "vidcat -b -f ppm -s 640x480 > $tmpfile 2>&-", # w3cam/ovcam "vidtomem -f $tmpfile 2>&- " . # Silicon Graphics "&& mv $tmpfile-00000.rgb $tmpfile", + # Maybe this works? + # "ffmpeg -i /dev/video0 -ss 00:00:01 -vframes 1 $tmpfile 2>&-", + # "mplayer -really-quiet tv://0 " . # Maybe works with some cams? # "-ao null -vo pnm -frames 1 2>&- " . # "&& mv 00000001.ppm $tmpfile", diff -Nru xscreensaver-5.30/driver/xscreensaver.h xscreensaver-5.34/driver/xscreensaver.h --- xscreensaver-5.30/driver/xscreensaver.h 2013-02-03 17:25:55.000000000 -0500 +++ xscreensaver-5.34/driver/xscreensaver.h 2014-12-04 16:59:26.000000000 -0500 @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1993-2012 Jamie Zawinski +/* xscreensaver, Copyright (c) 1993-2014 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 @@ -201,6 +201,7 @@ #endif /* HAVE_XF86VMODE */ extern Atom XA_VROOT, XA_XSETROOT_ID, XA_ESETROOT_PMAP_ID, XA_XROOTPMAP_ID; +extern Atom XA_NET_WM_USER_TIME; extern Atom XA_SCREENSAVER, XA_SCREENSAVER_VERSION, XA_SCREENSAVER_ID; extern Atom XA_SCREENSAVER_STATUS, XA_LOCK, XA_BLANK; extern Atom XA_DEMO, XA_PREFS; diff -Nru xscreensaver-5.30/driver/xscreensaver.man xscreensaver-5.34/driver/xscreensaver.man --- xscreensaver-5.30/driver/xscreensaver.man 2014-08-05 02:18:26.000000000 -0400 +++ xscreensaver-5.34/driver/xscreensaver.man 2015-06-08 16:48:06.000000000 -0400 @@ -180,7 +180,7 @@ option is set in your \fI/etc/X11/XF86Config\fP file. See the .BR XF86Config (5) manual for details. -.SH USING GNOME +.SH USING GNOME OR UNITY For the better part of a decade, GNOME shipped xscreensaver as-is, and everything just worked out of the box. In 2005, however, they decided to re-invent the wheel and ship their own replacement for @@ -202,11 +202,23 @@ Select "\fIStartup Applications\fP" from the menu (or manually launch "\fIgnome-session-properties\fP") and add "\fIxscreensaver\fP". .TP 3 -\fB3: Make "Lock Screen" use xscreensaver.\fP +\fB3: Make GNOME's "Lock Screen" use xscreensaver.\fP .EX sudo ln -sf /usr/bin/xscreensaver-command \\ /usr/bin/gnome-screensaver-command .EE +That doesn't work under Unity, though. Apparently it has its own +built-in screen locker which is not gnome-screensaver, and cannot be +removed, and yet still manages to be bug-addled and insecure. +Keep reinventing that wheel, guys! (If you have figured out how to +replace Unity's locking "feature" with xscreensaver, let me know.) +.TP 3 +\fB4: Turn off Unity's built-in blanking.\fP +Open "\fISystem Settings / Brightness & Lock\fP"; +.br +Un-check "\fIStart Automatically\fP"; +.br +Set \fI"Turn screen off when inactive for"\fP to \fI"Never."\fP .SH USING KDE Like GNOME, KDE also decided to invent their own screen saver framework from scratch instead of simply using xscreensaver. To replace the KDE @@ -258,12 +270,39 @@ and .BR xscreensaver-command (1) mechanisms. -.SH USING UNITY -Guess what, they did it again! Ubuntu Unity's screen-locking -framework is \fIyet another\fP rewrite, and it is completely broken, -bug-ridden and insecure. At this time I don't have any information on -how to turn it off and use xscreensaver instead. If you do, let me -know. +.SH USING SYSTEMD +If the above didn't do it, and your system has +.BR systemd (1), +then give this a try: + +.TP 3 +\fB1: Create a service.\fP +Create the file \fI~/.config/systemd/user/xscreensaver.service\fP +containing: +.EX +[Unit] +Description=XScreenSaver +[Service] +ExecStart=xscreensaver +[Install] +WantedBy=default.target +.EE +\fB2. Enable it.\fP +.EX +systemctl --user enable xscreensaver +.EE +Then restart X11. +.SH USING UPSTART +Still not working, but on your distro, that newfangled +.BR systemd (1) +nonsense has already fallen out of favor? Then maybe this will work: +launch the \fIStartup Applications\fP applet, click \fI"Add"\fP, and +enter these lines, then restart X11: +.EX +Name: XScreenSaver +Command: xscreensaver +Comment: xscreensaver +.EE .SH USING GDM You can run \fIxscreensaver\fP from your .BR gdm (1) @@ -443,6 +482,10 @@ new one started. If this is 0, then the graphics hack will never be changed: only one demo will run until the screensaver is deactivated by user activity. Default 10 minutes. + +The running saver will be restarted every \fIcycle\fP minutes even when +\fImode\fP is \fIone\fP, since some savers tend to converge on a steady +state. .TP 8 .B lock\fP (class \fBBoolean\fP) Enable locking: before the screensaver will turn off, it will require you @@ -899,7 +942,7 @@ .BR xscreensaver\-getimage (1), .BR xscreensaver\-text (1). .SH COPYRIGHT -Copyright \(co 1991-2014 by Jamie Zawinski. +Copyright \(co 1991-2015 by 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 the above copyright notice appear in all copies and that diff -Nru xscreensaver-5.30/driver/xscreensaver-text xscreensaver-5.34/driver/xscreensaver-text --- xscreensaver-5.30/driver/xscreensaver-text 2014-08-04 15:50:49.000000000 -0400 +++ xscreensaver-5.34/driver/xscreensaver-text 2015-07-21 21:19:51.000000000 -0400 @@ -1,5 +1,5 @@ #!/usr/bin/perl -w -# Copyright © 2005-2014 Jamie Zawinski +# Copyright © 2005-2015 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 @@ -28,13 +28,16 @@ # Only error out if we're actually loading a URL instead of local data. BEGIN { eval 'use LWP::UserAgent;' } +# Not sure how prevalent this is. Hope it's part of the default install. +BEGIN { eval 'use HTML::Entities;' } + use Socket; use POSIX qw(strftime); use Text::Wrap qw(wrap); use bytes; my $progname = $0; $progname =~ s@.*/@@g; -my ($version) = ('$Revision: 1.33 $' =~ m/\s(\d[.\d]+)\s/s); +my ($version) = ('$Revision: 1.39 $' =~ m/\s(\d[.\d]+)\s/s); my $verbose = 0; my $http_proxy = undef; @@ -44,146 +47,68 @@ my $text_literal = ''; my $text_file = ''; my $text_program = ''; -my $text_url = 'http://en.wikipedia.org/w/index.php?title=Special:NewPages&feed=rss'; +my $text_url = 'https://en.wikipedia.org/w/index.php?title=Special:NewPages&feed=rss'; # Default URL needs to be set and match what's in OSX/XScreenSaverView.m my $wrap_columns = undef; my $truncate_lines = undef; +my $latin1_p = 0; my $nyarlathotep_p = 0; -# Maps HTML character entities to the corresponding Latin1 characters. -# -my %entity_table = ( - "quot" => '"', "amp" => '&', "lt" => '<', - "gt" => '>', "nbsp" => " ", "iexcl" => "\xA1", - "cent" => "\xA2", "pound" => "\xA3", "curren" => "\xA4", - "yen" => "\xA5", "brvbar" => "\xA6", "sect" => "\xA7", - "uml" => "\xA8", "copy" => "\xA9", "ordf" => "\xAA", - "laquo" => "\xAB", "not" => "\xAC", "shy" => "\xAD", - "reg" => "\xAE", "macr" => "\xAF", "deg" => "\xB0", - "plusmn" => "\xB1", "sup2" => "\xB2", "sup3" => "\xB3", - "acute" => "\xB4", "micro" => "\xB5", "para" => "\xB6", - "middot" => "\xB7", "cedil" => "\xB8", "sup1" => "\xB9", - "ordm" => "\xBA", "raquo" => "\xBB", "frac14" => "\xBC", - "frac12" => "\xBD", "frac34" => "\xBE", "iquest" => "\xBF", - "Agrave" => "\xC0", "Aacute" => "\xC1", "Acirc" => "\xC2", - "Atilde" => "\xC3", "Auml" => "\xC4", "Aring" => "\xC5", - "AElig" => "\xC6", "Ccedil" => "\xC7", "Egrave" => "\xC8", - "Eacute" => "\xC9", "Ecirc" => "\xCA", "Euml" => "\xCB", - "Igrave" => "\xCC", "Iacute" => "\xCD", "Icirc" => "\xCE", - "Iuml" => "\xCF", "ETH" => "\xD0", "Ntilde" => "\xD1", - "Ograve" => "\xD2", "Oacute" => "\xD3", "Ocirc" => "\xD4", - "Otilde" => "\xD5", "Ouml" => "\xD6", "times" => "\xD7", - "Oslash" => "\xD8", "Ugrave" => "\xD9", "Uacute" => "\xDA", - "Ucirc" => "\xDB", "Uuml" => "\xDC", "Yacute" => "\xDD", - "THORN" => "\xDE", "szlig" => "\xDF", "agrave" => "\xE0", - "aacute" => "\xE1", "acirc" => "\xE2", "atilde" => "\xE3", - "auml" => "\xE4", "aring" => "\xE5", "aelig" => "\xE6", - "ccedil" => "\xE7", "egrave" => "\xE8", "eacute" => "\xE9", - "ecirc" => "\xEA", "euml" => "\xEB", "igrave" => "\xEC", - "iacute" => "\xED", "icirc" => "\xEE", "iuml" => "\xEF", - "eth" => "\xF0", "ntilde" => "\xF1", "ograve" => "\xF2", - "oacute" => "\xF3", "ocirc" => "\xF4", "otilde" => "\xF5", - "ouml" => "\xF6", "divide" => "\xF7", "oslash" => "\xF8", - "ugrave" => "\xF9", "uacute" => "\xFA", "ucirc" => "\xFB", - "uuml" => "\xFC", "yacute" => "\xFD", "thorn" => "\xFE", - "yuml" => "\xFF", "apos" => "\'", - - # HTML 4 entities that do not have 1:1 Latin1 mappings. - "bull" => "*", "hellip"=> "...", "prime" => "'", "Prime" => "\"", - "frasl" => "/", "trade" => "[tm]", "larr" => "<-", "rarr" => "->", - "harr" => "<->", "lArr" => "<=", "rArr" => "=>", "hArr" => "<=>", - "empty" => "\xD8", "minus" => "-", "lowast"=> "*", "sim" => "~", - "cong" => "=~", "asymp" => "~", "ne" => "!=", "equiv" => "==", - "le" => "<=", "ge" => ">=", "lang" => "<", "rang" => ">", - "loz" => "<>", "OElig" => "OE", "oelig" => "oe", "Yuml" => "Y", - "circ" => "^", "tilde" => "~", "ensp" => " ", "emsp" => " ", - "thinsp"=> " ", "ndash" => "-", "mdash" => "-", "lsquo" => "`", - "rsquo" => "'", "sbquo" => "'", "ldquo" => "\"", "rdquo" => "\"", - "bdquo" => "\"", "lsaquo"=> "<", "rsaquo"=> ">", -); - -# Maps certain UTF8 characters (2 or 3 bytes) to the corresponding -# Latin1 characters. -# -my %unicode_latin1_table = ( - "\xC2\xA1" => "\xA1", "\xC2\xA2" => "\xA2", "\xC2\xA3" => "\xA3", - "\xC2\xA4" => "\xA4", "\xC2\xA5" => "\xA5", "\xC2\xA6" => "\xA6", - "\xC2\xA7" => "\xA7", "\xC2\xA8" => "\xA8", "\xC2\xA9" => "\xA9", - "\xC2\xAA" => "\xAA", "\xC2\xAB" => "\xAB", "\xC2\xAC" => "\xAC", - "\xC2\xAD" => "\xAD", "\xC2\xAE" => "\xAE", "\xC2\xAF" => "\xAF", - "\xC2\xB0" => "\xB0", "\xC2\xB1" => "\xB1", "\xC2\xB2" => "\xB2", - "\xC2\xB3" => "\xB3", "\xC2\xB4" => "\xB4", "\xC2\xB5" => "\xB5", - "\xC2\xB6" => "\xB6", "\xC2\xB7" => "\xB7", "\xC2\xB8" => "\xB8", - "\xC2\xB9" => "\xB9", "\xC2\xBA" => "\xBA", "\xC2\xBB" => "\xBB", - "\xC2\xBC" => "\xBC", "\xC2\xBD" => "\xBD", "\xC2\xBE" => "\xBE", - "\xC2\xBF" => "\xBF", "\xC3\x80" => "\xC0", "\xC3\x81" => "\xC1", - "\xC3\x82" => "\xC2", "\xC3\x83" => "\xC3", "\xC3\x84" => "\xC4", - "\xC3\x85" => "\xC5", "\xC3\x86" => "\xC6", "\xC3\x87" => "\xC7", - "\xC3\x88" => "\xC8", "\xC3\x89" => "\xC9", "\xC3\x8A" => "\xCA", - "\xC3\x8B" => "\xCB", "\xC3\x8C" => "\xCC", "\xC3\x8D" => "\xCD", - "\xC3\x8E" => "\xCE", "\xC3\x8F" => "\xCF", "\xC3\x90" => "\xD0", - "\xC3\x91" => "\xD1", "\xC3\x92" => "\xD2", "\xC3\x93" => "\xD3", - "\xC3\x94" => "\xD4", "\xC3\x95" => "\xD5", "\xC3\x96" => "\xD6", - "\xC3\x97" => "\xD7", "\xC3\x98" => "\xD8", "\xC3\x99" => "\xD9", - "\xC3\x9A" => "\xDA", "\xC3\x9B" => "\xDB", "\xC3\x9C" => "\xDC", - "\xC3\x9D" => "\xDD", "\xC3\x9E" => "\xDE", "\xC3\x9F" => "\xDF", - "\xC3\xA0" => "\xE0", "\xC3\xA1" => "\xE1", "\xC3\xA2" => "\xE2", - "\xC3\xA3" => "\xE3", "\xC3\xA4" => "\xE4", "\xC3\xA5" => "\xE5", - "\xC3\xA6" => "\xE6", "\xC3\xA7" => "\xE7", "\xC3\xA8" => "\xE8", - "\xC3\xA9" => "\xE9", "\xC3\xAA" => "\xEA", "\xC3\xAB" => "\xEB", - "\xC3\xAC" => "\xEC", "\xC3\xAD" => "\xED", "\xC3\xAE" => "\xEE", - "\xC3\xAF" => "\xEF", "\xC3\xB0" => "\xF0", "\xC3\xB1" => "\xF1", - "\xC3\xB2" => "\xF2", "\xC3\xB3" => "\xF3", "\xC3\xB4" => "\xF4", - "\xC3\xB5" => "\xF5", "\xC3\xB6" => "\xF6", "\xC3\xB7" => "\xF7", - "\xC3\xB8" => "\xF8", "\xC3\xB9" => "\xF9", "\xC3\xBA" => "\xFA", - "\xC3\xBB" => "\xFB", "\xC3\xBC" => "\xFC", "\xC3\xBD" => "\xFD", - "\xC3\xBE" => "\xFE", "\xC3\xBF" => "\xFF", - - "\xE2\x80\x93" => '--', "\xE2\x80\x94" => '--', - "\xE2\x80\x98" => '`', "\xE2\x80\x99" => '\'', - "\xE2\x80\x9C" => "``", "\xE2\x80\x9D" => "''", - "\xE2\x80\xB2" => "'", "\xE2\x80\xA6" => '...', - "\xE2\x86\x90" => ' ← ', "\xE2\x84\xA2" => '™', - "\xE2\x80\xA2" => '•', "\xC2\xA0" => ' ', #   - ); - # Convert any HTML entities to Latin1 characters. # sub de_entify($) { my ($text) = @_; - $text =~ s/(&(\#)?([[:alpha:]\d]+);?)/ - { - my $c = $3; - if (! defined($2)) { - $c = $entity_table{$c}; # for Á - } else { - if ($c =~ m@^x([\dA-F]+)$@si) { # for A - $c = chr(hex($1)); - } elsif ($c =~ m@^\d+$@si) { # for A - $c = chr($c); - } else { - $c = undef; - } - } - ($c || "[$3]"); # for &unknown; => "[unknown]" - } - /gexi; - return $text; + + return '' unless defined($text); + return $text unless ($text =~ m/&/s); + + # Convert any HTML entities to Unicode characters, + # if the HTML::Entities module is installed. + eval { + my $t2 = $text; + $text = undef; + $text = HTML::Entities::decode_entities ($t2); + }; + return $text if defined($text); + + # If it's not installed, just complain instead of trying to halfass it. + print STDOUT ("\n\tPerl is broken. Do this to repair it:\n" . + "\n\tsudo cpan HTML::Entities\n\n"); + exit (1); } # Convert any Unicode characters to Latin1 if possible. # Unconvertable bytes are left alone. # -sub de_unicoddle($) { +sub utf8_to_latin1($) { my ($text) = @_; - foreach my $key (sort { length($b) <=> length($a) } - keys (%unicode_latin1_table)) { - my $val = $unicode_latin1_table{$key}; - $text =~ s/$key/$val/gs; - } + + utf8::encode ($text); # Unpack Unicode back to multi-byte UTF-8. + + # Maybe it would be better to handle this in the Unicode domain + # by doing things like s/\x{2018}/\"/g, but without decoding the + # string back to UTF-8 first, I'm at a loss as to how to have + # "á" print as "\340" instead of as "\303\240". + + $text =~ s/ \xC2 ( [\xA0-\xFF] ) / $1 /gsex; + $text =~ s/ \xC3 ( [\x80-\xFF] ) / chr (ord($1) | 0x40) /gsex; + + # Handles a few 3-byte sequences too. + $text =~ s/\xE2\x80\x93/--/gs; + $text =~ s/\xE2\x80\x94/--/gs; + $text =~ s/\xE2\x80\x98/`/gs; + $text =~ s/\xE2\x80\x99/'/gs; + $text =~ s/\xE2\x80\x9C/``/gs; + $text =~ s/\xE2\x80\x9D/'/gs; + $text =~ s/\xE2\x80\xA2/•/gs; + $text =~ s/\xE2\x80\xA6/.../gs; + $text =~ s/\xE2\x80\xB2/'/gs; + $text =~ s/\xE2\x84\xA2/™/gs; + $text =~ s/\xE2\x86\x90/ ← /gs; + return $text; } @@ -265,7 +190,10 @@ $text_mode = $v if defined ($v); # The "textMode" pref is set to a number instead of a string because I - # can't figure out the black magic to make Cocoa bindings work right. + # couldn't figure out the black magic to make Cocoa bindings work right. + # + # Update: as of 5.33, Cocoa writes strings instead of numbers, but + # pre-existing saved preferences might still have numbers in them. # if ($text_mode eq '0') { $text_mode = 'date'; } elsif ($text_mode eq '1') { $text_mode = 'literal'; } @@ -361,6 +289,7 @@ if ($text_mode eq 'literal') { $text_literal = strftime ($text_literal, localtime); + $text_literal = utf8_to_latin1($text_literal) if ($latin1_p); $text_literal =~ y/A-Za-z/N-ZA-Mn-za-m/ if ($nyarlathotep_p); print STDOUT $text_literal; print STDOUT "\n" unless ($text_literal =~ m/\n$/s); @@ -381,6 +310,7 @@ } else { # stream it by lines while (<$in>) { + $_ = utf8_to_latin1($_) if ($latin1_p); y/A-Za-z/N-ZA-Mn-za-m/ if ($nyarlathotep_p); print STDOUT $_; } @@ -438,7 +368,8 @@ if (-f "/usr/sbin/system_profiler") { # "Mac OS X 10.4.5 (8H14)" my $sp = # "iMac G5" - `/usr/sbin/system_profiler SPSoftwareDataType SPHardwareDataType`; + `/usr/sbin/system_profiler SPSoftwareDataType SPHardwareDataType 2>/dev/null`; + # system_profiler on OS X 10.10 generates spurious error messages. my ($v) = ($sp =~ m/^\s*System Version:\s*(.*)$/mi); my ($s) = ($sp =~ m/^\s*(?:CPU|Processor) Speed:\s*(.*)$/mi); my ($t) = ($sp =~ m/^\s*(?:Machine|Model) Name:\s*(.*)$/mi); @@ -511,6 +442,10 @@ s@[\r\n]@ @gsi; } + # This right here is the part where I doom us all to inhuman + # toil for the One whose Name cannot be expressed in the + # Basic Multilingual Plane. http://jwz.org/b/yhAT He comes. + s@@@gsi; # lose comments s@<(STYLE|SCRIPT)\b[^<>]*>.*?@@gsi; # lose css and js @@ -529,15 +464,17 @@ # if ($rss_p eq 'wiki') { + s@@@gsi; # lose HTML comments again + # Creation line is often truncated: screws up parsing with unbalanced {{. - s@(: +<- +Created page) with [^\n]+@$1@s; + s@(: +[^a-zA-Z ]* *Created page) with [^\n]+@$1@s; s@/\*.*?\*/@@si; # /* ... */ # Try to omit all tables, since they're impossible to read as text. # - 1 while (s/{{[^{}]*}}/ /gs); # {{ ... }} - 1 while (s/{\|.*?\|}/\n\n/gs); # {| ... |} + 1 while (s/\{\{[^{}]*}}/ /gs); # {{ ... }} + 1 while (s/\{\|.*?\|\}/\n\n/gs); # {| ... |} 1 while (s/\|-.*?\|/ /gs); # |- ... | (table cell) # Convert anchors to something more readable. @@ -563,12 +500,16 @@ # Omit trailing headlines with no text after them (e.g. == Notes ==) 1 while (s/\n==+[ \t]*[^\n=]+[ \t]*==+\s*$/\n/s); + + $_ = de_entify ($_); # convert HTML entities, again } - # elide any remaining non-Latin1 binary data... - s/([^\000-\176]+(\s*[^\000-\176]+)[^a-z\d]*)/\xAB...\xBB /g; -# s/([^\000-\176]+(\s*[^\000-\176]+)[^a-z\d]*)/\xAB$1\xBB /g; + # elide any remaining non-Latin1 binary data. + if ($latin1_p) { + utf8::encode ($_); # Unpack Unicode back to multi-byte UTF-8. + s/([^\000-\176]+(\s*[^\000-\176]+)[^a-z\d]*)/\xAB...\xBB /g; + } $_ .= "\n"; @@ -588,6 +529,7 @@ s/^(([^\n]*\n){$truncate_lines}).*$/$1/s; } + $_ = utf8_to_latin1($_) if ($latin1_p); y/A-Za-z/N-ZA-Mn-za-m/ if ($nyarlathotep_p); return $_; @@ -683,7 +625,6 @@ $body = de_entify ($body); # convert entities to get HTML from XML } - $body = de_unicoddle ($body); # convert UTF8 to Latin1 return $body; } @@ -705,6 +646,7 @@ $body =~ s/^(([^\n]*\n){$truncate_lines}).*$/$1/s; } + $body = utf8_to_latin1($body) if ($latin1_p); $body =~ y/A-Za-z/N-ZA-Mn-za-m/ if ($nyarlathotep_p); return $body; } @@ -763,6 +705,8 @@ $ct = 'text/plain'; } + utf8::decode ($body); # Pack multi-byte UTF-8 back into wide chars. + $ct = guess_content_type ($ct, $body); if ($ct eq 'html') { print STDERR "$progname: converting HTML...\n" if ($verbose > 2); @@ -813,6 +757,8 @@ " --cols N Wrap lines at this column. Default 72.\n" . "\n" . " --lines N No more than N lines of output.\n" . + "\n" . + " --latin1 Emit Latin1 instead of UTF-8.\n" . "\n"); exit 1; } @@ -843,6 +789,7 @@ elsif (m/^--?col(umn)?s?$/) { $wrap_columns = 0 + shift @ARGV; } elsif (m/^--?lines?$/) { $truncate_lines = 0 + shift @ARGV; } elsif (m/^--?cocoa$/) { $cocoa_id = shift @ARGV; } + elsif (m/^--?latin1$/) { $latin1_p++; } elsif (m/^--?nyarlathotep$/) { $nyarlathotep_p++; } elsif (m/^-./) { usage; } else { usage; } diff -Nru xscreensaver-5.30/driver/xscreensaver-text.man xscreensaver-5.34/driver/xscreensaver-text.man --- xscreensaver-5.30/driver/xscreensaver-text.man 2013-08-26 08:27:35.000000000 -0400 +++ xscreensaver-5.34/driver/xscreensaver-text.man 2015-06-13 19:08:53.000000000 -0400 @@ -68,7 +68,7 @@ .RS 0 .I http://www.livejournal.com/stats/latest-rss.bml, .RS 0 -.I http://en.wikipedia.org/w/index.php?title=Special:NewPages&feed=rss, +.I https://en.wikipedia.org/w/index.php?title=Special:NewPages&feed=rss, .RS 0 .BR driftnet (1), .BR EtherPEG , diff -Nru xscreensaver-5.30/hacks/abstractile.c xscreensaver-5.34/hacks/abstractile.c --- xscreensaver-5.30/hacks/abstractile.c 2014-09-10 17:39:39.000000000 -0400 +++ xscreensaver-5.34/hacks/abstractile.c 2014-09-26 23:02:43.000000000 -0400 @@ -90,7 +90,8 @@ /* draw, erase, fill, init, line, object, z indexes */ unsigned int di, ei, fi, ii, bi, li, eli, oi, zi; /* size variables */ - unsigned int gridx, gridy, gridn; /* grid size */ + int gridx, gridy; /* grid size */ + unsigned int gridn; int lwid, bwid, swid;/* line width, background width, shadow width */ int narray, max_wxh; int elwid, elpu, egridx, egridy; /* for now */ @@ -205,6 +206,7 @@ st->gridx=st->xgwa.width/st->lwid; st->gridy=st->xgwa.height/st->lwid; + if ((st->gridx <= 0) || (st->gridy <= 0)) abort(); st->gridn=st->gridx*st->gridy; /* clear grid */ for (z=0; zgridn; z++) { diff -Nru xscreensaver-5.30/hacks/analogtv.c xscreensaver-5.34/hacks/analogtv.c --- xscreensaver-5.30/hacks/analogtv.c 2014-09-04 13:40:51.000000000 -0400 +++ xscreensaver-5.34/hacks/analogtv.c 2015-03-01 23:17:17.000000000 -0500 @@ -59,12 +59,18 @@ Fixed a bug or two. */ +/* 2015-02-27, Tomasz Sulej : + - tint_control variable is used now + - removed unusable hashnoise code + */ + #ifdef HAVE_COCOA # include "jwxyz.h" #else /* !HAVE_COCOA */ # include # include #endif +#include #include #include @@ -791,11 +797,8 @@ colormode = (cb_i * cb_i + cb_q * cb_q) > 2.8; if (colormode) { - double tint_i = -cos((103 + it->color_control)*3.1415926/180); - double tint_q = sin((103 + it->color_control)*3.1415926/180); - - multiq2[0] = (cb_i*tint_i - cb_q*tint_q) * it->color_control; - multiq2[1] = (cb_q*tint_i + cb_i*tint_q) * it->color_control; + multiq2[0] = (cb_i*it->tint_i - cb_q*it->tint_q) * it->color_control; + multiq2[1] = (cb_q*it->tint_i + cb_i*it->tint_q) * it->color_control; multiq2[2]=-multiq2[0]; multiq2[3]=-multiq2[1]; } @@ -907,7 +910,7 @@ void analogtv_setup_frame(analogtv *it) { - int i,x,y; + /* int i,x,y;*/ it->redraw_all=0; @@ -919,10 +922,13 @@ ((int)(random()&0xff)-0x80) * 0.000001; } + /* it wasn't used for (i=0; ihashnoise_times[i]=0; } + */ + /* let's leave it to process shrinkpulse */ if (it->hashnoise_enable && !it->hashnoise_on) { if (random()%10000==0) { it->hashnoise_on=1; @@ -932,6 +938,8 @@ if (random()%1000==0) { it->hashnoise_on=0; } + +#if 0 /* never used */ if (it->hashnoise_on) { it->hashnoise_rpm += (15000.0 - it->hashnoise_rpm)*0.05 + ((int)(random()%2000)-1000)*0.1; @@ -941,11 +949,13 @@ } if (it->hashnoise_rpm > 0.0) { int hni; + double hni_double; int hnc=it->hashnoise_counter; /* in 24.8 format */ /* Convert rpm of a 16-pole motor into dots in 24.8 format */ - hni = (int)(ANALOGTV_V * ANALOGTV_H * 256.0 / - (it->hashnoise_rpm * 16.0 / 60.0 / 60.0)); + hni_double = ANALOGTV_V * ANALOGTV_H * 256.0 / + (it->hashnoise_rpm * 16.0 / 60.0 / 60.0); + hni = (hni_double <= INT_MAX) ? (int)hni_double : INT_MAX; while (hnc < (ANALOGTV_V * ANALOGTV_H)<<8) { y=(hnc>>8)/ANALOGTV_H; @@ -954,10 +964,18 @@ if (x>0 && xhashnoise_times[y]=x; } - hnc += hni + (int)(random()%65536)-32768; + /* hnc += hni + (int)(random()%65536)-32768; */ + { + hnc += (int)(random()%65536)-32768; + if ((hnc >= 0) && (INT_MAX - hnc < hni)) break; + hnc += hni; + } } -/* hnc -= (ANALOGTV_V * ANALOGTV_H)<<8;*/ } +#endif /* 0 */ + +/* hnc -= (ANALOGTV_V * ANALOGTV_H)<<8;*/ + if (it->rx_signal_level != 0.0) it->agclevel = 1.0/it->rx_signal_level; @@ -1195,14 +1213,17 @@ float *pe=it->rx_signal + end; float *p=ps; unsigned int fastrnd=rnd_seek(FASTRND_A, FASTRND_C, it->random0, start); + unsigned int fastrnd_offset; float nm1,nm2; float noisemul = sqrt(noiselevel*150)/(float)0x7fffffff; - nm1 = ((int)fastrnd-(int)0x7fffffff) * noisemul; + fastrnd_offset = fastrnd - 0x7fffffff; + nm1 = (fastrnd_offset <= INT_MAX ? (int)fastrnd_offset : -1 - (int)(UINT_MAX - fastrnd_offset)) * noisemul; while (p != pe) { nm2=nm1; fastrnd = (fastrnd*FASTRND_A+FASTRND_C) & 0xffffffffu; - nm1 = ((int)fastrnd-(int)0x7fffffff) * noisemul; + fastrnd_offset = fastrnd - 0x7fffffff; + nm1 = (fastrnd_offset <= INT_MAX ? (int)fastrnd_offset : -1 - (int)(UINT_MAX - fastrnd_offset)) * noisemul; *p++ = nm1*nm2; } } @@ -1243,7 +1264,8 @@ */ float sig0=(float)s[0]; - float noise = ((int)fastrnd-(int)0x7fffffff) * (50.0f/(float)0x7fffffff); + unsigned int fastrnd_offset = fastrnd - 0x7fffffff; + float noise = (fastrnd_offset <= INT_MAX ? (int)fastrnd_offset : -1 - (int)(UINT_MAX - fastrnd_offset)) * (50.0f/(float)0x7fffffff); fastrnd = (fastrnd*FASTRND_A+FASTRND_C) & 0xffffffffu; p[0] += sig0 * level * (1.0f - noise_ampl) + noise * noise_ampl; @@ -1727,7 +1749,7 @@ const analogtv_reception *const *recs, unsigned rec_count) { int i,lineno; - int /*bigloadchange,*/drawcount; + /* int bigloadchange,drawcount;*/ double baseload; int overall_top, overall_bot; @@ -1782,14 +1804,18 @@ baseload=0.5; /* if (it->hashnoise_on) baseload=0.5; */ - /*bigloadchange=1;*/ - drawcount=0; + /*bigloadchange=1; + drawcount=0;*/ it->crtload[ANALOGTV_TOP-1]=baseload; it->puheight = puramp(it, 2.0, 1.0, 1.3) * it->height_control * (1.125 - 0.125*puramp(it, 2.0, 2.0, 1.1)); analogtv_setup_levels(it, it->puheight * (double)it->useheight/(double)ANALOGTV_VISLINES); + /* calculate tint once per frame */ + it->tint_i = -cos((103 + it->tint_control)*3.1415926/180); + it->tint_q = sin((103 + it->tint_control)*3.1415926/180); + for (lineno=ANALOGTV_TOP; linenoonscreen_signature[lineno] = linesig; #endif - drawcount++; + /* drawcount++;*/ /* Interpolate the 600-dotclock line into however many horizontal diff -Nru xscreensaver-5.30/hacks/analogtv.h xscreensaver-5.34/hacks/analogtv.h --- xscreensaver-5.30/hacks/analogtv.h 2014-05-26 23:21:41.000000000 -0400 +++ xscreensaver-5.34/hacks/analogtv.h 2015-03-01 23:15:00.000000000 -0500 @@ -207,6 +207,8 @@ int cmap_i_levels; int cmap_q_levels; + float tint_i, tint_q; + int cur_hsync; int line_hsync[ANALOGTV_V]; int cur_vsync; diff -Nru xscreensaver-5.30/hacks/apple2.c xscreensaver-5.34/hacks/apple2.c --- xscreensaver-5.30/hacks/apple2.c 2014-05-26 23:22:35.000000000 -0400 +++ xscreensaver-5.34/hacks/apple2.c 2015-05-06 05:36:08.000000000 -0400 @@ -20,8 +20,6 @@ #include "xshm.h" #endif -#define DEBUG - /* * Implementation notes * diff -Nru xscreensaver-5.30/hacks/apple2-main.c xscreensaver-5.34/hacks/apple2-main.c --- xscreensaver-5.30/hacks/apple2-main.c 2014-08-01 20:09:26.000000000 -0400 +++ xscreensaver-5.34/hacks/apple2-main.c 2015-05-06 05:35:34.000000000 -0400 @@ -27,6 +27,7 @@ #include "screenhack.h" #include "apple2.h" #include "textclient.h" +#include "utf8wc.h" #undef countof #define countof(x) (sizeof((x))/sizeof((*x))) @@ -34,8 +35,6 @@ #define SCREEN_COLS 40 #define SCREEN_ROWS 24 -#define DEBUG - /* Given a bitmask, returns the position and width of the field. */ @@ -800,6 +799,7 @@ int curparam; int cursor_x, cursor_y; int saved_x, saved_y; + int unicruds; char unicrud[7]; union { struct { unsigned int bold : 1; @@ -901,6 +901,8 @@ int i; int start, end; + /* Mostly duplicated in phosphor.c */ + switch (state->escstate) { case 0: @@ -964,6 +966,38 @@ state->curparam = 0; break; default: + + /* states 102-106 are for UTF-8 decoding */ + + if ((c & 0xE0) == 0xC0) { /* 110xxxxx - 11 bits, 2 bytes */ + state->unicruds = 1; + state->unicrud[0] = c; + state->escstate = 102; + break; + } else if ((c & 0xF0) == 0xE0) { /* 1110xxxx - 16 bits, 3 bytes */ + state->unicruds = 1; + state->unicrud[0] = c; + state->escstate = 103; + break; + } else if ((c & 0xF8) == 0xF0) { /* 11110xxx - 21 bits, 4 bytes */ + state->unicruds = 1; + state->unicrud[0] = c; + state->escstate = 104; + break; + } else if ((c & 0xFC) == 0xF8) { /* 111110xx - 26 bits, 5 bytes */ + state->unicruds = 1; + state->unicrud[0] = c; + state->escstate = 105; + break; + } else if ((c & 0xFE) == 0xFC) { /* 1111110x - 31 bits, 6 bytes */ + state->unicruds = 1; + state->unicrud[0] = c; + state->escstate = 106; + break; + } + + PRINT: + /* If the cursor is in column 39 and we print a character, then that character shows up in column 39, and the cursor is no longer visible on the screen (it's in "column 40".) If another character @@ -1038,9 +1072,13 @@ state->curparam = 0; break; case '%': /* Select charset */ - /* No, I don't support UTF-8, since the apple2 font - isn't even Unicode anyway. We must still catch the - last byte, though. */ + /* @: Select default (ISO 646 / ISO 8859-1) + G: Select UTF-8 + 8: Select UTF-8 (obsolete) + + We can just ignore this and always process UTF-8, I think? + We must still catch the last byte, though. + */ case '(': case ')': /* I don't support different fonts either - see above @@ -1250,6 +1288,39 @@ case 3: state->escstate = 0; break; + + case 102: + case 103: + case 104: + case 105: + case 106: + { + int total = state->escstate - 100; /* see what I did there */ + if (state->unicruds < total) { + /* Buffer more bytes of the UTF-8 sequence */ + state->unicrud[state->unicruds++] = c; + } + + if (state->unicruds >= total) { + /* Done! Convert it to ASCII and print that. */ + char *s; + state->unicrud[state->unicruds] = 0; + s = utf8_to_latin1 ((const char *) state->unicrud, True); + state->unicruds = 0; + state->escstate = 0; + if (s) { + c = s[0]; + free (s); + goto PRINT; + } else { + c = 0; + } + } + } + break; + + default: + abort(); } a2_goto(st, state->cursor_y, state->cursor_x); } @@ -1299,24 +1370,36 @@ if (! mine->fast_p) *next_actiontime += 4.0; *stepno = 10; + + mine->last_emit_time = sim->curtime; break; case 10: + case 11: { + Bool first_line_p = (*stepno == 10); unsigned char buf[1024]; int nr,nwant; double elapsed; elapsed=sim->curtime - mine->last_emit_time; - mine->last_emit_time=sim->curtime; - nwant=elapsed*25.0; - if (elapsed>1.0) nwant=1; - if (nwant<1) nwant=1; - if (nwant>4) nwant=4; + + nwant = elapsed * 25.0; /* characters per second */ + + if (first_line_p) { + *stepno = 11; + nwant = 1; + } + + if (nwant > 40) nwant = 40; if (mine->fast_p) nwant = sizeof(buf)-1; + if (nwant <= 0) break; + + mine->last_emit_time = sim->curtime; + nr=terminal_read(mine, buf, nwant); for (i=0; i #include #include -#include +#include #include #include "yarandom.h" diff -Nru xscreensaver-5.30/hacks/binaryring.c xscreensaver-5.34/hacks/binaryring.c --- xscreensaver-5.30/hacks/binaryring.c 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/hacks/binaryring.c 2015-03-01 22:59:21.000000000 -0500 @@ -0,0 +1,593 @@ +/* + * Binary Ring + * Copyright (c) 2006-2014 Emilio Del Tessandoro + * + * Directly ported code from complexification.net Binary Ring art + * http://www.complexification.net/gallery/machines/binaryRing/appletm/BinaryRing_m.pde + * + * Binary Ring code: + * j.tarbell June, 2004 + * Albuquerque, New Mexico + * complexification.net + * + * Directly based the hacks of: + * + * xscreensaver, Copyright (c) 1997, 1998, 2002 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 + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation. No representations are made about the suitability of this + * software for any purpose. It is provided "as is" without express or + * implied warranty. + */ + +#include "screenhack.h" +#include "colors.h" +#include "hsv.h" + +#if HAVE_INTTYPES_H +# include +#else +typedef unsigned long uint32_t; +#endif + +#define ANTIALIAS 1 +#define BLACK 0 +#define WHITE 1 + +#define swap(a, b) do { __typeof__(a) tmp; tmp = a; a = b; b = tmp; } while(0) +#define frand1() ((((int) random() ) << 1) * 4.65661287524579692411E-10) +#define min(a,b) ((a)<(b)?(a):(b)) +#define max(a,b) ((a)>(b)?(a):(b)) + +/* better if signed */ +typedef uint32_t pixel_t; + + +typedef struct { + float x, y; + float xx, yy; + float vx, vy; + float color; + int age; /* age from 0 to ageMax */ +} particle_t; + + +struct state { + int epoch; + int growth_delay; + int ring_radius; + int max_age; + float curliness; + int particles_number; + particle_t* particles; + + + Display *display; /* variables for the X stuff */ + Window window; + GC gc; + XGCValues gcv; + Visual* visual; + int depth; + + int width; + int height; + + Pixmap pix; /* for reshape */ + XImage* buf; /* buffer */ + pixel_t* buffer; + pixel_t colors[2]; + + Bool color; +}; + + + +static void point2rgb(int depth, pixel_t c, int *r, int *g, int *b) +{ + switch(depth) { + case 32: + case 24: +#ifdef HAVE_COCOA + /* This program idiotically does not go through a color map, so + we have to hardcode in knowledge of how jwxyz.a packs pixels! + Fix it to go through st->colors[st->ncolors] instead! + */ + *r = (c & 0x00ff0000) >> 16; + *g = (c & 0x0000ffff) >> 8; + *b = (c & 0x000000ff); +#else + *g = (c & 0xff00) >> 8; + *r = (c & 0xff0000) >> 16; + *b = c & 0xff; +#endif + break; + case 16: + *g = ((c >> 5) & 0x3f) << 2; + *r = ((c >> 11) & 0x1f) << 3; + *b = (c & 0x1f) << 3; + break; + case 15: + *g = ((c >> 5) & 0x1f) << 3; + *r = ((c >> 10) & 0x1f) << 3; + *b = (c & 0x1f) << 3; + break; + } +} + +static pixel_t rgb2point(int depth, int r, int g, int b) +{ + pixel_t ret = 0; + + switch(depth) { + case 32: + case 24: +#ifdef HAVE_COCOA + /* This program idiotically does not go through a color map, so + we have to hardcode in knowledge of how jwxyz.a packs pixels! + Fix it to go through st->colors[st->ncolors] instead! + */ + ret = 0xFF000000 | (r << 16) | (g << 8) | b; +#else + ret |= (r << 16) | (g << 8) | b; +#endif + break; + case 16: + ret = ((r>>3) << 11) | ((g>>2)<<5) | (b>>3); + break; + case 15: + ret = ((r>>3) << 10) | ((g>>3)<<5) | (b>>3); + break; + } + + return ret; +} + +void print_color ( struct state* st, pixel_t color ); +/* alpha blended point drawing -- this is Not Right and will likely fail on + * non-intel platforms as it is now, needs fixing + */ + +static +void draw_point ( struct state* st, + int x, int y, pixel_t myc, float a ) { + + int or = 0, og = 0, ob = 0; + int r = 0, g = 0, b = 0; + int nr, ng, nb; + register pixel_t c; + + /*or = st->buffer[ 3 * ( y * st->width + x ) + 0 ]; + og = st->buffer[ 3 * ( y * st->width + x ) + 1 ]; + ob = st->buffer[ 3 * ( y * st->width + x ) + 2 ];*/ + + c = st->buffer[ y * st->width + x ]; + point2rgb( st->depth, c, &or, &og, &ob ); + point2rgb( st->depth, myc, &r, &g, &b ); + + nr = or + (r - or) * a; + ng = og + (g - og) * a; + nb = ob + (b - ob) * a; + + /*st->buffer[ 3 * ( y * st->width + x ) + 0 ] = nr; + st->buffer[ 3 * ( y * st->width + x ) + 1 ] = ng; + st->buffer[ 3 * ( y * st->width + x ) + 2 ] = nb;*/ + c = rgb2point(st->depth, nr, ng, nb); + st->buffer[ y * st->width + x ] = c; + + XPutPixel( st->buf, x, y, c ); +} + + + + +void print_color ( struct state* st, pixel_t color ) { + int r, g, b; + point2rgb(st->depth, color, &r, &g, &b); + printf( "%d %d %d\n", r, g, b); +} + + + +#if ANTIALIAS +#define plot_(X,Y,D) do{ \ + _dla_plot(st, (X), (Y), color, (D) * alpha); }while(0) + +static +void _dla_plot(struct state* st, int x, int y, pixel_t col, float br) +{ + if ( ( x >= 0 && x < st->width ) && ( y >= 0 && y < st->height ) ) { + if ( br > 1.0f ) br = 1.0f; + draw_point( st, x, y, col, br ); + } +} + +#define ipart_(X) ((int)(X)) +#define round_(X) ((int)(((float)(X))+0.5)) +#define fpart_(X) (((float)(X))-(float)ipart_(X)) +#define rfpart_(X) (1.0-fpart_(X)) + +static +void draw_line_antialias( + struct state* st, + int x1, int y1, + int x2, int y2, + pixel_t color, float alpha ) +{ + float dx = (float)x2 - (float)x1; + float dy = (float)y2 - (float)y1; + float gradient; + float xend; + float yend; + float xgap; + float ygap; + int xpxl1; + int ypxl1; + float intery; + float interx; + int xpxl2; + int ypxl2; + int x; + int y; + + /* hard clipping, because this routine has some problems with negative coordinates */ + /* TODO: fix the alpha for that boundary cases. Using fabs() could solve? */ + if ( ( x1 < 0 || x1 > st->width ) || + ( x2 < 0 || x2 > st->width ) || + ( y1 < 0 || y1 > st->height ) || + ( y2 < 0 || y2 > st->height ) ) + return; + + if ( fabs(dx) > fabs(dy) ) { + if ( x2 < x1 ) { + swap(x1, x2); + swap(y1, y2); + } + gradient = dy / dx; + xend = round_(x1); + yend = y1 + gradient*(xend - x1); + xgap = rfpart_(x1 + 0.5); + xpxl1 = xend; + ypxl1 = ipart_(yend); + plot_(xpxl1, ypxl1, rfpart_(yend)*xgap); + plot_(xpxl1, ypxl1+1, fpart_(yend)*xgap); + intery = yend + gradient; + + xend = round_(x2); + yend = y2 + gradient*(xend - x2); + xgap = fpart_(x2+0.5); + xpxl2 = xend; + ypxl2 = ipart_(yend); + plot_(xpxl2, ypxl2, rfpart_(yend) * xgap); + plot_(xpxl2, ypxl2 + 1, fpart_(yend) * xgap); + + /*if ( rfpart_(yend) * xgap < 0 || fpart_(yend) * xgap < 0) + printf("%f %f\n", rfpart_(yend) * xgap, fpart_(yend) * xgap);*/ + for(x=xpxl1+1; x <= (xpxl2-1); x++) { + plot_(x, ipart_(intery), rfpart_(intery)); + plot_(x, ipart_(intery) + 1, fpart_(intery)); + /*if ( rfpart_(intery) < 0 || fpart_(intery) < 0) + printf("%f %f\n", rfpart_(intery), fpart_(intery));*/ + intery += gradient; + } + } else { + if ( y2 < y1 ) { + swap(x1, x2); + swap(y1, y2); + } + gradient = dx / dy; + yend = round_(y1); + xend = x1 + gradient*(yend - y1); + ygap = rfpart_(y1 + 0.5); + ypxl1 = yend; + xpxl1 = ipart_(xend); + plot_(xpxl1, ypxl1, rfpart_(xend)*ygap); + plot_(xpxl1, ypxl1+1, fpart_(xend)*ygap); + interx = xend + gradient; + + yend = round_(y2); + xend = x2 + gradient*(yend - y2); + ygap = fpart_(y2+0.5); + ypxl2 = yend; + xpxl2 = ipart_(xend); + plot_(xpxl2, ypxl2, rfpart_(xend) * ygap); + plot_(xpxl2, ypxl2 + 1, fpart_(xend) * ygap); + + for(y=ypxl1+1; y <= (ypxl2-1); y++) { + plot_(ipart_(interx), y, rfpart_(interx)); + plot_(ipart_(interx) + 1, y, fpart_(interx)); + interx += gradient; + } + } +} +#undef plot_ +#undef ipart_ +#undef fpart_ +#undef round_ +#undef rfpart_ + +#else + +static +void draw_line ( struct state* st, int x0, int y0, int x1, int y1, int color, float a ) { + register int steep; + register int deltax; + register int deltay; + register int error; + register int ystep; + register int y; + register int x; + + + steep = abs ( y1 - y0 ) > abs ( x1 - x0 ); + if ( steep ) { swap(x0,y0); swap(x1,y1); } + if ( x0 > x1 ) { swap(x0,x1); swap(y0,y1); } + deltax = x1 - x0; + deltay = abs(y1-y0); + error = 0; + y = y0; + ystep = y0 < y1 ? 1 : -1; + if ( a > 1.0f ) a = 1.0f; + + for ( x = x0; x < x1; x++ ) { + if ( steep ) { + if ( ( y >= 0 && y < st->width ) && ( x >= 0 && x < st->height ) ) + draw_point( st, y, x, color, a ); + } else { + if ( ( x >= 0 && x < st->width ) && ( y >= 0 && y < st->height ) ) + draw_point( st, x, y, color, a ); + } + error += deltay; + if ( ( error << 1 ) > deltax ) { + y += ystep; + error -= deltax; + } + } +} +#endif + +static void create_buffers ( struct state* st, Display* display, Screen* screen, Window window, GC gc ) { + + XWindowAttributes xgwa; + XGetWindowAttributes( display, window, &xgwa ); + + /* Initialize the pixmap */ + if ( st->buf != NULL ) XFreePixmap( display, st->pix ); + + XSetForeground( display, gc, st->colors[BLACK] ); + st->pix = XCreatePixmap( display, window, st->width, st->height, + xgwa.depth ); + XFillRectangle( display, st->pix, gc, 0, 0, st->width, st->height); + + /* Initialize the bitmap */ + if ( st->buf != NULL ) XDestroyImage ( st->buf ); + st->buf = XGetImage( display, st->pix, 0, 0, st->width, st->height, visual_depth(screen, st->visual), ZPixmap ); + st->buffer = (pixel_t*) calloc(sizeof(pixel_t), st->width * st->height); + /*int i; + for ( i = 0; i < st->width * st->height; ++i ) st->buffer[i] = st->colors[BLACK];*/ +} + +static void init_particle ( particle_t* p, float dx, float dy, float direction, int color, int max_age ) { + float max_initial_velocity = 2.0f; + p->x = -dx; + p->y = -dy; + p->xx = 0; + p->yy = 0; + p->vx = max_initial_velocity * cos(direction); + p->vy = max_initial_velocity * sin(direction); + + p->age = random() % max_age; + + p->color = color; +} + +static void clamp ( int* value, int l, int h ) { + if ( *value < l ) *value = l; + if ( *value > h ) *value = h; +} + +static pixel_t next_color ( struct state* st, pixel_t current ) { + int r, g, b; + + point2rgb(st->depth, current, &r, &g, &b); + r += random() % 5 - 2; + g += random() % 5 - 2; + b += random() % 5 - 2; + clamp(&r, 0, 255); + clamp(&g, 0, 255); + clamp(&b, 0, 255); + + return rgb2point( st->depth, r, g, b ); +} + + +static void create_particles ( struct state* st ) { + int i; + float emitx, emity; + float direction; + + for ( i = 0; i < st->particles_number; i++ ) { + emitx = ( st->ring_radius * sinf( M_PI * 2 * ( (float) i / st->particles_number ) ) ); + emity = ( st->ring_radius * cosf( M_PI * 2 * ( (float) i / st->particles_number ) ) ); + direction = (M_PI * i) / st->particles_number; + + if ( st->epoch == WHITE && st->color ) + st->colors[WHITE] = next_color(st, st->colors[WHITE]); + + init_particle(st->particles + i, emitx, emity, direction, st->colors[WHITE], st->max_age); + } +} + + +/* randomly move one particle and draw it */ +static void move ( particle_t* p, struct state * st ) { + int w = st->width / 2; + int h = st->height / 2; + float max_dv = 1.0f; + + p->xx = p->x; + p->yy = p->y; + p->x += p->vx; + p->y += p->vy; + p->vx += frand1() * st->curliness * max_dv; + p->vy += frand1() * st->curliness * max_dv; + + +#if ANTIALIAS + draw_line_antialias( st, + w+p->xx, h+p->yy, w+p->x, h+p->y, p->color, 0.15 ); + draw_line_antialias( st, + w-p->xx, h+p->yy, w-p->x, h+p->y, p->color, 0.15 ); +#else + draw_line( st, w+p->xx, h+p->yy, w+p->x, h+p->y, p->color, 0.15 ); + draw_line( st, w-p->xx, h+p->yy, w-p->x, h+p->y, p->color, 0.15 ); +#endif + + p->age++; + /* if this is too old, die and reborn */ + if ( p->age > st->max_age ) { + float dir = frand1() * 2 * M_PI; + p->x = st->ring_radius * sin(dir); + p->y = st->ring_radius * cos(dir); + p->xx = p->yy = p->vx = p->vy = 0; + p->age = 0; + + if ( st->epoch == WHITE && st->color ) + st->colors[WHITE] = next_color(st, st->colors[WHITE] ); + + p->color = st->colors[st->epoch]; + } +} + + + + +/* Initialize Everything */ +static void* binaryring_init ( Display* display, Window window ) { + XWindowAttributes xgwa; + + struct state *st = ( struct state* ) calloc ( 1, sizeof( *st ) ); + + XGetWindowAttributes( display, window, &xgwa ); + + st->epoch = WHITE; + st->display = display; + st->window = window; + st->particles_number = (get_integer_resource(st->display, "particles_number", "Integer")); + st->growth_delay = (get_integer_resource(st->display, "growth_delay", "Integer")); + st->ring_radius = (get_integer_resource(st->display, "ring_radius", "Integer")); + st->max_age = (get_integer_resource(st->display, "max_age", "Integer")); + st->color = get_boolean_resource(st->display, "color", "Boolean"); + st->height = xgwa.height; + st->width = xgwa.width; + st->visual = xgwa.visual; + st->curliness = 0.5; + + + st->depth = visual_depth(xgwa.screen, st->visual); + st->colors[0] = rgb2point(st->depth, 0, 0, 0); + st->colors[1] = rgb2point(st->depth, 255, 255, 255); + + /*describe_visual (stdout, xgwa.screen, xgwa.visual, False);*/ + + st->particles = malloc (st->particles_number * sizeof( particle_t ) ); + create_particles ( st ); + + st->gc = XCreateGC( st->display, st->window, 0, &st->gcv ); + create_buffers ( st, display, xgwa.screen, window, st->gc ); + + + return st; +} + + +static unsigned long binaryring_draw ( Display* display, Window win, void *closure ) { + struct state *st = (struct state *) closure; + int i; + + for ( i = 0; i < st->particles_number; i++ ) + move( &(st->particles[i]), st ); + + /* draw the XImage in the Pixmap and the put the Pixmap on the screen */ + XPutImage( display, st->pix, st->gc, st->buf, 0, 0, 0, 0, st->width, st->height); + XCopyArea( display, st->pix, win, st->gc, 0, 0, st->width, st->height, 0, 0 ); + + /* randomly switch ageColor periods */ + if ( random() % 10000 > 9950 ) + st->epoch = (st->epoch == WHITE) ? BLACK : WHITE; + + return st->growth_delay; +} + + + +static void binaryring_reshape ( Display* display, Window win, void *closure, unsigned int w, unsigned int h ) { + struct state *st = (struct state *) closure; + + XWindowAttributes tmp; + XGetWindowAttributes(display, win, &tmp); + + if ( tmp.height != st->height || tmp.width != st->width ) { + st->height = tmp.height; + st->width = tmp.width; + + + st->epoch = WHITE; + create_particles ( st ); + + create_buffers ( st, display, tmp.screen, win, st->gc ); + } +} + + +/* if someone press a key switch the color */ +static Bool binaryring_event ( Display* display, Window win, void *closure, XEvent* event ) { + struct state *st = (struct state *) closure; + + if ( (*event).xany.type == KeyPress ) { + st->epoch = (st->epoch == WHITE) ? BLACK : WHITE; + } + + return False; +} + + +/* delete everything */ +static void binaryring_free ( Display* display, Window win, void *closure ) { + struct state *st = (struct state *) closure; + XWindowAttributes tmp; + XGetWindowAttributes(display, win, &tmp); + + free( st->buffer ); + free( st->particles ); + + free ( st ); +} + + +/* Default resources of the program */ +static const char* binaryring_defaults [] = { + ".background: black", + ".foreground: white", + "*growth_delay: 10000", + "*particles_number: 5000", + "*ring_radius: 40", + "*max_age: 400", + "*color: True", + "*ignoreRotation: True", + 0 +}; + +static XrmOptionDescRec binaryring_options [] = { + { "-particles-number", ".particles_number", XrmoptionSepArg, 0 }, + { "-growth-delay", ".growth_delay", XrmoptionSepArg, 0 }, + { "-ring-radius", ".ring_radius", XrmoptionSepArg, 0 }, + { "-max-age", ".max_age", XrmoptionSepArg, 0 }, + { "-color", ".color", XrmoptionNoArg, "True" }, + { "-no-color", ".color", XrmoptionNoArg, "False" }, + { 0, 0, 0, 0} +}; + +XSCREENSAVER_MODULE("BinaryRing", binaryring) diff -Nru xscreensaver-5.30/hacks/binaryring.man xscreensaver-5.34/hacks/binaryring.man --- xscreensaver-5.30/hacks/binaryring.man 1969-12-31 19:00:00.000000000 -0500 +++ xscreensaver-5.34/hacks/binaryring.man 2014-11-04 17:04:38.000000000 -0500 @@ -0,0 +1,88 @@ +.TH "Binary Ring" 1 "02-Sep-14" "X Version 11" +.SH NAME +binaryring - A system of path tracing particles evolves continuously from an initial creation. +.SH SYNOPSIS +.B binaryring +[\-fps] +[\-install] +[\-noinstall] +[\-mono] +[\-root] +[\-visual \fIvisual\fP] +[\-window] +[\-window\-id \fIwindow\-id\fP] +[\-color] +[\-no\-color] +[\-growth\-delay \fIdelayms\fP] +[\-particle\-number \fIparticles\fP] +[\-ring\-radius \fIradius\fP] +.SH DESCRIPTION +A system of path tracing particles evolves continuously from an initial circular creation. +Ages of darkness play arbitrarily with ages of light. + +Ported (with some extensions) from the code by J. Tarbell at http://complexification.net +.SH OPTIONS +.I binaryring +accepts the following options: +.TP 8 +.B \-fps +Display the current frame rate and CPU load. +.TP 8 +.B \-install +Install a private colormap for the window. +.TP 8 +.B \-mono +If on a color display, pretend we're on a monochrome display. +.TP 8 +.B \-noinstall +Don't install a private colormap for the window. +.TP 8 +.B \-root +Draw on the root window. +.TP 8 +.B \-visual \fIvisual\fP +Specify which visual to use. Legal values are the name of a visual +class or the id number (decimal or hex) of a specific visual. +.TP 8 +.B \-window +Draw on a newly-created window. This is the default. +.TP 8 +.B \-window\-id \fIwindow\-id\fP +Specify which window id to use. +.TP 8 +.B \-color (Default) +Particles have random generated colors that gradually change over time. +.TP 8 +.B \-no\-color +Use the original black and white visualization. +.TP 8 +.B \-growth\-delay \fIdelayms\fP (Default: \fI10000\fP) +Delay in ms between growth cycles. More delay, slower (but less CPU intensive). +.TP 8 +.B \-particles\-number \fIparticles\fP (Default: \fI5000\fP) +The number of particles in the system. With more particles the fps +can also be affected. +.TP 8 +.B \-ring\-radius \fIradius\fP (Default: \fI40\fP) +The radius of the ring where the particles are born, in pixels. +.SH ENVIRONMENT +.PP +.TP 8 +.B DISPLAY +to get the default host and display number. +.TP 8 +.B XENVIRONMENT +to get the name of a resource file that overrides the global +resources stored in the RESOURCE_MANAGER property. +.SH SEE ALSO +.BR X (1), +.BR xscreensaver (1) +.SH COPYRIGHT +Copyright \(co 2003 by J. Tarbell +(complex@complexification.net, http://www.complexification.net). + +Ported to XScreensaver by Emilio Del Tessandoro (emilio.deltessa@gmail.com) +.SH AUTHOR +J. Tarbell , Jun-03 + +Emilio Del Tessandoro , Aug-14 diff -Nru xscreensaver-5.30/hacks/blitspin.c xscreensaver-5.34/hacks/blitspin.c --- xscreensaver-5.30/hacks/blitspin.c 2014-08-27 21:55:38.000000000 -0400 +++ xscreensaver-5.34/hacks/blitspin.c 2014-09-26 23:07:03.000000000 -0400 @@ -154,7 +154,7 @@ st->first_time = 0; st->loaded_p = True; st->qwad = -1; - st->start_time = time ((time_t) 0); + st->start_time = time ((time_t *) 0); blitspin_init_2 (st); } @@ -165,7 +165,7 @@ if (!st->img_loader && st->load_ext_p && - st->start_time + st->duration < time ((time_t) 0)) { + st->start_time + st->duration < time ((time_t *) 0)) { /* Start a new image loading, but keep rotating the old image until the new one arrives. */ st->img_loader = load_image_async_simple (0, st->xgwa.screen, st->window, @@ -254,7 +254,7 @@ if (st->delay2 < 0) st->delay2 = 0; if (st->duration < 1) st->duration = 1; - st->start_time = time ((time_t) 0); + st->start_time = time ((time_t *) 0); bitmap_name = get_string_resource (st->dpy, "bitmap", "Bitmap"); if (! bitmap_name || !*bitmap_name) diff -Nru xscreensaver-5.30/hacks/bubbles.c xscreensaver-5.34/hacks/bubbles.c --- xscreensaver-5.30/hacks/bubbles.c 2008-07-31 15:27:48.000000000 -0400 +++ xscreensaver-5.34/hacks/bubbles.c 2015-05-06 05:37:35.000000000 -0400 @@ -43,6 +43,8 @@ # include "config.h" #endif +#undef DEBUG /* doesn't compile */ + #include #include diff -Nru xscreensaver-5.30/hacks/bumps.c xscreensaver-5.34/hacks/bumps.c --- xscreensaver-5.30/hacks/bumps.c 2014-08-29 20:50:10.000000000 -0400 +++ xscreensaver-5.34/hacks/bumps.c 2015-03-01 22:59:21.000000000 -0500 @@ -30,7 +30,7 @@ #include -#include +#include #include "screenhack.h" #ifdef HAVE_XSHM_EXTENSION @@ -433,7 +433,7 @@ XWindowAttributes XWinAttribs; XGetWindowAttributes( pBumps->dpy, pBumps->Win, &XWinAttribs ); - pBumps->start_time = time ((time_t) 0); + pBumps->start_time = time ((time_t *) 0); pScreenImage = XGetImage( pBumps->dpy, pBumps->source, 0, 0, pBumps->iWinWidth, pBumps->iWinHeight, @@ -666,7 +666,7 @@ Bumps->duration = get_integer_resource (dpy, "duration", "Seconds"); if (Bumps->delay < 0) Bumps->delay = 0; if (Bumps->duration < 1) Bumps->duration = 1; - Bumps->start_time = time ((time_t) 0); + Bumps->start_time = time ((time_t *) 0); return Bumps; } @@ -684,7 +684,7 @@ } if (!Bumps->img_loader && - Bumps->start_time + Bumps->duration < time ((time_t) 0)) { + Bumps->start_time + Bumps->duration < time ((time_t *) 0)) { Bumps->img_loader = load_image_async_simple (0, Bumps->screen, Bumps->Win, Bumps->source, 0, 0); diff -Nru xscreensaver-5.30/hacks/celtic.c xscreensaver-5.34/hacks/celtic.c --- xscreensaver-5.30/hacks/celtic.c 2014-08-27 21:59:20.000000000 -0400 +++ xscreensaver-5.34/hacks/celtic.c 2015-06-14 17:08:30.000000000 -0400 @@ -978,7 +978,9 @@ st->force_reset = 0; st->t = 1; - pattern_del(st->pattern); + if (st->pattern != NULL) { + pattern_del(st->pattern); + } st->pattern = NULL; graph_del(st->graph); diff -Nru xscreensaver-5.30/hacks/check-configs.pl xscreensaver-5.34/hacks/check-configs.pl --- xscreensaver-5.30/hacks/check-configs.pl 2014-09-10 23:23:23.000000000 -0400 +++ xscreensaver-5.34/hacks/check-configs.pl 2014-11-04 21:07:59.000000000 -0500 @@ -19,7 +19,7 @@ use strict; my $progname = $0; $progname =~ s@.*/@@g; -my ($version) = ('$Revision: 1.9 $' =~ m/\s(\d[.\d]+)\s/s); +my ($version) = ('$Revision: 1.12 $' =~ m/\s(\d[.\d]+)\s/s); my $verbose = 0; @@ -74,7 +74,7 @@ $body =~ s@/\*.*?\*/@@gs; $body =~ s@^#\s*(if|ifdef|ifndef|elif|else|endif).*$@@gm; - $body =~ s/(THREAD|ANALOGTV)_(DEFAULTS|OPTIONS)//gs; + $body =~ s/(THREAD|ANALOGTV)_(DEFAULTS|OPTIONS)(_XLOCK)?//gs; print STDERR "$progname: $file: defaults:\n" if ($verbose > 2); my %res_to_val; @@ -194,6 +194,8 @@ $body =~ s/ 2); foreach (split (m/\001/, $body)) { next if (m/^\s*$/s); @@ -209,6 +211,13 @@ push @result, $val; print STDERR "$progname: $file: name: $name\n" if ($verbose > 2); + } elsif ($type eq 'video') { + error ("$file: multiple videos") if $video; + ($video) = ($args =~ m/\bhref="(.*?)"/); + error ("$file: unparsable video") unless $video; + error ("$file: unparsable video URL") + unless ($video =~ m@^https?://www\.youtube\.com/watch\?v=[^?&]+$@s); + } elsif ($type eq 'number') { my ($arg) = ($args =~ m/\barg\s*=\s*\"([^\"]+)\"/); my ($val) = ($args =~ m/\bdefault\s*=\s*\"([^\"]+)\"/); @@ -277,6 +286,9 @@ } } +# error ("$file: no video") unless $video; + print STDERR "\n$file: WARNING: no video\n\n" unless $video; + return @result; } diff -Nru xscreensaver-5.30/hacks/compile_axp.com xscreensaver-5.34/hacks/compile_axp.com --- xscreensaver-5.30/hacks/compile_axp.com 2014-09-11 13:07:54.000000000 -0400 +++ xscreensaver-5.34/hacks/compile_axp.com 2015-10-24 15:14:59.000000000 -0400 @@ -9,6 +9,7 @@ $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) ASM6502.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) ATTRACTION.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) BARCODE.C +$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) BINARYRING.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) BLASTER.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) BLITSPIN.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) BOUBOULE.C @@ -101,6 +102,7 @@ $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) PYRO.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) QIX.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) RD-BOMB.C +$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) RECANIM.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) RIPPLES.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) ROCKS.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) RORSCHACH.C @@ -122,6 +124,7 @@ $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) SWIRL.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) T3D.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) TESSELLIMAGE.C +$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) TESTX11.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) THORNBIRD.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) TRIANGLE.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) TRUCHET.C diff -Nru xscreensaver-5.30/hacks/compile_decc.com xscreensaver-5.34/hacks/compile_decc.com --- xscreensaver-5.30/hacks/compile_decc.com 2014-09-11 13:07:54.000000000 -0400 +++ xscreensaver-5.34/hacks/compile_decc.com 2015-10-24 15:14:59.000000000 -0400 @@ -9,6 +9,7 @@ $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) ASM6502.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) ATTRACTION.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) BARCODE.C +$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) BINARYRING.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) BLASTER.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) BLITSPIN.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) BOUBOULE.C @@ -101,6 +102,7 @@ $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) PYRO.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) QIX.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) RD-BOMB.C +$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) RECANIM.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) RIPPLES.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) ROCKS.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) RORSCHACH.C @@ -122,6 +124,7 @@ $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) SWIRL.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) T3D.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) TESSELLIMAGE.C +$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) TESTX11.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) THORNBIRD.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) TRIANGLE.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) TRUCHET.C diff -Nru xscreensaver-5.30/hacks/config/abstractile.xml xscreensaver-5.34/hacks/config/abstractile.xml --- xscreensaver-5.30/hacks/config/abstractile.xml 2014-08-01 22:44:13.000000000 -0400 +++ xscreensaver-5.34/hacks/config/abstractile.xml 2015-06-13 19:08:53.000000000 -0400 @@ -4,6 +4,8 @@ +