summaryrefslogtreecommitdiff
path: root/tests/dummyatk/my-atk-editable-text.c
blob: 1b05cb30f86934ae7eb51e08f4757d459595d333 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/*
 * AT-SPI - Assistive Technology Service Provider Interface
 * (Gnome Accessibility Project; https://wiki.gnome.org/Accessibility)
 *
 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 */

#include <stdio.h>
#include <string.h>
#include <glib-object.h>
#include <atk/atk.h>

#include "my-atk-object.h"
#include "my-atk-editable-text.h"

typedef struct _MyAtkEditableTextInfo MyAtkEditableTextInfo;

static void atk_editable_text_interface_init (AtkEditableTextIface *iface);

G_DEFINE_TYPE_WITH_CODE (MyAtkEditableText,
                         my_atk_editable_text,
                         MY_TYPE_ATK_OBJECT,
                         G_IMPLEMENT_INTERFACE (ATK_TYPE_EDITABLE_TEXT,
                             atk_editable_text_interface_init));

guint
my_atk_set_editable_text (AtkEditableText *editable_text, const gchar *text)
{
  g_return_val_if_fail (MY_IS_ATK_EDITABLE_TEXT (editable_text), -1);

  return 0;
}

static void
my_atk_editable_text_init (MyAtkEditableText *obj)
{
  obj->text = NULL;
}

static gboolean
my_atk_set_editable_text_set_run_attributes (AtkEditableText  *text,
    AtkAttributeSet  *attrib_set,
    gint             start_offset,
    gint             end_offset)
{
  return FALSE;
}

static void
my_atk_set_editable_text_set_text_contents (AtkEditableText  *text,
    const gchar      *string)
{
}

static void
my_atk_set_editable_text_insert_text (AtkEditableText  *text,
                                      const gchar      *string,
                                      gint             length,
                                      gint             *position)
{
}

static void
my_atk_set_editable_text_copy_text (AtkEditableText  *text,
                                    gint             start_pos,
                                    gint             end_pos)
{
}

static void
my_atk_set_editable_text_cut_text (AtkEditableText  *text,
                                   gint             start_pos,
                                   gint             end_pos)
{
}

static void
my_atk_set_editable_text_delete_text (AtkEditableText  *text,
                                      gint             start_pos,
                                      gint             end_pos)
{
}

static void
my_atk_set_editable_text_paste_text (AtkEditableText  *text,
                                     gint             position)
{
}


static void
atk_editable_text_interface_init (AtkEditableTextIface *iface)
{
  if (!iface) return;
  iface->set_run_attributes = my_atk_set_editable_text_set_run_attributes;
  iface->set_text_contents = my_atk_set_editable_text_set_text_contents;
  iface->insert_text = my_atk_set_editable_text_insert_text;
  iface->copy_text = my_atk_set_editable_text_copy_text;
  iface->cut_text = my_atk_set_editable_text_cut_text;
  iface->delete_text = my_atk_set_editable_text_delete_text;
  iface->paste_text = my_atk_set_editable_text_paste_text;
}

static void
my_atk_editable_text_initialize (AtkObject *obj, gpointer data)
{
}

static void
my_atk_editable_text_finalize (GObject *object)
{
}

static void
my_atk_editable_text_class_init (MyAtkEditableTextClass *my_class)
{
  AtkObjectClass *atk_class = ATK_OBJECT_CLASS (my_class);
  GObjectClass *gobject_class = G_OBJECT_CLASS (my_class);

  gobject_class->finalize = my_atk_editable_text_finalize;

  atk_class->initialize = my_atk_editable_text_initialize;
}