evolution-3.6.4/widgets/table/gal-a11y-e-table-item-factory.c

No issues found

  1 /*
  2  * This program is free software; you can redistribute it and/or
  3  * modify it under the terms of the GNU Lesser General Public
  4  * License as published by the Free Software Foundation; either
  5  * version 2 of the License, or (at your option) version 3.
  6  *
  7  * This program is distributed in the hope that it will be useful,
  8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 10  * Lesser General Public License for more details.
 11  *
 12  * You should have received a copy of the GNU Lesser General Public
 13  * License along with the program; if not, see <http://www.gnu.org/licenses/>
 14  *
 15  *
 16  * Authors:
 17  *		Yuedong Du <yuedong.du@sun.com>
 18  *
 19  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
 20  *
 21  */
 22 
 23 #ifdef HAVE_CONFIG_H
 24 #include <config.h>
 25 #endif
 26 
 27 #include <atk/atk.h>
 28 
 29 #include "table/e-table.h"
 30 #include "table/e-tree.h"
 31 
 32 #include "gal-a11y-e-table.h"
 33 #include "gal-a11y-e-table-item.h"
 34 #include "gal-a11y-e-table-item-factory.h"
 35 
 36 #define CS_CLASS(factory) (G_TYPE_INSTANCE_GET_CLASS ((factory), C_TYPE_STREAM, GalA11yETableItemFactoryClass))
 37 static AtkObjectFactoryClass *parent_class;
 38 #define PARENT_TYPE (ATK_TYPE_OBJECT_FACTORY)
 39 
 40 /* Static functions */
 41 
 42 static GType
 43 gal_a11y_e_table_item_factory_get_accessible_type (void)
 44 {
 45 	return GAL_A11Y_TYPE_E_TABLE_ITEM;
 46 }
 47 
 48 static AtkObject *
 49 gal_a11y_e_table_item_factory_create_accessible (GObject *obj)
 50 {
 51 	AtkObject *accessible;
 52 
 53 	g_return_val_if_fail (E_IS_TABLE_ITEM (obj), NULL);
 54 	accessible = gal_a11y_e_table_item_new (E_TABLE_ITEM (obj));
 55 
 56 	return accessible;
 57 }
 58 
 59 static void
 60 gal_a11y_e_table_item_factory_class_init (GalA11yETableItemFactoryClass *class)
 61 {
 62 	AtkObjectFactoryClass *factory_class = ATK_OBJECT_FACTORY_CLASS (class);
 63 
 64 	parent_class = g_type_class_ref (PARENT_TYPE);
 65 
 66 	factory_class->create_accessible   = gal_a11y_e_table_item_factory_create_accessible;
 67 	factory_class->get_accessible_type = gal_a11y_e_table_item_factory_get_accessible_type;
 68 }
 69 
 70 static void
 71 gal_a11y_e_table_item_factory_init (GalA11yETableItemFactory *factory)
 72 {
 73 }
 74 
 75 /**
 76  * gal_a11y_e_table_factory_get_type:
 77  * @void:
 78  *
 79  * Registers the &GalA11yETableFactory class if necessary, and returns the type ID
 80  * associated to it.
 81  *
 82  * Return value: The type ID of the &GalA11yETableFactory class.
 83  **/
 84 GType
 85 gal_a11y_e_table_item_factory_get_type (void)
 86 {
 87 	static GType type = 0;
 88 
 89 	if (!type) {
 90 		GTypeInfo info = {
 91 			sizeof (GalA11yETableItemFactoryClass),
 92 			(GBaseInitFunc) NULL,
 93 			(GBaseFinalizeFunc) NULL,
 94 			(GClassInitFunc) gal_a11y_e_table_item_factory_class_init,
 95 			(GClassFinalizeFunc) NULL,
 96 			NULL, /* class_data */
 97 			sizeof (GalA11yETableItemFactory),
 98 			0,
 99 			(GInstanceInitFunc) gal_a11y_e_table_item_factory_init,
100 			NULL /* value_table */
101 		};
102 
103 		type = g_type_register_static (PARENT_TYPE, "GalA11yETableItemFactory", &info, 0);
104 	}
105 
106 	return type;
107 }