package Display::Plugins::FSpot;
use DBI;
+use Clutter;
my $f_spot_db = "/home/andrew/.gnome2/f-spot/photos.db";
sub new {
- my ($class,$instance) = @_;
+ my ($class,$stage) = @_;
- my $self = {};
+ my $self = {
+ 'stage' => $stage
+ };
bless ($self, $class);
$self->init();
$self->{'sth'}->finish()
|| die "Failed to finish statement: $DBI::errstr\n";;
+ $self->set_from_file($uri);
+
return $uri;
}
$self->{'sth'} = $self->{'dbh'}->prepare($sql)
|| die "Failed to prepare statement: $DBI::errstr\n";
+
+ $self->{'picture'} = Clutter::Texture->new();
+ $self->display();
+ $self->{'stage'}->add($self->{'picture'};
}
1;
use strict;
use FindBin;
use Module::Pluggable search_path => ['Display::Plugins'];
+use Cluter qw( :init );
+use Getopt::Long;
use lib "$FindBin::Bin/lib";
+my $full_screen = 1;
+
+GetOptions(
+ '!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() });
+
+if ($full_screen) {
+ $stage->fullscreen;
+} else {
+ $stage->set_size(800, 600);
+}
+
for my $module (@modules) {
print $module->display() . "\n";
}
die "Failed to load plugin: $module ($@)\n";
}
- push @modules, $module->new();
+ push @modules, $module->new($stage);
}
return @modules;