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
48 * Note: callers should not rely on %NULL or on a zero value for
49 * indication of whether AtkValue is implemented, they should
50 * use type checking/interface checking macros or the
51 * atk_get_accessible_value() convenience method.
54 atk_value_get_current_value (AtkValue *obj,
59 g_return_if_fail (obj != NULL);
60 g_return_if_fail (value != NULL);
61 g_return_if_fail (ATK_IS_VALUE (obj));
63 iface = ATK_VALUE_GET_IFACE (obj);
65 if (iface->get_current_value)
66 (iface->get_current_value) (obj, value);
70 * atk_value_get_maximum_value:
71 * @obj: a GObject instance that implements AtkValueIface
72 * @value: a #GValue representing the maximum accessible value
74 * Gets the maximum value of this object
75 * Note: callers should not rely on %NULL or on a zero value for
76 * indication of whether AtkValue is implemented, they should
77 * use type checking/interface checking macros or the
78 * atk_get_accessible_value() convenience method.
81 atk_value_get_maximum_value (AtkValue *obj,
86 g_return_if_fail (obj != NULL);
87 g_return_if_fail (value != NULL);
88 g_return_if_fail (ATK_IS_VALUE (obj));
90 iface = ATK_VALUE_GET_IFACE (obj);
92 if (iface->get_maximum_value)
93 (iface->get_maximum_value) (obj, value);
97 * atk_value_get_minimum_value:
98 * @obj: a GObject instance that implements AtkValueIface
99 * @value: a #GValue representing the minimum accessible value
101 * Gets the mimnimum value of this object
102 * Note: callers should not rely on %NULL or on a zero value for
103 * indication of whether AtkValue is implemented, they should
104 * use type checking/interface checking macros or the
105 * atk_get_accessible_value() convenience method.
108 atk_value_get_minimum_value (AtkValue *obj,
111 AtkValueIface *iface;
113 g_return_if_fail (obj != NULL);
114 g_return_if_fail (value != NULL);
115 g_return_if_fail (ATK_IS_VALUE (obj));
117 iface = ATK_VALUE_GET_IFACE (obj);
119 if (iface->get_minimum_value)
120 (iface->get_minimum_value) (obj, value);
124 * atk_value_set_current_value:
125 * @obj: a GObject instance that implements AtkValueIface
126 * @value: a #GValue which is the desired new accessible value.
128 * Sets the value of this object
130 * Returns: %TRUE if new value is successfully set, %FALSE otherwise.
133 atk_value_set_current_value (AtkValue *obj,
136 AtkValueIface *iface;
138 g_return_val_if_fail (obj != NULL, FALSE);
139 g_return_val_if_fail (value != NULL, FALSE);
140 g_return_val_if_fail (ATK_IS_VALUE (obj), FALSE);
141 g_return_val_if_fail (G_IS_VALUE (value), FALSE);
143 iface = ATK_VALUE_GET_IFACE (obj);
145 if (iface->set_current_value)
146 return (iface->set_current_value) (obj, value);