1 // Generated by gtkmmproc -- DO NOT MODIFY!
4 #include <gtkmm/linkbutton.h>
5 #include <gtkmm/private/linkbutton_p.h>
8 /* $Id: linkbutton.ccg,v 1.1 2006/01/29 12:21:43 murrayc Exp $ */
12 * Copyright 2006 The gtkmm Development Team
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.
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.
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.
29 #include <gtk/gtklinkbutton.h>
32 static void SignalProxy_UriHook_gtk_callback(GtkLinkButton *button, const gchar *link, gpointer user_data)
34 Gtk::LinkButton::SlotUri* the_slot = static_cast<Gtk::LinkButton::SlotUri*>(user_data);
36 #ifdef GLIBMM_EXCEPTIONS_ENABLED
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
46 Glib::exception_handlers_invoke();
48 #endif //GLIBMM_EXCEPTIONS_ENABLE
51 static void SignalProxy_UriHook_gtk_callback_destroy(void* data)
53 delete static_cast<Gtk::LinkButton::SlotUri*>(data);
60 LinkButton::LinkButton(const Glib::ustring& uri)
62 // Mark this class as non-derived to allow C++ vfuncs to be skipped.
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.
67 void LinkButton::set_uri_hook(const SlotUri& slot)
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);
73 gtk_link_button_set_uri_hook (&SignalProxy_UriHook_gtk_callback, slot_copy, &SignalProxy_UriHook_gtk_callback_destroy);
76 void LinkButton::unset_uri_hook()
78 gtk_link_button_set_uri_hook (0, 0, 0);
87 } // anonymous namespace
93 Gtk::LinkButton* wrap(GtkLinkButton* object, bool take_copy)
95 return dynamic_cast<Gtk::LinkButton *> (Glib::wrap_auto ((GObject*)(object), take_copy));
98 } /* namespace Glib */
104 /* The *_Class implementation: */
106 const Glib::Class& LinkButton_Class::init()
108 if(!gtype_) // create the GType if necessary
110 // Glib::Class has to know the class init function to clone custom types.
111 class_init_func_ = &LinkButton_Class::class_init_function;
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();
117 // Create the wrapper type, with the same class/instance size as the base type.
118 register_derived_type(gtk_link_button_get_type());
120 // Add derived versions of interfaces, if the C type implements any interfaces:
126 void LinkButton_Class::class_init_function(void* g_class, void* class_data)
128 BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
129 CppClassParent::class_init_function(klass, class_data);
131 #ifdef GLIBMM_VFUNCS_ENABLED
132 #endif //GLIBMM_VFUNCS_ENABLED
134 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
135 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
138 #ifdef GLIBMM_VFUNCS_ENABLED
139 #endif //GLIBMM_VFUNCS_ENABLED
141 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
142 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
145 Glib::ObjectBase* LinkButton_Class::wrap_new(GObject* o)
147 return manage(new LinkButton((GtkLinkButton*)(o)));
152 /* The implementation: */
154 LinkButton::LinkButton(const Glib::ConstructParams& construct_params)
156 Gtk::Button(construct_params)
160 LinkButton::LinkButton(GtkLinkButton* castitem)
162 Gtk::Button((GtkButton*)(castitem))
166 LinkButton::~LinkButton()
171 LinkButton::CppClassType LinkButton::linkbutton_class_; // initialize static member
173 GType LinkButton::get_type()
175 return linkbutton_class_.init().get_type();
178 GType LinkButton::get_base_type()
180 return gtk_link_button_get_type();
184 LinkButton::LinkButton()
186 // Mark this class as non-derived to allow C++ vfuncs to be skipped.
188 Gtk::Button(Glib::ConstructParams(linkbutton_class_.init()))
192 LinkButton::LinkButton(const Glib::ustring& uri, const Glib::ustring& label)
194 // Mark this class as non-derived to allow C++ vfuncs to be skipped.
196 Gtk::Button(Glib::ConstructParams(linkbutton_class_.init(), "uri", uri.c_str(), "label", label.c_str(), static_cast<char*>(0)))
200 Glib::ustring LinkButton::get_uri() const
202 return Glib::convert_const_gchar_ptr_to_ustring(gtk_link_button_get_uri(const_cast<GtkLinkButton*>(gobj())));
205 void LinkButton::set_uri(const Glib::ustring& uri)
207 gtk_link_button_set_uri(gobj(), uri.c_str());
211 #ifdef GLIBMM_PROPERTIES_ENABLED
212 Glib::PropertyProxy<Glib::ustring> LinkButton::property_uri()
214 return Glib::PropertyProxy<Glib::ustring>(this, "uri");
216 #endif //GLIBMM_PROPERTIES_ENABLED
218 #ifdef GLIBMM_PROPERTIES_ENABLED
219 Glib::PropertyProxy_ReadOnly<Glib::ustring> LinkButton::property_uri() const
221 return Glib::PropertyProxy_ReadOnly<Glib::ustring>(this, "uri");
223 #endif //GLIBMM_PROPERTIES_ENABLED
226 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
227 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
229 #ifdef GLIBMM_VFUNCS_ENABLED
230 #endif //GLIBMM_VFUNCS_ENABLED