Backed out 3 changesets (bug 1870106, bug 1845276) for causing doc generate failures...
[gecko.git] / widget / gtk / nsAppShell.h
blob0b628033ccd25ac15bbbe5a7eac877410ebebd64
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:expandtab:shiftwidth=4:tabstop=4:
3 */
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/. */
8 #ifndef nsAppShell_h__
9 #define nsAppShell_h__
11 #ifdef MOZ_ENABLE_DBUS
12 # include <gio/gio.h>
13 # include "mozilla/RefPtr.h"
14 # include "mozilla/GRefPtr.h"
15 #endif
16 #include <glib.h>
17 #include "nsBaseAppShell.h"
19 class nsAppShell : public nsBaseAppShell {
20 public:
21 nsAppShell() = default;
23 // nsBaseAppShell overrides:
24 nsresult Init();
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,
35 gchar* aSignalName,
36 GVariant* aParameters,
37 gpointer aUserData);
38 static void DBusTimedatePropertiesChangedCallback(GDBusProxy* aProxy,
39 gchar* aSenderName,
40 gchar* aSignalName,
41 GVariant* aParameters,
42 gpointer aUserData);
43 static void DBusConnectClientResponse(GObject* aObject, GAsyncResult* aResult,
44 gpointer aUserData);
45 #endif
47 static void InstallTermSignalHandler();
49 private:
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};
59 unsigned mTag = 0;
61 #ifdef MOZ_ENABLE_DBUS
62 RefPtr<GDBusProxy> mLogin1Proxy;
63 RefPtr<GCancellable> mLogin1ProxyCancellable;
64 RefPtr<GDBusProxy> mTimedate1Proxy;
65 RefPtr<GCancellable> mTimedate1ProxyCancellable;
66 #endif
69 #endif /* nsAppShell_h__ */