Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* vim:expandtab:shiftwidth=2:tabstop=8: |
michael@0 | 3 | */ |
michael@0 | 4 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 5 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 6 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 7 | |
michael@0 | 8 | #ifndef NSXREMOTESERVICE_H |
michael@0 | 9 | #define NSXREMOTESERVICE_H |
michael@0 | 10 | |
michael@0 | 11 | #include "nsString.h" |
michael@0 | 12 | |
michael@0 | 13 | #include "nsIRemoteService.h" |
michael@0 | 14 | #include "nsIObserver.h" |
michael@0 | 15 | #include <X11/Xlib.h> |
michael@0 | 16 | #include <X11/X.h> |
michael@0 | 17 | |
michael@0 | 18 | class nsIDOMWindow; |
michael@0 | 19 | class nsIWeakReference; |
michael@0 | 20 | |
michael@0 | 21 | /** |
michael@0 | 22 | Base class for GTK/Qt remote service |
michael@0 | 23 | */ |
michael@0 | 24 | class nsXRemoteService : public nsIRemoteService, |
michael@0 | 25 | public nsIObserver |
michael@0 | 26 | { |
michael@0 | 27 | public: |
michael@0 | 28 | NS_DECL_NSIOBSERVER |
michael@0 | 29 | |
michael@0 | 30 | |
michael@0 | 31 | protected: |
michael@0 | 32 | nsXRemoteService(); |
michael@0 | 33 | |
michael@0 | 34 | static bool HandleNewProperty(Window aWindowId,Display* aDisplay, |
michael@0 | 35 | Time aEventTime, Atom aChangedAtom, |
michael@0 | 36 | nsIWeakReference* aDomWindow); |
michael@0 | 37 | |
michael@0 | 38 | void XRemoteBaseStartup(const char *aAppName, const char *aProfileName); |
michael@0 | 39 | |
michael@0 | 40 | void HandleCommandsFor(Window aWindowId); |
michael@0 | 41 | static nsXRemoteService *sRemoteImplementation; |
michael@0 | 42 | private: |
michael@0 | 43 | void EnsureAtoms(); |
michael@0 | 44 | static const char* HandleCommand(char* aCommand, nsIDOMWindow* aWindow, |
michael@0 | 45 | uint32_t aTimestamp); |
michael@0 | 46 | |
michael@0 | 47 | static const char* HandleCommandLine(char* aBuffer, nsIDOMWindow* aWindow, |
michael@0 | 48 | uint32_t aTimestamp); |
michael@0 | 49 | |
michael@0 | 50 | virtual void SetDesktopStartupIDOrTimestamp(const nsACString& aDesktopStartupID, |
michael@0 | 51 | uint32_t aTimestamp) = 0; |
michael@0 | 52 | |
michael@0 | 53 | nsCString mAppName; |
michael@0 | 54 | nsCString mProfileName; |
michael@0 | 55 | |
michael@0 | 56 | static Atom sMozVersionAtom; |
michael@0 | 57 | static Atom sMozLockAtom; |
michael@0 | 58 | static Atom sMozCommandAtom; |
michael@0 | 59 | static Atom sMozResponseAtom; |
michael@0 | 60 | static Atom sMozUserAtom; |
michael@0 | 61 | static Atom sMozProfileAtom; |
michael@0 | 62 | static Atom sMozProgramAtom; |
michael@0 | 63 | static Atom sMozCommandLineAtom; |
michael@0 | 64 | }; |
michael@0 | 65 | |
michael@0 | 66 | #endif // NSXREMOTESERVICE_H |