Re: [gnome-hispano] tomboy-shell-extension
- From: Aleksander Morgado <aleksander gnu org>
- To: Rodrigo Moya <rodrigo gnome-db org>, GNOME Hispano <gnome-hispano-list gnome org>
- Subject: Re: [gnome-hispano] tomboy-shell-extension
- Date: Tue, 22 Oct 2013 13:43:40 +0200
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 22/10/13 12:20, Rodrigo Moya wrote:
#include <gio/gio.h>
static void
on_name_appeared (GDBusConnection *connection,
const gchar *name,
const gchar *name_owner,
gpointer user_data)
{
g_print ("Name %s appeared\n", name);
}
static void
on_name_vanished (GDBusConnection *connection,
const gchar *name,
gpointer user_data)
{
g_print ("Name %s vanished\n", name);
}
int
main (int argc, char *argv[])
{
GMainLoop *loop;
guint watcher_id;
g_type_init ();
watcher_id = g_bus_watch_name (G_BUS_TYPE_SESSION,
"org.mpris.MediaPlayer2",
0,
on_name_appeared,
on_name_vanished,
NULL,
NULL);
loop = g_main_loop_new (NULL, TRUE);
g_main_loop_run (loop);
return 0;
}
pero en JavaScript :-)
TambiƩn puedes crear directamente un proxy para la interfaz que vayas a
usar y luego ver si el name-owner existe o no.
this._proxy.connect('notify::g-name-owner', Lang.bind(this, function() {
if (this._proxy.g_name_owner)
global.log('Tomboy running');
else
global.log('Tomboy not running');
}
Saludos!
- --
Aleksander
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.15 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iEYEARECAAYFAlJmZOwACgkQgxIgkKLogl6TIgCgl2KdNrR75vsIhHpORxyciwYg
KCAAniEx7iOTSklc9gPCINn9RY1e5vey
=AkIN
-----END PGP SIGNATURE-----
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]