// Generated by gmmproc 2.77.0 -- DO NOT MODIFY!


#include <glibmm.h>

#include <gtkmm/texttagtable.h>
#include <gtkmm/private/texttagtable_p.h>


/*
 * Copyright 1998-2002 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, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

#include <gtkmm/texttag.h>
#include <gtk/gtk.h>

extern "C"
{
static void SignalProxy_ForEach_gtk_callback(GtkTextTag* texttag, gpointer data)
{
  auto the_slot = static_cast<Gtk::TextTagTable::SlotForEach*>(data);
  if(the_slot)
  {
    //Use Slot::operator():
    (*the_slot)(Glib::wrap(texttag, true)); //true = take_copy.
  }
}
} // extern "C"

namespace Gtk
{

void TextTagTable::foreach(const SlotForEach& slot)
{
  //The slot doesn't need to exist for longer than the function call.
  gtk_text_tag_table_foreach(gobj(),  &SignalProxy_ForEach_gtk_callback, (gpointer)&slot);
}

} //namespace Gtk

namespace
{


extern "C" {
static void TextTagTable_signal_tag_changed_connect_callback(GtkTextTagTable* self, GtkTextTag* p0,gboolean p1,void* data)
{
  using namespace Gtk;
  using SlotType = sigc::slot<void(const Glib::RefPtr<TextTag>&, bool)>;

  auto obj = dynamic_cast<TextTagTable*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
  // Do not try to call a signal on a disassociated wrapper.
  if(obj)
  {
    try
    {
      if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
        (*static_cast<SlotType*>(slot))(Glib::wrap(p0, true)
, p1
);
    }
    catch(...)
    {
       Glib::exception_handlers_invoke();
    }
  }
}
} // extern "C"

static const Glib::SignalProxyInfo TextTagTable_signal_tag_changed_info =
{
  "tag_changed",
  (GCallback) &TextTagTable_signal_tag_changed_connect_callback,
  (GCallback) &TextTagTable_signal_tag_changed_connect_callback
};


extern "C" {
static void TextTagTable_signal_tag_added_connect_callback(GtkTextTagTable* self, GtkTextTag* p0,void* data)
{
  using namespace Gtk;
  using SlotType = sigc::slot<void(const Glib::RefPtr<TextTag>&)>;

  auto obj = dynamic_cast<TextTagTable*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
  // Do not try to call a signal on a disassociated wrapper.
  if(obj)
  {
    try
    {
      if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
        (*static_cast<SlotType*>(slot))(Glib::wrap(p0, true)
);
    }
    catch(...)
    {
       Glib::exception_handlers_invoke();
    }
  }
}
} // extern "C"

static const Glib::SignalProxyInfo TextTagTable_signal_tag_added_info =
{
  "tag_added",
  (GCallback) &TextTagTable_signal_tag_added_connect_callback,
  (GCallback) &TextTagTable_signal_tag_added_connect_callback
};


extern "C" {
static void TextTagTable_signal_tag_removed_connect_callback(GtkTextTagTable* self, GtkTextTag* p0,void* data)
{
  using namespace Gtk;
  using SlotType = sigc::slot<void(const Glib::RefPtr<TextTag>&)>;

  auto obj = dynamic_cast<TextTagTable*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
  // Do not try to call a signal on a disassociated wrapper.
  if(obj)
  {
    try
    {
      if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
        (*static_cast<SlotType*>(slot))(Glib::wrap(p0, true)
);
    }
    catch(...)
    {
       Glib::exception_handlers_invoke();
    }
  }
}
} // extern "C"

static const Glib::SignalProxyInfo TextTagTable_signal_tag_removed_info =
{
  "tag_removed",
  (GCallback) &TextTagTable_signal_tag_removed_connect_callback,
  (GCallback) &TextTagTable_signal_tag_removed_connect_callback
};


} // anonymous namespace


namespace Glib
{

Glib::RefPtr<Gtk::TextTagTable> wrap(GtkTextTagTable* object, bool take_copy)
{
  return Glib::make_refptr_for_instance<Gtk::TextTagTable>( dynamic_cast<Gtk::TextTagTable*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
  //We use dynamic_cast<> in case of multiple inheritance.
}

} /* namespace Glib */


namespace Gtk
{


/* The *_Class implementation: */

const Glib::Class& TextTagTable_Class::init()
{
  if(!gtype_) // create the GType if necessary
  {
    // Glib::Class has to know the class init function to clone custom types.
    class_init_func_ = &TextTagTable_Class::class_init_function;

    // This is actually just optimized away, apparently with no harm.
    // Make sure that the parent type has been created.
    //CppClassParent::CppObjectType::get_type();

    // Create the wrapper type, with the same class/instance size as the base type.
    register_derived_type(gtk_text_tag_table_get_type());

    // Add derived versions of interfaces, if the C type implements any interfaces:
  Buildable::add_interface(get_type());

  }

  return *this;
}


void TextTagTable_Class::class_init_function(void* g_class, void* class_data)
{
  const auto klass = static_cast<BaseClassType*>(g_class);
  CppClassParent::class_init_function(klass, class_data);


}


Glib::ObjectBase* TextTagTable_Class::wrap_new(GObject* object)
{
  return new TextTagTable((GtkTextTagTable*)object);
}


/* The implementation: */

GtkTextTagTable* TextTagTable::gobj_copy()
{
  reference();
  return gobj();
}

TextTagTable::TextTagTable(const Glib::ConstructParams& construct_params)
:
  Glib::Object(construct_params)
{

}

TextTagTable::TextTagTable(GtkTextTagTable* castitem)
:
  Glib::Object((GObject*)(castitem))
{}


TextTagTable::TextTagTable(TextTagTable&& src) noexcept
: Glib::Object(std::move(src))
  , Buildable(std::move(src))
{}

TextTagTable& TextTagTable::operator=(TextTagTable&& src) noexcept
{
  Glib::Object::operator=(std::move(src));
  Buildable::operator=(std::move(src));
  return *this;
}


TextTagTable::~TextTagTable() noexcept
{}


TextTagTable::CppClassType TextTagTable::texttagtable_class_; // initialize static member

GType TextTagTable::get_type()
{
  return texttagtable_class_.init().get_type();
}


GType TextTagTable::get_base_type()
{
  return gtk_text_tag_table_get_type();
}


TextTagTable::TextTagTable()
:
  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(nullptr),
  Glib::Object(Glib::ConstructParams(texttagtable_class_.init()))
{
  

}

Glib::RefPtr<TextTagTable> TextTagTable::create()
{
  return Glib::make_refptr_for_instance<TextTagTable>( new TextTagTable() );
}

bool TextTagTable::add(const Glib::RefPtr<TextTag>& tag)
{
  return gtk_text_tag_table_add(gobj(), Glib::unwrap(tag));
}

void TextTagTable::remove(const Glib::RefPtr<TextTag>& tag)
{
  gtk_text_tag_table_remove(gobj(), Glib::unwrap(tag));
}

Glib::RefPtr<TextTag> TextTagTable::lookup(const Glib::ustring& name)
{
  auto retvalue = Glib::wrap(gtk_text_tag_table_lookup(gobj(), name.c_str()));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;
}

Glib::RefPtr<const TextTag> TextTagTable::lookup(const Glib::ustring& name) const
{
  return const_cast<TextTagTable*>(this)->lookup(name);
}

int TextTagTable::get_size() const
{
  return gtk_text_tag_table_get_size(const_cast<GtkTextTagTable*>(gobj()));
}


Glib::SignalProxy<void(const Glib::RefPtr<TextTag>&, bool)> TextTagTable::signal_tag_changed()
{
  return Glib::SignalProxy<void(const Glib::RefPtr<TextTag>&, bool) >(this, &TextTagTable_signal_tag_changed_info);
}


Glib::SignalProxy<void(const Glib::RefPtr<TextTag>&)> TextTagTable::signal_tag_added()
{
  return Glib::SignalProxy<void(const Glib::RefPtr<TextTag>&) >(this, &TextTagTable_signal_tag_added_info);
}


Glib::SignalProxy<void(const Glib::RefPtr<TextTag>&)> TextTagTable::signal_tag_removed()
{
  return Glib::SignalProxy<void(const Glib::RefPtr<TextTag>&) >(this, &TextTagTable_signal_tag_removed_info);
}


} // namespace Gtk


