本文整理汇总了C++中nsDisplayListSet类的典型用法代码示例。如果您正苦于以下问题:C++ nsDisplayListSet类的具体用法?C++ nsDisplayListSet怎么用?C++ nsDisplayListSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了nsDisplayListSet类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: thumbRect
void
nsSliderFrame::BuildDisplayListForChildren(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
// if we are too small to have a thumb don't paint it.
nsIFrame* thumb = nsBox::GetChildBox(this);
if (thumb) {
nsRect thumbRect(thumb->GetRect());
nsMargin m;
thumb->GetMargin(m);
thumbRect.Inflate(m);
nsRect crect;
GetClientRect(crect);
if (crect.width < thumbRect.width || crect.height < thumbRect.height)
return;
// If this scrollbar is the scrollbar of an actively scrolled scroll frame,
// layerize the scrollbar thumb, wrap it in its own ContainerLayer and
// attach scrolling information to it.
// We do this here and not in the thumb's nsBoxFrame::BuildDisplayList so
// that the event region that gets created for the thumb is included in
// the nsDisplayOwnLayer contents.
uint32_t flags = 0;
mozilla::layers::FrameMetrics::ViewID scrollTargetId =
mozilla::layers::FrameMetrics::NULL_SCROLL_ID;
aBuilder->GetScrollbarInfo(&scrollTargetId, &flags);
bool thumbGetsLayer = (scrollTargetId != layers::FrameMetrics::NULL_SCROLL_ID);
nsLayoutUtils::SetScrollbarThumbLayerization(thumb, thumbGetsLayer);
if (thumbGetsLayer) {
nsDisplayListCollection tempLists;
nsBoxFrame::BuildDisplayListForChildren(aBuilder, aDirtyRect, tempLists);
// This is a bit of a hack. Collect up all descendant display items
// and merge them into a single Content() list.
nsDisplayList masterList;
masterList.AppendToTop(tempLists.BorderBackground());
masterList.AppendToTop(tempLists.BlockBorderBackgrounds());
masterList.AppendToTop(tempLists.Floats());
masterList.AppendToTop(tempLists.Content());
masterList.AppendToTop(tempLists.PositionedDescendants());
masterList.AppendToTop(tempLists.Outlines());
// Wrap the list to make it its own layer.
aLists.Content()->AppendNewToTop(new (aBuilder)
nsDisplayOwnLayer(aBuilder, this, &masterList, flags, scrollTargetId,
GetThumbRatio()));
return;
}
}
nsBoxFrame::BuildDisplayListForChildren(aBuilder, aDirtyRect, aLists);
}
开发者ID:Phoxygen,项目名称:gecko-dev,代码行数:59,代码来源:nsSliderFrame.cpp
示例2: rect
NS_IMETHODIMP
nsHTMLButtonControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
nsDisplayList onTop;
if (IsVisibleForPainting(aBuilder)) {
nsresult rv = mRenderer.DisplayButton(aBuilder, aLists.BorderBackground(), &onTop);
NS_ENSURE_SUCCESS(rv, rv);
}
nsDisplayListCollection set;
// Do not allow the child subtree to receive events.
if (!aBuilder->IsForEventDelivery()) {
nsresult rv =
BuildDisplayListForChild(aBuilder, mFrames.FirstChild(), aDirtyRect, set,
DISPLAY_CHILD_FORCE_PSEUDO_STACKING_CONTEXT);
NS_ENSURE_SUCCESS(rv, rv);
// That should put the display items in set.Content()
}
// Put the foreground outline and focus rects on top of the children
set.Content()->AppendToTop(&onTop);
// clips to our padding box for <input>s but not <button>s, unless
// they have non-visible overflow..
if (IsInput() || GetStyleDisplay()->mOverflowX != NS_STYLE_OVERFLOW_VISIBLE) {
nsMargin border = GetStyleBorder()->GetComputedBorder();
nsRect rect(aBuilder->ToReferenceFrame(this), GetSize());
rect.Deflate(border);
nscoord radii[8];
GetPaddingBoxBorderRadii(radii);
nsresult rv = OverflowClip(aBuilder, set, aLists, rect, radii);
NS_ENSURE_SUCCESS(rv, rv);
} else {
set.MoveTo(aLists);
}
nsresult rv = DisplayOutline(aBuilder, aLists);
NS_ENSURE_SUCCESS(rv, rv);
// to draw border when selected in editor
return DisplaySelectionOverlay(aBuilder, aLists.Content());
}
开发者ID:vvuk,项目名称:mozilla-central,代码行数:45,代码来源:nsHTMLButtonControlFrame.cpp
示例3: nsDisplaymtdBorder
nsresult
nsMathMLmtdFrame::ProcessBorders(nsTableFrame* aFrame,
nsDisplayListBuilder* aBuilder,
const nsDisplayListSet& aLists)
{
aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
nsDisplaymtdBorder(aBuilder, this));
return NS_OK;
}
开发者ID:kitcambridge,项目名称:gecko-dev,代码行数:9,代码来源:nsMathMLmtableFrame.cpp
示例4: clipRect
NS_IMETHODIMP
nsFileControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
// box-shadow
if (GetStyleBorder()->mBoxShadow) {
nsresult rv = aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
nsDisplayBoxShadowOuter(aBuilder, this));
NS_ENSURE_SUCCESS(rv, rv);
}
// Our background is inherited to the text input, and we don't really want to
// paint it or out padding and borders (which we never have anyway, per
// styles in forms.css) -- doing it just makes us look ugly in some cases and
// has no effect in others.
nsDisplayListCollection tempList;
nsresult rv = nsBlockFrame::BuildDisplayList(aBuilder, aDirtyRect, tempList);
if (NS_FAILED(rv))
return rv;
tempList.BorderBackground()->DeleteAll();
// Clip height only
nsRect clipRect(aBuilder->ToReferenceFrame(this), GetSize());
clipRect.width = GetVisualOverflowRect().XMost();
nscoord radii[8] = {0, 0, 0, 0, 0, 0, 0, 0};
rv = OverflowClip(aBuilder, tempList, aLists, clipRect, radii);
NS_ENSURE_SUCCESS(rv, rv);
// Disabled file controls don't pass mouse events to their children, so we
// put an invisible item in the display list above the children
// just to catch events
nsEventStates eventStates = mContent->AsElement()->State();
if (eventStates.HasState(NS_EVENT_STATE_DISABLED) && IsVisibleForPainting(aBuilder)) {
rv = aLists.Content()->AppendNewToTop(
new (aBuilder) nsDisplayEventReceiver(aBuilder, this));
if (NS_FAILED(rv))
return rv;
}
return DisplaySelectionOverlay(aBuilder, aLists.Content());
}
开发者ID:Lynart,项目名称:mozilla-central,代码行数:43,代码来源:nsFileControlFrame.cpp
示例5: clipState
void
nsHTMLButtonControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
nsDisplayList onTop;
if (IsVisibleForPainting(aBuilder)) {
mRenderer.DisplayButton(aBuilder, aLists.BorderBackground(), &onTop);
}
nsDisplayListCollection set;
// Do not allow the child subtree to receive events.
if (!aBuilder->IsForEventDelivery()) {
DisplayListClipState::AutoSaveRestore clipState(aBuilder);
if (IsInput() || StyleDisplay()->mOverflowX != NS_STYLE_OVERFLOW_VISIBLE) {
nsMargin border = StyleBorder()->GetComputedBorder();
nsRect rect(aBuilder->ToReferenceFrame(this), GetSize());
rect.Deflate(border);
nscoord radii[8];
bool hasRadii = GetPaddingBoxBorderRadii(radii);
clipState.ClipContainingBlockDescendants(rect, hasRadii ? radii : nullptr);
}
BuildDisplayListForChild(aBuilder, mFrames.FirstChild(), aDirtyRect, set,
DISPLAY_CHILD_FORCE_PSEUDO_STACKING_CONTEXT);
// That should put the display items in set.Content()
}
// Put the foreground outline and focus rects on top of the children
set.Content()->AppendToTop(&onTop);
set.MoveTo(aLists);
DisplayOutline(aBuilder, aLists);
// to draw border when selected in editor
DisplaySelectionOverlay(aBuilder, aLists.Content());
}
开发者ID:BrunoReX,项目名称:palemoon,代码行数:39,代码来源:nsHTMLButtonControlFrame.cpp
示例6: DisplayBorderBackgroundOutline
NS_IMETHODIMP
nsVideoFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
if (!IsVisibleForPainting(aBuilder))
return NS_OK;
DO_GLOBAL_REFLOW_COUNT_DSP("nsVideoFrame");
nsresult rv = DisplayBorderBackgroundOutline(aBuilder, aLists);
NS_ENSURE_SUCCESS(rv, rv);
if (!ShouldDisplayPoster() && HasVideoData()) {
rv = aLists.Content()->AppendNewToTop(
new (aBuilder) nsDisplayGeneric(this, ::PaintVideo, "Video"));
NS_ENSURE_SUCCESS(rv, rv);
}
// Add child frames to display list. We expect up to two children, an image
// frame for the poster, and the box frame for the video controls.
for (nsIFrame *child = mFrames.FirstChild();
child;
child = child->GetNextSibling()) {
if (child->GetType() == nsGkAtoms::imageFrame && ShouldDisplayPoster()) {
rv = child->BuildDisplayListForStackingContext(aBuilder,
aDirtyRect - child->GetOffsetTo(this),
aLists.Content());
NS_ENSURE_SUCCESS(rv,rv);
} else if (child->GetType() == nsGkAtoms::boxFrame) {
rv = child->BuildDisplayListForStackingContext(aBuilder,
aDirtyRect - child->GetOffsetTo(this),
aLists.Content());
NS_ENSURE_SUCCESS(rv,rv);
}
}
return NS_OK;
}
开发者ID:amyvmiwei,项目名称:firefox,代码行数:39,代码来源:nsVideoFrame.cpp
示例7: DisplayBorderBackgroundOutline
void
nsRangeFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
if (IsThemed()) {
DisplayBorderBackgroundOutline(aBuilder, aLists);
// Only create items for the thumb. Specifically, we do not want
// the track to paint, since *our* background is used to paint
// the track, and we don't want the unthemed track painting over
// the top of the themed track.
// This logic is copied from
// nsContainerFrame::BuildDisplayListForNonBlockChildren as
// called by BuildDisplayListForInline.
nsIFrame* thumb = mThumbDiv->GetPrimaryFrame();
if (thumb) {
nsDisplayListSet set(aLists, aLists.Content());
BuildDisplayListForChild(aBuilder, thumb, aDirtyRect, set, DISPLAY_CHILD_INLINE);
}
} else {
BuildDisplayListForInline(aBuilder, aDirtyRect, aLists);
}
// Draw a focus outline if appropriate:
nsEventStates eventStates = mContent->AsElement()->State();
if (!eventStates.HasState(NS_EVENT_STATE_FOCUSRING) ||
eventStates.HasState(NS_EVENT_STATE_DISABLED)) {
return;
}
nsPresContext *presContext = PresContext();
const nsStyleDisplay *disp = StyleDisplay();
if ((!IsThemed(disp) ||
!presContext->GetTheme()->ThemeDrawsFocusForWidget(disp->mAppearance)) &&
IsVisibleForPainting(aBuilder)) {
aLists.Content()->AppendNewToTop(
new (aBuilder) nsDisplayRangeFocusRing(aBuilder, this));
}
}
开发者ID:captainbrosset,项目名称:gecko-dev,代码行数:38,代码来源:nsRangeFrame.cpp
示例8: nsDisplayXULTextBox
NS_IMETHODIMP
nsTextBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
if (!IsVisibleForPainting(aBuilder))
return NS_OK;
nsresult rv = nsLeafBoxFrame::BuildDisplayList(aBuilder, aDirtyRect, aLists);
NS_ENSURE_SUCCESS(rv, rv);
return aLists.Content()->AppendNewToTop(new (aBuilder)
nsDisplayXULTextBox(aBuilder, this));
}
开发者ID:lofter2011,项目名称:Icefox,代码行数:14,代码来源:nsTextBoxFrame.cpp
示例9: BuildDisplayListForInline
void
nsInlineFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsDisplayListSet& aLists)
{
BuildDisplayListForInline(aBuilder, aLists);
// The sole purpose of this is to trigger display of the selection
// window for Named Anchors, which don't have any children and
// normally don't have any size, but in Editor we use CSS to display
// an image to represent this "hidden" element.
if (!mFrames.FirstChild()) {
DisplaySelectionOverlay(aBuilder, aLists.Content());
}
}
开发者ID:luke-chang,项目名称:gecko-1,代码行数:14,代码来源:nsInlineFrame.cpp
示例10: DisplayBorderBackgroundOutline
NS_IMETHODIMP
nsSimplePageSequenceFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
nsresult rv = DisplayBorderBackgroundOutline(aBuilder, aLists);
NS_ENSURE_SUCCESS(rv, rv);
rv = aLists.Content()->AppendNewToTop(new (aBuilder)
nsDisplayGeneric(this, ::PaintPageSequence, "PageSequence"));
NS_ENSURE_SUCCESS(rv, rv);
return NS_OK;
}
开发者ID:ahadzi,项目名称:celtx,代码行数:14,代码来源:nsSimplePageSequence.cpp
示例11: nsDisplayEventReceiver
void
nsSliderFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsDisplayListSet& aLists)
{
if (aBuilder->IsForEventDelivery() && isDraggingThumb()) {
// This is EVIL, we shouldn't be messing with event delivery just to get
// thumb mouse drag events to arrive at the slider!
aLists.Outlines()->AppendToTop(new (aBuilder)
nsDisplayEventReceiver(aBuilder, this));
return;
}
nsBoxFrame::BuildDisplayList(aBuilder, aLists);
}
开发者ID:luke-chang,项目名称:gecko-1,代码行数:14,代码来源:nsSliderFrame.cpp
示例12: MoveTo
void nsDisplayListSet::MoveTo(const nsDisplayListSet& aDestination) const
{
aDestination.BorderBackground()->AppendToTop(BorderBackground());
aDestination.BlockBorderBackgrounds()->AppendToTop(BlockBorderBackgrounds());
aDestination.Floats()->AppendToTop(Floats());
aDestination.Content()->AppendToTop(Content());
aDestination.PositionedDescendants()->AppendToTop(PositionedDescendants());
aDestination.Outlines()->AppendToTop(Outlines());
}
开发者ID:ahadzi,项目名称:celtx,代码行数:9,代码来源:nsDisplayList.cpp
示例13: GetSelectedBox
void
nsDeckFrame::BuildDisplayListForChildren(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
// only paint the selected box
nsIFrame* box = GetSelectedBox();
if (!box)
return;
// Putting the child in the background list. This is a little weird but
// it matches what we were doing before.
nsDisplayListSet set(aLists, aLists.BlockBorderBackgrounds());
BuildDisplayListForChild(aBuilder, box, aDirtyRect, set);
}
开发者ID:Nazi-Nigger,项目名称:gecko-dev,代码行数:15,代码来源:nsDeckFrame.cpp
示例14: DisplayBorderBackgroundOutline
void
nsColumnSetFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) {
DisplayBorderBackgroundOutline(aBuilder, aLists);
aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
nsDisplayGenericOverflow(aBuilder, this, ::PaintColumnRule, "ColumnRule",
nsDisplayItem::TYPE_COLUMN_RULE));
// Our children won't have backgrounds so it doesn't matter where we put them.
for (nsFrameList::Enumerator e(mFrames); !e.AtEnd(); e.Next()) {
BuildDisplayListForChild(aBuilder, e.get(), aDirtyRect, aLists);
}
}
开发者ID:tomazj,项目名称:mozilla-central,代码行数:15,代码来源:nsColumnSetFrame.cpp
示例15: nsDisplayXULGroupBackground
void
nsGroupBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
// Paint our background and border
if (IsVisibleForPainting(aBuilder)) {
aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
nsDisplayXULGroupBackground(aBuilder, this));
DisplayOutline(aBuilder, aLists);
}
BuildDisplayListForChildren(aBuilder, aDirtyRect, aLists);
}
开发者ID:kleopatra999,项目名称:system-addons,代码行数:15,代码来源:nsGroupBoxFrame.cpp
示例16: kidLists
// REVIEW: The old code put everything in the background layer. To be more
// consistent with the way other frames work, I'm putting everything in the
// Content() (i.e., foreground) layer (see nsFrame::BuildDisplayListForChild,
// the case for stacking context but non-positioned, non-floating frames).
// This could easily be changed back by hacking nsBoxFrame::BuildDisplayListInternal
// a bit more.
void
nsStackFrame::BuildDisplayListForChildren(nsDisplayListBuilder* aBuilder,
const nsDisplayListSet& aLists)
{
// BuildDisplayListForChild puts stacking contexts into the PositionedDescendants
// list. So we need to map that list to aLists.Content(). This is an easy way to
// do that.
nsDisplayList* content = aLists.Content();
nsDisplayListSet kidLists(content, content, content, content, content, content);
nsIFrame* kid = mFrames.FirstChild();
while (kid) {
// Force each child into its own true stacking context.
BuildDisplayListForChild(aBuilder, kid, kidLists, DISPLAY_CHILD_FORCE_STACKING_CONTEXT);
kid = kid->GetNextSibling();
}
}
开发者ID:luke-chang,项目名称:gecko-1,代码行数:22,代码来源:nsStackFrame.cpp
示例17: nsDisplayEventReceiver
void
nsSplitterFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
nsBoxFrame::BuildDisplayList(aBuilder, aDirtyRect, aLists);
// if the mouse is captured always return us as the frame.
if (mInner->mDragging)
{
// XXX It's probably better not to check visibility here, right?
aLists.Outlines()->AppendNewToTop(new (aBuilder)
nsDisplayEventReceiver(aBuilder, this));
return;
}
}
开发者ID:Tripleman,项目名称:mozilla-central,代码行数:16,代码来源:nsSplitterFrame.cpp
示例18: GetEnclosingListFrame
void
nsSelectsAreaFrame::BuildDisplayListInternal(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
nsBlockFrame::BuildDisplayList(aBuilder, aDirtyRect, aLists);
nsListControlFrame* listFrame = GetEnclosingListFrame(this);
if (listFrame && listFrame->IsFocused()) {
// we can't just associate the display item with the list frame,
// because then the list's scrollframe won't clip it (the scrollframe
// only clips contained descendants).
aLists.Outlines()->AppendNewToTop(new (aBuilder)
nsDisplayListFocus(aBuilder, this));
}
}
开发者ID:Andrel322,项目名称:gecko-dev,代码行数:16,代码来源:nsSelectsAreaFrame.cpp
示例19: new
void
nsPlaceholderFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
DO_GLOBAL_REFLOW_COUNT_DSP("nsPlaceholderFrame");
#ifdef DEBUG
if (GetShowFrameBorders()) {
aLists.Outlines()->AppendNewToTop(
new (aBuilder) nsDisplayGeneric(aBuilder, this, PaintDebugPlaceholder,
"DebugPlaceholder",
nsDisplayItem::TYPE_DEBUG_PLACEHOLDER));
}
#endif
}
开发者ID:MichaelKohler,项目名称:gecko-dev,代码行数:16,代码来源:nsPlaceholderFrame.cpp
示例20: StyleBorder
nsresult
nsTableCellFrame::ProcessBorders(nsTableFrame* aFrame,
nsDisplayListBuilder* aBuilder,
const nsDisplayListSet& aLists)
{
const nsStyleBorder* borderStyle = StyleBorder();
if (aFrame->IsBorderCollapse() || !borderStyle->HasBorder())
return NS_OK;
if (!GetContentEmpty() ||
StyleTableBorder()->mEmptyCells == NS_STYLE_TABLE_EMPTY_CELLS_SHOW) {
aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
nsDisplayBorder(aBuilder, this));
}
return NS_OK;
}
开发者ID:logicoftekk,项目名称:cyberfox,代码行数:17,代码来源:nsTableCellFrame.cpp
注:本文中的nsDisplayListSet类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论