]> Pileus Git - ~andy/gtk/blob - gtk/gtkseparatormenuitem.c
Change FSF Address
[~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, see <http://www.gnu.org/licenses/>.
16  */
17
18 /*
19  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
20  * file for a list of people on the GTK+ Team.  See the ChangeLog
21  * files for a list of changes.  These files are distributed with
22  * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
23  */
24
25 #include "config.h"
26 #include "gtkseparatormenuitem.h"
27
28 /**
29  * SECTION:gtkseparatormenuitem
30  * @Short_description: A separator used in menus
31  * @Title: GtkSeparatorMenuItem
32  *
33  * The #GtkSeparatorMenuItem is a separator used to group
34  * items within a menu. It displays a horizontal line with a shadow to
35  * make it appear sunken into the interface.
36  */
37
38 G_DEFINE_TYPE (GtkSeparatorMenuItem, gtk_separator_menu_item, GTK_TYPE_MENU_ITEM)
39
40 static void
41 gtk_separator_menu_item_class_init (GtkSeparatorMenuItemClass *class)
42 {
43   GTK_CONTAINER_CLASS (class)->child_type = NULL;
44
45   gtk_widget_class_set_accessible_role (GTK_WIDGET_CLASS (class), ATK_ROLE_SEPARATOR);
46 }
47
48 static void 
49 gtk_separator_menu_item_init (GtkSeparatorMenuItem *item)
50 {
51   GtkStyleContext *context;
52
53   context = gtk_widget_get_style_context (GTK_WIDGET (item));
54   gtk_style_context_add_class (context, GTK_STYLE_CLASS_SEPARATOR);
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 }