Back to index

lightning-sunbird  0.9+nobinonly
Functions
nsSVGMarkerFrame.cpp File Reference
#include "nsIDOMSVGFitToViewBox.h"
#include "nsIDOMSVGAnimatedLength.h"
#include "nsIDOMSVGAnimatedEnum.h"
#include "nsIDOMSVGAnimatedAngle.h"
#include "nsIDOMSVGAnimatedRect.h"
#include "nsIDOMSVGAngle.h"
#include "nsIDOMSVGLength.h"
#include "nsIDOMSVGPoint.h"
#include "nsIDOMSVGRect.h"
#include "nsIDOMSVGRectElement.h"
#include "nsIDOMSVGElement.h"
#include "nsIDOMSVGSVGElement.h"
#include "nsISVGRendererPathBuilder.h"
#include "nsSVGDefsFrame.h"
#include "nsISVGValue.h"
#include "nsIDOMSVGMarkerElement.h"
#include "nsIDOMDocument.h"
#include "nsIDocument.h"
#include "nsSVGMarkerFrame.h"
#include "nsSVGPathGeometryFrame.h"
#include "nsISVGRendererCanvas.h"
#include "nsSVGUtils.h"
#include "nsSVGMatrix.h"

Go to the source code of this file.

Functions

nsresult NS_NewSVGMarkerFrame (nsIPresShell *aPresShell, nsIContent *aContent, nsIFrame **aNewFrame)
nsresult NS_GetSVGMarkerFrame (nsSVGMarkerFrame **aResult, nsIURI *aURI, nsIContent *aContent)

Function Documentation

nsresult NS_GetSVGMarkerFrame ( nsSVGMarkerFrame **  aResult,
nsIURI aURI,
nsIContent aContent 
)

Definition at line 104 of file nsSVGMarkerFrame.cpp.

{
  *aResult = nsnull;

  // Get the PresShell
  nsIDocument *myDoc = aContent->GetCurrentDoc();
  if (!myDoc) {
    NS_WARNING("No document for this content!");
    return NS_ERROR_FAILURE;
  }
  nsIPresShell *aPresShell = myDoc->GetShellAt(0);

  // Get the URI Spec
  nsCAutoString uriSpec;
  aURI->GetSpec(uriSpec);

  // Find the referenced frame
  nsIFrame *marker;
  if (!NS_SUCCEEDED(nsSVGUtils::GetReferencedFrame(&marker, 
                                                   uriSpec, aContent, aPresShell)))
    return NS_ERROR_FAILURE;

  nsIAtom* frameType = marker->GetType();
  if (frameType != nsLayoutAtoms::svgMarkerFrame)
    return NS_ERROR_FAILURE;

  *aResult = (nsSVGMarkerFrame *)marker;
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult NS_NewSVGMarkerFrame ( nsIPresShell aPresShell,
nsIContent aContent,
nsIFrame **  aNewFrame 
)

Definition at line 90 of file nsSVGMarkerFrame.cpp.

{
  *aNewFrame = nsnull;

  nsSVGMarkerFrame* it = new (aPresShell) nsSVGMarkerFrame;
  if (nsnull == it)
    return NS_ERROR_OUT_OF_MEMORY;

  *aNewFrame = it;

  return NS_OK;
}