2009-09-02 20:47:44 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2004-04-18 22:01:16 +00:00
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
2000-10-20 05:10:43 +00:00
|
|
|
* The Original Code is mozilla.org code.
|
2004-04-18 22:01:16 +00:00
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is
|
2006-03-30 07:57:05 +00:00
|
|
|
* Christopher Blizzard.
|
2004-04-18 22:01:16 +00:00
|
|
|
* Portions created by the Initial Developer are Copyright (C) 2001
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
2000-10-20 05:10:43 +00:00
|
|
|
* Contributor(s):
|
2004-04-18 22:01:16 +00:00
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
2000-10-20 05:10:43 +00:00
|
|
|
|
|
|
|
#include <X11/X.h>
|
|
|
|
#include <X11/Xlib.h>
|
2003-02-14 13:17:50 +00:00
|
|
|
|
2005-04-04 19:08:55 +00:00
|
|
|
#include "nsRemoteClient.h"
|
2000-10-20 05:10:43 +00:00
|
|
|
|
2005-04-04 19:08:55 +00:00
|
|
|
class XRemoteClient : public nsRemoteClient
|
2000-10-20 05:10:43 +00:00
|
|
|
{
|
2005-04-04 19:08:55 +00:00
|
|
|
public:
|
2000-10-20 05:10:43 +00:00
|
|
|
XRemoteClient();
|
2005-04-04 19:08:55 +00:00
|
|
|
~XRemoteClient();
|
2000-10-20 05:10:43 +00:00
|
|
|
|
2005-04-04 19:08:55 +00:00
|
|
|
virtual nsresult Init();
|
|
|
|
virtual nsresult SendCommand(const char *aProgram, const char *aUsername,
|
|
|
|
const char *aProfile, const char *aCommand,
|
2007-02-09 01:33:26 +00:00
|
|
|
const char* aDesktopStartupID,
|
2011-09-29 06:19:26 +00:00
|
|
|
char **aResponse, bool *aSucceeded);
|
2005-04-04 19:08:55 +00:00
|
|
|
virtual nsresult SendCommandLine(const char *aProgram, const char *aUsername,
|
|
|
|
const char *aProfile,
|
|
|
|
PRInt32 argc, char **argv,
|
2007-02-09 01:33:26 +00:00
|
|
|
const char* aDesktopStartupID,
|
2011-09-29 06:19:26 +00:00
|
|
|
char **aResponse, bool *aSucceeded);
|
2005-04-04 19:08:55 +00:00
|
|
|
void Shutdown();
|
2000-10-20 05:10:43 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
2001-09-11 01:36:19 +00:00
|
|
|
Window CheckWindow (Window aWindow);
|
|
|
|
Window CheckChildren (Window aWindow);
|
2011-09-29 06:19:26 +00:00
|
|
|
nsresult GetLock (Window aWindow, bool *aDestroyed);
|
2001-09-11 01:36:19 +00:00
|
|
|
nsresult FreeLock (Window aWindow);
|
2005-04-04 19:08:55 +00:00
|
|
|
Window FindBestWindow (const char *aProgram,
|
|
|
|
const char *aUsername,
|
|
|
|
const char *aProfile,
|
2011-09-29 06:19:26 +00:00
|
|
|
bool aSupportsCommandLine);
|
2009-09-02 20:47:44 +00:00
|
|
|
nsresult SendCommandInternal(const char *aProgram, const char *aUsername,
|
|
|
|
const char *aProfile, const char *aCommand,
|
|
|
|
PRInt32 argc, char **argv,
|
|
|
|
const char* aDesktopStartupID,
|
2011-09-29 06:19:26 +00:00
|
|
|
char **aResponse, bool *aWindowFound);
|
2001-09-11 01:36:19 +00:00
|
|
|
nsresult DoSendCommand (Window aWindow,
|
2005-04-04 19:08:55 +00:00
|
|
|
const char *aCommand,
|
2007-02-09 01:33:26 +00:00
|
|
|
const char* aDesktopStartupID,
|
2005-04-04 19:08:55 +00:00
|
|
|
char **aResponse,
|
2011-09-29 06:19:26 +00:00
|
|
|
bool *aDestroyed);
|
2005-04-04 19:08:55 +00:00
|
|
|
nsresult DoSendCommandLine(Window aWindow,
|
|
|
|
PRInt32 argc, char **argv,
|
2007-02-09 01:33:26 +00:00
|
|
|
const char* aDesktopStartupID,
|
2005-04-04 19:08:55 +00:00
|
|
|
char **aResponse,
|
2011-09-29 06:19:26 +00:00
|
|
|
bool *aDestroyed);
|
|
|
|
bool WaitForResponse (Window aWindow, char **aResponse,
|
|
|
|
bool *aDestroyed, Atom aCommandAtom);
|
2000-10-20 05:10:43 +00:00
|
|
|
|
|
|
|
Display *mDisplay;
|
|
|
|
|
|
|
|
Atom mMozVersionAtom;
|
|
|
|
Atom mMozLockAtom;
|
|
|
|
Atom mMozCommandAtom;
|
2005-04-04 19:08:55 +00:00
|
|
|
Atom mMozCommandLineAtom;
|
2000-10-20 05:10:43 +00:00
|
|
|
Atom mMozResponseAtom;
|
2001-09-11 01:36:19 +00:00
|
|
|
Atom mMozWMStateAtom;
|
2001-09-18 21:45:43 +00:00
|
|
|
Atom mMozUserAtom;
|
2004-04-08 14:01:17 +00:00
|
|
|
Atom mMozProfileAtom;
|
|
|
|
Atom mMozProgramAtom;
|
2005-04-04 19:08:55 +00:00
|
|
|
Atom mMozSupportsCLAtom;
|
2000-10-20 05:10:43 +00:00
|
|
|
|
2001-12-28 22:17:20 +00:00
|
|
|
char *mLockData;
|
2000-10-20 05:10:43 +00:00
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mInitialized;
|
2000-10-20 05:10:43 +00:00
|
|
|
};
|