/* Copyright (C) 2009 The gtkmm Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, see . */ _CONFIGINCLUDE(gtkmmconfig.h) #include _DEFS(gtkmm,gtk) _PINCLUDE(glibmm/private/interface_p.h) #ifndef DOXYGEN_SHOULD_SKIP_THIS extern "C" { typedef struct _GtkBuildableIface GtkBuildableIface; } #endif /* DOXYGEN_SHOULD_SKIP_THIS */ namespace Gtk { /** A base class for objects that can be built by Gtk::Builder. * * Buildable allows objects to extend and customize thier deserialization from Gtk::Builder UI descriptions. * The interface includes methods for setting names and properties of objects, parsing custom tags and constructing child objects. * * All gtkmm widgets, and many non-widget objects, derive from this base class. * The main user of this interface is Gtk::Builder. There should be very little need for applications to call any of Buildable's methods. * * @newin{3,0} */ class GTKMM_API Buildable : public Glib::Interface { _CLASS_INTERFACE(Buildable, GtkBuildable, GTK_BUILDABLE, GtkBuildableIface, , , GTKMM_API) public: _WRAP_METHOD(void set_name(const Glib::ustring& name), gtk_buildable_set_name) _WRAP_METHOD(Glib::ustring get_name() const, gtk_buildable_get_name) //TODO: #m4 _CONVERSION(`(const Glib::RefPtr&',`GtkBuilder*',`($3).gobj()') //TODO: _WRAP_METHOD(void add_child(const Glib::RefPtr& builder, const Glib::RefPtr& child, const Glib::ustring& type), gtk_buildable_add_child) /* TODO: _WRAP_METHOD(void gtk_buildable_set_buildable_property ( GtkBuilder *builder, const Glib::ustring& name, const GValue *value); _WRAP_METHOD(GObject * gtk_buildable_construct_child ( GtkBuilder *builder, const Glib::ustring& name); _WRAP_METHOD(gboolean gtk_buildable_custom_tag_start ( GtkBuilder *builder, GObject *child, const Glib::ustring& tagname, GMarkupParser *parser, gpointer *data); _WRAP_METHOD(void gtk_buildable_custom_tag_end ( GtkBuilder *builder, GObject *child, const Glib::ustring& tagname, gpointer *data); _WRAP_METHOD(void gtk_buildable_custom_finished ( GtkBuilder *builder, GObject *child, const Glib::ustring& tagname, gpointer data); _WRAP_METHOD(void gtk_buildable_parser_finished ( GtkBuilder *builder); _WRAP_METHOD(GObject * gtk_buildable_get_internal_child ( GtkBuilder *builder, const Glib::ustring& childname); */ //TODO: Properties, signals, vfuncs. #m4begin dnl //Custom-coded vfuncs: dnl _PUSH(SECTION_CC_PRE_INCLUDES) // Needed before gtkmm/private/buildable_p.h is included. typedef struct _GtkBuilder GtkBuilder; _SECTION(SECTION_PCC_CLASS_INIT_VFUNCS) klass->custom_tag_start = &custom_tag_start_vfunc_callback; klass->custom_tag_end = &custom_tag_end_vfunc_callback; _SECTION(SECTION_PH_VFUNCS) static gboolean custom_tag_start_vfunc_callback( GtkBuildable* buildable, GtkBuilder* builder, GObject* child, const gchar* tagname, GMarkupParser* parser, gpointer* data); static void custom_tag_end_vfunc_callback( GtkBuildable* buildable, GtkBuilder* builder, GObject* child, const gchar* tagname, gpointer* data); _POP() #m4end }; } // namespace Gtk