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


#include <glibmm.h>

#include <idemm/context.h>
#include <idemm/private/context_p.h>


/* context.ccg
 *
 * Copyright (C) 2016 Marcin Kolny <marcin.kolny@gmail.com>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

namespace
{


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


} // anonymous namespace


namespace Glib
{

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

} /* namespace Glib */


namespace Ide
{


/* The *_Class implementation: */

const Glib::Class& Context_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_ = &Context_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(ide_context_get_type());

    // Add derived versions of interfaces, if the C type implements any interfaces:

  }

  return *this;
}


void Context_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* Context_Class::wrap_new(GObject* object)
{
  return new Context((IdeContext*)object);
}


/* The implementation: */

IdeContext* Context::gobj_copy()
{
  reference();
  return gobj();
}

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

}

Context::Context(IdeContext* castitem)
:
  Glib::Object((GObject*)(castitem))
{}


Context::Context(Context&& src) noexcept
: Glib::Object(std::move(src))
{}

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


Context::~Context() noexcept
{}


Context::CppClassType Context::context_class_; // initialize static member

GType Context::get_type()
{
  return context_class_.init().get_type();
}


GType Context::get_base_type()
{
  return ide_context_get_type();
}


Glib::RefPtr<Ide::BackForwardList> Context::get_back_forward_list() const
{
  Glib::RefPtr<Ide::BackForwardList> retvalue = Glib::wrap(ide_context_get_back_forward_list(const_cast<IdeContext*>(gobj())));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;
}

Glib::RefPtr<Gio::File> Context::get_project_file() const
{
  Glib::RefPtr<Gio::File> retvalue = Glib::wrap(ide_context_get_project_file(const_cast<IdeContext*>(gobj())));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;
}

Glib::RefPtr<Gtk::RecentManager> Context::get_recent_manager() const
{
  Glib::RefPtr<Gtk::RecentManager> retvalue = Glib::wrap(ide_context_get_recent_manager(const_cast<IdeContext*>(gobj())));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;
}

Glib::ustring Context::get_root_build_dir() const
{
  return Glib::convert_const_gchar_ptr_to_ustring(ide_context_get_root_build_dir(const_cast<IdeContext*>(gobj())));
}

void Context::set_root_build_dir(const Glib::ustring& root_build_dir)
{
  ide_context_set_root_build_dir(gobj(), root_build_dir.c_str());
}

void Context::hold()
{
  ide_context_hold(gobj());
}

void Context::hold_for_object(const Glib::RefPtr<Glib::Object>& instance)
{
  ide_context_hold_for_object(gobj(), Glib::unwrap(instance));
}

void Context::release()
{
  ide_context_release(gobj());
}


Glib::SignalProxy< void > Context::signal_loaded()
{
  return Glib::SignalProxy< void >(this, &Context_signal_loaded_info);
}


Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Ide::BackForwardList> > Context::property_back_forward_list() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Ide::BackForwardList> >(this, "back-forward-list");
}

Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gio::File> > Context::property_project_file() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gio::File> >(this, "project-file");
}


} // namespace Ide


