From: tanya Date: Wed, 11 Aug 2010 09:28:54 +0000 (+0300) Subject: changed dbus send param X-Git-Url: http://vcs.maemo.org/git/?p=xscreensaver;a=commitdiff_plain;h=ec56a38efdf850541c41da1358a7408235ac998a changed dbus send param --- diff --git a/xscreensaver/config.guess b/xscreensaver/config.guess old mode 100755 new mode 100644 diff --git a/xscreensaver/config.sub b/xscreensaver/config.sub old mode 100755 new mode 100644 diff --git a/xscreensaver/hacks/screenhack.c b/xscreensaver/hacks/screenhack.c index 273c2e1..5515ad4 100644 --- a/xscreensaver/hacks/screenhack.c +++ b/xscreensaver/hacks/screenhack.c @@ -532,15 +532,18 @@ run_screenhack_table (Display *dpy, #define LIVEWP_PAUSE_LIVEBG_ON_VIEW2 "pause_livebg_on_view2" #define LIVEWP_PAUSE_LIVEBG_ON_VIEW3 "pause_livebg_on_view3" #define LIVEWP_PAUSE_LIVEBG_ON_VIEW4 "pause_livebg_on_view4" +#define LIVEWP_PAUSE_LIVEBG_ON_VIEW "pause_livebg_on_view" #define LIVEWP_PLAY_LIVEBG_ON_VIEW1 "play_livebg_on_view1" #define LIVEWP_PLAY_LIVEBG_ON_VIEW2 "play_livebg_on_view2" #define LIVEWP_PLAY_LIVEBG_ON_VIEW3 "play_livebg_on_view3" #define LIVEWP_PLAY_LIVEBG_ON_VIEW4 "play_livebg_on_view4" +#define LIVEWP_PLAY_LIVEBG_ON_VIEW "play_livebg_on_view" DBusMessage* msg; DBusConnection* conn; DBusError err; int ret; char pause = 0; + int param = 0; /* Kludge: even though the init_cb functions are declared to take 2 args, actually call them with 3, for the benefit of xlockmore_init() and @@ -584,6 +587,7 @@ run_screenhack_table (Display *dpy, dbus_error_free(&err); exit (1); } + DBusMessageIter args; while (1) { if (pause == 0){ @@ -612,7 +616,30 @@ run_screenhack_table (Display *dpy, msg = dbus_connection_pop_message(conn); if (NULL == msg) continue; + + if (dbus_message_is_signal(msg, LIVEWP_SIGNAL_INTERFACE, LIVEWP_PAUSE_LIVEBG_ON_VIEW) || + dbus_message_is_signal(msg, LIVEWP_SIGNAL_INTERFACE, LIVEWP_PLAY_LIVEBG_ON_VIEW)){ + if (!dbus_message_iter_init(msg, &args)) + fprintf(stderr, "dbus message has no param\n"); + else if (DBUS_TYPE_INT32 != dbus_message_iter_get_arg_type(&args)) + fprintf(stderr, "dbus message param is not int \n"); + else{ + dbus_message_iter_get_basic(&args, ¶m); + fprintf(stderr, "dbus param = %i\n", param); + } + if (param == view){ + if (dbus_message_is_signal(msg, LIVEWP_SIGNAL_INTERFACE, LIVEWP_PAUSE_LIVEBG_ON_VIEW)){ + fprintf(stderr, "dbus Pause scene visible %i\n", param); + pause = 1; + } + if (dbus_message_is_signal(msg, LIVEWP_SIGNAL_INTERFACE, LIVEWP_PLAY_LIVEBG_ON_VIEW)){ + fprintf(stderr, "dbus Play scene visible %i\n", param); + pause = 0; + } + } + } /* check this is a method call for the right interface & method */ + /* if ((view == 1 && dbus_message_is_signal(msg, LIVEWP_SIGNAL_INTERFACE, LIVEWP_PAUSE_LIVEBG_ON_VIEW1))|| (view == 2 && dbus_message_is_signal(msg, LIVEWP_SIGNAL_INTERFACE, LIVEWP_PAUSE_LIVEBG_ON_VIEW2))|| (view == 3 && dbus_message_is_signal(msg, LIVEWP_SIGNAL_INTERFACE, LIVEWP_PAUSE_LIVEBG_ON_VIEW3))|| @@ -628,7 +655,8 @@ run_screenhack_table (Display *dpy, fprintf(stderr, "Play scene visible %i\n", view); pause = 0; } - +*/ + } ft->free_cb (dpy, window, closure);