-typedef GtkTextLineSegment *(* GtkTextLineSegmentSplitFunc) (GtkTextLineSegment *segPtr,
- int index);
-typedef gboolean (* GtkTextViewSegDeleteFunc) (GtkTextLineSegment *segPtr,
- GtkTextLine *line,
- gboolean treeGone);
-typedef GtkTextLineSegment *(* GtkTextViewSegCleanupFunc) (GtkTextLineSegment *segPtr,
- GtkTextLine *line);
-typedef void (* GtkTextLineSegmentLineChangeFunc) (GtkTextLineSegment *segPtr,
- GtkTextLine *line);
-typedef void (* GtkTextViewSegCheckFunc) (GtkTextLineSegment *segPtr,
- GtkTextLine *line);
+/* Split seg at index, returning list of two new segments, and freeing seg */
+typedef GtkTextLineSegment* (*GtkTextSegSplitFunc) (GtkTextLineSegment *seg,
+ gint index);
+
+/* Delete seg which is contained in line; if tree_gone, the tree is being
+ * freed in its entirety, which may matter for some reason (?)
+ * Return TRUE if the segment is not deleteable, e.g. a mark.
+ */
+typedef gboolean (*GtkTextSegDeleteFunc) (GtkTextLineSegment *seg,
+ GtkTextLine *line,
+ gboolean tree_gone);
+
+/* Called after segment structure of line changes, so segments can
+ * cleanup (e.g. merge with adjacent segments). Returns a segment list
+ * to replace the original segment list with. The line argument is
+ * the current line.
+ */
+typedef GtkTextLineSegment* (*GtkTextSegCleanupFunc) (GtkTextLineSegment *seg,
+ GtkTextLine *line);
+
+/* Called when a segment moves from one line to another. CleanupFunc is also
+ * called in that case, so many segments just use CleanupFunc, I'm not sure
+ * what's up with that (this function may not be needed...)
+ */
+typedef void (*GtkTextSegLineChangeFunc) (GtkTextLineSegment *seg,
+ GtkTextLine *line);
+
+/* Called to do debug checks on the segment. */
+typedef void (*GtkTextSegCheckFunc) (GtkTextLineSegment *seg,
+ GtkTextLine *line);