当前位置: 首页>>代码示例>>C++>>正文


C++ nsFloatCacheFreeList::Head方法代码示例

本文整理汇总了C++中nsFloatCacheFreeList::Head方法的典型用法代码示例。如果您正苦于以下问题:C++ nsFloatCacheFreeList::Head方法的具体用法?C++ nsFloatCacheFreeList::Head怎么用?C++ nsFloatCacheFreeList::Head使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在nsFloatCacheFreeList的用法示例。


在下文中一共展示了nsFloatCacheFreeList::Head方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: while

/**
 * Place below-current-line floats.
 */
void
nsBlockReflowState::PlaceBelowCurrentLineFloats(nsFloatCacheFreeList& aList,
                                                nsLineBox* aLine)
{
  nsFloatCache* fc = aList.Head();
  while (fc) {
#ifdef DEBUG
    if (nsBlockFrame::gNoisyReflow) {
      nsFrame::IndentBy(stdout, nsBlockFrame::gNoiseIndent);
      printf("placing bcl float: ");
      nsFrame::ListTag(stdout, fc->mFloat);
      printf("\n");
    }
#endif
    // Place the float
    bool placed = FlowAndPlaceFloat(fc->mFloat);
    nsFloatCache *next = fc->Next();
    if (!placed) {
      aList.Remove(fc);
      delete fc;
      aLine->SetHadFloatPushed();
    }
    fc = next;
  }
}
开发者ID:bolt-dev,项目名称:gecko-dev,代码行数:28,代码来源:nsBlockReflowState.cpp

示例2: if

/**
 * Place below-current-line floats.
 */
PRBool
nsBlockReflowState::PlaceBelowCurrentLineFloats(nsFloatCacheFreeList& aList, PRBool aForceFit)
{
  nsFloatCache* fc = aList.Head();
  while (fc) {
    {
#ifdef DEBUG
      if (nsBlockFrame::gNoisyReflow) {
        nsFrame::IndentBy(stdout, nsBlockFrame::gNoiseIndent);
        printf("placing bcl float: ");
        nsFrame::ListTag(stdout, fc->mPlaceholder->GetOutOfFlowFrame());
        printf("\n");
      }
#endif
      // Place the float
      PRBool isLeftFloat;
      nsReflowStatus reflowStatus;
      PRBool placed = FlowAndPlaceFloat(fc, &isLeftFloat, reflowStatus, aForceFit);
      NS_ASSERTION(placed || !aForceFit,
                   "If we're in force-fit mode, we should have placed the float");

      if (!placed || (NS_FRAME_IS_TRUNCATED(reflowStatus) && !aForceFit)) {
        // return before processing all of the floats, since the line will be pushed.
        return PR_FALSE;
      }
      else if (NS_FRAME_IS_NOT_COMPLETE(reflowStatus)) {
        // Create a continuation for the incomplete float and its placeholder.
        nsresult rv = mBlock->SplitPlaceholder(*this, fc->mPlaceholder);
        if (NS_FAILED(rv)) 
          return PR_FALSE;
      } else {
        // XXX We could deal with truncated frames better by breaking before
        // the associated placeholder
        NS_WARN_IF_FALSE(!NS_FRAME_IS_TRUNCATED(reflowStatus),
                         "This situation currently leads to data not printing");

        // Float is complete. We need to delete any leftover placeholders now.
        nsIFrame* nextPlaceholder = fc->mPlaceholder->GetNextInFlow();
        if (nextPlaceholder) {
          nsHTMLContainerFrame* parent =
            static_cast<nsHTMLContainerFrame*>(nextPlaceholder->GetParent());
          parent->DeleteNextInFlowChild(mPresContext, nextPlaceholder);
        }
      }
    }
    fc = fc->Next();
  }
  return PR_TRUE;
}
开发者ID:ahadzi,项目名称:celtx,代码行数:52,代码来源:nsBlockReflowState.cpp

示例3: if

/**
 * Place below-current-line floats.
 */
PRBool
nsBlockReflowState::PlaceBelowCurrentLineFloats(nsFloatCacheFreeList& aList, PRBool aForceFit)
{
  nsFloatCache* fc = aList.Head();
  while (fc) {
    {
#ifdef DEBUG
      if (nsBlockFrame::gNoisyReflow) {
        nsFrame::IndentBy(stdout, nsBlockFrame::gNoiseIndent);
        printf("placing bcl float: ");
        nsFrame::ListTag(stdout, fc->mFloat);
        printf("\n");
      }
#endif
      // Place the float
      nsReflowStatus reflowStatus;
      PRBool placed = FlowAndPlaceFloat(fc->mFloat, reflowStatus, aForceFit);
      NS_ASSERTION(placed || !aForceFit,
                   "If we're in force-fit mode, we should have placed the float");

      if (!placed || (NS_FRAME_IS_TRUNCATED(reflowStatus) && !aForceFit)) {
        // return before processing all of the floats, since the line will be pushed.
        return PR_FALSE;
      }
      else if (!NS_FRAME_IS_FULLY_COMPLETE(reflowStatus)) {
        // Create a continuation for the incomplete float
        nsresult rv = mBlock->SplitFloat(*this, fc->mFloat, reflowStatus);
        if (NS_FAILED(rv))
          return PR_FALSE;
      } else {
        // XXX We could deal with truncated frames better by breaking before
        // the associated placeholder
        NS_WARN_IF_FALSE(!NS_FRAME_IS_TRUNCATED(reflowStatus),
                         "This situation currently leads to data not printing");
        // Float is complete.
      }
    }
    fc = fc->Next();
  }
  return PR_TRUE;
}
开发者ID:MozillaOnline,项目名称:gecko-dev,代码行数:44,代码来源:nsBlockReflowState.cpp


注:本文中的nsFloatCacheFreeList::Head方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。