Compare commits

..

2 Commits

Author SHA1 Message Date
heikki%netscape.com
a637f81f7f new project started
git-svn-id: svn://10.0.0.236/branches/mozilla@91184 18797224-902f-48f8-a5cc-f745e15eee43
2001-04-03 22:13:38 +00:00
(no author)
6cfadae5d1 This commit was manufactured by cvs2svn to create branch 'mozilla'.
git-svn-id: svn://10.0.0.236/branches/mozilla@8534 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-26 18:36:10 +00:00
28 changed files with 89 additions and 2285 deletions

48
mozilla/mozilla.kdevprj Normal file
View File

@@ -0,0 +1,48 @@
# KDE Config File
[mozilla.lsm]
install_location=
dist=true
install=false
type=DATA
[Config for BinMakefileAm]
ldflags=
cxxflags=-O0 -g3 -Wall
bin_program=mozilla
[po/Makefile.am]
sub_dirs=
type=po
[LFV Groups]
Dialogs=*.kdevdlg,
Others=*,
Translations=*.po,
groups=Headers,Sources,Dialogs,Translations,Others,
Sources=*.cpp,*.c,*.cc,*.C,*.cxx,*.ec,*.ecpp,*.lxx,*.l++,*.ll,*.l,
Headers=*.h,*.hh,*.hxx,*.hpp,*.H,
[mozilla.kdevprj]
install_location=
dist=true
install=false
type=DATA
[mozilla/docs/en/Makefile.am]
sub_dirs=
type=normal
[mozilla/Makefile.am]
sub_dirs=
type=prog_main
[General]
makefiles=Makefile.am,mozilla/Makefile.am,mozilla/docs/Makefile.am,mozilla/docs/en/Makefile.am,po/Makefile.am,
version_control=CVS
author=Heikki Toivonen
project_type=normal_empty
sub_dir=mozilla/
version=0.1
project_name=Mozilla
email=heikki@netscape.com
kdevprj_version=1.2
[Makefile.am]
files=mozilla.kdevprj,mozilla.lsm,
sub_dirs=mozilla,
type=normal
[mozilla/docs/Makefile.am]
sub_dirs=
type=normal

14
mozilla/mozilla.lsm Normal file
View File

@@ -0,0 +1,14 @@
Begin3
Title: Mozilla
Version: 0.1
Entered-date:
Description:
Keywords:
Author: Heikki Toivonen <heikki@netscape.com>
Maintained-by: Heikki Toivonen <heikki@netscape.com>
Primary-site:
Home-page: http://
Original-site:
Platforms: Linux and other Unices
Copying-policy: GNU Public License
End

View File

@@ -1,37 +1,20 @@
/* -*- Mode: IDL; tab-width: 4; 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 Communicator client code, released
* March 31, 1998.
*
* 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) 1998-1999 Netscape Communications Corporation. All
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#include "nsISupports.idl"
#include "domstubs.idl"
%{C++
#include "nsIDOMWindow.h"
#include "nsIDOMNode.h"
%}
[scriptable, uuid(0b96297e-2459-11d3-8aad-006008948010)]
interface nsIDOMDataSource : nsISupports {
void setMode(in string mode, in boolean active);
boolean getMode(in string mode);
void setWindow(in nsIDOMWindow window);
};

View File

@@ -0,0 +1,20 @@
/*
* 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) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/

View File

@@ -1,2 +0,0 @@
nsIDOMDataSource.idl
nsIDOMViewerElement.idl

View File

@@ -1,53 +0,0 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = rdfdomds
LIBRARY_NAME = rdfdomds
IS_COMPONENT = 1
DIRS = resources
CPPSRCS = \
nsRDFDOMDataSource.cpp \
nsRDFDOMDataSourceFactory.cpp \
nsRDFDOMResourceFactory.cpp \
nsRDFDOMViewerUtils.cpp \
$(NULL)
XPIDLSRCS = \
nsIDOMDataSource.idl \
nsIDOMViewerElement.idl \
nsIRDFDOMViewerObject.idl \
$(NULL)
EXTRA_DSO_LDOPTS = \
-L$(DIST)/bin \
-L$(DIST)/lib \
-lxpcom \
-lrdfutil_s \
$(NSPR_LIBS) \
$(NULL)
include $(topsrcdir)/config/rules.mk

View File

@@ -1 +0,0 @@
#include "MacPrefix.h"

View File

@@ -1,2 +0,0 @@
#define DEBUG 1
#include "MacPrefix_debug.h"

View File

@@ -1,50 +0,0 @@
#!nmake
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
DEPTH = ..\..\..
include <$(DEPTH)/config/config.mak>
MODULE=rdfdomds
LIBNAME=.\$(OBJDIR)\$(MODULE)
DLL=$(LIBNAME).dll
XPIDLSRCS= .\nsIDOMViewerElement.idl \
.\nsIDOMDataSource.idl \
.\nsIRDFDOMViewerObject.idl \
$(NULL)
DIRS=resources
OBJS= .\$(OBJDIR)\nsRDFDOMDataSource.obj \
.\$(OBJDIR)\nsRDFDOMDataSourceFactory.obj \
.\$(OBJDIR)\nsRDFDOMResourceFactory.obj \
.\$(OBJDIR)\nsRDFDOMViewerUtils.obj \
$(NULL)
LLIBS= \
$(DIST)\lib\rdfutil_s.lib \
$(DIST)\lib\xpcom.lib \
$(LIBNSPR)
include <$(DEPTH)\config\rules.mak>
install:: $(DLL)
$(MAKE_INSTALL) $(LIBNAME).$(DLL_SUFFIX) $(DIST)\bin\components
$(MAKE_INSTALL) $(LIBNAME).$(LIB_SUFFIX) $(DIST)\lib
clobber::
rm -rf $(DIST)\bin\components\$(LIBNAME).$(DLL_SUFFIX)
rm -rf $(DIST)\lib\$(LIBNAME).$(LIB_SUFFIX)

View File

@@ -1,13 +0,0 @@
#include "nsISupports.idl"
#include "domstubs.idl"
%{C++
#include "nsIDOMNode.h"
%}
[scriptable, uuid(2842a0ba-4bd8-11d3-ac84-00a0c900d445)]
interface nsIDOMViewerElement : nsISupports {
attribute nsISupports object;
};

View File

@@ -1,35 +0,0 @@
/* -*- Mode: idl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsISupports.idl"
#include "nsIRDFResource.idl"
%{C++
#include "nsString.h"
%}
[ref] native nsStringRef(nsString);
[scriptable, uuid(1ff615aa-7328-11d3-90a0-00a0c900d445)]
interface nsIRDFDOMViewerObject : nsISupports {
void setTarget(in nsIRDFResource property, in nsIRDFNode value);
[noscript] void setTargetLiteral(in nsIRDFResource property,
in nsStringRef str);
nsIRDFNode getTarget(in nsIRDFResource property);
};

File diff suppressed because it is too large Load Diff

View File

@@ -1,198 +0,0 @@
/* -*- Mode: C++; tab-width: 4; 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 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-1999 Netscape Communications Corporation. All
* Rights Reserved.
*/
#ifndef __nsRDFDOMDataSource_h
#define __nsRDFDOMDataSource_h
#include "nsIRDFDataSource.h"
#include "nsIDOMDataSource.h"
#include "nsIRDFService.h"
#include "nsVoidArray.h"
#include "nsCOMPtr.h"
#include "nsHashtable.h"
#include "nsIDOMDocument.h"
//
#include "nsIDOMNode.h"
#include "nsIContent.h"
#include "nsIStyledContent.h"
#include "nsIDOMCSSRule.h"
#include "nsIDOMCSSStyleRule.h"
#include "nsIDOMHTMLElement.h"
#include "nsICSSStyleRule.h"
#include "nsIStyleRule.h"
#include "nsIFrame.h"
/* {c7cf77e8-245a-11d3-80f0-006008948010} */
#define NS_RDF_DOMDATASOURCE_CID \
{0xc7cf77e8, 0x245a, 0x11d3, \
{0x80, 0xf0, 0x00, 0x60, 0x08, 0x94, 0x80, 0x10}}
class nsRDFDOMDataSource : public nsIRDFDataSource,
public nsIDOMDataSource
{
public:
nsRDFDOMDataSource();
virtual ~nsRDFDOMDataSource();
NS_DECL_ISUPPORTS
NS_DECL_NSIRDFDATASOURCE
NS_DECL_NSIDOMDATASOURCE
static NS_METHOD Create(nsISupports* aOuter,
const nsIID& iid,
void **result);
protected:
char *mURI;
nsIRDFService *getRDFService();
static PRBool assertEnumFunc(void *aElement, void *aData);
static PRBool unassertEnumFunc(void *aElement, void *aData);
nsresult NotifyObservers(nsIRDFResource *subject, nsIRDFResource *property,
nsIRDFNode *object, PRBool assert);
private:
// HTML stuff
nsresult createHTMLElementArcs(nsIDOMHTMLElement *element,
nsISupportsArray *arcs);
nsresult createFrameArcs(nsIFrame *frame,
nsISupportsArray *arcs);
// DOM stuff
nsresult createDOMNodeArcs(nsIDOMNode *node,
nsISupportsArray *arcs);
nsresult createDOMAttributeArcs(nsIDOMNode *node,
nsISupportsArray *arcs);
nsresult createDOMChildArcs(nsIDOMNode *node,
nsISupportsArray *arcs);
nsresult createDOMNodeListArcs(nsIDOMNodeList *nodelist,
nsISupportsArray *arcs);
nsresult createDOMNamedNodeMapArcs(nsIDOMNamedNodeMap *nodelist,
nsISupportsArray *arcs);
nsresult createFrameTarget(nsIFrame *frame,
nsIRDFResource *property,
nsIRDFNode **aResult);
nsresult createDOMNodeTarget(nsIDOMNode *node,
nsIRDFResource *property,
nsIRDFNode **aResult);
// nsIContent stuff
nsresult createContentArcs(nsIContent *content,
nsISupportsArray *arcs);
nsresult createContentChildArcs(nsIContent *content,
nsISupportsArray *arcs);
nsresult createContentAttributeArcs(nsIContent *content,
nsISupportsArray *arcs);
nsresult createContentMiscArcs(nsIContent* content,
nsISupportsArray *arcs);
nsresult createContentTarget(nsIContent *content,
nsIRDFResource *property,
nsIRDFNode **aResult);
// nsIStyledContent stuff
nsresult createStyledContentArcs(nsIStyledContent *content,
nsISupportsArray *arcs);
nsresult createStyledContentClassArcs(nsIStyledContent *content,
nsISupportsArray *arcs);
nsresult createStyledContentTarget(nsIStyledContent *content,
nsIRDFResource *property,
nsIRDFNode **aResult);
// nsIDOMCSSStyleDeclaration
nsresult getDOMCSSStyleDeclTarget(nsIDOMCSSStyleDeclaration *decl,
nsIRDFResource *property,
nsIRDFNode **aResult);
// nsIDOMCSSStyleRule
// nsIDOMCSSRule
nsresult getDOMCSSStyleRuleTarget(nsIDOMCSSStyleRule *rule,
nsIRDFResource *property,
nsIRDFNode **result);
nsresult getDOMCSSRuleTarget(nsIDOMCSSRule *rule,
nsIRDFResource *property,
nsIRDFNode **result);
// nsICSSStyleRule
// nsICSSRule
// nsIStyleRule
nsresult getCSSStyleRuleTarget(nsICSSStyleRule *rule,
nsIRDFResource *property,
nsIRDFNode **result);
nsresult getCSSRuleTarget(nsICSSRule *rule,
nsIRDFResource *property,
nsIRDFNode **result);
nsresult getStyleRuleTarget(nsIStyleRule *rule,
nsIRDFResource *property,
nsIRDFNode **result);
// helper routines
nsresult createArcsFromSupportsArray(nsISupportsArray *rules,
nsISupportsArray *arcs);
nsresult getResourceForObject(nsISupports *object,
nsIRDFResource **resource);
nsresult appendLeafObject(nsString& name,
nsString& value,
nsISupportsArray *arcs);
nsresult getTargetForKnownObject(nsISupports *object,
nsIRDFResource* aProperty,
nsIRDFNode **result);
nsresult getTargetsForKnownObject(nsISupports *object,
nsIRDFResource *aProperty,
PRBool useDOM,
nsISupportsArray *arcs);
nsresult createLiteral(nsString& str, nsIRDFNode **result);
// member variables
PRBool init;
nsIRDFService *mRDFService;
PRInt32 mMode;
nsVoidArray *mObservers;
nsSupportsHashtable objectTable;
nsHashtable mModeTable;
nsCOMPtr<nsIDOMDocument> mDocument;
nsIFrame *mRootFrame;
nsIRDFResource* kNC_Name;
nsIRDFResource* kNC_Value;
nsIRDFResource* kNC_Type;
nsIRDFResource* kNC_Child;
nsIRDFResource* kNC_DOMRoot;
};
#endif

View File

@@ -1,101 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsIGenericFactory.h"
#include "nsRDFDOMDataSource.h"
#include "nsRDFDOMResourceFactory.h"
#include "nsIComponentManager.h"
#include "nsIServiceManager.h"
#include "rdf.h"
#ifdef NS_DEBUG
#include <stdio.h>
#endif
static NS_DEFINE_CID(kRDFDOMDataSourceCID, NS_RDF_DOMDATASOURCE_CID);
static NS_DEFINE_CID(kRDFDOMResourceFactoryCID, NS_RDF_DOMRESOURCEFACTORY_CID);
static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
// return the proper factory to the caller
extern "C" PR_IMPLEMENT(nsresult)
NSGetFactory(nsISupports* aServMgr,
const nsCID &aClass,
const char* aClassName,
const char* aProgID,
nsIFactory **aFactory)
{
nsresult rv=NS_OK;
nsIGenericFactory* fact;
if (aClass.Equals(kRDFDOMDataSourceCID)) {
rv = NS_NewGenericFactory(&fact, nsRDFDOMDataSource::Create);
printf("Creating datasource: %s\n", NS_SUCCEEDED(rv) ? "succeed" : "failed");
} else
if (aClass.Equals(kRDFDOMResourceFactoryCID)) {
rv = NS_NewGenericFactory(&fact, nsRDFDOMViewerElement::Create);
printf("Creating resource: %s\n", NS_SUCCEEDED(rv) ? "succeed" : "failed");
}
else
rv = NS_ERROR_FAILURE;
if (NS_SUCCEEDED(rv))
*aFactory = fact;
#ifdef DEBUG_alecf
printf("nsRDFDOMDataSource's NSGetFactory!\n");
#endif
return rv;
}
extern "C" PR_IMPLEMENT(nsresult)
NSRegisterSelf(nsISupports* aServMgr, const char* aPath)
{
nsresult rv;
NS_WITH_SERVICE1(nsIComponentManager,
compMgr,
aServMgr,
kComponentManagerCID,
&rv);
if (NS_FAILED(rv)) return rv;
printf("Registering DOM Viewer\n");
rv = compMgr->RegisterComponent(kRDFDOMDataSourceCID,
"Generic DataSource DataSource",
NS_RDF_DATASOURCE_PROGID_PREFIX "domds",
aPath, PR_TRUE, PR_TRUE);
rv = compMgr->RegisterComponent(kRDFDOMResourceFactoryCID,
"DOM element resource factory",
NS_RDF_RESOURCE_FACTORY_PROGID_PREFIX "object",
aPath, PR_TRUE, PR_TRUE);
return rv;
}
extern "C" PR_IMPLEMENT(nsresult)
NSUnregisterSelf(nsISupports* aServMgr, const char* aPath)
{
nsresult rv;
NS_WITH_SERVICE1(nsIComponentManager, compMgr,
aServMgr, kComponentManagerCID, &rv);
if (NS_FAILED(rv)) return rv;
rv = compMgr->UnregisterComponent(kRDFDOMDataSourceCID, aPath);
rv = compMgr->UnregisterComponent(kRDFDOMResourceFactoryCID, aPath);
return rv;
}

View File

@@ -1,63 +0,0 @@
/* -*- Mode: C++; tab-width: 4; 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 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-1999 Netscape Communications Corporation. All
* Rights Reserved.
*/
#include "nsRDFDOMResourceFactory.h"
nsRDFDOMViewerElement::nsRDFDOMViewerElement()
{
}
nsRDFDOMViewerElement::~nsRDFDOMViewerElement()
{
}
NS_IMPL_ISUPPORTS_INHERITED(nsRDFDOMViewerElement, nsRDFResource, nsIDOMViewerElement)
NS_IMETHODIMP
nsRDFDOMViewerElement::SetObject(nsISupports* object)
{
mObject = do_QueryInterface(object);
return NS_OK;
}
NS_IMETHODIMP
nsRDFDOMViewerElement::GetObject(nsISupports** object)
{
if (!object) return NS_ERROR_NULL_POINTER;
*object = mObject;
NS_IF_ADDREF(*object);
return NS_OK;
}
NS_METHOD
nsRDFDOMViewerElement::Create(nsISupports* aOuter,
const nsIID& iid,
void **result) {
nsRDFDOMViewerElement* ve = new nsRDFDOMViewerElement();
if (!ve) return NS_ERROR_NULL_POINTER;
NS_ADDREF(ve);
nsresult rv = ve->QueryInterface(iid, result);
NS_RELEASE(ve);
return rv;
}

View File

@@ -1,57 +0,0 @@
/* -*- Mode: C++; tab-width: 4; 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 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-1999 Netscape Communications Corporation. All
* Rights Reserved.
*/
#ifndef __nsRDFDOMResourceFactory_h
#define __nsRDFDOMResourceFactory_h
#include "nsIRDFService.h"
#include "nscore.h"
#include "nsCOMPtr.h"
#include "nsWeakPtr.h"
#include "rdf.h"
#include "nsRDFResource.h"
#include "nsIDOMViewerElement.h"
class nsRDFDOMViewerElement : nsRDFResource,
nsIDOMViewerElement
{
public:
nsRDFDOMViewerElement();
virtual ~nsRDFDOMViewerElement();
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIDOMVIEWERELEMENT
static NS_METHOD
Create(nsISupports* aOuter,const nsIID& iid, void **result);
private:
//nsWeakPtr mObject;
nsCOMPtr<nsISupports> mObject;
};
/* {84a87046-57f4-11d3-9061-00a0c900d445} */
#define NS_RDF_DOMRESOURCEFACTORY_CID \
{0x84a87046, 0x57f4, 0x11d3, \
{ 0x90, 0x61, 0x0, 0xa0, 0xc9, 0x0, 0xd4, 0x45 }}
#endif

View File

@@ -1,83 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "rdf.h"
#include "nsIRDFService.h"
#include "nsRDFDOMViewerUtils.h"
#include "nsIServiceManager.h"
#include "nsCOMPtr.h"
nsDOMViewerObject::nsDOMViewerObject() {}
nsDOMViewerObject::~nsDOMViewerObject()
{
targets.Reset();
}
NS_IMPL_ISUPPORTS1(nsDOMViewerObject,
nsIRDFDOMViewerObject)
NS_IMETHODIMP
nsDOMViewerObject::SetTarget(nsIRDFResource *aProperty,
nsIRDFNode *aValue)
{
nsISupportsKey propKey(aProperty);
targets.Put(&propKey, (void *)aValue);
return NS_OK;
}
NS_IMETHODIMP
nsDOMViewerObject::SetTargetLiteral(nsIRDFResource *aProperty,
nsString& str)
{
nsresult rv;
NS_WITH_SERVICE(nsIRDFService, rdf, NS_RDF_PROGID "/rdf-service", &rv);
PRUnichar* uniStr = str.ToNewUnicode();
nsCOMPtr<nsIRDFLiteral> literal;
rv = rdf->GetLiteral(uniStr, getter_AddRefs(literal));
nsAllocator::Free(uniStr);
SetTarget(aProperty, literal);
return NS_OK;
}
nsresult
nsDOMViewerObject::GetTarget(nsIRDFResource *aProperty,
nsIRDFNode **aValue)
{
nsISupportsKey propKey(aProperty);
*aValue = (nsIRDFResource*)targets.Get(&propKey);
return NS_OK;
}
nsresult
NS_NewDOMViewerObject(const nsIID& iid, void ** aResult) {
nsresult rv;
nsDOMViewerObject* obj = new nsDOMViewerObject;
NS_ADDREF(obj);
rv = obj->QueryInterface(iid, aResult);
NS_RELEASE(obj);
return rv;
}

View File

@@ -1,39 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/* a really lame-ass last resort for putting objects in the tree
* use only if there really is no object */
#include "nsIRDFDOMViewerObject.h"
#include "nsHashtable.h"
class nsDOMViewerObject : nsIRDFDOMViewerObject {
public:
nsDOMViewerObject();
virtual ~nsDOMViewerObject();
NS_DECL_ISUPPORTS
NS_DECL_NSIRDFDOMVIEWEROBJECT
private:
nsSupportsHashtable targets;
};
nsresult
NS_NewDOMViewerObject(const nsIID& iid, void ** result);

View File

@@ -1,42 +0,0 @@
treeitem[Type="1"] {
color: green;
}
treeitem[Type="2"] {
color: red;
}
treeitem[Type="3"] {
color: blue;
}
treeitem[Type="leaf"] {
color: black;
}
treeitem[Type~="content"] {
color: green;
font-style: italic;
}
treeitem[Type="contentAttribute"] {
color: red;
font-style: italic;
}
treeitem[Type="contentStyleRule"] {
color: orange;
font-style: italic;
}
treeitem[Type="style"] {
color: brown;
font-style: italic;
}
treeitem[Type="contentMisc"] {
color:black;
font-style: italic;
}

View File

@@ -1,61 +0,0 @@
/* -*- Mode: C++; tab-width: 4; 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 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-1999 Netscape Communications Corporation. All
* Rights Reserved.
*/
var RDF = Components.classes['component://netscape/rdf/rdf-service'].getService();
RDF = RDF.QueryInterface(Components.interfaces.nsIRDFService);
var domds;
function loadUrl() {
var urlwidget = document.getElementById("url");
if (!urlwidget)
url = "resource:/res/samples/rdf/domviewer.html";
else
url = urlwidget.value;
dump("Loading " + url + " into " + parent.window.frames["srcdoc"] +"\n");
var win = window.frames["srcdoc"];
win.location=url;
}
function setMode(mode, active) {
domds.setMode(mode, active);
}
function refreshTree() {
dump("refresh..\n");
var win = window.frames["srcdoc"];
domds.setWindow(win);
var tree = document.getElementById("dataSourceTree");
tree.clearItemSelection();
tree.setAttribute("ref","NC:DOMRoot");
}
function onSrcLoaded() {
var ds = RDF.GetDataSource("rdf:domds");
domds = ds.QueryInterface(Components.interfaces.nsIDOMDataSource);
}

View File

@@ -1,67 +0,0 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="DOMDataSourceViewer.css" type="text/css"?>
<window
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="onSrcLoaded();"
alignment="horizontal"
title="DOM Viewer">
<html:script language="JavaScript" src="DOMDataSourceViewer.js"/>
<box align="vertical" flex="30%">
<html:input value="resource:/res/samples/rdf/domviewer.html" type="text" name="url" id="url" onkeyup="if (event.which == 13) loadUrl();"/>
<html:div>
Show:
<html:input type="checkbox" onclick="setMode('content', !event.target.checked);"/>
Content
<html:input type="checkbox" onclick="setMode('dom', !event.target.checked);"/>
DOM
<html:input type="checkbox" onclick="setMode('frame', !event.target.checked);"/> Frames
<html:input type="checkbox" onclick="setMode('leaf', !event.target.checked);"/>
OOB data
</html:div>
<box align="horizontal">
<titledbutton onclick="loadUrl();" value="Load"/>
<titledbutton onclick="refreshTree();" value="Refresh"/>
</box>
<html:div flex="100%">
<tree style="height:100%"
rdf:datasources="rdf:domds"
id="dataSourceTree">
<template>
<rule>
<treechildren>
<treeitem uri="..."
Type="rdf:http://home.netscape.com/NC-rdf#Type">
<treerow>
<treecell indent="true" value="rdf:http://home.netscape.com/NC-rdf#Name"/>
<treecell value="rdf:http://home.netscape.com/NC-rdf#Value"/>
</treerow>
</treeitem>
</treechildren>
</rule>
<treechildren>
<treeitem id="NC:DOMRoot"/>
</treechildren>
</template>
<treecol style="width: 50%" id="NameColumn" rdf:resource="http://home.netscape.com/NC-rdf#Name"/>
<treecol style="width: 50%" id="ValueColumn" rdf:resource="http://home.netscape.com/NC-rdf#Value"/>
<treehead>
<treerow>
<treecell value="Name"/>
<treecell value="Value"/>
</treerow>
</treehead>
</tree>
</html:div>
</box>
<splitter collapse="before" persist="state hidden" chromeclass="extrachrome"/>
<html:iframe onload="onSrcLoaded();" name="srcdoc" src="resource:/res/samples/rdf/domviewer.html" flex="73%"/>
</window>

View File

@@ -1,11 +0,0 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="DOMDataSourceViewer.css" type="text/css"?>
<!DOCTYPE window>
<window
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
</window>

View File

@@ -1,5 +0,0 @@
DOMDataSourceViewer.xul
DOMDataSourceViewer.css
DOMTree.xul
domviewer.html
DOMDataSourceViewer.js

View File

@@ -1,43 +0,0 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
DEPTH = ../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = rdfdomds
SAMPLES_DIR = $(DIST)/bin/res/samples/rdf
RESOURCE_SAMPLES = \
DOMDataSourceViewer.xul \
DOMDataSourceViewer.css \
DOMDataSourceViewer.js \
DOMTree.xul \
domviewer.html \
$(NULL)
include $(topsrcdir)/config/rules.mk
GARBAGE += $(addprefix $(SAMPLES_DIR)/, $(RESOURCE_SAMPLES))
install::
$(INSTALL) $(addprefix $(srcdir)/,$(RESOURCE_SAMPLES)) $(SAMPLES_DIR)

View File

@@ -1,21 +0,0 @@
<html>
<title>How to use the DOM Viewer</title>
<body>
<h2>
How to use the DOM Viewer
</h2>
<hr>
<p>
click the <b>Refresh</b> button to view the dom for the page loaded in this frame.
</p>
<b>(try it now on this page!)</b></p>
<p>
to load a new page, enter it in the text area. hit enter or click the <b>Load</b> button.</p>
<p>
Then browse the DOM!</p>
<p>questions / comments to <a href=mailto:alecf@netscape.com>alecf</a><p>
</body>
</html>

View File

@@ -1,37 +0,0 @@
#!nmake
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
DEPTH=..\..\..\..
MODULE=rdfdomds
SAMPLES_DIR = $(DIST)/bin/res/samples/rdf
include <$(DEPTH)\config\rules.mak>
install::
$(MAKE_INSTALL) DOMDataSourceViewer.css $(SAMPLES_DIR)
$(MAKE_INSTALL) DOMDataSourceViewer.js $(SAMPLES_DIR)
$(MAKE_INSTALL) DOMDataSourceViewer.xul $(SAMPLES_DIR)
$(MAKE_INSTALL) DOMTree.xul $(SAMPLES_DIR)
$(MAKE_INSTALL) domviewer.html $(SAMPLES_DIR)
clobber::
rm -f $(SAMPLES_DIR)\DOMDataSourceViewer.css
rm -f $(SAMPLES_DIR)\DOMDataSourceViewer.js
rm -f $(SAMPLES_DIR)\DOMDataSourceViewer.xul
rm -f $(SAMPLES_DIR)\DOMTree.xul
rm -f $(SAMPLES_DIR)\domviewer.html