new xul directory

git-svn-id: svn://10.0.0.236/trunk@18124 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
danm%netscape.com
1999-01-21 01:56:05 +00:00
parent 801958a339
commit 64c1df8ee4
10 changed files with 487 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
/* -*- 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.
*/
#ifndef nsXULAtoms_h___
#define nsXULAtoms_h___
#include "prtypes.h"
#include "nsIAtom.h"
class nsINameSpaceManager;
/**
* This class wraps up the creation and destruction of the standard
* set of xul atoms used during normal xul handling. This object
* is created when the first xul content object is created, and
* destroyed when the last such content object is destroyed.
*/
class nsXULAtoms {
public:
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;
static nsIAtom* checkbox;
static nsIAtom* radio;
static nsIAtom* text;
static nsIAtom* toolbar;
static nsIAtom* tree;
static nsIAtom* widget;
static nsIAtom* window;
};
#endif /* nsXULAtoms_h___ */

View File

@@ -0,0 +1,78 @@
/* -*- 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 "nsString.h"
#include "nsINameSpaceManager.h"
#include "nsXULAtoms.h"
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::radio;
nsIAtom* nsXULAtoms::text;
nsIAtom* nsXULAtoms::toolbar;
nsIAtom* nsXULAtoms::tree;
nsIAtom* nsXULAtoms::widget;
nsIAtom* nsXULAtoms::window;
static nsrefcnt gRefCnt;
static nsINameSpaceManager* gNameSpaceManager;
void nsXULAtoms::AddrefAtoms() {
if (gRefCnt == 0) {
/* XUL Atoms registers the XUL name space ID because it's a convenient
place to do this, if you don't want a permanent, "well-known" ID.
*/
if (NS_SUCCEEDED(NS_NewNameSpaceManager(&gNameSpaceManager)))
// gNameSpaceManager->CreateRootNameSpace(namespace);
gNameSpaceManager->RegisterNameSpace(kXULNameSpace, nameSpaceID);
else
NS_ASSERTION(0, "failed to create xul atoms namespace manager");
// now register the atoms
button = NS_NewAtom("button");
checkbox = NS_NewAtom("checkbox");
radio = NS_NewAtom("radio");
text = NS_NewAtom("text");
toolbar = NS_NewAtom("toolbar");
tree = NS_NewAtom("tree");
window = NS_NewAtom("widget");
window = NS_NewAtom("window");
}
++gRefCnt;
}
void nsXULAtoms::ReleaseAtoms() {
NS_PRECONDITION(gRefCnt != 0, "bad release of xul atoms");
if (--gRefCnt == 0) {
NS_RELEASE(button);
NS_RELEASE(checkbox);
NS_RELEASE(radio);
NS_RELEASE(text);
NS_RELEASE(toolbar);
NS_RELEASE(tree);
NS_RELEASE(window);
NS_IF_RELEASE(gNameSpaceManager);
}
}

View File

@@ -0,0 +1,29 @@
#!gmake
#
# 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 = ../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = content
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/config/rules.mk

View File

@@ -0,0 +1,29 @@
#!gmake
#
# 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 = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = src
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/config/rules.mk

View File

@@ -0,0 +1,22 @@
#!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=..\..\..
DIRS=src
include <$(DEPTH)\layout\config\rules.mak>

View File

@@ -0,0 +1,64 @@
#!gmake
#
# 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=../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/config.mk
LIBRARY_NAME = raptorxulcontent_s
DEFINES += -D_IMPL_NS_HTML
INCLUDES += \
-I$(srcdir)/../../../base/src \
-I$(DIST)/public/raptor \
$(NULL)
# Note the sophisticated alphabetical ordering :-|
CPPSRCS = \
nsXULAtoms.cpp \
$(NULL)
EXPORTS = \
$(NULL)
EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS))
MODULE=layout
REQUIRES = xpcom raptor dom
MKSHLIB :=
# we don't want the shared lib
NO_SHARED_LIB=1
include $(topsrcdir)/config/rules.mk
export::
install:: $(TARGETS)
clobber::

View File

@@ -0,0 +1,53 @@
#!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=..\..\..\..
LIBRARY_NAME=raptorxulcontent_s
MODULE=raptor
REQUIRES=xpcom raptor pref
DEFINES=-D_IMPL_NS_HTML -DWIN32_LEAN_AND_MEAN
CPPSRCS= \
nsXULAtoms.cpp \
$(NULL)
CPP_OBJS= \
.\$(OBJDIR)\nsXULAtoms.obj \
$(NULL)
EXPORTS = \
$(NULL)
LINCS=-I$(PUBLIC)\xpcom -I$(PUBLIC)\raptor -I$(PUBLIC)\js \
-I..\..\..\html\style\src -I..\..\..\html\base\src -I$(PUBLIC)\dom \
-I..\..\..\html\document\src \
-I$(PUBLIC)\netlib -I..\..\..\base\src -I$(PUBLIC)\pref
LCFLAGS = \
$(LCFLAGS) \
$(DEFINES) \
$(NULL)
include <$(DEPTH)\layout\config\rules.mak>
libs:: $(LIBRARY)
$(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib
clobber::
rm -f $(DIST)\lib\$(LIBRARY_NAME).lib

View File

@@ -0,0 +1,78 @@
/* -*- 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 "nsString.h"
#include "nsINameSpaceManager.h"
#include "nsXULAtoms.h"
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::radio;
nsIAtom* nsXULAtoms::text;
nsIAtom* nsXULAtoms::toolbar;
nsIAtom* nsXULAtoms::tree;
nsIAtom* nsXULAtoms::widget;
nsIAtom* nsXULAtoms::window;
static nsrefcnt gRefCnt;
static nsINameSpaceManager* gNameSpaceManager;
void nsXULAtoms::AddrefAtoms() {
if (gRefCnt == 0) {
/* XUL Atoms registers the XUL name space ID because it's a convenient
place to do this, if you don't want a permanent, "well-known" ID.
*/
if (NS_SUCCEEDED(NS_NewNameSpaceManager(&gNameSpaceManager)))
// gNameSpaceManager->CreateRootNameSpace(namespace);
gNameSpaceManager->RegisterNameSpace(kXULNameSpace, nameSpaceID);
else
NS_ASSERTION(0, "failed to create xul atoms namespace manager");
// now register the atoms
button = NS_NewAtom("button");
checkbox = NS_NewAtom("checkbox");
radio = NS_NewAtom("radio");
text = NS_NewAtom("text");
toolbar = NS_NewAtom("toolbar");
tree = NS_NewAtom("tree");
window = NS_NewAtom("widget");
window = NS_NewAtom("window");
}
++gRefCnt;
}
void nsXULAtoms::ReleaseAtoms() {
NS_PRECONDITION(gRefCnt != 0, "bad release of xul atoms");
if (--gRefCnt == 0) {
NS_RELEASE(button);
NS_RELEASE(checkbox);
NS_RELEASE(radio);
NS_RELEASE(text);
NS_RELEASE(toolbar);
NS_RELEASE(tree);
NS_RELEASE(window);
NS_IF_RELEASE(gNameSpaceManager);
}
}

View File

@@ -0,0 +1,56 @@
/* -*- 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.
*/
#ifndef nsXULAtoms_h___
#define nsXULAtoms_h___
#include "prtypes.h"
#include "nsIAtom.h"
class nsINameSpaceManager;
/**
* This class wraps up the creation and destruction of the standard
* set of xul atoms used during normal xul handling. This object
* is created when the first xul content object is created, and
* destroyed when the last such content object is destroyed.
*/
class nsXULAtoms {
public:
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;
static nsIAtom* checkbox;
static nsIAtom* radio;
static nsIAtom* text;
static nsIAtom* toolbar;
static nsIAtom* tree;
static nsIAtom* widget;
static nsIAtom* window;
};
#endif /* nsXULAtoms_h___ */

View File

@@ -0,0 +1,22 @@
#!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=..\..
DIRS = content
include <$(DEPTH)\layout\config\rules.mak>