X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=gtk%2Fa11y%2Fgtkbuttonaccessible.c;h=3ba94d30cf66e1e89dac0e984ad8001cdf888f61;hb=3c04597306a918317cb96d6c267fc73a798c04e4;hp=d3f852d0f4c6cbee58666d5aad15f70ce3d2004c;hpb=e756b2e50dcee82855b0cbe7af6aa3873d1ecfa8;p=~andy%2Fgtk diff --git a/gtk/a11y/gtkbuttonaccessible.c b/gtk/a11y/gtkbuttonaccessible.c index d3f852d0f..3ba94d30c 100644 --- a/gtk/a11y/gtkbuttonaccessible.c +++ b/gtk/a11y/gtkbuttonaccessible.c @@ -1,4 +1,4 @@ -/* GAIL - The GNOME Accessibility Implementation Library +/* GTK+ - accessibility implementations * Copyright 2001, 2002, 2003 Sun Microsystems Inc. * * This library is free software; you can redistribute it and/or @@ -12,22 +12,21 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ #include "config.h" #include #include +#include #include "gtkbuttonaccessible.h" static void atk_action_interface_init (AtkActionIface *iface); static void atk_image_interface_init (AtkImageIface *iface); -G_DEFINE_TYPE_WITH_CODE (GtkButtonAccessible, _gtk_button_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE, +G_DEFINE_TYPE_WITH_CODE (GtkButtonAccessible, gtk_button_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE, G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init) G_IMPLEMENT_INTERFACE (ATK_TYPE_IMAGE, atk_image_interface_init)) @@ -57,7 +56,7 @@ gtk_button_accessible_initialize (AtkObject *obj, { GtkWidget *parent; - ATK_OBJECT_CLASS (_gtk_button_accessible_parent_class)->initialize (obj, data); + ATK_OBJECT_CLASS (gtk_button_accessible_parent_class)->initialize (obj, data); g_signal_connect (data, "state-flags-changed", G_CALLBACK (state_changed_cb), NULL); @@ -145,7 +144,7 @@ gtk_button_accessible_get_name (AtkObject *obj) if (widget == NULL) return NULL; - name = ATK_OBJECT_CLASS (_gtk_button_accessible_parent_class)->get_name (obj); + name = ATK_OBJECT_CLASS (gtk_button_accessible_parent_class)->get_name (obj); if (name != NULL) return name; @@ -192,7 +191,7 @@ gtk_button_accessible_ref_state_set (AtkObject *obj) if (widget == NULL) return NULL; - state_set = ATK_OBJECT_CLASS (_gtk_button_accessible_parent_class)->ref_state_set (obj); + state_set = ATK_OBJECT_CLASS (gtk_button_accessible_parent_class)->ref_state_set (obj); if ((gtk_widget_get_state_flags (widget) & GTK_STATE_FLAG_ACTIVE) != 0) atk_state_set_add_state (state_set, ATK_STATE_ARMED); @@ -218,11 +217,11 @@ gtk_button_accessible_notify_gtk (GObject *obj, g_signal_emit_by_name (atk_obj, "visible-data-changed"); } else - GTK_WIDGET_ACCESSIBLE_CLASS (_gtk_button_accessible_parent_class)->notify_gtk (obj, pspec); + GTK_WIDGET_ACCESSIBLE_CLASS (gtk_button_accessible_parent_class)->notify_gtk (obj, pspec); } static void -_gtk_button_accessible_class_init (GtkButtonAccessibleClass *klass) +gtk_button_accessible_class_init (GtkButtonAccessibleClass *klass) { AtkObjectClass *class = ATK_OBJECT_CLASS (klass); GtkContainerAccessibleClass *container_class = (GtkContainerAccessibleClass*)klass; @@ -241,7 +240,7 @@ _gtk_button_accessible_class_init (GtkButtonAccessibleClass *klass) } static void -_gtk_button_accessible_init (GtkButtonAccessible *button) +gtk_button_accessible_init (GtkButtonAccessible *button) { } @@ -329,10 +328,27 @@ static const gchar * gtk_button_accessible_action_get_name (AtkAction *action, gint i) { - if (i != 0) - return NULL; + if (i == 0) + return "click"; + return NULL; +} + +static const gchar * +gtk_button_accessible_action_get_localized_name (AtkAction *action, + gint i) +{ + if (i == 0) + return C_("Action name", "Click"); + return NULL; +} - return "click"; +static const gchar * +gtk_button_accessible_action_get_description (AtkAction *action, + gint i) +{ + if (i == 0) + return C_("Action description", "Clicks the button"); + return NULL; } static void @@ -342,6 +358,8 @@ atk_action_interface_init (AtkActionIface *iface) iface->get_n_actions = gtk_button_accessible_get_n_actions; iface->get_keybinding = gtk_button_accessible_get_keybinding; iface->get_name = gtk_button_accessible_action_get_name; + iface->get_localized_name = gtk_button_accessible_action_get_localized_name; + iface->get_description = gtk_button_accessible_action_get_description; } static const gchar *