#include <range.h>
Inheritance diagram for Range:

Public Types | |
| enum | CommonAttribResult { ATTR_COMMON, ATTR_NONE, ATTR_MANY } |
Public Member Functions | |
| Range () | |
| Creates an uninitialised range. | |
| virtual | ~Range () |
| Range (Node *First, Node *Last, RangeControl RangeControlFlgs) | |
| The purpose of this function is to create a node range. | |
| Range (Range &Range) | |
| Range copy constructor. | |
| Range & | operator= (Range &Range) |
| Range = operator. | |
| BOOL | operator== (const Range &) const |
| Test for equality of two ranges. Ranges are considered equal if they have the same flags and the same first & last nodes. SeeAlso Range::operator!=. | |
| BOOL | operator!= (const Range &) const |
| Test for non-equality of two ranges. Ranges are considered equal if they have the same flags and the same first & last nodes. SeeAlso Range::operator==. | |
| void | SetRangeControl (RangeControl RangeControlFlgs) |
| To set the range control for the range. | |
| virtual Node * | FindFirst (BOOL AndChildren=FALSE) |
| The purpose of this function is to find the first node in a range. | |
| virtual Node * | FindLast () |
| The purpose of this function is to find the last node in a range. If the range was constructed with a NULL last node specifier then the range is scanned until the last node is found. If a non NULL last node was specified however the value of last is simply returned. It's existance is not verified !. | |
| virtual Node * | FindNext (Node *Previous, BOOL AndChildren=FALSE) |
| virtual Node * | FindPrev (Node *pNode, BOOL AndChildren=FALSE) |
| virtual void | Update (BOOL TellWorld=FALSE) |
| To inform the SelRange that the selection has changed This invalidates the SelRange's selection-info cache so it will be recached when info is next requested. | |
| virtual void | FreshenCache () |
| RangeControl | GetRangeControlFlags () const |
| BOOL | ForceRenderEORAll () const |
| UINT32 | Count () |
| BOOL | Contains (Node *pNode, BOOL bAndChildren=FALSE) |
| To determin whether a particular node is actually in the range list. | |
| BOOL | ContainsSelectInside () |
| BOOL | ConsistsOf (CCRuntimeClass *pccrtSearch, BOOL fIncludeDerivedClasses=TRUE) |
| Determines whether the range consists entirely of the given class of object - or of derived classes of the given sort of object. | |
| BOOL | IsEmpty () |
| Determines whether the range is empty. | |
| List * | MakeListOfNodes (BOOL AndChildren=FALSE) |
| This function will create and return a pointer to a list representing the objects in the range. It will return NULL if it couldn't create the list due to lack of memory. WARNING! This function creates objects which must be deleted by the calling routine. The last thing we need right now is another bunch of listitems appearing on shutdown. | |
| void | UpdateParentBoundsOfSelection (BOOL AndChildren=FALSE) |
| This function updates the parent bounds of all selected objects. It is a lot more efficient than calling ChangeBounds on every node in the selection (cos it uses an algorithm!). | |
| BOOL | MakeAttributeComplete (BOOL CheckForDuplicates=TRUE, BOOL AndChildren=FALSE, BOOL IgnoreComplex=FALSE) |
| This function calls NodeRenderableInk::MakeAttributeComplete on every Object in the selection. If we run out of memory then all changes are undone. | |
| void | NormaliseAttributes (BOOL AndChildren=FALSE, BOOL IgnoreComplex=FALSE) |
| This function calls NodeRenderableInk::NormaliseAttributes on every Object in the selection. | |
| BOOL | CopyComponentDataToDoc (BaseDocument *pSrcDoc, BaseDocument *pDestDoc, BOOL AndChildren=FALSE) |
| Asks all objects in the range (including their children) to copy across their component data to the specified destination document. The range must be in the destination doc. | |
| void | ResetXOROutlineRenderer (BOOL FlushTheCache=TRUE) |
| void | RenderXOROutlinesOn (DocRect *ClipRect, Spread *pSpread, Matrix *Transform, Node *ClickedObject=NULL) |
| Shared code used by the rotate, select, and scale tools to XOR the object(s) being dragged on/off screen. This function will do background rendering to XOR outlines onto screen (Successive calls will render more of the selection until it has all been rendered - it must therefore be called during mouse idle events to complete redraws). | |
| void | RenderXOROutlinesOff (DocRect *ClipRect, Spread *pSpread, Matrix *Transform) |
| Shared code used by the rotate, select, and scale tools to XOR the object(s) being dragged onto screen. This function is used to remove XORed object outline blobs from the screen (obviously they will only be truly removed if you call it with the screen in the correct state). After the outlines have been rendered, the XOROutline renderer state is reset, so it is ready to begin a fresh pass of rendering blobs back on to the screen. | |
| void | RenderXOROutlinesToCatchUp (DocRect *ClipRect, Spread *pSpread, Matrix *Transform) |
| Shared code used by the rotate, select, and scale tools to XOR the object(s) being dragged onto screen. This function is used when an area is redrawn during a drag (e.g. scrolling the window forces a redraw) to 'catch up' to the XOR outlines already present in other areas of the screen (i.e. it redraws everything that should already be on screen in unchanged areas into the invalidated area, so that XOR dragging can continue without leaving mess behind. | |
| virtual DocRect | GetBoundingRect () |
| To determine the bounds of all objects in the range. | |
| virtual DocRect | GetBoundingRectForEorDragging () |
| Same as for GetBoundingRect() but calls GetDragEorBoundingRect for all nodes. | |
| virtual BOOL | AllowOp (ObjChangeParam *pParam, BOOL SetOpPermissionState=TRUE, BOOL DoPreTriggerEdit=TRUE) |
| Calls AllowOp() on all nodes in the range. If SetOpPermissionState is TRUE, the op permission state of all nodes in the range, plus all parents of these nodes, will have their op permission state changed. | |
| BOOL | GetCompoundObjectSet (ObjectSet *pCompoundObjectSet, BOOL ExcludeTextObjects=FALSE) |
| This function traverses the range, and whenever it finds an object which is the child of a compound node it adds the compound node to the set. | |
| BOOL | AddTextStoryCompoundsForDel (ObjectSet *pCompoundObjectSet) |
| This function is really a BODGE. When we are deleting a range which contains text chars, the deletion code may/may-not hide unselected TextLines as well. If this occurs then we will not be able to globally localise/factor out attributes on these TextLines. | |
| Range::CommonAttribResult | FindCommonAttribute (CCRuntimeClass *AttribClass, NodeAttribute **pAttribute, BOOL bRangeIsEffectsLevel=FALSE) |
| To determine if all objects in the range share an attribute with the same value. You should only use this function if you need to find a common attribute value for a single attribute type. If you need to find common values for many types then FindCommonAttributes is much more efficient. | |
| BOOL | FindCommonAttributes (CommonAttrSet *CommonAttributeSet, BOOL CompoundAccuracy=FALSE) |
| Finds all attributes which are common to the objects in the selection. There is a CommonAttributeItem for every attribute type (common or not). The Status field in this structure specifies if the attribute is common. | |
| Range::CommonAttribResult | FindCommonAttributeType (CCRuntimeClass *AttribType, CCRuntimeClass **pCommonType, BOOL ForceAttribType=FALSE, BOOL bRangeIsEffectsLevel=FALSE) |
| To determine if all objects in the selection share attributes with the same type. | |
| Range::CommonAttribResult | FindCommonNonOptimisingAttr (CCRuntimeClass *pAttribClass, NodeAttribute **ppAttr) |
| Do a search on the range, for non-optimising attrs. Because they are not optimised, we don't need to search up and down the tree for these attributes - we just look at the children of each node in the range. | |
| BOOL | FindBitmap (KernelBitmap **ppFoundBitmap=NULL, KernelBitmapRef **ppFoundBitmapRef=NULL, NodeBitmap **ppFoundNode=NULL, AttrFillGeometry **ppFoundFillAttribute=NULL) |
| Find out if there is a valid bitmap in the selection and return useful information to the caller. | |
| virtual void | AttrsHaveChanged () |
| This function gets called to inform the range that attributes applied to its objects have, or may have changed. It deletes the Common attribute cache if one exists. | |
| virtual void | SetRenderable (BOOL bNewVis=FALSE) |
| virtual Range * | CloneNodes (UINT32 timeLimit, BOOL bCloneOnTop=FALSE, BOOL bLightweight=FALSE, Layer *pDestLayer=NULL) |
| virtual void | DeleteNodes () |
| virtual void | ForceRedrawView (DocView *pDocView, BOOL bReleaseCache=FALSE, BOOL bUseBlobRects=FALSE, BOOL bReleaseParentsOnly=FALSE) |
| virtual BOOL | TransformNodes (TransformBase *Trans) |
| virtual void | SetDraggedNodes (BOOL bNewState=FALSE) |
| virtual void | CopyNodesContents (Range *pDestRange, BOOL bSetDragged=FALSE, BOOL bSetRenderable=FALSE) |
| virtual BOOL | SetPromoteToParent (BOOL bNewValue) |
Public Attributes | |
| Node * | NodeToRender |
Protected Member Functions | |
| CommonAttrSet * | GetCommonAttrCache () |
| This fn should be called to get a pointer to the range's common attribute cache. If the cache does not exist in the range then one is first created. Scope: private. | |
| BOOL | FindNextXOROutlineNode (Node **OriginalNode, DocRect *pClipRect) |
| Shared code used by the rotate, select, and scale tools to XOR the object(s) being dragged on/off screen. This function is used to calculate the next object to be drawn; it attempts to draw the most significant objects first, so that minute detail is only drawn if there is enough time spare. This significantly enhances interactiveness of dragging. | |
| BOOL | CacheXOROutlineInfo (Spread *pSpread, Node *ClickedObject=NULL) |
| This function is called before starting to XOR the objects onto screen to precalculate information pertaining to object significance (the order in which objects are drawn). | |
| virtual Node * | SmartFindNext (Node *pContext, BOOL AndChildren=FALSE, BOOL FindFirst=FALSE) const |
| virtual BOOL | InRange (Node *pNode, BOOL AndChildren) const |
| Private helper function for SmartFindNext. Tests whether the presented node is in the range according to the RangeControlFlags and two other locally presented flags. | |
Protected Attributes | |
| CommonAttrSet * | pCommonAttribCache |
| RangeControl | RangeControlFlags |
| Node * | FirstNode |
| Node * | LastNode |
| INT32 | NumObjectsDrawn |
| INT32 | RenderingPass |
| XOROutlineInfoStr | XORInfo |
Definition at line 311 of file range.h.
|
|
Definition at line 387 of file range.h. 00387 { ATTR_COMMON, ATTR_NONE, ATTR_MANY };
|
|
|
Creates an uninitialised range.
Definition at line 314 of file range.cpp. 00315 { 00316 FirstNode = LastNode = NULL; 00317 pCommonAttribCache = NULL; // The common attribute cache only comes into 00318 // existance if the FindCommonAttribute functions 00319 }
|
|
|
Definition at line 324 of file range.cpp. 00325 { 00326 // Destroy the CommonAttribSet if one exists 00327 if (pCommonAttribCache) 00328 { 00329 delete pCommonAttribCache; 00330 } 00331 }
|
|
||||||||||||||||
|
The purpose of this function is to create a node range.
If RangeControlFlgs.Unselected = TRUE All nodes with an unselected status are included as members in the range. If both these flags are TRUE then all nodes from First to Last are included in the range. If RangeControlFlgs.CrossLayer = TRUE The range may cross several layers; when the end of a layer is reached, the search will continue at the start of the following layer. If RangeControlFlgs.IgnoreLockedLayers = TRUE locked layers are included in the search. Defaults to FALSE so locked layers ignored. If RangeControlFlgs.IgnoreNoneRenderable = TRUE non-renderable nodes are included in the search. Defaults to FALSE so non-redenderable nodes ignored. If RangeControlFlgs.IgnoreInvisibleLayers = TRUE Invisable layers are included in the search. Defaults to FALSE so invisible layers ignored. First: The node from which to commence searching for members of a range. Last: The final node to search (must be a right sibling of First, or NULL). NULL specifies that all nodes from First to the end of First's sibling list (or end of the tree, if CrossLayer is TRUE) are to be searched for members of the range.
Definition at line 268 of file range.cpp. 00269 { 00270 // When the First node in a range is NULL the range is assumed to lie directly under 00271 // the surface of layers... 00272 /* 00273 if (First!=NULL) 00274 { 00275 ERROR3IF( RangeControlFlgs.Unselected 00276 && !First->FindParent()->IsLayer() 00277 && First != Last, 00278 "Attempt to create an illegal range!" 00279 ); 00280 } 00281 */ 00282 00283 RangeControlFlags = RangeControlFlgs; 00284 FirstNode = First; 00285 LastNode = Last; 00286 pCommonAttribCache = NULL; // The common attribute cache only comes into 00287 // existance if the FindCommonAttribute functions 00288 // are called on the range. 00289 00290 // Initialise the XOR rendering stuff 00291 NodeToRender = NULL; 00292 ResetXOROutlineRenderer(TRUE); 00293 }
|
|
|
Range copy constructor.
Definition at line 351 of file range.cpp. 00352 { 00353 // If the range is a sel range we must be sure that the range has been cached 00354 Rng.FreshenCache(); 00355 00356 RangeControlFlags = Rng.RangeControlFlags; 00357 FirstNode = Rng.FirstNode; 00358 LastNode = Rng.LastNode; 00359 pCommonAttribCache = NULL; 00360 }
|
|
|
This function is really a BODGE. When we are deleting a range which contains text chars, the deletion code may/may-not hide unselected TextLines as well. If this occurs then we will not be able to globally localise/factor out attributes on these TextLines.
Really any deletion of this sort should occur after the operation ends similar to group deletion in the no children case.But we have got to ship this product some time.
Definition at line 3371 of file range.cpp. 03372 { 03373 Node* pCurrent = FindFirst(); 03374 Node* pParent; 03375 while (pCurrent) 03376 { 03377 pParent = pCurrent->FindParent(); 03378 ERROR3IF(!pParent, "object in range has no parent"); 03379 if (pParent) 03380 { 03381 if (IS_A(pParent, TextLine)) 03382 { 03383 pParent = pParent->FindParent(); 03384 ERROR3IF(!pParent, "parent of object in range has no parent"); 03385 ERROR3IF(!(IS_A(pParent, TextStory)), "Parent of TextLine is not a TextStory"); 03386 if (IS_A(pParent, TextStory)) 03387 { 03388 // Add the story to the set 03389 if (!(pCompoundObjectSet->AddToSet((NodeRenderableInk*)pParent))) 03390 return FALSE; 03391 } 03392 } 03393 } 03394 pCurrent = pCurrent->FindNext(); 03395 } 03396 return TRUE; 03397 }
|
|
||||||||||||||||
|
Calls AllowOp() on all nodes in the range. If SetOpPermissionState is TRUE, the op permission state of all nodes in the range, plus all parents of these nodes, will have their op permission state changed.
Definition at line 2349 of file range.cpp. 02350 { 02351 Node* pNode = FindFirst(); 02352 BOOL result = FALSE,allowed; 02353 02354 // we call AllowOp on all Nodes in the range, but never ask for a PreTriggerEdit on 02355 // each one, as if it is necessary then we deal with them en masse next. 02356 while (pNode != NULL) 02357 { 02358 Node* pNextNode = FindNext(pNode); 02359 allowed = pNode->AllowOp(pParam, SetOpPermissionState, FALSE); 02360 result = result || allowed; 02361 pNode = pNextNode; 02362 } 02363 02364 // if we're ok so far and were asked to do a PreTriggerEdit, then 02365 // determine whether the Op may change the bounds of some nodes. 02366 // If it may, then call NameGallery::PreTriggerEdit. 02367 if (result && DoPreTriggerEdit) 02368 { 02369 // if the Op is non-NULL then query its MayChangeNodeBounds() method. 02370 UndoableOperation* pChangeOp = pParam->GetOpPointer(); 02371 if (pChangeOp != NULL && pChangeOp->MayChangeNodeBounds() && NameGallery::Instance()) 02372 { 02373 result = NameGallery::Instance()->PreTriggerEdit(pChangeOp, pParam, this); 02374 } 02375 } 02376 02377 return result; 02378 }
|
|
|
This function gets called to inform the range that attributes applied to its objects have, or may have changed. It deletes the Common attribute cache if one exists. void Range::AttrsHaveChanged()
Reimplemented in SelRange. Definition at line 3412 of file range.cpp. 03413 { 03414 // if we are currently caching current attrs delete them 03415 if (pCommonAttribCache) 03416 { 03417 delete pCommonAttribCache; 03418 pCommonAttribCache = NULL; 03419 } 03420 }
|
|
||||||||||||
|
This function is called before starting to XOR the objects onto screen to precalculate information pertaining to object significance (the order in which objects are drawn).
Scope: private
Definition at line 1678 of file range.cpp. 01683 { 01684 01685 #if !defined(EXCLUDE_FROM_RALPH) 01686 01687 if (XORInfo.Cached) // Have already cached the info 01688 return TRUE; 01689 01690 BOOL bPromote = RangeControlFlags.PromoteToParent; 01691 RangeControlFlags.PromoteToParent = TRUE; 01692 01693 ERROR2IF(pSpread == NULL,FALSE, "NULL Spread pointer passed to SelRange::CacheXOROutlineInfo"); 01694 ERROR2IF(DocView::GetSelected() == NULL,FALSE, "DocView::GetSelected is NULL in SelRange::CacheXOROutlineInfo"); 01695 01696 DocView *pDocView = DocView::GetSelected(); 01697 if (pDocView == NULL) 01698 { 01699 RangeControlFlags.PromoteToParent = bPromote; 01700 return FALSE; 01701 } 01702 01703 XORInfo.SigRegion = pDocView->GetDocViewRect(pSpread); 01704 01705 // Take screenrect or source bounding rect, whichever is smaller 01706 // (if the source rect passed in was NULL, just use screen coords) 01707 DocRect SourceRegion = GetBoundingRectForEorDragging(); 01708 if (Count() > 0 && 01709 XORInfo.SigRegion.Width() + XORInfo.SigRegion.Height() > 01710 SourceRegion.Width() + SourceRegion.Height()) 01711 { 01712 XORInfo.SigRegion = SourceRegion; 01713 XORInfo.SigRegionIsScreen = FALSE; 01714 } 01715 else 01716 { 01717 // Convert SigRgn from Document to Spread coords 01718 pSpread->DocCoordToSpreadCoord(&XORInfo.SigRegion); 01719 XORInfo.SigRegionIsScreen = TRUE; 01720 } 01721 01722 01723 XORInfo.PrimeObject = NULL; 01724 if (ClickedObject != NULL) 01725 { 01726 // And remember which object must always be drawn first (the prime object) 01727 // --but only if it's a renderable object that is part of the selection! 01728 BOOL Selected = ClickedObject->IsSelected(); 01729 01730 if (ClickedObject->ShouldITransformWithChildren()) 01731 { 01732 Selected = TRUE; 01733 } 01734 01735 if (!Selected) 01736 { 01737 // The object isn't selected, but perhaps it is in a selected group. 01738 // Search up through all parent nodes until we have determined if it 01739 // really is selected. 01740 01741 Node *TheNode = (Node *) ClickedObject; 01742 do 01743 { 01744 Selected = (TheNode->IsSelected()); 01745 TheNode = TheNode->FindParent(); 01746 } 01747 while (!Selected && TheNode != NULL); 01748 } 01749 01750 if (Selected && ClickedObject->IsKindOf(CC_RUNTIME_CLASS(NodeRenderableInk))) 01751 XORInfo.PrimeObject = ClickedObject; 01752 } 01753 else 01754 { 01755 01756 } 01757 01758 XORInfo.Cached = TRUE; 01759 01760 RangeControlFlags.PromoteToParent = bPromote; 01761 01762 return TRUE; 01763 #else 01764 return FALSE; 01765 #endif 01766 }
|
|
||||||||||||||||||||
|
Definition at line 3556 of file range.cpp. 03557 { 03558 Node* pNode; 03559 ListRange* pCloneRange = new ListRange(); 03560 MonotonicTime timeClone; 03561 03562 pNode = FindFirst(); 03563 while (pNode && !timeClone.Elapsed(timeLimit)) 03564 { 03565 // Make a copy of the current node 03566 Node* pCopy = NULL; 03567 BOOL bOK = FALSE; 03568 03569 // bOK = pNode->CloneNode(&pCopy, bLightweight); 03570 bOK = pNode->NodeCopy(&pCopy); 03571 if (!bOK) 03572 goto CloneError; 03573 03574 // make sure that it is bounded 03575 ERROR2IF(!pCopy->IsBounded(), FALSE, "Object being pasted is not a NodeRenderableBounded"); 03576 // NodeRenderableBounded* BoundCopy = (NodeRenderableBounded*)pCopy; 03577 03578 // Make sure the copy is not selected 03579 pCopy->SetSelected(FALSE); 03580 03581 if (pDestLayer==NULL) 03582 { 03583 if (!bCloneOnTop) 03584 { 03585 // Insert the copied node right alongside the original 03586 pCopy->AttachNode(pNode, NEXT, FALSE, FALSE); 03587 } 03588 else 03589 { 03590 Node* pTail = pNode->FindParent(CC_RUNTIME_CLASS(Layer))->FindLastChild(TRUE); 03591 pCopy->AttachNode(pTail, NEXT, FALSE, FALSE); 03592 } 03593 } 03594 else 03595 { 03596 // Copy the node into a new target spread... 03597 Node* pTail = pDestLayer->FindLastChild(TRUE); 03598 if (pTail) 03599 pCopy->AttachNode(pTail, NEXT, FALSE, FALSE); 03600 else 03601 pCopy->AttachNode(pDestLayer, FIRSTCHILD, FALSE, FALSE); 03602 } 03603 03604 // Add the copied node to the output ListRange 03605 pCloneRange->AddNode(pCopy); 03606 03607 pNode = FindNext(pNode); 03608 } 03609 03610 // If we ran through all the nodes we needed to then pNode will be NULL and we can exit normally 03611 if (pNode==NULL) 03612 return pCloneRange; 03613 // Else we aborted early and we must fall through to the tidy up routine and return NULL 03614 03615 CloneError: 03616 pNode = pCloneRange->FindLast(); 03617 while (pNode) 03618 { 03619 pNode->CascadeDelete(); 03620 delete pNode; 03621 03622 pNode = pCloneRange->FindPrev(pNode); 03623 } 03624 03625 delete pCloneRange; 03626 03627 return NULL; 03628 }
|
|
||||||||||||
|
Determines whether the range consists entirely of the given class of object - or of derived classes of the given sort of object. BOOL Range::ConsistsOf(CCRuntimeClass* pccrtSearch, BOOL fIncludeDerivedClasses=TRUE)
This is used by the WebAddressDlg, which needs to know whether the selection consists entirely of text.
Definition at line 3448 of file range.cpp. 03449 { 03450 //Find the first node in the range, not including children 03451 Node* pThisNode=FindFirst(FALSE); 03452 03453 //Now scan until we get to the end of the range 03454 while (pThisNode!=NULL) 03455 { 03456 BOOL ok=TRUE; 03457 03458 //Is the object allowed to be a derived class of pccrtSearch? 03459 if (fIncludeDerivedClasses) 03460 //Yes. So test to see whether the node is a derived class of pccrtSearch 03461 ok=pThisNode->IsKindOf(pccrtSearch); 03462 else 03463 //No. So test whether the node is exactly the same class as pccrtSearch 03464 ok=(pThisNode->GetRuntimeClass()==pccrtSearch); 03465 03466 //If the node wasn't of the appropriate class, return FALSE now. 03467 if (!ok) 03468 return FALSE; 03469 03470 //Get the next object to test 03471 pThisNode=FindNext(pThisNode, FALSE); 03472 } 03473 03474 //We've reached the end of the range and all the nodes were of the class we wanted. 03475 //So return TRUE 03476 return TRUE; 03477 03478 }
|
|
||||||||||||
|
To determin whether a particular node is actually in the range list.
Definition at line 731 of file range.cpp. 00732 { 00733 Node* pNode=FindFirst(); 00734 while (pNode) 00735 { 00736 if (pNode==pLookFor) 00737 return TRUE; 00738 00739 if (bAndChildren && pNode->IsNodeInSubtree(pLookFor)) 00740 return TRUE; 00741 00742 pNode=FindNext(pNode); 00743 } 00744 return FALSE; 00745 }
|
|
|
Definition at line 765 of file range.cpp. 00766 { 00767 #if !defined(EXCLUDE_FROM_RALPH) 00768 // Preconditions 00769 ERROR2IF(this==NULL,FALSE,"ContainsSelectInside called on NULL pointer"); 00770 00771 // Implementation 00772 Node* pNodeInRange = FindFirst(); 00773 Node* pParent; 00774 while (pNodeInRange) // While there's a node in the range 00775 { 00776 pParent = pNodeInRange->FindParent(); // Look at it's parent node 00777 00778 // DMc - added promotehittestonchildrentome test to eliminate the 'inside' setting 00779 // for nodes should as shadows, contours, bevels etc 00780 while (pParent) 00781 { 00782 if (pParent->IsAnObject() && pParent->IsParentOfSelected() && 00783 pParent->PromoteHitTestOnChildrenToMe()) // If that's marked parent of sel 00784 return TRUE; // Then this node is "inside" so return TRUE 00785 00786 pParent = pParent->FindParent(); 00787 } 00788 00789 pNodeInRange = FindNext(pNodeInRange); // Else, keep scanning members of range 00790 } 00791 #endif 00792 return FALSE; // If no more in range, none were "inside" 00793 }
|
|
||||||||||||||||
|
Asks all objects in the range (including their children) to copy across their component data to the specified destination document. The range must be in the destination doc.
Definition at line 1443 of file range.cpp. 01446 { 01447 // Scan all nodes in the range 01448 Node* Scan = FindFirst(AndChildren); 01449 while (Scan != NULL) 01450 { 01451 Node* Root = Scan; 01452 Node* Current = Root->FindFirstDepthFirst(); 01453 // This depth first search was written BEFORE the AndChildren flag was passed in. 01454 // It could probably be removed now... 01455 while (Current != NULL) 01456 { 01457 // Ask the current node if it would copy it's data to the relevant DocComponents 01458 if (Current->IsKindOf(CC_RUNTIME_CLASS(NodeRenderable))) 01459 { 01460 if (!((NodeRenderable*)Current)->CopyComponentData(pSrcDoc, pDestDoc)) 01461 { 01462 // No luck 01463 pDestDoc->AbortComponentCopy(); // Cancel all data which has been copied 01464 return FALSE; 01465 } 01466 } 01467 01468 Current = Current->FindNextDepthFirst(Root); 01469 } 01470 Scan = FindNext(Scan, AndChildren); 01471 } 01472 return TRUE; // Success 01473 }
|
|
||||||||||||||||
|
Definition at line 3790 of file range.cpp. 03791 { 03792 Node* pSrcNode; 03793 Node* pDestNode; 03794 NodeRenderable* pSrcRendNode; 03795 NodeRenderable* pDestRendNode; 03796 03797 // ENSURE(GetCount()==pDestRange->GetCount(), "Ranges differ too much"); 03798 03799 pSrcNode = FindFirst(FALSE); 03800 pDestNode = pDestRange->FindFirst(FALSE); 03801 while (pSrcNode && pDestNode) 03802 { 03803 ENSURE(pSrcNode->GetRuntimeClass() == pDestNode->GetRuntimeClass(), "Ranges differ unexpectedly"); 03804 if (pSrcNode->IsBounded() && pSrcNode->GetRuntimeClass() == pDestNode->GetRuntimeClass()) 03805 { 03806 pSrcRendNode = (NodeRenderable*)pSrcNode; 03807 pDestRendNode = (NodeRenderable*)pDestNode; 03808 03809 // Do the children because PolyCopyNodeContents can't sensibly be recursive 03810 Node* pSrcSubNode = pSrcRendNode->FindFirstDepthFirst(); 03811 while (pSrcSubNode && (pSrcSubNode->IsNodeHidden() || pSrcSubNode->IsDragged())) // URGH 03812 pSrcSubNode = pSrcSubNode->FindNextDepthFirst(pSrcRendNode); // URGH 03813 03814 Node* pDestSubNode = pDestRendNode->FindFirstDepthFirst(); 03815 while (pDestSubNode && (pDestSubNode->IsNodeHidden() || !pDestSubNode->IsDragged())) // URGH 03816 pDestSubNode = pDestSubNode->FindNextDepthFirst(pDestRendNode); // URGH 03817 03818 while (pSrcSubNode && pDestSubNode) 03819 { 03820 if (pSrcSubNode->IsNodeRenderableClass() 03821 && pDestSubNode->IsNodeRenderableClass()) 03822 { 03823 ENSURE(pSrcSubNode->GetRuntimeClass() == pDestSubNode->GetRuntimeClass(), "Ranges differ unexpectedly"); 03824 ((NodeRenderable*)pSrcSubNode)->PolyCopyNodeContents((NodeRenderable*)pDestSubNode); 03825 pDestSubNode->SetSelected(FALSE); 03826 pDestSubNode->SetParentOfSelected(FALSE); 03827 } 03828 03829 pSrcSubNode = pSrcSubNode->FindNextDepthFirst(pSrcRendNode); 03830 while (pSrcSubNode && (pSrcSubNode->IsNodeHidden() || pDestSubNode->IsDragged())) // URGH 03831 pSrcSubNode = pSrcSubNode->FindNextDepthFirst(pSrcRendNode); // URGH 03832 03833 pDestSubNode = pDestSubNode->FindNextDepthFirst(pDestRendNode); 03834 while (pDestSubNode && (pDestSubNode->IsNodeHidden() || !pDestSubNode->IsDragged())) // URGH 03835 pDestSubNode = pDestSubNode->FindNextDepthFirst(pDestRendNode); // URGH 03836 } 03837 03838 // if (bSetDragged && pDestRendNode->IsBounded()) 03839 // ((NodeRenderableBounded*)pDestRendNode)->SetDraggedState(TRUE, TRUE); 03840 if (bSetDragged) 03841 pDestRendNode->SetDraggedState(TRUE, TRUE); 03842 if (bSetRenderable) 03843 pDestRendNode->SetRender(TRUE, TRUE); 03844 03845 } 03846 03847 pSrcNode = FindNext(pSrcNode, FALSE); 03848 pDestNode = pDestRange->FindNext(pDestNode, FALSE); 03849 } 03850 }
|
|
|
Reimplemented in SelRange. Definition at line 699 of file range.cpp. 00700 { 00701 UINT32 count = 0; 00702 Node* pNode; 00703 00704 pNode = FindFirst(); 00705 while (pNode) 00706 { 00707 count++; 00708 pNode = FindNext(pNode); 00709 } 00710 00711 return(count); 00712 }
|
|
|
Definition at line 3648 of file range.cpp. 03649 { 03650 Node* pNode; 03651 Node* pNext; 03652 03653 pNode = FindFirst(); 03654 while (pNode) 03655 { 03656 pNext = FindNext(pNode); 03657 03658 pNode->CascadeDelete(); 03659 delete pNode; 03660 03661 pNode = pNext; 03662 } 03663 }
|
|
||||||||||||||||||||
|
Find out if there is a valid bitmap in the selection and return useful information to the caller.
Definition at line 7229 of file range.cpp. 07233 { 07234 KernelBitmap * pBitmap = NULL; 07235 KernelBitmapRef* pBitmapRef = NULL; 07236 07237 // Assume nothing found 07238 if (ppFoundBitmap) *ppFoundBitmap = NULL; 07239 if (ppFoundBitmapRef) *ppFoundBitmapRef = NULL; 07240 if (ppFoundNode) *ppFoundNode = NULL; 07241 if (ppFoundFillAttribute) *ppFoundFillAttribute = NULL; 07242 07243 Node* pCurrentNode = FindFirst(); 07244 07245 if (pCurrentNode != NULL) // No nodes selected so End 07246 { 07247 // Do all bitmaps. OK this should pick up the fill as well. Never mind 07248 while (pCurrentNode != NULL) 07249 { 07250 if (pCurrentNode->IsABitmap()) 07251 { 07252 NodeBitmap* pNodeBmp = (NodeBitmap*)pCurrentNode; 07253 pBitmap = pNodeBmp->GetBitmap(); 07254 pBitmapRef = pNodeBmp->GetBitmapRef(); 07255 // If the caller wanted it, return the found bitmap to them 07256 if (ppFoundBitmap) 07257 *ppFoundBitmap = pBitmap; 07258 // ditto found bitmap ref 07259 if (ppFoundBitmapRef) 07260 *ppFoundBitmapRef = pBitmapRef; 07261 // ditto found node 07262 if (ppFoundNode) 07263 *ppFoundNode = pNodeBmp; 07264 // ditto found fill attribute 07265 if (ppFoundFillAttribute) 07266 *ppFoundFillAttribute = NULL; 07267 07268 return TRUE; 07269 } 07270 07271 pCurrentNode = FindNext(pCurrentNode); 07272 } 07273 07274 } 07275 07276 if (ppFoundFillAttribute) 07277 { 07278 // Find the first Fill Attribute in the selection 07279 AttrFillGeometry* pAttrNode = AttrFillGeometry::FindFirstSelectedAttr(); 07280 07281 while (pAttrNode != NULL) 07282 { 07283 if (pAttrNode->IsKindOf(CC_RUNTIME_CLASS(AttrBitmapColourFill))) 07284 { 07285 pBitmap = pAttrNode->GetBitmap(); 07286 pBitmapRef = pAttrNode->GetBitmapRef(); 07287 // If the caller wanted it, return the found bitmap to them 07288 if (ppFoundBitmap) 07289 *ppFoundBitmap = pBitmap; 07290 // ditto found bitmap ref 07291 if (ppFoundBitmapRef) 07292 *ppFoundBitmapRef = pBitmapRef; 07293 // ditto found node 07294 if (ppFoundNode) 07295 *ppFoundNode = NULL; 07296 // ditto found fill attribute 07297 if (ppFoundFillAttribute) 07298 *ppFoundFillAttribute = pAttrNode; 07299 07300 return TRUE; 07301 } 07302 07303 // Check the next fill 07304 pAttrNode = AttrFillGeometry::FindNextSelectedAttr(); 07305 } 07306 } 07307 07308 return FALSE; 07309 }
|
|
||||||||||||||||
|
To determine if all objects in the range share an attribute with the same value. You should only use this function if you need to find a common attribute value for a single attribute type. If you need to find common values for many types then FindCommonAttributes is much more efficient.
ATTR_MANY: There is no common attribute, pAttribute will be NULL
Definition at line 2787 of file range.cpp. 02790 { 02791 #if !defined(EXCLUDE_FROM_RALPH) 02792 CommonAttribResult Result; 02793 *pAttribute = NULL; 02794 02795 // Before we go away and do any hard work, let's see if the value that the user 02796 // is after is already cached. 02797 CommonAttrSet* pCommonAttrCache = GetCommonAttrCache(); 02798 if (pCommonAttrCache) 02799 { 02800 // are the AttrTypes common details cached 02801 CommonAttributeItem* pAttrItem = pCommonAttrCache->FindAttrItem(AttribType); 02802 if (pAttrItem) 02803 { 02804 // Aren't we lucky 02805 *pAttribute = pAttrItem->pAttr; 02806 return (pAttrItem->Status); 02807 } 02808 } 02809 // else the cache could not be created. We shall just have to work without one 02810 02811 // Scan each selected node until we get a result 02812 NodeRenderableInk* n = NULL; 02813 NodeRenderableInk* pn = (NodeRenderableInk*)FindFirst(); 02814 02815 NodeAttribute* AppliedAttr; // The attribute applied and used by n. 02816 02817 |