From df7e36611d6a4d5954d2afdfda97ff00ba8f9bcd Mon Sep 17 00:00:00 2001 From: vidur Date: Fri, 3 Jul 1998 00:50:16 +0000 Subject: [PATCH] Moved core DOM interfaces to coreDom directory --- dom/public/idl/coreDom/AttributeList.idl | 9 +++ dom/public/idl/coreDom/Comment.idl | 4 ++ dom/public/idl/coreDom/DOM.idl | 4 ++ dom/public/idl/coreDom/Document.idl | 17 ++++++ dom/public/idl/coreDom/DocumentContext.idl | 3 + dom/public/idl/coreDom/DocumentFragment.idl | 3 + dom/public/idl/coreDom/Element.idl | 14 +++++ dom/public/idl/coreDom/Node.idl | 25 +++++++++ dom/public/idl/coreDom/NodeIterator.idl | 9 +++ dom/public/idl/coreDom/PI.idl | 4 ++ dom/public/idl/coreDom/Text.idl | 14 +++++ dom/public/idl/coreDom/TreeIterator.idl | 11 ++++ dom/public/idl/coreDom/makefile.win | 61 +++++++++++++++++++++ dom/public/idl/makefile.win | 4 +- 14 files changed, 180 insertions(+), 2 deletions(-) create mode 100644 dom/public/idl/coreDom/AttributeList.idl create mode 100644 dom/public/idl/coreDom/Comment.idl create mode 100644 dom/public/idl/coreDom/DOM.idl create mode 100644 dom/public/idl/coreDom/Document.idl create mode 100644 dom/public/idl/coreDom/DocumentContext.idl create mode 100644 dom/public/idl/coreDom/DocumentFragment.idl create mode 100644 dom/public/idl/coreDom/Element.idl create mode 100644 dom/public/idl/coreDom/Node.idl create mode 100644 dom/public/idl/coreDom/NodeIterator.idl create mode 100644 dom/public/idl/coreDom/PI.idl create mode 100644 dom/public/idl/coreDom/Text.idl create mode 100644 dom/public/idl/coreDom/TreeIterator.idl create mode 100644 dom/public/idl/coreDom/makefile.win diff --git a/dom/public/idl/coreDom/AttributeList.idl b/dom/public/idl/coreDom/AttributeList.idl new file mode 100644 index 000000000000..0a7c287389f3 --- /dev/null +++ b/dom/public/idl/coreDom/AttributeList.idl @@ -0,0 +1,9 @@ + interface AttributeList { + Attribute getAttribute(in wstring attrName); + void setAttribute(in Attribute attr); + Attribute remove(in wstring attrName) interface NoSuchAttributeException {}; + + Attribute item(in unsigned long index) interface NoSuchAttributeException {}; + + unsigned long getLength(); + }; diff --git a/dom/public/idl/coreDom/Comment.idl b/dom/public/idl/coreDom/Comment.idl new file mode 100644 index 000000000000..8461cc73873f --- /dev/null +++ b/dom/public/idl/coreDom/Comment.idl @@ -0,0 +1,4 @@ + interface Comment : Node { + attribute wstring data; + }; + diff --git a/dom/public/idl/coreDom/DOM.idl b/dom/public/idl/coreDom/DOM.idl new file mode 100644 index 000000000000..881f552e3695 --- /dev/null +++ b/dom/public/idl/coreDom/DOM.idl @@ -0,0 +1,4 @@ +interface DOM { + Document createDocument(in wstring type); + boolean hasFeature(in wstring feature); + }; diff --git a/dom/public/idl/coreDom/Document.idl b/dom/public/idl/coreDom/Document.idl new file mode 100644 index 000000000000..978b2d1d536e --- /dev/null +++ b/dom/public/idl/coreDom/Document.idl @@ -0,0 +1,17 @@ + interface Document : DocumentFragment { + attribute Node documentType; + attribute Element documentElement; + attribute DocumentContext documentContext; + DocumentContext createDocumentContext(); + Element createElement(in wstring tagName, + in AttributeList attributes); + Text createTextNode(in wstring data); + Comment createComment(in wstring data); + PI createPI(in wstring name, + in wstring data); + Attribute createAttribute(in wstring name, + in Node value); + AttributeList createAttributeList(); + TreeIterator createTreeIterator(in Node node); + NodeIterator getElementsByTagName(in wstring tagname); + }; diff --git a/dom/public/idl/coreDom/DocumentContext.idl b/dom/public/idl/coreDom/DocumentContext.idl new file mode 100644 index 000000000000..1f14f9e17c22 --- /dev/null +++ b/dom/public/idl/coreDom/DocumentContext.idl @@ -0,0 +1,3 @@ + interface DocumentContext { + attribute Document document; + }; diff --git a/dom/public/idl/coreDom/DocumentFragment.idl b/dom/public/idl/coreDom/DocumentFragment.idl new file mode 100644 index 000000000000..9a6e76176bda --- /dev/null +++ b/dom/public/idl/coreDom/DocumentFragment.idl @@ -0,0 +1,3 @@ + interface DocumentFragment : Node { + attribute Document masterDoc; + }; diff --git a/dom/public/idl/coreDom/Element.idl b/dom/public/idl/coreDom/Element.idl new file mode 100644 index 000000000000..759afb574bbe --- /dev/null +++ b/dom/public/idl/coreDom/Element.idl @@ -0,0 +1,14 @@ + interface Element : Node { + wstring getTagName(); + AttributeList getAttributes(); + wstring getDOMAttribute(in wstring name); + void setDOMAttribute(in string name, + in string value); + void removeAttribute(in wstring name); + Attribute getAttributeNode(in wstring name); + void setAttributeNode(in Attribute newAttr); + void removeAttributeNode(in Attribute oldAttr); + NodeIterator getElementsByTagName(in wstring tagname); + void normalize(); + }; + diff --git a/dom/public/idl/coreDom/Node.idl b/dom/public/idl/coreDom/Node.idl new file mode 100644 index 000000000000..a33f79569d5f --- /dev/null +++ b/dom/public/idl/coreDom/Node.idl @@ -0,0 +1,25 @@ + interface Node { + // NodeType + const int DOCUMENT = 1; + const int ELEMENT = 2; + const int ATTRIBUTE = 3; + const int PI = 4; + const int COMMENT = 5; + const int TEXT = 6; + + int getNodeType(); + Node getParentNode(); + NodeIterator getChildNodes(); + boolean hasChildNodes(); + Node getFirstChild(); + Node getPreviousSibling(); + Node getNextSibling(); + void insertBefore(in Node newChild, + in Node refChild) interface NotMyChildException {}; + + void replaceChild(in Node newChild, + in Node oldChild) interface NotMyChildException {}; + + void removeChild(in Node oldChild) interface NotMyChildException {}; + + }; diff --git a/dom/public/idl/coreDom/NodeIterator.idl b/dom/public/idl/coreDom/NodeIterator.idl new file mode 100644 index 000000000000..b6edbfdd76f6 --- /dev/null +++ b/dom/public/idl/coreDom/NodeIterator.idl @@ -0,0 +1,9 @@ + interface NodeIterator { + unsigned long getLength(); + Node getCurrentNode(); + Node getNextNode(); + Node getPreviousNode(); + Node toFirst(); + Node toLast(); + Node moveTo(in int n); + }; diff --git a/dom/public/idl/coreDom/PI.idl b/dom/public/idl/coreDom/PI.idl new file mode 100644 index 000000000000..23a59b2bd3ec --- /dev/null +++ b/dom/public/idl/coreDom/PI.idl @@ -0,0 +1,4 @@ + interface PI : Node { + attribute wstring name; + attribute wstring data; + }; diff --git a/dom/public/idl/coreDom/Text.idl b/dom/public/idl/coreDom/Text.idl new file mode 100644 index 000000000000..0b1a8463fcec --- /dev/null +++ b/dom/public/idl/coreDom/Text.idl @@ -0,0 +1,14 @@ + interface Text : Node { + attribute wstring data; + void append(in wstring data); + void insert(in int offset, + in wstring data); + void delete(in int offset, + in int count); + void replace(in int offset, + in int count, + in wstring data); + void splice(in Element element, + in int offset, + in int count); + }; diff --git a/dom/public/idl/coreDom/TreeIterator.idl b/dom/public/idl/coreDom/TreeIterator.idl new file mode 100644 index 000000000000..bd73b6e34ee2 --- /dev/null +++ b/dom/public/idl/coreDom/TreeIterator.idl @@ -0,0 +1,11 @@ + interface TreeIterator : NodeIterator { + unsigned long numChildren(); + unsigned long numPreviousSiblings(); + unsigned long numNextSiblings(); + Node toParent(); + Node toPreviousSibling(); + Node toNextSibling(); + Node toFirstChild(); + Node toLastChild(); + Node toNthChild(in int n) interface NoSuchNodeException {}; + }; diff --git a/dom/public/idl/coreDom/makefile.win b/dom/public/idl/coreDom/makefile.win new file mode 100644 index 000000000000..bd2da67a9f18 --- /dev/null +++ b/dom/public/idl/coreDom/makefile.win @@ -0,0 +1,61 @@ +#!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=..\..\..\.. +IGNORE_MANIFEST=1 + +MODULE=raptor + +IDLSRCS = \ + Attribute.idl \ + AttributeList.idl \ + Comment.idl \ + DOM.idl \ + Document.idl \ + DocumentContext.idl \ + DocumentFragment.idl \ + Element.idl \ + Node.idl \ + NodeIterator.idl \ + PI.idl \ + Text.idl \ + TreeIterator.idl + +JSSTUB_DESTDIR=$(DEPTH)\dom\src + +GENXDIR=genx +GENJSDIR=genjs + +!include <$(DEPTH)\config\rules.mak> + +$(GENXDIR): + -mkdir $(GENXDIR) + +$(GENJSDIR): + -mkdir $(GENJSDIR) + +IDLC=$(DIST)\bin\idlc.exe +GENIID=$(DIST)\bin\geniid.pl + +export:: $(GENXDIR) $(GENJSDIR) $(IDLSRCS) + @echo +++ make: generating xpcom headers + $(IDLC) -d $(GENXDIR) -x $(IDLSRCS) + @echo +++ make: generating JavaScript stubs + $(IDLC) -d $(GENJSDIR) -j $(IDLSRCS) + +install:: + for %g in ($(IDLSRCS:.idl=.cpp)) do $(MAKE_INSTALL:/=\) $(GENJSDIR)\nsJS%g $(JSSTUB_DESTDIR) diff --git a/dom/public/idl/makefile.win b/dom/public/idl/makefile.win index c8f8430370ba..f978083031c0 100644 --- a/dom/public/idl/makefile.win +++ b/dom/public/idl/makefile.win @@ -28,11 +28,11 @@ GLOBAL_IDLSRC = Window.idl XPCOM_DESTDIR=$(DEPTH)\dom\public JSSTUB_DESTDIR=$(DEPTH)\dom\src -IIDDIRS=$(DIRS: =/genx )/$(GENXDIR) $(GENXDIR) - GENXDIR=genx GENJSDIR=genjs +IIDDIRS=$(DIRS: =/genx )/$(GENXDIR) $(GENXDIR) + !include <$(DEPTH)\config\rules.mak> $(GENXDIR):