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),
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 * WARNING: callers should not rely on %NULL or on a zero value for
48 * indication of whether AtkValue is implemented, they should
49 * use type checking/interface checking macros or the
50 * atk_get_accessible_value() convenience method.
53 atk_value_get_current_value (AtkValue *obj,
58 g_return_if_fail (obj != NULL);
59 g_return_if_fail (value != NULL);
60 g_return_if_fail (ATK_IS_VALUE (obj));
62 iface = ATK_VALUE_GET_IFACE (obj);
64 if (iface->get_current_value)
65 (iface->get_current_value) (obj, value);
69 * atk_value_get_maximum_value:
70 * @obj: a GObject instance that implements AtkValueIface
71 * @value: a #GValue representing the maximum accessible value
73 * WARNING: callers should not rely on %NULL or on a zero value for
74 * indication of whether AtkValue is implemented, they should
75 * use type checking/interface checking macros or the
76 * atk_get_accessible_value() convenience method.
79 atk_value_get_maximum_value (AtkValue *obj,
84 g_return_if_fail (obj != NULL);
85 g_return_if_fail (value != NULL);
86 g_return_if_fail (ATK_IS_VALUE (obj));
88 iface = ATK_VALUE_GET_IFACE (obj);
90 if (iface->get_maximum_value)
91 (iface->get_maximum_value) (obj, value);
95 * atk_value_get_minimum_value:
96 * @obj: a GObject instance that implements AtkValueIface
97 * @value: a #GValue representing the minimum accessible value
99 * WARNING: callers should not rely on %NULL or on a zero value for
100 * indication of whether AtkValue is implemented, they should
101 * use type checking/interface checking macros or the
102 * atk_get_accessible_value() convenience method.
105 atk_value_get_minimum_value (AtkValue *obj,
108 AtkValueIface *iface;
110 g_return_if_fail (obj != NULL);
111 g_return_if_fail (value != NULL);
112 g_return_if_fail (ATK_IS_VALUE (obj));
114 iface = ATK_VALUE_GET_IFACE (obj);
116 if (iface->get_minimum_value)
117 return (iface->get_minimum_value) (obj, value);
121 * atk_value_set_current_value:
122 * @obj: a GObject instance that implements AtkValueIface
123 * @value: a #GValue which is the desired new accessible value.
124 * @return: %true if new value is successfully set, %false otherwise.
127 atk_value_set_current_value (AtkValue *obj,
130 AtkValueIface *iface;
132 g_return_val_if_fail (obj != NULL, FALSE);
133 g_return_val_if_fail (value != NULL, FALSE);
134 g_return_val_if_fail (ATK_IS_VALUE (obj), FALSE);
135 g_return_val_if_fail (G_IS_VALUE (value), FALSE);
137 iface = ATK_VALUE_GET_IFACE (obj);
139 if (iface->set_current_value)
140 return (iface->set_current_value) (obj, value);