Back to index

lightning-sunbird  0.9+nobinonly
Functions
nsSVGGradient.h File Reference
#include "nsISVGGradient.h"
#include "nsIURI.h"
#include "nsIContent.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

nsresult NS_GetSVGGradient (nsISVGGradient **result, nsIURI *aURI, nsIContent *aContent, nsIPresShell *aPresShell)
nsresult NS_NewSVGLinearGradientFrame (nsIPresShell *aPresShell, nsIContent *aContent, nsIFrame **aNewFrame)
nsresult NS_NewSVGRadialGradientFrame (nsIPresShell *aPresShell, nsIContent *aContent, nsIFrame **aNewFrame)

Function Documentation

nsresult NS_GetSVGGradient ( nsISVGGradient **  result,
nsIURI aURI,
nsIContent aContent,
nsIPresShell aPresShell 
)

Definition at line 1303 of file nsSVGGradientFrame.cpp.

{
  *aGrad = nsnull;

  // Get the spec from the URI
  nsCAutoString uriSpec;
  aURI->GetSpec(uriSpec);
#ifdef DEBUG_scooter
  printf("NS_GetSVGGradient: uri = %s\n",uriSpec.get());
#endif
  nsIFrame *result;
  if (!NS_SUCCEEDED(nsSVGUtils::GetReferencedFrame(&result, 
                                                   uriSpec, aContent, aPresShell))) {
    return NS_ERROR_FAILURE;
  }
  return result->QueryInterface(NS_GET_IID(nsISVGGradient), (void **)aGrad);
}

Here is the call graph for this function:

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;
}
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;
}