Back to index

lightning-sunbird  0.9+nobinonly
Classes | Functions | Variables
nsGfxScrollFrame.cpp File Reference
#include "nsCOMPtr.h"
#include "nsHTMLParts.h"
#include "nsPresContext.h"
#include "nsReflowType.h"
#include "nsIDeviceContext.h"
#include "nsPageFrame.h"
#include "nsViewsCID.h"
#include "nsIServiceManager.h"
#include "nsIView.h"
#include "nsIScrollableView.h"
#include "nsIScrollable.h"
#include "nsIViewManager.h"
#include "nsHTMLContainerFrame.h"
#include "nsWidgetsCID.h"
#include "nsGfxScrollFrame.h"
#include "nsLayoutAtoms.h"
#include "nsXULAtoms.h"
#include "nsHTMLAtoms.h"
#include "nsINameSpaceManager.h"
#include "nsISupportsArray.h"
#include "nsIDocument.h"
#include "nsIFontMetrics.h"
#include "nsIDocumentObserver.h"
#include "nsBoxLayoutState.h"
#include "nsINodeInfo.h"
#include "nsIScrollbarFrame.h"
#include "nsIScrollbarMediator.h"
#include "nsITextControlFrame.h"
#include "nsIDOMHTMLTextAreaElement.h"
#include "nsNodeInfoManager.h"
#include "nsIURI.h"
#include "nsGUIEvent.h"
#include "nsContentCreatorFunctions.h"
#include "nsISupportsPrimitives.h"
#include "nsIPresShell.h"
#include "nsIEventQueueService.h"
#include "nsReflowPath.h"
#include "nsAutoPtr.h"
#include "nsPresState.h"

Go to the source code of this file.

Classes

struct  ScrollReflowState
 HTML scrolling implementation. More...
struct  nsAsyncScrollPortEvent

Functions

nsresult NS_NewHTMLScrollFrame (nsIPresShell *aPresShell, nsIFrame **aNewFrame, PRBool aIsRoot)
static nsSize ComputeInsideBorderSize (ScrollReflowState *aState, const nsSize &aDesiredInsideBorderSize)
static void GetScrollbarMetrics (nsBoxLayoutState &aState, nsIBox *aBox, nsSize *aMin, nsSize *aPref, PRBool aVertical)
nsresult NS_NewXULScrollFrame (nsIPresShell *aPresShell, nsIFrame **aNewFrame, PRBool aIsRoot)
 NS_IMETHODIMP_ (nsrefcnt) nsGfxScrollFrameInner
static void HandleScrollPref (nsIScrollable *aScrollable, PRInt32 aOrientation, PRUint8 &aValue)
static void *PR_CALLBACK HandleAsyncScrollPortEvent (PLEvent *aEvent)
static void PR_CALLBACK DestroyAsyncScrollPortEvent (PLEvent *aEvent)
 PR_STATIC_CALLBACK (void *) HandleScrollEvent(PLEvent *aEvent)
 PR_STATIC_CALLBACK (void) DestroyScrollEvent(PLEvent *aEvent)

Variables

static const char kEventQueueServiceCID [] = NS_EVENTQUEUESERVICE_CONTRACTID

Function Documentation

static nsSize ComputeInsideBorderSize ( ScrollReflowState aState,
const nsSize aDesiredInsideBorderSize 
) [static]

Definition at line 290 of file nsGfxScrollFrame.cpp.

{
  // aDesiredInsideBorderSize is the frame size; i.e., it includes
  // borders and padding (but the scrolled child doesn't have
  // borders). The scrolled child has the same padding as us.
  nscoord contentWidth = aState->mReflowState.mComputedWidth;
  if (contentWidth == NS_UNCONSTRAINEDSIZE) {
    contentWidth = aDesiredInsideBorderSize.width -
      aState->mReflowState.mComputedPadding.LeftRight();
  }
  nscoord contentHeight = aState->mReflowState.mComputedHeight;
  if (contentHeight == NS_UNCONSTRAINEDSIZE) {
    contentHeight = aDesiredInsideBorderSize.height -
      aState->mReflowState.mComputedPadding.TopBottom();
  }

  aState->mReflowState.ApplyMinMaxConstraints(&contentWidth, &contentHeight);
  return nsSize(contentWidth + aState->mReflowState.mComputedPadding.LeftRight(),
                contentHeight + aState->mReflowState.mComputedPadding.TopBottom());
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void PR_CALLBACK DestroyAsyncScrollPortEvent ( PLEvent aEvent) [static]

Definition at line 1569 of file nsGfxScrollFrame.cpp.

{
  delete NS_STATIC_CAST(nsAsyncScrollPortEvent*, aEvent);
}

Here is the caller graph for this function:

static void GetScrollbarMetrics ( nsBoxLayoutState aState,
nsIBox *  aBox,
nsSize aMin,
nsSize aPref,
PRBool  aVertical 
) [static]

Definition at line 313 of file nsGfxScrollFrame.cpp.

{
  if (aMin) {
    aBox->GetMinSize(aState, *aMin);
    nsBox::AddMargin(aBox, *aMin);
  }
 
  if (aPref) {
    aBox->GetPrefSize(aState, *aPref);
    nsBox::AddMargin(aBox, *aPref);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void* PR_CALLBACK HandleAsyncScrollPortEvent ( PLEvent aEvent) [static]

Definition at line 1564 of file nsGfxScrollFrame.cpp.

{
  NS_STATIC_CAST(nsAsyncScrollPortEvent*, aEvent)->HandleEvent();
  return nsnull;
}

Here is the caller graph for this function:

static void HandleScrollPref ( nsIScrollable aScrollable,
PRInt32  aOrientation,
PRUint8 aValue 
) [static]

Definition at line 1422 of file nsGfxScrollFrame.cpp.

{
  PRInt32 pref;
  aScrollable->GetDefaultScrollbarPreferences(aOrientation, &pref);
  switch (pref) {
    case nsIScrollable::Scrollbar_Auto:
      // leave |aValue| untouched
      break;
    case nsIScrollable::Scrollbar_Never:
      aValue = NS_STYLE_OVERFLOW_HIDDEN;
      break;
    case nsIScrollable::Scrollbar_Always:
      aValue = NS_STYLE_OVERFLOW_SCROLL;
      break;
  }
}

Here is the caller graph for this function:

Definition at line 1342 of file nsGfxScrollFrame.cpp.

{
  return 1;
}
nsresult NS_NewHTMLScrollFrame ( nsIPresShell aPresShell,
nsIFrame **  aNewFrame,
PRBool  aIsRoot 
)

Definition at line 89 of file nsGfxScrollFrame.cpp.

{
  NS_PRECONDITION(aNewFrame, "null OUT ptr");
  if (nsnull == aNewFrame) {
    return NS_ERROR_NULL_POINTER;
  }
  nsHTMLScrollFrame* it = new (aPresShell) nsHTMLScrollFrame(aPresShell, aIsRoot);
  if (nsnull == it) {
    return NS_ERROR_OUT_OF_MEMORY;
  }
  *aNewFrame = it;
  return NS_OK;
}

Here is the caller graph for this function:

nsresult NS_NewXULScrollFrame ( nsIPresShell aPresShell,
nsIFrame **  aNewFrame,
PRBool  aIsRoot 
)

Definition at line 914 of file nsGfxScrollFrame.cpp.

{
  NS_PRECONDITION(aNewFrame, "null OUT ptr");
  if (nsnull == aNewFrame) {
    return NS_ERROR_NULL_POINTER;
  }
  nsXULScrollFrame* it = new (aPresShell) nsXULScrollFrame(aPresShell, aIsRoot);
  if (nsnull == it) {
    return NS_ERROR_OUT_OF_MEMORY;
  }
  *aNewFrame = it;
  return NS_OK;
}

Here is the caller graph for this function:

Definition at line 1859 of file nsGfxScrollFrame.cpp.

{
  NS_ASSERTION(nsnull != aEvent,"Event is null");
  nsGfxScrollFrameInner* inner = NS_STATIC_CAST(nsGfxScrollFrameInner*, aEvent->owner);
  inner->FireScrollEvent();
  return nsnull;
}

Definition at line 1867 of file nsGfxScrollFrame.cpp.

{
  NS_ASSERTION(nsnull != aEvent,"Event is null");
  delete aEvent;
}

Variable Documentation

Definition at line 82 of file nsGfxScrollFrame.cpp.