]> Pileus Git - ~andy/gtk/blob - modules/other/gail/gailimagecellfactory.c
77c4b92e6bcaf505eb6d4f2f62de668083814d37
[~andy/gtk] / modules / other / gail / gailimagecellfactory.c
1 /* GAIL - The GNOME Accessibility Enabling Library
2  * Copyright 2001 Sun Microsystems Inc.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 #include <gtk/gtkcellrendererpixbuf.h>
21 #include "gailimagecellfactory.h"
22 #include "gailimagecell.h"
23
24 static void gail_image_cell_factory_class_init (GailImageCellFactoryClass        *klass);
25
26 static AtkObject* gail_image_cell_factory_create_accessible (
27                                 GObject                              *obj);
28
29 static GType gail_image_cell_factory_get_accessible_type (void);
30
31 GType
32 gail_image_cell_factory_get_type (void)
33 {
34   static GType type = 0;
35
36   if (!type) 
37   {
38     static const GTypeInfo tinfo =
39     {
40       sizeof (GailImageCellFactoryClass),
41       (GBaseInitFunc) NULL, /* base init */
42       (GBaseFinalizeFunc) NULL, /* base finalize */
43       (GClassInitFunc) gail_image_cell_factory_class_init, /* class init */
44       (GClassFinalizeFunc) NULL, /* class finalize */
45       NULL, /* class data */
46       sizeof (GailImageCellFactory), /* instance size */
47       0, /* nb preallocs */
48       (GInstanceInitFunc) NULL, /* instance init */
49       NULL /* value table */
50     };
51     type = g_type_register_static (ATK_TYPE_OBJECT_FACTORY, 
52                            "GailImageCellFactory" , &tinfo, 0);
53   }
54
55   return type;
56 }
57
58 static void 
59 gail_image_cell_factory_class_init (GailImageCellFactoryClass *klass)
60 {
61   AtkObjectFactoryClass *class = ATK_OBJECT_FACTORY_CLASS (klass);
62
63   class->create_accessible = gail_image_cell_factory_create_accessible;
64   class->get_accessible_type = gail_image_cell_factory_get_accessible_type;
65 }
66
67 static AtkObject* 
68 gail_image_cell_factory_create_accessible (GObject     *obj)
69 {
70   g_return_val_if_fail (GTK_IS_CELL_RENDERER_PIXBUF (obj), NULL);
71
72   return gail_image_cell_new ();
73 }
74
75 static GType
76 gail_image_cell_factory_get_accessible_type (void)
77 {
78   return GAIL_TYPE_IMAGE_CELL;
79 }