Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #include <X11/X.h> |
michael@0 | 7 | #include <X11/Xlib.h> |
michael@0 | 8 | |
michael@0 | 9 | #include "nsRemoteClient.h" |
michael@0 | 10 | |
michael@0 | 11 | class XRemoteClient : public nsRemoteClient |
michael@0 | 12 | { |
michael@0 | 13 | public: |
michael@0 | 14 | XRemoteClient(); |
michael@0 | 15 | ~XRemoteClient(); |
michael@0 | 16 | |
michael@0 | 17 | virtual nsresult Init(); |
michael@0 | 18 | virtual nsresult SendCommand(const char *aProgram, const char *aUsername, |
michael@0 | 19 | const char *aProfile, const char *aCommand, |
michael@0 | 20 | const char* aDesktopStartupID, |
michael@0 | 21 | char **aResponse, bool *aSucceeded); |
michael@0 | 22 | virtual nsresult SendCommandLine(const char *aProgram, const char *aUsername, |
michael@0 | 23 | const char *aProfile, |
michael@0 | 24 | int32_t argc, char **argv, |
michael@0 | 25 | const char* aDesktopStartupID, |
michael@0 | 26 | char **aResponse, bool *aSucceeded); |
michael@0 | 27 | void Shutdown(); |
michael@0 | 28 | |
michael@0 | 29 | private: |
michael@0 | 30 | |
michael@0 | 31 | Window CheckWindow (Window aWindow); |
michael@0 | 32 | Window CheckChildren (Window aWindow); |
michael@0 | 33 | nsresult GetLock (Window aWindow, bool *aDestroyed); |
michael@0 | 34 | nsresult FreeLock (Window aWindow); |
michael@0 | 35 | Window FindBestWindow (const char *aProgram, |
michael@0 | 36 | const char *aUsername, |
michael@0 | 37 | const char *aProfile, |
michael@0 | 38 | bool aSupportsCommandLine); |
michael@0 | 39 | nsresult SendCommandInternal(const char *aProgram, const char *aUsername, |
michael@0 | 40 | const char *aProfile, const char *aCommand, |
michael@0 | 41 | int32_t argc, char **argv, |
michael@0 | 42 | const char* aDesktopStartupID, |
michael@0 | 43 | char **aResponse, bool *aWindowFound); |
michael@0 | 44 | nsresult DoSendCommand (Window aWindow, |
michael@0 | 45 | const char *aCommand, |
michael@0 | 46 | const char* aDesktopStartupID, |
michael@0 | 47 | char **aResponse, |
michael@0 | 48 | bool *aDestroyed); |
michael@0 | 49 | nsresult DoSendCommandLine(Window aWindow, |
michael@0 | 50 | int32_t argc, char **argv, |
michael@0 | 51 | const char* aDesktopStartupID, |
michael@0 | 52 | char **aResponse, |
michael@0 | 53 | bool *aDestroyed); |
michael@0 | 54 | bool WaitForResponse (Window aWindow, char **aResponse, |
michael@0 | 55 | bool *aDestroyed, Atom aCommandAtom); |
michael@0 | 56 | |
michael@0 | 57 | Display *mDisplay; |
michael@0 | 58 | |
michael@0 | 59 | Atom mMozVersionAtom; |
michael@0 | 60 | Atom mMozLockAtom; |
michael@0 | 61 | Atom mMozCommandAtom; |
michael@0 | 62 | Atom mMozCommandLineAtom; |
michael@0 | 63 | Atom mMozResponseAtom; |
michael@0 | 64 | Atom mMozWMStateAtom; |
michael@0 | 65 | Atom mMozUserAtom; |
michael@0 | 66 | Atom mMozProfileAtom; |
michael@0 | 67 | Atom mMozProgramAtom; |
michael@0 | 68 | |
michael@0 | 69 | char *mLockData; |
michael@0 | 70 | |
michael@0 | 71 | bool mInitialized; |
michael@0 | 72 | }; |