separating jsconsole into its own component. r=damn/sr=hyatt bug#73127.

This commit is contained in:
pinkerton%netscape.com 2001-05-10 03:12:59 +00:00
parent 3c220edb7c
commit 8bcd5a8be5
13 changed files with 348 additions and 0 deletions

View File

@ -738,6 +738,7 @@ sub BuildClientDist()
InstallFromManifest(":mozilla:embedding:base:MANIFEST_IDL", "$distdirectory:idl:");
InstallFromManifest(":mozilla:embedding:browser:webbrowser:MANIFEST_IDL", "$distdirectory:idl:");
InstallFromManifest(":mozilla:embedding:components:windowwatcher:public:MANIFEST_IDL", "$distdirectory:idl:");
InstallFromManifest(":mozilla:embedding:components:jsconsole:public:MANIFEST_IDL", "$distdirectory:idl:");
InstallFromManifest(":mozilla:embedding:components:appstartup:src:MANIFEST", "$distdirectory:embedding:components:");
InstallFromManifest(":mozilla:embedding:components:find:public:MANIFEST_IDL", "$distdirectory:idl:");

View File

@ -0,0 +1,29 @@
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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, Inc. Portions created by Netscape are
# Copyright (C) 2001, Mozilla. All Rights Reserved.
#
# Contributor(s):
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = public src
include $(topsrcdir)/config/rules.mk

View File

@ -0,0 +1,25 @@
#!nmake
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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, Inc. Portions created by Netscape are
# Copyright (C) 2001, Mozilla. All Rights Reserved.
#
# Contributor(s):
DEPTH=..\..\..
DIRS=public src
include <$(DEPTH)\config\rules.mak>

View File

@ -0,0 +1 @@
nsIJSConsoleService.idl

View File

@ -0,0 +1,36 @@
#
# 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) 2001 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
DEPTH = ../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = jsconsole
XPIDL_MODULE = jsconsole
XPIDLSRCS = nsIJSConsoleService.idl \
$(NULL)
include $(topsrcdir)/config/rules.mk

View File

@ -0,0 +1,30 @@
#!nmake
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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, Inc. Portions created by Netscape are
# Copyright (C) 2001, Mozilla. All Rights Reserved.
#
# Contributor(s):
DEPTH=..\..\..\..
MODULE=jsconsole
XPIDLSRCS = \
.\nsIJSConsoleService.idl \
$(NULL)
include <$(DEPTH)\config\rules.mak>

View File

@ -0,0 +1,41 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* 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) 2001 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
//
// nsIJSConsoleService
//
// This is the interface to the embeddable JS console service. We
// separate it out so that embedding clients can override the factory
// if they want to handle it themselves.
//
#include "nsISupports.idl"
interface nsIDOMWindow;
[scriptable, uuid(1b86a0a6-1dd2-11b2-a85c-e3f42b4dcceb)]
interface nsIJSConsoleService : nsISupports
{
// opens up a JS console with the given parent window
void open ( in nsIDOMWindow inParent ) ;
};

View File

@ -0,0 +1,40 @@
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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, Inc. Portions created by Netscape are
# Copyright (C) 2001, Mozilla. All Rights Reserved.
#
# Contributor(s):
DEPTH = ../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = embedcomponents
LIBRARY_NAME = jsconsole_s
REQUIRES = xpcom string dom windowwatcher widget js xpconnect caps layout uriloader necko docshell locale webbrwsr embed_base gfx2 wallet intl appshell
CPPSRCS = nsJSConsoleService.cpp \
$(NULL)
# we don't want the shared lib, but we want to force the creation of a
# static lib.
override NO_SHARED_LIB=1
override NO_STATIC_LIB=
include $(topsrcdir)/config/rules.mk

View File

@ -0,0 +1,36 @@
#!nmake
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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, Inc. Portions created by Netscape are
# Copyright (C) 2001, Mozilla. All Rights Reserved.
#
# Contributor(s):
DEPTH=..\..\..\..
MODULE=embedcomponents
LIBRARY_NAME=jsconsole_s
CPP_OBJS= \
.\$(OBJDIR)\nsJSConsoleService.obj \
$(NULL)
include <$(DEPTH)\config\rules.mak>
install:: $(LIBRARY)
$(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib
clobber::
rm -f $(DIST)\lib\$(LIBRARY_NAME).lib

View File

@ -0,0 +1,59 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* 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) 2001 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#include "nsJSConsoleService.h"
#include "jsapi.h"
#include "nsIDOMWindow.h"
#include "nsIWindowWatcher.h"
#include "nsIServiceManager.h"
#include "nsCOMPtr.h"
static const char console_chrome_url[] = "chrome://global/content/console.xul";
static const char console_window_options[] = "dialog=no,close,chrome,menubar,toolbar,resizable";
NS_IMPL_ISUPPORTS1(nsJSConsoleService, nsIJSConsoleService)
nsJSConsoleService::nsJSConsoleService()
{
NS_INIT_REFCNT();
}
nsJSConsoleService::~nsJSConsoleService()
{
}
NS_IMETHODIMP
nsJSConsoleService :: Open ( nsIDOMWindow *inParent )
{
nsCOMPtr<nsIWindowWatcher> wwatch(do_GetService("@mozilla.org/embedcomp/window-watcher;1"));
if (!wwatch)
return NS_ERROR_FAILURE;
nsCOMPtr<nsIDOMWindow> consoleWindow;
return wwatch->OpenWindow(inParent, console_chrome_url, "_blank", console_window_options,
nsnull, getter_AddRefs(consoleWindow));
}

View File

@ -0,0 +1,50 @@
/* -*- 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.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 2001 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#ifndef __nsJSConsoleService_h
#define __nsJSConsoleService_h
// {35807600-35bd-11d5-bb6f-b9f2e9fee03c}
#define NS_JSCONSOLESERVICE_CID \
{ 0x35807600, 0x35bd, 0x11d5, {0xbb, 0x6f, 0xb9, 0xf2, 0xe9, 0xfe, 0xe0, 0x3c}}
#define NS_JSCONSOLESERVICE_CONTRACTID \
"@mozilla.org/embedcomp/jsconsole-service;1"
#include "nsIJSConsoleService.h"
class nsIDOMWindow;
class nsJSConsoleService: public nsIJSConsoleService
{
public:
nsJSConsoleService();
virtual ~nsJSConsoleService();
NS_DECL_NSIJSCONSOLESERVICE
NS_DECL_ISUPPORTS
};
#endif