Index: ChangeLog
===================================================================
--- ChangeLog   （版本 1284）
+++ ChangeLog   （工作副本）
@@ -1,3 +1,8 @@
+2007-09-26  Liyan Zhang  <Li-Yan.Zhang@sun.com>
+
+       * gail/gailcombobox.c: (gail_combo_box_get_keybinding):
+       Bug #474575. Add the function of get keybinding to combo box.
+
 2007-08-07  Sunil Mohan Adapa  <sunil@atc.tcs.com>
 
        * configure.in: Added Telugu (te) to ALL_LINGUAS.
Index: gail/gailcombobox.c
===================================================================
--- gail/gailcombobox.c （版本 1284）
+++ gail/gailcombobox.c （工作副本）
@@ -18,6 +18,7 @@
  */
 
 #include <gtk/gtk.h>
+#include <gdk/gdkkeysyms.h>
 #include "gailcombobox.h"
 
 #if GTK_MINOR_VERSION > 4
@@ -46,6 +47,8 @@
 ;
 static G_CONST_RETURN gchar* gail_combo_box_get_description(AtkAction      *action,
                                                             gint           i);
+static G_CONST_RETURN gchar* gail_combo_box_get_keybinding   (AtkAction       *action,
+                                                            gint            i);
 static G_CONST_RETURN gchar* gail_combo_box_action_get_name(AtkAction      *action,
                                                             gint           i);
 static gboolean              gail_combo_box_set_description(AtkAction      *action,
@@ -137,6 +140,7 @@
 gail_combo_box_object_init (GailComboBox      *combo_box)
 {
   combo_box->press_description = NULL;
+  combo_box->press_keybinding = NULL;
   combo_box->old_selection = -1;
   combo_box->name = NULL;
   combo_box->popup_set = FALSE;
@@ -347,6 +351,7 @@
   iface->do_action = gail_combo_box_do_action;
   iface->get_n_actions = gail_combo_box_get_n_actions;
   iface->get_description = gail_combo_box_get_description;
+  iface->get_keybinding = gail_combo_box_get_keybinding;
   iface->get_name = gail_combo_box_action_get_name;
   iface->set_description = gail_combo_box_set_description;
 }
@@ -441,6 +446,60 @@
 }
 
 static G_CONST_RETURN gchar*
+gail_combo_box_get_keybinding (AtkAction *action,
+                                   gint      i)
+{
+  GailComboBox *combo_box;
+  gchar *return_value = NULL;
+  combo_box = GAIL_COMBO_BOX (action);
+  switch (i)
+  {
+     case 0:
+      {
+         GtkWidget *widget;                                                        
+         GtkWidget *label;
+         AtkRelationSet *set;
+         AtkRelation *relation;                                                             
+         GPtrArray *target;
+         gpointer target_object;
+         guint key_val;
+
+         combo_box = GAIL_COMBO_BOX (action);
+         widget = GTK_ACCESSIBLE (combo_box)->widget;
+         if (widget == NULL)
+             return NULL;
+         set = atk_object_ref_relation_set (ATK_OBJECT (action));
+         if (!set)
+             return NULL;
+         label = NULL;
+         relation = atk_relation_set_get_relation_by_type (set, ATK_RELATION_LABELLED_BY);
+         if (relation)
+         {
+            target = atk_relation_get_target (relation);
+            target_object = g_ptr_array_index (target, 0);
+            if (GTK_IS_ACCESSIBLE (target_object))
+            {
+               label = GTK_ACCESSIBLE (target_object)->widget;
+            }
+         }  
+         g_object_unref (set);
+         if (GTK_IS_LABEL (label))
+         {
+             key_val = gtk_label_get_mnemonic_keyval (GTK_LABEL (label));
+            if (key_val != GDK_VoidSymbol)
+             return_value = gtk_accelerator_name (key_val, GDK_MOD1_MASK);
+         }
+          g_free (combo_box->press_keybinding);
+          combo_box->press_keybinding = return_value;
+          break;                                                                                   
+         }                             
+    default:
+          break;
+  }
+  return return_value;
+}
+
+
+static G_CONST_RETURN gchar*
 gail_combo_box_action_get_name (AtkAction *action,
                                 gint      i)
 {
@@ -616,6 +675,7 @@
   GailComboBox *combo_box = GAIL_COMBO_BOX (object);
 
   g_free (combo_box->press_description);
+  g_free (combo_box->press_keybinding);
   g_free (combo_box->name);
   if (combo_box->action_idle_handler)
     {
Index: gail/gailcombobox.h
===================================================================
--- gail/gailcombobox.h （版本 1284）
+++ gail/gailcombobox.h （工作副本）
@@ -42,6 +42,7 @@
 {
   GailContainer parent;
 
+  gchar         *press_keybinding;
   gchar         *press_description;
   guint         action_idle_handler;

