2009-09-03 00:47:44 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2000-10-20 09:10:43 +04:00
|
|
|
|
|
|
|
#include <X11/X.h>
|
|
|
|
#include <X11/Xlib.h>
|
2003-02-14 16:17:50 +03:00
|
|
|
|
2005-04-04 23:08:55 +04:00
|
|
|
#include "nsRemoteClient.h"
|
2000-10-20 09:10:43 +04:00
|
|
|
|
2005-04-04 23:08:55 +04:00
|
|
|
class XRemoteClient : public nsRemoteClient
|
2000-10-20 09:10:43 +04:00
|
|
|
{
|
2005-04-04 23:08:55 +04:00
|
|
|
public:
|
2000-10-20 09:10:43 +04:00
|
|
|
XRemoteClient();
|
2005-04-04 23:08:55 +04:00
|
|
|
~XRemoteClient();
|
2000-10-20 09:10:43 +04:00
|
|
|
|
2005-04-04 23:08:55 +04:00
|
|
|
virtual nsresult Init();
|
|
|
|
virtual nsresult SendCommand(const char *aProgram, const char *aUsername,
|
|
|
|
const char *aProfile, const char *aCommand,
|
2007-02-09 04:33:26 +03:00
|
|
|
const char* aDesktopStartupID,
|
2011-09-29 10:19:26 +04:00
|
|
|
char **aResponse, bool *aSucceeded);
|
2005-04-04 23:08:55 +04:00
|
|
|
virtual nsresult SendCommandLine(const char *aProgram, const char *aUsername,
|
|
|
|
const char *aProfile,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t argc, char **argv,
|
2007-02-09 04:33:26 +03:00
|
|
|
const char* aDesktopStartupID,
|
2011-09-29 10:19:26 +04:00
|
|
|
char **aResponse, bool *aSucceeded);
|
2005-04-04 23:08:55 +04:00
|
|
|
void Shutdown();
|
2000-10-20 09:10:43 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
2001-09-11 05:36:19 +04:00
|
|
|
Window CheckWindow (Window aWindow);
|
|
|
|
Window CheckChildren (Window aWindow);
|
2011-09-29 10:19:26 +04:00
|
|
|
nsresult GetLock (Window aWindow, bool *aDestroyed);
|
2001-09-11 05:36:19 +04:00
|
|
|
nsresult FreeLock (Window aWindow);
|
2005-04-04 23:08:55 +04:00
|
|
|
Window FindBestWindow (const char *aProgram,
|
|
|
|
const char *aUsername,
|
|
|
|
const char *aProfile,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aSupportsCommandLine);
|
2009-09-03 00:47:44 +04:00
|
|
|
nsresult SendCommandInternal(const char *aProgram, const char *aUsername,
|
|
|
|
const char *aProfile, const char *aCommand,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t argc, char **argv,
|
2009-09-03 00:47:44 +04:00
|
|
|
const char* aDesktopStartupID,
|
2011-09-29 10:19:26 +04:00
|
|
|
char **aResponse, bool *aWindowFound);
|
2001-09-11 05:36:19 +04:00
|
|
|
nsresult DoSendCommand (Window aWindow,
|
2005-04-04 23:08:55 +04:00
|
|
|
const char *aCommand,
|
2007-02-09 04:33:26 +03:00
|
|
|
const char* aDesktopStartupID,
|
2005-04-04 23:08:55 +04:00
|
|
|
char **aResponse,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool *aDestroyed);
|
2005-04-04 23:08:55 +04:00
|
|
|
nsresult DoSendCommandLine(Window aWindow,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t argc, char **argv,
|
2007-02-09 04:33:26 +03:00
|
|
|
const char* aDesktopStartupID,
|
2005-04-04 23:08:55 +04:00
|
|
|
char **aResponse,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool *aDestroyed);
|
|
|
|
bool WaitForResponse (Window aWindow, char **aResponse,
|
|
|
|
bool *aDestroyed, Atom aCommandAtom);
|
2000-10-20 09:10:43 +04:00
|
|
|
|
|
|
|
Display *mDisplay;
|
|
|
|
|
|
|
|
Atom mMozVersionAtom;
|
|
|
|
Atom mMozLockAtom;
|
|
|
|
Atom mMozCommandAtom;
|
2005-04-04 23:08:55 +04:00
|
|
|
Atom mMozCommandLineAtom;
|
2000-10-20 09:10:43 +04:00
|
|
|
Atom mMozResponseAtom;
|
2001-09-11 05:36:19 +04:00
|
|
|
Atom mMozWMStateAtom;
|
2001-09-19 01:45:43 +04:00
|
|
|
Atom mMozUserAtom;
|
2004-04-08 18:01:17 +04:00
|
|
|
Atom mMozProfileAtom;
|
|
|
|
Atom mMozProgramAtom;
|
2000-10-20 09:10:43 +04:00
|
|
|
|
2001-12-29 01:17:20 +03:00
|
|
|
char *mLockData;
|
2000-10-20 09:10:43 +04:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mInitialized;
|
2000-10-20 09:10:43 +04:00
|
|
|
};
|