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.
22 #include <glib-object.h>
26 /* New GObject properties registered by AtkObject */
29 PROP_0
, /* gobject convention */
33 PROP_PARENT
, /* ancestry has changed */
34 PROP_CHILD
, /* a child has been added or removed */
35 PROP_STATE
, /* AtkStateSet for the object has changed */
36 PROP_TEXT
, /* Used only by AtkText implementors */
37 PROP_CARET
, /* Used only by AtkText implementors */
43 PROP_TABLE_COLUMN_DESCRIPTION
,
44 PROP_TABLE_COLUMN_HEADER
,
45 PROP_TABLE_ROW_DESCRIPTION
,
46 PROP_TABLE_ROW_HEADER
,
49 PROP_LAST
/* gobject convention */
60 static void atk_object_class_init (AtkObjectClass
*klass
);
61 static void atk_object_init (AtkObject
*accessible
,
62 AtkObjectClass
*klass
);
63 static AtkRelationSet
* atk_object_real_ref_relation_set
64 (AtkObject
*accessible
);
66 static void atk_object_real_set_property (GObject
*object
,
70 static void atk_object_real_get_property (GObject
*object
,
74 static void atk_object_finalize (GObject
*object
);
75 static G_CONST_RETURN gchar
*
76 atk_object_real_get_name (AtkObject
*object
);
77 static G_CONST_RETURN gchar
*
78 atk_object_real_get_description
80 static AtkObject
* atk_object_real_get_parent (AtkObject
*object
);
81 static AtkRole
atk_object_real_get_role (AtkObject
*object
);
82 static AtkStateSet
* atk_object_real_ref_state_set
84 static void atk_object_real_set_name (AtkObject
*object
,
86 static void atk_object_real_set_description
88 const gchar
*description
);
89 static void atk_object_real_set_parent (AtkObject
*object
,
91 static void atk_object_real_set_role (AtkObject
*object
,
93 static guint atk_object_real_connect_property_change_handler
95 AtkPropertyChangeHandler
97 static void atk_object_real_remove_property_change_handler
100 static void atk_object_notify (GObject
*obj
,
104 static guint atk_object_signals
[LAST_SIGNAL
] = { 0, };
106 static gpointer parent_class
= NULL
;
108 static const gchar
* atk_object_name_property_name
= "accessible-name";
109 static const gchar
* atk_object_name_property_state
= "accessible-state";
110 static const gchar
* atk_object_name_property_description
= "accessible-description";
111 static const gchar
* atk_object_name_property_child
= "accessible-child";
112 static const gchar
* atk_object_name_property_parent
= "accessible-parent";
113 static const gchar
* atk_object_name_property_text
= "accessible-text";
114 static const gchar
* atk_object_name_property_caret
= "accessible-caret";
115 static const gchar
* atk_object_name_property_selection
= "accessible-selection";
116 static const gchar
* atk_object_name_property_value
= "accessible-value";
117 static const gchar
* atk_object_name_property_visible
= "accessible-visible-data";
118 static const gchar
* atk_object_name_property_role
= "accessible-role";
119 static const gchar
* atk_object_name_property_table_caption
= "accessible-table-caption";
120 static const gchar
* atk_object_name_property_table_column_description
= "accessible-table-column-description";
121 static const gchar
* atk_object_name_property_table_column_header
= "accessible-table-column-header";
122 static const gchar
* atk_object_name_property_table_row_description
= "accessible-table-row-description";
123 static const gchar
* atk_object_name_property_table_row_header
= "accessible-table-row-header";
124 static const gchar
* atk_object_name_property_table_summary
= "accessible-table-summary";
125 static const gchar
* atk_object_name_property_model
= "accessible-model";
128 atk_object_get_type (void)
130 static GType type
= 0;
134 static const GTypeInfo typeInfo
=
136 sizeof (AtkObjectClass
),
137 (GBaseInitFunc
) NULL
,
138 (GBaseFinalizeFunc
) NULL
,
139 (GClassInitFunc
) atk_object_class_init
,
140 (GClassFinalizeFunc
) NULL
,
144 (GInstanceInitFunc
) atk_object_init
,
146 type
= g_type_register_static (G_TYPE_OBJECT
, "AtkObject", &typeInfo
, 0) ;
152 atk_object_class_init (AtkObjectClass
*klass
)
154 GObjectClass
*gobject_class
= G_OBJECT_CLASS (klass
);
156 parent_class
= g_type_class_ref (G_TYPE_OBJECT
);
158 gobject_class
->set_property
= atk_object_real_set_property
;
159 gobject_class
->get_property
= atk_object_real_get_property
;
160 gobject_class
->finalize
= atk_object_finalize
;
161 gobject_class
->notify
= atk_object_notify
;
163 klass
->get_name
= atk_object_real_get_name
;
164 klass
->get_description
= atk_object_real_get_description
;
165 klass
->get_parent
= atk_object_real_get_parent
;
166 klass
->get_n_children
= NULL
;
167 klass
->ref_child
= NULL
;
168 klass
->get_index_in_parent
= NULL
;
169 klass
->ref_relation_set
= atk_object_real_ref_relation_set
;
170 klass
->get_role
= atk_object_real_get_role
;
171 klass
->ref_state_set
= atk_object_real_ref_state_set
;
172 klass
->set_name
= atk_object_real_set_name
;
173 klass
->set_description
= atk_object_real_set_description
;
174 klass
->set_parent
= atk_object_real_set_parent
;
175 klass
->set_role
= atk_object_real_set_role
;
176 klass
->connect_property_change_handler
=
177 atk_object_real_connect_property_change_handler
;
178 klass
->remove_property_change_handler
=
179 atk_object_real_remove_property_change_handler
;
182 * We do not define default signal handlers here
184 klass
->children_changed
= NULL
;
185 klass
->focus_event
= NULL
;
186 klass
->property_change
= NULL
;
188 g_object_class_install_property (gobject_class
,
190 g_param_spec_string (atk_object_name_property_name
,
192 "Object instance\'s name formatted for "
193 "assistive technology access",
196 g_object_class_install_property (gobject_class
,
198 g_param_spec_string (atk_object_name_property_description
,
199 "Accessible Description",
200 "Description of an object, formatted for "
201 "assistive technology access",
204 g_object_class_install_property (gobject_class
,
206 g_param_spec_int (atk_object_name_property_state
,
207 "Accessible State Set",
208 "The accessible state set of this object "
209 "or its UI component",
214 g_object_class_install_property (gobject_class
,
216 g_param_spec_object (atk_object_name_property_child
,
218 "Is used to notify that a child has been added or removed ",
221 g_object_class_install_property (gobject_class
,
223 g_param_spec_object (atk_object_name_property_parent
,
225 "Is used to notify that the parent has changed ",
228 g_object_class_install_property (gobject_class
,
230 g_param_spec_object (atk_object_name_property_text
,
232 "Is used to notify that the text has changed ",
235 g_object_class_install_property (gobject_class
,
237 g_param_spec_int (atk_object_name_property_caret
,
239 "Is used to notify that the caret position has changed ",
244 g_object_class_install_property (gobject_class
,
246 g_param_spec_object (atk_object_name_property_selection
,
247 "Accessible Selection",
248 "Is used to notify that the selection has changed ",
251 g_object_class_install_property (gobject_class
,
253 g_param_spec_double (atk_object_name_property_value
,
255 "Is used to notify that the value has changed ",
260 g_object_class_install_property (gobject_class
,
262 g_param_spec_object (atk_object_name_property_visible
,
263 "Accessible Visible Data",
264 "Is used to notify that the visual appearance of the object has changed ",
267 g_object_class_install_property (gobject_class
,
269 g_param_spec_int (atk_object_name_property_role
,
271 "The accessible role this object ",
276 g_object_class_install_property (gobject_class
,
278 g_param_spec_object (atk_object_name_property_table_caption
,
279 "Accessible Table Caption",
280 "Is used to notify that the table caption has changed ",
283 g_object_class_install_property (gobject_class
,
284 PROP_TABLE_COLUMN_HEADER
,
285 g_param_spec_object (atk_object_name_property_table_column_header
,
286 "Accessible Table Column Header",
287 "Is used to notify that the table column header has changed ",
290 g_object_class_install_property (gobject_class
,
291 PROP_TABLE_COLUMN_DESCRIPTION
,
292 g_param_spec_int (atk_object_name_property_table_column_description
,
293 "Accessible Table Column Description",
294 "Is used to notify that the table columnscription has changed ",
299 g_object_class_install_property (gobject_class
,
300 PROP_TABLE_ROW_HEADER
,
301 g_param_spec_object (atk_object_name_property_table_row_header
,
302 "Accessible Table Row Header",
303 "Is used to notify that the table row header has changed ",
306 g_object_class_install_property (gobject_class
,
307 PROP_TABLE_ROW_DESCRIPTION
,
308 g_param_spec_int (atk_object_name_property_table_row_description
,
309 "Accessible Table Row Description",
310 "Is used to notify that the table row description has changed ",
315 g_object_class_install_property (gobject_class
,
317 g_param_spec_object (atk_object_name_property_table_summary
,
318 "Accessible Table Summary",
319 "Is used to notify that the table summary has changed ",
322 g_object_class_install_property (gobject_class
,
324 g_param_spec_object (atk_object_name_property_model
,
326 "Is used to notify that the model for Table or Tree has changed ",
330 * The signal "children_changed" supports two details:
333 atk_object_signals
[CHILDREN_CHANGED
] =
334 g_signal_new ("children_changed",
335 G_TYPE_FROM_CLASS (klass
),
336 G_SIGNAL_RUN_LAST
| G_SIGNAL_DETAILED
,
337 G_STRUCT_OFFSET (AtkObjectClass
, children_changed
),
339 g_cclosure_marshal_VOID__UINT_POINTER
,
341 2, G_TYPE_UINT
, G_TYPE_POINTER
);
342 atk_object_signals
[FOCUS_EVENT
] =
343 g_signal_new ("focus_event",
344 G_TYPE_FROM_CLASS (klass
),
346 G_STRUCT_OFFSET (AtkObjectClass
, focus_event
),
348 g_cclosure_marshal_VOID__BOOLEAN
,
351 atk_object_signals
[PROPERTY_CHANGE
] =
352 g_signal_new ("property_change",
353 G_TYPE_FROM_CLASS (klass
),
355 G_STRUCT_OFFSET (AtkObjectClass
, property_change
),
356 (GSignalAccumulator
) NULL
, NULL
,
357 g_cclosure_marshal_VOID__POINTER
,
363 atk_object_init (AtkObject
*accessible
,
364 AtkObjectClass
*klass
)
366 accessible
->name
= NULL
;
367 accessible
->description
= NULL
;
368 accessible
->accessible_parent
= NULL
;
369 accessible
->relation_set
= atk_relation_set_new();
370 accessible
->role
= ATK_ROLE_UNKNOWN
;
374 atk_implementor_get_type (void)
376 static GType type
= 0;
380 static const GTypeInfo typeInfo
=
382 sizeof (AtkImplementorIface
),
383 (GBaseInitFunc
) NULL
,
384 (GBaseFinalizeFunc
) NULL
,
387 type
= g_type_register_static (G_TYPE_INTERFACE
, "AtkImplementorIface", &typeInfo
, 0) ;
394 * atk_object_get_name:
395 * @accessible: an #AtkObject
397 * Gets the accessible name of the accessible.
399 * Returns: a character string representing the accessible name of the object.
401 G_CONST_RETURN gchar
*
402 atk_object_get_name (AtkObject
*accessible
)
404 AtkObjectClass
*klass
;
406 g_return_val_if_fail (ATK_IS_OBJECT (accessible
), NULL
);
408 klass
= ATK_OBJECT_GET_CLASS (accessible
);
410 return (klass
->get_name
) (accessible
);
416 * atk_object_get_description:
417 * @accessible: an #AtkObject
419 * Gets the accessible description of the accessible.
421 * Returns: a character string representing the accessible description
425 G_CONST_RETURN gchar
*
426 atk_object_get_description (AtkObject
*accessible
)
428 AtkObjectClass
*klass
;
430 g_return_val_if_fail (ATK_IS_OBJECT (accessible
), NULL
);
432 klass
= ATK_OBJECT_GET_CLASS (accessible
);
433 if (klass
->get_description
)
434 return (klass
->get_description
) (accessible
);
440 * atk_object_get_parent:
441 * @accessible: an #AtkObject
443 * Gets the accessible parent of the accessible.
445 * Returns: a #AtkObject representing the accessible parent of the accessible
448 atk_object_get_parent (AtkObject
*accessible
)
450 AtkObjectClass
*klass
;
452 g_return_val_if_fail (ATK_IS_OBJECT (accessible
), NULL
);
454 klass
= ATK_OBJECT_GET_CLASS (accessible
);
455 if (klass
->get_parent
)
456 return (klass
->get_parent
) (accessible
);
462 * atk_object_get_n_accessible_children:
463 * @accessible: an #AtkObject
465 * Gets the number of accessible children of the accessible.
467 * Returns: an integer representing the number of accessible children
471 atk_object_get_n_accessible_children (AtkObject
*accessible
)
473 AtkObjectClass
*klass
;
475 g_return_val_if_fail (ATK_IS_OBJECT (accessible
), 0);
477 klass
= ATK_OBJECT_GET_CLASS (accessible
);
478 if (klass
->get_n_children
)
479 return (klass
->get_n_children
) (accessible
);
485 * atk_object_ref_accessible_child:
486 * @accessible: an #AtkObject
487 * @i: a gint representing the position of the child, starting from 0
489 * Gets a reference to the specified accessible child of the object.
490 * The accessible children are 0-based so the first accessible child is
491 * at index 0, the second at index 1 and so on.
493 * Returns: an #AtkObject representing the specified accessible child
497 atk_object_ref_accessible_child (AtkObject
*accessible
,
500 AtkObjectClass
*klass
;
502 g_return_val_if_fail (ATK_IS_OBJECT (accessible
), NULL
);
504 klass
= ATK_OBJECT_GET_CLASS (accessible
);
505 if (klass
->ref_child
)
506 return (klass
->ref_child
) (accessible
, i
);
512 * atk_object_ref_relation_set:
513 * @accessible: an #AtkObject
515 * Gets the #AtkRelationSet associated with the object.
517 * Returns: an #AtkRelationSet representing the relation set of the object.
520 atk_object_ref_relation_set (AtkObject
*accessible
)
522 AtkObjectClass
*klass
;
524 g_return_val_if_fail (ATK_IS_OBJECT (accessible
), NULL
);
526 klass
= ATK_OBJECT_GET_CLASS (accessible
);
527 if (klass
->ref_relation_set
)
528 return (klass
->ref_relation_set
) (accessible
);
535 * @name: a character string describing the new role.
537 * Registers the role specified by @name.
539 * Returns: an #AtkRole for the new role.
542 atk_role_register (const gchar
*name
)
544 /* TODO: associate name with new type */
545 static guint type
= ATK_ROLE_LAST_DEFINED
;
550 * atk_object_get_role:
551 * @accessible: an #AtkObject
553 * Gets the role of the accessible.
555 * Returns: an #AtkRole which is the role of the accessible
558 atk_object_get_role (AtkObject
*accessible
)
560 AtkObjectClass
*klass
;
562 g_return_val_if_fail (ATK_IS_OBJECT (accessible
), ATK_ROLE_UNKNOWN
);
564 klass
= ATK_OBJECT_GET_CLASS (accessible
);
566 return (klass
->get_role
) (accessible
);
568 return ATK_ROLE_UNKNOWN
;
572 * atk_object_ref_state_set:
573 * @accessible: an #AtkObject
575 * Gets a reference to the state set of the accessible; the caller must
576 * unreference it when it is no longer needed.
578 * Returns: a reference to an #AtkStateSet which is the state
579 * set of the accessible
582 atk_object_ref_state_set (AtkObject
*accessible
)
584 AtkObjectClass
*klass
;
586 g_return_val_if_fail (ATK_IS_OBJECT (accessible
), NULL
);
588 klass
= ATK_OBJECT_GET_CLASS (accessible
);
589 if (klass
->ref_state_set
)
590 return (klass
->ref_state_set
) (accessible
);
596 * atk_object_get_index_in_parent:
597 * @accessible: an #AtkObject
599 * Gets the 0-based index of this accessible in its parent; returns -1 if the
600 * accessible does not have an accessible parent.
602 * Returns: an integer which is the index of the accessible in its parent
605 atk_object_get_index_in_parent (AtkObject
*accessible
)
607 AtkObjectClass
*klass
;
609 g_return_val_if_fail (ATK_OBJECT (accessible
), -1);
611 klass
= ATK_OBJECT_GET_CLASS (accessible
);
612 if (klass
->get_index_in_parent
)
613 return (klass
->get_index_in_parent
) (accessible
);
619 * atk_object_set_name:
620 * @accessible: an #AtkObject
621 * @name: a character string to be set as the accessible name
623 * Sets the accessible name of the accessible.
626 atk_object_set_name (AtkObject
*accessible
,
629 AtkObjectClass
*klass
;
631 g_return_if_fail (ATK_IS_OBJECT (accessible
));
632 g_return_if_fail (name
!= NULL
);
634 klass
= ATK_OBJECT_GET_CLASS (accessible
);
637 (klass
->set_name
) (accessible
, name
);
638 g_object_notify (G_OBJECT (accessible
), atk_object_name_property_name
);
643 * atk_object_set_description:
644 * @accessible: an #AtkObject
645 * @description : a character string to be set as the accessible description
647 * Sets the accessible description of the accessible.
650 atk_object_set_description (AtkObject
*accessible
,
651 const gchar
*description
)
653 AtkObjectClass
*klass
;
655 g_return_if_fail (ATK_IS_OBJECT (accessible
));
656 g_return_if_fail (description
!= NULL
);
658 klass
= ATK_OBJECT_GET_CLASS (accessible
);
659 if (klass
->set_description
)
661 (klass
->set_description
) (accessible
, description
);
662 g_object_notify (G_OBJECT (accessible
), atk_object_name_property_description
);
667 * atk_object_set_parent:
668 * @accessible: an #AtkObject
669 * @parent : an #AtkObject to be set as the accessible parent
671 * Sets the accessible parent of the accessible.
674 atk_object_set_parent (AtkObject
*accessible
,
677 AtkObjectClass
*klass
;
679 g_return_if_fail (ATK_IS_OBJECT (accessible
));
681 klass
= ATK_OBJECT_GET_CLASS (accessible
);
682 if (klass
->set_parent
)
683 (klass
->set_parent
) (accessible
, parent
);
687 * atk_object_set_role:
688 * @accessible: an #AtkObject
689 * @role : an #AtkRole to be set as the role
691 * Sets the role of the accessible.
694 atk_object_set_role (AtkObject
*accessible
,
697 AtkObjectClass
*klass
;
699 g_return_if_fail (ATK_IS_OBJECT (accessible
));
701 klass
= ATK_OBJECT_GET_CLASS (accessible
);
703 (klass
->set_role
) (accessible
, role
);
707 * atk_object_connect_property_change_handler:
708 * @accessible: an #AtkObject
709 * @handler : a function to be called when a property changes its value
711 * Specifies a function to be called when a property changes value.
713 * Returns: a #guint which is the handler id used in
714 * atk_object_remove_property_change_handler()
717 atk_object_connect_property_change_handler (AtkObject
*accessible
,
718 AtkPropertyChangeHandler
*handler
)
720 AtkObjectClass
*klass
;
722 g_return_val_if_fail (ATK_IS_OBJECT (accessible
), 0);
723 g_return_val_if_fail ((handler
!= NULL
), 0);
725 klass
= ATK_OBJECT_GET_CLASS (accessible
);
726 if (klass
->connect_property_change_handler
)
727 return (klass
->connect_property_change_handler
) (accessible
, handler
);
733 * atk_object_remove_property_change_handler:
734 * @accessible: an #AtkObject
735 * @handler_id : a guint which identifies the handler to be removed.
737 * Removes a property change handler.
740 atk_object_remove_property_change_handler (AtkObject
*accessible
,
743 AtkObjectClass
*klass
;
745 g_return_if_fail (ATK_IS_OBJECT (accessible
));
747 klass
= ATK_OBJECT_GET_CLASS (accessible
);
748 if (klass
->remove_property_change_handler
)
749 (klass
->remove_property_change_handler
) (accessible
, handler_id
);
753 * atk_implementor_ref_accessible:
754 * @implementor: The #GObject instance which should implement #AtkImplementorIface
755 * if a non-null return value is required.
757 * Gets a reference to an object's #AtkObject implementation, if
758 * the object implements #AtkObjectIface
760 * Returns: a reference to an object's #AtkObject implementation
763 atk_implementor_ref_accessible (AtkImplementor
*object
)
765 AtkImplementorIface
*iface
;
766 AtkObject
*accessible
= NULL
;
768 g_return_val_if_fail (ATK_IS_IMPLEMENTOR (object
), NULL
);
770 iface
= ATK_IMPLEMENTOR_GET_IFACE (object
);
773 accessible
= iface
->ref_accessible (object
);
775 g_return_val_if_fail ((accessible
!= NULL
), NULL
);
780 static AtkRelationSet
*
781 atk_object_real_ref_relation_set (AtkObject
*accessible
)
783 g_return_val_if_fail (accessible
->relation_set
, NULL
);
784 g_object_ref (accessible
->relation_set
);
786 return accessible
->relation_set
;
790 atk_object_real_set_property (GObject
*object
,
795 AtkObject
*accessible
;
797 accessible
= ATK_OBJECT (object
);
802 atk_object_set_name (accessible
, g_value_get_string (value
));
804 case PROP_DESCRIPTION
:
805 atk_object_set_description (accessible
, g_value_get_string (value
));
808 g_print ("This interface does not support setting the state set of an accessible object\n");
811 if (ATK_IS_VALUE (accessible
))
812 atk_value_set_current_value (ATK_VALUE (accessible
), value
);
820 atk_object_real_get_property (GObject
*object
,
825 AtkObject
*accessible
;
827 accessible
= ATK_OBJECT (object
);
832 g_value_set_string (value
, atk_object_get_name (accessible
));
834 case PROP_DESCRIPTION
:
835 g_value_set_string (value
, atk_object_get_description (accessible
));
838 if (ATK_IS_VALUE (accessible
))
839 atk_value_get_current_value (ATK_VALUE (accessible
), value
);
847 atk_object_finalize (GObject
*object
)
849 AtkObject
*accessible
;
851 g_return_if_fail (ATK_IS_OBJECT (object
));
853 accessible
= ATK_OBJECT (object
);
855 g_free (accessible
->name
);
856 g_free (accessible
->description
);
859 * Free memory allocated for relation set if it have been allocated.
861 if (accessible
->relation_set
)
863 g_object_unref (accessible
->relation_set
);
866 G_OBJECT_CLASS (parent_class
)->finalize (object
);
869 static G_CONST_RETURN gchar
*
870 atk_object_real_get_name (AtkObject
*object
)
875 static G_CONST_RETURN gchar
*
876 atk_object_real_get_description (AtkObject
*object
)
878 return object
->description
;
882 atk_object_real_get_parent (AtkObject
*object
)
884 return object
->accessible_parent
;
888 atk_object_real_get_role (AtkObject
*object
)
894 atk_object_real_ref_state_set (AtkObject
*accessible
)
896 AtkStateSet
*state_set
;
899 state_set
= atk_state_set_new ();
901 ap
= atk_object_get_parent (accessible
);
904 if (ATK_IS_SELECTION (ap
))
908 atk_state_set_add_state (state_set
, ATK_STATE_SELECTABLE
);
910 i
= atk_object_get_index_in_parent (accessible
);
913 if (atk_selection_is_child_selected(ATK_SELECTION (ap
), i
))
915 atk_state_set_add_state (state_set
, ATK_STATE_SELECTED
);
924 atk_object_real_set_name (AtkObject
*object
,
927 g_free (object
->name
);
928 object
->name
= g_strdup (name
);
932 atk_object_real_set_description (AtkObject
*object
,
933 const gchar
*description
)
935 g_free (object
->description
);
936 object
->description
= g_strdup (description
);
940 atk_object_real_set_parent (AtkObject
*object
,
943 object
->accessible_parent
= parent
;
948 atk_object_real_set_role (AtkObject
*object
,
955 atk_object_real_connect_property_change_handler (AtkObject
*obj
,
956 AtkPropertyChangeHandler
*handler
)
958 return g_signal_connect_closure_by_id (obj
,
959 atk_object_signals
[PROPERTY_CHANGE
],
962 G_CALLBACK (handler
), NULL
,
963 (GClosureNotify
) NULL
),
968 atk_object_real_remove_property_change_handler (AtkObject
*obj
,
971 g_signal_handler_disconnect (obj
, handler_id
);
975 * This function is a signal handler for notify signal which gets emitted
976 * when a property changes value.
978 * It constructs an AtkPropertyValues structure and emits a "property_changed"
979 * signal which causes the user specified AtkPropertyChangeHandler
983 atk_object_notify (GObject
*obj
,
986 AtkPropertyValues values
;
988 memset (&values
.old_value
, 0, sizeof (GValue
));
989 memset (&values
.new_value
, 0, sizeof (GValue
));
990 g_value_init (&values
.new_value
, pspec
->value_type
);
991 g_object_get_property(obj
, pspec
->name
, &values
.new_value
);
992 values
.property_name
= pspec
->name
;
993 g_signal_emit (obj
, atk_object_signals
[PROPERTY_CHANGE
], 0,