gecko-dev/layout/base/nsLayoutAtoms.cpp

182 строки
5.8 KiB
C++
Исходник Обычный вид История

1998-12-02 03:32:20 +03:00
/* -*- 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) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsLayoutAtoms.h"
// XXX make this be autogenerated. doh!
1998-12-11 05:31:51 +03:00
// media atoms
1998-12-02 03:32:20 +03:00
nsIAtom* nsLayoutAtoms::all;
nsIAtom* nsLayoutAtoms::aural;
nsIAtom* nsLayoutAtoms::braille;
nsIAtom* nsLayoutAtoms::embossed;
nsIAtom* nsLayoutAtoms::handheld;
nsIAtom* nsLayoutAtoms::print;
nsIAtom* nsLayoutAtoms::projection;
nsIAtom* nsLayoutAtoms::screen;
nsIAtom* nsLayoutAtoms::tty;
nsIAtom* nsLayoutAtoms::tv;
1998-12-11 05:31:51 +03:00
// name space atoms
nsIAtom* nsLayoutAtoms::htmlNameSpace;
nsIAtom* nsLayoutAtoms::xmlNameSpace;
nsIAtom* nsLayoutAtoms::xmlnsNameSpace;
1998-12-11 05:31:51 +03:00
// frame additional child lists
nsIAtom* nsLayoutAtoms::absoluteList;
1998-12-11 05:31:51 +03:00
nsIAtom* nsLayoutAtoms::bulletList;
nsIAtom* nsLayoutAtoms::colGroupList;
nsIAtom* nsLayoutAtoms::fixedList;
nsIAtom* nsLayoutAtoms::floaterList;
1998-12-11 05:31:51 +03:00
// pseudo tag names for non-element content
nsIAtom* nsLayoutAtoms::commentTagName;
1999-02-11 09:39:07 +03:00
nsIAtom* nsLayoutAtoms::textTagName;
nsIAtom* nsLayoutAtoms::processingInstructionTagName;
1999-02-11 09:39:07 +03:00
nsIAtom* nsLayoutAtoms::viewportPseudo;
1999-02-19 03:53:09 +03:00
nsIAtom* nsLayoutAtoms::pagePseudo;
// frame types
nsIAtom* nsLayoutAtoms::areaFrame;
1999-04-20 22:20:52 +04:00
nsIAtom* nsLayoutAtoms::blockFrame;
nsIAtom* nsLayoutAtoms::htmlFrameInnerFrame;
nsIAtom* nsLayoutAtoms::htmlFrameOuterFrame;
1999-04-20 22:20:52 +04:00
nsIAtom* nsLayoutAtoms::inlineFrame;
1999-04-28 02:07:22 +04:00
nsIAtom* nsLayoutAtoms::letterFrame;
nsIAtom* nsLayoutAtoms::lineFrame;
nsIAtom* nsLayoutAtoms::pageFrame;
1999-04-23 18:32:12 +04:00
nsIAtom* nsLayoutAtoms::placeholderFrame;
1999-04-20 22:27:37 +04:00
nsIAtom* nsLayoutAtoms::positionedInlineFrame;
nsIAtom* nsLayoutAtoms::rootFrame;
nsIAtom* nsLayoutAtoms::scrollFrame;
nsIAtom* nsLayoutAtoms::tableOuterFrame;
nsIAtom* nsLayoutAtoms::tableFrame;
nsIAtom* nsLayoutAtoms::tableRowGroupFrame;
nsIAtom* nsLayoutAtoms::tableRowFrame;
nsIAtom* nsLayoutAtoms::tableCellFrame;
1999-02-24 08:33:40 +03:00
nsIAtom* nsLayoutAtoms::textFrame;
nsIAtom* nsLayoutAtoms::viewportFrame;
1998-12-02 03:32:20 +03:00
static nsrefcnt gRefCnt;
void nsLayoutAtoms::AddrefAtoms()
{
if (0 == gRefCnt) {
1999-01-23 10:02:10 +03:00
all = NS_NewAtom("all"); // Media atoms must be lower case
aural = NS_NewAtom("aural");
braille = NS_NewAtom("braille");
embossed = NS_NewAtom("embossed");
handheld = NS_NewAtom("handheld");
print = NS_NewAtom("print");
projection = NS_NewAtom("projection");
screen = NS_NewAtom("screen");
tty = NS_NewAtom("tty");
tv = NS_NewAtom("tv");
1998-12-11 05:31:51 +03:00
htmlNameSpace = NS_NewAtom("html");
xmlNameSpace = NS_NewAtom("xml");
xmlnsNameSpace = NS_NewAtom("xmlns");
1998-12-11 05:31:51 +03:00
absoluteList = NS_NewAtom("Absolute-list");
1998-12-11 05:31:51 +03:00
bulletList = NS_NewAtom("Bullet-list");
colGroupList = NS_NewAtom("ColGroup-list");
fixedList = NS_NewAtom("Fixed-list");
floaterList = NS_NewAtom("Floater-list");
commentTagName = NS_NewAtom("__moz_comment");
1999-02-11 09:39:07 +03:00
textTagName = NS_NewAtom("__moz_text");
processingInstructionTagName = NS_NewAtom("__moz_pi");
1999-02-12 09:19:07 +03:00
viewportPseudo = NS_NewAtom(":-moz-viewport");
1999-02-19 03:53:09 +03:00
pagePseudo = NS_NewAtom(":-moz-page");
areaFrame = NS_NewAtom("AreaFrame");
1999-04-20 22:20:52 +04:00
blockFrame = NS_NewAtom("BlockFrame");
htmlFrameInnerFrame = NS_NewAtom("htmlFrameInnerFrame");
htmlFrameOuterFrame = NS_NewAtom("htmlFrameOuterFrame");
1999-04-20 22:20:52 +04:00
inlineFrame = NS_NewAtom("InlineFrame");
1999-04-28 02:07:22 +04:00
letterFrame = NS_NewAtom("LetterFrame");
lineFrame = NS_NewAtom("LineFrame");
pageFrame = NS_NewAtom("PageFrame");
1999-04-23 18:32:12 +04:00
placeholderFrame = NS_NewAtom("PlaceholderFrame");
1999-04-20 22:27:37 +04:00
positionedInlineFrame = NS_NewAtom("PositionedInlineFrame");
rootFrame = NS_NewAtom("RootFrame");
scrollFrame = NS_NewAtom("ScrollFrame");
tableOuterFrame = NS_NewAtom("TableOuterFrame");
tableFrame = NS_NewAtom("TableFrame");
tableRowGroupFrame = NS_NewAtom("TableRowGroupFrame");
tableRowFrame = NS_NewAtom("TableRowFrame");
tableCellFrame = NS_NewAtom("TableCellFrame");
1999-02-24 08:33:40 +03:00
textFrame = NS_NewAtom("TextFrame");
viewportFrame = NS_NewAtom("ViewportFrame");
1998-12-02 03:32:20 +03:00
}
++gRefCnt;
}
void nsLayoutAtoms::ReleaseAtoms()
{
NS_PRECONDITION(gRefCnt != 0, "bad release atoms");
if (--gRefCnt == 0) {
NS_RELEASE(all);
NS_RELEASE(aural);
NS_RELEASE(braille);
NS_RELEASE(embossed);
NS_RELEASE(handheld);
NS_RELEASE(print);
NS_RELEASE(projection);
NS_RELEASE(screen);
NS_RELEASE(tty);
NS_RELEASE(tv);
1998-12-11 05:31:51 +03:00
NS_RELEASE(htmlNameSpace);
NS_RELEASE(xmlNameSpace);
NS_RELEASE(xmlnsNameSpace);
NS_RELEASE(absoluteList);
1998-12-11 05:31:51 +03:00
NS_RELEASE(bulletList);
NS_RELEASE(colGroupList);
NS_RELEASE(fixedList);
NS_RELEASE(floaterList);
NS_RELEASE(commentTagName);
1999-02-11 09:39:07 +03:00
NS_RELEASE(textTagName);
NS_RELEASE(processingInstructionTagName);
1999-02-11 09:39:07 +03:00
NS_RELEASE(viewportPseudo);
1999-02-19 03:53:09 +03:00
NS_RELEASE(pagePseudo);
NS_RELEASE(areaFrame);
1999-04-20 22:20:52 +04:00
NS_RELEASE(blockFrame);
NS_RELEASE(htmlFrameInnerFrame);
NS_RELEASE(htmlFrameOuterFrame);
1999-04-20 22:20:52 +04:00
NS_RELEASE(inlineFrame);
1999-04-28 02:07:22 +04:00
NS_RELEASE(letterFrame);
NS_RELEASE(lineFrame);
NS_RELEASE(pageFrame);
1999-04-23 18:32:12 +04:00
NS_RELEASE(placeholderFrame);
1999-04-20 22:27:37 +04:00
NS_RELEASE(positionedInlineFrame);
NS_RELEASE(rootFrame);
NS_RELEASE(scrollFrame);
NS_RELEASE(tableOuterFrame);
NS_RELEASE(tableFrame);
NS_RELEASE(tableRowGroupFrame);
NS_RELEASE(tableRowFrame);
NS_RELEASE(tableCellFrame);
1999-02-24 08:33:40 +03:00
NS_RELEASE(textFrame);
NS_RELEASE(viewportFrame);
1998-12-02 03:32:20 +03:00
}
}