#include "atkeditabletext.h"
-enum {
- TEXT_CHANGED,
- CARET_MOVED,
- LAST_SIGNAL
-};
struct _AtkEditableTextIfaceClass
{
typedef struct _AtkEditableTextIfaceClass AtkEditableTextIfaceClass;
-#if 0
-static void atk_editable_text_interface_init (AtkEditableTextIfaceClass *klass);
-
-static gpointer parent_class = NULL;
-#endif
-
-
GType
atk_editable_text_get_type ()
{
return type;
}
-/*
- * Additional GObject properties exported by AtkText:
- * "accessible_text" (accessible text has changed)
- * "accessible_caret" (accessible text cursor position changed:
- * editable text only)
- */
-
-#if 0
-static void
-atk_editable_text_interface_init (AtkEditableTextIfaceClass *klass)
-{
- parent_class = g_type_class_ref (ATK_TYPE_EDITABLE_TEXT);
-
- /* Note that text_changed signal supports details "insert", "delete", possibly "replace". */
-
- atk_signals[TEXT_CHANGED] =
- g_signal_newc ("text_changed",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
- G_STRUCT_OFFSET (AtkEditableTextClass, text_changed), /* still need to declare and define this func */
- NULL,
- g_cclosure_marshal_VOID__UINT_POINTER,
- G_TYPE_NONE,
- 2, G_TYPE_UINT, ATK_TYPE_OBJECT);
-
- atk_signals[CARET_MOVED] =
- g_signal_newc ("text_caret_moved",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (AtkTextClass, caret_changed), /* still need to declare and define this func */
- NULL,
- g_cclosure_marshal_VOID__UINT_POINTER,
- G_TYPE_NONE,
- 2, G_TYPE_UINT, ATK_TYPE_OBJECT);
-}
-#endif
void
atk_editable_text_select_text (AtkEditableText *text,
#include "atktext.h"
+enum {
+ TEXT_CHANGED,
+ CARET_MOVED,
+ LAST_SIGNAL
+};
+
struct _AtkTextIfaceClass
{
GObjectClass parent;
typedef struct _AtkTextIfaceClass AtkTextIfaceClass;
+static void atk_text_interface_init (AtkTextIfaceClass *klass);
+
+static gpointer parent_class = NULL;
+
+static guint atk_text_signals[LAST_SIGNAL] = { 0, 0, 0};
GType
atk_text_get_type ()
{
static GType type = 0;
- if (!type) {
- static const GTypeInfo tinfo =
+ if (!type)
{
- sizeof (AtkTextIface),
- NULL,
- NULL,
+ static const GTypeInfo tinfo =
+ {
+ sizeof (AtkTextIface),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) atk_text_interface_init,
+ (GClassFinalizeFunc) NULL,
- };
+ };
- type = g_type_register_static (G_TYPE_INTERFACE, "AtkText", &tinfo, 0);
- }
+ type = g_type_register_static (G_TYPE_INTERFACE, "AtkText", &tinfo, 0);
+ }
return type;
}
+/*
+ * Additional GObject properties exported by AtkText:
+ * "accessible_text" (accessible text has changed)
+ * "accessible_caret" (accessible text cursor position changed:
+ * editable text only)
+ */
+
+static void
+atk_text_interface_init (AtkTextIfaceClass *klass)
+{
+ parent_class = g_type_class_ref (G_TYPE_OBJECT);
+
+ /*
+ * Note that text_changed signal supports details "insert", "delete",
+ * possibly "replace".
+ */
+
+ atk_text_signals[TEXT_CHANGED] =
+ g_signal_newc ("text_changed",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
+ G_STRUCT_OFFSET (AtkTextIface, text_changed),
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE,
+ 0, G_TYPE_NONE);
+
+ atk_text_signals[CARET_MOVED] =
+ g_signal_newc ("text_caret_moved",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (AtkTextIface, caret_changed),
+ NULL,
+ g_cclosure_marshal_VOID__INT,
+ G_TYPE_NONE,
+ 1, G_TYPE_INT);
+}
+
gchar*
atk_text_get_text (AtkText *text,
gint start_offset,