Add state FOCUSED if object is focus object.
authorPadraig O'Briain <padraig.obriain@sun.com>
Wed, 26 Nov 2003 17:13:29 +0000 (17:13 +0000)
committerPadraig O'Briain <padraigo@src.gnome.org>
Wed, 26 Nov 2003 17:13:29 +0000 (17:13 +0000)
2003-11-26  Padraig O'Briain  <padraig.obriain@sun.com>

        * atk/atkobject.c (atk_object_real_ref_state_set): Add state FOCUSED
        if object is focus object.

        * atk/atkutil.[ch] (atk_get_focus_object): New function which returns
        the last object reported by the application as focused.

        * docs/atk-sections.txt, docs/tmpl/atkutil.sgml:
        Add atk_get_focus_object.

Fixes bug #127400.

ChangeLog
atk/atkobject.c
atk/atkutil.c
atk/atkutil.h
docs/atk-sections.txt
docs/tmpl/atkutil.sgml

index 8953771..3a5d16f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
 2003-11-26  Padraig O'Briain  <padraig.obriain@sun.com>
 
+        * atk/atkobject.c (atk_object_real_ref_state_set): Add state FOCUSED
+        if object is focus object.
+
+        * atk/atkutil.[ch] (atk_get_focus_object): New function which returns
+        the last object reported by the application as focused.
+
+        * docs/atk-sections.txt, docs/tmpl/atkutil.sgml:
+        Add atk_get_focus_object.
+
+       Fixes bug #127400.
+
+2003-11-26  Padraig O'Briain  <padraig.obriain@sun.com>
+
        * atk/atkobject.c: Change role names so that the unlocalized names
        do not contain hyphens and match the Java role names. Fixes bug #125024.
 
@@ -8,7 +21,7 @@
        *  docs/tmpl/atkhyperlink.sgml, docs/tmp/atkhypertext.sgml,
        docs/tmpl/atkobject.sgml, docs/tmpl/atkrelatiom.sgml,
        docs/tmpl/atkselection.sgml, docs/tmpl/atktable.sgml,
-       docs/tmpl/atktext.sgml: Regenernate these files. The location of
+       docs/tmpl/atktext.sgml: Regenerate these files. The location of
        signal information has changed.
 
 2003-11-24  Padraig O'Briain  <padraig.obriain@sun.com>
index 7cdd3c6..6b302e5 100755 (executable)
@@ -1112,6 +1112,7 @@ atk_object_real_ref_state_set (AtkObject *accessible)
 {
   AtkStateSet *state_set;
   AtkObject *ap;
+  AtkObject *focus_object;
 
   state_set = atk_state_set_new ();
 
@@ -1128,6 +1129,9 @@ atk_object_real_ref_state_set (AtkObject *accessible)
           if (atk_selection_is_child_selected(ATK_SELECTION (ap), i))
             atk_state_set_add_state (state_set, ATK_STATE_SELECTED);
       } 
+  focus_object = atk_get_focus_object ();
+  if (focus_object == accessible)
+    atk_state_set_add_state (state_set, ATK_STATE_FOCUSED);
 
   return state_set; 
 }
index 7089782..5e4cdab 100755 (executable)
 #include "atkutil.h"
 #include "atkmarshal.c"
 
-
 static void atk_util_class_init (AtkUtilClass *klass);
 
+static AtkObject *previous_focus_object = NULL;
+
 GType
 atk_util_get_type (void)
 {
@@ -174,7 +175,6 @@ void
 atk_focus_tracker_notify (AtkObject       *object)
 {
   FocusTracker *item;
-  static AtkObject *previous_focus_object = NULL;
   guint i;
 
   if (trackers == NULL)
@@ -318,6 +318,19 @@ atk_get_root (void)
 }
 
 /**
+ * atk_get_focus_object:
+ *
+ * Gets the currently focused object.
+ *
+ * Returns: the currently focused object for the current application
+ **/
+AtkObject*
+atk_get_focus_object (void)
+{
+  return previous_focus_object;
+}
+
+/**
  * atk_get_toolkit_name:
  *
  * Gets name string for the GUI toolkit implementing ATK for this application.
index 7654156..042d610 100755 (executable)
@@ -163,6 +163,8 @@ void        atk_remove_key_event_listener (guint listener_id);
  */
 AtkObject* atk_get_root(void);
 
+AtkObject* atk_get_focus_object (void);
+
 /*
  * Returns name string for the GUI toolkit.
  */
index e88dd3c..d0a42c8 100644 (file)
@@ -515,6 +515,7 @@ AtkKeySnoopFunc
 atk_add_key_event_listener
 atk_remove_key_event_listener
 atk_get_root
+atk_get_focus_object
 atk_get_toolkit_name
 atk_get_toolkit_version
 <SUBSECTION Standard>
index 334a43f..dddb115 100644 (file)
@@ -161,6 +161,14 @@ An AtkKeySnoopFunc is a function which is called when a keyboard event occurs.
 @Returns: 
 
 
+<!-- ##### FUNCTION atk_get_focus_object ##### -->
+<para>
+
+</para>
+
+@Returns: 
+
+
 <!-- ##### FUNCTION atk_get_toolkit_name ##### -->
 <para>