]> Pileus Git - ~andy/gtk/blob - gtk/a11y/gtkarrowaccessible.c
filechooser: Rename _gtk_file_is_path_not_local() to _gtk_file_has_native_path()
[~andy/gtk] / gtk / a11y / gtkarrowaccessible.c
1 /* GTK+ - accessibility implementations
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 struct _GtkArrowAccessiblePrivate
24 {
25   gchar *image_description;
26 };
27
28 static void atk_image_interface_init (AtkImageIface  *iface);
29
30 G_DEFINE_TYPE_WITH_CODE (GtkArrowAccessible, gtk_arrow_accessible, GTK_TYPE_WIDGET_ACCESSIBLE,
31                          G_IMPLEMENT_INTERFACE (ATK_TYPE_IMAGE, atk_image_interface_init))
32
33 static void
34 gtk_arrow_accessible_initialize (AtkObject *accessible,
35                                  gpointer   data)
36 {
37   ATK_OBJECT_CLASS (gtk_arrow_accessible_parent_class)->initialize (accessible, data);
38
39   accessible->role = ATK_ROLE_ICON;
40 }
41
42 static void
43 gtk_arrow_accessible_finalize (GObject *object)
44 {
45   GtkArrowAccessible *arrow = GTK_ARROW_ACCESSIBLE (object);
46
47   g_free (arrow->priv->image_description);
48
49   G_OBJECT_CLASS (gtk_arrow_accessible_parent_class)->finalize (object);
50 }
51
52 static void
53 gtk_arrow_accessible_class_init (GtkArrowAccessibleClass *klass)
54 {
55   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
56   AtkObjectClass *atk_object_class = ATK_OBJECT_CLASS (klass);
57
58   atk_object_class->initialize = gtk_arrow_accessible_initialize;
59
60   gobject_class->finalize = gtk_arrow_accessible_finalize;
61
62   g_type_class_add_private (klass, sizeof (GtkArrowAccessiblePrivate));
63 }
64
65 static void
66 gtk_arrow_accessible_init (GtkArrowAccessible *arrow)
67 {
68   arrow->priv = G_TYPE_INSTANCE_GET_PRIVATE (arrow,
69                                              GTK_TYPE_ARROW_ACCESSIBLE,
70                                              GtkArrowAccessiblePrivate);
71 }
72
73 static const gchar *
74 gtk_arrow_accessible_get_image_description (AtkImage *obj)
75 {
76   GtkArrowAccessible *arrow = GTK_ARROW_ACCESSIBLE (obj);
77
78   return arrow->priv->image_description;
79 }
80
81 static gboolean
82 gtk_arrow_accessible_set_image_description (AtkImage    *obj,
83                                             const gchar *description)
84 {
85   GtkArrowAccessible *arrow = GTK_ARROW_ACCESSIBLE (obj);
86
87   g_free (arrow->priv->image_description);
88   arrow->priv->image_description = g_strdup (description);
89
90   return TRUE;
91
92 }
93
94 static void
95 atk_image_interface_init (AtkImageIface *iface)
96 {
97   iface->get_image_description = gtk_arrow_accessible_get_image_description;
98   iface->set_image_description = gtk_arrow_accessible_set_image_description;
99 }