toolkit/components/remote/nsXRemoteService.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/components/remote/nsXRemoteService.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,66 @@
     1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* vim:expandtab:shiftwidth=2:tabstop=8:
     1.6 + */
     1.7 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.8 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.9 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
    1.10 +
    1.11 +#ifndef NSXREMOTESERVICE_H
    1.12 +#define NSXREMOTESERVICE_H
    1.13 +
    1.14 +#include "nsString.h"
    1.15 +
    1.16 +#include "nsIRemoteService.h"
    1.17 +#include "nsIObserver.h"
    1.18 +#include <X11/Xlib.h>
    1.19 +#include <X11/X.h>
    1.20 +
    1.21 +class nsIDOMWindow;
    1.22 +class nsIWeakReference;
    1.23 +
    1.24 +/**
    1.25 +  Base class for GTK/Qt remote service
    1.26 +*/
    1.27 +class nsXRemoteService : public nsIRemoteService,
    1.28 +                         public nsIObserver
    1.29 +{
    1.30 +public:
    1.31 +    NS_DECL_NSIOBSERVER
    1.32 +
    1.33 +
    1.34 +protected:
    1.35 +    nsXRemoteService();
    1.36 +
    1.37 +    static bool HandleNewProperty(Window aWindowId,Display* aDisplay,
    1.38 +                                    Time aEventTime, Atom aChangedAtom,
    1.39 +                                    nsIWeakReference* aDomWindow);
    1.40 +    
    1.41 +    void XRemoteBaseStartup(const char *aAppName, const char *aProfileName);
    1.42 +
    1.43 +    void HandleCommandsFor(Window aWindowId);
    1.44 +    static nsXRemoteService *sRemoteImplementation;
    1.45 +private:
    1.46 +    void EnsureAtoms();
    1.47 +    static const char* HandleCommand(char* aCommand, nsIDOMWindow* aWindow,
    1.48 +                                     uint32_t aTimestamp);
    1.49 +
    1.50 +    static const char* HandleCommandLine(char* aBuffer, nsIDOMWindow* aWindow,
    1.51 +                                         uint32_t aTimestamp);
    1.52 +
    1.53 +    virtual void SetDesktopStartupIDOrTimestamp(const nsACString& aDesktopStartupID,
    1.54 +                                                uint32_t aTimestamp) = 0;
    1.55 +
    1.56 +    nsCString mAppName;
    1.57 +    nsCString mProfileName;
    1.58 +
    1.59 +    static Atom sMozVersionAtom;
    1.60 +    static Atom sMozLockAtom;
    1.61 +    static Atom sMozCommandAtom;
    1.62 +    static Atom sMozResponseAtom;
    1.63 +    static Atom sMozUserAtom;
    1.64 +    static Atom sMozProfileAtom;
    1.65 +    static Atom sMozProgramAtom;
    1.66 +    static Atom sMozCommandLineAtom;
    1.67 +};
    1.68 +
    1.69 +#endif // NSXREMOTESERVICE_H

mercurial