]> Pileus Git - ~andy/gtk/blob - gtk/gtktexttypes.h
Include files outside of the extern "C" block. Makes some C++ compiler
[~andy/gtk] / gtk / gtktexttypes.h
1 #ifndef GTK_TEXT_TYPES_H
2 #define GTK_TEXT_TYPES_H
3
4 #include <glib.h>
5
6 #include <gtk/gtktextbuffer.h>
7 #include <gtk/gtktexttagprivate.h>
8
9 #ifdef __cplusplus
10 extern "C" {
11 #endif /* __cplusplus */
12
13 typedef struct _GtkTextLine GtkTextLine;
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;
22 typedef struct _GtkTextLayout GtkTextLayout;
23
24 /*
25  * Search
26  */
27
28 /*
29  * The data structure below is used for searching a B-tree for transitions
30  * on a single tag (or for all tag transitions).  No code outside of
31  * tkTextBTree.c should ever modify any of the fields in these structures,
32  * but it's OK to use them for read-only information.
33  */
34
35 struct _GtkTextViewSearch {
36   GtkTextBTree *tree;
37   
38   GtkTextIter curIndex;         /* Position of last tag transition
39                                          * returned by gtk_text_btree_next_tag, or
40                                          * index of start of segment
41                                          * containing starting position for
42                                          * search if gtk_text_btree_next_tag hasn't
43                                          * been called yet, or same as
44                                          * stopIndex if search is over. */
45
46   GtkTextLineSegment *segPtr;           /* Actual tag segment returned
47                                            by last call to
48                                            gtk_text_btree_next_tag,
49                                            or NULL if 
50                                            gtk_text_btree_next_tag
51                                            hasn't returned  anything
52                                            yet. */
53   
54   GtkTextLineSegment *lastPtr;          /* Stop search before just before
55                                          * considering this segment. */
56   GtkTextTag *tag;                      /* Tag to search for (or tag found, if
57                                          * allTags is non-zero). */
58   int linesLeft;                        /* Lines left to search (including
59                                          * curIndex and stopIndex).  When
60                                          * this becomes <= 0 the search is
61                                          * over. */
62   int allTags;                  /* Non-zero means ignore tag check:
63                                  * search for transitions on all
64                                  * tags. */
65 };
66
67 /*
68  * The following data structure describes a single tab stop.
69  */
70
71 typedef enum {
72   GTK_TEXT_TAB_LEFT,
73   GTK_TEXT_TAB_RIGHT,
74   GTK_TEXT_TAB_CENTER,
75   GTK_TEXT_TAB_NUMERIC
76 } GtkTextTabAlign;
77
78 struct _GtkTextTab {
79     int location;                       /* Offset in pixels of this tab stop
80                                          * from the left margin (lmargin2) of
81                                          * the text. */
82     GtkTextTabAlign alignment;          /* Where the tab stop appears relative
83                                          * to the text. */
84 };
85
86 struct _GtkTextTabArray {
87   guint refcount;
88   int numTabs;                  /* Number of tab stops. */
89   GtkTextTab *tabs;
90 };
91
92 GtkTextTabArray *gtk_text_view_tab_array_new   (guint             size);
93 void              gtk_text_view_tab_array_ref   (GtkTextTabArray *tab_array);
94 void              gtk_text_view_tab_array_unref (GtkTextTabArray *tab_array);
95
96 /*
97  * Declarations for variables shared among the text-related files:
98  */
99
100 /* In gtktextbtree.c */
101 extern GtkTextLineSegmentClass gtk_text_char_type;
102 extern GtkTextLineSegmentClass gtk_text_toggle_on_type;
103 extern GtkTextLineSegmentClass gtk_text_toggle_off_type;
104
105 /* In gtktextmark.c */
106 extern GtkTextLineSegmentClass gtk_text_left_mark_type;
107 extern GtkTextLineSegmentClass gtk_text_right_mark_type;
108
109 /* In gtktextchild.c */
110 extern GtkTextLineSegmentClass gtk_text_pixmap_type;
111 extern GtkTextLineSegmentClass gtk_text_view_child_type;
112
113 /*
114  * UTF 8 Stubs
115  */
116
117 extern const gunichar gtk_text_unknown_char;
118 extern const gchar gtk_text_unknown_char_utf8[];
119
120 gboolean gtk_text_byte_begins_utf8_char (const gchar *byte);
121 guint    gtk_text_utf_to_latin1_char    (const gchar *p,
122                                          guchar      *l1_ch);
123 gchar*   gtk_text_utf_to_latin1         (const gchar *p,
124                                          gint         len);
125 gchar*   gtk_text_latin1_to_utf         (const gchar *latin1,
126                                          gint         len);
127
128
129 #ifdef __cplusplus
130 }
131 #endif /* __cplusplus */
132
133 #endif
134