* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
-#include "gtkseparatormenuitem.h"
-
-static void gtk_separator_menu_item_class_init (GtkSeparatorMenuItemClass *class);
+#include "config.h"
-GType
-gtk_separator_menu_item_get_type (void)
-{
- static GType separator_menu_item_type = 0;
+#include "gtkseparatormenuitem.h"
- if (!separator_menu_item_type)
- {
- static const GTypeInfo separator_menu_item_info =
- {
- sizeof (GtkSeparatorMenuItemClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) gtk_separator_menu_item_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (GtkSeparatorMenuItem),
- 0, /* n_preallocs */
- NULL, /* instance_init */
- };
+#include "gtkstylecontext.h"
- separator_menu_item_type =
- g_type_register_static (GTK_TYPE_MENU_ITEM, "GtkSeparatorMenuItem",
- &separator_menu_item_info, 0);
- }
+/**
+ * SECTION:gtkseparatormenuitem
+ * @Short_description: A separator used in menus
+ * @Title: GtkSeparatorMenuItem
+ *
+ * The #GtkSeparatorMenuItem is a separator used to group
+ * items within a menu. It displays a horizontal line with a shadow to
+ * make it appear sunken into the interface.
+ */
- return separator_menu_item_type;
-}
+G_DEFINE_TYPE (GtkSeparatorMenuItem, gtk_separator_menu_item, GTK_TYPE_MENU_ITEM)
static void
gtk_separator_menu_item_class_init (GtkSeparatorMenuItemClass *class)
{
GTK_CONTAINER_CLASS (class)->child_type = NULL;
+
+ gtk_widget_class_set_accessible_role (GTK_WIDGET_CLASS (class), ATK_ROLE_SEPARATOR);
}
+static void
+gtk_separator_menu_item_init (GtkSeparatorMenuItem *item)
+{
+ GtkStyleContext *context;
+
+ context = gtk_widget_get_style_context (GTK_WIDGET (item));
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_SEPARATOR);
+}
+
+/**
+ * gtk_separator_menu_item_new:
+ *
+ * Creates a new #GtkSeparatorMenuItem.
+ *
+ * Returns: a new #GtkSeparatorMenuItem.
+ */
GtkWidget *
gtk_separator_menu_item_new (void)
{