本文整理汇总了C++中SelectionMap::set方法的典型用法代码示例。如果您正苦于以下问题:C++ SelectionMap::set方法的具体用法?C++ SelectionMap::set怎么用?C++ SelectionMap::set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SelectionMap
的用法示例。
在下文中一共展示了SelectionMap::set方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: selectionBounds
IntRect RenderView::selectionBounds() const
{
typedef WillBeHeapHashMap<RawPtrWillBeMember<RenderObject>, OwnPtrWillBeMember<RenderSelectionInfo> > SelectionMap;
SelectionMap selectedObjects;
RenderObject* os = m_selectionStart;
RenderObject* stop = rendererAfterPosition(m_selectionEnd, m_selectionEndPos);
while (os && os != stop) {
if ((os->canBeSelectionLeaf() || os == m_selectionStart || os == m_selectionEnd) && os->selectionState() != SelectionNone) {
// Blocks are responsible for painting line gaps and margin gaps. They must be examined as well.
selectedObjects.set(os, adoptPtrWillBeNoop(new RenderSelectionInfo(os)));
RenderBlock* cb = os->containingBlock();
while (cb && !cb->isRenderView()) {
OwnPtrWillBeMember<RenderSelectionInfo>& blockInfo = selectedObjects.add(cb, nullptr).storedValue->value;
if (blockInfo)
break;
blockInfo = adoptPtrWillBeNoop(new RenderSelectionInfo(cb));
cb = cb->containingBlock();
}
}
os = os->nextInPreOrder();
}
// Now create a single bounding box rect that encloses the whole selection.
LayoutRect selRect;
SelectionMap::iterator end = selectedObjects.end();
for (SelectionMap::iterator i = selectedObjects.begin(); i != end; ++i)
selRect.unite(i->value->absoluteSelectionRect());
return pixelSnappedIntRect(selRect);
}
示例2: selectionBounds
IntRect RenderView::selectionBounds(bool clipToVisibleContent) const
{
document()->updateRendering();
typedef HashMap<RenderObject*, SelectionInfo*> SelectionMap;
SelectionMap selectedObjects;
RenderObject* os = m_selectionStart;
RenderObject* stop = rendererAfterPosition(m_selectionEnd, m_selectionEndPos);
while (os && os != stop) {
if ((os->canBeSelectionLeaf() || os == m_selectionStart || os == m_selectionEnd) && os->selectionState() != SelectionNone) {
// Blocks are responsible for painting line gaps and margin gaps. They must be examined as well.
selectedObjects.set(os, new SelectionInfo(os, clipToVisibleContent));
RenderBlock* cb = os->containingBlock();
while (cb && !cb->isRenderView()) {
SelectionInfo* blockInfo = selectedObjects.get(cb);
if (blockInfo)
break;
selectedObjects.set(cb, new SelectionInfo(cb, clipToVisibleContent));
cb = cb->containingBlock();
}
}
os = os->nextInPreOrder();
}
// Now create a single bounding box rect that encloses the whole selection.
IntRect selRect;
SelectionMap::iterator end = selectedObjects.end();
for (SelectionMap::iterator i = selectedObjects.begin(); i != end; ++i) {
SelectionInfo* info = i->second;
selRect.unite(info->rect());
delete info;
}
return selRect;
}
示例3: selectionBounds
IntRect RenderView::selectionBounds(bool clipToVisibleContent) const
{
typedef HashMap<RawPtr<RenderObject>, OwnPtr<RenderSelectionInfo> > SelectionMap;
SelectionMap selectedObjects;
RenderObject* os = m_selectionStart;
RenderObject* stop = rendererAfterPosition(m_selectionEnd, m_selectionEndPos);
while (os && os != stop) {
if ((os->canBeSelectionLeaf() || os == m_selectionStart || os == m_selectionEnd) && os->selectionState() != SelectionNone) {
// Blocks are responsible for painting line gaps and margin gaps. They must be examined as well.
selectedObjects.set(os, adoptPtr(new RenderSelectionInfo(os, clipToVisibleContent)));
RenderBlock* cb = os->containingBlock();
while (cb && !cb->isRenderView()) {
OwnPtr<RenderSelectionInfo>& blockInfo = selectedObjects.add(cb, nullptr).storedValue->value;
if (blockInfo)
break;
blockInfo = adoptPtr(new RenderSelectionInfo(cb, clipToVisibleContent));
cb = cb->containingBlock();
}
}
os = os->nextInPreOrder();
}
// Now create a single bounding box rect that encloses the whole selection.
LayoutRect selRect;
SelectionMap::iterator end = selectedObjects.end();
for (SelectionMap::iterator i = selectedObjects.begin(); i != end; ++i) {
RenderSelectionInfo* info = i->value.get();
// RenderSelectionInfo::rect() is in the coordinates of the paintInvalidationContainer, so map to page coordinates.
LayoutRect currRect = info->rect();
if (const RenderLayerModelObject* paintInvalidationContainer = info->paintInvalidationContainer()) {
FloatQuad absQuad = paintInvalidationContainer->localToAbsoluteQuad(FloatRect(currRect));
currRect = absQuad.enclosingBoundingBox();
}
selRect.unite(currRect);
}
return pixelSnappedIntRect(selRect);
}