1 : /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* vim:expandtab:shiftwidth=2:tabstop=8:
3 : */
4 : /* ***** BEGIN LICENSE BLOCK *****
5 : * Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 : *
7 : * The contents of this file are subject to the Mozilla Public License Version
8 : * 1.1 (the "License"); you may not use this file except in compliance with
9 : * the License. You may obtain a copy of the License at
10 : * http://www.mozilla.org/MPL/
11 : *
12 : * Software distributed under the License is distributed on an "AS IS" basis,
13 : * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
14 : * for the specific language governing rights and limitations under the
15 : * License.
16 : *
17 : * The Original Code is mozilla.org code.
18 : *
19 : * The Initial Developer of the Original Code is
20 : * Christopher Blizzard.
21 : * Portions created by the Initial Developer are Copyright (C) 2001
22 : * the Initial Developer. All Rights Reserved.
23 : *
24 : * Contributor(s):
25 : * Christopher Blizzard <blizzard@mozilla.org>
26 : * Benjamin Smedberg <benjamin@smedbergs.us>
27 : * Miika Jarvinen <mjarvin@gmail.com>
28 : *
29 : * Alternatively, the contents of this file may be used under the terms of
30 : * either the GNU General Public License Version 2 or later (the "GPL"), or
31 : * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
32 : * in which case the provisions of the GPL or the LGPL are applicable instead
33 : * of those above. If you wish to allow use of your version of this file only
34 : * under the terms of either the GPL or the LGPL, and not to allow others to
35 : * use your version of this file under the terms of the MPL, indicate your
36 : * decision by deleting the provisions above and replace them with the notice
37 : * and other provisions required by the GPL or the LGPL. If you do not delete
38 : * the provisions above, a recipient may use your version of this file under
39 : * the terms of any one of the MPL, the GPL or the LGPL.
40 : *
41 : * ***** END LICENSE BLOCK ***** */
42 :
43 : #ifndef NSXREMOTESERVICE_H
44 : #define NSXREMOTESERVICE_H
45 :
46 : #include "nsString.h"
47 :
48 : #include "nsIRemoteService.h"
49 : #include "nsIObserver.h"
50 : #include <X11/Xlib.h>
51 : #include <X11/X.h>
52 :
53 : class nsIDOMWindow;
54 : class nsIWeakReference;
55 :
56 : /**
57 : Base class for GTK/Qt remote service
58 : */
59 : class nsXRemoteService : public nsIRemoteService,
60 : public nsIObserver
61 0 : {
62 : public:
63 : NS_DECL_NSIOBSERVER
64 :
65 :
66 : protected:
67 : nsXRemoteService();
68 :
69 : static bool HandleNewProperty(Window aWindowId,Display* aDisplay,
70 : Time aEventTime, Atom aChangedAtom,
71 : nsIWeakReference* aDomWindow);
72 :
73 : void XRemoteBaseStartup(const char *aAppName, const char *aProfileName);
74 :
75 : void HandleCommandsFor(Window aWindowId);
76 : static nsXRemoteService *sRemoteImplementation;
77 : private:
78 : void EnsureAtoms();
79 : static const char* HandleCommand(char* aCommand, nsIDOMWindow* aWindow,
80 : PRUint32 aTimestamp);
81 :
82 : static const char* HandleCommandLine(char* aBuffer, nsIDOMWindow* aWindow,
83 : PRUint32 aTimestamp);
84 :
85 : virtual void SetDesktopStartupIDOrTimestamp(const nsACString& aDesktopStartupID,
86 : PRUint32 aTimestamp) = 0;
87 :
88 : nsCString mAppName;
89 : nsCString mProfileName;
90 :
91 : static Atom sMozVersionAtom;
92 : static Atom sMozLockAtom;
93 : static Atom sMozCommandAtom;
94 : static Atom sMozResponseAtom;
95 : static Atom sMozUserAtom;
96 : static Atom sMozProfileAtom;
97 : static Atom sMozProgramAtom;
98 : static Atom sMozCommandLineAtom;
99 : };
100 :
101 : #endif // NSXREMOTESERVICE_H
|