1 /************************************************************************/ 2 /* */ 3 /* Text Editor Buffer structure. */ 4 /* */ 5 /************************************************************************/ 6 7 # ifndef DOC_BUF_H 8 # define DOC_BUF_H 9 10 # include <time.h> 11 12 # include <bitmap.h> 13 # include <psPostScriptFontList.h> 14 # include <geo2DInteger.h> 15 # include <utilMemoryBuffer.h> 16 17 # include <docFramePropertiesAdmin.h> 18 19 # include <docStyleSheet.h> 20 # include <docDocumentProperties.h> 21 # include <docDocumentFieldList.h> 22 # include "docDrawingShapeList.h" 23 # include <docInsertedObjectList.h> 24 # include <docObject.h> 25 # include "docSelect.h" 26 # include "docDocumentTree.h" 27 # include <docListTable.h> 28 29 # include <docEditPosition.h> 30 # include <docEditRange.h> 31 32 /************************************************************************/ 33 /* */ 34 /* Forward declarations of structs. */ 35 /* */ 36 /************************************************************************/ 37 38 struct BufferDocument; 39 struct BufferItem; 40 struct TextLine; 41 struct TextParticule; 42 struct DocumentNote; 43 struct NoteProperties; 44 struct ParagraphProperties; 45 struct BorderProperties; 46 struct TabStopList; 47 struct DocumentPropertyLists; 48 49 /************************************************************************/ 50 /* */ 51 /* The document as a whole. */ 52 /* */ 53 /************************************************************************/ 54 55 typedef struct NotesList 56 { 57 struct DocumentNote * nlNotes; 58 int nlNoteCount; 59 } NotesList; 60 61 typedef struct BufferDocument 62 { 63 /** 64 * Numbered properties of the document. 65 * In some cases, the lists are shared 66 * between documents. 67 */ 68 struct DocumentPropertyLists * bdPropertyLists; 69 70 /** 71 * The body of the document. This is the 72 * main document tree. Page headers and 73 * page footers are attached to the sections. 74 * 75 * Notes are kept in bdNotesList. The 76 * separators between the notes and ordinary 77 * text are declared below. 78 */ 79 DocumentTree bdBody; 80 DocumentProperties bdProperties; 81 82 InsertedObjectList bdObjectList; 83 DocumentStyleSheet bdStyleSheet; 84 DocumentFieldList bdFieldList; 85 DrawingShapeList bdShapeList; 86 87 /** 88 * The notes in this document. References 89 * from the contents of the various document 90 * trees to this list always pass through 91 * the field list of that tree. 92 * 93 * In practice, only the document body holds 94 * notes. The implementation of notes 95 * implcitly relies on this assumption. 96 */ 97 NotesList bdNotesList; 98 99 /** 100 * The Identifiers of the sequence 101 * fields in this document. It is map from 102 * the identifier to an int. The value of 103 * the int is only relevant inside the loop 104 * that renumbers the SEQ fields of a tree 105 * in the document. 106 */ 107 void * bdSeqFieldIdentifiers; 108 109 DocumentTree bdEiFtnsep; 110 DocumentTree bdEiFtnsepc; 111 DocumentTree bdEiFtncn; 112 113 DocumentTree bdEiAftnsep; 114 DocumentTree bdEiAftnsepc; 115 DocumentTree bdEiAftncn; 116 117 /** 118 * Used to smuggle the command line property 119 * into the line formatter. 120 */ 121 unsigned char bdAutoHyphenate; 122 } BufferDocument; 123 124 /************************************************************************/ 125 126 # define docGetObject( bd, n ) \ 127 docGetObjectByNumber( &((bd)->bdObjectList), (n) ) 128 # define docClaimObject( p, bd ) \ 129 docClaimInsertedObject( (p), &((bd)->bdObjectList) ) 130 131 /************************************************************************/ 132 /* */ 133 /* Routine declarations. */ 134 /* */ 135 /************************************************************************/ 136 137 extern const char * docKindStr( int kind ); 138 extern const char * docLevelStr( int level ); 139 extern const char * docTreeTypeStr( int level ); 140 extern const char * docFieldKindStr( int kind ); 141 extern const char * docObjectKindStr( int kind ); 142 extern const char * docBreakKindStr( int kind ); 143 extern const char * docAttributeStr( const TextAttribute * ta ); 144 extern const char * docParticuleFlagsStr( int flags ); 145 146 extern int docGetDefaultFont( BufferDocument * bd ); 147 148 extern BufferDocument * docNewFile( 149 TextAttribute * taDefault, 150 const char * defaultFontName, 151 int defaultFontSize, 152 const PostScriptFontList * psfl, 153 const DocumentGeometry * dg ); 154 155 extern void docFreeDocument( BufferDocument * bd ); 156 extern BufferDocument * docNewDocument( const BufferDocument * bdRef ); 157 158 extern int docNextPosition( DocumentPosition * dp ); /* technical */ 159 extern int docPrevPosition( DocumentPosition * dp ); /* technical */ 160 161 extern int docGotoNextPosition( DocumentPosition * dp ); /* navigation */ 162 extern int docGotoPrevPosition( DocumentPosition * dp ); /* navigation */ 163 164 extern int docNextWord( DocumentPosition * dp ); 165 extern int docPrevWord( DocumentPosition * dp ); 166 167 extern int docLineDown( int * pLine, 168 DocumentPosition * dp, 169 int line ); 170 171 extern int docLineUp( int * pLine, 172 DocumentPosition * dp, 173 int line ); 174 175 extern int docGotoFirstPosition( DocumentPosition * dp, /* navigation */ 176 struct BufferItem * node ); 177 extern int docGotoLastPosition( DocumentPosition * dp, /* navigation */ 178 struct BufferItem * node ); 179 extern int docHeadPosition( DocumentPosition * dp, /* technical */ 180 struct BufferItem * node ); 181 extern int docTailPosition( DocumentPosition * dp, /* technical */ 182 struct BufferItem * node ); 183 184 extern int docDocumentHead( DocumentPosition * dp, 185 BufferDocument * bd ); 186 187 extern int docDocumentTail( DocumentPosition * dp, 188 BufferDocument * bd ); 189 190 extern void docAvoidParaHeadField( DocumentPosition * dp, 191 int * pPart, 192 const BufferDocument * bd ); 193 194 extern void docSetParaSelection( DocumentSelection * ds, 195 struct BufferItem * node, 196 int direction, 197 int start, 198 int length ); 199 200 extern int docComparePositions( const DocumentPosition * dp1, 201 const DocumentPosition * dp2 ); 202 203 extern int docSetDocumentPosition( DocumentPosition * dp, 204 struct BufferItem * node, 205 int stroff ); 206 207 extern int docCompareNodePositionToSelection( 208 const struct BufferItem * node, 209 const DocumentSelection * ds ); 210 211 extern int docCompareCellPositionToSelection( 212 int * pSelected, 213 const struct BufferItem * cellBi, 214 const DocumentSelection * ds ); 215 216 extern void docDeleteDocumentTree( BufferDocument * bd, 217 DocumentTree * dt ); 218 219 extern void docEraseDocumentTree( BufferDocument * bd, 220 DocumentTree * dt ); 221 222 extern InsertedObject * docClaimObjectCopy( 223 BufferDocument * bd, 224 int * pNr, 225 const InsertedObject * ioFrom ); 226 227 extern int docDelimitTable( const struct BufferItem * paraNode, 228 struct BufferItem ** pParentNode, 229 int * pCol, 230 int * pRow0, 231 int * pRow, 232 int * pRow1 ); 233 234 extern void docTableDetermineCellspans( int * pRowspan, 235 int * pColspan, 236 const struct BufferItem * cellNode ); 237 238 extern int docGetCellBottom( LayoutPosition * lpBottom, 239 const struct BufferItem * cellNode ); 240 241 extern void docLineSelection( DocumentSelection * dsLine, 242 int * pPartLineBegin, 243 int * pPartLineEnd, 244 const struct BufferItem * node, 245 int line ); 246 247 extern void docWordSelection( 248 DocumentSelection * dsWord, 249 int * pIsObject, 250 const DocumentPosition * dpAround ); 251 252 extern int docWhatPageHeader( DocumentTree ** pTree, 253 int * pIsEmpty, 254 const struct BufferItem * bodySectNode, 255 int page, 256 const BufferDocument * bd ); 257 258 extern int docWhatPageFooter( DocumentTree ** pTree, 259 int * pIsEmpty, 260 const struct BufferItem * bodySectNode, 261 int page, 262 const BufferDocument * bd ); 263 264 extern int docWhatPagesForHeaderFooter( 265 const DocumentProperties * dp, 266 const SectionProperties * sp, 267 int treeType ); 268 269 extern struct BufferItem * docGetSelectionRoot( 270 DocumentTree ** pTree, 271 struct BufferItem ** pBodySectNode, 272 BufferDocument * bd, 273 const DocumentSelection * ds ); 274 275 extern int docGetHeaderFooter( DocumentTree ** pTree, 276 struct BufferItem ** pBodySectNode, 277 const DocumentPosition * dp, 278 BufferDocument * bd, 279 int treeType ); 280 281 extern int docInquireHeadersFooters( 282 int * pDocHasHeaders, 283 int * pDocHasFooters, 284 const BufferDocument * bd ); 285 286 extern int docMakeDocumentTree( BufferDocument * bd, 287 DocumentTree * dt, 288 const SelectionScope * ss, 289 const SectionProperties * sp ); 290 291 extern struct BufferItem * docMakeExternalParagraph( 292 BufferDocument * bd, 293 DocumentTree * dt, 294 int treeType, 295 const struct BufferItem * bodyNode, 296 int ownerNumber, 297 int txtAttrNr ); 298 299 extern struct BufferItem * docMakeTreeRoot( 300 BufferDocument * bd, 301 DocumentTree * dt, 302 const struct BufferItem * bodyBi, 303 int ownerNumber, 304 int treeType ); 305 306 extern struct BufferItem * docInsertEmptyParagraph( 307 BufferDocument * bd, 308 struct BufferItem * node, 309 int txtAttrNr ); 310 311 extern int docTableRectangleSelection( DocumentSelection * ds, 312 struct BufferItem ** pSelParentBi, 313 BufferDocument * bd, 314 const TableRectangle * tr ); 315 316 extern int docMergeDocumentLists( 317 int ** pFontMap, 318 int ** pListStyleMap, 319 BufferDocument * bdTo, 320 BufferDocument * bdFrom, 321 const int * colorMap, 322 const int * rulerMap ); 323 324 extern int docMergeColorTables( int ** pColorMap, 325 BufferDocument * bdTo, 326 const BufferDocument * bdFrom ); 327 328 extern int docFindBookmarkInDocument( DocumentSelection * dsInside, 329 int * pHeadPart, 330 int * pTailPart, 331 const BufferDocument * bd, 332 const MemoryBuffer * markName ); 333 334 extern DocumentField * docMakeField( 335 BufferDocument * bd, 336 DocumentTree * dt, 337 const DocumentSelection * dsInput, 338 int part0, 339 int part1, 340 int attr0, 341 int attr1 ); 342 343 extern void docConstrainSelectionToOneParagraph( int * pHeadMoved, 344 int * pTailMoved, 345 DocumentSelection * ds ); 346 347 extern int docParaNextWord( const struct BufferItem * paraNode, 348 int stroff ); 349 350 extern int docParaPrevWord( const struct BufferItem * paraNode, 351 int stroff ); 352 353 extern int docParaHeadOfWord( int * pStroff, 354 const struct BufferItem * paraNode, 355 int part ); 356 357 extern int docParaTailOfWord( int * pStroff, 358 const struct BufferItem * paraNode, 359 int part ); 360 361 extern int docParaPastLastNonBlank( const struct BufferItem * paraNode, 362 int from, 363 int upto ); 364 365 extern DocumentTree * docSectionHeaderFooter( 366 const struct BufferItem * bodySectNode, 367 unsigned char * pApplies, 368 const DocumentProperties * dp, 369 int treeType ); 370 371 extern int docSectionHasHeaderFooter( 372 const struct BufferItem * bodySectNode, 373 unsigned char * pApplies, 374 const DocumentProperties * dp, 375 int treeType ); 376 377 DocumentTree * docDocumentNoteSeparator( 378 BufferDocument * bd, 379 int which ); 380 381 extern int docGetTreeOfNode( DocumentTree ** pTree, 382 struct BufferItem ** pBodySectNode, 383 BufferDocument * bd, 384 struct BufferItem * node ); 385 386 extern int docGetRootOfSelectionScope( DocumentTree ** pTree, 387 struct BufferItem ** pBodySectNode, 388 BufferDocument * bd, 389 const SelectionScope * ss ); 390 391 extern int docSectionHeaderFooterFirstPage( 392 int * pUsedInDocument, 393 const struct BufferItem * bodySectNode, 394 int treeType, 395 const DocumentProperties * dp ); 396 397 extern int docSelectWholeSection( DocumentSelection * bs, 398 int direction ); 399 extern int docSelectWholeTable( DocumentSelection * bs ); 400 extern int docSelectRow( DocumentSelection * bs, 401 int direction, 402 int allColumns ); 403 extern int docSelectWholeCell( DocumentSelection * bs, 404 int direction, 405 int allRows ); 406 extern int docSelectColumn( DocumentSelection * ds, 407 int col ); 408 extern int docSelectWholeParagraph( DocumentSelection * bs, 409 int direction ); 410 411 extern int docSelectWholeBody( DocumentSelection * ds, 412 BufferDocument * bd ); 413 414 extern int docNumberOfParagraph( const struct BufferItem * paraNode ); 415 416 extern struct BufferItem * docGetParagraphByNumber( 417 const DocumentTree * dt, 418 int n ); 419 420 extern struct BufferItem * docGetCommonParent( 421 struct BufferItem * paraNode1, 422 struct BufferItem * paraNode2 ); 423 424 extern void docSetTreeTypeOfNode( struct BufferItem * node, 425 int treeType ); 426 427 extern int docCheckNoteSeparatorItem( BufferDocument * bd, 428 int sepTreeType ); 429 extern int docCheckSeparatorItemForNoteType( 430 BufferDocument * bd, 431 int noteTreeType ); 432 433 extern int docCountParticulesInField( const struct BufferItem * paraNode, 434 int * pClosed, 435 int part, 436 int partUpto ); 437 438 extern int docGetSolidRgbShadeOfItem( int * pIsFilled, 439 RGB8Color * rgb8, 440 const BufferDocument * bd, 441 const ItemShading * is ); 442 443 extern void docDelimitTables( struct BufferItem * parentNode, 444 int recursively ); 445 446 extern int docTextAttributeNumber( BufferDocument * bd, 447 const TextAttribute * ta ); 448 449 extern void docGetTextAttributeByNumber( TextAttribute * ta, 450 const BufferDocument * bd, 451 int n ); 452 453 extern int docItemShadingNumber( BufferDocument * bd, 454 const ItemShading * is ); 455 456 extern void docGetItemShadingByNumber( ItemShading * is, 457 const BufferDocument * bd, 458 int n ); 459 460 extern int docShadingNumberIsShading( const BufferDocument * bd, 461 int n ); 462 463 extern int docFramePropertiesNumber( BufferDocument * bd, 464 const FrameProperties * fp ); 465 466 extern void docGetFramePropertiesByNumber( 467 FrameProperties * fp, 468 const BufferDocument * bd, 469 int n ); 470 471 extern int docBorderPropertiesNumber( BufferDocument * bd, 472 const struct BorderProperties * bp ); 473 474 extern void docGetBorderPropertiesByNumber( 475 struct BorderProperties * bp, 476 const BufferDocument * bd, 477 int n ); 478 479 extern int docBorderNumberIsBorder( const BufferDocument * bd, 480 int n ); 481 482 483 extern int docTabStopListNumber( BufferDocument * bd, 484 const struct TabStopList * tsl ); 485 486 extern void docGetTabStopListByNumber( 487 struct TabStopList * tsl, 488 const BufferDocument * bd, 489 int n ); 490 491 extern int docBalanceFieldSelection( DocumentField ** pLeftField, 492 DocumentField ** pRightField, 493 int * pBeginMoved, 494 int * pEndMoved, 495 int * pHeadPart, 496 int * pTailPart, 497 DocumentPosition * dpBegin, 498 DocumentPosition * dpEnd, 499 DocumentTree * dt, 500 BufferDocument * bd ); 501 502 extern int docGetListOfParagraph( struct ListOverride ** pLo, 503 struct DocumentList ** pDl, 504 int ls, 505 const BufferDocument * bd ); 506 507 extern int docGetListLevelOfParagraph( 508 int * startPath, 509 int * formatPath, 510 struct ListOverride ** pLo, 511 struct DocumentList ** pDl, 512 const struct ListLevel ** pLl, 513 const ParagraphProperties * pp, 514 const BufferDocument * bd ); 515 516 extern int docRemoveParagraphFromList( struct BufferItem * paraNode, 517 DocumentTree * dt, 518 BufferDocument * bd ); 519 520 extern int docParaHeadFieldKind( const struct BufferItem * paraNode, 521 const BufferDocument * bd ); 522 523 extern int docDelimitParaHeadField( 524 DocumentField ** pField, 525 DocumentSelection * dsInsideField, 526 DocumentSelection * dsAroundField, 527 int * pPartBegin, 528 int * pPartEnd, 529 const struct BufferItem * paraNode, 530 const BufferDocument * bd ); 531 532 extern int docFindListOfSelection( 533 int * pLs, 534 int * pLevel, 535 int * pMultiList, 536 int * pMultiLevel, 537 int * pParaNr, 538 const DocumentSelection * ds, 539 DocumentTree * tree, 540 BufferDocument * bd ); 541 542 extern int docApplyListRuler( const struct DocumentList * dl, 543 const struct ListOverride * lo, 544 BufferDocument * bd ); 545 546 extern int docGetEffectiveTextAttributes( 547 TextAttribute * ta, 548 BufferDocument * bd, 549 const struct BufferItem * paraNode, 550 int part ); 551 552 extern int docGetSelectionAttributes( 553 BufferDocument * bd, 554 const DocumentSelection * ds, 555 PropertyMask * pUpdMask, 556 TextAttribute * pTaNew ); 557 558 extern int docInsertParaHeadField( 559 DocumentField ** pField, 560 DocumentSelection * dsInsideField, 561 DocumentSelection * dsAroundField, 562 int * pHeadPart, 563 int * pTailPart, 564 struct BufferItem * paraNode, 565 BufferDocument * bd, 566 DocumentTree * dt, 567 int fieldKind, 568 int textAttrNr ); 569 570 extern int docDelimitFieldInDoc(DocumentSelection * dsInside, 571 DocumentSelection * dsAround, 572 int * pPart0, 573 int * pPart1, 574 const BufferDocument * bd, 575 const DocumentField * df ); 576 577 extern int docDelimitFieldInTree( 578 DocumentSelection * dsInside, 579 DocumentSelection * dsAround, 580 int * pPart0, 581 int * pPart1, 582 const BufferDocument * bd, 583 const DocumentTree * dt, 584 const DocumentField * df ); 585 586 extern int docDeleteFieldFromParent( 587 DocumentTree * dt, 588 DocumentField * df ); 589 590 extern int docNextSimilarRoot( DocumentPosition * dp, 591 int * pPage, 592 int * pColumn, 593 BufferDocument * bd ); 594 595 extern int docPrevSimilarRoot( DocumentPosition * dp, 596 int * pPage, 597 int * pColumn, 598 BufferDocument * bd ); 599 600 extern int docAdaptParagraphToListLevel( 601 int * pChanged, 602 struct BufferItem * paraNode, 603 const BufferDocument * bd ); 604 605 extern int docMakeCapsString( char ** pUpperString, 606 int ** pSegments, 607 int * pSegmentCount, 608 const TextAttribute * ta, 609 const char * printString, 610 int len ); 611 612 extern int docChangeRowProperties( 613 PropertyMask * rpDonePask, 614 struct BufferItem * rowNode, 615 const PropertyMask * rpSetMask, 616 const RowProperties * rpFrom ); 617 618 extern int docSelectionForEditPositionsInDoc( 619 DocumentSelection * ds, 620 const BufferDocument * bd, 621 const SelectionScope * ss, 622 const EditPosition * epHead, 623 const EditPosition * epTail ); 624 625 extern int docSelectionForEditPositionsInTree( 626 DocumentSelection * ds, 627 const DocumentTree * dt, 628 const EditPosition * epHead, 629 const EditPosition * epTail ); 630 631 extern int docPositionForEditPosition( DocumentPosition * dpNew, 632 const EditPosition * ep, 633 const DocumentTree * dt ); 634 635 extern int docShiftFieldReferences( DocumentTree * dt, 636 int sectFrom, 637 int paraFrom, 638 int stroffFrom, 639 int sectShift, 640 int paraShift, 641 int stroffShift ); 642 643 extern int docGetCellRight( int * pColspan, 644 const struct BufferItem * cellNode ); 645 646 extern int docGetMatchingCell( int * pColspan, 647 const struct BufferItem * rowNode, 648 int l, 649 int r ); 650 651 extern const CellProperties * docGetCellProperties( 652 const RowProperties ** pRp, 653 const struct BufferItem * cellNode ); 654 655 extern void docSetCellRectangleProperties( CellProperties * cpSet, 656 const struct BufferItem * rowNode, 657 const TableRectangle * tr, 658 const DocumentAttributeMap * dam ); 659 660 extern void docDeleteFieldFromDocument( BufferDocument * bd, 661 DocumentField * df ); 662 663 extern int docDeleteFieldRange( int * pUpdateFlags, 664 BufferDocument * bd, 665 const EditRange * er, 666 ChildFields * rootFields, 667 DocumentField * dfLeft, 668 DocumentField * dfRight ); 669 670 extern void docDeleteChildFields( int * pUpdateFlags, 671 BufferDocument * bd, 672 ChildFields * cf ); 673 674 extern int docFindSetPattern( void ** pProg, 675 const char * pattern, 676 int useRegex ); 677 678 extern int docGetCharsUsed( BufferDocument * bd ); 679 680 extern int docGetAttributesUsedInTree(BufferDocument * bd, 681 const DocumentTree * dt, 682 IndexSet * isUsed ); 683 684 extern int docGetAttributesUsedInShape( 685 BufferDocument * bd, 686 const struct DrawingShape * ds, 687 IndexSet * isUsed ); 688 689 extern void docPlainTextAttribute( TextAttribute * ta, 690 BufferDocument * bd ); 691 692 extern int docScapsAttributeNumber( BufferDocument * bd, 693 const TextAttribute * ta ); 694 695 extern void docCleanNodeObjects( int * pBulletsDeleted, 696 int * pParagraphCount, 697 DocumentTree * dt, 698 BufferDocument * bd, 699 struct BufferItem * node, 700 DOC_CLOSE_OBJECT closeObject ); 701 702 extern void docCleanDocumentObjects( BufferDocument * bd, 703 DOC_CLOSE_OBJECT closeObject ); 704 705 extern const DocumentFont * docRtfGetCurrentFont( 706 BufferDocument * bd, 707 TextAttribute * ta ); 708 709 extern const char * docGetEncodingName( 710 BufferDocument * bd, 711 TextAttribute * ta, 712 int charset ); 713 714 extern void docGetColorByNumber( RGB8Color * rgb8, 715 const BufferDocument * bd, 716 int colorNumber ); 717 718 extern void docDeleteObject( BufferDocument * bd, 719 int n ); 720 721 extern int docChangeParticuleAttributes( int * pChanged, 722 PropertyMask * pTaAllMask, 723 BufferDocument * bd, 724 struct BufferItem * paraNode, 725 int part, 726 int partUpto, 727 const TextAttribute * taSet, 728 const PropertyMask * taSetMask ); 729 730 extern int docCopySectHeadersFooters( struct BufferItem * sectNodeTo, 731 BufferDocument * bdTo, 732 struct BufferItem * sectNodeFrom, 733 BufferDocument * bdFrom ); 734 735 extern int docCopySectDescription( struct BufferItem * sectNodeTo, 736 BufferDocument * bdTo, 737 struct BufferItem * sectNodeFrom, 738 BufferDocument * bdFrom ); 739 740 extern int docNodeAtExtremity( int * pAtExtremity, 741 const struct BufferItem * parentNode, 742 const struct BufferItem * paraNode, 743 int after ); 744 745 extern int docHeaderFooterPage( const BufferDocument * bd, 746 const struct BufferItem * bodySectNode, 747 int currentPage, 748 int treeType ); 749 750 extern void docInvalidateSectHeaderFooterLayout( struct BufferItem * sectNode ); 751 752 extern void docInvalidateParagraphLayout( struct BufferItem * paraNode ); 753 extern void docInvalidateNodeLayout( struct BufferItem * node ); 754 755 extern struct BufferItem * docGetBodySectNodeOfScope( 756 const SelectionScope * ss, 757 const BufferDocument * bd ); 758 759 extern void docOverridePaperSize( struct BufferDocument * bd, 760 const DocumentGeometry * dgFrom ); 761 762 # endif 763