Work in progress to integrate Keith Visco's XSL processor, Transformiix, into Gecko. All code is protected by #ifdef XSL and will not affect the build.
This commit is contained in:
Родитель
e1e0ac9466
Коммит
8bd80641a6
|
@ -21,7 +21,13 @@ LIBRARY_NAME=raptorxsldoc_s
|
|||
MODULE=raptor
|
||||
REQUIRES=xpcom raptor pref
|
||||
|
||||
DEFINES=-D_IMPL_NS_HTML -DWIN32_LEAN_AND_MEAN
|
||||
DEFINES=-D_IMPL_NS_HTML -DWIN32_LEAN_AND_MEAN \
|
||||
!if defined(MOZ_XSL)
|
||||
-DXSL
|
||||
!endif
|
||||
|
||||
XPIDLSRCS= .\nsIDocumentTransformer.idl \
|
||||
$(NULL)
|
||||
|
||||
CPPSRCS= \
|
||||
nsXSLContentSink.cpp \
|
||||
|
@ -34,7 +40,6 @@ CPP_OBJS= \
|
|||
$(NULL)
|
||||
|
||||
EXPORTS = \
|
||||
nsIDocumentTransformer.h \
|
||||
nsITransformMediator.h \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
/* -*- 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.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 "nsISupports.idl"
|
||||
|
||||
interface nsIDOMElement;
|
||||
interface nsIDOMDocument;
|
||||
interface nsIObserver;
|
||||
|
||||
/**
|
||||
* This interface should be implemented by any object that wants to
|
||||
* transform the content model of the current document before the
|
||||
* document is displayed. One possible implementor of this interface
|
||||
* is an XSL processor.
|
||||
*/
|
||||
|
||||
[scriptable, uuid(3fbff728-2d20-11d3-aef3-00108300ff91)]
|
||||
interface nsIDocumentTransformer : nsISupports
|
||||
{
|
||||
void TransformDocument(in nsIDOMElement aSourceDOM,
|
||||
in nsIDOMElement aStyleDOM,
|
||||
in nsIDOMDocument aOutputDOC,
|
||||
in nsIObserver aObserver);
|
||||
};
|
||||
|
||||
|
||||
%{ C++
|
||||
extern nsresult
|
||||
NS_NewDocumentTransformer(nsIDocumentTransformer** aDocTransformer);
|
||||
%}
|
|
@ -21,9 +21,8 @@
|
|||
#include "nsIComponentManager.h"
|
||||
|
||||
static NS_DEFINE_IID(kITransformMediatorIID, NS_ITRANSFORM_MEDIATOR_IID);
|
||||
static NS_DEFINE_IID(kIDocumentTransformerIID, NS_IDOCUMENT_TRANSFORMER_IID);
|
||||
|
||||
const char* kTransformerProgIDPrefix = "component://netscape/document-converter?type=";
|
||||
const char* kTransformerProgIDPrefix = "component://netscape/document-transformer?type=";
|
||||
|
||||
nsresult
|
||||
NS_NewTransformMediator(nsITransformMediator** aResult,
|
||||
|
@ -90,7 +89,7 @@ nsTransformMediator::Init(const nsString& aMimeType)
|
|||
if (NS_SUCCEEDED(rv)) {
|
||||
// Try to find a component that implements the nsIDocumentTransformer interface
|
||||
rv = nsComponentManager::CreateInstance(cid, nsnull,
|
||||
kIDocumentTransformerIID, (void**) &mTransformer);
|
||||
NS_GET_IID(nsIDocumentTransformer), (void**) &mTransformer);
|
||||
}
|
||||
delete [] progIDStr;
|
||||
}
|
||||
|
|
|
@ -21,7 +21,13 @@ LIBRARY_NAME=raptorxsldoc_s
|
|||
MODULE=raptor
|
||||
REQUIRES=xpcom raptor pref
|
||||
|
||||
DEFINES=-D_IMPL_NS_HTML -DWIN32_LEAN_AND_MEAN
|
||||
DEFINES=-D_IMPL_NS_HTML -DWIN32_LEAN_AND_MEAN \
|
||||
!if defined(MOZ_XSL)
|
||||
-DXSL
|
||||
!endif
|
||||
|
||||
XPIDLSRCS= .\nsIDocumentTransformer.idl \
|
||||
$(NULL)
|
||||
|
||||
CPPSRCS= \
|
||||
nsXSLContentSink.cpp \
|
||||
|
@ -34,7 +40,6 @@ CPP_OBJS= \
|
|||
$(NULL)
|
||||
|
||||
EXPORTS = \
|
||||
nsIDocumentTransformer.h \
|
||||
nsITransformMediator.h \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
/* -*- 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.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 "nsISupports.idl"
|
||||
|
||||
interface nsIDOMElement;
|
||||
interface nsIDOMDocument;
|
||||
interface nsIObserver;
|
||||
|
||||
/**
|
||||
* This interface should be implemented by any object that wants to
|
||||
* transform the content model of the current document before the
|
||||
* document is displayed. One possible implementor of this interface
|
||||
* is an XSL processor.
|
||||
*/
|
||||
|
||||
[scriptable, uuid(3fbff728-2d20-11d3-aef3-00108300ff91)]
|
||||
interface nsIDocumentTransformer : nsISupports
|
||||
{
|
||||
void TransformDocument(in nsIDOMElement aSourceDOM,
|
||||
in nsIDOMElement aStyleDOM,
|
||||
in nsIDOMDocument aOutputDOC,
|
||||
in nsIObserver aObserver);
|
||||
};
|
||||
|
||||
|
||||
%{ C++
|
||||
extern nsresult
|
||||
NS_NewDocumentTransformer(nsIDocumentTransformer** aDocTransformer);
|
||||
%}
|
|
@ -21,9 +21,8 @@
|
|||
#include "nsIComponentManager.h"
|
||||
|
||||
static NS_DEFINE_IID(kITransformMediatorIID, NS_ITRANSFORM_MEDIATOR_IID);
|
||||
static NS_DEFINE_IID(kIDocumentTransformerIID, NS_IDOCUMENT_TRANSFORMER_IID);
|
||||
|
||||
const char* kTransformerProgIDPrefix = "component://netscape/document-converter?type=";
|
||||
const char* kTransformerProgIDPrefix = "component://netscape/document-transformer?type=";
|
||||
|
||||
nsresult
|
||||
NS_NewTransformMediator(nsITransformMediator** aResult,
|
||||
|
@ -90,7 +89,7 @@ nsTransformMediator::Init(const nsString& aMimeType)
|
|||
if (NS_SUCCEEDED(rv)) {
|
||||
// Try to find a component that implements the nsIDocumentTransformer interface
|
||||
rv = nsComponentManager::CreateInstance(cid, nsnull,
|
||||
kIDocumentTransformerIID, (void**) &mTransformer);
|
||||
NS_GET_IID(nsIDocumentTransformer), (void**) &mTransformer);
|
||||
}
|
||||
delete [] progIDStr;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче