widget/xremoteclient/XRemoteClient.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/widget/xremoteclient/XRemoteClient.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,72 @@
     1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#include <X11/X.h>
    1.10 +#include <X11/Xlib.h>
    1.11 +
    1.12 +#include "nsRemoteClient.h"
    1.13 +
    1.14 +class XRemoteClient : public nsRemoteClient
    1.15 +{
    1.16 +public:
    1.17 +  XRemoteClient();
    1.18 +  ~XRemoteClient();
    1.19 +
    1.20 +  virtual nsresult Init();
    1.21 +  virtual nsresult SendCommand(const char *aProgram, const char *aUsername,
    1.22 +                               const char *aProfile, const char *aCommand,
    1.23 +                               const char* aDesktopStartupID,
    1.24 +                               char **aResponse, bool *aSucceeded);
    1.25 +  virtual nsresult SendCommandLine(const char *aProgram, const char *aUsername,
    1.26 +                                   const char *aProfile,
    1.27 +                                   int32_t argc, char **argv,
    1.28 +                                   const char* aDesktopStartupID,
    1.29 +                                   char **aResponse, bool *aSucceeded);
    1.30 +  void Shutdown();
    1.31 +
    1.32 +private:
    1.33 +
    1.34 +  Window         CheckWindow      (Window aWindow);
    1.35 +  Window         CheckChildren    (Window aWindow);
    1.36 +  nsresult       GetLock          (Window aWindow, bool *aDestroyed);
    1.37 +  nsresult       FreeLock         (Window aWindow);
    1.38 +  Window         FindBestWindow   (const char *aProgram,
    1.39 +                                   const char *aUsername,
    1.40 +                                   const char *aProfile,
    1.41 +                                   bool aSupportsCommandLine);
    1.42 +  nsresult     SendCommandInternal(const char *aProgram, const char *aUsername,
    1.43 +                                   const char *aProfile, const char *aCommand,
    1.44 +                                   int32_t argc, char **argv,
    1.45 +                                   const char* aDesktopStartupID,
    1.46 +                                   char **aResponse, bool *aWindowFound);
    1.47 +  nsresult       DoSendCommand    (Window aWindow,
    1.48 +                                   const char *aCommand,
    1.49 +                                   const char* aDesktopStartupID,
    1.50 +                                   char **aResponse,
    1.51 +                                   bool *aDestroyed);
    1.52 +  nsresult       DoSendCommandLine(Window aWindow,
    1.53 +                                   int32_t argc, char **argv,
    1.54 +                                   const char* aDesktopStartupID,
    1.55 +                                   char **aResponse,
    1.56 +                                   bool *aDestroyed);
    1.57 +  bool           WaitForResponse  (Window aWindow, char **aResponse,
    1.58 +                                   bool *aDestroyed, Atom aCommandAtom);
    1.59 +
    1.60 +  Display       *mDisplay;
    1.61 +
    1.62 +  Atom           mMozVersionAtom;
    1.63 +  Atom           mMozLockAtom;
    1.64 +  Atom           mMozCommandAtom;
    1.65 +  Atom           mMozCommandLineAtom;
    1.66 +  Atom           mMozResponseAtom;
    1.67 +  Atom           mMozWMStateAtom;
    1.68 +  Atom           mMozUserAtom;
    1.69 +  Atom           mMozProfileAtom;
    1.70 +  Atom           mMozProgramAtom;
    1.71 +
    1.72 +  char          *mLockData;
    1.73 +
    1.74 +  bool           mInitialized;
    1.75 +};

mercurial