~ubuntu-branches/ubuntu/vivid/gimp/vivid

« back to all changes in this revision

Viewing changes to app/widgets/gimptextbuffer.h

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach
  • Date: 2012-05-08 18:50:03 UTC
  • mto: (1.1.26) (0.5.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 71.
  • Revision ID: package-import@ubuntu.com-20120508185003-tltkvbaysf8d2426
ImportĀ upstreamĀ versionĀ 2.8.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* GIMP - The GNU Image Manipulation Program
 
2
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
 
3
 *
 
4
 * GimpTextBuffer
 
5
 * Copyright (C) 2010  Michael Natterer <mitch@gimp.org>
 
6
 *
 
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.
 
11
 *
 
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.
 
16
 *
 
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/>.
 
19
 */
 
20
 
 
21
#ifndef __GIMP_TEXT_BUFFER_H__
 
22
#define __GIMP_TEXT_BUFFER_H__
 
23
 
 
24
 
 
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))
 
30
 
 
31
 
 
32
typedef struct _GimpTextBufferClass  GimpTextBufferClass;
 
33
 
 
34
struct _GimpTextBuffer
 
35
{
 
36
  GtkTextBuffer  parent_instance;
 
37
 
 
38
  GtkTextTag    *bold_tag;
 
39
  GtkTextTag    *italic_tag;
 
40
  GtkTextTag    *underline_tag;
 
41
  GtkTextTag    *strikethrough_tag;
 
42
 
 
43
  GList         *size_tags;
 
44
  GList         *baseline_tags;
 
45
  GList         *kerning_tags;
 
46
  GList         *font_tags;
 
47
  GList         *color_tags;
 
48
 
 
49
  gboolean       insert_tags_set;
 
50
  GList         *insert_tags;
 
51
  GList         *remove_tags;
 
52
 
 
53
  GdkAtom        markup_atom;
 
54
};
 
55
 
 
56
struct _GimpTextBufferClass
 
57
{
 
58
  GtkTextBufferClass  parent_class;
 
59
};
 
60
 
 
61
 
 
62
GType            gimp_text_buffer_get_type          (void) G_GNUC_CONST;
 
63
 
 
64
GimpTextBuffer * gimp_text_buffer_new               (void);
 
65
 
 
66
void             gimp_text_buffer_set_text          (GimpTextBuffer    *buffer,
 
67
                                                     const gchar       *text);
 
68
gchar          * gimp_text_buffer_get_text          (GimpTextBuffer    *buffer);
 
69
 
 
70
void             gimp_text_buffer_set_markup        (GimpTextBuffer    *buffer,
 
71
                                                     const gchar       *markup);
 
72
gchar          * gimp_text_buffer_get_markup        (GimpTextBuffer    *buffer);
 
73
 
 
74
gboolean         gimp_text_buffer_has_markup        (GimpTextBuffer    *buffer);
 
75
 
 
76
GtkTextTag     * gimp_text_buffer_get_iter_size     (GimpTextBuffer    *buffer,
 
77
                                                     const GtkTextIter *iter,
 
78
                                                     gint              *size);
 
79
void             gimp_text_buffer_set_size          (GimpTextBuffer    *buffer,
 
80
                                                     const GtkTextIter *start,
 
81
                                                     const GtkTextIter *end,
 
82
                                                     gint               size);
 
83
void             gimp_text_buffer_change_size       (GimpTextBuffer    *buffer,
 
84
                                                     const GtkTextIter *start,
 
85
                                                     const GtkTextIter *end,
 
86
                                                     gint               amount);
 
87
 
 
88
GtkTextTag     * gimp_text_buffer_get_iter_baseline (GimpTextBuffer    *buffer,
 
89
                                                     const GtkTextIter *iter,
 
90
                                                     gint              *baseline);
 
91
void             gimp_text_buffer_set_baseline      (GimpTextBuffer    *buffer,
 
92
                                                     const GtkTextIter *start,
 
93
                                                     const GtkTextIter *end,
 
94
                                                     gint               count);
 
95
void             gimp_text_buffer_change_baseline   (GimpTextBuffer    *buffer,
 
96
                                                     const GtkTextIter *start,
 
97
                                                     const GtkTextIter *end,
 
98
                                                     gint               count);
 
99
 
 
100
GtkTextTag     * gimp_text_buffer_get_iter_kerning  (GimpTextBuffer    *buffer,
 
101
                                                     const GtkTextIter *iter,
 
102
                                                     gint              *kerning);
 
103
void             gimp_text_buffer_set_kerning       (GimpTextBuffer    *buffer,
 
104
                                                     const GtkTextIter *start,
 
105
                                                     const GtkTextIter *end,
 
106
                                                     gint               count);
 
107
void             gimp_text_buffer_change_kerning    (GimpTextBuffer    *buffer,
 
108
                                                     const GtkTextIter *start,
 
109
                                                     const GtkTextIter *end,
 
110
                                                     gint               count);
 
111
 
 
112
GtkTextTag     * gimp_text_buffer_get_iter_font     (GimpTextBuffer    *buffer,
 
113
                                                     const GtkTextIter *iter,
 
114
                                                     gchar            **font);
 
115
void             gimp_text_buffer_set_font          (GimpTextBuffer    *buffer,
 
116
                                                     const GtkTextIter *start,
 
117
                                                     const GtkTextIter *end,
 
118
                                                     const gchar       *font);
 
119
 
 
120
GtkTextTag     * gimp_text_buffer_get_iter_color    (GimpTextBuffer    *buffer,
 
121
                                                     const GtkTextIter *iter,
 
122
                                                     GimpRGB           *color);
 
123
void             gimp_text_buffer_set_color         (GimpTextBuffer    *buffer,
 
124
                                                     const GtkTextIter *start,
 
125
                                                     const GtkTextIter *end,
 
126
                                                     const GimpRGB     *color);
 
127
 
 
128
const gchar    * gimp_text_buffer_tag_to_name       (GimpTextBuffer    *buffer,
 
129
                                                     GtkTextTag        *tag,
 
130
                                                     const gchar      **attribute,
 
131
                                                     gchar            **value);
 
132
GtkTextTag     * gimp_text_buffer_name_to_tag       (GimpTextBuffer    *buffer,
 
133
                                                     const gchar       *name,
 
134
                                                     const gchar       *attribute,
 
135
                                                     const gchar       *value);
 
136
 
 
137
void             gimp_text_buffer_set_insert_tags   (GimpTextBuffer    *buffer,
 
138
                                                     GList             *insert_tags,
 
139
                                                     GList             *remove_tags);
 
140
void             gimp_text_buffer_clear_insert_tags (GimpTextBuffer    *buffer);
 
141
void             gimp_text_buffer_insert            (GimpTextBuffer    *buffer,
 
142
                                                     const gchar       *text);
 
143
 
 
144
gint             gimp_text_buffer_get_iter_index    (GimpTextBuffer    *buffer,
 
145
                                                     GtkTextIter       *iter,
 
146
                                                     gboolean           layout_index);
 
147
void             gimp_text_buffer_get_iter_at_index (GimpTextBuffer    *buffer,
 
148
                                                     GtkTextIter       *iter,
 
149
                                                     gint               index,
 
150
                                                     gboolean           layout_index);
 
151
 
 
152
gboolean         gimp_text_buffer_load              (GimpTextBuffer    *buffer,
 
153
                                                     const gchar       *filename,
 
154
                                                     GError           **error);
 
155
gboolean         gimp_text_buffer_save              (GimpTextBuffer    *buffer,
 
156
                                                     const gchar       *filename,
 
157
                                                     gboolean           selection_only,
 
158
                                                     GError           **error);
 
159
 
 
160
 
 
161
#endif /* __GIMP_TEXT_BUFFER_H__ */