1 : /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* vim:expandtab:shiftwidth=2:tabstop=2:
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 : *
28 : * Alternatively, the contents of this file may be used under the terms of
29 : * either the GNU General Public License Version 2 or later (the "GPL"), or
30 : * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
31 : * in which case the provisions of the GPL or the LGPL are applicable instead
32 : * of those above. If you wish to allow use of your version of this file only
33 : * under the terms of either the GPL or the LGPL, and not to allow others to
34 : * use your version of this file under the terms of the MPL, indicate your
35 : * decision by deleting the provisions above and replace them with the notice
36 : * and other provisions required by the GPL or the LGPL. If you do not delete
37 : * the provisions above, a recipient may use your version of this file under
38 : * the terms of any one of the MPL, the GPL or the LGPL.
39 : *
40 : * ***** END LICENSE BLOCK ***** */
41 :
42 : #ifndef __nsGTKRemoteService_h__
43 : #define __nsGTKRemoteService_h__
44 :
45 : #include <gdk/gdk.h>
46 : #include <gdk/gdkx.h>
47 : #include <gtk/gtk.h>
48 :
49 : #include "nsInterfaceHashtable.h"
50 : #include "nsXRemoteService.h"
51 :
52 : class nsGTKRemoteService : public nsXRemoteService
53 : {
54 : public:
55 : // We will be a static singleton, so don't use the ordinary methods.
56 : NS_DECL_ISUPPORTS
57 : NS_DECL_NSIREMOTESERVICE
58 :
59 :
60 0 : nsGTKRemoteService() :
61 0 : mServerWindow(NULL) { }
62 :
63 : private:
64 0 : ~nsGTKRemoteService() { }
65 :
66 : void HandleCommandsFor(GtkWidget* aWidget,
67 : nsIWeakReference* aWindow);
68 :
69 :
70 : static PLDHashOperator StartupHandler(const void* aKey,
71 : nsIWeakReference* aData,
72 : void* aClosure);
73 :
74 :
75 : static gboolean HandlePropertyChange(GtkWidget *widget,
76 : GdkEventProperty *event,
77 : nsIWeakReference* aThis);
78 :
79 :
80 : virtual void SetDesktopStartupIDOrTimestamp(const nsACString& aDesktopStartupID,
81 : PRUint32 aTimestamp);
82 :
83 : nsInterfaceHashtable<nsVoidPtrHashKey, nsIWeakReference> mWindows;
84 : GtkWidget* mServerWindow;
85 : };
86 :
87 : #endif // __nsGTKRemoteService_h__
|