4 * An OpenGL based 'interactive canvas' library.
6 * Copyright (C) 2008 Intel Corporation.
8 * Authored By: Øyvind Kolås <pippin@o-hand.com>
9 * Emmanuele Bassi <ebassi@linux.intel.com>
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public
13 * License as published by the Free Software Foundation; either
14 * version 2 of the License, or (at your option) any later version.
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
25 #if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
26 #error "Only <clutter/clutter.h> can be included directly."
29 #ifndef __CLUTTER_TEXT_H__
30 #define __CLUTTER_TEXT_H__
32 #include <clutter/clutter-actor.h>
33 #include <clutter/clutter-text-buffer.h>
34 #include <pango/pango.h>
38 #define CLUTTER_TYPE_TEXT (clutter_text_get_type ())
39 #define CLUTTER_TEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_TEXT, ClutterText))
40 #define CLUTTER_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_TEXT, ClutterTextClass))
41 #define CLUTTER_IS_TEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_TEXT))
42 #define CLUTTER_IS_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_TEXT))
43 #define CLUTTER_TEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_TEXT, ClutterTextClass))
45 typedef struct _ClutterText ClutterText;
46 typedef struct _ClutterTextPrivate ClutterTextPrivate;
47 typedef struct _ClutterTextClass ClutterTextClass;
52 * The #ClutterText struct contains only private data.
59 ClutterActor parent_instance;
61 ClutterTextPrivate *priv;
66 * @text_changed: class handler for the #ClutterText::text-changed signal
67 * @activate: class handler for the #ClutterText::activate signal
68 * @cursor_event: class handler for the #ClutterText::cursor_event signal
70 * The #ClutterTextClass struct contains only private data.
74 struct _ClutterTextClass
77 ClutterActorClass parent_class;
80 /* signals, not vfuncs */
81 void (* text_changed) (ClutterText *self);
82 void (* activate) (ClutterText *self);
83 void (* cursor_event) (ClutterText *self,
84 const ClutterGeometry *geometry);
87 /* padding for future expansion */
88 void (* _clutter_reserved1) (void);
89 void (* _clutter_reserved2) (void);
90 void (* _clutter_reserved3) (void);
91 void (* _clutter_reserved4) (void);
92 void (* _clutter_reserved5) (void);
93 void (* _clutter_reserved6) (void);
94 void (* _clutter_reserved7) (void);
95 void (* _clutter_reserved8) (void);
98 GType clutter_text_get_type (void) G_GNUC_CONST;
100 ClutterActor * clutter_text_new (void);
101 ClutterActor * clutter_text_new_full (const gchar *font_name,
103 const ClutterColor *color);
104 ClutterActor * clutter_text_new_with_text (const gchar *font_name,
106 CLUTTER_AVAILABLE_IN_1_10
107 ClutterActor * clutter_text_new_with_buffer (ClutterTextBuffer *buffer);
108 CLUTTER_AVAILABLE_IN_1_10
109 ClutterTextBuffer * clutter_text_get_buffer (ClutterText *self);
110 CLUTTER_AVAILABLE_IN_1_10
111 void clutter_text_set_buffer (ClutterText *self,
112 ClutterTextBuffer *buffer);
113 const gchar * clutter_text_get_text (ClutterText *self);
114 void clutter_text_set_text (ClutterText *self,
116 void clutter_text_set_markup (ClutterText *self,
117 const gchar *markup);
118 void clutter_text_set_color (ClutterText *self,
119 const ClutterColor *color);
120 void clutter_text_get_color (ClutterText *self,
121 ClutterColor *color);
122 void clutter_text_set_font_name (ClutterText *self,
123 const gchar *font_name);
124 const gchar * clutter_text_get_font_name (ClutterText *self);
125 void clutter_text_set_font_description (ClutterText *self,
126 PangoFontDescription *font_desc);
127 PangoFontDescription *clutter_text_get_font_description (ClutterText *self);
129 void clutter_text_set_ellipsize (ClutterText *self,
130 PangoEllipsizeMode mode);
131 PangoEllipsizeMode clutter_text_get_ellipsize (ClutterText *self);
132 void clutter_text_set_line_wrap (ClutterText *self,
134 gboolean clutter_text_get_line_wrap (ClutterText *self);
135 void clutter_text_set_line_wrap_mode (ClutterText *self,
136 PangoWrapMode wrap_mode);
137 PangoWrapMode clutter_text_get_line_wrap_mode (ClutterText *self);
138 PangoLayout * clutter_text_get_layout (ClutterText *self);
139 void clutter_text_set_attributes (ClutterText *self,
140 PangoAttrList *attrs);
141 PangoAttrList * clutter_text_get_attributes (ClutterText *self);
142 void clutter_text_set_use_markup (ClutterText *self,
144 gboolean clutter_text_get_use_markup (ClutterText *self);
145 void clutter_text_set_line_alignment (ClutterText *self,
146 PangoAlignment alignment);
147 PangoAlignment clutter_text_get_line_alignment (ClutterText *self);
148 void clutter_text_set_justify (ClutterText *self,
150 gboolean clutter_text_get_justify (ClutterText *self);
152 void clutter_text_insert_unichar (ClutterText *self,
154 void clutter_text_delete_chars (ClutterText *self,
156 void clutter_text_insert_text (ClutterText *self,
159 void clutter_text_delete_text (ClutterText *self,
162 gchar * clutter_text_get_chars (ClutterText *self,
165 void clutter_text_set_editable (ClutterText *self,
167 gboolean clutter_text_get_editable (ClutterText *self);
168 void clutter_text_set_activatable (ClutterText *self,
169 gboolean activatable);
170 gboolean clutter_text_get_activatable (ClutterText *self);
172 gint clutter_text_get_cursor_position (ClutterText *self);
173 void clutter_text_set_cursor_position (ClutterText *self,
175 void clutter_text_set_cursor_visible (ClutterText *self,
176 gboolean cursor_visible);
177 gboolean clutter_text_get_cursor_visible (ClutterText *self);
178 void clutter_text_set_cursor_color (ClutterText *self,
179 const ClutterColor *color);
180 void clutter_text_get_cursor_color (ClutterText *self,
181 ClutterColor *color);
182 void clutter_text_set_cursor_size (ClutterText *self,
184 guint clutter_text_get_cursor_size (ClutterText *self);
185 void clutter_text_set_selectable (ClutterText *self,
186 gboolean selectable);
187 gboolean clutter_text_get_selectable (ClutterText *self);
188 void clutter_text_set_selection_bound (ClutterText *self,
189 gint selection_bound);
190 gint clutter_text_get_selection_bound (ClutterText *self);
191 void clutter_text_set_selection (ClutterText *self,
194 gchar * clutter_text_get_selection (ClutterText *self);
195 void clutter_text_set_selection_color (ClutterText *self,
196 const ClutterColor *color);
197 void clutter_text_get_selection_color (ClutterText *self,
198 ClutterColor *color);
199 gboolean clutter_text_delete_selection (ClutterText *self);
200 void clutter_text_set_password_char (ClutterText *self,
202 gunichar clutter_text_get_password_char (ClutterText *self);
203 void clutter_text_set_max_length (ClutterText *self,
205 gint clutter_text_get_max_length (ClutterText *self);
206 void clutter_text_set_single_line_mode (ClutterText *self,
207 gboolean single_line);
208 gboolean clutter_text_get_single_line_mode (ClutterText *self);
210 void clutter_text_set_selected_text_color (ClutterText *self,
211 const ClutterColor *color);
212 void clutter_text_get_selected_text_color (ClutterText *self,
213 ClutterColor *color);
215 gboolean clutter_text_activate (ClutterText *self);
216 CLUTTER_AVAILABLE_IN_1_10
217 gint clutter_text_coords_to_position (ClutterText *self,
220 gboolean clutter_text_position_to_coords (ClutterText *self,
224 gfloat *line_height);
226 void clutter_text_set_preedit_string (ClutterText *self,
227 const gchar *preedit_str,
228 PangoAttrList *preedit_attrs,
231 void clutter_text_get_layout_offsets (ClutterText *self,
237 #endif /* __CLUTTER_TEXT_H__ */