diff options
author | Mike Gorse <mgorse@suse.com> | 2014-03-13 00:22:54 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2014-03-13 00:22:54 +0800 |
commit | 03ca50dbe3809c7321ab7038b0d62788552d501d (patch) | |
tree | 041bff6b0edd258bb49291117892ebb30f8be8d8 /calendar/gui/ea-day-view-main-item.c | |
parent | d8ac0f010b636a675e279da9a1fcfc5bc5f03789 (diff) | |
download | gsoc2013-evolution-03ca50dbe3809c7321ab7038b0d62788552d501d.tar gsoc2013-evolution-03ca50dbe3809c7321ab7038b0d62788552d501d.tar.gz gsoc2013-evolution-03ca50dbe3809c7321ab7038b0d62788552d501d.tar.bz2 gsoc2013-evolution-03ca50dbe3809c7321ab7038b0d62788552d501d.tar.lz gsoc2013-evolution-03ca50dbe3809c7321ab7038b0d62788552d501d.tar.xz gsoc2013-evolution-03ca50dbe3809c7321ab7038b0d62788552d501d.tar.zst gsoc2013-evolution-03ca50dbe3809c7321ab7038b0d62788552d501d.zip |
Bug #722938 - Adapt a11y code for newest gtk
As of gtk+ 3.2, AtkObjectFactories are no longer used to generate
accessibles for gtk widgets, so our custom atk classes need refactoring.
Diffstat (limited to 'calendar/gui/ea-day-view-main-item.c')
-rw-r--r-- | calendar/gui/ea-day-view-main-item.c | 80 |
1 files changed, 10 insertions, 70 deletions
diff --git a/calendar/gui/ea-day-view-main-item.c b/calendar/gui/ea-day-view-main-item.c index 376c0e89e6..9396eefcc5 100644 --- a/calendar/gui/ea-day-view-main-item.c +++ b/calendar/gui/ea-day-view-main-item.c @@ -32,8 +32,6 @@ #include "ea-day-view-cell.h" /* EaDayViewMainItem */ -static void ea_day_view_main_item_class_init (EaDayViewMainItemClass *klass); - static void ea_day_view_main_item_finalize (GObject *object); static const gchar * ea_day_view_main_item_get_name (AtkObject *accessible); @@ -154,75 +152,17 @@ static gint n_ea_day_view_main_item_destroyed = 0; static gpointer parent_class = NULL; -GType -ea_day_view_main_item_get_type (void) -{ - static GType type = 0; - AtkObjectFactory *factory; - GTypeQuery query; - GType derived_atk_type; - - if (!type) { - static GTypeInfo tinfo = { - sizeof (EaDayViewMainItemClass), - (GBaseInitFunc) NULL, /* base init */ - (GBaseFinalizeFunc) NULL, /* base finalize */ - (GClassInitFunc) ea_day_view_main_item_class_init, - (GClassFinalizeFunc) NULL, /* class finalize */ - NULL, /* class data */ - sizeof (EaDayViewMainItem), /* instance size */ - 0, /* nb preallocs */ - (GInstanceInitFunc) NULL, /* instance init */ - NULL /* value table */ - }; - - static const GInterfaceInfo atk_component_info = { - (GInterfaceInitFunc) atk_component_interface_init, - (GInterfaceFinalizeFunc) NULL, - NULL - }; - - static const GInterfaceInfo atk_table_info = { - (GInterfaceInitFunc) atk_table_interface_init, - (GInterfaceFinalizeFunc) NULL, - NULL - }; - static const GInterfaceInfo atk_selection_info = { - (GInterfaceInitFunc) atk_selection_interface_init, - (GInterfaceFinalizeFunc) NULL, - NULL - }; - - /* - * Figure out the size of the class and instance - * we are run-time deriving from (GailCanvasItem, in this case) - * - */ - - factory = atk_registry_get_factory ( - atk_get_default_registry (), - e_day_view_main_item_get_type ()); - derived_atk_type = atk_object_factory_get_accessible_type (factory); - g_type_query (derived_atk_type, &query); - - tinfo.class_size = query.class_size; - tinfo.instance_size = query.instance_size; - - type = g_type_register_static ( - derived_atk_type, - "EaDayViewMainItem", &tinfo, 0); - g_type_add_interface_static ( - type, ATK_TYPE_COMPONENT, - &atk_component_info); - g_type_add_interface_static ( - type, ATK_TYPE_TABLE, - &atk_table_info); - g_type_add_interface_static ( - type, ATK_TYPE_SELECTION, - &atk_selection_info); - } +G_DEFINE_TYPE_WITH_CODE (EaDayViewMainItem, ea_day_view_main_item, GAIL_TYPE_CANVAS_ITEM, + G_IMPLEMENT_INTERFACE ( + ATK_TYPE_COMPONENT, atk_component_interface_init) + G_IMPLEMENT_INTERFACE ( + ATK_TYPE_SELECTION, atk_selection_interface_init) + G_IMPLEMENT_INTERFACE ( + ATK_TYPE_TABLE, atk_table_interface_init)) - return type; +static void +ea_day_view_main_item_init (EaDayViewMainItem *item) +{ } static void |