Debian Codegraph @

clutter/cally/cally-texture.c

raw
1 /* CALLY - The Clutter Accessibility Implementation Library
2 *
3 * Copyright (C) 2009 Igalia, S.L.
4 *
5 * Author: Alejandro PiƱeiro Iglesias <[email protected]>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
21 */
22
23 /**
24 * SECTION:cally-texture
25 * @Title: CallyTexture
26 * @short_description: Implementation of the ATK interfaces for a #ClutterTexture
27 * @see_also: #ClutterTexture
28 *
29 * #CallyTexture implements the required ATK interfaces of #ClutterTexture
30 *
31 * In particular it sets a proper role for the texture.
32 */
33 #include "config.h"
34
35 #define CLUTTER_DISABLE_DEPRECATION_WARNINGS
36
37 #include "cally-texture.h"
38 #include "cally-actor-private.h"
39
40 #include "deprecated/clutter-texture.h"
41
42 /* AtkObject */
43 static void cally_texture_real_initialize (AtkObject *obj,
44 gpointer data);
45
46 G_DEFINE_TYPE (CallyTexture, cally_texture, CALLY_TYPE_ACTOR)
47
48 static void
49 cally_texture_class_init (CallyTextureClass *klass)
50 {
51 /* GObjectClass *gobject_class = G_OBJECT_CLASS (klass); */
52 AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
53
54 class->initialize = cally_texture_real_initialize;
55 }
56
57 static void
58 cally_texture_init (CallyTexture *texture)
59 {
60 /* nothing to do yet */
61 }
62
63 /**
64 * cally_texture_new:
65 * @actor: a #ClutterActor
66 *
67 * Creates a new #CallyTexture for the given @actor. @actor must be
68 * a #ClutterTexture.
69 *
70 * Return value: the newly created #AtkObject
71 *
72 * Since: 1.4
73 */
74 AtkObject*
75 cally_texture_new (ClutterActor *actor)
76 {
77 GObject *object = NULL;
78 AtkObject *accessible = NULL;
79
80 g_return_val_if_fail (CLUTTER_IS_TEXTURE (actor), NULL);
81
82 object = g_object_new (CALLY_TYPE_TEXTURE, NULL);
83
84 accessible = ATK_OBJECT (object);
85 atk_object_initialize (accessible, actor);
86
87 return accessible;
88 }
89
90 static void
91 cally_texture_real_initialize (AtkObject *obj,
92 gpointer data)
93 {
94 ATK_OBJECT_CLASS (cally_texture_parent_class)->initialize (obj, data);
95
96 /* default role */
97 obj->role = ATK_ROLE_IMAGE;
98 }