klass = ATK_OBJECT_GET_CLASS (accessible);
if (klass->set_name)
- {
- (klass->set_name) (accessible, name);
- g_object_notify (G_OBJECT (accessible), atk_object_name_property_name);
- }
+ {
+ (klass->set_name) (accessible, name);
+ g_object_notify (G_OBJECT (accessible), atk_object_name_property_name);
+ }
}
/**
klass = ATK_OBJECT_GET_CLASS (accessible);
if (klass->set_description)
- {
- (klass->set_description) (accessible, description);
- g_object_notify (G_OBJECT (accessible), atk_object_name_property_description);
- }
+ {
+ (klass->set_description) (accessible, description);
+ g_object_notify (G_OBJECT (accessible), atk_object_name_property_description);
+ }
}
/**
}
/**
+ * atk_object_notify_state_change:
+ * @accessible: an #AtkObject
+ * @state: an #AtkState whose state is changed
+ * @value : a gboolean which indicates whether the state is being set on or off
+ *
+ * Emits a property_change signal for the specified state.
+ * This signal is caught by an #AtkPropertyChangeHandler
+ **/
+void
+atk_object_notify_state_change (AtkObject *accessible,
+ AtkState state,
+ gboolean value)
+{
+ AtkPropertyValues values;
+
+ memset (&values.old_value, 0, sizeof (GValue));
+ memset (&values.new_value, 0, sizeof (GValue));
+ values.property_name = atk_object_name_property_state;
+ if (value)
+ {
+ g_value_init (&values.new_value, G_TYPE_INT);
+ g_value_set_int (&values.new_value, state);
+ }
+ else
+ {
+ g_value_init (&values.old_value, G_TYPE_INT);
+ g_value_set_int (&values.old_value, state);
+ }
+ g_signal_emit (accessible, atk_object_signals[PROPERTY_CHANGE],
+ g_quark_from_string (atk_object_name_property_state),
+ &values, NULL);
+}
+
+/**
* atk_implementor_ref_accessible:
* @implementor: The #GObject instance which should implement #AtkImplementorIface
* if a non-null return value is required.
accessible = ATK_OBJECT (object);
switch (prop_id)
- {
+ {
case PROP_NAME:
atk_object_set_name (accessible, g_value_get_string (value));
break;
break;
default:
break;
- }
+ }
}
static void
accessible = ATK_OBJECT (object);
switch (prop_id)
- {
+ {
case PROP_NAME:
g_value_set_string (value, atk_object_get_name (accessible));
break;
break;
default:
break;
- }
+ }
}
static void
ap = atk_object_get_parent (accessible);
if (ap)
- {
if (ATK_IS_SELECTION (ap))
- {
- int i;
+ {
+ int i;
- atk_state_set_add_state (state_set, ATK_STATE_SELECTABLE);
+ atk_state_set_add_state (state_set, ATK_STATE_SELECTABLE);
- i = atk_object_get_index_in_parent (accessible);
- if (i >= 0)
- {
- if (atk_selection_is_child_selected(ATK_SELECTION (ap), i))
- {
- atk_state_set_add_state (state_set, ATK_STATE_SELECTED);
- }
+ i = atk_object_get_index_in_parent (accessible);
+ if (i >= 0)
+ if (atk_selection_is_child_selected(ATK_SELECTION (ap), i))
+ atk_state_set_add_state (state_set, ATK_STATE_SELECTED);
}
- }
- }
+
return state_set;
}
g_quark_from_string (pspec->name),
&values, NULL);
}
-
#endif /* __cplusplus */
#include <glib-object.h>
+#include <atk/atkstate.h>
/*
* AtkObject represents the minimum information all accessible objects
*/
guint atk_object_connect_property_change_handler (AtkObject *accessible,
AtkPropertyChangeHandler *handler);
-void atk_object_remove_property_change_handler (AtkObject *accessible,
- guint handler_id);
+void atk_object_remove_property_change_handler (AtkObject *accessible,
+ guint handler_id);
+void atk_object_notify_state_change (AtkObject *accessible,
+ AtkState state,
+ gboolean value);
+
/*
* Note: the properties which are registered with the GType
* property registry, for type ATK_TYPE_OBJECT, are as follows:
* atk_attribute_get_name:
* @attr: The #AtkTextAttribute whose name is required
*
- * Returns the name corresponding to the attr value.
+ * Gets the name corresponding to the #AtkTextAttribute
+ *
+ * Returns: a string containing the name; this string should not be freed
**/
G_CONST_RETURN gchar*
atk_attribute_get_name (AtkTextAttribute attr)
* @attr: The #AtkTextAttribute for which a value is required
* @index: The index of the required value
*
- * Returns the value corresponding to the attr value and index.
+ * Gets the value for the index of the #AtkTextAttribute
+ *
+ * Returns: a string containing the value; this string should not be freed;
* NULL is returned if there are no values maintained for the attr value.
**/
G_CONST_RETURN gchar*