/* This header has the segment type, and two specific segments
(character and toggle segments) */
/* Information a BTree stores about a tag. */ typedefstruct _GtkTextTagInfo GtkTextTagInfo; struct _GtkTextTagInfo {
GtkTextTag *tag;
GtkTextBTreeNode *tag_root; /* highest-level node containing the tag */ int toggle_count; /* total toggles of this tag below tag_root */
};
/* Body of a segment that toggles a tag on or off */ struct _GtkTextToggleBody {
GtkTextTagInfo *info; /* Tag that starts or ends here. */
gboolean inNodeCounts; /* TRUE means this toggle has been *accountedforinnodetoggle
* counts; FALSE means it hasn't, yet. */
};
/* Class struct for segments */
/* Split seg at index, returning list of two new segments, and freeing seg */ typedef GtkTextLineSegment* (*GtkTextSegSplitFunc) (GtkTextLineSegment *seg, int index);
/* Delete seg which is contained in line; if tree_gone, the tree is being *freedinitsentirety,whichmaymatterforsomereason(?) *ReturnTRUEifthesegmentisnotdeletable,e.g.amark.
*/ typedef gboolean (*GtkTextSegDeleteFunc) (GtkTextLineSegment *seg,
GtkTextLine *line,
gboolean tree_gone);
/* Called after segment structure of line changes, so segments can *cleanup(e.g.mergewithadjacentsegments).Returnsasegmentlist *toreplacetheoriginalsegmentlistwith.Thelineargumentis *thecurrentline.
*/ typedef GtkTextLineSegment* (*GtkTextSegCleanupFunc) (GtkTextLineSegment *seg,
GtkTextLine *line);
/* Called when a segment moves from one line to another. CleanupFunc is also *calledinthatcase,somanysegmentsjustuseCleanupFunc,I'mnotsure *what’supwiththat(thisfunctionmaynotbeneeded...)
*/ typedefvoid (*GtkTextSegLineChangeFunc) (GtkTextLineSegment *seg,
GtkTextLine *line);
/* Called to do debug checks on the segment. */ typedefvoid (*GtkTextSegCheckFunc) (GtkTextLineSegment *seg,
GtkTextLine *line);
struct _GtkTextLineSegmentClass { constchar *name; /* Name of this kind of segment. */
gboolean leftGravity; /* If a segment has zero size (e.g. a *markortagtoggle),doesit *attachtocharactertoitsleft *orright?1meansleft,0means
* right. */
GtkTextSegSplitFunc splitFunc; /* Procedure to split large segment
* into two smaller ones. */
GtkTextSegDeleteFunc deleteFunc; /* Procedure to call to delete
* segment. */
GtkTextSegCleanupFunc cleanupFunc; /* After any change to a line, this *procedureisinvokedforall *segmentsleftinthelineto *performanycleanuptheywish *(e.g.joiningneighboring
* segments). */
GtkTextSegLineChangeFunc lineChangeFunc; /* Invoked when a segment is about *tobemovedfromitscurrentline *toanearlierlinebecauseof *adeletion.Thelineisthat *forthesegment'soldline. *CleanupFuncwillbeinvokedafter
* the deletion is finished. */
GtkTextSegCheckFunc checkFunc; /* Called during consistency checks *tocheckinternalconsistencyof
* segment. */
};
/* *Thedatastructurebelowdefineslinesegments.
*/
struct _GtkTextLineSegment { const GtkTextLineSegmentClass *type; /* Pointer to record describing
* segment's type. */
GtkTextLineSegment *next; /* Next in list of segments for this
* line, or NULL for end of list. */
int char_count; /* # of chars of index space occupied */
int byte_count; /* Size of this segment (# of bytes
* of index space it occupies). */ union { char chars[4]; /* Characters that make up character *info.Actuallengthvariesto
* hold as many characters as needed.*/
GtkTextToggleBody toggle; /* Information about tag toggle. */
GtkTextMarkBody mark; /* Information about mark. */
GtkTextPaintable paintable; /* Child texture */
GtkTextChildBody child; /* Child widget */
} body;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.