Debian Codegraph @

clutter/cally/cally-rectangle.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-rectangle
25 * @short_description: Implementation of the ATK interfaces for a #ClutterRectangle
26 * @see_also: #ClutterRectangle
27 *
28 * #CallyRectangle implements the required ATK interfaces of #ClutterRectangle
29 *
30 * In particular it sets a proper role for the rectangle.
31 */
32
33 #include "config.h"
34
35 #define CLUTTER_DISABLE_DEPRECATION_WARNINGS
36
37 #include "cally-rectangle.h"
38 #include "cally-actor-private.h"
39
40 #include "clutter-color.h"
41 #include "deprecated/clutter-rectangle.h"
42
43 /* AtkObject */
44 static void cally_rectangle_real_initialize (AtkObject *obj,
45 gpointer data);
46
47 G_DEFINE_TYPE (CallyRectangle, cally_rectangle, CALLY_TYPE_ACTOR)
48
49 static void
50 cally_rectangle_class_init (CallyRectangleClass *klass)
51 {
52 /* GObjectClass *gobject_class = G_OBJECT_CLASS (klass); */
53 AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
54
55 class->initialize = cally_rectangle_real_initialize;
56 }
57
58 static void
59 cally_rectangle_init (CallyRectangle *rectangle)
60 {
61 /* nothing to do yet */
62 }
63
64 /**
65 * cally_rectangle_new:
66 * @actor: a #ClutterActor
67 *
68 * Creates a new #CallyRectangle for the given @actor. @actor must be
69 * a #ClutterRectangle.
70 *
71 * Return value: the newly created #AtkObject
72 *
73 * Since: 1.4
74 */
75 AtkObject*
76 cally_rectangle_new (ClutterActor *actor)
77 {
78 GObject *object = NULL;
79 AtkObject *accessible = NULL;
80
81 g_return_val_if_fail (CLUTTER_IS_RECTANGLE (actor), NULL);
82
83 object = g_object_new (CALLY_TYPE_RECTANGLE, NULL);
84
85 accessible = ATK_OBJECT (object);
86 atk_object_initialize (accessible, actor);
87
88 return accessible;
89 }
90
91 static void
92 cally_rectangle_real_initialize (AtkObject *obj,
93 gpointer data)
94 {
95 ATK_OBJECT_CLASS (cally_rectangle_parent_class)->initialize (obj, data);
96
97 obj->role = ATK_ROLE_IMAGE;
98 }