Back to index

lightning-sunbird  0.9+nobinonly
Classes | Typedefs | Functions
nsSVGGradientFrame.cpp File Reference
#include "nsSVGGenericContainerFrame.h"
#include "nsSVGGradient.h"
#include "nsIDOMDocument.h"
#include "nsIDocument.h"
#include "nsIDOMSVGStopElement.h"
#include "nsSVGAtoms.h"
#include "nsIDOMSVGLength.h"
#include "nsIDOMSVGAnimatedEnum.h"
#include "nsIDOMSVGAnimatedLength.h"
#include "nsIDOMSVGAnimatedNumber.h"
#include "nsIDOMSVGAnimatedString.h"
#include "nsIDOMSVGAnimTransformList.h"
#include "nsIDOMSVGTransformList.h"
#include "nsIDOMSVGNumber.h"
#include "nsIDOMSVGGradientElement.h"
#include "nsIDOMSVGURIReference.h"
#include "nsISVGValue.h"
#include "nsISVGValueUtils.h"
#include "nsStyleContext.h"
#include "nsSVGValue.h"
#include "nsNetUtil.h"
#include "nsINameSpaceManager.h"
#include "nsISVGChildFrame.h"
#include "nsIDOMSVGRect.h"
#include "nsSVGMatrix.h"
#include "nsISVGGeometrySource.h"
#include "nsISVGGradient.h"
#include "nsIURI.h"
#include "nsIContent.h"
#include "nsSVGNumber.h"
#include "nsSVGUtils.h"
#include "nsWeakReference.h"
#include "nsISVGValueObserver.h"

Go to the source code of this file.

Classes

class  nsSVGGradientFrame
class  nsSVGLinearGradientFrame
class  nsSVGRadialGradientFrame

Typedefs

typedef nsSVGGenericContainerFrame nsSVGGradientFrameBase
typedef nsSVGGradientFrame nsSVGLinearGradientFrameBase
typedef nsSVGGradientFrame nsSVGRadialGradientFrameBase

Functions

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

Typedef Documentation

Definition at line 74 of file nsSVGGradientFrame.cpp.

Definition at line 177 of file nsSVGGradientFrame.cpp.

Definition at line 227 of file nsSVGGradientFrame.cpp.


Function Documentation

nsresult NS_GetSVGGradient ( nsISVGGradient **  aGrad,
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;
}

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: