]> Pileus Git - ~andy/gtk/blob - gtk/gtkseparatortoolitem.c
gtkradiotoolbutton.c gtkradiotoolbutton.h gtktoggletoolbutton.c
[~andy/gtk] / gtk / gtkseparatortoolitem.c
1 /* gtkseparatortoolitem.c
2  *
3  * Copyright (C) 2002 Anders Carlsson <andersca@codefactory.se>
4  * Copyright (C) 2002 James Henstridge <james@daa.com.au>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21
22 #include "gtkseparatormenuitem.h"
23 #include "gtkseparatortoolitem.h"
24 #include "gtkintl.h"
25
26 static void gtk_separator_tool_item_class_init (GtkSeparatorToolItemClass*class);
27
28 static void gtk_separator_tool_item_add (GtkContainer *container,
29                                          GtkWidget    *child);
30
31 static GObjectClass *parent_class = NULL;
32
33
34 GType
35 gtk_separator_tool_item_get_type (void)
36 {
37   static GType type = 0;
38
39   if (!type)
40     {
41       static const GTypeInfo type_info =
42         {
43           sizeof (GtkSeparatorToolItemClass),
44           (GBaseInitFunc) 0,
45           (GBaseFinalizeFunc) 0,
46           (GClassInitFunc) gtk_separator_tool_item_class_init,
47           (GClassFinalizeFunc) 0,
48           NULL,
49           sizeof (GtkSeparatorToolItem),
50           0, /* n_preallocs */
51           (GInstanceInitFunc) NULL,
52         };
53
54       type = g_type_register_static (GTK_TYPE_TOOL_ITEM,
55                                      "GtkSeparatorToolItem", &type_info, 0);
56     }
57   return type;
58 }
59
60
61 static void
62 gtk_separator_tool_item_class_init (GtkSeparatorToolItemClass *class)
63 {
64   GtkContainerClass *container_class;
65   GtkToolItemClass *toolitem_class;
66
67   parent_class = g_type_class_peek_parent (class);
68   container_class = (GtkContainerClass *)class;
69   toolitem_class = (GtkToolItemClass *)class;
70
71   container_class->add = gtk_separator_tool_item_add;
72 }
73
74 static void
75 gtk_separator_tool_item_add (GtkContainer *container,
76                              GtkWidget    *child)
77 {
78   g_warning("attempt to add a child to an GtkSeparatorToolItem");
79 }
80
81 GtkToolItem *
82 gtk_separator_tool_item_new (void)
83 {
84   GtkToolItem *self;
85
86   self = g_object_new (GTK_TYPE_SEPARATOR_TOOL_ITEM,
87                        NULL);
88   
89   return self;
90 }