use preprocessor to generate atom code

This commit is contained in:
peterl%netscape.com 1999-07-18 00:35:21 +00:00
Родитель 33759cf899
Коммит 96e0cff2d6
6 изменённых файлов: 238 добавлений и 484 удалений

Просмотреть файл

@ -0,0 +1,99 @@
/* -*- 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.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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
/******
This file contains the list of all XUL nsIAtoms and their values
It is designed to be used as inline input to nsXULAtoms.cpp *only*
through the magic of C preprocessing.
All entires must be enclosed in the macro XUL_ATOM which will have cruel
and unusual things done to it
It is recommended (but not strictly necessary) to keep all entries
in alphabetical order
The first argument to XUL_ATOM is the C++ identifier of the atom
The second argument is the string value of the atom
******/
XUL_ATOM(button, "button")
XUL_ATOM(checkbox, "checkbox")
XUL_ATOM(spinner, "spinner")
XUL_ATOM(scrollbar, "scrollbar")
XUL_ATOM(slider, "slider")
XUL_ATOM(colorpicker, "colorpicker")
XUL_ATOM(fontpicker, "fontpicker")
XUL_ATOM(radio, "radio")
XUL_ATOM(text, "text")
XUL_ATOM(toolbar, "toolbar")
XUL_ATOM(toolbaritem, "toolbaritem")
XUL_ATOM(toolbox, "toolbox")
// The tree atoms
XUL_ATOM(tree, "tree") // The start of a tree view
XUL_ATOM(treecaption, "treecaption") // The caption of a tree view
XUL_ATOM(treehead, "treehead") // The header of the tree view
XUL_ATOM(treerow, "treerow") // A row in the tree view
XUL_ATOM(treecell, "treecell") // An item in the tree view
XUL_ATOM(treeitem, "treeitem") // A cell in the tree view
XUL_ATOM(treechildren, "treechildren") // The children of an item in the tree view
XUL_ATOM(treeindentation, "treeindentation") // Specifies that the indentation for the level should occur here.
XUL_ATOM(treeallowevents, "treeallowevents") // Lets events be handled on the cell contents.
XUL_ATOM(treecol, "treecol") // A column in the tree view
XUL_ATOM(treecolgroup, "treecolgroup") // A column group in the tree view
XUL_ATOM(treefoot, "treefoot") // The footer of the tree view
XUL_ATOM(treepusher, "treepusher") // A column pusher (left or right) for the tree view
XUL_ATOM(menuitem, "menuitem") // The menu element
XUL_ATOM(menubar, "menubar") // The menubar element
XUL_ATOM(menu, "menu") // A single menu item
XUL_ATOM(menubutton, "menubutton") // A button inside an XP menu.
XUL_ATOM(menuchildren, "menuchildren") // The menu's children.
XUL_ATOM(progressmeter, "progressmeter")
XUL_ATOM(titledbutton, "titledbutton")
XUL_ATOM(mode, "mode")
XUL_ATOM(box, "box")
XUL_ATOM(flex, "flex")
XUL_ATOM(deck, "deck")
XUL_ATOM(tabcontrol, "tabcontrol")
XUL_ATOM(tab, "tab")
XUL_ATOM(tabpanel, "tabpanel")
XUL_ATOM(tabpage, "tabpage")
XUL_ATOM(tabbox, "tabbox")
XUL_ATOM(maxpos, "maxpos")
XUL_ATOM(curpos, "curpos")
XUL_ATOM(scrollbarbutton, "scrollbarbutton")
XUL_ATOM(increment, "increment")
XUL_ATOM(pageincrement, "pageincrement")
XUL_ATOM(thumb, "thumb")
XUL_ATOM(toggled, "toggled")
XUL_ATOM(grippy, "grippy")
XUL_ATOM(splitter, "splitter")
XUL_ATOM(collapse, "collapse")
XUL_ATOM(widget, "widget")
XUL_ATOM(window, "window")

Просмотреть файл

@ -32,78 +32,23 @@ class nsINameSpaceManager;
class nsXULAtoms {
public:
static void AddrefAtoms();
static void AddRefAtoms();
static void ReleaseAtoms();
// XUL namespace ID, good for the life of the nsXULAtoms object
static PRInt32 nameSpaceID;
// Alphabetical list of xul tag and attribute atoms
static nsIAtom* button;
/* Declare all atoms
static nsIAtom* checkbox;
static nsIAtom* spinner;
static nsIAtom* scrollbar;
static nsIAtom* slider;
static nsIAtom* colorpicker;
static nsIAtom* fontpicker;
The atom names and values are stored in nsCSSAtomList.h and
are brought to you by the magic of C preprocessing
static nsIAtom* radio;
Add new atoms to nsCSSAtomList and all support logic will be auto-generated
*/
#define XUL_ATOM(_name, _value) static nsIAtom* _name;
#include "nsXULAtomList.h"
#undef XUL_ATOM
static nsIAtom* text;
static nsIAtom* toolbar;
static nsIAtom* toolbaritem;
static nsIAtom* toolbox;
// The tree atoms
static nsIAtom* tree; // The start of a tree view
static nsIAtom* treecaption; // The caption of a tree view
static nsIAtom* treehead; // The header of the tree view
static nsIAtom* treerow; // A row in the tree view
static nsIAtom* treeitem; // An item in the tree view
static nsIAtom* treecell; // A cell in the tree view
static nsIAtom* treechildren; // The children of an item in the tree viw
static nsIAtom* treeindentation; // Specifies that the indentation for the level should occur here.
static nsIAtom* treeallowevents; // Lets events be handled on the cell contents.
static nsIAtom* treecol; // A column in the tree view
static nsIAtom* treecolgroup; // A column group in the tree view
static nsIAtom* treefoot; // The footer of the tree view
static nsIAtom* treepusher; // A column pusher (left or right) for the tree view
static nsIAtom* menu; // The menu element
static nsIAtom* menubar; // The menubar element
static nsIAtom* menuitem; // A single menu item
static nsIAtom* menubutton; // A button inside an XP menu.
static nsIAtom* menuchildren; // The menu's children.
static nsIAtom* progressmeter;
static nsIAtom* titledbutton;
static nsIAtom* mode;
static nsIAtom* box;
static nsIAtom* flex;
static nsIAtom* deck;
static nsIAtom* tabcontrol;
static nsIAtom* tabbox;
static nsIAtom* tab;
static nsIAtom* tabpanel;
static nsIAtom* tabpage;
static nsIAtom* widget;
static nsIAtom* window;
static nsIAtom* curpos;
static nsIAtom* maxpos;
static nsIAtom* increment;
static nsIAtom* pageincrement;
static nsIAtom* scrollbarbutton;
static nsIAtom* thumb;
static nsIAtom* toggled;
static nsIAtom* grippy;
static nsIAtom* splitter;
static nsIAtom* collapse;
};
#endif /* nsXULAtoms_h___ */

Просмотреть файл

@ -22,74 +22,18 @@
static const char kXULNameSpace[] = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
// XXX make this be autogenerated. doh!
PRInt32 nsXULAtoms::nameSpaceID;
nsIAtom* nsXULAtoms::button;
nsIAtom* nsXULAtoms::checkbox;
nsIAtom* nsXULAtoms::spinner;
nsIAtom* nsXULAtoms::scrollbar;
nsIAtom* nsXULAtoms::slider;
nsIAtom* nsXULAtoms::colorpicker;
nsIAtom* nsXULAtoms::fontpicker;
nsIAtom* nsXULAtoms::radio;
nsIAtom* nsXULAtoms::text;
nsIAtom* nsXULAtoms::toolbar;
nsIAtom* nsXULAtoms::toolbaritem;
nsIAtom* nsXULAtoms::toolbox;
nsIAtom* nsXULAtoms::tree;
nsIAtom* nsXULAtoms::treecaption;
nsIAtom* nsXULAtoms::treehead;
nsIAtom* nsXULAtoms::treerow;
nsIAtom* nsXULAtoms::treeitem;
nsIAtom* nsXULAtoms::treecell;
nsIAtom* nsXULAtoms::treechildren;
nsIAtom* nsXULAtoms::treeindentation;
nsIAtom* nsXULAtoms::treeallowevents;
nsIAtom* nsXULAtoms::treecol;
nsIAtom* nsXULAtoms::treecolgroup;
nsIAtom* nsXULAtoms::treefoot;
nsIAtom* nsXULAtoms::treepusher;
// define storage for all atoms
#define XUL_ATOM(_name, _value) nsIAtom* nsXULAtoms::_name;
#include "nsXULAtomList.h"
#undef XUL_ATOM
nsIAtom* nsXULAtoms::menu;
nsIAtom* nsXULAtoms::menuitem;
nsIAtom* nsXULAtoms::menubar;
nsIAtom* nsXULAtoms::menubutton;
nsIAtom* nsXULAtoms::menuchildren;
nsIAtom* nsXULAtoms::progressmeter;
nsIAtom* nsXULAtoms::titledbutton;
nsIAtom* nsXULAtoms::mode;
nsIAtom* nsXULAtoms::box;
nsIAtom* nsXULAtoms::flex;
nsIAtom* nsXULAtoms::tabcontrol;
nsIAtom* nsXULAtoms::tabbox;
nsIAtom* nsXULAtoms::tab;
nsIAtom* nsXULAtoms::tabpanel;
nsIAtom* nsXULAtoms::tabpage;
nsIAtom* nsXULAtoms::deck;
nsIAtom* nsXULAtoms::maxpos;
nsIAtom* nsXULAtoms::curpos;
nsIAtom* nsXULAtoms::scrollbarbutton;
nsIAtom* nsXULAtoms::increment;
nsIAtom* nsXULAtoms::pageincrement;
nsIAtom* nsXULAtoms::thumb;
nsIAtom* nsXULAtoms::toggled;
nsIAtom* nsXULAtoms::grippy;
nsIAtom* nsXULAtoms::splitter;
nsIAtom* nsXULAtoms::collapse;
nsIAtom* nsXULAtoms::widget;
nsIAtom* nsXULAtoms::window;
static nsrefcnt gRefCnt;
static nsINameSpaceManager* gNameSpaceManager;
void nsXULAtoms::AddrefAtoms() {
void nsXULAtoms::AddRefAtoms() {
if (gRefCnt == 0) {
/* XUL Atoms registers the XUL name space ID because it's a convenient
@ -102,66 +46,9 @@ void nsXULAtoms::AddrefAtoms() {
NS_ASSERTION(0, "failed to create xul atoms namespace manager");
// now register the atoms
button = NS_NewAtom("button");
checkbox = NS_NewAtom("checkbox");
spinner = NS_NewAtom("spinner");
scrollbar = NS_NewAtom("scrollbar");
slider = NS_NewAtom("slider");
colorpicker = NS_NewAtom("colorpicker");
fontpicker = NS_NewAtom("fontpicker");
radio = NS_NewAtom("radio");
text = NS_NewAtom("text");
toolbar = NS_NewAtom("toolbar");
toolbaritem = NS_NewAtom("toolbaritem");
toolbox = NS_NewAtom("toolbox");
tree = NS_NewAtom("tree");
treecaption = NS_NewAtom("treecaption");
treehead = NS_NewAtom("treehead");
treerow = NS_NewAtom("treerow");
treecell = NS_NewAtom("treecell");
treeitem = NS_NewAtom("treeitem");
treechildren = NS_NewAtom("treechildren");
treeindentation = NS_NewAtom("treeindentation");
treeallowevents = NS_NewAtom("treeallowevents");
treecol = NS_NewAtom("treecol");
treecolgroup = NS_NewAtom("treecolgroup");
treefoot = NS_NewAtom("treefoot");
treepusher = NS_NewAtom("treepusher");
menuitem = NS_NewAtom("menuitem");
menubar = NS_NewAtom("menubar");
menu = NS_NewAtom("menu");
menubutton = NS_NewAtom("menubutton");
menuchildren = NS_NewAtom("menuchildren");
progressmeter = NS_NewAtom("progressmeter");
titledbutton = NS_NewAtom("titledbutton");
mode = NS_NewAtom("mode");
box = NS_NewAtom("box");
flex = NS_NewAtom("flex");
deck = NS_NewAtom("deck");
tabcontrol = NS_NewAtom("tabcontrol");
tab = NS_NewAtom("tab");
tabpanel = NS_NewAtom("tabpanel");
tabpage = NS_NewAtom("tabpage");
tabbox = NS_NewAtom("tabbox");
maxpos = NS_NewAtom("maxpos");
curpos = NS_NewAtom("curpos");
scrollbarbutton = NS_NewAtom("scrollbarbutton");
increment = NS_NewAtom("increment");
pageincrement = NS_NewAtom("pageincrement");
thumb = NS_NewAtom("thumb");
toggled = NS_NewAtom("toggled");
grippy = NS_NewAtom("grippy");
splitter = NS_NewAtom("splitter");
collapse = NS_NewAtom("collapse");
widget = NS_NewAtom("widget");
window = NS_NewAtom("window");
#define XUL_ATOM(_name, _value) _name = NS_NewAtom(_value);
#include "nsXULAtomList.h"
#undef XUL_ATOM
}
++gRefCnt;
}
@ -170,64 +57,10 @@ void nsXULAtoms::ReleaseAtoms() {
NS_PRECONDITION(gRefCnt != 0, "bad release of xul atoms");
if (--gRefCnt == 0) {
NS_RELEASE(button);
NS_RELEASE(checkbox);
NS_RELEASE(spinner);
NS_RELEASE(slider);
NS_RELEASE(scrollbar);
NS_RELEASE(colorpicker);
NS_RELEASE(fontpicker);
NS_RELEASE(radio);
NS_RELEASE(text);
NS_RELEASE(toolbar);
NS_RELEASE(toolbox);
#define XUL_ATOM(_name, _value) NS_RELEASE(_name);
#include "nsXULAtomList.h"
#undef XUL_ATOM
NS_RELEASE(tree);
NS_RELEASE(treecaption);
NS_RELEASE(treehead);
NS_RELEASE(treerow);
NS_RELEASE(treecell);
NS_RELEASE(treeitem);
NS_RELEASE(treechildren);
NS_RELEASE(treeindentation);
NS_RELEASE(treeallowevents);
NS_RELEASE(treecol);
NS_RELEASE(treecolgroup);
NS_RELEASE(treefoot);
NS_RELEASE(treepusher);
NS_RELEASE(menu);
NS_RELEASE(menubar);
NS_RELEASE(menuitem);
NS_RELEASE(menubutton);
NS_RELEASE(menuchildren);
NS_RELEASE(progressmeter);
NS_RELEASE(mode);
NS_RELEASE(box);
NS_RELEASE(flex);
NS_RELEASE(deck);
NS_RELEASE(tabcontrol);
NS_RELEASE(tab);
NS_RELEASE(tabbox);
NS_RELEASE(tabpanel);
NS_RELEASE(tabpage);
NS_RELEASE(maxpos);
NS_RELEASE(curpos);
NS_RELEASE(scrollbarbutton);
NS_RELEASE(increment);
NS_RELEASE(pageincrement);
NS_RELEASE(thumb);
NS_RELEASE(toggled);
NS_RELEASE(grippy);
NS_RELEASE(splitter);
NS_RELEASE(collapse);
NS_RELEASE(widget);
NS_RELEASE(window);
NS_IF_RELEASE(gNameSpaceManager);
}
}

Просмотреть файл

@ -0,0 +1,99 @@
/* -*- 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.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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
/******
This file contains the list of all XUL nsIAtoms and their values
It is designed to be used as inline input to nsXULAtoms.cpp *only*
through the magic of C preprocessing.
All entires must be enclosed in the macro XUL_ATOM which will have cruel
and unusual things done to it
It is recommended (but not strictly necessary) to keep all entries
in alphabetical order
The first argument to XUL_ATOM is the C++ identifier of the atom
The second argument is the string value of the atom
******/
XUL_ATOM(button, "button")
XUL_ATOM(checkbox, "checkbox")
XUL_ATOM(spinner, "spinner")
XUL_ATOM(scrollbar, "scrollbar")
XUL_ATOM(slider, "slider")
XUL_ATOM(colorpicker, "colorpicker")
XUL_ATOM(fontpicker, "fontpicker")
XUL_ATOM(radio, "radio")
XUL_ATOM(text, "text")
XUL_ATOM(toolbar, "toolbar")
XUL_ATOM(toolbaritem, "toolbaritem")
XUL_ATOM(toolbox, "toolbox")
// The tree atoms
XUL_ATOM(tree, "tree") // The start of a tree view
XUL_ATOM(treecaption, "treecaption") // The caption of a tree view
XUL_ATOM(treehead, "treehead") // The header of the tree view
XUL_ATOM(treerow, "treerow") // A row in the tree view
XUL_ATOM(treecell, "treecell") // An item in the tree view
XUL_ATOM(treeitem, "treeitem") // A cell in the tree view
XUL_ATOM(treechildren, "treechildren") // The children of an item in the tree view
XUL_ATOM(treeindentation, "treeindentation") // Specifies that the indentation for the level should occur here.
XUL_ATOM(treeallowevents, "treeallowevents") // Lets events be handled on the cell contents.
XUL_ATOM(treecol, "treecol") // A column in the tree view
XUL_ATOM(treecolgroup, "treecolgroup") // A column group in the tree view
XUL_ATOM(treefoot, "treefoot") // The footer of the tree view
XUL_ATOM(treepusher, "treepusher") // A column pusher (left or right) for the tree view
XUL_ATOM(menuitem, "menuitem") // The menu element
XUL_ATOM(menubar, "menubar") // The menubar element
XUL_ATOM(menu, "menu") // A single menu item
XUL_ATOM(menubutton, "menubutton") // A button inside an XP menu.
XUL_ATOM(menuchildren, "menuchildren") // The menu's children.
XUL_ATOM(progressmeter, "progressmeter")
XUL_ATOM(titledbutton, "titledbutton")
XUL_ATOM(mode, "mode")
XUL_ATOM(box, "box")
XUL_ATOM(flex, "flex")
XUL_ATOM(deck, "deck")
XUL_ATOM(tabcontrol, "tabcontrol")
XUL_ATOM(tab, "tab")
XUL_ATOM(tabpanel, "tabpanel")
XUL_ATOM(tabpage, "tabpage")
XUL_ATOM(tabbox, "tabbox")
XUL_ATOM(maxpos, "maxpos")
XUL_ATOM(curpos, "curpos")
XUL_ATOM(scrollbarbutton, "scrollbarbutton")
XUL_ATOM(increment, "increment")
XUL_ATOM(pageincrement, "pageincrement")
XUL_ATOM(thumb, "thumb")
XUL_ATOM(toggled, "toggled")
XUL_ATOM(grippy, "grippy")
XUL_ATOM(splitter, "splitter")
XUL_ATOM(collapse, "collapse")
XUL_ATOM(widget, "widget")
XUL_ATOM(window, "window")

Просмотреть файл

@ -22,74 +22,18 @@
static const char kXULNameSpace[] = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
// XXX make this be autogenerated. doh!
PRInt32 nsXULAtoms::nameSpaceID;
nsIAtom* nsXULAtoms::button;
nsIAtom* nsXULAtoms::checkbox;
nsIAtom* nsXULAtoms::spinner;
nsIAtom* nsXULAtoms::scrollbar;
nsIAtom* nsXULAtoms::slider;
nsIAtom* nsXULAtoms::colorpicker;
nsIAtom* nsXULAtoms::fontpicker;
nsIAtom* nsXULAtoms::radio;
nsIAtom* nsXULAtoms::text;
nsIAtom* nsXULAtoms::toolbar;
nsIAtom* nsXULAtoms::toolbaritem;
nsIAtom* nsXULAtoms::toolbox;
nsIAtom* nsXULAtoms::tree;
nsIAtom* nsXULAtoms::treecaption;
nsIAtom* nsXULAtoms::treehead;
nsIAtom* nsXULAtoms::treerow;
nsIAtom* nsXULAtoms::treeitem;
nsIAtom* nsXULAtoms::treecell;
nsIAtom* nsXULAtoms::treechildren;
nsIAtom* nsXULAtoms::treeindentation;
nsIAtom* nsXULAtoms::treeallowevents;
nsIAtom* nsXULAtoms::treecol;
nsIAtom* nsXULAtoms::treecolgroup;
nsIAtom* nsXULAtoms::treefoot;
nsIAtom* nsXULAtoms::treepusher;
// define storage for all atoms
#define XUL_ATOM(_name, _value) nsIAtom* nsXULAtoms::_name;
#include "nsXULAtomList.h"
#undef XUL_ATOM
nsIAtom* nsXULAtoms::menu;
nsIAtom* nsXULAtoms::menuitem;
nsIAtom* nsXULAtoms::menubar;
nsIAtom* nsXULAtoms::menubutton;
nsIAtom* nsXULAtoms::menuchildren;
nsIAtom* nsXULAtoms::progressmeter;
nsIAtom* nsXULAtoms::titledbutton;
nsIAtom* nsXULAtoms::mode;
nsIAtom* nsXULAtoms::box;
nsIAtom* nsXULAtoms::flex;
nsIAtom* nsXULAtoms::tabcontrol;
nsIAtom* nsXULAtoms::tabbox;
nsIAtom* nsXULAtoms::tab;
nsIAtom* nsXULAtoms::tabpanel;
nsIAtom* nsXULAtoms::tabpage;
nsIAtom* nsXULAtoms::deck;
nsIAtom* nsXULAtoms::maxpos;
nsIAtom* nsXULAtoms::curpos;
nsIAtom* nsXULAtoms::scrollbarbutton;
nsIAtom* nsXULAtoms::increment;
nsIAtom* nsXULAtoms::pageincrement;
nsIAtom* nsXULAtoms::thumb;
nsIAtom* nsXULAtoms::toggled;
nsIAtom* nsXULAtoms::grippy;
nsIAtom* nsXULAtoms::splitter;
nsIAtom* nsXULAtoms::collapse;
nsIAtom* nsXULAtoms::widget;
nsIAtom* nsXULAtoms::window;
static nsrefcnt gRefCnt;
static nsINameSpaceManager* gNameSpaceManager;
void nsXULAtoms::AddrefAtoms() {
void nsXULAtoms::AddRefAtoms() {
if (gRefCnt == 0) {
/* XUL Atoms registers the XUL name space ID because it's a convenient
@ -102,66 +46,9 @@ void nsXULAtoms::AddrefAtoms() {
NS_ASSERTION(0, "failed to create xul atoms namespace manager");
// now register the atoms
button = NS_NewAtom("button");
checkbox = NS_NewAtom("checkbox");
spinner = NS_NewAtom("spinner");
scrollbar = NS_NewAtom("scrollbar");
slider = NS_NewAtom("slider");
colorpicker = NS_NewAtom("colorpicker");
fontpicker = NS_NewAtom("fontpicker");
radio = NS_NewAtom("radio");
text = NS_NewAtom("text");
toolbar = NS_NewAtom("toolbar");
toolbaritem = NS_NewAtom("toolbaritem");
toolbox = NS_NewAtom("toolbox");
tree = NS_NewAtom("tree");
treecaption = NS_NewAtom("treecaption");
treehead = NS_NewAtom("treehead");
treerow = NS_NewAtom("treerow");
treecell = NS_NewAtom("treecell");
treeitem = NS_NewAtom("treeitem");
treechildren = NS_NewAtom("treechildren");
treeindentation = NS_NewAtom("treeindentation");
treeallowevents = NS_NewAtom("treeallowevents");
treecol = NS_NewAtom("treecol");
treecolgroup = NS_NewAtom("treecolgroup");
treefoot = NS_NewAtom("treefoot");
treepusher = NS_NewAtom("treepusher");
menuitem = NS_NewAtom("menuitem");
menubar = NS_NewAtom("menubar");
menu = NS_NewAtom("menu");
menubutton = NS_NewAtom("menubutton");
menuchildren = NS_NewAtom("menuchildren");
progressmeter = NS_NewAtom("progressmeter");
titledbutton = NS_NewAtom("titledbutton");
mode = NS_NewAtom("mode");
box = NS_NewAtom("box");
flex = NS_NewAtom("flex");
deck = NS_NewAtom("deck");
tabcontrol = NS_NewAtom("tabcontrol");
tab = NS_NewAtom("tab");
tabpanel = NS_NewAtom("tabpanel");
tabpage = NS_NewAtom("tabpage");
tabbox = NS_NewAtom("tabbox");
maxpos = NS_NewAtom("maxpos");
curpos = NS_NewAtom("curpos");
scrollbarbutton = NS_NewAtom("scrollbarbutton");
increment = NS_NewAtom("increment");
pageincrement = NS_NewAtom("pageincrement");
thumb = NS_NewAtom("thumb");
toggled = NS_NewAtom("toggled");
grippy = NS_NewAtom("grippy");
splitter = NS_NewAtom("splitter");
collapse = NS_NewAtom("collapse");
widget = NS_NewAtom("widget");
window = NS_NewAtom("window");
#define XUL_ATOM(_name, _value) _name = NS_NewAtom(_value);
#include "nsXULAtomList.h"
#undef XUL_ATOM
}
++gRefCnt;
}
@ -170,64 +57,10 @@ void nsXULAtoms::ReleaseAtoms() {
NS_PRECONDITION(gRefCnt != 0, "bad release of xul atoms");
if (--gRefCnt == 0) {
NS_RELEASE(button);
NS_RELEASE(checkbox);
NS_RELEASE(spinner);
NS_RELEASE(slider);
NS_RELEASE(scrollbar);
NS_RELEASE(colorpicker);
NS_RELEASE(fontpicker);
NS_RELEASE(radio);
NS_RELEASE(text);
NS_RELEASE(toolbar);
NS_RELEASE(toolbox);
#define XUL_ATOM(_name, _value) NS_RELEASE(_name);
#include "nsXULAtomList.h"
#undef XUL_ATOM
NS_RELEASE(tree);
NS_RELEASE(treecaption);
NS_RELEASE(treehead);
NS_RELEASE(treerow);
NS_RELEASE(treecell);
NS_RELEASE(treeitem);
NS_RELEASE(treechildren);
NS_RELEASE(treeindentation);
NS_RELEASE(treeallowevents);
NS_RELEASE(treecol);
NS_RELEASE(treecolgroup);
NS_RELEASE(treefoot);
NS_RELEASE(treepusher);
NS_RELEASE(menu);
NS_RELEASE(menubar);
NS_RELEASE(menuitem);
NS_RELEASE(menubutton);
NS_RELEASE(menuchildren);
NS_RELEASE(progressmeter);
NS_RELEASE(mode);
NS_RELEASE(box);
NS_RELEASE(flex);
NS_RELEASE(deck);
NS_RELEASE(tabcontrol);
NS_RELEASE(tab);
NS_RELEASE(tabbox);
NS_RELEASE(tabpanel);
NS_RELEASE(tabpage);
NS_RELEASE(maxpos);
NS_RELEASE(curpos);
NS_RELEASE(scrollbarbutton);
NS_RELEASE(increment);
NS_RELEASE(pageincrement);
NS_RELEASE(thumb);
NS_RELEASE(toggled);
NS_RELEASE(grippy);
NS_RELEASE(splitter);
NS_RELEASE(collapse);
NS_RELEASE(widget);
NS_RELEASE(window);
NS_IF_RELEASE(gNameSpaceManager);
}
}

Просмотреть файл

@ -32,78 +32,23 @@ class nsINameSpaceManager;
class nsXULAtoms {
public:
static void AddrefAtoms();
static void AddRefAtoms();
static void ReleaseAtoms();
// XUL namespace ID, good for the life of the nsXULAtoms object
static PRInt32 nameSpaceID;
// Alphabetical list of xul tag and attribute atoms
static nsIAtom* button;
/* Declare all atoms
static nsIAtom* checkbox;
static nsIAtom* spinner;
static nsIAtom* scrollbar;
static nsIAtom* slider;
static nsIAtom* colorpicker;
static nsIAtom* fontpicker;
The atom names and values are stored in nsCSSAtomList.h and
are brought to you by the magic of C preprocessing
static nsIAtom* radio;
Add new atoms to nsCSSAtomList and all support logic will be auto-generated
*/
#define XUL_ATOM(_name, _value) static nsIAtom* _name;
#include "nsXULAtomList.h"
#undef XUL_ATOM
static nsIAtom* text;
static nsIAtom* toolbar;
static nsIAtom* toolbaritem;
static nsIAtom* toolbox;
// The tree atoms
static nsIAtom* tree; // The start of a tree view
static nsIAtom* treecaption; // The caption of a tree view
static nsIAtom* treehead; // The header of the tree view
static nsIAtom* treerow; // A row in the tree view
static nsIAtom* treeitem; // An item in the tree view
static nsIAtom* treecell; // A cell in the tree view
static nsIAtom* treechildren; // The children of an item in the tree viw
static nsIAtom* treeindentation; // Specifies that the indentation for the level should occur here.
static nsIAtom* treeallowevents; // Lets events be handled on the cell contents.
static nsIAtom* treecol; // A column in the tree view
static nsIAtom* treecolgroup; // A column group in the tree view
static nsIAtom* treefoot; // The footer of the tree view
static nsIAtom* treepusher; // A column pusher (left or right) for the tree view
static nsIAtom* menu; // The menu element
static nsIAtom* menubar; // The menubar element
static nsIAtom* menuitem; // A single menu item
static nsIAtom* menubutton; // A button inside an XP menu.
static nsIAtom* menuchildren; // The menu's children.
static nsIAtom* progressmeter;
static nsIAtom* titledbutton;
static nsIAtom* mode;
static nsIAtom* box;
static nsIAtom* flex;
static nsIAtom* deck;
static nsIAtom* tabcontrol;
static nsIAtom* tabbox;
static nsIAtom* tab;
static nsIAtom* tabpanel;
static nsIAtom* tabpage;
static nsIAtom* widget;
static nsIAtom* window;
static nsIAtom* curpos;
static nsIAtom* maxpos;
static nsIAtom* increment;
static nsIAtom* pageincrement;
static nsIAtom* scrollbarbutton;
static nsIAtom* thumb;
static nsIAtom* toggled;
static nsIAtom* grippy;
static nsIAtom* splitter;
static nsIAtom* collapse;
};
#endif /* nsXULAtoms_h___ */