1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:expandtab:shiftwidth=4:tabstop=4:
4 /* This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
11 #ifdef MOZ_ENABLE_DBUS
13 # include "mozilla/RefPtr.h"
14 # include "mozilla/GRefPtr.h"
17 #include "nsBaseAppShell.h"
19 class nsAppShell
: public nsBaseAppShell
{
21 nsAppShell() = default;
23 // nsBaseAppShell overrides:
25 NS_IMETHOD
Run() override
;
27 void ScheduleNativeEventCallback() override
;
28 bool ProcessNextNativeEvent(bool mayWait
) override
;
30 #ifdef MOZ_ENABLE_DBUS
31 void StartDBusListening();
32 void StopDBusListening();
34 static void DBusSessionSleepCallback(GDBusProxy
* aProxy
, gchar
* aSenderName
,
36 GVariant
* aParameters
,
38 static void DBusTimedatePropertiesChangedCallback(GDBusProxy
* aProxy
,
41 GVariant
* aParameters
,
43 static void DBusConnectClientResponse(GObject
* aObject
, GAsyncResult
* aResult
,
47 static void InstallTermSignalHandler();
50 virtual ~nsAppShell();
52 static gboolean
EventProcessorCallback(GIOChannel
* source
,
53 GIOCondition condition
, gpointer data
);
54 static void TermSignalHandler(int signo
);
56 void ScheduleQuitEvent();
58 int mPipeFDs
[2] = {0, 0};
61 #ifdef MOZ_ENABLE_DBUS
62 RefPtr
<GDBusProxy
> mLogin1Proxy
;
63 RefPtr
<GCancellable
> mLogin1ProxyCancellable
;
64 RefPtr
<GDBusProxy
> mTimedate1Proxy
;
65 RefPtr
<GCancellable
> mTimedate1ProxyCancellable
;
69 #endif /* nsAppShell_h__ */