package Display::Plugins::FSpot;
-use DBI;
use Clutter;
+use base ('Display::Plugin');
my $f_spot_db = "/home/andrew/.gnome2/f-spot/photos.db";
sub new {
- my ($class,$stage) = @_;
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
- my $self = {
- 'stage' => $stage,
- 'last_file' => '',
- };
+ my $self = $class->SUPER::new(@_);
+
+ $self->{'last_file'} = '';
bless ($self, $class);
$self->init();
fade_in($self->{'new'});
# } else {
#warn "Fade out old\n";
-# my $old_effect = Clutter::EffectTemplate->new_for_duration(1000, 'smoothstep_dec' );
+# my $old_effect = Clutter::EffectTemplate->new_for_duration(1000, 'main::smoothstep_dec' );
# my $old = Clutter::Effect->fade($old_effect, $self->{'old'}, 0, $self->can('fade_in'), $self->{'new'});
# $old->start();
}
# $self->{'new'} = $temp;
$self->{'last_file'} = $file;
+ $self->{'kernel'}->delay_set(fspot_display => 30);
return 1;
}
sub fade_in {
my $new_pic = shift;
- my $new_effect = Clutter::EffectTemplate->new_for_duration(1000, 'smoothstep_inc');
+ my $new_effect = Clutter::EffectTemplate->new_for_duration(1000, 'main::smoothstep_inc');
my $new = Clutter::Effect->fade($new_effect, $new_pic, 255);
$new->start();
}
sub init {
my $self = shift;
+ $self->{'kernel'}->state('fspot_display', $self, 'display');
+
$self->{'dbh'} = DBI->connect("dbi:SQLite:dbname=$f_spot_db","","")
|| die "Failed to connect to $f_spot_db: $DBI::errstr\n";
$self->{'stage'}->add($self->{$age});
}
- Glib::Timeout->add_seconds(30, $self->can('display'), $self);
+ $self->{'kernel'}->delay_set(fspot_display => 30);
}
1;