#include <nodetxts.h>
Inheritance diagram for BaseTextClass:
Public Member Functions | |
BaseTextClass () | |
Simple BaseTextClass constructor. | |
~BaseTextClass () | |
BaseTextClass destructor. | |
BaseTextClass (Node *ContextNode, AttachNodeDirection Direction) | |
The main BaseTextClass constructor. | |
void | Init () |
init function called by various constructors | |
void | CopyNodeContents (BaseTextClass *NodeCopy) |
This method copies the node's contents to the node pointed to by NodeCopy. Assumption: Only called when creating new copies and the constructor sets these flags correctly. | |
virtual Node * | SimpleCopy () |
This method returns a shallow copy of the node with all Node pointers NULL. The function is virtual, and must be defined for all derived classes. | |
virtual void | PolyCopyNodeContents (NodeRenderable *pNodeCopy) |
Polymorphically copies the contents of this node to another. | |
virtual BOOL | IsABaseTextClass () const |
virtual BOOL | IsSetCandidate () const |
Indicates that NodeRenderableInks are candidates for membership of Attribute gallery set. | |
virtual CCRuntimeClass * | GetCurrentAttribGroup () |
Every Ink object has an associated current attribute group, If an attribute is applied to the object, and it needs to become current then the attribute group specified will get updated. | |
virtual BOOL | AllowOp (ObjChangeParam *pParam, BOOL SetOpPermissionState=TRUE, BOOL DoPreTriggerEdit=TRUE) |
Generic AllowOp() for all text nodes except TextStories. | |
BOOL | PreOpProcessing (ObjChangeParam *pParam) |
Perform all preprocessing required before an op is performed on a text node. | |
TextStory * | FindParentStory () |
get a pointer to the text story associated with this text node NB if 'this' is a text story, return 'this' | |
BOOL | DoHideNode (UndoableOperation *pUndoOp) |
As UndoableOperation::DoHideNode() BUT can be called non-undoably!!! | |
BOOL | DoInsertNewNode (UndoableOperation *pUndoOp, Node *pContextNode, AttachNodeDirection Direction) |
As UndoableOperation::DoInsertNewNode() BUT can be called non-undoably!!! | |
BOOL | DoFactorOutCommonChildAttributes (UndoableOperation *pUndoOp, BOOL Global, AttrTypeSet *pAffectedAttrTypes) |
As UndoableOperation::DoFactorOutCommonChildAttributes() BUT can be called non-undoably!!! | |
BOOL | DoLocaliseCommonAttributes (UndoableOperation *pUndoOp, BOOL CheckForDuplicates, BOOL Global, AttrTypeSet *pAffectedAttrTypes) |
As UndoableOperation::DoLocaliseCommonAttributes() BUT can be called non-undoably!!! | |
void | GetAttachNodeAndDirectionToAttachFirstChildObject (Node **ppNode, AttachNodeDirection *pDir) |
BOOL | AddNonLineLevelDescendantAttrsToSet (AttrTypeSet *pAttrTypeSet) |
void | UnionNodeAndDescendantsOldAndNewBounds (DocRect *pBounds, BOOL ParentModifiedByOp=FALSE) |
Union bounds of the node and any text descendants 'affected' with the given bounds Any text nodes which are also 'ModifiedByOp' also have their BlobBounds included as they were selected at the start of the op. | |
BOOL | ReCacheNodeAndDescendantsMetrics (FormatRegion *pFormatRegion) |
Recache metrics in (this node and any text descendants) which have been ModifiedByOp. | |
virtual BOOL | ReCacheMetrics (FormatRegion *pFormatRegion) |
Recache metrics in text node - does nothing by default. | |
void | FlagNodeAndDescendantsModifiedByOpAndParentsHaveDescendantModifiedByOp () |
Flag node and all text descendants that they have been directly modified by an op and flag all text parents that they have a text descendant directly modified by an op. | |
void | FlagNodeAndDescendantsAffectedAndParentsHaveDescendantAffected () |
Flag node and all text descendants that they have been 'affected' and flag all text parents that they have a text descendant 'affected'. | |
void | FlagPrevTextCharAndDescendantsModifiedByOpAndParentsHaveDescendantModifiedByOp () |
Flags the previous text node (on the current line only) as modified by op (this is useful for kerning where the previous char to the one that is inserted needs to be updated so it can find out if it is the left half of a kern pair). | |
void | ClearNodeAndDescendantsFlags () |
Clear flags in node and all text descendants Assumption: if any flag is set the AffectedFlag is set, and if AffectedFlag is set, its parents have DescendantAffectedFlag set. | |
BOOL | ModifiedByOp () |
BOOL | DescendantModifiedByOp () |
BOOL | NodeOrDescendantModifiedByOp () |
BOOL | Affected () |
BOOL | DescendantAffected () |
BOOL | NodeOrDescendantAffected () |
BOOL | AlreadyWritten () |
void | SetAlreadyWritten (BOOL f) |
Private Member Functions | |
void | FlagParentsHaveDescendantModifiedByOp () |
Flag all text parents that they have a text descendant directly modified by an op. | |
void | FlagDescendantsModifiedByOp () |
Flag all text descendants as being directly modified by an op. | |
void | FlagParentsHaveDescendantAffected () |
Flag all text parents that they have a text descendant 'affected'. | |
void | FlagDescendantsAffected () |
Flag all text descendants as being 'affected'. | |
void | FlagModifiedByOp () |
void | FlagDescendantModifiedByOp () |
void | FlagAffected () |
void | FlagDescendantAffected () |
void | ClearFlags () |
clear all flags in the node | |
Private Attributes | |
BYTE | mModifiedByOpFlag: 1 |
BYTE | mDescendantModifiedByOpFlag: 1 |
BYTE | mAffectedFlag: 1 |
BYTE | mDescendantAffectedFlag: 1 |
BYTE | mAlreadyWritten: 1 |
Definition at line 125 of file nodetxts.h.
|
Simple BaseTextClass constructor.
Definition at line 195 of file nodetxts.cpp. 00195 : NodeRenderableInk() // Call the base class 00196 { 00197 Init(); 00198 }
|
|
BaseTextClass destructor.
Definition at line 209 of file nodetxts.cpp.
|
|
The main BaseTextClass constructor.
Specifies the direction in which the node is to be attached to the ContextNode. The values this variable can take are as follows: PREV : Attach node as a previous sibling of the context node NEXT : Attach node as a next sibling of the context node FIRSTCHILD: Attach node as the first child of the context node LASTCHILD : Attach node as a last child of the context node Definition at line 234 of file nodetxts.cpp. 00235 :NodeRenderableInk(ContextNode, Direction) 00236 { 00237 Init(); 00238 }
|
|
Definition at line 962 of file nodetxts.cpp. 00963 { 00964 ERROR2IF(pAttrTypeSet==NULL,FALSE,"BaseTextClass::AddNonLineLevelDescendantAttrsToSet() - pAttrTypeSet==NULL"); 00965 00966 Node* pNode = FindFirstChild(); 00967 while (pNode!=NULL) 00968 { 00969 if ( pNode->IsAnAttribute() && !((NodeAttribute*)pNode)->IsALineLevelAttrib() ) 00970 { 00971 NodeAttribute* pAttr = (NodeAttribute*)pNode; 00972 if (!pAttrTypeSet->AddToSet(pAttr->GetAttributeType())) 00973 return FALSE; 00974 } 00975 else if (pNode->IsABaseTextClass()) 00976 if (!((BaseTextClass*)pNode)->AddNonLineLevelDescendantAttrsToSet(pAttrTypeSet)) 00977 return FALSE; 00978 pNode = pNode->FindNext(); 00979 } 00980 return TRUE; 00981 }
|
|
Definition at line 172 of file nodetxts.h. 00172 { return mAffectedFlag; }
|
|
Generic AllowOp() for all text nodes except TextStories.
Reimplemented from Node. Reimplemented in TextStory. Definition at line 630 of file nodetxts.cpp. 00632 { 00633 ERROR2IF(pParam==NULL,FALSE,"BaseTextClass::AllowOp() - pParam==NULL"); 00634 ERROR2IF(Parent==NULL,FALSE,"BaseTextClass::AllowOp() - Parent==NULL"); // must have at least a TextStory 00635 00636 // if a parent AllowOp() calls the TextStory AllowOp() this is as far down the tree as we 00637 // need to go to ensure the story is maintained correctly, hence the TextStory AllowOp() 00638 // does not call any child AllowOp()s 00639 // also, for similar reasons, any node in the story need only call it's parents AllowOp()s 00640 // and never its children 00641 // so we should never be called by a parent AllowOp() ... 00642 ERROR3IF(pParam->GetDirection()==OBJCHANGE_CALLEDBYPARENT,"BaseTextClass::AllowOp() - called by parent AllowOp()!"); 00643 00644 // decide if we allow it ... 00645 BOOL allowed=TRUE; 00646 ObjChangeFlags Flags=pParam->GetChangeFlags(); 00647 if (pParam->GetDirection()==OBJCHANGE_CALLEDBYCHILD) 00648 { 00649 // clean out the calling-child ptr, so it doesn't get passed around unintentionally. 00650 pParam->SetCallingChild(NULL); 00651 00652 if (Flags.ReplaceNode || Flags.MultiReplaceNode || Flags.MoveNode) 00653 allowed=FALSE; 00654 } 00655 00656 // and special case for caret (don't allow it to be deleted or copied) 00657 if (IS_A(this,CaretNode) && pParam->GetDirection()==OBJCHANGE_CALLEDBYOP) 00658 if (Flags.DeleteNode || Flags.CopyNode) 00659 allowed=FALSE; 00660 00661 // if we didn't allow it set a reason 00662 if (allowed==FALSE) 00663 pParam->SetReasonForDenial(_R(IDE_TEXT_USEDBYSTORY)); 00664 00665 00666 // if we allowed it, see if our parent allows it 00667 if (allowed) 00668 { 00669 // indicate we're calling from a child AllowOp() 00670 ObjChangeDirection OldDirection=pParam->GetDirection(); 00671 pParam->SetCallingChild(this); 00672 pParam->SetDirection(OBJCHANGE_CALLEDBYCHILD); 00673 allowed=Parent->AllowOp(pParam,SetOpPermissionState,DoPreTriggerEdit); 00674 pParam->SetDirection(OldDirection); 00675 } 00676 00677 // if setting permisions ... 00678 if (SetOpPermissionState) 00679 { 00680 // (assume if parent allowed it, it set permission correctly on itself) 00681 // (and if called by a child, it did all the pre-op processing required) 00682 // (note we should never be called by our parent) 00683 if (allowed) 00684 allowed=PreOpProcessing(pParam); 00685 else 00686 SetOpPermission(PERMISSION_DENIED,TRUE); 00687 } 00688 00689 // if we're ok so far and were asked to do a PreTriggerEdit, then 00690 // determine whether the Op may change the bounds of some nodes. 00691 // If it may, then call NameGallery::PreTriggerEdit. 00692 if (allowed && DoPreTriggerEdit) 00693 { 00694 // if the Op is non-NULL then query its MayChangeNodeBounds() method. 00695 UndoableOperation* pChangeOp = pParam->GetOpPointer(); 00696 if (pChangeOp != NULL && pChangeOp->MayChangeNodeBounds() && NameGallery::Instance()) 00697 { 00698 allowed = NameGallery::Instance()->PreTriggerEdit(pChangeOp, pParam, this); 00699 } 00700 } 00701 00702 // return result (directly, or indirectly via a child AllowOp()) to op 00703 return allowed; 00704 }
|
|
Definition at line 175 of file nodetxts.h. 00175 { return mAlreadyWritten; }
|
|
clear all flags in the node
Definition at line 347 of file nodetxts.cpp. 00348 { 00349 mModifiedByOpFlag = FALSE; 00350 mDescendantModifiedByOpFlag = FALSE; 00351 mAffectedFlag = FALSE; 00352 mDescendantAffectedFlag = FALSE; 00353 mAlreadyWritten = FALSE; 00354 }
|
|
Clear flags in node and all text descendants Assumption: if any flag is set the AffectedFlag is set, and if AffectedFlag is set, its parents have DescendantAffectedFlag set.
Definition at line 367 of file nodetxts.cpp. 00368 { 00369 if (IS_A(this, CaretNode)) 00370 SetOpPermission(PERMISSION_UNDEFINED); 00371 00372 if (NodeOrDescendantAffected()) 00373 { 00374 Node* pNode = FindFirstChild(); 00375 while (pNode!=NULL) 00376 { 00377 if (pNode->IsABaseTextClass()) 00378 ((BaseTextClass*)pNode)->ClearNodeAndDescendantsFlags(); 00379 pNode = pNode->FindNext(); 00380 } 00381 ClearFlags(); 00382 } 00383 }
|
|
This method copies the node's contents to the node pointed to by NodeCopy. Assumption: Only called when creating new copies and the constructor sets these flags correctly.
Definition at line 250 of file nodetxts.cpp. 00251 { 00252 // Ask the base class to do its bit 00253 NodeRenderableInk::CopyNodeContents(NodeCopy); 00254 }
|
|
Definition at line 173 of file nodetxts.h. 00173 { return mDescendantAffectedFlag; }
|
|
Definition at line 170 of file nodetxts.h. 00170 { return mDescendantModifiedByOpFlag; }
|
|
As UndoableOperation::DoFactorOutCommonChildAttributes() BUT can be called non-undoably!!!
Definition at line 909 of file nodetxts.cpp. 00912 { 00913 if (pUndoOp!=NULL) 00914 return pUndoOp->DoFactorOutCommonChildAttributes(this,Global,pAffectedAttrTypes); 00915 00916 return FactorOutCommonChildAttributes(Global,pAffectedAttrTypes); 00917 }
|
|
As UndoableOperation::DoHideNode() BUT can be called non-undoably!!!
Definition at line 807 of file nodetxts.cpp. 00808 { 00809 // deselect any node to hide to ensure 'parent of selected' flag correct 00810 if (IsSelected()) 00811 SetSelected(FALSE); 00812 00813 if (pUndoOp!=NULL) 00814 return pUndoOp->DoHideNode(this,FALSE,NULL,TRUE); 00815 00816 // delete the node 00817 // (no need to update selection as non-undoable code only called for clipboard/import) 00818 // (no need to invalidate bounding box as text has it's own sytem to handle this) 00819 CascadeDelete(); 00820 delete this; 00821 return TRUE; 00822 }
|
|
As UndoableOperation::DoInsertNewNode() BUT can be called non-undoably!!!
Definition at line 840 of file nodetxts.cpp. 00843 { 00844 BOOL ok = TRUE; 00845 if (pUndoOp!=NULL) 00846 ok = pUndoOp->DoInsertNewNode(this, pContextNode, Direction, FALSE,FALSE,FALSE,FALSE); 00847 else 00848 { 00849 // Insert the NewNode into the tree 00850 // (no need to invalidate bounding box as text has it's own sytem to handle this) 00851 // (assume layer is not locked and is visible) 00852 // (do not select the object, normalise it's attrs as this is done later) 00853 AttachNode(pContextNode, Direction); 00854 } 00855 00856 if (ok) this->FlagNodeAndDescendantsModifiedByOpAndParentsHaveDescendantModifiedByOp(); 00857 00858 // flag prev char to allow for kerning 00859 FlagPrevTextCharAndDescendantsModifiedByOpAndParentsHaveDescendantModifiedByOp(); 00860 00861 return ok; 00862 }
|
|
As UndoableOperation::DoLocaliseCommonAttributes() BUT can be called non-undoably!!!
Definition at line 882 of file nodetxts.cpp. 00886 { 00887 if (pUndoOp!=NULL) 00888 return pUndoOp->DoLocaliseCommonAttributes(this,CheckForDuplicates,Global,pAffectedAttrTypes); 00889 00890 return LocaliseCommonAttributes(CheckForDuplicates,Global,pAffectedAttrTypes); 00891 }
|
|
get a pointer to the text story associated with this text node NB if 'this' is a text story, return 'this'
Definition at line 783 of file nodetxts.cpp. 00784 { 00785 Node* pNode=this; 00786 while (IS_A(pNode,TextStory)==FALSE) 00787 { 00788 pNode = pNode->FindParent(); 00789 if (pNode==NULL || pNode->IsABaseTextClass()==FALSE) 00790 ERROR2(NULL,"BaseTextClass::FindParentStory() - could not find associated TextStory"); 00791 } 00792 return (TextStory*)pNode; 00793 }
|
|
Definition at line 187 of file nodetxts.h. 00187 { mAffectedFlag = TRUE; }
|
|
Definition at line 188 of file nodetxts.h. 00188 { mDescendantAffectedFlag = TRUE; }
|
|
Definition at line 186 of file nodetxts.h. 00186 { mDescendantModifiedByOpFlag = TRUE; mDescendantAffectedFlag = TRUE; }
|
|
Flag all text descendants as being 'affected'.
Definition at line 518 of file nodetxts.cpp. 00519 { 00520 Node* pNode = FindFirstChild(); 00521 while (pNode!=NULL) 00522 { 00523 if (pNode->IsABaseTextClass()) 00524 { 00525 BaseTextClass* pBTC = (BaseTextClass*)pNode; 00526 pBTC->FlagAffected(); 00527 pBTC->FlagDescendantsAffected(); 00528 } 00529 pNode = pNode->FindNext(); 00530 } 00531 }
|
|
Flag all text descendants as being directly modified by an op.
Definition at line 445 of file nodetxts.cpp. 00446 { 00447 Node* pNode = FindFirstChild(); 00448 while (pNode!=NULL) 00449 { 00450 if (pNode->IsABaseTextClass()) 00451 { 00452 BaseTextClass* pBTC = (BaseTextClass*)pNode; 00453 pBTC->FlagModifiedByOp(); 00454 pBTC->FlagDescendantsModifiedByOp(); 00455 } 00456 pNode = pNode->FindNext(); 00457 } 00458 }
|
|
Definition at line 185 of file nodetxts.h. 00185 { mModifiedByOpFlag = TRUE; mAffectedFlag = TRUE; }
|
|
Flag node and all text descendants that they have been 'affected' and flag all text parents that they have a text descendant 'affected'.
Definition at line 470 of file nodetxts.cpp. 00471 { 00472 FlagAffected(); 00473 FlagDescendantsAffected(); 00474 FlagParentsHaveDescendantAffected(); 00475 }
|
|
Flag node and all text descendants that they have been directly modified by an op and flag all text parents that they have a text descendant directly modified by an op.
Definition at line 396 of file nodetxts.cpp. 00397 { 00398 FlagModifiedByOp(); 00399 FlagDescendantsModifiedByOp(); 00400 FlagParentsHaveDescendantModifiedByOp(); 00401 }
|
|
Flag all text parents that they have a text descendant 'affected'.
Definition at line 486 of file nodetxts.cpp. 00487 { 00488 // get parent 00489 Node* pNode = this->FindParent(); 00490 if (pNode==NULL) 00491 { 00492 ERROR3("BaseTextClass::FlagParentsHaveDescendantAffected() - node has no parent"); 00493 return; 00494 } 00495 00496 // if parent is a text node, set it's flag and flag it's parents 00497 if (pNode->IsABaseTextClass()) 00498 { 00499 // if 'DescendantAffected' assume all it's parents already have this flag set 00500 BaseTextClass* pBTC = (BaseTextClass*)pNode; 00501 if (pBTC->DescendantAffected()==FALSE) 00502 { 00503 pBTC->FlagDescendantAffected(); 00504 pBTC->FlagParentsHaveDescendantAffected(); 00505 } 00506 } 00507 }
|
|
Flag all text parents that they have a text descendant directly modified by an op.
Definition at line 412 of file nodetxts.cpp. 00413 { 00414 // get parent 00415 Node* pNode = this->FindParent(); 00416 if (pNode==NULL) 00417 { 00418 // Can be called when text block is being inserted and does not yet have a parent??? 00419 // ERROR3("BaseTextClass::FlagParentsHaveDescendantModifiedByOp() - node has no parent") 00420 return; 00421 } 00422 00423 // if parent is a text node, set it's flag and flag it's parents 00424 if (pNode->IsABaseTextClass()) 00425 { 00426 // if 'DescendantModifiedByOp' assume all it's parents already have this flag set 00427 BaseTextClass* pBTC = (BaseTextClass*)pNode; 00428 if (pBTC->DescendantModifiedByOp()==FALSE) 00429 { 00430 pBTC->FlagDescendantModifiedByOp(); 00431 pBTC->FlagParentsHaveDescendantModifiedByOp(); 00432 } 00433 } 00434 }
|
|
Flags the previous text node (on the current line only) as modified by op (this is useful for kerning where the previous char to the one that is inserted needs to be updated so it can find out if it is the left half of a kern pair).
Definition at line 546 of file nodetxts.cpp. 00547 { 00548 if (!this->IsAVisibleTextNode()) 00549 return; 00550 00551 VisibleTextNode* pVTN = static_cast<VisibleTextNode*>(this); 00552 TextChar* pTC = pVTN->FindPrevTextCharInStory(); 00553 00554 BaseTextClass* pBTC = pTC; 00555 if (pBTC) 00556 { 00557 pBTC->FlagModifiedByOp(); 00558 pBTC->FlagDescendantsModifiedByOp(); 00559 pBTC->FlagParentsHaveDescendantModifiedByOp(); 00560 } 00561 }
|
|
Definition at line 930 of file nodetxts.cpp. 00932 { 00933 *ppNode = this->FindFirstChild(CC_RUNTIME_CLASS(NodeRenderableInk)); 00934 *pDir = PREV; 00935 00936 // if no object to attach before, try next to last non-object node 00937 if (*ppNode==NULL) 00938 { 00939 *ppNode = this->FindLastChild(); 00940 *pDir = NEXT; 00941 } 00942 00943 // if no child nodes, set first child of this 00944 if (*ppNode==NULL) 00945 { 00946 *ppNode = this; 00947 *pDir = FIRSTCHILD; 00948 } 00949 }
|
|
Every Ink object has an associated current attribute group, If an attribute is applied to the object, and it needs to become current then the attribute group specified will get updated.
Reimplemented from NodeRenderableInk. Definition at line 767 of file nodetxts.cpp. 00768 { 00769 return (CC_RUNTIME_CLASS(BaseTextClass)); 00770 }
|
|
init function called by various constructors
Reimplemented from NodeRenderableInk. Reimplemented in VisibleTextNode, AbstractTextChar, TextLine, and TextStory. Definition at line 177 of file nodetxts.cpp. 00178 { 00179 mModifiedByOpFlag = TRUE; // ensures node will have metrics recached 00180 mDescendantModifiedByOpFlag = TRUE; // ensures any children will have metrics cached 00181 mAffectedFlag = TRUE; // ensures node will be includes in redraw rect 00182 mDescendantAffectedFlag = TRUE; // ensures any children will be included in redraw 00183 mAlreadyWritten = FALSE; // ensures the char will be written to v2 files 00184 }
|
|
Reimplemented from Node. Definition at line 139 of file nodetxts.h. 00139 { return TRUE; }
|
|
Indicates that NodeRenderableInks are candidates for membership of Attribute gallery set.
Reimplemented from NodeRenderableInk. Reimplemented in TextChar, TextLine, and TextStory. Definition at line 140 of file nodetxts.h. 00140 { return FALSE; }
|
|
Definition at line 169 of file nodetxts.h. 00169 { return mModifiedByOpFlag; }
|
|
Definition at line 174 of file nodetxts.h. 00174 { return mAffectedFlag || mDescendantAffectedFlag; }
|
|
Definition at line 171 of file nodetxts.h. 00171 { return mModifiedByOpFlag || mDescendantModifiedByOpFlag; }
|
|
Polymorphically copies the contents of this node to another.
Reimplemented from NodeRenderableBounded. Reimplemented in AbstractTextChar, TextChar, KernCode, HorizontalTab, EOLNode, TextLine, and TextStory. Definition at line 269 of file nodetxts.cpp. 00270 { 00271 ENSURE(pNodeCopy, "Trying to copy a node's contents into a NULL node"); 00272 ENSURE(pNodeCopy->IsKindOf(CC_RUNTIME_CLASS(BaseTextClass)), "PolyCopyNodeContents given wrong dest node type"); 00273 00274 if (pNodeCopy->IsKindOf(CC_RUNTIME_CLASS(BaseTextClass))) 00275 CopyNodeContents((BaseTextClass*)pNodeCopy); 00276 }
|
|
Perform all preprocessing required before an op is performed on a text node.
Definition at line 717 of file nodetxts.cpp. 00718 { 00719 // if called by an AllowOp() which itself was NOT called by a child's AllowOp(), do our stuff 00720 // (assume if it WAS called by an AllowOp() which itself was called by a child AllowOp() 00721 // (this routine would have already been called by a child's AllowOp() which itself was 00722 // (called by an AlowOp() called directly by an Op! 00723 if (pParam->GetDirection()!=OBJCHANGE_CALLEDBYCHILD || 00724 (pParam->GetCallingChild() != NULL && 00725 pParam->GetCallingChild()->IsNodePath()) ) 00726 { 00727 // if the TextStory has already been met by the op, 00728 // just union the affected node's bounds with the current redraw rect 00729 // else (we've been called for the first time in this op for this story) so, 00730 // flag the story has been met, reset the redraw rect, insert a single reformat action for undo 00731 TextStory* pTextStory = FindParentStory(); 00732 if (pTextStory->NodeOrDescendantModifiedByOp()) 00733 pTextStory->UpdateRedrawRect(GetBoundingRect()); 00734 else 00735 { 00736 pTextStory->Validate(); 00737 pTextStory->SetRedrawRect(GetBoundingRect()); 00738 UndoableOperation* pOp=pParam->GetOpPointer(); 00739 if (pOp!=NULL) 00740 if (PrePostTextAction::Init(pOp,pOp->GetUndoActionList(),pTextStory,TRUE)==AC_FAIL) 00741 return FALSE; 00742 } 00743 // also need to include blob bounds as obj must be selected to get here! 00744 pTextStory->UpdateRedrawRect(GetBlobBoundingRect()); 00745 00746 // flag the node is directly modified by the op 00747 FlagNodeAndDescendantsModifiedByOpAndParentsHaveDescendantModifiedByOp(); 00748 00749 // flag prev char to allow for kerning 00750 FlagPrevTextCharAndDescendantsModifiedByOpAndParentsHaveDescendantModifiedByOp(); 00751 } 00752 return TRUE; 00753 }
|
|
Recache metrics in text node - does nothing by default.
Reimplemented in AbstractTextChar, and TextLine. Definition at line 333 of file nodetxts.cpp. 00334 { 00335 return TRUE; 00336 }
|
|
Recache metrics in (this node and any text descendants) which have been ModifiedByOp.
Definition at line 289 of file nodetxts.cpp. 00290 { 00291 PORTNOTE("text","BaseTextClass::ReCacheNodeAndDescendantsMetrics - do nothing"); 00292 #ifndef DISABLE_TEXT_RENDERING 00293 BOOL ok=TRUE; 00294 if (NodeOrDescendantModifiedByOp()) 00295 { 00296 pFormatRegion->SaveContext(); 00297 00298 // scan immediate children rendering any text attrs, and recaching metrics on any text node 00299 Node* pNode = FindFirstChild(); 00300 while (pNode!=NULL) 00301 { 00302 if (pNode->IsABaseTextClass()) 00303 ok = ok && ((BaseTextClass*)pNode)->ReCacheNodeAndDescendantsMetrics(pFormatRegion); 00304 else if (pNode->IsKindOfTextAttribute()) 00305 pNode->Render(pFormatRegion); 00306 pNode = pNode->FindNext(); 00307 } 00308 00309 // now all child text attrs rendered, recache this node's metrics 00310 if (this->ModifiedByOp()) 00311 ok = ok && ReCacheMetrics(pFormatRegion); 00312 00313 pFormatRegion->RestoreContext(); 00314 } 00315 00316 return ok; 00317 #else 00318 return FALSE; 00319 #endif 00320 }
|
|
Definition at line 177 of file nodetxts.h. 00177 { mAlreadyWritten = f; }
|
|
This method returns a shallow copy of the node with all Node pointers NULL. The function is virtual, and must be defined for all derived classes.
Reimplemented from NodeRenderableInk. Reimplemented in VisibleTextNode, AbstractTextChar, TextChar, KernCode, HorizontalTab, CaretNode, EOLNode, TextLine, and TextStory. Definition at line 136 of file nodetxts.h.
|
|
Union bounds of the node and any text descendants 'affected' with the given bounds Any text nodes which are also 'ModifiedByOp' also have their BlobBounds included as they were selected at the start of the op.
But (w.r.t. blob bounds) since a selected node can have no selected descendants AND BlobBounds are not dependent on descendants, if a node's parent is ModifiedByOp this node's blob bounds do not need to be included Should not be including BlobBounds in undo actions as they don't scale except if they're text blobs! - what about line & story blobs? Definition at line 585 of file nodetxts.cpp. 00586 { 00587 if (NodeOrDescendantAffected()) 00588 { 00589 Node* pNode = FindFirstChild(); 00590 while (pNode!=NULL) 00591 { 00592 if (pNode->IsABaseTextClass()) 00593 ((BaseTextClass*)pNode)->UnionNodeAndDescendantsOldAndNewBounds(pBounds,ModifiedByOp()); 00594 pNode = pNode->FindNext(); 00595 } 00596 } 00597 00598 if (Affected()) 00599 { 00600 *pBounds = pBounds->Union(GetBoundingRect()); 00601 if (ModifiedByOp() && !ParentModifiedByOp) 00602 *pBounds = pBounds->Union(GetBlobBoundingRect()); 00603 00604 InvalidateBoundingRect(); 00605 00606 *pBounds = pBounds->Union(GetBoundingRect()); 00607 if (ModifiedByOp() && !ParentModifiedByOp) 00608 *pBounds = pBounds->Union(GetBlobBoundingRect()); 00609 } 00610 }
|
|
Definition at line 195 of file nodetxts.h. |
|
Definition at line 197 of file nodetxts.h. |
|
Definition at line 196 of file nodetxts.h. |
|
Definition at line 194 of file nodetxts.h. |
|
Definition at line 193 of file nodetxts.h. |