add new sigc++2 directory
[ardour.git] / libs / gtkmm2 / atk / atkmm / relationset.cc
1 // Generated by gtkmmproc -- DO NOT MODIFY!
2
3
4 #include <atkmm/relationset.h>
5 #include <atkmm/private/relationset_p.h>
6
7 // -*- c++ -*-
8 /* $Id$ */
9
10 /* Copyright 1998-2002 The gtkmm Development Team
11  *
12  * This library is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Library General Public
14  * License as published by the Free Software Foundation; either
15  * version 2 of the License, or (at your option) any later version.
16  *
17  * This library is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20  * Library General Public License for more details.
21  *
22  * You should have received a copy of the GNU Library General Public
23  * License along with this library; if not, write to the Free
24  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25  */
26
27 #include <atk/atkobject.h>
28 #include <atk/atkrelationset.h>
29
30
31 namespace
32 {
33 } // anonymous namespace
34
35
36 namespace Glib
37 {
38
39 Glib::RefPtr<Atk::RelationSet> wrap(AtkRelationSet* object, bool take_copy)
40 {
41   return Glib::RefPtr<Atk::RelationSet>( dynamic_cast<Atk::RelationSet*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
42   //We use dynamic_cast<> in case of multiple inheritance.
43 }
44
45 } /* namespace Glib */
46
47
48 namespace Atk
49 {
50
51
52 /* The *_Class implementation: */
53
54 const Glib::Class& RelationSet_Class::init()
55 {
56   if(!gtype_) // create the GType if necessary
57   {
58     // Glib::Class has to know the class init function to clone custom types.
59     class_init_func_ = &RelationSet_Class::class_init_function;
60
61     // This is actually just optimized away, apparently with no harm.
62     // Make sure that the parent type has been created.
63     //CppClassParent::CppObjectType::get_type();
64
65     // Create the wrapper type, with the same class/instance size as the base type.
66     register_derived_type(atk_relation_set_get_type());
67
68     // Add derived versions of interfaces, if the C type implements any interfaces:
69   }
70
71   return *this;
72 }
73
74 void RelationSet_Class::class_init_function(void* g_class, void* class_data)
75 {
76   BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
77   CppClassParent::class_init_function(klass, class_data);
78
79 #ifdef GLIBMM_VFUNCS_ENABLED
80 #endif //GLIBMM_VFUNCS_ENABLED
81
82 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
83 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
84 }
85
86 #ifdef GLIBMM_VFUNCS_ENABLED
87 #endif //GLIBMM_VFUNCS_ENABLED
88
89 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
90 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
91
92
93 Glib::ObjectBase* RelationSet_Class::wrap_new(GObject* object)
94 {
95   return new RelationSet((AtkRelationSet*)object);
96 }
97
98
99 /* The implementation: */
100
101 AtkRelationSet* RelationSet::gobj_copy()
102 {
103   reference();
104   return gobj();
105 }
106
107 RelationSet::RelationSet(const Glib::ConstructParams& construct_params)
108 :
109   Glib::Object(construct_params)
110 {}
111
112 RelationSet::RelationSet(AtkRelationSet* castitem)
113 :
114   Glib::Object((GObject*)(castitem))
115 {}
116
117 RelationSet::~RelationSet()
118 {}
119
120
121 RelationSet::CppClassType RelationSet::relationset_class_; // initialize static member
122
123 GType RelationSet::get_type()
124 {
125   return relationset_class_.init().get_type();
126 }
127
128 GType RelationSet::get_base_type()
129 {
130   return atk_relation_set_get_type();
131 }
132
133
134 RelationSet::RelationSet()
135 :
136   // Mark this class as non-derived to allow C++ vfuncs to be skipped.
137   Glib::ObjectBase(0),
138   Glib::Object(Glib::ConstructParams(relationset_class_.init()))
139 {
140   }
141
142 Glib::RefPtr<RelationSet> RelationSet::create()
143 {
144   return Glib::RefPtr<RelationSet>( new RelationSet() );
145 }
146 bool RelationSet::set_contains(RelationType relationship)
147 {
148   return atk_relation_set_contains(gobj(), ((AtkRelationType)(relationship)));
149 }
150
151 void RelationSet::set_remove(const Glib::RefPtr<Relation>& relation)
152 {
153 atk_relation_set_remove(gobj(), Glib::unwrap(relation)); 
154 }
155
156 void RelationSet::set_add(const Glib::RefPtr<Relation>& relation)
157 {
158 atk_relation_set_add(gobj(), Glib::unwrap(relation)); 
159 }
160
161 int RelationSet::get_n_relations() const
162 {
163   return atk_relation_set_get_n_relations(const_cast<AtkRelationSet*>(gobj()));
164 }
165
166 Glib::RefPtr<Relation> RelationSet::get_relation(gint i)
167 {
168
169   Glib::RefPtr<Relation> retvalue = Glib::wrap(atk_relation_set_get_relation(gobj(), i));
170   if(retvalue)
171     retvalue->reference(); //The function does not do a ref for us.
172   return retvalue;
173
174 }
175
176 Glib::RefPtr<Relation> RelationSet::get_relation(RelationType relationship)
177 {
178
179   Glib::RefPtr<Relation> retvalue = Glib::wrap(atk_relation_set_get_relation_by_type(gobj(), ((AtkRelationType)(relationship))));
180   if(retvalue)
181     retvalue->reference(); //The function does not do a ref for us.
182   return retvalue;
183
184 }
185
186 void RelationSet::add_relation_by_type(RelationType relationship, const Glib::RefPtr<Atk::Object>& target)
187 {
188 atk_relation_set_add_relation_by_type(gobj(), ((AtkRelationType)(relationship)), Glib::unwrap(target)); 
189 }
190
191
192 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
193 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
194
195 #ifdef GLIBMM_VFUNCS_ENABLED
196 #endif //GLIBMM_VFUNCS_ENABLED
197
198
199 } // namespace Atk
200
201