$self->{'sth'}->finish()
|| die "Failed to finish statement: $DBI::errstr\n";;
- $self->set_from_file($uri);
+ $uri =~ s|^file://||;
+ $self->{'picture'}->set_from_file($uri);
return $uri;
}
|| die "Failed to prepare statement: $DBI::errstr\n";
$self->{'picture'} = Clutter::Texture->new();
+ $self->{'picture'}->set_size($self->{'stage'}->get_size());
+ $self->{'picture'}->{'keep-aspect-ratio'} = 1;
+ $self->{'picture'}->{'sync-size'} = 1;
$self->display();
- $self->{'stage'}->add($self->{'picture'};
+ $self->{'stage'}->add($self->{'picture'});
}
1;
use strict;
use FindBin;
use Module::Pluggable search_path => ['Display::Plugins'];
-use Cluter qw( :init );
+use Clutter qw( :init );
use Getopt::Long;
use lib "$FindBin::Bin/lib";
my $full_screen = 1;
GetOptions(
- '!full|f' => \$full_screen,
+ 'full|f!' => \$full_screen,
);
-my @modules = loadModules();
-
my $stage = Clutter::Stage->get_default();
$stage->set_color(Clutter::Color->parse('Black'));
$stage->signal_connect('key-press-event' => sub { Clutter->main_quit() });
$stage->set_size(800, 600);
}
-for my $module (@modules) {
- print $module->display() . "\n";
+my @modules = loadModules();
+
+$stage->show_all();
+
+Glib::Timeout->add_seconds(30, \&update_screen);
+
+Clutter->main();
+
+sub update_screen {
+ for my $module (@modules) {
+ $module->display();
+ }
}
sub loadModules {