This commit is contained in:
rjc%netscape.com 1999-08-30 08:48:52 +00:00
Родитель 2cb5c551b6
Коммит a64e2bcf4f
12 изменённых файлов: 0 добавлений и 850 удалений

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

@ -1,10 +0,0 @@
interface RDFCore : BaseAppCore
{
/* IID: { 0xdf365f00, 0xcc53, 0x11d2, \
{ 0x8f, 0xdf, 0x0, 0x08, 0xc7, 0x0a, 0xdc, 0x7b } } */
void RDFCore();
void doSort(in Node node, in DOMString sortResource, in DOMString sortDirection);
};

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

@ -32,7 +32,6 @@ IDLSRCS= \
AppCoresManager.idl \
BaseAppCore.idl \
BrowserAppCore.idl \
RDFCore.idl \
ProfileCore.idl \
ToolkitCore.idl
!endif

Двоичные данные
xpfe/AppCores/macbuild/AppCores.mcp

Двоичный файл не отображается.

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

@ -35,8 +35,6 @@ MODULE=raptor
CPPSRCS= \
nsBaseAppCore.cpp \
nsProfileCore.cpp \
nsRDFCore.cpp \
nsRDFCoreFactory.cpp \
nsAppCoresNameSet.cpp \
nsToolkitCore.cpp \
nsBrowserAppCore.cpp \
@ -48,7 +46,6 @@ CPPSRCS= \
nsJSBaseAppCore.cpp \
nsJSAppCoresManager.cpp \
nsJSProfileCore.cpp \
nsJSRDFCore.cpp \
nsJSToolkitCore.cpp \
nsJSBrowserAppCore.cpp \
nsAppCores.cpp \

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

@ -77,8 +77,6 @@ LLIBS = \
OBJS = \
.\$(OBJDIR)\nsBaseAppCore.obj \
.\$(OBJDIR)\nsProfileCore.obj \
.\$(OBJDIR)\nsRDFCore.obj \
.\$(OBJDIR)\nsRDFCoreFactory.obj \
.\$(OBJDIR)\nsAppCoresNameSet.obj \
.\$(OBJDIR)\nsToolkitCore.obj \
.\$(OBJDIR)\nsToolkitCoreFactory.obj \
@ -90,7 +88,6 @@ OBJS = \
.\$(OBJDIR)\nsJSBaseAppCore.obj \
.\$(OBJDIR)\nsJSAppCoresManager.obj \
.\$(OBJDIR)\nsJSProfileCore.obj \
.\$(OBJDIR)\nsJSRDFCore.obj \
.\$(OBJDIR)\nsJSToolkitCore.obj \
.\$(OBJDIR)\nsJSBrowserAppCore.obj \
.\$(OBJDIR)\nsAppCores.obj \

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

@ -22,7 +22,6 @@
#include "nsAppCoresCIDs.h"
#include "nsAppCoresManagerFactory.h"
#include "nsProfileCoreFactory.h"
#include "nsRDFCoreFactory.h"
#include "nsBrowserAppCoreFactory.h"
#include "nsToolkitCoreFactory.h"
#include "nsIFactory.h"
@ -36,7 +35,6 @@ static PRInt32 gInstanceCnt = 0;
static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
static NS_DEFINE_IID(kProfileCoreCID, NS_PROFILECORE_CID);
static NS_DEFINE_IID(kRDFCoreCID, NS_RDFCORE_CID);
static NS_DEFINE_IID(kToolkitCoreCID, NS_TOOLKITCORE_CID);
static NS_DEFINE_IID(kBrowserAppCoreCID, NS_BROWSERAPPCORE_CID);
static NS_DEFINE_IID(kAppCoresManagerCID, NS_APPCORESMANAGER_CID);
@ -58,7 +56,6 @@ NSRegisterSelf(nsISupports* serviceMgr, const char *path)
printf("*** AppCores object is being registered\n");
nsComponentManager::RegisterComponent(kAppCoresManagerCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
nsComponentManager::RegisterComponent(kProfileCoreCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
nsComponentManager::RegisterComponent(kRDFCoreCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
nsComponentManager::RegisterComponent(kToolkitCoreCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
nsComponentManager::RegisterComponent(kBrowserAppCoreCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
@ -72,7 +69,6 @@ NSUnregisterSelf(nsISupports* serviceMgr, const char *path)
nsComponentManager::UnregisterComponent(kAppCoresManagerCID, path);
nsComponentManager::UnregisterComponent(kProfileCoreCID, path);
nsComponentManager::UnregisterComponent(kRDFCoreCID, path);
nsComponentManager::UnregisterComponent(kToolkitCoreCID, path);
nsComponentManager::UnregisterComponent(kBrowserAppCoreCID, path);
@ -104,10 +100,6 @@ NSGetFactory(nsISupports* serviceMgr,
{
inst = new nsProfileCoreFactory();
}
else if ( aClass.Equals(kRDFCoreCID) )
{
inst = new nsRDFCoreFactory();
}
else if ( aClass.Equals(kToolkitCoreCID) )
{
inst = new nsToolkitCoreFactory();

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

@ -27,7 +27,6 @@
#include "nsIDOMAppCoresManager.h"
#include "nsIDOMToolkitCore.h"
#include "nsIDOMProfileCore.h"
#include "nsIDOMRDFCore.h"
#include "nsIDOMBrowserAppCore.h"
#include "nsAppCoresCIDs.h"
@ -36,7 +35,6 @@ static NS_DEFINE_IID(kIScriptExternalNameSetIID, NS_ISCRIPTEXTERNALNAMESET_IID);
static NS_DEFINE_IID(kAppCoresCID, NS_APPCORESMANAGER_CID);
static NS_DEFINE_IID(kToolkitCoreCID, NS_TOOLKITCORE_CID);
static NS_DEFINE_IID(kProfileCoreCID, NS_PROFILECORE_CID);
static NS_DEFINE_IID(kRDFCoreCID, NS_RDFCORE_CID);
static NS_DEFINE_IID(kBrowserAppCoreCID, NS_BROWSERAPPCORE_CID);
nsAppCoresNameSet::nsAppCoresNameSet()
@ -64,7 +62,6 @@ nsAppCoresNameSet::InitializeClasses(nsIScriptContext* aScriptContext)
result = NS_InitProfileCoreClass(aScriptContext, nsnull);
result = NS_InitBrowserAppCoreClass(aScriptContext, nsnull);
result = NS_InitToolkitCoreClass(aScriptContext, nsnull);
result = NS_InitRDFCoreClass(aScriptContext, nsnull);
return result;
}
@ -87,14 +84,6 @@ nsAppCoresNameSet::AddNameSet(nsIScriptContext* aScriptContext)
if (NS_OK != result) return result;
result = manager->RegisterGlobalName("RDFCore",
kRDFCoreCID,
PR_TRUE);
if (NS_OK != result) return result;
result = manager->RegisterGlobalName("ToolkitCore",
kToolkitCoreCID,
PR_TRUE);

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

@ -1,404 +0,0 @@
/* -*- 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.
*/
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIScriptSecurityManager.h"
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMNode.h"
#include "nsIDOMRDFCore.h"
#include "nsIScriptNameSpaceManager.h"
#include "nsIComponentManager.h"
#include "nsIJSNativeInitializer.h"
#include "nsDOMCID.h"
static NS_DEFINE_IID(kIScriptObjectOwnerIID, NS_ISCRIPTOBJECTOWNER_IID);
static NS_DEFINE_IID(kIJSScriptObjectIID, NS_IJSSCRIPTOBJECT_IID);
static NS_DEFINE_IID(kIScriptGlobalObjectIID, NS_ISCRIPTGLOBALOBJECT_IID);
static NS_DEFINE_IID(kINodeIID, NS_IDOMNODE_IID);
static NS_DEFINE_IID(kIRDFCoreIID, NS_IDOMRDFCORE_IID);
NS_DEF_PTR(nsIDOMNode);
NS_DEF_PTR(nsIDOMRDFCore);
/***********************************************************************/
//
// RDFCore Properties Getter
//
PR_STATIC_CALLBACK(JSBool)
GetRDFCoreProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsIDOMRDFCore *a = (nsIDOMRDFCore*)nsJSUtils::nsGetNativeThis(cx, obj);
// If there's no private data, this must be the prototype, so ignore
if (nsnull == a) {
return JS_TRUE;
}
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case 0:
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
}
/***********************************************************************/
//
// RDFCore Properties Setter
//
PR_STATIC_CALLBACK(JSBool)
SetRDFCoreProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsIDOMRDFCore *a = (nsIDOMRDFCore*)nsJSUtils::nsGetNativeThis(cx, obj);
// If there's no private data, this must be the prototype, so ignore
if (nsnull == a) {
return JS_TRUE;
}
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case 0:
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
}
//
// RDFCore finalizer
//
PR_STATIC_CALLBACK(void)
FinalizeRDFCore(JSContext *cx, JSObject *obj)
{
nsJSUtils::nsGenericFinalize(cx, obj);
}
//
// RDFCore enumerate
//
PR_STATIC_CALLBACK(JSBool)
EnumerateRDFCore(JSContext *cx, JSObject *obj)
{
return nsJSUtils::nsGenericEnumerate(cx, obj);
}
//
// RDFCore resolve
//
PR_STATIC_CALLBACK(JSBool)
ResolveRDFCore(JSContext *cx, JSObject *obj, jsval id)
{
return nsJSUtils::nsGenericResolve(cx, obj, id);
}
//
// Native method DoSort
//
PR_STATIC_CALLBACK(JSBool)
RDFCoreDoSort(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
nsIDOMRDFCore *nativeThis = (nsIDOMRDFCore*)nsJSUtils::nsGetNativeThis(cx, obj);
nsIDOMNodePtr b0;
nsAutoString b1;
nsAutoString b2;
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
return JS_FALSE;
}
{
PRBool ok;
secMan->CheckScriptAccess(scriptCX, obj, "rdfcore.dosort", &ok);
if (!ok) {
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
if (nsnull == nativeThis) {
return JS_TRUE;
}
{
if (argc < 3) {
JS_ReportError(cx, "Function doSort requires 3 parameters");
return JS_FALSE;
}
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&b0,
kINodeIID,
"Node",
cx,
argv[0])) {
return JS_FALSE;
}
nsJSUtils::nsConvertJSValToString(b1, cx, argv[1]);
nsJSUtils::nsConvertJSValToString(b2, cx, argv[2]);
if (NS_OK != nativeThis->DoSort(b0, b1, b2)) {
return JS_FALSE;
}
*rval = JSVAL_VOID;
}
return JS_TRUE;
}
/***********************************************************************/
//
// class for RDFCore
//
JSClass RDFCoreClass = {
"RDFCore",
JSCLASS_HAS_PRIVATE | JSCLASS_PRIVATE_IS_NSISUPPORTS,
JS_PropertyStub,
JS_PropertyStub,
GetRDFCoreProperty,
SetRDFCoreProperty,
EnumerateRDFCore,
ResolveRDFCore,
JS_ConvertStub,
FinalizeRDFCore
};
//
// RDFCore class properties
//
static JSPropertySpec RDFCoreProperties[] =
{
{0}
};
//
// RDFCore class methods
//
static JSFunctionSpec RDFCoreMethods[] =
{
{"doSort", RDFCoreDoSort, 3},
{0}
};
//
// RDFCore constructor
//
PR_STATIC_CALLBACK(JSBool)
RDFCore(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
nsresult result;
nsIID classID;
nsIScriptContext* context = (nsIScriptContext*)JS_GetContextPrivate(cx);
nsIScriptNameSpaceManager* manager;
nsIDOMRDFCore *nativeThis;
nsIScriptObjectOwner *owner = nsnull;
nsIJSNativeInitializer* initializer = nsnull;
static NS_DEFINE_IID(kIDOMRDFCoreIID, NS_IDOMRDFCORE_IID);
static NS_DEFINE_IID(kIJSNativeInitializerIID, NS_IJSNATIVEINITIALIZER_IID);
result = context->GetNameSpaceManager(&manager);
if (NS_OK != result) {
return JS_FALSE;
}
result = manager->LookupName("RDFCore", PR_TRUE, classID);
NS_RELEASE(manager);
if (NS_OK != result) {
return JS_FALSE;
}
result = nsComponentManager::CreateInstance(classID,
nsnull,
kIDOMRDFCoreIID,
(void **)&nativeThis);
if (NS_OK != result) {
return JS_FALSE;
}
result = nativeThis->QueryInterface(kIJSNativeInitializerIID, (void **)&initializer);
if (NS_OK == result) {
result = initializer->Initialize(cx, argc, argv);
NS_RELEASE(initializer);
if (NS_OK != result) {
NS_RELEASE(nativeThis);
return JS_FALSE;
}
}
result = nativeThis->QueryInterface(kIScriptObjectOwnerIID, (void **)&owner);
if (NS_OK != result) {
NS_RELEASE(nativeThis);
return JS_FALSE;
}
owner->SetScriptObject((void *)obj);
JS_SetPrivate(cx, obj, nativeThis);
NS_RELEASE(owner);
return JS_TRUE;
}
//
// RDFCore class initialization
//
extern "C" NS_DOM nsresult NS_InitRDFCoreClass(nsIScriptContext *aContext, void **aPrototype)
{
JSContext *jscontext = (JSContext *)aContext->GetNativeContext();
JSObject *proto = nsnull;
JSObject *constructor = nsnull;
JSObject *parent_proto = nsnull;
JSObject *global = JS_GetGlobalObject(jscontext);
jsval vp;
if ((PR_TRUE != JS_LookupProperty(jscontext, global, "RDFCore", &vp)) ||
!JSVAL_IS_OBJECT(vp) ||
((constructor = JSVAL_TO_OBJECT(vp)) == nsnull) ||
(PR_TRUE != JS_LookupProperty(jscontext, JSVAL_TO_OBJECT(vp), "prototype", &vp)) ||
!JSVAL_IS_OBJECT(vp)) {
if (NS_OK != NS_InitBaseAppCoreClass(aContext, (void **)&parent_proto)) {
return NS_ERROR_FAILURE;
}
proto = JS_InitClass(jscontext, // context
global, // global object
parent_proto, // parent proto
&RDFCoreClass, // JSClass
RDFCore, // JSNative ctor
0, // ctor args
RDFCoreProperties, // proto props
RDFCoreMethods, // proto funcs
nsnull, // ctor props (static)
nsnull); // ctor funcs (static)
if (nsnull == proto) {
return NS_ERROR_FAILURE;
}
}
else if ((nsnull != constructor) && JSVAL_IS_OBJECT(vp)) {
proto = JSVAL_TO_OBJECT(vp);
}
else {
return NS_ERROR_FAILURE;
}
if (aPrototype) {
*aPrototype = proto;
}
return NS_OK;
}
//
// Method for creating a new RDFCore JavaScript object
//
extern "C" NS_DOM nsresult NS_NewScriptRDFCore(nsIScriptContext *aContext, nsISupports *aSupports, nsISupports *aParent, void **aReturn)
{
NS_PRECONDITION(nsnull != aContext && nsnull != aSupports && nsnull != aReturn, "null argument to NS_NewScriptRDFCore");
JSObject *proto;
JSObject *parent;
nsIScriptObjectOwner *owner;
JSContext *jscontext = (JSContext *)aContext->GetNativeContext();
nsresult result = NS_OK;
nsIDOMRDFCore *aRDFCore;
if (nsnull == aParent) {
parent = nsnull;
}
else if (NS_OK == aParent->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
if (NS_OK != owner->GetScriptObject(aContext, (void **)&parent)) {
NS_RELEASE(owner);
return NS_ERROR_FAILURE;
}
NS_RELEASE(owner);
}
else {
return NS_ERROR_FAILURE;
}
if (NS_OK != NS_InitRDFCoreClass(aContext, (void **)&proto)) {
return NS_ERROR_FAILURE;
}
result = aSupports->QueryInterface(kIRDFCoreIID, (void **)&aRDFCore);
if (NS_OK != result) {
return result;
}
// create a js object for this class
*aReturn = JS_NewObject(jscontext, &RDFCoreClass, proto, parent);
if (nsnull != *aReturn) {
// connect the native object to the js object
JS_SetPrivate(jscontext, (JSObject *)*aReturn, aRDFCore);
}
else {
NS_RELEASE(aRDFCore);
return NS_ERROR_FAILURE;
}
return NS_OK;
}

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

@ -1,173 +0,0 @@
/* -*- 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 "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.
*/
#include "nsCOMPtr.h"
#include "nsRDFCore.h"
#include "nsIBrowserWindow.h"
#include "nsIWebShell.h"
#include "pratom.h"
#include "nsIComponentManager.h"
#include "nsAppCores.h"
#include "nsAppCoresCIDs.h"
#include "nsAppCoresManager.h"
#include "nsIScriptContext.h"
#include "nsIScriptContextOwner.h"
#include "nsIDOMDocument.h"
#include "nsIDocument.h"
#include "nsIDOMWindow.h"
#include "nsIServiceManager.h"
#include "nsRDFCID.h"
#include "rdf.h"
#include "nsIXULSortService.h"
#include "nsIRDFService.h"
// Globals
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
static NS_DEFINE_IID(kIRDFCoreIID, NS_IDOMRDFCORE_IID);
static NS_DEFINE_IID(kIDOMDocumentIID, nsIDOMDocument::GetIID());
static NS_DEFINE_IID(kIDocumentIID, nsIDocument::GetIID());
static NS_DEFINE_CID(kRDFCoreCID, NS_RDFCORE_CID);
static NS_DEFINE_CID(kBrowserWindowCID, NS_BROWSER_WINDOW_CID);
static NS_DEFINE_CID(kXULSortServiceCID, NS_XULSORTSERVICE_CID);
static NS_DEFINE_IID(kIXULSortServiceIID, NS_IXULSORTSERVICE_IID);
static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
/////////////////////////////////////////////////////////////////////////
// nsRDFCore
/////////////////////////////////////////////////////////////////////////
nsRDFCore::nsRDFCore()
{
mScriptObject = nsnull;
mScriptContext = nsnull;
/*
mWindow = nsnull;
*/
IncInstanceCount();
NS_INIT_REFCNT();
}
nsRDFCore::~nsRDFCore()
{
NS_IF_RELEASE(mScriptContext);
/*
NS_IF_RELEASE(mWindow);
*/
DecInstanceCount();
}
NS_IMPL_ADDREF(nsRDFCore)
NS_IMPL_RELEASE(nsRDFCore)
NS_IMETHODIMP
nsRDFCore::QueryInterface(REFNSIID aIID,void** aInstancePtr)
{
if (aInstancePtr == NULL) {
return NS_ERROR_NULL_POINTER;
}
// Always NULL result, in case of failure
*aInstancePtr = NULL;
if ( aIID.Equals(kIRDFCoreIID) ) {
*aInstancePtr = (void*) ((nsIDOMRDFCore*)this);
AddRef();
return NS_OK;
}
return nsBaseAppCore::QueryInterface(aIID, aInstancePtr);
}
NS_IMETHODIMP
nsRDFCore::GetScriptObject(nsIScriptContext *aContext, void** aScriptObject)
{
NS_PRECONDITION(nsnull != aScriptObject, "null arg");
nsresult res = NS_OK;
if (nsnull == mScriptObject)
{
res = NS_NewScriptRDFCore(aContext,
(nsISupports *)(nsIDOMRDFCore*)this,
nsnull,
&mScriptObject);
}
*aScriptObject = mScriptObject;
return res;
}
NS_IMETHODIMP
nsRDFCore::Init(const nsString& aId)
{
nsBaseAppCore::Init(aId);
return NS_OK;
}
NS_IMETHODIMP
nsRDFCore::DoSort(nsIDOMNode* node, const nsString& sortResource,
const nsString &sortDirection)
{
/*
if (nsnull == mScriptContext) {
return NS_ERROR_FAILURE;
}
*/
printf("----------------------------\n");
printf("-- Sort \n");
printf("-- Column: %s \n", sortResource.ToNewCString());
printf("-- Direction: %s \n", sortDirection.ToNewCString());
printf("----------------------------\n");
nsIXULSortService *XULSortService = nsnull;
nsresult rv = nsServiceManager::GetService(kXULSortServiceCID,
kIXULSortServiceIID, (nsISupports**) &XULSortService);
if (NS_SUCCEEDED(rv))
{
if (nsnull != XULSortService)
{
XULSortService->Sort(node, nsCAutoString(sortResource), nsCAutoString(sortDirection));
nsServiceManager::ReleaseService(kXULSortServiceCID, XULSortService);
}
}
/*
if (nsnull != mScriptContext) {
const char* url = "";
PRBool isUndefined = PR_FALSE;
nsString rVal;
mScriptContext->EvaluateString(mScript, url, 0, rVal, &isUndefined);
}
*/
return(rv);
}

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

@ -1,62 +0,0 @@
/* -*- 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 nsRDFCorePrivate_h___
#define nsRDFCorePrivate_h___
//#include "nsAppCores.h"
#include "nscore.h"
#include "nsString.h"
#include "nsISupports.h"
#include "nsIDOMRDFCore.h"
#include "nsBaseAppCore.h"
class nsIScriptContext;
class nsIDOMNode;
////////////////////////////////////////////////////////////////////////////////
// nsRDFCore:
////////////////////////////////////////////////////////////////////////////////
class nsRDFCore : public nsBaseAppCore,
public nsIDOMRDFCore
{
public:
nsRDFCore();
virtual ~nsRDFCore();
NS_DECL_ISUPPORTS
NS_IMETHOD GetScriptObject(nsIScriptContext *aContext, void** aScriptObject);
NS_IMETHOD Init(const nsString& aId);
NS_IMETHOD GetId(nsString& aId) { return nsBaseAppCore::GetId(aId); }
NS_IMETHOD SetDocumentCharset(const nsString& aCharset) { return nsBaseAppCore::SetDocumentCharset(aCharset); }
NS_IMETHOD DoSort(nsIDOMNode* node, const nsString& sortResource, const nsString& sortDirection);
protected:
nsString mScript;
nsIScriptContext *mScriptContext;
};
#endif // nsRDFCore_h___

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

@ -1,126 +0,0 @@
/* -*- 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 "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.
*/
#include "nsAppCores.h"
#include "nsRDFCoreFactory.h"
#include "nsRDFCore.h"
#include "pratom.h"
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
/////////////////////////////////////////////////////////////////////////
// nsRDFCoreFactory
/////////////////////////////////////////////////////////////////////////
nsRDFCoreFactory::nsRDFCoreFactory(void)
{
mRefCnt=0;
IncInstanceCount();
}
nsRDFCoreFactory::~nsRDFCoreFactory(void)
{
DecInstanceCount();
}
NS_IMETHODIMP
nsRDFCoreFactory::QueryInterface(REFNSIID aIID,void** aInstancePtr)
{
if (aInstancePtr == NULL)
{
return NS_ERROR_NULL_POINTER;
}
// Always NULL result, in case of failure
*aInstancePtr = NULL;
if ( aIID.Equals(kISupportsIID) )
{
*aInstancePtr = (void*) this;
}
else if ( aIID.Equals(kIFactoryIID) )
{
*aInstancePtr = (void*) this;
}
if (aInstancePtr == NULL)
{
return NS_ERROR_NO_INTERFACE;
}
AddRef();
return NS_OK;
}
NS_IMPL_ADDREF(nsRDFCoreFactory)
NS_IMETHODIMP_(nsrefcnt)
nsRDFCoreFactory::Release(void)
{
if (--mRefCnt ==0)
{
// delete this;
return 0; // Don't access mRefCnt after deleting!
}
return mRefCnt;
}
NS_IMETHODIMP
nsRDFCoreFactory::CreateInstance(nsISupports *aOuter, REFNSIID aIID, void **aResult)
{
if (aResult == NULL)
{
return NS_ERROR_NULL_POINTER;
}
*aResult = NULL;
/* do I have to use iSupports? */
nsRDFCore *inst = new nsRDFCore();
if (inst == NULL)
return NS_ERROR_OUT_OF_MEMORY;
nsresult result = inst->QueryInterface(aIID, aResult);
if (result != NS_OK)
delete inst;
return result;
}
NS_IMETHODIMP
nsRDFCoreFactory::LockFactory(PRBool aLock)
{
if (aLock)
IncLockCount();
else
DecLockCount();
return NS_OK;
}

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

@ -1,49 +0,0 @@
/* -*- 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 nsRDFCoreFactory_h___
#define nsRDFCoreFactory_h___
//#include "nscore.h"
//#include "nsString.h"
#include "nsIFactory.h"
#include "nsISupports.h"
////////////////////////////////////////////////////////////////////////////////
// nsRDFCoreFactory:
////////////////////////////////////////////////////////////////////////////////
class nsRDFCoreFactory : public nsIFactory
{
public:
nsRDFCoreFactory();
virtual ~nsRDFCoreFactory();
PRBool CanUnload(void);
NS_DECL_ISUPPORTS
NS_IMETHOD CreateInstance(nsISupports *aOuter,
REFNSIID aIID,
void **aResult);
NS_IMETHOD LockFactory(PRBool aLock);
};
#endif // nsRDFCoreFactory_h___