]> Pileus Git - ~andy/gtk/blob - gtk/gtkseparatormenuitem.c
Don't export extra symbols for accessibility
[~andy/gtk] / gtk / gtkseparatormenuitem.c
1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
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 /*
21  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
22  * file for a list of people on the GTK+ Team.  See the ChangeLog
23  * files for a list of changes.  These files are distributed with
24  * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
25  */
26
27 #include "config.h"
28 #include "gtkaccessibleprivate.h"
29 #include "gtkseparatormenuitem.h"
30
31 /**
32  * SECTION:gtkseparatormenuitem
33  * @Short_description: A separator used in menus
34  * @Title: GtkSeparatorMenuItem
35  *
36  * The #GtkSeparatorMenuItem is a separator used to group
37  * items within a menu. It displays a horizontal line with a shadow to
38  * make it appear sunken into the interface.
39  */
40
41 static AtkObject *gtk_separator_menu_item_get_accessible (GtkWidget *widget);
42
43 G_DEFINE_TYPE (GtkSeparatorMenuItem, gtk_separator_menu_item, GTK_TYPE_MENU_ITEM)
44
45 static void
46 gtk_separator_menu_item_class_init (GtkSeparatorMenuItemClass *class)
47 {
48   GTK_CONTAINER_CLASS (class)->child_type = NULL;
49   GTK_WIDGET_CLASS (class)->get_accessible = gtk_separator_menu_item_get_accessible;
50 }
51
52 static void 
53 gtk_separator_menu_item_init (GtkSeparatorMenuItem *item)
54 {
55 }
56
57 /**
58  * gtk_separator_menu_item_new:
59  *
60  * Creates a new #GtkSeparatorMenuItem.
61  *
62  * Returns: a new #GtkSeparatorMenuItem.
63  */
64 GtkWidget *
65 gtk_separator_menu_item_new (void)
66 {
67   return g_object_new (GTK_TYPE_SEPARATOR_MENU_ITEM, NULL);
68 }
69
70 typedef struct _GtkSeparatorMenuItemAccessible GtkSeparatorMenuItemAccessible;
71 typedef struct _GtkSeparatorMenuItemAccessibleClass GtkSeparatorMenuItemAccessibleClass;
72
73 ATK_DEFINE_TYPE (GtkSeparatorMenuItemAccessible, _gtk_separator_menu_item_accessible, GTK_TYPE_MENU_ITEM);
74
75 static void
76 _gtk_separator_menu_item_accessible_initialize (AtkObject *accessible,
77                                                 gpointer   widget)
78 {
79   ATK_OBJECT_CLASS (_gtk_separator_menu_item_accessible_parent_class)->initialize (accessible, widget);
80
81   atk_object_set_role (accessible, ATK_ROLE_SEPARATOR);
82 }
83
84 static void
85 _gtk_separator_menu_item_accessible_class_init (GtkSeparatorMenuItemAccessibleClass *klass)
86 {
87   AtkObjectClass *atk_class = ATK_OBJECT_CLASS (klass);
88
89   atk_class->initialize = _gtk_separator_menu_item_accessible_initialize;
90 }
91
92 static void
93 _gtk_separator_menu_item_accessible_init (GtkSeparatorMenuItemAccessible *self)
94 {
95 }
96
97 typedef AtkObjectFactoryClass   GtkSeparatorMenuItemAccessibleFactoryClass;
98 typedef AtkObjectFactory        GtkSeparatorMenuItemAccessibleFactory;
99
100 G_DEFINE_TYPE (GtkSeparatorMenuItemAccessibleFactory,
101                _gtk_separator_menu_item_accessible_factory,
102                ATK_TYPE_OBJECT_FACTORY);
103
104 static GType
105 _gtk_separator_menu_item_accessible_factory_get_accessible_type (void)
106 {
107   return _gtk_separator_menu_item_accessible_get_type ();
108 }
109
110 static AtkObject *
111 _gtk_separator_menu_item_accessible_factory_create_accessible (GObject *obj)
112 {
113   AtkObject *accessible;
114
115   accessible = g_object_new (_gtk_separator_menu_item_accessible_get_type (), NULL);
116   atk_object_initialize (accessible, obj);
117
118   return accessible;
119 }
120
121 static void
122 _gtk_separator_menu_item_accessible_factory_class_init (AtkObjectFactoryClass *klass)
123 {
124   klass->create_accessible = _gtk_separator_menu_item_accessible_factory_create_accessible;
125   klass->get_accessible_type = _gtk_separator_menu_item_accessible_factory_get_accessible_type;
126 }
127
128 static void
129 _gtk_separator_menu_item_accessible_factory_init (AtkObjectFactory *factory)
130 {
131 }
132
133 static AtkObject *
134 gtk_separator_menu_item_get_accessible (GtkWidget *widget)
135 {
136   static gboolean initialized = FALSE;
137
138   if (G_UNLIKELY (!initialized))
139     {
140       _gtk_accessible_set_factory_type (GTK_TYPE_SEPARATOR_MENU_ITEM,
141                                         _gtk_separator_menu_item_accessible_factory_get_type ());
142
143       initialized = TRUE;
144     }
145
146   return GTK_WIDGET_CLASS (gtk_separator_menu_item_parent_class)->get_accessible (widget);
147 }