56 #include <nsAutoPtr.h>
88 NS_ENSURE_SUCCESS(rv, rv);
92 NS_ENSURE_SUCCESS(rv, rv);
111 mSuppressed(PR_FALSE)
140 sbScreenSaverSuppressor::Suppress()
149 nsAutoPtr<sbDBusConnection> dBusConnection;
152 "org.gnome.ScreenSaver",
153 "/org/gnome/ScreenSaver",
154 "org.gnome.ScreenSaver");
155 NS_ENSURE_SUCCESS(rv, rv);
158 static const char*
name =
"Songbird";
159 static const char* reason =
"Playing video";
160 nsAutoPtr<sbDBusMessage> reply;
161 rv = dBusConnection->InvokeMethod(
"Inhibit",
162 getter_Transfers(reply),
168 NS_ENSURE_SUCCESS(rv, rv);
171 rv = reply->GetArgs(DBUS_TYPE_UINT32, &mInhibitCookie, DBUS_TYPE_INVALID);
172 NS_ENSURE_SUCCESS(rv, rv);
175 mSuppressed = PR_TRUE;
187 sbScreenSaverSuppressor::Unsuppress()
196 nsAutoPtr<sbDBusConnection> dBusConnection;
199 "org.gnome.ScreenSaver",
200 "/org/gnome/ScreenSaver",
201 "org.gnome.ScreenSaver");
202 NS_ENSURE_SUCCESS(rv, rv);
205 rv = dBusConnection->InvokeMethod(
"UnInhibit",
210 NS_ENSURE_SUCCESS(rv, rv);
213 mSuppressed = PR_FALSE;
static nsresult New(sbDBusConnection **aConnection, DBusBusType aBusType, const char *aDestination, const char *aPath, const char *aInterface)
NS_IMPL_ISUPPORTS_INHERITED0(sbScreenSaverSuppressor, sbBaseScreenSaverSuppressor) nsresult sbScreenSaverSuppressor
sbScreenSaverSuppressor()
Songbird D-Bus Service Definitions.
virtual ~sbScreenSaverSuppressor()