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


#include <glibmm.h>

#include <atkmm/text.h>
#include <atkmm/private/text_p.h>

#include <atk/atk-enum-types.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, see <https://www.gnu.org/licenses/>.
 */

#include <atkmm/object.h>
#include <glib.h>
#include <algorithm> /* for std::swap() */


// static
GType Glib::Value<Atk::TextAttribute>::value_type()
{
  return atk_text_attribute_get_type();
}


namespace Atk
{

/**** Atk::Attribute *******************************************************/

Attribute::Attribute()
{
  gobject_.name  = 0;
  gobject_.value = 0;
}

Attribute::Attribute(const Glib::ustring& name, const Glib::ustring& value)
{
  gobject_.name  = g_strndup(name .data(), name .bytes());
  gobject_.value = g_strndup(value.data(), value.bytes());
}

Attribute::Attribute(const AtkAttribute* gobject)
{
  g_return_if_fail(gobject != 0);

  gobject_.name  = g_strdup(gobject->name);
  gobject_.value = g_strdup(gobject->value);
}

Attribute::~Attribute()
{
  g_free(gobject_.name);
  g_free(gobject_.value);
}

Attribute::Attribute(const Attribute& other)
{
  gobject_.name  = g_strdup(other.gobject_.name);
  gobject_.value = g_strdup(other.gobject_.value);
}

Attribute& Attribute::operator=(const Attribute& other)
{
  Attribute temp (other);
  swap(temp);
  return *this;
}

void Attribute::swap(Attribute& other)
{
  std::swap(gobject_.name,  other.gobject_.name);
  std::swap(gobject_.value, other.gobject_.value);
}


/**** Atk::TextAttribute ***************************************************/

// static
TextAttribute TextAttribute::for_name(const Glib::ustring& name)
{
  return TextAttribute(int(atk_text_attribute_for_name(name.c_str())));
}

// static
Glib::ustring TextAttribute::get_name(TextAttribute attribute)
{
  if(const char *const name = atk_text_attribute_get_name(AtkTextAttribute(int(attribute))))
    return Glib::ustring(name);
  else
    return Glib::ustring();
}

// static
Glib::ustring TextAttribute::get_value(TextAttribute attribute, int index)
{
  if(const char *const value = atk_text_attribute_get_value(AtkTextAttribute(int(attribute)), index))
    return Glib::ustring(value);
  else
    return Glib::ustring();
}

} // namespace Atk

namespace
{


static void Text_signal_text_changed_callback(AtkText* self, gint p0,gint p1,void* data)
{
  using namespace Atk;
  using SlotType = sigc::slot< void,int,int >;

  auto obj = dynamic_cast<Text*>(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))(p0
, p1
);
    }
    catch(...)
    {
       Glib::exception_handlers_invoke();
    }
  }
}

static const Glib::SignalProxyInfo Text_signal_text_changed_info =
{
  "text_changed",
  (GCallback) &Text_signal_text_changed_callback,
  (GCallback) &Text_signal_text_changed_callback
};


static void Text_signal_text_caret_moved_callback(AtkText* self, gint p0,void* data)
{
  using namespace Atk;
  using SlotType = sigc::slot< void,int >;

  auto obj = dynamic_cast<Text*>(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))(p0
);
    }
    catch(...)
    {
       Glib::exception_handlers_invoke();
    }
  }
}

static const Glib::SignalProxyInfo Text_signal_text_caret_moved_info =
{
  "text_caret_moved",
  (GCallback) &Text_signal_text_caret_moved_callback,
  (GCallback) &Text_signal_text_caret_moved_callback
};


static const Glib::SignalProxyInfo Text_signal_text_selection_changed_info =
{
  "text_selection_changed",
  (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
  (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
};


static const Glib::SignalProxyInfo Text_signal_text_attributes_changed_info =
{
  "text_attributes_changed",
  (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
  (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
};


} // anonymous namespace


namespace Atk
{


Glib::ustring Attribute::get_name() const
{
  return Glib::convert_const_gchar_ptr_to_ustring(gobj()->name);
}

Glib::ustring Attribute::get_value() const
{
  return Glib::convert_const_gchar_ptr_to_ustring(gobj()->value);
}


} // namespace Atk

// static
GType Glib::Value<Atk::BuiltinTextAttribute>::value_type()
{
  return atk_text_attribute_get_type();
}

// static
GType Glib::Value<Atk::TextBoundary>::value_type()
{
  return atk_text_boundary_get_type();
}

// static
GType Glib::Value<Atk::TextClipType>::value_type()
{
  return atk_text_clip_type_get_type();
}

// static
GType Glib::Value<Atk::TextGranularity>::value_type()
{
  return atk_text_granularity_get_type();
}


namespace Glib
{

Glib::RefPtr<Atk::Text> wrap(AtkText* object, bool take_copy)
{
  return Glib::RefPtr<Atk::Text>( dynamic_cast<Atk::Text*> (Glib::wrap_auto_interface<Atk::Text> ((GObject*)(object), take_copy)) );
  //We use dynamic_cast<> in case of multiple inheritance.
}

} // namespace Glib


namespace Atk
{


/* The *_Class implementation: */

const Glib::Interface_Class& Text_Class::init()
{
  if(!gtype_) // create the GType if necessary
  {
    // Glib::Interface_Class has to know the interface init function
    // in order to add interfaces to implementing types.
    class_init_func_ = &Text_Class::iface_init_function;

    // We can not derive from another interface, and it is not necessary anyway.
    gtype_ = atk_text_get_type();
  }

  return *this;
}

void Text_Class::iface_init_function(void* g_iface, void*)
{
  const auto klass = static_cast<BaseClassType*>(g_iface);

  //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect.
  //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc
  g_assert(klass != nullptr);

  klass->get_text = &get_text_vfunc_callback;
  klass->get_character_at_offset = &get_character_at_offset_vfunc_callback;
  klass->get_text_after_offset = &get_text_after_offset_vfunc_callback;
  klass->get_text_at_offset = &get_text_at_offset_vfunc_callback;
  klass->get_text_before_offset = &get_text_before_offset_vfunc_callback;
  klass->get_caret_offset = &get_caret_offset_vfunc_callback;
  klass->get_character_extents = &get_character_extents_vfunc_callback;
  klass->get_run_attributes = &get_run_attributes_vfunc_callback;
  klass->get_default_attributes = &get_default_attributes_vfunc_callback;
  klass->get_character_count = &get_character_count_vfunc_callback;
  klass->get_offset_at_point = &get_offset_at_point_vfunc_callback;
  klass->get_n_selections = &get_n_selections_vfunc_callback;
  klass->get_selection = &get_selection_vfunc_callback;
  klass->add_selection = &add_selection_vfunc_callback;
  klass->remove_selection = &remove_selection_vfunc_callback;
  klass->set_selection = &set_selection_vfunc_callback;
  klass->set_caret_offset = &set_caret_offset_vfunc_callback;

  klass->text_changed = &text_changed_callback;
  klass->text_caret_moved = &text_caret_moved_callback;
  klass->text_selection_changed = &text_selection_changed_callback;
  klass->text_attributes_changed = &text_attributes_changed_callback;
}

gchar* Text_Class::get_text_vfunc_callback(AtkText* self, gint start_offset, gint end_offset)
{
  const auto obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        return g_strdup((obj->get_text_vfunc(start_offset
, end_offset
)).c_str());
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
)  );

  // Call the original underlying C function:
  if(base && base->get_text)
    return (*base->get_text)(self, start_offset, end_offset);

  using RType = gchar*;
  return RType();
}
gunichar Text_Class::get_character_at_offset_vfunc_callback(AtkText* self, gint offset)
{
  const auto obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        return obj->get_character_at_offset_vfunc(offset
);
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
)  );

  // Call the original underlying C function:
  if(base && base->get_character_at_offset)
    return (*base->get_character_at_offset)(self, offset);

  using RType = gunichar;
  return RType();
}
gchar* Text_Class::get_text_after_offset_vfunc_callback(AtkText* self, gint offset, AtkTextBoundary boundary_type, gint* start_offset, gint* end_offset)
{
  const auto obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        return g_strdup((obj->get_text_after_offset_vfunc(offset
, ((TextBoundary)(boundary_type))
, *(start_offset)
, *(end_offset)
)).c_str());
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
)  );

  // Call the original underlying C function:
  if(base && base->get_text_after_offset)
    return (*base->get_text_after_offset)(self, offset, boundary_type, start_offset, end_offset);

  using RType = gchar*;
  return RType();
}
gchar* Text_Class::get_text_at_offset_vfunc_callback(AtkText* self, gint offset, AtkTextBoundary boundary_type, gint* start_offset, gint* end_offset)
{
  const auto obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        return g_strdup((obj->get_text_at_offset_vfunc(offset
, ((TextBoundary)(boundary_type))
, *(start_offset)
, *(end_offset)
)).c_str());
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
)  );

  // Call the original underlying C function:
  if(base && base->get_text_at_offset)
    return (*base->get_text_at_offset)(self, offset, boundary_type, start_offset, end_offset);

  using RType = gchar*;
  return RType();
}
gchar* Text_Class::get_text_before_offset_vfunc_callback(AtkText* self, gint offset, AtkTextBoundary boundary_type, gint* start_offset, gint* end_offset)
{
  const auto obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        return g_strdup((obj->get_text_before_offset_vfunc(offset
, ((TextBoundary)(boundary_type))
, *(start_offset)
, *(end_offset)
)).c_str());
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
)  );

  // Call the original underlying C function:
  if(base && base->get_text_before_offset)
    return (*base->get_text_before_offset)(self, offset, boundary_type, start_offset, end_offset);

  using RType = gchar*;
  return RType();
}
gint Text_Class::get_caret_offset_vfunc_callback(AtkText* self)
{
  const auto obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        return obj->get_caret_offset_vfunc();
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
)  );

  // Call the original underlying C function:
  if(base && base->get_caret_offset)
    return (*base->get_caret_offset)(self);

  using RType = gint;
  return RType();
}
void Text_Class::get_character_extents_vfunc_callback(AtkText* self, gint offset, gint* x, gint* y, gint* width, gint* height, AtkCoordType coords)
{
  const auto obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        obj->get_character_extents_vfunc(offset
, *(x)
, *(y)
, *(width)
, *(height)
, ((CoordType)(coords))
);
        return;
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
)  );

  // Call the original underlying C function:
  if(base && base->get_character_extents)
    (*base->get_character_extents)(self, offset, x, y, width, height, coords);
}
AtkAttributeSet* Text_Class::get_run_attributes_vfunc_callback(AtkText* self, gint offset, gint* start_offset, gint* end_offset)
{
  const auto obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        return obj->get_run_attributes_vfunc(offset
, *(start_offset)
, *(end_offset)
);
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
)  );

  // Call the original underlying C function:
  if(base && base->get_run_attributes)
    return (*base->get_run_attributes)(self, offset, start_offset, end_offset);

  using RType = AtkAttributeSet*;
  return RType();
}
AtkAttributeSet* Text_Class::get_default_attributes_vfunc_callback(AtkText* self)
{
  const auto obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        return obj->get_default_attributes_vfunc();
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
)  );

  // Call the original underlying C function:
  if(base && base->get_default_attributes)
    return (*base->get_default_attributes)(self);

  using RType = AtkAttributeSet*;
  return RType();
}
gint Text_Class::get_character_count_vfunc_callback(AtkText* self)
{
  const auto obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        return obj->get_character_count_vfunc();
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
)  );

  // Call the original underlying C function:
  if(base && base->get_character_count)
    return (*base->get_character_count)(self);

  using RType = gint;
  return RType();
}
gint Text_Class::get_offset_at_point_vfunc_callback(AtkText* self, gint x, gint y, AtkCoordType coords)
{
  const auto obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        return obj->get_offset_at_point_vfunc(x
, y
, ((CoordType)(coords))
);
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
)  );

  // Call the original underlying C function:
  if(base && base->get_offset_at_point)
    return (*base->get_offset_at_point)(self, x, y, coords);

  using RType = gint;
  return RType();
}
gint Text_Class::get_n_selections_vfunc_callback(AtkText* self)
{
  const auto obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        return obj->get_n_selections_vfunc();
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
)  );

  // Call the original underlying C function:
  if(base && base->get_n_selections)
    return (*base->get_n_selections)(self);

  using RType = gint;
  return RType();
}
gchar* Text_Class::get_selection_vfunc_callback(AtkText* self, gint selection_num, gint* start_offset, gint* end_offset)
{
  const auto obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        return g_strdup((obj->get_selection_vfunc(selection_num
, *(start_offset)
, *(end_offset)
)).c_str());
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
)  );

  // Call the original underlying C function:
  if(base && base->get_selection)
    return (*base->get_selection)(self, selection_num, start_offset, end_offset);

  using RType = gchar*;
  return RType();
}
gboolean Text_Class::add_selection_vfunc_callback(AtkText* self, gint start_offset, gint end_offset)
{
  const auto obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        return static_cast<int>(obj->add_selection_vfunc(start_offset
, end_offset
));
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
)  );

  // Call the original underlying C function:
  if(base && base->add_selection)
    return (*base->add_selection)(self, start_offset, end_offset);

  using RType = gboolean;
  return RType();
}
gboolean Text_Class::remove_selection_vfunc_callback(AtkText* self, gint selection_num)
{
  const auto obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        return static_cast<int>(obj->remove_selection_vfunc(selection_num
));
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
)  );

  // Call the original underlying C function:
  if(base && base->remove_selection)
    return (*base->remove_selection)(self, selection_num);

  using RType = gboolean;
  return RType();
}
gboolean Text_Class::set_selection_vfunc_callback(AtkText* self, gint selection_num, gint start_offset, gint end_offset)
{
  const auto obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        return static_cast<int>(obj->set_selection_vfunc(selection_num
, start_offset
, end_offset
));
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
)  );

  // Call the original underlying C function:
  if(base && base->set_selection)
    return (*base->set_selection)(self, selection_num, start_offset, end_offset);

  using RType = gboolean;
  return RType();
}
gboolean Text_Class::set_caret_offset_vfunc_callback(AtkText* self, gint offset)
{
  const auto obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        return static_cast<int>(obj->set_caret_offset_vfunc(offset
));
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
)  );

  // Call the original underlying C function:
  if(base && base->set_caret_offset)
    return (*base->set_caret_offset)(self, offset);

  using RType = gboolean;
  return RType();
}

void Text_Class::text_changed_callback(AtkText* self, gint p0, gint p1)
{
  const auto obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        obj->on_text_changed(p0
, p1
);
        return;
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  const auto base = static_cast<BaseClassType*>(
        g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
)    );

  // Call the original underlying C function:
  if(base && base->text_changed)
    (*base->text_changed)(self, p0, p1);
}
void Text_Class::text_caret_moved_callback(AtkText* self, gint p0)
{
  const auto obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        obj->on_text_caret_moved(p0
);
        return;
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  const auto base = static_cast<BaseClassType*>(
        g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
)    );

  // Call the original underlying C function:
  if(base && base->text_caret_moved)
    (*base->text_caret_moved)(self, p0);
}
void Text_Class::text_selection_changed_callback(AtkText* self)
{
  const auto obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        obj->on_text_selection_changed();
        return;
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  const auto base = static_cast<BaseClassType*>(
        g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
)    );

  // Call the original underlying C function:
  if(base && base->text_selection_changed)
    (*base->text_selection_changed)(self);
}
void Text_Class::text_attributes_changed_callback(AtkText* self)
{
  const auto obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        obj->on_text_attributes_changed();
        return;
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  const auto base = static_cast<BaseClassType*>(
        g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
)    );

  // Call the original underlying C function:
  if(base && base->text_attributes_changed)
    (*base->text_attributes_changed)(self);
}


Glib::ObjectBase* Text_Class::wrap_new(GObject* object)
{
  return new Text((AtkText*)(object));
}


/* The implementation: */

Text::Text()
:
  Glib::Interface(text_class_.init())
{}

Text::Text(AtkText* castitem)
:
  Glib::Interface((GObject*)(castitem))
{}

Text::Text(const Glib::Interface_Class& interface_class)
: Glib::Interface(interface_class)
{
}

Text::Text(Text&& src) noexcept
: Glib::Interface(std::move(src))
{}

Text& Text::operator=(Text&& src) noexcept
{
  Glib::Interface::operator=(std::move(src));
  return *this;
}

Text::~Text() noexcept
{}

// static
void Text::add_interface(GType gtype_implementer)
{
  text_class_.init().add_interface(gtype_implementer);
}

Text::CppClassType Text::text_class_; // initialize static member

GType Text::get_type()
{
  return text_class_.init().get_type();
}


GType Text::get_base_type()
{
  return atk_text_get_type();
}

Glib::ustring Text::get_text(int start_offset, int end_offset) const
{
  return Glib::convert_return_gchar_ptr_to_ustring(atk_text_get_text(const_cast<AtkText*>(gobj()), start_offset, end_offset));
}

gunichar Text::get_character_at_offset(int offset) const
{
  return atk_text_get_character_at_offset(const_cast<AtkText*>(gobj()), offset);
}

#ifndef ATKMM_DISABLE_DEPRECATED
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
Glib::ustring Text::get_text_after_offset(int offset, TextBoundary boundary_type, int& start_offset, int& end_offset) const
{
  return Glib::convert_return_gchar_ptr_to_ustring(atk_text_get_text_after_offset(const_cast<AtkText*>(gobj()), offset, ((AtkTextBoundary)(boundary_type)), &(start_offset), &(end_offset)));
}
G_GNUC_END_IGNORE_DEPRECATIONS
#endif // ATKMM_DISABLE_DEPRECATED

#ifndef ATKMM_DISABLE_DEPRECATED
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
Glib::ustring Text::get_text_at_offset(int offset, TextBoundary boundary_type, int& start_offset, int& end_offset) const
{
  return Glib::convert_return_gchar_ptr_to_ustring(atk_text_get_text_at_offset(const_cast<AtkText*>(gobj()), offset, ((AtkTextBoundary)(boundary_type)), &(start_offset), &(end_offset)));
}
G_GNUC_END_IGNORE_DEPRECATIONS
#endif // ATKMM_DISABLE_DEPRECATED

#ifndef ATKMM_DISABLE_DEPRECATED
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
Glib::ustring Text::get_text_before_offset(int offset, TextBoundary boundary_type, int& start_offset, int& end_offset) const
{
  return Glib::convert_return_gchar_ptr_to_ustring(atk_text_get_text_before_offset(const_cast<AtkText*>(gobj()), offset, ((AtkTextBoundary)(boundary_type)), &(start_offset), &(end_offset)));
}
G_GNUC_END_IGNORE_DEPRECATIONS
#endif // ATKMM_DISABLE_DEPRECATED

Glib::ustring Text::get_string_at_offset(int offset, TextGranularity granularity, int& start_offset, int& end_offset)
{
  return Glib::convert_return_gchar_ptr_to_ustring(atk_text_get_string_at_offset(gobj(), offset, ((AtkTextGranularity)(granularity)), &(start_offset), &(end_offset)));
}

int Text::get_caret_offset() const
{
  return atk_text_get_caret_offset(const_cast<AtkText*>(gobj()));
}

void Text::get_character_extents(int offset, int& x, int& y, int& width, int& height, CoordType coords) const
{
  atk_text_get_character_extents(const_cast<AtkText*>(gobj()), offset, &(x), &(y), &(width), &(height), ((AtkCoordType)(coords)));
}

AttributeSet Text::get_run_attributes(int offset, int& start_offset, int& end_offset) const
{
  return AttributeSet(atk_text_get_run_attributes(const_cast<AtkText*>(gobj()), offset, &(start_offset), &(end_offset)), Glib::OWNERSHIP_DEEP);
}

AttributeSet Text::get_default_attributes() const
{
  return AttributeSet(atk_text_get_default_attributes(const_cast<AtkText*>(gobj())), Glib::OWNERSHIP_DEEP);
}

int Text::get_character_count() const
{
  return atk_text_get_character_count(const_cast<AtkText*>(gobj()));
}

int Text::get_offset_at_point(int x, int y, CoordType coords) const
{
  return atk_text_get_offset_at_point(const_cast<AtkText*>(gobj()), x, y, ((AtkCoordType)(coords)));
}

int Text::get_n_selections() const
{
  return atk_text_get_n_selections(const_cast<AtkText*>(gobj()));
}

Glib::ustring Text::get_selection(int selection_num, int& start_offset, int& end_offset) const
{
  return Glib::convert_return_gchar_ptr_to_ustring(atk_text_get_selection(const_cast<AtkText*>(gobj()), selection_num, &(start_offset), &(end_offset)));
}

bool Text::add_selection(int start_offset, int end_offset)
{
  return atk_text_add_selection(gobj(), start_offset, end_offset);
}

bool Text::remove_selection(int selection_num)
{
  return atk_text_remove_selection(gobj(), selection_num);
}

bool Text::set_selection(int selection_num, int start_offset, int end_offset)
{
  return atk_text_set_selection(gobj(), selection_num, start_offset, end_offset);
}

bool Text::set_caret_offset(int offset)
{
  return atk_text_set_caret_offset(gobj(), offset);
}

void Text::get_range_extents(int start_offset, int end_offset, CoordType coord_type, Rectangle& rect)
{
  atk_text_get_range_extents(gobj(), start_offset, end_offset, ((AtkCoordType)(coord_type)), &(rect));
}

AtkTextRange** Text::get_bounded_ranges(const Rectangle& rect, CoordType coord_type, TextClipType x_clip_type, TextClipType y_clip_type)
{
  return atk_text_get_bounded_ranges(gobj(), const_cast<AtkTextRectangle*>(&(rect)), ((AtkCoordType)(coord_type)), ((AtkTextClipType)(x_clip_type)), ((AtkTextClipType)(y_clip_type)));
}


Glib::SignalProxy< void,int,int > Text::signal_text_changed()
{
  return Glib::SignalProxy< void,int,int >(this, &Text_signal_text_changed_info);
}


Glib::SignalProxy< void,int > Text::signal_text_caret_moved()
{
  return Glib::SignalProxy< void,int >(this, &Text_signal_text_caret_moved_info);
}


Glib::SignalProxy< void > Text::signal_text_selection_changed()
{
  return Glib::SignalProxy< void >(this, &Text_signal_text_selection_changed_info);
}


Glib::SignalProxy< void > Text::signal_text_attributes_changed()
{
  return Glib::SignalProxy< void >(this, &Text_signal_text_attributes_changed_info);
}


void Atk::Text::on_text_changed(int position, int length)
{
  const auto base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
)  );

  if(base && base->text_changed)
    (*base->text_changed)(gobj(),position,length);
}
void Atk::Text::on_text_caret_moved(int location)
{
  const auto base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
)  );

  if(base && base->text_caret_moved)
    (*base->text_caret_moved)(gobj(),location);
}
void Atk::Text::on_text_selection_changed()
{
  const auto base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
)  );

  if(base && base->text_selection_changed)
    (*base->text_selection_changed)(gobj());
}
void Atk::Text::on_text_attributes_changed()
{
  const auto base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
)  );

  if(base && base->text_attributes_changed)
    (*base->text_attributes_changed)(gobj());
}

Glib::ustring Atk::Text::get_text_vfunc(int start_offset, int end_offset) const
{
  const auto base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
)  );

  if(base && base->get_text)
  {
    Glib::ustring retval(Glib::convert_return_gchar_ptr_to_ustring((*base->get_text)(const_cast<AtkText*>(gobj()),start_offset,end_offset)));
    return retval;
  }

  using RType = Glib::ustring;
  return RType();
}
gunichar Atk::Text::get_character_at_offset_vfunc(int offset) const
{
  const auto base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
)  );

  if(base && base->get_character_at_offset)
  {
    gunichar retval((*base->get_character_at_offset)(const_cast<AtkText*>(gobj()),offset));
    return retval;
  }

  using RType = gunichar;
  return RType();
}
Glib::ustring Atk::Text::get_text_after_offset_vfunc(int offset, TextBoundary boundary_type, int& start_offset, int& end_offset) const
{
  const auto base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
)  );

  if(base && base->get_text_after_offset)
  {
    Glib::ustring retval(Glib::convert_return_gchar_ptr_to_ustring((*base->get_text_after_offset)(const_cast<AtkText*>(gobj()),offset,((AtkTextBoundary)(boundary_type)),&(start_offset),&(end_offset))));
    return retval;
  }

  using RType = Glib::ustring;
  return RType();
}
Glib::ustring Atk::Text::get_text_at_offset_vfunc(int offset, TextBoundary boundary_type, int& start_offset, int& end_offset) const
{
  const auto base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
)  );

  if(base && base->get_text_at_offset)
  {
    Glib::ustring retval(Glib::convert_return_gchar_ptr_to_ustring((*base->get_text_at_offset)(const_cast<AtkText*>(gobj()),offset,((AtkTextBoundary)(boundary_type)),&(start_offset),&(end_offset))));
    return retval;
  }

  using RType = Glib::ustring;
  return RType();
}
Glib::ustring Atk::Text::get_text_before_offset_vfunc(int offset, TextBoundary boundary_type, int& start_offset, int& end_offset) const
{
  const auto base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
)  );

  if(base && base->get_text_before_offset)
  {
    Glib::ustring retval(Glib::convert_return_gchar_ptr_to_ustring((*base->get_text_before_offset)(const_cast<AtkText*>(gobj()),offset,((AtkTextBoundary)(boundary_type)),&(start_offset),&(end_offset))));
    return retval;
  }

  using RType = Glib::ustring;
  return RType();
}
int Atk::Text::get_caret_offset_vfunc() const
{
  const auto base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
)  );

  if(base && base->get_caret_offset)
  {
    int retval((*base->get_caret_offset)(const_cast<AtkText*>(gobj())));
    return retval;
  }

  using RType = int;
  return RType();
}
void Atk::Text::get_character_extents_vfunc(int offset, int& x, int& y, int& width, int& height, CoordType coords) const
{
  const auto base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
)  );

  if(base && base->get_character_extents)
  {
    (*base->get_character_extents)(const_cast<AtkText*>(gobj()),offset,&(x),&(y),&(width),&(height),((AtkCoordType)(coords)));
  }
}
AtkAttributeSet* Atk::Text::get_run_attributes_vfunc(int offset, int& start_offset, int& end_offset) const
{
  const auto base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
)  );

  if(base && base->get_run_attributes)
  {
    AtkAttributeSet* retval((*base->get_run_attributes)(const_cast<AtkText*>(gobj()),offset,&(start_offset),&(end_offset)));
    return retval;
  }

  using RType = AtkAttributeSet*;
  return RType();
}
AtkAttributeSet* Atk::Text::get_default_attributes_vfunc() const
{
  const auto base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
)  );

  if(base && base->get_default_attributes)
  {
    AtkAttributeSet* retval((*base->get_default_attributes)(const_cast<AtkText*>(gobj())));
    return retval;
  }

  using RType = AtkAttributeSet*;
  return RType();
}
int Atk::Text::get_character_count_vfunc() const
{
  const auto base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
)  );

  if(base && base->get_character_count)
  {
    int retval((*base->get_character_count)(const_cast<AtkText*>(gobj())));
    return retval;
  }

  using RType = int;
  return RType();
}
int Atk::Text::get_offset_at_point_vfunc(int x, int y, CoordType coords) const
{
  const auto base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
)  );

  if(base && base->get_offset_at_point)
  {
    int retval((*base->get_offset_at_point)(const_cast<AtkText*>(gobj()),x,y,((AtkCoordType)(coords))));
    return retval;
  }

  using RType = int;
  return RType();
}
int Atk::Text::get_n_selections_vfunc() const
{
  const auto base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
)  );

  if(base && base->get_n_selections)
  {
    int retval((*base->get_n_selections)(const_cast<AtkText*>(gobj())));
    return retval;
  }

  using RType = int;
  return RType();
}
Glib::ustring Atk::Text::get_selection_vfunc(int selection_num, int& start_offset, int& end_offset) const
{
  const auto base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
)  );

  if(base && base->get_selection)
  {
    Glib::ustring retval(Glib::convert_return_gchar_ptr_to_ustring((*base->get_selection)(const_cast<AtkText*>(gobj()),selection_num,&(start_offset),&(end_offset))));
    return retval;
  }

  using RType = Glib::ustring;
  return RType();
}
bool Atk::Text::add_selection_vfunc(int start_offset, int end_offset) 
{
  const auto base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
)  );

  if(base && base->add_selection)
  {
    bool retval((*base->add_selection)(gobj(),start_offset,end_offset));
    return retval;
  }

  using RType = bool;
  return RType();
}
bool Atk::Text::remove_selection_vfunc(int selection_num) 
{
  const auto base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
)  );

  if(base && base->remove_selection)
  {
    bool retval((*base->remove_selection)(gobj(),selection_num));
    return retval;
  }

  using RType = bool;
  return RType();
}
bool Atk::Text::set_selection_vfunc(int selection_num, int start_offset, int end_offset) 
{
  const auto base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
)  );

  if(base && base->set_selection)
  {
    bool retval((*base->set_selection)(gobj(),selection_num,start_offset,end_offset));
    return retval;
  }

  using RType = bool;
  return RType();
}
bool Atk::Text::set_caret_offset_vfunc(int offset) 
{
  const auto base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
)  );

  if(base && base->set_caret_offset)
  {
    bool retval((*base->set_caret_offset)(gobj(),offset));
    return retval;
  }

  using RType = bool;
  return RType();
}


} // namespace Atk


