Back to index

lightning-sunbird  0.9+nobinonly
Functions
nsSVGGradientFrame.h File Reference
#include "nsIFrame.h"
#include "nsIContent.h"
#include "nsIPresShell.h"

Go to the source code of this file.

Functions

nsresult NS_NewSVGLinearGradientFrame (nsIPresShell *aPresShell, nsIContent *aContent, nsIFrame **aNewFrame)
nsresult NS_NewSVGRadialGradientFrame (nsIPresShell *aPresShell, nsIContent *aContent, nsIFrame **aNewFrame)

Function Documentation

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

Definition at line 1229 of file nsSVGGradientFrame.cpp.

{
  *aNewFrame = nsnull;
  
  nsCOMPtr<nsIDOMSVGLinearGradientElement> grad = do_QueryInterface(aContent);
  NS_ASSERTION(grad, "NS_NewSVGLinearGradientFrame -- Content doesn't support nsIDOMSVGLinearGradient");
  if (!grad)
    return NS_ERROR_FAILURE;
  
  nsSVGLinearGradientFrame* it = new (aPresShell) nsSVGLinearGradientFrame;
  if (nsnull == it)
    return NS_ERROR_OUT_OF_MEMORY;

  nsCOMPtr<nsIDOMSVGURIReference> aRef = do_QueryInterface(aContent);
  NS_ASSERTION(aRef, "NS_NewSVGLinearGradientFrame -- Content doesn't support nsIDOMSVGURIReference");
  if (!aRef) {
    it->mNextGrad = nsnull;
  } else {
    // Get the hRef
    nsCOMPtr<nsIDOMSVGAnimatedString> aHref;
    aRef->GetHref(getter_AddRefs(aHref));

    nsAutoString aStr;
    aHref->GetAnimVal(aStr);
    it->mNextGradStr = aStr;
    it->mNextGrad = nsnull;
  }

  it->mLoopFlag = PR_FALSE;
  *aNewFrame = it;

  return NS_OK;
}

Here is the call graph for this function:

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

Definition at line 1265 of file nsSVGGradientFrame.cpp.

{
  *aNewFrame = nsnull;
  
  nsCOMPtr<nsIDOMSVGRadialGradientElement> grad = do_QueryInterface(aContent);
  NS_ASSERTION(grad, "NS_NewSVGRadialGradientFrame -- Content doesn't support nsIDOMSVGRadialGradient");
  if (!grad)
    return NS_ERROR_FAILURE;
  
  nsSVGRadialGradientFrame* it = new (aPresShell) nsSVGRadialGradientFrame;
  if (nsnull == it)
    return NS_ERROR_OUT_OF_MEMORY;

  nsCOMPtr<nsIDOMSVGURIReference> aRef = do_QueryInterface(aContent);
  NS_ASSERTION(aRef, "NS_NewSVGRadialGradientFrame -- Content doesn't support nsIDOMSVGURIReference");
  if (!aRef) {
    it->mNextGrad = nsnull;
  } else {
    // Get the hRef
    nsCOMPtr<nsIDOMSVGAnimatedString> aHref;
    aRef->GetHref(getter_AddRefs(aHref));

    nsAutoString aStr;
    aHref->GetAnimVal(aStr);
    it->mNextGradStr = aStr;
    it->mNextGrad = nsnull;
  }

  it->mLoopFlag = PR_FALSE;
  *aNewFrame = it;

  return NS_OK;
}

Here is the call graph for this function: