michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include michael@0: #include michael@0: michael@0: #include "nsRemoteClient.h" michael@0: michael@0: class XRemoteClient : public nsRemoteClient michael@0: { michael@0: public: michael@0: XRemoteClient(); michael@0: ~XRemoteClient(); michael@0: michael@0: virtual nsresult Init(); michael@0: virtual nsresult SendCommand(const char *aProgram, const char *aUsername, michael@0: const char *aProfile, const char *aCommand, michael@0: const char* aDesktopStartupID, michael@0: char **aResponse, bool *aSucceeded); michael@0: virtual nsresult SendCommandLine(const char *aProgram, const char *aUsername, michael@0: const char *aProfile, michael@0: int32_t argc, char **argv, michael@0: const char* aDesktopStartupID, michael@0: char **aResponse, bool *aSucceeded); michael@0: void Shutdown(); michael@0: michael@0: private: michael@0: michael@0: Window CheckWindow (Window aWindow); michael@0: Window CheckChildren (Window aWindow); michael@0: nsresult GetLock (Window aWindow, bool *aDestroyed); michael@0: nsresult FreeLock (Window aWindow); michael@0: Window FindBestWindow (const char *aProgram, michael@0: const char *aUsername, michael@0: const char *aProfile, michael@0: bool aSupportsCommandLine); michael@0: nsresult SendCommandInternal(const char *aProgram, const char *aUsername, michael@0: const char *aProfile, const char *aCommand, michael@0: int32_t argc, char **argv, michael@0: const char* aDesktopStartupID, michael@0: char **aResponse, bool *aWindowFound); michael@0: nsresult DoSendCommand (Window aWindow, michael@0: const char *aCommand, michael@0: const char* aDesktopStartupID, michael@0: char **aResponse, michael@0: bool *aDestroyed); michael@0: nsresult DoSendCommandLine(Window aWindow, michael@0: int32_t argc, char **argv, michael@0: const char* aDesktopStartupID, michael@0: char **aResponse, michael@0: bool *aDestroyed); michael@0: bool WaitForResponse (Window aWindow, char **aResponse, michael@0: bool *aDestroyed, Atom aCommandAtom); michael@0: michael@0: Display *mDisplay; michael@0: michael@0: Atom mMozVersionAtom; michael@0: Atom mMozLockAtom; michael@0: Atom mMozCommandAtom; michael@0: Atom mMozCommandLineAtom; michael@0: Atom mMozResponseAtom; michael@0: Atom mMozWMStateAtom; michael@0: Atom mMozUserAtom; michael@0: Atom mMozProfileAtom; michael@0: Atom mMozProgramAtom; michael@0: michael@0: char *mLockData; michael@0: michael@0: bool mInitialized; michael@0: };