1
/* GIMP - The GNU Image Manipulation Program
2
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
5
* Copyright (C) 2010 Michael Natterer <mitch@gimp.org>
7
* This program is free software: you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 3 of the License, or
10
* (at your option) any later version.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License
18
* along with this program. If not, see <http://www.gnu.org/licenses/>.
21
#ifndef __GIMP_TEXT_BUFFER_H__
22
#define __GIMP_TEXT_BUFFER_H__
25
#define GIMP_TYPE_TEXT_BUFFER (gimp_text_buffer_get_type ())
26
#define GIMP_TEXT_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_TEXT_BUFFER, GimpTextBuffer))
27
#define GIMP_IS_TEXT_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_TEXT_BUFFER))
28
#define GIMP_TEXT_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_TEXT_BUFFER, GimpTextBufferClass))
29
#define GIMP_IS_TEXT_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_TEXT_BUFFER))
32
typedef struct _GimpTextBufferClass GimpTextBufferClass;
34
struct _GimpTextBuffer
36
GtkTextBuffer parent_instance;
39
GtkTextTag *italic_tag;
40
GtkTextTag *underline_tag;
41
GtkTextTag *strikethrough_tag;
49
gboolean insert_tags_set;
56
struct _GimpTextBufferClass
58
GtkTextBufferClass parent_class;
62
GType gimp_text_buffer_get_type (void) G_GNUC_CONST;
64
GimpTextBuffer * gimp_text_buffer_new (void);
66
void gimp_text_buffer_set_text (GimpTextBuffer *buffer,
68
gchar * gimp_text_buffer_get_text (GimpTextBuffer *buffer);
70
void gimp_text_buffer_set_markup (GimpTextBuffer *buffer,
72
gchar * gimp_text_buffer_get_markup (GimpTextBuffer *buffer);
74
gboolean gimp_text_buffer_has_markup (GimpTextBuffer *buffer);
76
GtkTextTag * gimp_text_buffer_get_iter_size (GimpTextBuffer *buffer,
77
const GtkTextIter *iter,
79
void gimp_text_buffer_set_size (GimpTextBuffer *buffer,
80
const GtkTextIter *start,
81
const GtkTextIter *end,
83
void gimp_text_buffer_change_size (GimpTextBuffer *buffer,
84
const GtkTextIter *start,
85
const GtkTextIter *end,
88
GtkTextTag * gimp_text_buffer_get_iter_baseline (GimpTextBuffer *buffer,
89
const GtkTextIter *iter,
91
void gimp_text_buffer_set_baseline (GimpTextBuffer *buffer,
92
const GtkTextIter *start,
93
const GtkTextIter *end,
95
void gimp_text_buffer_change_baseline (GimpTextBuffer *buffer,
96
const GtkTextIter *start,
97
const GtkTextIter *end,
100
GtkTextTag * gimp_text_buffer_get_iter_kerning (GimpTextBuffer *buffer,
101
const GtkTextIter *iter,
103
void gimp_text_buffer_set_kerning (GimpTextBuffer *buffer,
104
const GtkTextIter *start,
105
const GtkTextIter *end,
107
void gimp_text_buffer_change_kerning (GimpTextBuffer *buffer,
108
const GtkTextIter *start,
109
const GtkTextIter *end,
112
GtkTextTag * gimp_text_buffer_get_iter_font (GimpTextBuffer *buffer,
113
const GtkTextIter *iter,
115
void gimp_text_buffer_set_font (GimpTextBuffer *buffer,
116
const GtkTextIter *start,
117
const GtkTextIter *end,
120
GtkTextTag * gimp_text_buffer_get_iter_color (GimpTextBuffer *buffer,
121
const GtkTextIter *iter,
123
void gimp_text_buffer_set_color (GimpTextBuffer *buffer,
124
const GtkTextIter *start,
125
const GtkTextIter *end,
126
const GimpRGB *color);
128
const gchar * gimp_text_buffer_tag_to_name (GimpTextBuffer *buffer,
130
const gchar **attribute,
132
GtkTextTag * gimp_text_buffer_name_to_tag (GimpTextBuffer *buffer,
134
const gchar *attribute,
137
void gimp_text_buffer_set_insert_tags (GimpTextBuffer *buffer,
140
void gimp_text_buffer_clear_insert_tags (GimpTextBuffer *buffer);
141
void gimp_text_buffer_insert (GimpTextBuffer *buffer,
144
gint gimp_text_buffer_get_iter_index (GimpTextBuffer *buffer,
146
gboolean layout_index);
147
void gimp_text_buffer_get_iter_at_index (GimpTextBuffer *buffer,
150
gboolean layout_index);
152
gboolean gimp_text_buffer_load (GimpTextBuffer *buffer,
153
const gchar *filename,
155
gboolean gimp_text_buffer_save (GimpTextBuffer *buffer,
156
const gchar *filename,
157
gboolean selection_only,
161
#endif /* __GIMP_TEXT_BUFFER_H__ */