1
// Generated by gtkmmproc -- DO NOT MODIFY!
3
#include <gtkmm/treedragdest.h>
4
#include <gtkmm/private/treedragdest_p.h>
9
/* Copyright 1998-2002 The gtkmm Development Team
11
* This library is free software; you can redistribute it and/or
12
* modify it under the terms of the GNU Library General Public
13
* License as published by the Free Software Foundation; either
14
* version 2 of the License, or (at your option) any later version.
16
* This library is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19
* Library General Public License for more details.
21
* You should have received a copy of the GNU Library General Public
22
* License along with this library; if not, write to the Free
23
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26
#include <gtkmm/treepath.h>
27
#include <gtkmm/selectiondata_private.h>
28
#include <gtk/gtktreednd.h>
33
} // anonymous namespace
39
Glib::RefPtr<Gtk::TreeDragDest> wrap(GtkTreeDragDest* object, bool take_copy)
41
return Glib::RefPtr<Gtk::TreeDragDest>( dynamic_cast<Gtk::TreeDragDest*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
42
//We use dynamic_cast<> in case of multiple inheritance.
52
/* The *_Class implementation: */
54
const Glib::Interface_Class& TreeDragDest_Class::init()
56
if(!gtype_) // create the GType if necessary
58
// Glib::Interface_Class has to know the interface init function
59
// in order to add interfaces to implementing types.
60
class_init_func_ = &TreeDragDest_Class::iface_init_function;
62
// We can not derive from another interface, and it is not necessary anyway.
63
gtype_ = gtk_tree_drag_dest_get_type();
69
void TreeDragDest_Class::iface_init_function(void* g_iface, void*)
71
BaseClassType *const klass = static_cast<BaseClassType*>(g_iface);
73
//This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect.
74
//This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc
77
klass->drag_data_received = &drag_data_received_vfunc_callback;
78
klass->row_drop_possible = &row_drop_possible_vfunc_callback;
81
gboolean TreeDragDest_Class::drag_data_received_vfunc_callback(GtkTreeDragDest* self, GtkTreePath* dest, GtkSelectionData* selection_data)
83
CppObjectType *const obj = dynamic_cast<CppObjectType*>(
84
Glib::ObjectBase::_get_current_wrapper((GObject*)self));
86
// Non-gtkmmproc-generated custom classes implicitly call the default
87
// Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
88
// generated classes can use this optimisation, which avoids the unnecessary
89
// parameter conversions if there is no possibility of the virtual function
91
if(obj && obj->is_derived_())
93
try // Trap C++ exceptions which would normally be lost because this is a C callback.
95
// Call the virtual member method, which derived classes might override.
96
return static_cast<int>(obj->drag_data_received_vfunc(Gtk::TreePath(dest, true)
97
, SelectionData_WithoutOwnership(selection_data)
102
Glib::exception_handlers_invoke();
107
BaseClassType *const base = static_cast<BaseClassType*>(
108
g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
109
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
112
// Call the original underlying C function:
113
if(base && base->drag_data_received)
114
return (*base->drag_data_received)(self, dest, selection_data);
117
typedef gboolean RType;
121
gboolean TreeDragDest_Class::row_drop_possible_vfunc_callback(GtkTreeDragDest* self, GtkTreePath* dest_path, GtkSelectionData* selection_data)
123
CppObjectType *const obj = dynamic_cast<CppObjectType*>(
124
Glib::ObjectBase::_get_current_wrapper((GObject*)self));
126
// Non-gtkmmproc-generated custom classes implicitly call the default
127
// Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
128
// generated classes can use this optimisation, which avoids the unnecessary
129
// parameter conversions if there is no possibility of the virtual function
131
if(obj && obj->is_derived_())
133
try // Trap C++ exceptions which would normally be lost because this is a C callback.
135
// Call the virtual member method, which derived classes might override.
136
return static_cast<int>(obj->row_drop_possible_vfunc(Gtk::TreePath(dest_path, true)
137
, SelectionData_WithoutOwnership(selection_data)
142
Glib::exception_handlers_invoke();
147
BaseClassType *const base = static_cast<BaseClassType*>(
148
g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
149
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
152
// Call the original underlying C function:
153
if(base && base->row_drop_possible)
154
return (*base->row_drop_possible)(self, dest_path, selection_data);
157
typedef gboolean RType;
162
Glib::ObjectBase* TreeDragDest_Class::wrap_new(GObject* object)
164
return new TreeDragDest((GtkTreeDragDest*)(object));
168
/* The implementation: */
170
TreeDragDest::TreeDragDest()
172
Glib::Interface(treedragdest_class_.init())
175
TreeDragDest::TreeDragDest(GtkTreeDragDest* castitem)
177
Glib::Interface((GObject*)(castitem))
180
TreeDragDest::~TreeDragDest()
184
void TreeDragDest::add_interface(GType gtype_implementer)
186
treedragdest_class_.init().add_interface(gtype_implementer);
189
TreeDragDest::CppClassType TreeDragDest::treedragdest_class_; // initialize static member
191
GType TreeDragDest::get_type()
193
return treedragdest_class_.init().get_type();
196
GType TreeDragDest::get_base_type()
198
return gtk_tree_drag_dest_get_type();
202
bool TreeDragDest::drag_data_received(const TreeModel::Path& dest, const SelectionData& selection_data)
204
return gtk_tree_drag_dest_drag_data_received(gobj(), const_cast<GtkTreePath*>((dest).gobj()), const_cast<GtkSelectionData*>((selection_data).gobj()));
207
bool TreeDragDest::row_drop_possible(const TreeModel::Path& dest_path, const SelectionData& selection_data) const
209
return gtk_tree_drag_dest_row_drop_possible(const_cast<GtkTreeDragDest*>(gobj()), const_cast<GtkTreePath*>((dest_path).gobj()), const_cast<GtkSelectionData*>((selection_data).gobj()));
213
bool Gtk::TreeDragDest::drag_data_received_vfunc(const TreeModel::Path& dest, const SelectionData& selection_data)
215
BaseClassType *const base = static_cast<BaseClassType*>(
216
g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
217
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
220
if(base && base->drag_data_received)
221
return (*base->drag_data_received)(gobj(),const_cast<GtkTreePath*>((dest).gobj()),const_cast<GtkSelectionData*>((selection_data).gobj()));
227
bool Gtk::TreeDragDest::row_drop_possible_vfunc(const TreeModel::Path& dest, const SelectionData& selection_data) const
229
BaseClassType *const base = static_cast<BaseClassType*>(
230
g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
231
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
234
if(base && base->row_drop_possible)
235
return (*base->row_drop_possible)(const_cast<GtkTreeDragDest*>(gobj()),const_cast<GtkTreePath*>((dest).gobj()),const_cast<GtkSelectionData*>((selection_data).gobj()));