1 /************************************************************************/ 2 /* */ 3 /* Text Editor A line of text. */ 4 /* */ 5 /************************************************************************/ 6 7 # ifndef DOC_TEXT_LINE_H 8 # define DOC_TEXT_LINE_H 9 10 # include "docLayoutPosition.h" 11 12 /************************************************************************/ 13 /* */ 14 /* Used to lay out the text on the page. */ 15 /* A text line consists of a series of particules. */ 16 /* */ 17 /* 1) What part of the string in the paragraph. */ 18 /* 2) What particules. */ 19 /* 3) Where is it geo/typographically? */ 20 /* 4) Postscript geometry information. */ 21 /* tlAscY0 is negative, tlDescY1 is positive. Both are relative to */ 22 /* the base line of the line. */ 23 /* 5) Screen geometry. */ 24 /* */ 25 /* 6) The width of the column for which the line was last formatted. */ 26 /* When the line is shifted to a column with the same width, it */ 27 /* is sufficient to change the coordinates of the line and its */ 28 /* contents during a reformat of the document. When the column */ 29 /* width is diffrerent, the line must be reformatted. (and most */ 30 /* probably subsequent lines as well). */ 31 /* NOTE that a short int cannot hold the width of A0 paper in */ 32 /* landscape orientation. */ 33 /* 7) The indent of the first particule in the line relative to the */ 34 /* pf.pfContentRect that is avialable in the formatter and in the */ 35 /* rendering routines. */ 36 /* NOTE that a short int cannot hold the width of A0 paper in */ 37 /* landscape orientation. */ 38 /* */ 39 /************************************************************************/ 40 41 typedef struct TextLine 42 { 43 /* 1,2 */ 44 int tlStroff; 45 int tlFirstParticule; 46 short int tlStrlen; 47 short int tlParticuleCount; 48 short int tlWordCount; 49 /* 3 */ 50 LayoutPosition tlTopPosition; 51 /* 4 */ 52 short int tlAscY0; 53 short int tlDescY1; 54 short int tlLineStride; 55 /* 5 */ 56 unsigned char tlFlags; 57 # define TLflagBLOCKBREAK 0x01 58 /* define TLflagLINEBREAK 0x02 */ 59 # define TLflagINLINECONTENT 0x04 60 # define TLflagSHADING 0x08 61 # define TLflagBORDER 0x10 62 63 unsigned short int tlFlowWidthTwips; /* 6 */ 64 short int tlLineIndent; /* 7 */ 65 } TextLine; 66 67 /************************************************************************/ 68 69 # define TL_LEADING( tl ) ( (tl)->tlLineStride- (tl)->tlDescY1+ (tl)->tlAscY0 ) 70 # define TL_BASELINE( tl ) ( -(tl)->tlAscY0+ TL_LEADING( tl ) ) 71 72 /************************************************************************/ 73 74 # define docInvalidateTextLine( tl ) (tl)->tlFlowWidthTwips= 0 75 76 /************************************************************************/ 77 78 extern void docInitTextLine( TextLine * tl ); 79 80 # endif 81