diff --git a/layout/svg/base/src/Makefile.in b/layout/svg/base/src/Makefile.in index 95da3f44b437..5e7d1e44580c 100644 --- a/layout/svg/base/src/Makefile.in +++ b/layout/svg/base/src/Makefile.in @@ -33,6 +33,7 @@ CPPSRCS = \ nsSVGContainerFrame.cpp \ nsPolygonFrame.cpp \ nsPolylineFrame.cpp \ + nsSVGPathFrame.cpp \ $(NULL) include $(topsrcdir)/config/config.mk diff --git a/layout/svg/base/src/makefile.win b/layout/svg/base/src/makefile.win index 41ccceb6f490..08d5bd8b0b51 100644 --- a/layout/svg/base/src/makefile.win +++ b/layout/svg/base/src/makefile.win @@ -31,12 +31,14 @@ CPPSRCS= \ nsSVGContainerFrame.cpp \ nsPolygonFrame.cpp \ nsPolylineFrame.cpp \ + nsSVGPathFrame.cpp \ $(NULL) CPP_OBJS= \ .\$(OBJDIR)\nsSVGContainerFrame.obj \ .\$(OBJDIR)\nsPolygonFrame.obj \ .\$(OBJDIR)\nsPolylineFrame.obj \ + .\$(OBJDIR)\nsSVGPathFrame.obj \ $(NULL) EXPORTS = \ diff --git a/layout/svg/base/src/nsSVGPathFrame.cpp b/layout/svg/base/src/nsSVGPathFrame.cpp new file mode 100644 index 000000000000..441057617ba3 --- /dev/null +++ b/layout/svg/base/src/nsSVGPathFrame.cpp @@ -0,0 +1,65 @@ +/* -*- 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.1 (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.org 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. + * + * Contributor(s): + */ + + +#include "nsSVGPathFrame.h" + +#include "nsIDOMElement.h" +#include "nsIContent.h" +#include "prtypes.h" +#include "nsIAtom.h" +#include "nsHTMLAtoms.h" +#include "nsIPresContext.h" +#include "nsIStyleContext.h" +#include "nsCSSRendering.h" +#include "nsINameSpaceManager.h" +#include "nsColor.h" +#include "nsIServiceManager.h" +#include "nsPoint.h" +#include "nsSVGAtoms.h" +#include "nsIDeviceContext.h" +//#include "nsSVGPathCID.h" +// +// NS_NewSVGPathFrame +// +// Wrapper for creating a new color picker +// +nsresult +NS_NewSVGPathFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame) +{ + NS_PRECONDITION(aNewFrame, "null OUT ptr"); + if (nsnull == aNewFrame) { + return NS_ERROR_NULL_POINTER; + } + nsSVGPathFrame* it = new (aPresShell) nsSVGPathFrame; + if ( !it ) + return NS_ERROR_OUT_OF_MEMORY; + *aNewFrame = it; + return NS_OK; +} + +NS_METHOD nsSVGPathFrame::RenderPoints(nsIRenderingContext& aRenderingContext, + const nsPoint aPoints[], PRInt32 aNumPoints) +{ + // draw path here + return NS_OK; +} diff --git a/layout/svg/base/src/nsSVGPathFrame.h b/layout/svg/base/src/nsSVGPathFrame.h new file mode 100644 index 000000000000..f68cca678f35 --- /dev/null +++ b/layout/svg/base/src/nsSVGPathFrame.h @@ -0,0 +1,51 @@ +/* -*- 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.1 (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.org 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. + * + * Contributor(s): + */ + +// +// nsSVGPathFrame +// + +#ifndef nsSVGPathFrame_h__ +#define nsSVGPathFrame_h__ + + +#include "nsPolygonFrame.h" + +class nsString; + + +nsresult NS_NewSVGPathFrame(nsIPresShell* aPresShell, nsIFrame** aResult) ; + + +// XXX - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +// This should NOT be derived from nsLeafFrame +// we really want to create our own container class from the nsIFrame +// interface and not derive from any HTML Frames +// XXX - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +class nsSVGPathFrame : public nsPolygonFrame +{ + NS_IMETHOD RenderPoints(nsIRenderingContext& aRenderingContext, + const nsPoint aPoints[], PRInt32 aNumPoints); + +}; // class nsSVGPathFrame + +#endif diff --git a/layout/svg/tests/example.xml b/layout/svg/tests/example.xml index ef51ccd99315..f566e8201856 100644 --- a/layout/svg/tests/example.xml +++ b/layout/svg/tests/example.xml @@ -10,7 +10,7 @@ Simple Polygons A Simple Graph +