// Generated by gtkmmproc -- DO NOT MODIFY!


#include <glibmm.h>

#include <pangomm/layoutrun.h>
#include <pangomm/private/layoutrun_p.h>


/*
 * Copyright 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, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include <pangomm/item.h>
#include <pangomm/glyphstring.h>

namespace Pango
{

} /* namespace Pango */


namespace
{
} // anonymous namespace


namespace Glib
{

Pango::LayoutRun wrap(PangoGlyphItem* object, bool take_copy)
{
  return Pango::LayoutRun(object, take_copy);
}

} // namespace Glib


namespace Pango
{


// static
GType LayoutRun::get_type()
{
  return pango_glyph_item_get_type();
}

LayoutRun::LayoutRun()
:
  gobject_ (0) // Allows creation of invalid wrapper, e.g. for output arguments to methods.
{}

LayoutRun::LayoutRun(const LayoutRun& other)
:
  gobject_ ((other.gobject_) ? pango_glyph_item_copy(other.gobject_) : 0)
{}

LayoutRun::LayoutRun(PangoGlyphItem* gobject, bool make_a_copy)
:
  // For BoxedType wrappers, make_a_copy is true by default.  The static
  // BoxedType wrappers must always take a copy, thus make_a_copy = true
  // ensures identical behaviour if the default argument is used.
  gobject_ ((make_a_copy && gobject) ? pango_glyph_item_copy(gobject) : gobject)
{}

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

LayoutRun::~LayoutRun()
{
  if(gobject_)
    pango_glyph_item_free(gobject_);
}

void LayoutRun::swap(LayoutRun& other)
{
  PangoGlyphItem *const temp = gobject_;
  gobject_ = other.gobject_;
  other.gobject_ = temp;
}

PangoGlyphItem* LayoutRun::gobj_copy() const
{
  return pango_glyph_item_copy(gobject_);
}


GlyphItem LayoutRun::split(const Glib::ustring& text, int split_index)
{
  return GlyphItem((pango_glyph_item_split(gobj(), text.c_str(), split_index)));
}

void LayoutRun::letter_space(const Glib::ustring& text, const LogAttr& log_attrs, int letter_spacing)
{
  pango_glyph_item_letter_space(gobj(), text.c_str(), &(const_cast<LogAttr&>(log_attrs)), letter_spacing);
}

 Item LayoutRun::get_item() const
{
  return Item((gobj()->item));
}
 
 GlyphString LayoutRun::get_glyphs() const
{
  return GlyphString((gobj()->glyphs));
}
 

} // namespace Pango


