diff options
author | Li Yuan <li.yuan@sun.com> | 2004-09-30 15:32:36 +0800 |
---|---|---|
committer | Harry Lu <haip@src.gnome.org> | 2004-09-30 15:32:36 +0800 |
commit | 55e921af93354f13406657f4a5d68c5e426d9402 (patch) | |
tree | c3df07c23a7b26388ec7aa2ad510e06b39189c42 /a11y/calendar/ea-cal-view-event.c | |
parent | a575a7229795651453ffdc8809a2f642b5e4a00c (diff) | |
download | gsoc2013-evolution-55e921af93354f13406657f4a5d68c5e426d9402.tar gsoc2013-evolution-55e921af93354f13406657f4a5d68c5e426d9402.tar.gz gsoc2013-evolution-55e921af93354f13406657f4a5d68c5e426d9402.tar.bz2 gsoc2013-evolution-55e921af93354f13406657f4a5d68c5e426d9402.tar.lz gsoc2013-evolution-55e921af93354f13406657f4a5d68c5e426d9402.tar.xz gsoc2013-evolution-55e921af93354f13406657f4a5d68c5e426d9402.tar.zst gsoc2013-evolution-55e921af93354f13406657f4a5d68c5e426d9402.zip |
Make accessibility name and description translatable.
2004-09-23 Li Yuan <li.yuan@sun.com>
* calendar/ea-cal-view-event.c: (ea_cal_view_event_get_type),
(ea_cal_view_event_get_name), (ea_cal_view_event_get_description):
Make accessibility name and description translatable.
(atk_action_interface_init), (ea_cal_view_event_do_action),
(ea_cal_view_event_get_n_actions),
(ea_cal_view_event_action_get_name):
Add action interface to ea-cal-view-event so that it can be
UI grabbed by GOK.
* calendar/ea-cal-view.c:
Make accessibility name and description translatable.
* calendar/ea-day-view-cell.c: (ea_day_view_cell_new):
Change atk role of ea-day-view-cell from ATK_ROLE_TABLE_CELL
to ATK_ROLE_UNKNOWN so that it can be UI grabbed by GOK.
(atk_component_interface_init), (component_interface_grab_focus):
Add a component interface function : grab_focus.
When grab focus, present the Evolution GUI to the front.
* calendar/ea-day-view-main-item.c:
(ea_day_view_main_item_get_description):
Make accessibility name and description translatable.
(ea_day_view_main_item_time_change_cb):
Notify the item_cell is selected.
* calendar/ea-day-view.c: (ea_day_view_get_name),
(ea_day_view_get_description):
Make accessibility name and description translatable.
* calendar/ea-gnome-calendar.c: (ea_gnome_calendar_get_name),
(ea_gnome_calendar_get_description), (ea_gnome_calendar_ref_child):
Make accessibility name and description translatable.
* calendar/ea-jump-button.c: (ea_jump_button_get_name),
(ea_jump_button_get_description):
Make accessibility name and description translatable.
* calendar/ea-week-view-cell.c: (ea_week_view_cell_get_name),
(atk_component_interface_init), (component_interface_get_extents),
(component_interface_grab_focus):
Add a component interface function : grab_focus.
Add support for different week start days.
When grab focus, present the Evolutioon GUI to the front.
* calendar/ea-week-view-main-item.c: (ea_week_view_main_item_new):
Set the atk role to ATK_ROLE_TABLE.
(ea_week_view_main_item_get_description):
Make accessibility name and description translatable.
(ea_week_view_main_item_time_change_cb):
Notify the item_cell is selected.
* calendar/ea-week-view.c: (ea_week_view_get_name),
(ea_week_view_get_description):
Make accessibility name and description translatable.
* widgets/ea-calendar-cell.c: (ea_calendar_cell_new):
Change atk role of ea-calendar-cell from ATK_ROLE_TABLE_CELL
to ATK_ROLE_UNKNOWN so that it can be UI grabbed by GOK.
* widgets/ea-calendar-item.c: (ea_calendar_item_class_init),
(ea_calendar_item_get_name), (ea_calendar_item_get_description):
Make accessibility name and description translatable.
(ea_calendar_item_ref_state_set),:
Implement ref_state_set so that ea-calendar-item can be UI
grabbed by GOK.
(ea_calendar_item_destory_cell_data):
Fix a crash here.
svn path=/trunk/; revision=27434
Diffstat (limited to 'a11y/calendar/ea-cal-view-event.c')
-rw-r--r-- | a11y/calendar/ea-cal-view-event.c | 80 |
1 files changed, 73 insertions, 7 deletions
diff --git a/a11y/calendar/ea-cal-view-event.c b/a11y/calendar/ea-cal-view-event.c index 5f9e7eb9ba..3a389b2324 100644 --- a/a11y/calendar/ea-cal-view-event.c +++ b/a11y/calendar/ea-cal-view-event.c @@ -28,6 +28,7 @@ #include "ea-day-view.h" #include "ea-week-view.h" #include <gal/e-text/e-text.h> +#include <libgnome/gnome-i18n.h> static void ea_cal_view_event_class_init (EaCalViewEventClass *klass); @@ -41,6 +42,12 @@ static void atk_component_interface_init (AtkComponentIface *iface); static void ea_cal_view_get_extents (AtkComponent *component, gint *x, gint *y, gint *width, gint *height, AtkCoordType coord_type); +/* action interface */ +static void atk_action_interface_init (AtkActionIface *iface); +static gboolean ea_cal_view_event_do_action (AtkAction *action, gint i); +static gint ea_cal_view_event_get_n_actions (AtkAction *action); +static G_CONST_RETURN gchar* ea_cal_view_event_action_get_name (AtkAction *action, gint i); + #ifdef ACC_DEBUG static gint n_ea_cal_view_event_created = 0, n_ea_cal_view_event_destroyed = 0; @@ -78,6 +85,13 @@ ea_cal_view_event_get_type (void) NULL }; + static const GInterfaceInfo atk_action_info = { + (GInterfaceInitFunc) atk_action_interface_init, + (GInterfaceFinalizeFunc) NULL, + NULL + }; + + /* * Figure out the size of the class and instance * we are run-time deriving from (atk object for E_TEXT, in this case) @@ -96,6 +110,10 @@ ea_cal_view_event_get_type (void) "EaCalViewEvent", &tinfo, 0); g_type_add_interface_static (type, ATK_TYPE_COMPONENT, &atk_component_info); + g_type_add_interface_static (type, ATK_TYPE_ACTION, + &atk_action_info); + + } return type; @@ -214,30 +232,30 @@ ea_cal_view_event_get_name (AtkObject *accessible) if (event && event->comp_data) { if (e_cal_util_component_has_alarms (event->comp_data->icalcomp)) { tmp_name = new_name; - new_name = g_strconcat (new_name, "alarm ", NULL); + new_name = g_strconcat (new_name, _("alarm "), NULL); g_free (tmp_name); } if (e_cal_util_component_has_recurrences (event->comp_data->icalcomp)) { tmp_name = new_name; - new_name = g_strconcat (new_name, "recurrence ", NULL); + new_name = g_strconcat (new_name, _("recurrence "), NULL); g_free (tmp_name); } if (event->different_timezone) { tmp_name = new_name; - new_name = g_strconcat (new_name, "time-zone ", NULL); + new_name = g_strconcat (new_name, _("time-zone "), NULL); g_free (tmp_name); } if (e_cal_util_component_has_organizer (event->comp_data->icalcomp)) { tmp_name = new_name; - new_name = g_strconcat (new_name, "meeting ", NULL); + new_name = g_strconcat (new_name, _("meeting "), NULL); g_free (tmp_name); } } tmp_name = new_name; - new_name = g_strconcat (new_name, "event. Summary is ", NULL); + new_name = g_strconcat (new_name, _("event. Summary is "), NULL); g_free (tmp_name); summary = icalcomponent_get_summary (event->comp_data->icalcomp); @@ -248,7 +266,7 @@ ea_cal_view_event_get_name (AtkObject *accessible) } else { tmp_name = new_name; - new_name = g_strconcat (new_name, "empty", NULL); + new_name = g_strconcat (new_name, _("empty"), NULL); g_free (tmp_name); } @@ -267,7 +285,7 @@ ea_cal_view_event_get_description (AtkObject *accessible) if (accessible->description) return accessible->description; - return "calendar view event"; + return _("calendar view event"); } static AtkObject * @@ -480,3 +498,51 @@ ea_cal_view_get_extents (AtkComponent *component, printf ("Event Bounds (%d, %d, %d, %d)\n", *x, *y, *width, *height); #endif } + +#define CAL_VIEW_EVENT_ACTION_NUM 1 + +static const char * action_name [CAL_VIEW_EVENT_ACTION_NUM] = { + N_("Grab Focus") +}; + +static void +atk_action_interface_init (AtkActionIface *iface) +{ + g_return_if_fail (iface != NULL); + + iface->do_action = ea_cal_view_event_do_action; + iface->get_n_actions = ea_cal_view_event_get_n_actions; + iface->get_name = ea_cal_view_event_action_get_name; +} + +static gboolean +ea_cal_view_event_do_action (AtkAction *action, gint i) +{ + AtkGObjectAccessible *atk_gobj; + AtkComponent *atk_comp; + + atk_gobj = ATK_GOBJECT_ACCESSIBLE (action); + + if (i == 0) { + atk_comp = (AtkComponent *)atk_gobj; + return atk_component_grab_focus (atk_comp); + } + + return FALSE; + +} + +static gint +ea_cal_view_event_get_n_actions (AtkAction *action) +{ + return CAL_VIEW_EVENT_ACTION_NUM; +} + +static G_CONST_RETURN gchar* +ea_cal_view_event_action_get_name (AtkAction *action, gint i) +{ + if (i >= 0 && i < CAL_VIEW_EVENT_ACTION_NUM) + return action_name [i]; + return NULL; +} + |