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


#include <glibmm.h>

#include <gtkmm/csssection.h>
#include <gtkmm/private/csssection_p.h>


/* Copyright (C) 2014 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 <http://www.gnu.org/licenses/>.
 */

#include <gtk/gtk.h>

namespace
{
} // anonymous namespace

// static
GType Glib::Value<Gtk::CssSectionType>::value_type()
{
  return gtk_css_section_type_get_type();
}


/* Why reinterpret_cast<CssSection*>(gobject) is needed:
 *
 * A CssSection instance is in fact always a GtkCssSection instance.
 * Unfortunately, GtkCssSection cannot be a member of CssSection,
 * because it is an opaque struct.  Also, the C interface does not provide
 * any hooks to install a destroy notification handler, thus we cannot
 * wrap it dynamically either.
 *
 * The cast works because CssSection does not have any member data, and
 * it is impossible to derive from it.  This is ensured by using final on the
 * class and by using = delete on the default constructor.
 */

namespace Glib
{

Glib::RefPtr<Gtk::CssSection> wrap(GtkCssSection* object, bool take_copy)
{
  if(take_copy && object)
    gtk_css_section_ref(object);

  // See the comment at the top of this file, if you want to know why the cast works.
  return Glib::RefPtr<Gtk::CssSection>(reinterpret_cast<Gtk::CssSection*>(object));
}

} // namespace Glib


namespace Gtk
{

void CssSection::reference() const
{
  // See the comment at the top of this file, if you want to know why the cast works.
  gtk_css_section_ref(reinterpret_cast<GtkCssSection*>(const_cast<CssSection*>(this)));
}

void CssSection::unreference() const
{
  // See the comment at the top of this file, if you want to know why the cast works.
  gtk_css_section_unref(reinterpret_cast<GtkCssSection*>(const_cast<CssSection*>(this)));
}

GtkCssSection* CssSection::gobj()
{
  // See the comment at the top of this file, if you want to know why the cast works.
  return reinterpret_cast<GtkCssSection*>(this);
}

const GtkCssSection* CssSection::gobj() const
{
  // See the comment at the top of this file, if you want to know why the cast works.
  return reinterpret_cast<const GtkCssSection*>(this);
}

GtkCssSection* CssSection::gobj_copy() const
{
  // See the comment at the top of this file, if you want to know why the cast works.
  const auto gobject = reinterpret_cast<GtkCssSection*>(const_cast<CssSection*>(this));
  gtk_css_section_ref(gobject);
  return gobject;
}


CssSectionType CssSection::get_section_type() const
{
  return ((CssSectionType)(gtk_css_section_get_section_type(const_cast<GtkCssSection*>(gobj()))));
}

Glib::RefPtr<CssSection> CssSection::get_parent()
{
  Glib::RefPtr<CssSection> retvalue = Glib::wrap(gtk_css_section_get_parent(gobj()));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;
}

Glib::RefPtr<const CssSection> CssSection::get_parent() const
{
  return const_cast<CssSection*>(this)->get_parent();
}

Glib::RefPtr<Gio::File> CssSection::get_file()
{
  Glib::RefPtr<Gio::File> retvalue = Glib::wrap(gtk_css_section_get_file(gobj()));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;
}

Glib::RefPtr<const Gio::File> CssSection::get_file() const
{
  return const_cast<CssSection*>(this)->get_file();
}

unsigned int CssSection::get_start_line() const
{
  return gtk_css_section_get_start_line(const_cast<GtkCssSection*>(gobj()));
}

unsigned int CssSection::get_start_position() const
{
  return gtk_css_section_get_start_position(const_cast<GtkCssSection*>(gobj()));
}

unsigned int CssSection::get_end_line() const
{
  return gtk_css_section_get_end_line(const_cast<GtkCssSection*>(gobj()));
}

unsigned int CssSection::get_end_position() const
{
  return gtk_css_section_get_end_position(const_cast<GtkCssSection*>(gobj()));
}


} // namespace Gtk


