// Generated by gtkmmproc -- DO NOT MODIFY!


#include <gtksourceviewmm/sourcelanguagemanager.h>
#include <gtksourceviewmm/private/sourcelanguagemanager_p.h>

#include <gtksourceview/gtksourcelanguagemanager.h>
#include <gtksourceview/gtksourceview-typebuiltins.h>
/* sourcelanguagemanager.cc
 *
 * Copyright (C) 2004-2005 Jae Jang
 * Copyright (C) 2005-2006 Rob Page
 * Copyright (C) 2006 Dodji Seketeli
 * Copyright (C) 2009, 2010 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.
 */

#include "gtksourceviewmm/sourcelanguagemanager.h"

namespace gtksourceview
{

void
SourceLanguageManager::reset_search_path()
{
  gtk_source_language_manager_set_search_path(gobj(), 0);
}

Glib::RefPtr<SourceLanguage> SourceLanguageManager::guess_language(const Glib::ustring& filename, const Glib::ustring& content_type)
{
  Glib::RefPtr<SourceLanguage> retvalue = Glib::wrap(gtk_source_language_manager_guess_language(gobj(), filename.empty() ? 0 : filename.c_str(), content_type.empty() ? 0 : content_type.c_str()));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;

}

Glib::RefPtr<const SourceLanguage> SourceLanguageManager::guess_language(const Glib::ustring& filename, const Glib::ustring& content_type) const
{
  return const_cast<SourceLanguageManager*>(this)->guess_language(filename, content_type);
}

}//end namespace gtksourceview


namespace
{
} // anonymous namespace


namespace Glib
{

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

} /* namespace Glib */


namespace gtksourceview
{


/* The *_Class implementation: */

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

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

  }

  return *this;
}


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


}


Glib::ObjectBase* SourceLanguageManager_Class::wrap_new(GObject* object)
{
  return new SourceLanguageManager((GtkSourceLanguageManager*)object);
}


/* The implementation: */

GtkSourceLanguageManager* SourceLanguageManager::gobj_copy()
{
  reference();
  return gobj();
}

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

}

SourceLanguageManager::SourceLanguageManager(GtkSourceLanguageManager* castitem)
:
  Glib::Object((GObject*)(castitem))
{}


SourceLanguageManager::~SourceLanguageManager()
{}


SourceLanguageManager::CppClassType SourceLanguageManager::sourcelanguagemanager_class_; // initialize static member

GType SourceLanguageManager::get_type()
{
  return sourcelanguagemanager_class_.init().get_type();
}


GType SourceLanguageManager::get_base_type()
{
  return gtk_source_language_manager_get_type();
}


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

}

Glib::RefPtr<SourceLanguageManager> SourceLanguageManager::create()
{
  return Glib::RefPtr<SourceLanguageManager>( new SourceLanguageManager() );
}
Glib::RefPtr<SourceLanguageManager> SourceLanguageManager::get_default()
{

  Glib::RefPtr<SourceLanguageManager> retvalue = Glib::wrap(gtk_source_language_manager_get_default());

  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;
}


Glib::StringArrayHandle SourceLanguageManager::get_search_path() const
{
  return Glib::StringArrayHandle(gtk_source_language_manager_get_search_path(const_cast<GtkSourceLanguageManager*>(gobj())), Glib::OWNERSHIP_NONE);
}

void SourceLanguageManager::set_search_path(const Glib::StringArrayHandle& dirs)
{
gtk_source_language_manager_set_search_path(gobj(), const_cast<gchar**>((dirs).data())); 
}

Glib::StringArrayHandle SourceLanguageManager::get_language_ids() const
{
  return Glib::StringArrayHandle(gtk_source_language_manager_get_language_ids(const_cast<GtkSourceLanguageManager*>(gobj())), Glib::OWNERSHIP_NONE);
}

Glib::RefPtr<SourceLanguage> SourceLanguageManager::get_language(const Glib::ustring& id)
{

  Glib::RefPtr<SourceLanguage> retvalue = Glib::wrap(gtk_source_language_manager_get_language(gobj(), id.c_str()));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;

}

Glib::RefPtr<const SourceLanguage> SourceLanguageManager::get_language(const Glib::ustring& id) const
{
  return const_cast<SourceLanguageManager*>(this)->get_language(id);
}


} // namespace gtksourceview


