1 /* clutter-text-buffer.h
2 * Copyright (C) 2011 Collabora Ltd.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
19 * Author: Stef Walter <stefw@collabora.co.uk>
22 #if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
23 #error "Only <clutter/clutter.h> can be included directly."
26 #ifndef __CLUTTER_TEXT_BUFFER_H__
27 #define __CLUTTER_TEXT_BUFFER_H__
29 #include <clutter/clutter-types.h>
33 #define CLUTTER_TYPE_TEXT_BUFFER (clutter_text_buffer_get_type ())
34 #define CLUTTER_TEXT_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_TEXT_BUFFER, ClutterTextBuffer))
35 #define CLUTTER_TEXT_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_TEXT_BUFFER, ClutterTextBufferClass))
36 #define CLUTTER_IS_TEXT_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_TEXT_BUFFER))
37 #define CLUTTER_IS_TEXT_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_TEXT_BUFFER))
38 #define CLUTTER_TEXT_BUFFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_TEXT_BUFFER, ClutterTextBufferClass))
41 * CLUTTER_TEXT_BUFFER_MAX_SIZE:
43 * Maximum size of text buffer, in bytes.
47 #define CLUTTER_TEXT_BUFFER_MAX_SIZE G_MAXUSHORT
49 typedef struct _ClutterTextBuffer ClutterTextBuffer;
50 typedef struct _ClutterTextBufferClass ClutterTextBufferClass;
51 typedef struct _ClutterTextBufferPrivate ClutterTextBufferPrivate;
56 * The <structname>ClutterTextBuffer</structname> structure contains private
57 * data and it should only be accessed using the provided API.
61 struct _ClutterTextBuffer
64 GObject parent_instance;
66 ClutterTextBufferPrivate *priv;
70 * ClutterTextBufferClass:
71 * @inserted_text: default handler for the #ClutterTextBuffer::inserted-text signal
72 * @deleted_text: default hanlder for the #ClutterTextBuffer::deleted-text signal
73 * @get_text: virtual function
74 * @get_length: virtual function
75 * @insert_text: virtual function
76 * @delete_text: virtual function
78 * The <structname>ClutterTextBufferClass</structname> structure contains
83 struct _ClutterTextBufferClass
86 GObjectClass parent_class;
90 void (*inserted_text) (ClutterTextBuffer *buffer,
95 void (*deleted_text) (ClutterTextBuffer *buffer,
100 const gchar* (*get_text) (ClutterTextBuffer *buffer,
103 guint (*get_length) (ClutterTextBuffer *buffer);
105 guint (*insert_text) (ClutterTextBuffer *buffer,
110 guint (*delete_text) (ClutterTextBuffer *buffer,
115 /* Padding for future expansion */
116 void (*_clutter_reserved1) (void);
117 void (*_clutter_reserved2) (void);
118 void (*_clutter_reserved3) (void);
119 void (*_clutter_reserved4) (void);
120 void (*_clutter_reserved5) (void);
121 void (*_clutter_reserved6) (void);
122 void (*_clutter_reserved7) (void);
123 void (*_clutter_reserved8) (void);
126 CLUTTER_AVAILABLE_IN_1_10
127 GType clutter_text_buffer_get_type (void) G_GNUC_CONST;
129 CLUTTER_AVAILABLE_IN_1_10
130 ClutterTextBuffer* clutter_text_buffer_new (void);
131 CLUTTER_AVAILABLE_IN_1_10
132 ClutterTextBuffer* clutter_text_buffer_new_with_text (const gchar *text,
135 CLUTTER_AVAILABLE_IN_1_10
136 gsize clutter_text_buffer_get_bytes (ClutterTextBuffer *buffer);
137 CLUTTER_AVAILABLE_IN_1_10
138 guint clutter_text_buffer_get_length (ClutterTextBuffer *buffer);
139 CLUTTER_AVAILABLE_IN_1_10
140 const gchar* clutter_text_buffer_get_text (ClutterTextBuffer *buffer);
141 CLUTTER_AVAILABLE_IN_1_10
142 void clutter_text_buffer_set_text (ClutterTextBuffer *buffer,
145 CLUTTER_AVAILABLE_IN_1_10
146 void clutter_text_buffer_set_max_length (ClutterTextBuffer *buffer,
148 CLUTTER_AVAILABLE_IN_1_10
149 gint clutter_text_buffer_get_max_length (ClutterTextBuffer *buffer);
151 CLUTTER_AVAILABLE_IN_1_10
152 guint clutter_text_buffer_insert_text (ClutterTextBuffer *buffer,
156 CLUTTER_AVAILABLE_IN_1_10
157 guint clutter_text_buffer_delete_text (ClutterTextBuffer *buffer,
160 CLUTTER_AVAILABLE_IN_1_10
161 void clutter_text_buffer_emit_inserted_text (ClutterTextBuffer *buffer,
165 CLUTTER_AVAILABLE_IN_1_10
166 void clutter_text_buffer_emit_deleted_text (ClutterTextBuffer *buffer,
172 #endif /* __CLUTTER_TEXT_BUFFER_H__ */