From 08024cb1ff10f72fa952b7cf5056ca3c941ce6ec Mon Sep 17 00:00:00 2001 From: "sspitzer%netscape.com" Date: Tue, 8 Feb 2000 07:32:20 +0000 Subject: [PATCH] adding new files and makefiles. implementing a stub for the remote controller in JS. not part of the build yet. --- xpfe/components/remote/.cvsignore | 1 + xpfe/components/remote/public/.cvsignore | 1 + .../remote/public/nsIRemoteBrowserControl.idl | 20 +--- xpfe/components/remote/src/.cvsignore | 1 + .../components/remote/src/MANIFEST_COMPONENTS | 1 + xpfe/components/remote/src/Makefile.in | 32 ++++++ xpfe/components/remote/src/makefile.win | 27 +++++ xpfe/components/remote/src/remoteControl.js | 102 ++++++++++++++++++ 8 files changed, 170 insertions(+), 15 deletions(-) create mode 100644 xpfe/components/remote/.cvsignore create mode 100644 xpfe/components/remote/public/.cvsignore create mode 100644 xpfe/components/remote/src/.cvsignore create mode 100644 xpfe/components/remote/src/MANIFEST_COMPONENTS create mode 100644 xpfe/components/remote/src/Makefile.in create mode 100644 xpfe/components/remote/src/makefile.win create mode 100644 xpfe/components/remote/src/remoteControl.js diff --git a/xpfe/components/remote/.cvsignore b/xpfe/components/remote/.cvsignore new file mode 100644 index 000000000000..f3c7a7c5da68 --- /dev/null +++ b/xpfe/components/remote/.cvsignore @@ -0,0 +1 @@ +Makefile diff --git a/xpfe/components/remote/public/.cvsignore b/xpfe/components/remote/public/.cvsignore new file mode 100644 index 000000000000..f3c7a7c5da68 --- /dev/null +++ b/xpfe/components/remote/public/.cvsignore @@ -0,0 +1 @@ +Makefile diff --git a/xpfe/components/remote/public/nsIRemoteBrowserControl.idl b/xpfe/components/remote/public/nsIRemoteBrowserControl.idl index 429ff21403e5..f415ec896464 100644 --- a/xpfe/components/remote/public/nsIRemoteBrowserControl.idl +++ b/xpfe/components/remote/public/nsIRemoteBrowserControl.idl @@ -1,3 +1,4 @@ +/* * -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- * * The contents of this file are subject to the Netscape Public @@ -18,21 +19,14 @@ * Rights Reserved. * * Contributor(s): + * Shane Culpepper */ -/* - - The interface to the Remote Browser Component. - -*/ +/* The interface to the Remote Browser Component. */ #include "nsISupports.idl" -%{ C++ -#include "nscore.h" // for PRUnichar -%} - -[scriptable, uuid(BCE83AE2-1DD1-11B2-BC0E-A9E997E21AD2)] +[scriptable, uuid(048afcc8-1dd2-11b2-bd86-a45b24375deb)] interface nsIRemoteBrowserControl : nsISupports { @@ -72,11 +66,7 @@ interface nsIRemoteBrowserControl : nsISupports }; -%{ C++ -/* {BCE83AE2-1DD1-11B2-BC0E-A9E997E21AD2} */ -#define NS_REMOTEBROWSERCONTROL_CID \ -{ 0xbce83ae2, 0x1dd1, 0x11b2, { 0xbc, 0x0e, 0xa9, 0xe9, 0x97, 0xe2, 0x1a, 0xd2} } - +%{C++ #define NS_REMOTEBROWSERCONTROL_PROGID \ "component://netscape/browser/remote-browser-control" %} diff --git a/xpfe/components/remote/src/.cvsignore b/xpfe/components/remote/src/.cvsignore new file mode 100644 index 000000000000..f3c7a7c5da68 --- /dev/null +++ b/xpfe/components/remote/src/.cvsignore @@ -0,0 +1 @@ +Makefile diff --git a/xpfe/components/remote/src/MANIFEST_COMPONENTS b/xpfe/components/remote/src/MANIFEST_COMPONENTS new file mode 100644 index 000000000000..1edd55ade3a2 --- /dev/null +++ b/xpfe/components/remote/src/MANIFEST_COMPONENTS @@ -0,0 +1 @@ +remoteControl.js diff --git a/xpfe/components/remote/src/Makefile.in b/xpfe/components/remote/src/Makefile.in new file mode 100644 index 000000000000..68c57b6028e2 --- /dev/null +++ b/xpfe/components/remote/src/Makefile.in @@ -0,0 +1,32 @@ +# +# The contents of this file are subject to the Netscape Public +# License Version 1.1 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.mozilla.org/NPL/ +# +# Software distributed under the License is distributed on an "AS +# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +# implied. See the License for the specific language governing +# rights and limitations under the License. +# +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is Netscape +# Communications Corporation. Portions created by Netscape are +# Copyright (C) 1998 Netscape Communications Corporation. All +# Rights Reserved. +# +# Contributor(s): +# + +DEPTH = ../../../.. +topsrcdir = @top_srcdir@ +srcdir = @srcdir@ +VPATH = @srcdir@ + +include $(DEPTH)/config/autoconf.mk + +install:: + $(INSTALL) remoteControl.js $(DIST)/bin/components + +include $(topsrcdir)/config/rules.mk diff --git a/xpfe/components/remote/src/makefile.win b/xpfe/components/remote/src/makefile.win new file mode 100644 index 000000000000..af657d57897c --- /dev/null +++ b/xpfe/components/remote/src/makefile.win @@ -0,0 +1,27 @@ +# +# The contents of this file are subject to the Netscape Public +# License Version 1.1 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.mozilla.org/NPL/ +# +# Software distributed under the License is distributed on an "AS +# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +# implied. See the License for the specific language governing +# rights and limitations under the License. +# +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is Netscape +# Communications Corporation. Portions created by Netscape are +# Copyright (C) 1998 Netscape Communications Corporation. All +# Rights Reserved. +# +# Contributor(s): +# + +DEPTH=..\..\..\.. + +include <$(DEPTH)\config\rules.mak> + +install:: + $(MAKE_INSTALL) remoteControl.js $(DIST)\bin\components diff --git a/xpfe/components/remote/src/remoteControl.js b/xpfe/components/remote/src/remoteControl.js new file mode 100644 index 000000000000..edd1aa17eae6 --- /dev/null +++ b/xpfe/components/remote/src/remoteControl.js @@ -0,0 +1,102 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Seth Spitzer + */ + +var remoteControlProgID = "component://netscape/browser/remote-browser-control" + +var nsIRemoteBrowserControl = Components.interfaces.nsIRemoteBrowserControl; + +function BrowserRemoteControl() { + return browserRemoteControl; +} + +// We need to implement nsIRemoteBrowserControl + +var browserRemoteControl = { + openURL: function(aURL, newWindow) + { + dump("openURL(" + aURL + "," + newWindow + "\n"); + } + + openFile: function(aURL) + { + dump("openFile(" + aURL+ "\n"); + } + + saveAs: function(aURL) + { + dump("saveAs(" + aURL + "\n"); + } + + mailto: function(mailToList) + { + dump("mailto(" + mailToList + "\n"); + } + + addBookmark(aURL, aTitle) + { + dump("addBookmark(" + aURL + "," + aTitle + "\n"); + } +}; + +var module = { + registerSelf: function (compMgr, fileSpec, location, type) { + dump("registerSelf for remoteControl\n"); + compMgr.registerComponentWithType(this.myCID, + "Browser Remote Control", + remoteControlProgID + fileSpec, location, true, true, + type); + }, + + getClassObject: function (compMgr, cid, iid) { + if (!cid.equals(this.myCID)) + throw Components.results.NS_ERROR_NO_INTERFACE; + + if (!iid.equals(Components.interfaces.nsIFactory)) + throw Components.results.NS_ERROR_NOT_IMPLEMENTED; + + return this.myFactory; + }, + + canUnload: function () { + }, + + myCID: Components.ID("{97c8d0de-1dd1-11b2-bc64-86a3aaf8f5c5}"), + + myFactory: { + CreateInstance: function (outer, iid) { + if (outer != null) + throw Components.results.NS_ERROR_NO_AGGREGATION; + + if (!(iid.equals(nsIRemoteBrowserControl) || + iid.equals(Components.interfaces.nsISupports))) { + throw Components.results.NS_ERROR_INVALID_ARG; + } + + return new BrowserRemoteControl(); + } + } +}; + +function NSGetModule(compMgr, fileSpec) { return module; }