summaryrefslogtreecommitdiffstats
path: root/docs/mdk-vs-redhat
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-06-08 15:06:53 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-06-08 15:06:53 +0000
commit998a2e45ab54e8ba634bbfa752331975262d9311 (patch)
tree581288ee87b679e998454a73d434225aabaa9c43 /docs/mdk-vs-redhat
parent759c983bce8867d7126fa2e82dfb1aa83fd0bd34 (
Diffstat (limited to 'docs/mdk-vs-redhat')
0 files changed, 0 insertions, 0 deletions
ass="hl opt">); bless $o, $type; } sub attach_object { my ($o) = @_; my $service = $o->{bus}->get_service($o->{service}); $o->{object} = $service->get_object($o->{path}, $o->{interface}); } sub call_method { my ($o, $method, @args) = @_; $o->{object}->$method(@args); } sub safe_call_method { my ($o, $method, @args) = @_; my @ret; eval { @ret = $o->call_method($method, @args); }; if ($@) { print STDERR "($method) exception: $@\n"; $o->{bus}{connection}->dispatch; return; } @ret; } sub set_gtk2_watch { my ($o) = @_; set_gtk2_watch_helper($o->{bus}); } sub set_gtk2_watch_helper { my ($bus) = @_; $bus->{connection}->set_watch_callbacks(sub { my ($con, $watch) = @_; my $flags = $watch->get_flags; require Net::DBus::Binding::Watch; require Gtk2::Helper; if ($flags & &Net::DBus::Binding::Watch::READABLE) { Gtk2::Helper->add_watch($watch->get_fileno, 'in', sub { $watch->handle(&Net::DBus::Binding::Watch::READABLE); $con->dispatch; 1; }); } #- do nothing for WRITABLE watch, we dispatch when needed }, undef, undef); #- do nothing when watch is disabled or toggled yet $bus->{connection}->dispatch; } 1;