1 /* ATK - Accessibility Toolkit
2 * Copyright 2001 Sun Microsystems Inc.
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.
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.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
25 static GType type = 0;
30 sizeof (AtkValueIface),
32 (GBaseFinalizeFunc) NULL,
36 type = g_type_register_static (G_TYPE_INTERFACE, "AtkValue", &tinfo, 0);
43 * atk_value_get_current_value:
44 * @obj: a GObject instance that implements AtkValueIface
45 * @value: a #GValue representing the current accessible value
47 * Gets the value of this object.
50 atk_value_get_current_value (AtkValue *obj,
55 g_return_if_fail (obj != NULL);
56 g_return_if_fail (value != NULL);
57 g_return_if_fail (ATK_IS_VALUE (obj));
59 iface = ATK_VALUE_GET_IFACE (obj);
61 if (iface->get_current_value)
62 (iface->get_current_value) (obj, value);
66 * atk_value_get_maximum_value:
67 * @obj: a GObject instance that implements AtkValueIface
68 * @value: a #GValue representing the maximum accessible value
70 * Gets the maximum value of this object.
73 atk_value_get_maximum_value (AtkValue *obj,
78 g_return_if_fail (obj != NULL);
79 g_return_if_fail (value != NULL);
80 g_return_if_fail (ATK_IS_VALUE (obj));
82 iface = ATK_VALUE_GET_IFACE (obj);
84 if (iface->get_maximum_value)
85 (iface->get_maximum_value) (obj, value);
89 * atk_value_get_minimum_value:
90 * @obj: a GObject instance that implements AtkValueIface
91 * @value: a #GValue representing the minimum accessible value
93 * Gets the minimum value of this object.
96 atk_value_get_minimum_value (AtkValue *obj,
101 g_return_if_fail (obj != NULL);
102 g_return_if_fail (value != NULL);
103 g_return_if_fail (ATK_IS_VALUE (obj));
105 iface = ATK_VALUE_GET_IFACE (obj);
107 if (iface->get_minimum_value)
108 (iface->get_minimum_value) (obj, value);
112 * atk_value_set_current_value:
113 * @obj: a GObject instance that implements AtkValueIface
114 * @value: a #GValue which is the desired new accessible value.
116 * Sets the value of this object.
118 * Returns: %TRUE if new value is successfully set, %FALSE otherwise.
121 atk_value_set_current_value (AtkValue *obj,
124 AtkValueIface *iface;
126 g_return_val_if_fail (obj != NULL, FALSE);
127 g_return_val_if_fail (value != NULL, FALSE);
128 g_return_val_if_fail (ATK_IS_VALUE (obj), FALSE);
129 g_return_val_if_fail (G_IS_VALUE (value), FALSE);
131 iface = ATK_VALUE_GET_IFACE (obj);
133 if (iface->set_current_value)
134 return (iface->set_current_value) (obj, value);