add new sigc++2 directory
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / linkbutton.cc
1 // Generated by gtkmmproc -- DO NOT MODIFY!
2
3
4 #include <gtkmm/linkbutton.h>
5 #include <gtkmm/private/linkbutton_p.h>
6
7 // -*- c++ -*-
8 /* $Id: linkbutton.ccg,v 1.1 2006/01/29 12:21:43 murrayc Exp $ */
9
10 /*
11  *
12  * Copyright 2006 The gtkmm Development Team
13  *
14  * This library is free software; you can redistribute it and/or
15  * modify it under the terms of the GNU Library General Public
16  * License as published by the Free Software Foundation; either
17  * version 2 of the License, or (at your option) any later version.
18  *
19  * This library is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
22  * Library General Public License for more details.
23  *
24  * You should have received a copy of the GNU Library General Public
25  * License along with this library; if not, write to the Free
26  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27  */
28
29 #include <gtk/gtklinkbutton.h>
30
31
32 static void SignalProxy_UriHook_gtk_callback(GtkLinkButton *button, const gchar *link, gpointer user_data)
33 {
34   Gtk::LinkButton::SlotUri* the_slot = static_cast<Gtk::LinkButton::SlotUri*>(user_data);
35
36   #ifdef GLIBMM_EXCEPTIONS_ENABLED
37   try
38   {
39   #endif //GLIBMM_EXCEPTIONS_ENABLE
40     // use Slot::operator()
41     (*the_slot)(Glib::wrap(button), Glib::convert_const_gchar_ptr_to_ustring(link));
42   #ifdef GLIBMM_EXCEPTIONS_ENABLED
43   }
44   catch(...)
45   {
46     Glib::exception_handlers_invoke();
47   }
48   #endif //GLIBMM_EXCEPTIONS_ENABLE
49 }
50
51 static void SignalProxy_UriHook_gtk_callback_destroy(void* data)
52 {
53   delete static_cast<Gtk::LinkButton::SlotUri*>(data);
54 }
55
56
57 namespace Gtk
58 {
59
60 LinkButton::LinkButton(const Glib::ustring& uri)
61 :
62   // Mark this class as non-derived to allow C++ vfuncs to be skipped.
63   Glib::ObjectBase(0),
64   Gtk::Button(Glib::ConstructParams(linkbutton_class_.init(), "uri",uri.c_str(),"label",uri.c_str(), static_cast<char*>(0))) //Note that the uri is used for the label too, as in the C _new() function.
65 {}
66
67 void LinkButton::set_uri_hook(const SlotUri& slot)
68 {
69   //Create a copy of the slot. A pointer to this will be passed through the callback's data parameter.
70   //It will be deleted when TreeView_Private::SignalProxy_CellData_gtk_callback_destroy() is called.
71    SlotUri* slot_copy = new SlotUri(slot);
72
73   gtk_link_button_set_uri_hook (&SignalProxy_UriHook_gtk_callback, slot_copy, &SignalProxy_UriHook_gtk_callback_destroy);
74 }
75
76 void LinkButton::unset_uri_hook()
77 {
78   gtk_link_button_set_uri_hook (0, 0, 0);
79 }
80
81
82 } // namespace Gtk
83
84
85 namespace
86 {
87 } // anonymous namespace
88
89
90 namespace Glib
91 {
92
93 Gtk::LinkButton* wrap(GtkLinkButton* object, bool take_copy)
94 {
95   return dynamic_cast<Gtk::LinkButton *> (Glib::wrap_auto ((GObject*)(object), take_copy));
96 }
97
98 } /* namespace Glib */
99
100 namespace Gtk
101 {
102
103
104 /* The *_Class implementation: */
105
106 const Glib::Class& LinkButton_Class::init()
107 {
108   if(!gtype_) // create the GType if necessary
109   {
110     // Glib::Class has to know the class init function to clone custom types.
111     class_init_func_ = &LinkButton_Class::class_init_function;
112
113     // This is actually just optimized away, apparently with no harm.
114     // Make sure that the parent type has been created.
115     //CppClassParent::CppObjectType::get_type();
116
117     // Create the wrapper type, with the same class/instance size as the base type.
118     register_derived_type(gtk_link_button_get_type());
119
120     // Add derived versions of interfaces, if the C type implements any interfaces:
121   }
122
123   return *this;
124 }
125
126 void LinkButton_Class::class_init_function(void* g_class, void* class_data)
127 {
128   BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
129   CppClassParent::class_init_function(klass, class_data);
130
131 #ifdef GLIBMM_VFUNCS_ENABLED
132 #endif //GLIBMM_VFUNCS_ENABLED
133
134 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
135 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
136 }
137
138 #ifdef GLIBMM_VFUNCS_ENABLED
139 #endif //GLIBMM_VFUNCS_ENABLED
140
141 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
142 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
143
144
145 Glib::ObjectBase* LinkButton_Class::wrap_new(GObject* o)
146 {
147   return manage(new LinkButton((GtkLinkButton*)(o)));
148
149 }
150
151
152 /* The implementation: */
153
154 LinkButton::LinkButton(const Glib::ConstructParams& construct_params)
155 :
156   Gtk::Button(construct_params)
157 {
158   }
159
160 LinkButton::LinkButton(GtkLinkButton* castitem)
161 :
162   Gtk::Button((GtkButton*)(castitem))
163 {
164   }
165
166 LinkButton::~LinkButton()
167 {
168   destroy_();
169 }
170
171 LinkButton::CppClassType LinkButton::linkbutton_class_; // initialize static member
172
173 GType LinkButton::get_type()
174 {
175   return linkbutton_class_.init().get_type();
176 }
177
178 GType LinkButton::get_base_type()
179 {
180   return gtk_link_button_get_type();
181 }
182
183
184 LinkButton::LinkButton()
185 :
186   // Mark this class as non-derived to allow C++ vfuncs to be skipped.
187   Glib::ObjectBase(0),
188   Gtk::Button(Glib::ConstructParams(linkbutton_class_.init()))
189 {
190   }
191
192 LinkButton::LinkButton(const Glib::ustring& uri, const Glib::ustring& label)
193 :
194   // Mark this class as non-derived to allow C++ vfuncs to be skipped.
195   Glib::ObjectBase(0),
196   Gtk::Button(Glib::ConstructParams(linkbutton_class_.init(), "uri", uri.c_str(), "label", label.c_str(), static_cast<char*>(0)))
197 {
198   }
199
200 Glib::ustring LinkButton::get_uri() const
201 {
202   return Glib::convert_const_gchar_ptr_to_ustring(gtk_link_button_get_uri(const_cast<GtkLinkButton*>(gobj())));
203 }
204
205 void LinkButton::set_uri(const Glib::ustring& uri)
206 {
207 gtk_link_button_set_uri(gobj(), uri.c_str()); 
208 }
209
210
211 #ifdef GLIBMM_PROPERTIES_ENABLED
212 Glib::PropertyProxy<Glib::ustring> LinkButton::property_uri() 
213 {
214   return Glib::PropertyProxy<Glib::ustring>(this, "uri");
215 }
216 #endif //GLIBMM_PROPERTIES_ENABLED
217
218 #ifdef GLIBMM_PROPERTIES_ENABLED
219 Glib::PropertyProxy_ReadOnly<Glib::ustring> LinkButton::property_uri() const
220 {
221   return Glib::PropertyProxy_ReadOnly<Glib::ustring>(this, "uri");
222 }
223 #endif //GLIBMM_PROPERTIES_ENABLED
224
225
226 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
227 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
228
229 #ifdef GLIBMM_VFUNCS_ENABLED
230 #endif //GLIBMM_VFUNCS_ENABLED
231
232
233 } // namespace Gtk
234
235