Initial revision.

This commit is contained in:
waterson%netscape.com 2000-04-12 04:49:28 +00:00
parent af97e4a182
commit 0cd1973ec7
6 changed files with 394 additions and 0 deletions

View File

@ -0,0 +1,73 @@
/* -*- 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.
*
* 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.
*
* Original Author(s):
* Chris Waterson <waterson@netscape.com>
*
* Contributor(s):
*
*/
/*
Back-end for commonly used XUL atoms.
*/
#include "nsXULAtoms.h"
#ifdef NS_XULATOM
#undef NS_XULATOM
#endif
#define NS_XULATOM(__atom) nsIAtom* nsXULAtoms::__atom
#include "nsXULAtoms.inc"
nsrefcnt nsXULAtoms::gRefCnt = 0;
nsIAtom* nsXULAtoms::Template;
nsrefcnt
nsXULAtoms::AddRef()
{
if (++gRefCnt == 1) {
#undef NS_XULATOM
#define NS_XULATOM(__atom) __atom = NS_NewAtom(#__atom)
#include "nsXULAtoms.inc"
Template = NS_NewAtom("template");
}
return gRefCnt;
}
nsrefcnt
nsXULAtoms::Release()
{
if (--gRefCnt == 0) {
#undef NS_XULATOM
#define NS_XULATOM(__atom) NS_RELEASE(__atom)
#include "nsXULAtoms.inc"
NS_RELEASE(Template);
}
return gRefCnt;
}

View File

@ -0,0 +1,61 @@
/* -*- 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.
*
* 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.
*
* Original Author(s):
* Chris Waterson <waterson@netscape.com>
*
* Contributor(s):
*
*/
/*
Header file used to include the commonly-used atoms in the XUL
code. Actual atom additions and removal should be performed on
nsXULAtoms.inc.
*/
#ifndef nsXULAtoms_h__
#define nsXULAtoms_h__
#include "nsIAtom.h"
#ifdef NS_XULATOM
#undef NS_XULATOM
#endif
#define NS_XULATOM(__atom) static nsIAtom* __atom
class nsXULAtoms {
protected:
static nsrefcnt gRefCnt;
public:
static nsrefcnt AddRef();
static nsrefcnt Release();
#include "nsXULAtoms.inc"
static nsIAtom* Template; // XXX because |template| is a keyword
};
#endif

View File

@ -0,0 +1,63 @@
/* -*- 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.
*
* 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.
*
* Original Author(s):
* Chris Waterson <waterson@netscape.com>
*
* Contributor(s):
*
*/
/*
XUL atom declarations.
*/
NS_XULATOM(child);
NS_XULATOM(conditions);
NS_XULATOM(container);
NS_XULATOM(containment);
NS_XULATOM(content);
NS_XULATOM(empty);
NS_XULATOM(id);
NS_XULATOM(ignore);
NS_XULATOM(instanceOf);
NS_XULATOM(iscontainer);
NS_XULATOM(isempty);
NS_XULATOM(member);
NS_XULATOM(menu);
NS_XULATOM(menupopup);
NS_XULATOM(object);
NS_XULATOM(open);
NS_XULATOM(parent);
NS_XULATOM(persist);
NS_XULATOM(predicate);
NS_XULATOM(property);
NS_XULATOM(resource);
NS_XULATOM(rule);
NS_XULATOM(subject);
NS_XULATOM(textnode);
NS_XULATOM(tree);
NS_XULATOM(treechildren);
NS_XULATOM(treeitem);
NS_XULATOM(triple);
NS_XULATOM(uri);
NS_XULATOM(value);
NS_XULATOM(xulcontentsgenerated);

View File

@ -0,0 +1,73 @@
/* -*- 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.
*
* 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.
*
* Original Author(s):
* Chris Waterson <waterson@netscape.com>
*
* Contributor(s):
*
*/
/*
Back-end for commonly used XUL atoms.
*/
#include "nsXULAtoms.h"
#ifdef NS_XULATOM
#undef NS_XULATOM
#endif
#define NS_XULATOM(__atom) nsIAtom* nsXULAtoms::__atom
#include "nsXULAtoms.inc"
nsrefcnt nsXULAtoms::gRefCnt = 0;
nsIAtom* nsXULAtoms::Template;
nsrefcnt
nsXULAtoms::AddRef()
{
if (++gRefCnt == 1) {
#undef NS_XULATOM
#define NS_XULATOM(__atom) __atom = NS_NewAtom(#__atom)
#include "nsXULAtoms.inc"
Template = NS_NewAtom("template");
}
return gRefCnt;
}
nsrefcnt
nsXULAtoms::Release()
{
if (--gRefCnt == 0) {
#undef NS_XULATOM
#define NS_XULATOM(__atom) NS_RELEASE(__atom)
#include "nsXULAtoms.inc"
NS_RELEASE(Template);
}
return gRefCnt;
}

View File

@ -0,0 +1,61 @@
/* -*- 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.
*
* 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.
*
* Original Author(s):
* Chris Waterson <waterson@netscape.com>
*
* Contributor(s):
*
*/
/*
Header file used to include the commonly-used atoms in the XUL
code. Actual atom additions and removal should be performed on
nsXULAtoms.inc.
*/
#ifndef nsXULAtoms_h__
#define nsXULAtoms_h__
#include "nsIAtom.h"
#ifdef NS_XULATOM
#undef NS_XULATOM
#endif
#define NS_XULATOM(__atom) static nsIAtom* __atom
class nsXULAtoms {
protected:
static nsrefcnt gRefCnt;
public:
static nsrefcnt AddRef();
static nsrefcnt Release();
#include "nsXULAtoms.inc"
static nsIAtom* Template; // XXX because |template| is a keyword
};
#endif

View File

@ -0,0 +1,63 @@
/* -*- 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.
*
* 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.
*
* Original Author(s):
* Chris Waterson <waterson@netscape.com>
*
* Contributor(s):
*
*/
/*
XUL atom declarations.
*/
NS_XULATOM(child);
NS_XULATOM(conditions);
NS_XULATOM(container);
NS_XULATOM(containment);
NS_XULATOM(content);
NS_XULATOM(empty);
NS_XULATOM(id);
NS_XULATOM(ignore);
NS_XULATOM(instanceOf);
NS_XULATOM(iscontainer);
NS_XULATOM(isempty);
NS_XULATOM(member);
NS_XULATOM(menu);
NS_XULATOM(menupopup);
NS_XULATOM(object);
NS_XULATOM(open);
NS_XULATOM(parent);
NS_XULATOM(persist);
NS_XULATOM(predicate);
NS_XULATOM(property);
NS_XULATOM(resource);
NS_XULATOM(rule);
NS_XULATOM(subject);
NS_XULATOM(textnode);
NS_XULATOM(tree);
NS_XULATOM(treechildren);
NS_XULATOM(treeitem);
NS_XULATOM(triple);
NS_XULATOM(uri);
NS_XULATOM(value);
NS_XULATOM(xulcontentsgenerated);