Blame pango/pangomm/layoutline.cc

Packit 78284e
// Generated by gmmproc 2.49.5 -- DO NOT MODIFY!
Packit 78284e
Packit 78284e
Packit 78284e
#include <glibmm.h>
Packit 78284e
Packit 78284e
#include <pangomm/layoutline.h>
Packit 78284e
#include <pangomm/private/layoutline_p.h>
Packit 78284e
Packit 78284e
Packit 78284e
// -*- c++ -*-
Packit 78284e
/* $Id: layoutline.ccg,v 1.3 2006/05/30 17:14:21 murrayc Exp $ */
Packit 78284e
Packit 78284e
/*
Packit 78284e
 *
Packit 78284e
 * Copyright 1998-2002 The gtkmm Development Team
Packit 78284e
 *
Packit 78284e
 * This library is free software; you can redistribute it and/or
Packit 78284e
 * modify it under the terms of the GNU Lesser General Public
Packit 78284e
 * License as published by the Free Software Foundation; either
Packit 78284e
 * version 2.1 of the License, or (at your option) any later version.
Packit 78284e
 *
Packit 78284e
 * This library is distributed in the hope that it will be useful,
Packit 78284e
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 78284e
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 78284e
 * Lesser General Public License for more details.
Packit 78284e
 *
Packit 78284e
 * You should have received a copy of the GNU Lesser General Public
Packit 78284e
 * License along with this library; if not, write to the Free
Packit 78284e
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Packit 78284e
 */
Packit 78284e
Packit 78284e
#include <pangomm/layout.h>
Packit 78284e
#include <pango/pangocairo.h>
Packit 78284e
Packit 78284e
namespace Pango {
Packit 78284e
Packit 78284e
Rectangle LayoutLine::get_ink_extents() const
Packit 78284e
{
Packit 78284e
  Rectangle ink_rect;
Packit 78284e
  pango_layout_line_get_extents(const_cast<PangoLayoutLine*>(gobj()), ink_rect.gobj(), 0);
Packit 78284e
  return ink_rect;
Packit 78284e
}
Packit 78284e
Packit 78284e
Rectangle LayoutLine::get_logical_extents() const
Packit 78284e
{
Packit 78284e
  Rectangle logical_rect;
Packit 78284e
  pango_layout_line_get_extents(const_cast<PangoLayoutLine*>(gobj()), 0, logical_rect.gobj());
Packit 78284e
  return logical_rect;
Packit 78284e
}
Packit 78284e
Packit 78284e
Rectangle LayoutLine::get_pixel_ink_extents() const
Packit 78284e
{
Packit 78284e
  Rectangle ink_rect;
Packit 78284e
  pango_layout_line_get_pixel_extents(const_cast<PangoLayoutLine*>(gobj()), ink_rect.gobj(), 0);
Packit 78284e
  return ink_rect;
Packit 78284e
}
Packit 78284e
Packit 78284e
Rectangle LayoutLine::get_pixel_logical_extents() const
Packit 78284e
{
Packit 78284e
  Rectangle logical_rect;
Packit 78284e
  pango_layout_line_get_pixel_extents(const_cast<PangoLayoutLine*>(gobj()), 0, logical_rect.gobj());
Packit 78284e
  return logical_rect;
Packit 78284e
}
Packit 78284e
Packit 78284e
int LayoutLine::index_to_x(int index, bool trailing) const
Packit 78284e
{
Packit 78284e
  int x_pos;
Packit 78284e
  pango_layout_line_index_to_x(const_cast<PangoLayoutLine*>(gobj()), index, trailing, &x_pos);
Packit 78284e
  return x_pos;
Packit 78284e
}
Packit 78284e
Packit 78284e
Glib::ArrayHandle<std::pair<int,int> > LayoutLine::get_x_ranges(int start_index, int end_index) const
Packit 78284e
{
Packit 78284e
  int* ranges = 0;
Packit 78284e
  int n_ranges = 0;
Packit 78284e
  pango_layout_line_get_x_ranges(const_cast<PangoLayoutLine*>(gobj()), start_index, end_index, &ranges, &n_ranges);
Packit 78284e
  return Glib::ArrayHandle<std::pair<int,int> >(reinterpret_cast<std::pair<int,int>*>(ranges), n_ranges, Glib::OWNERSHIP_SHALLOW);
Packit 78284e
}
Packit 78284e
Packit 78284e
void LayoutLine::show_in_cairo_context(const Cairo::RefPtr<Cairo::Context>& context)
Packit 78284e
{
Packit 78284e
  pango_cairo_show_layout_line(context->cobj(), gobj());
Packit 78284e
}
Packit 78284e
Packit 78284e
void LayoutLine::add_to_cairo_context(const Cairo::RefPtr<Cairo::Context>& context)
Packit 78284e
{
Packit 78284e
  pango_cairo_layout_line_path(context->cobj(), gobj());
Packit 78284e
}
Packit 78284e
Packit 78284e
} /* namespace Pango */
Packit 78284e
Packit 78284e
namespace
Packit 78284e
{
Packit 78284e
} // anonymous namespace
Packit 78284e
Packit 78284e
Packit 78284e
/* Why reinterpret_cast<LayoutLine*>(gobject) is needed:
Packit 78284e
 *
Packit 78284e
 * A LayoutLine instance is in fact always a PangoLayoutLine instance.
Packit 78284e
 * Unfortunately, PangoLayoutLine cannot be a member of LayoutLine,
Packit 78284e
 * because it is an opaque struct.  Also, the C interface does not provide
Packit 78284e
 * any hooks to install a destroy notification handler, thus we cannot
Packit 78284e
 * wrap it dynamically either.
Packit 78284e
 *
Packit 78284e
 * The cast works because LayoutLine does not have any member data, and
Packit 78284e
 * it is impossible to derive from it.  This is ensured by using final on the
Packit 78284e
 * class and by using = delete on the default constructor.
Packit 78284e
 */
Packit 78284e
Packit 78284e
namespace Glib
Packit 78284e
{
Packit 78284e
Packit 78284e
Glib::RefPtr<Pango::LayoutLine> wrap(PangoLayoutLine* object, bool take_copy)
Packit 78284e
{
Packit 78284e
  if(take_copy && object)
Packit 78284e
    pango_layout_line_ref(object);
Packit 78284e
Packit 78284e
  // See the comment at the top of this file, if you want to know why the cast works.
Packit 78284e
  return Glib::RefPtr<Pango::LayoutLine>(reinterpret_cast<Pango::LayoutLine*>(object));
Packit 78284e
}
Packit 78284e
Packit 78284e
} // namespace Glib
Packit 78284e
Packit 78284e
Packit 78284e
namespace Pango
Packit 78284e
{
Packit 78284e
Packit 78284e
Packit 78284e
void LayoutLine::reference() const
Packit 78284e
{
Packit 78284e
  // See the comment at the top of this file, if you want to know why the cast works.
Packit 78284e
  pango_layout_line_ref(reinterpret_cast<PangoLayoutLine*>(const_cast<LayoutLine*>(this)));
Packit 78284e
}
Packit 78284e
Packit 78284e
void LayoutLine::unreference() const
Packit 78284e
{
Packit 78284e
  // See the comment at the top of this file, if you want to know why the cast works.
Packit 78284e
  pango_layout_line_unref(reinterpret_cast<PangoLayoutLine*>(const_cast<LayoutLine*>(this)));
Packit 78284e
}
Packit 78284e
Packit 78284e
PangoLayoutLine* LayoutLine::gobj()
Packit 78284e
{
Packit 78284e
  // See the comment at the top of this file, if you want to know why the cast works.
Packit 78284e
  return reinterpret_cast<PangoLayoutLine*>(this);
Packit 78284e
}
Packit 78284e
Packit 78284e
const PangoLayoutLine* LayoutLine::gobj() const
Packit 78284e
{
Packit 78284e
  // See the comment at the top of this file, if you want to know why the cast works.
Packit 78284e
  return reinterpret_cast<const PangoLayoutLine*>(this);
Packit 78284e
}
Packit 78284e
Packit 78284e
PangoLayoutLine* LayoutLine::gobj_copy() const
Packit 78284e
{
Packit 78284e
  // See the comment at the top of this file, if you want to know why the cast works.
Packit 78284e
  const auto gobject = reinterpret_cast<PangoLayoutLine*>(const_cast<LayoutLine*>(this));
Packit 78284e
  pango_layout_line_ref(gobject);
Packit 78284e
  return gobject;
Packit 78284e
}
Packit 78284e
Packit 78284e
Packit 78284e
bool LayoutLine::x_to_index(int x_pos, int& index, int& trailing) const
Packit 78284e
{
Packit 78284e
  return pango_layout_line_x_to_index(const_cast<PangoLayoutLine*>(gobj()), x_pos, &(index), &(trailing));
Packit 78284e
}
Packit 78284e
Packit 78284e
void LayoutLine::get_extents(Rectangle& ink_rect, Rectangle& logical_rect) const
Packit 78284e
{
Packit 78284e
  pango_layout_line_get_extents(const_cast<PangoLayoutLine*>(gobj()), (ink_rect).gobj(), (logical_rect).gobj());
Packit 78284e
}
Packit 78284e
Packit 78284e
void LayoutLine::get_pixel_extents(Rectangle& ink_rect, Rectangle& logical_rect) const
Packit 78284e
{
Packit 78284e
  pango_layout_line_get_pixel_extents(const_cast<PangoLayoutLine*>(gobj()), (ink_rect).gobj(), (logical_rect).gobj());
Packit 78284e
}
Packit 78284e
Packit 78284e
Glib::RefPtr<Pango::Layout> LayoutLine::get_layout()
Packit 78284e
{
Packit 78284e
  Glib::RefPtr<Pango::Layout> ref_ptr(Glib::wrap(gobj()->layout));
Packit 78284e
Packit 78284e
  if(ref_ptr)
Packit 78284e
    ref_ptr->reference();
Packit 78284e
Packit 78284e
  return ref_ptr;
Packit 78284e
}
Packit 78284e
Packit 78284e
Glib::RefPtr<const Pango::Layout> LayoutLine::get_layout() const
Packit 78284e
{
Packit 78284e
  Glib::RefPtr<const Pango::Layout> ref_ptr(Glib::wrap(gobj()->layout));
Packit 78284e
Packit 78284e
  if(ref_ptr)
Packit 78284e
    ref_ptr->reference();
Packit 78284e
Packit 78284e
  return ref_ptr;
Packit 78284e
}
Packit 78284e
Packit 78284e
int LayoutLine::get_length() const
Packit 78284e
{
Packit 78284e
  return gobj()->length;
Packit 78284e
}
Packit 78284e
Packit 78284e
int LayoutLine::get_start_index() const
Packit 78284e
{
Packit 78284e
  return gobj()->start_index;
Packit 78284e
}
Packit 78284e
Packit 78284e
Packit 78284e
} // namespace Pango
Packit 78284e
Packit 78284e