1 #ifndef GTK_TEXT_TYPES_H
2 #define GTK_TEXT_TYPES_H
6 #endif /* __cplusplus */
10 #include <gtk/gtktextbuffer.h>
11 #include <gtk/gtktexttagprivate.h>
14 typedef struct _GtkTextCounter GtkTextCounter;
15 typedef struct _GtkTextLineSegment GtkTextLineSegment;
16 typedef struct _GtkTextLineSegmentClass GtkTextLineSegmentClass;
17 typedef struct _GtkTextToggleBody GtkTextToggleBody;
18 typedef struct _GtkTextViewSearch GtkTextViewSearch;
19 typedef struct _GtkTextTab GtkTextTab;
20 typedef struct _GtkTextViewStyle GtkTextViewStyle;
21 typedef struct _GtkTextMarkBody GtkTextMarkBody;
28 * The data structure below is used for searching a B-tree for transitions
29 * on a single tag (or for all tag transitions). No code outside of
30 * tkTextBTree.c should ever modify any of the fields in these structures,
31 * but it's OK to use them for read-only information.
34 struct _GtkTextViewSearch {
37 GtkTextIter curIndex; /* Position of last tag transition
38 * returned by gtk_text_btree_next_tag, or
39 * index of start of segment
40 * containing starting position for
41 * search if gtk_text_btree_next_tag hasn't
42 * been called yet, or same as
43 * stopIndex if search is over. */
45 GtkTextLineSegment *segPtr; /* Actual tag segment returned
47 gtk_text_btree_next_tag,
49 gtk_text_btree_next_tag
50 hasn't returned anything
53 GtkTextLineSegment *lastPtr; /* Stop search before just before
54 * considering this segment. */
55 GtkTextTag *tag; /* Tag to search for (or tag found, if
56 * allTags is non-zero). */
57 int linesLeft; /* Lines left to search (including
58 * curIndex and stopIndex). When
59 * this becomes <= 0 the search is
61 int allTags; /* Non-zero means ignore tag check:
62 * search for transitions on all
67 * The following data structure describes a single tab stop.
78 int location; /* Offset in pixels of this tab stop
79 * from the left margin (lmargin2) of
81 GtkTextTabAlign alignment; /* Where the tab stop appears relative
85 struct _GtkTextTabArray {
87 int numTabs; /* Number of tab stops. */
91 GtkTextTabArray *gtk_text_view_tab_array_new (guint size);
92 void gtk_text_view_tab_array_ref (GtkTextTabArray *tab_array);
93 void gtk_text_view_tab_array_unref (GtkTextTabArray *tab_array);
96 * Declarations for variables shared among the text-related files:
99 /* In gtktextbtree.c */
100 extern GtkTextLineSegmentClass gtk_text_char_type;
101 extern GtkTextLineSegmentClass gtk_text_toggle_on_type;
102 extern GtkTextLineSegmentClass gtk_text_toggle_off_type;
104 /* In gtktextmark.c */
105 extern GtkTextLineSegmentClass gtk_text_left_mark_type;
106 extern GtkTextLineSegmentClass gtk_text_right_mark_type;
108 /* In gtktextchild.c */
109 extern GtkTextLineSegmentClass gtk_text_pixmap_type;
110 extern GtkTextLineSegmentClass gtk_text_view_child_type;
116 extern const gunichar gtk_text_unknown_char;
117 extern const gchar gtk_text_unknown_char_utf8[];
119 gboolean gtk_text_byte_begins_utf8_char (const gchar *byte);
120 guint gtk_text_utf_to_latin1_char (const gchar *p,
122 gchar* gtk_text_utf_to_latin1 (const gchar *p,
124 gchar* gtk_text_latin1_to_utf (const gchar *latin1,
128 gchar* g_convert (const gchar *str,
130 const gchar *to_codeset,
131 const gchar *from_codeset,
132 gint *bytes_converted);
136 #endif /* __cplusplus */