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


#include <glibmm.h>

#include <gtksourceviewmm/completionproposal.h>
#include <gtksourceviewmm/private/completionproposal_p.h>


/* completionproposal.cc
 *
 * Copyright (C) 2009, 2010, 2011 Krzesimir Nowak
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 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
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */


namespace
{


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


} // anonymous namespace


namespace Glib
{

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

} // namespace Glib


namespace Gsv
{


/* The *_Class implementation: */

const Glib::Interface_Class& CompletionProposal_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_ = &CompletionProposal_Class::iface_init_function;

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

  return *this;
}

void CompletionProposal_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 != 0); 

  klass->get_label = &get_label_vfunc_callback;
  klass->get_markup = &get_markup_vfunc_callback;
  klass->get_text = &get_text_vfunc_callback;
  klass->get_icon = &get_icon_vfunc_callback;
  klass->get_info = &get_info_vfunc_callback;
  klass->hash = &hash_vfunc_callback;
  klass->equal = &equal_vfunc_callback;

  klass->changed = &changed_callback;
}

char* CompletionProposal_Class::get_label_vfunc_callback(GtkSourceCompletionProposal* 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 g_strdup((obj->get_label_vfunc()).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_label)
  {
    char* retval = (*base->get_label)(self);
    return retval;
  }

  typedef char* RType;
  return RType();
}
char* CompletionProposal_Class::get_markup_vfunc_callback(GtkSourceCompletionProposal* 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 g_strdup((obj->get_markup_vfunc()).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_markup)
  {
    char* retval = (*base->get_markup)(self);
    return retval;
  }

  typedef char* RType;
  return RType();
}
char* CompletionProposal_Class::get_text_vfunc_callback(GtkSourceCompletionProposal* 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 g_strdup((obj->get_text_vfunc()).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)
  {
    char* retval = (*base->get_text)(self);
    return retval;
  }

  typedef char* RType;
  return RType();
}
GdkPixbuf* CompletionProposal_Class::get_icon_vfunc_callback(GtkSourceCompletionProposal* 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 Glib::unwrap(obj->get_icon_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_icon)
  {
    GdkPixbuf* retval = (*base->get_icon)(self);
    return retval;
  }

  typedef GdkPixbuf* RType;
  return RType();
}
char* CompletionProposal_Class::get_info_vfunc_callback(GtkSourceCompletionProposal* 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 g_strdup((obj->get_info_vfunc()).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_info)
  {
    char* retval = (*base->get_info)(self);
    return retval;
  }

  typedef char* RType;
  return RType();
}
guint CompletionProposal_Class::hash_vfunc_callback(GtkSourceCompletionProposal* 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->hash_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->hash)
  {
    guint retval = (*base->hash)(self);
    return retval;
  }

  typedef guint RType;
  return RType();
}
gboolean CompletionProposal_Class::equal_vfunc_callback(GtkSourceCompletionProposal* self, GtkSourceCompletionProposal* other)
{
  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->equal_vfunc(Glib::wrap(other, true)
));
      }
      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->equal)
  {
    gboolean retval = (*base->equal)(self, other);
    return retval;
  }

  typedef gboolean RType;
  return RType();
}

void CompletionProposal_Class::changed_callback(GtkSourceCompletionProposal* 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_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->changed)
    (*base->changed)(self);
}


Glib::ObjectBase* CompletionProposal_Class::wrap_new(GObject* object)
{
  return new CompletionProposal((GtkSourceCompletionProposal*)(object));
}


/* The implementation: */

CompletionProposal::CompletionProposal()
:
  Glib::Interface(completionproposal_class_.init())
{}

CompletionProposal::CompletionProposal(GtkSourceCompletionProposal* castitem)
:
  Glib::Interface((GObject*)(castitem))
{}

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

CompletionProposal::~CompletionProposal()
{}

// static
void CompletionProposal::add_interface(GType gtype_implementer)
{
  completionproposal_class_.init().add_interface(gtype_implementer);
}

CompletionProposal::CppClassType CompletionProposal::completionproposal_class_; // initialize static member

GType CompletionProposal::get_type()
{
  return completionproposal_class_.init().get_type();
}


GType CompletionProposal::get_base_type()
{
  return gtk_source_completion_proposal_get_type();
}


Glib::ustring CompletionProposal::get_label() const
{
  return Glib::convert_return_gchar_ptr_to_ustring(gtk_source_completion_proposal_get_label(const_cast<GtkSourceCompletionProposal*>(gobj())));
}

Glib::ustring CompletionProposal::get_markup() const
{
  return Glib::convert_return_gchar_ptr_to_ustring(gtk_source_completion_proposal_get_markup(const_cast<GtkSourceCompletionProposal*>(gobj())));
}

Glib::ustring CompletionProposal::get_text() const
{
  return Glib::convert_return_gchar_ptr_to_ustring(gtk_source_completion_proposal_get_text(const_cast<GtkSourceCompletionProposal*>(gobj())));
}

Glib::RefPtr<Gdk::Pixbuf> CompletionProposal::get_icon()
{
  Glib::RefPtr<Gdk::Pixbuf> retvalue = Glib::wrap(gtk_source_completion_proposal_get_icon(gobj()));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;
}

Glib::RefPtr<const Gdk::Pixbuf> CompletionProposal::get_icon() const
{
  return const_cast<CompletionProposal*>(this)->get_icon();
}

Glib::ustring CompletionProposal::get_info() const
{
  return Glib::convert_return_gchar_ptr_to_ustring(gtk_source_completion_proposal_get_info(const_cast<GtkSourceCompletionProposal*>(gobj())));
}

void CompletionProposal::changed()
{
  gtk_source_completion_proposal_changed(gobj());
}

guint CompletionProposal::hash() const
{
  return gtk_source_completion_proposal_hash(const_cast<GtkSourceCompletionProposal*>(gobj()));
}

bool CompletionProposal::equal(const Glib::RefPtr<const CompletionProposal>& other) const
{
  return gtk_source_completion_proposal_equal(const_cast<GtkSourceCompletionProposal*>(gobj()), const_cast<GtkSourceCompletionProposal*>(Glib::unwrap(other)));
}


Glib::SignalProxy0< void > CompletionProposal::signal_changed()
{
  return Glib::SignalProxy0< void >(this, &CompletionProposal_signal_changed_info);
}


void Gsv::CompletionProposal::on_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->changed)
    (*base->changed)(gobj());
}

Glib::ustring Gsv::CompletionProposal::get_label_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_label)
  {
    Glib::ustring retval(Glib::convert_const_gchar_ptr_to_ustring((*base->get_label)(const_cast<GtkSourceCompletionProposal*>(gobj()))));
    return retval;
  }

  typedef Glib::ustring RType;
  return RType();
}
Glib::ustring Gsv::CompletionProposal::get_markup_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_markup)
  {
    Glib::ustring retval(Glib::convert_const_gchar_ptr_to_ustring((*base->get_markup)(const_cast<GtkSourceCompletionProposal*>(gobj()))));
    return retval;
  }

  typedef Glib::ustring RType;
  return RType();
}
Glib::ustring Gsv::CompletionProposal::get_text_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_text)
  {
    Glib::ustring retval(Glib::convert_const_gchar_ptr_to_ustring((*base->get_text)(const_cast<GtkSourceCompletionProposal*>(gobj()))));
    return retval;
  }

  typedef Glib::ustring RType;
  return RType();
}
Glib::RefPtr<Gdk::Pixbuf> Gsv::CompletionProposal::get_icon_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_icon)
  {
    Glib::RefPtr<Gdk::Pixbuf> retval(Glib::wrap((*base->get_icon)(const_cast<GtkSourceCompletionProposal*>(gobj())), true));
    return retval;
  }

  typedef Glib::RefPtr<Gdk::Pixbuf> RType;
  return RType();
}
Glib::ustring Gsv::CompletionProposal::get_info_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_info)
  {
    Glib::ustring retval(Glib::convert_const_gchar_ptr_to_ustring((*base->get_info)(const_cast<GtkSourceCompletionProposal*>(gobj()))));
    return retval;
  }

  typedef Glib::ustring RType;
  return RType();
}
guint Gsv::CompletionProposal::hash_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->hash)
  {
    guint retval((*base->hash)(const_cast<GtkSourceCompletionProposal*>(gobj())));
    return retval;
  }

  typedef guint RType;
  return RType();
}
bool Gsv::CompletionProposal::equal_vfunc(const Glib::RefPtr<const CompletionProposal>& other) 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->equal)
  {
    bool retval((*base->equal)(const_cast<GtkSourceCompletionProposal*>(gobj()),const_cast<GtkSourceCompletionProposal*>(Glib::unwrap(other))));
    return retval;
  }

  typedef bool RType;
  return RType();
}


} // namespace Gsv


