Net-DBus-GLib

 view release on metacpan or  search on metacpan

lib/Net/DBus/GLib.pm  view on Meta::CPAN


    return $bus;
}

=item my $bus = Net::DBus::GLib->system(%params);

Return a handle for the system message bus. For further
details on this method, consult to the method of the
same name in L<Net::DBus>. The %params hash may contain an
additional entry with a name of C<context>. This can be a
reference to an instance of the C<Glib::MainContext> object;
if omitted, the default GLib context will be used.

=cut

sub system {
    my $self = shift;
    my %params = @_;
    my $ctx = exists $params{context} ? $params{context} : Glib::MainContext->default;
    delete $params{context};
    my $bus = Net::DBus->system(nomainloop => 1, @_);

    _dbus_connection_setup_with_g_main($bus->get_connection->{connection}, $ctx);

    return $bus;
}


=item my $bus = Net::DBus::GLib->session(%params);

Return a handle for the session message bus. For further
details on this method, consult to the method of the
same name in L<Net::DBus>. The %params hash may contain an
additional entry with a name of C<context>. This can be a
reference to an instance of the C<Glib::MainContext> object;
if omitted, the default GLib context will be used.

=cut

sub session {
    my $self = shift;
    my %params = @_;
    my $ctx = exists $params{context} ? $params{context} : Glib::MainContext->default;
    delete $params{context};
    my $bus = Net::DBus->session(nomainloop => 1, @_);

    _dbus_connection_setup_with_g_main($bus->get_connection->{connection}, $ctx);

    return $bus;
}

1;

=pod

=back

=head1 SEE ALSO

L<Net::DBus>, L<Glib>, L<Glib::MainLoop>
C<http://dbus.freedesktop.org>, C<http://gtk.org>

=head1 AUTHOR

Daniel Berrange <dan@berrange.com>

=head1 COPYRIGHT

Copyright 2006-2008 by Daniel Berrange

=cut



( run in 0.753 second using v1.01-cache-2.11-cpan-39bf76dae61 )