]> Pileus Git - ~andy/gtk/blob - gtk/gtkseparatormenuitem.c
stylecontext: Do invalidation on first resize container
[~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
27 #include "gtkseparatormenuitem.h"
28
29 #include "gtkstylecontext.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 G_DEFINE_TYPE (GtkSeparatorMenuItem, gtk_separator_menu_item, GTK_TYPE_MENU_ITEM)
42
43 static void
44 gtk_separator_menu_item_class_init (GtkSeparatorMenuItemClass *class)
45 {
46   GTK_CONTAINER_CLASS (class)->child_type = NULL;
47
48   gtk_widget_class_set_accessible_role (GTK_WIDGET_CLASS (class), ATK_ROLE_SEPARATOR);
49 }
50
51 static void 
52 gtk_separator_menu_item_init (GtkSeparatorMenuItem *item)
53 {
54   GtkStyleContext *context;
55
56   context = gtk_widget_get_style_context (GTK_WIDGET (item));
57   gtk_style_context_add_class (context, GTK_STYLE_CLASS_SEPARATOR);
58 }
59
60 /**
61  * gtk_separator_menu_item_new:
62  *
63  * Creates a new #GtkSeparatorMenuItem.
64  *
65  * Returns: a new #GtkSeparatorMenuItem.
66  */
67 GtkWidget *
68 gtk_separator_menu_item_new (void)
69 {
70   return g_object_new (GTK_TYPE_SEPARATOR_MENU_ITEM, NULL);
71 }