diff options
Diffstat (limited to 'lib/App/XScreenSaver/DBus/SaverProxy.pm')
-rw-r--r-- | lib/App/XScreenSaver/DBus/SaverProxy.pm | 56 |
1 files changed, 26 insertions, 30 deletions
diff --git a/lib/App/XScreenSaver/DBus/SaverProxy.pm b/lib/App/XScreenSaver/DBus/SaverProxy.pm index 858dcba..af4ec17 100644 --- a/lib/App/XScreenSaver/DBus/SaverProxy.pm +++ b/lib/App/XScreenSaver/DBus/SaverProxy.pm @@ -2,45 +2,41 @@ package App::XScreenSaver::DBus::SaverProxy; use v5.20; use strict; use warnings; -use experimental qw(signatures postderef); # this is the interface name use Net::DBus::Exporter qw(org.freedesktop.ScreenSaver); -use parent 'Net::DBus::Object'; -# VERSION +use parent 'Net::DBus::ProxyObject'; +our $VERSION = '1.0.5'; # VERSION # ABSTRACT: proxy dbus object -=head1 DESCRIPTION +dbus_method('Inhibit',['string','string','caller'],['uint32']); +dbus_method('UnInhibit',['uint32','caller'],[]); -This is functionally the same as L<< C<Net::DBus::ObjectProxy> >>, but -specialised for this application, and with a hack to allow L<< -C<App::XScreenSaver::DBus::Saver> >> to access the sender of the -message. +1; -=cut +__END__ -dbus_method('Inhibit',['string','string'],['uint32']); -dbus_method('UnInhibit',['uint32'],[]); +=pod -sub new($class,$service,$path,$inhibit_cb,$uninhibit_cb) { - my $self = $class->SUPER::new($service, $path); - bless $self, $class; - $self->{__inhibit_cb} = $inhibit_cb; - $self->{__uninhibit_cb} = $uninhibit_cb; - return $self; -} +=encoding UTF-8 -our $_message; -sub _dispatch_object($self,$connection,$message,@etc) { - local $_message = $message; - return $self->SUPER::_dispatch_object($connection,$message,@etc); -} +=head1 NAME -sub Inhibit($self,$name,$reason) { - return $self->{__inhibit_cb}->($name,$reason,$_message); -} +App::XScreenSaver::DBus::SaverProxy - proxy dbus object -sub UnInhibit($self,$cookie) { - return $self->{__uninhibit_cb}->($cookie,$_message); -} +=head1 VERSION -1; +version 1.0.5 + +=head1 AUTHOR + +Gianni Ceccarelli <dakkar@thenautilus.net> + +=head1 COPYRIGHT AND LICENSE + +This software is Copyright (c) 2021 by Gianni Ceccarelli <dakkar@thenautilus.net>. + +This is free software, licensed under: + + The GNU Affero General Public License, Version 3, November 2007 + +=cut |