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));
61 g_return_if_fail (G_IS_VALUE (value));
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 * WARNING: callers should not rely on %NULL or on a zero value for
75 * indication of whether AtkValue is implemented, they should
76 * use type checking/interface checking macros or the
77 * atk_get_accessible_value() convenience method.
80 atk_value_get_maximum_value (AtkValue *obj,
85 g_return_if_fail (obj != NULL);
86 g_return_if_fail (value != NULL);
87 g_return_if_fail (ATK_IS_VALUE (obj));
88 g_return_if_fail (G_IS_VALUE (value));
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 * WARNING: callers should not rely on %NULL or on a zero value for
102 * indication of whether AtkValue is implemented, they should
103 * use type checking/interface checking macros or the
104 * atk_get_accessible_value() convenience method.
107 atk_value_get_minimum_value (AtkValue *obj,
110 AtkValueIface *iface;
112 g_return_if_fail (obj != NULL);
113 g_return_if_fail (value != NULL);
114 g_return_if_fail (ATK_IS_VALUE (obj));
115 g_return_if_fail (G_IS_VALUE (value));
117 iface = ATK_VALUE_GET_IFACE (obj);
119 if (iface->get_minimum_value)
120 return (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.
127 * @return: %true if new value is successfully set, %false otherwise.
130 atk_value_set_current_value (AtkValue *obj,
133 AtkValueIface *iface;
135 g_return_val_if_fail (obj != NULL, FALSE);
136 g_return_val_if_fail (value != NULL, FALSE);
137 g_return_val_if_fail (ATK_IS_VALUE (obj), FALSE);
138 g_return_val_if_fail (G_IS_VALUE (value), FALSE);
140 iface = ATK_VALUE_GET_IFACE (obj);
142 if (iface->set_current_value)
143 return (iface->set_current_value) (obj, value);