Back to index

lightning-sunbird  0.9+nobinonly
Classes | Functions
nsFrameTraversal.cpp File Reference
#include "nsCOMPtr.h"
#include "nsLayoutAtoms.h"
#include "nsFrameTraversal.h"
#include "nsFrameList.h"
#include "nsPlaceholderFrame.h"

Go to the source code of this file.

Classes

class  nsFrameIterator
class  nsLeafIterator
class  nsFocusIterator

Functions

nsresult NS_CreateFrameTraversal (nsIFrameTraversal **aResult)
nsresult NS_NewFrameTraversal (nsIBidirectionalEnumerator **aEnumerator, nsTraversalType aType, nsPresContext *aPresContext, nsIFrame *aStart, PRBool aLockInScrollView)
static PRBool IsRootFrame (nsIFrame *aFrame)

Function Documentation

static PRBool IsRootFrame ( nsIFrame aFrame) [static]

Definition at line 335 of file nsFrameTraversal.cpp.

{
  nsIAtom* atom = aFrame->GetType();
  return (atom == nsLayoutAtoms::canvasFrame) ||
         (atom == nsLayoutAtoms::rootFrame);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 168 of file nsFrameTraversal.cpp.

{
  NS_ENSURE_ARG_POINTER(aResult);
  *aResult = nsnull;

  nsCOMPtr<nsIFrameTraversal> t(new nsFrameTraversal());
  if (!t)
    return NS_ERROR_OUT_OF_MEMORY;

  *aResult = t;
  NS_ADDREF(*aResult);

  return NS_OK;
}

Here is the call graph for this function:

nsresult NS_NewFrameTraversal ( nsIBidirectionalEnumerator **  aEnumerator,
nsTraversalType  aType,
nsPresContext aPresContext,
nsIFrame aStart,
PRBool  aLockInScrollView 
)

Definition at line 184 of file nsFrameTraversal.cpp.

{
  if (!aEnumerator || !aStart)
    return NS_ERROR_NULL_POINTER;
  switch(aType)
  {
  case LEAF: {
    nsLeafIterator *trav = new nsLeafIterator(aPresContext, aStart);
    if (!trav)
      return NS_ERROR_OUT_OF_MEMORY;
    trav->SetLockInScrollView(aLockInScrollView);
    *aEnumerator = NS_STATIC_CAST(nsIBidirectionalEnumerator*, trav);
    NS_ADDREF(trav);
    trav->SetExtensive(PR_FALSE);
  }
  break;
  case EXTENSIVE:{
    nsLeafIterator *trav = new nsLeafIterator(aPresContext, aStart);
    if (!trav)
      return NS_ERROR_OUT_OF_MEMORY;
    *aEnumerator = NS_STATIC_CAST(nsIBidirectionalEnumerator*, trav);
    NS_ADDREF(trav);
    trav->SetExtensive(PR_TRUE);
  }
  break;
  case FOCUS: {
    nsFocusIterator *trav = new nsFocusIterator(aPresContext, aStart);
    if (!trav)
      return NS_ERROR_OUT_OF_MEMORY;
    *aEnumerator = NS_STATIC_CAST(nsIBidirectionalEnumerator*, trav);
    NS_ADDREF(trav);
  }
  break;
#ifdef IBMBIDI
  case VISUAL:{
    nsVisualIterator *trav = new nsVisualIterator(aPresContext, aStart);
    if (!trav)
      return NS_ERROR_OUT_OF_MEMORY;
    *aEnumerator = NS_STATIC_CAST(nsIBidirectionalEnumerator*, trav);
    NS_ADDREF(trav);
              }
    break;
#endif
#if 0
  case FASTEST:{
    nsFastestTraversal *trav = new nsFastestTraversal(aStart);
    if (!trav)
      return NS_ERROR_NOMEMORY;
    *aEnumerator = NS_STATIC_CAST(nsIBidirectionalEnumerator*, trav);
    NS_ADDREF(trav);
               }
#endif
  default:
    return NS_ERROR_NOT_IMPLEMENTED;
    break;
  }
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function: