~ubuntu-branches/ubuntu/saucy/atkmm1.6/saucy-proposed

« back to all changes in this revision

Viewing changes to atk/atkmm/relationset.cc

  • Committer: Bazaar Package Importer
  • Author(s): Krzysztof Klimonda
  • Date: 2010-11-02 20:35:53 UTC
  • Revision ID: james.westby@ubuntu.com-20101102203553-syno2w6yedmcdgk8
ImportĀ upstreamĀ versionĀ 2.22.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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: relationset.ccg,v 1.1 2003/01/21 13:37:06 murrayc Exp $ */
 
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 Lesser General Public
 
14
 * License as published by the Free Software Foundation; either
 
15
 * version 2.1 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
 * Lesser General Public License for more details.
 
21
 *
 
22
 * You should have received a copy of the GNU Lesser 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
 
 
72
  return *this;
 
73
}
 
74
 
 
75
 
 
76
void RelationSet_Class::class_init_function(void* g_class, void* class_data)
 
77
{
 
78
  BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
 
79
  CppClassParent::class_init_function(klass, class_data);
 
80
 
 
81
 
 
82
}
 
83
 
 
84
 
 
85
Glib::ObjectBase* RelationSet_Class::wrap_new(GObject* object)
 
86
{
 
87
  return new RelationSet((AtkRelationSet*)object);
 
88
}
 
89
 
 
90
 
 
91
/* The implementation: */
 
92
 
 
93
AtkRelationSet* RelationSet::gobj_copy()
 
94
{
 
95
  reference();
 
96
  return gobj();
 
97
}
 
98
 
 
99
RelationSet::RelationSet(const Glib::ConstructParams& construct_params)
 
100
:
 
101
  Glib::Object(construct_params)
 
102
{
 
103
 
 
104
}
 
105
 
 
106
RelationSet::RelationSet(AtkRelationSet* castitem)
 
107
:
 
108
  Glib::Object((GObject*)(castitem))
 
109
{}
 
110
 
 
111
 
 
112
RelationSet::~RelationSet()
 
113
{}
 
114
 
 
115
 
 
116
RelationSet::CppClassType RelationSet::relationset_class_; // initialize static member
 
117
 
 
118
GType RelationSet::get_type()
 
119
{
 
120
  return relationset_class_.init().get_type();
 
121
}
 
122
 
 
123
 
 
124
GType RelationSet::get_base_type()
 
125
{
 
126
  return atk_relation_set_get_type();
 
127
}
 
128
 
 
129
 
 
130
RelationSet::RelationSet()
 
131
:
 
132
  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
 
133
  Glib::ObjectBase(0),
 
134
  Glib::Object(Glib::ConstructParams(relationset_class_.init()))
 
135
{
 
136
  
 
137
 
 
138
}
 
139
 
 
140
Glib::RefPtr<RelationSet> RelationSet::create()
 
141
{
 
142
  return Glib::RefPtr<RelationSet>( new RelationSet() );
 
143
}
 
144
bool RelationSet::set_contains(RelationType relationship)
 
145
{
 
146
  return atk_relation_set_contains(gobj(), ((AtkRelationType)(relationship)));
 
147
}
 
148
 
 
149
void RelationSet::set_remove(const Glib::RefPtr<Relation>& relation)
 
150
{
 
151
atk_relation_set_remove(gobj(), Glib::unwrap(relation)); 
 
152
}
 
153
 
 
154
void RelationSet::set_add(const Glib::RefPtr<Relation>& relation)
 
155
{
 
156
atk_relation_set_add(gobj(), Glib::unwrap(relation)); 
 
157
}
 
158
 
 
159
int RelationSet::get_n_relations() const
 
160
{
 
161
  return atk_relation_set_get_n_relations(const_cast<AtkRelationSet*>(gobj()));
 
162
}
 
163
 
 
164
Glib::RefPtr<Relation> RelationSet::get_relation(gint i)
 
165
{
 
166
 
 
167
  Glib::RefPtr<Relation> retvalue = Glib::wrap(atk_relation_set_get_relation(gobj(), i));
 
168
  if(retvalue)
 
169
    retvalue->reference(); //The function does not do a ref for us.
 
170
  return retvalue;
 
171
 
 
172
}
 
173
 
 
174
Glib::RefPtr<Relation> RelationSet::get_relation(RelationType relationship)
 
175
{
 
176
 
 
177
  Glib::RefPtr<Relation> retvalue = Glib::wrap(atk_relation_set_get_relation_by_type(gobj(), ((AtkRelationType)(relationship))));
 
178
  if(retvalue)
 
179
    retvalue->reference(); //The function does not do a ref for us.
 
180
  return retvalue;
 
181
 
 
182
}
 
183
 
 
184
void RelationSet::add_relation_by_type(RelationType relationship, const Glib::RefPtr<Atk::Object>& target)
 
185
{
 
186
atk_relation_set_add_relation_by_type(gobj(), ((AtkRelationType)(relationship)), Glib::unwrap(target)); 
 
187
}
 
188
 
 
189
 
 
190
} // namespace Atk
 
191
 
 
192