]> Pileus Git - ~andy/gtk/blob - gtk/a11y/gtkarrowaccessible.c
Change FSF Address
[~andy/gtk] / gtk / a11y / gtkarrowaccessible.c
1 /* GAIL - The GNOME Accessibility Implementation Library
2  * Copyright 2001 Sun Microsystems Inc.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser 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.
8  *
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  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
16  */
17
18 #include "config.h"
19
20 #include <gtk/gtk.h>
21 #include "gtkarrowaccessible.h"
22
23
24 static void atk_image_interface_init (AtkImageIface  *iface);
25
26 G_DEFINE_TYPE_WITH_CODE (GtkArrowAccessible, _gtk_arrow_accessible, GTK_TYPE_WIDGET_ACCESSIBLE,
27                          G_IMPLEMENT_INTERFACE (ATK_TYPE_IMAGE, atk_image_interface_init))
28
29 static void
30 gtk_arrow_accessible_initialize (AtkObject *accessible,
31                                  gpointer   data)
32 {
33   ATK_OBJECT_CLASS (_gtk_arrow_accessible_parent_class)->initialize (accessible, data);
34
35   accessible->role = ATK_ROLE_ICON;
36 }
37
38 static void
39 gtk_arrow_accessible_finalize (GObject *object)
40 {
41   GtkArrowAccessible *arrow = GTK_ARROW_ACCESSIBLE (object);
42
43   g_free (arrow->image_description);
44
45   G_OBJECT_CLASS (_gtk_arrow_accessible_parent_class)->finalize (object);
46 }
47
48 static void
49 _gtk_arrow_accessible_class_init (GtkArrowAccessibleClass *klass)
50 {
51   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
52   AtkObjectClass *atk_object_class = ATK_OBJECT_CLASS (klass);
53
54   atk_object_class->initialize = gtk_arrow_accessible_initialize;
55
56   gobject_class->finalize = gtk_arrow_accessible_finalize;
57 }
58
59 static void
60 _gtk_arrow_accessible_init (GtkArrowAccessible *arrow)
61 {
62   arrow->image_description = NULL;
63 }
64
65 static const gchar *
66 gtk_arrow_accessible_get_image_description (AtkImage *obj)
67 {
68   GtkArrowAccessible *arrow = GTK_ARROW_ACCESSIBLE (obj);
69
70   return arrow->image_description;
71 }
72
73 static gboolean
74 gtk_arrow_accessible_set_image_description (AtkImage    *obj,
75                                             const gchar *description)
76 {
77   GtkArrowAccessible *arrow = GTK_ARROW_ACCESSIBLE (obj);
78
79   g_free (arrow->image_description);
80   arrow->image_description = g_strdup (description);
81
82   return TRUE;
83
84 }
85
86 static void
87 atk_image_interface_init (AtkImageIface *iface)
88 {
89   iface->get_image_description = gtk_arrow_accessible_get_image_description;
90   iface->set_image_description = gtk_arrow_accessible_set_image_description;
91 }