From 2ed20459c3f472c7e447d5ab39524976cd584fe3 Mon Sep 17 00:00:00 2001 From: "waterson%netscape.com" Date: Wed, 12 Apr 2000 04:49:28 +0000 Subject: [PATCH] Initial revision. git-svn-id: svn://10.0.0.236/trunk@65657 18797224-902f-48f8-a5cc-f745e15eee43 --- .../content/xul/content/src/nsXULAtoms.cpp | 73 +++++++++++++++++++ mozilla/content/xul/content/src/nsXULAtoms.h | 61 ++++++++++++++++ .../content/xul/content/src/nsXULAtoms.inc | 63 ++++++++++++++++ mozilla/rdf/content/src/nsXULAtoms.cpp | 73 +++++++++++++++++++ mozilla/rdf/content/src/nsXULAtoms.h | 61 ++++++++++++++++ mozilla/rdf/content/src/nsXULAtoms.inc | 63 ++++++++++++++++ 6 files changed, 394 insertions(+) create mode 100644 mozilla/content/xul/content/src/nsXULAtoms.cpp create mode 100644 mozilla/content/xul/content/src/nsXULAtoms.h create mode 100644 mozilla/content/xul/content/src/nsXULAtoms.inc create mode 100644 mozilla/rdf/content/src/nsXULAtoms.cpp create mode 100644 mozilla/rdf/content/src/nsXULAtoms.h create mode 100644 mozilla/rdf/content/src/nsXULAtoms.inc diff --git a/mozilla/content/xul/content/src/nsXULAtoms.cpp b/mozilla/content/xul/content/src/nsXULAtoms.cpp new file mode 100644 index 00000000000..54cd9133598 --- /dev/null +++ b/mozilla/content/xul/content/src/nsXULAtoms.cpp @@ -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 + * + * 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; +} + diff --git a/mozilla/content/xul/content/src/nsXULAtoms.h b/mozilla/content/xul/content/src/nsXULAtoms.h new file mode 100644 index 00000000000..cff8f41374e --- /dev/null +++ b/mozilla/content/xul/content/src/nsXULAtoms.h @@ -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 + * + * 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 diff --git a/mozilla/content/xul/content/src/nsXULAtoms.inc b/mozilla/content/xul/content/src/nsXULAtoms.inc new file mode 100644 index 00000000000..1de614287b0 --- /dev/null +++ b/mozilla/content/xul/content/src/nsXULAtoms.inc @@ -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 + * + * 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); diff --git a/mozilla/rdf/content/src/nsXULAtoms.cpp b/mozilla/rdf/content/src/nsXULAtoms.cpp new file mode 100644 index 00000000000..54cd9133598 --- /dev/null +++ b/mozilla/rdf/content/src/nsXULAtoms.cpp @@ -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 + * + * 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; +} + diff --git a/mozilla/rdf/content/src/nsXULAtoms.h b/mozilla/rdf/content/src/nsXULAtoms.h new file mode 100644 index 00000000000..cff8f41374e --- /dev/null +++ b/mozilla/rdf/content/src/nsXULAtoms.h @@ -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 + * + * 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 diff --git a/mozilla/rdf/content/src/nsXULAtoms.inc b/mozilla/rdf/content/src/nsXULAtoms.inc new file mode 100644 index 00000000000..1de614287b0 --- /dev/null +++ b/mozilla/rdf/content/src/nsXULAtoms.inc @@ -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 + * + * 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);