<?xml version="1.0" standalone="no"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<refentry id="class-pangolayoutline">
  <refnamediv>
    <refname>pango.LayoutLine</refname>
    <refpurpose>a line in a <link
linkend="class-pangolayout"><classname>pango.Layout</classname></link>
(new in PyGTK 2.8)</refpurpose>
  </refnamediv>

  <refsect1>
    <title>Synopsis</title>

    <classsynopsis language="python">
      <ooclass><classname>pango.LayoutLine</classname></ooclass>
      <ooclass><classname><link
linkend="class-gobjectgboxed">gobject.GBoxed</link></classname></ooclass>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-pangolayoutline--get-extents">get_extents</link></methodname>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-pangolayoutline--get-pixel-extents">get_pixel_extents</link></methodname>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-pangolayoutline--index-to-x">index_to_x</link></methodname>
	<methodparam><parameter role="keyword">index</parameter></methodparam>
	<methodparam><parameter role="keyword">trailing</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-pangolayoutline--x-to-index">x_to_index</link></methodname>
	<methodparam><parameter role="keyword">x_pos</parameter></methodparam>
      </methodsynopsis>

    </classsynopsis>

  </refsect1>

  <refsect1>
    <title>Ancestry</title>

<synopsis>+-- <link linkend="class-gobjectgboxed">gobject.GBoxed</link>
  +-- <link linkend="class-pangolayoutline">pango.LayoutLine</link>
</synopsis>

  </refsect1>

  <refsect1>
    <title>Attributes</title>
 
    <blockquote role="properties">
      <informaltable pgwide="1" frame="none">
        <tgroup cols="3">
        <?dbhtml cellpadding="5"?>
          <colspec column="1" colwidth="1in"/>
          <colspec column="2" colwidth="1in"/>
          <colspec column="3" colwidth="4in"/>
          <tbody>
 
            <row valign="top">
              <entry>"is_paragraph_start"</entry>
              <entry>Read</entry>
              <entry><literal>True</literal> if this is the first line of
the paragraph</entry>
            </row>
 
            <row valign="top">
              <entry>"length"</entry>
              <entry>Read</entry>
              <entry>the length of the line in bytes</entry>
            </row>
 
            <row valign="top">
              <entry>"resolved_dir"</entry>
              <entry>Read</entry>
              <entry>the resolved direction of line</entry>
            </row>
 
            <row valign="top">
              <entry>"runs"</entry>
              <entry>Read</entry>
              <entry>a list containing the runs of the line in visual
order.</entry>
            </row>
 
            <row valign="top">
              <entry>"start_index"</entry>
              <entry>Read</entry>
              <entry>the start of the line as byte index into the
layout.</entry>
            </row>
 
        </tbody>
      </tgroup>
      </informaltable>
    </blockquote>
 
  </refsect1>
 
  <refsect1>
    <title>Description</title>

    <para>A <link
linkend="class-pangolayoutline"><classname>pango.LayoutLine</classname></link>
object represents one of the lines resulting from laying out a paragraph via
<link
linkend="class-pangolayout"><classname>pango.Layout</classname></link>. <link
linkend="class-pangolayoutline"><classname>pango.LayoutLine</classname></link>
objects are obtained by calling the <link
linkend="method-pangolayout--get-line"><methodname>pango.Layout.get_line</methodname>()</link>
method or the <link
linkend="method-pangolayoutiter--get-line"><methodname>pango.LayoutIter.get_line</methodname>()</link>
method. <link
linkend="class-pangolayoutline"><classname>pango.LayoutLine</classname></link>
objects are only valid until the text, attributes, or settings of the parent
<link linkend="class-pangolayout"><classname>pango.Layout</classname></link>
are modified.</para>

  </refsect1>

  <refsect1>
    <title>Methods</title>

  <refsect2 id="method-pangolayoutline--get-extents">
      <title>pango.LayoutLine.get_extents</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_extents</methodname>
       </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a 2-tuple containing 4-tuples representing
the rectangles for the logical and ink extents in Pango
units.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.8 and above.</para>
      </note>

      <para>The <methodname>get_extents</methodname>() method returns the
logical and ink extents rectangles of the layout line in a 2-tuple
containing two 4-tuples which represent the rectangles. See the
documentation for the <link
linkend="method-pangofont--get-glyph-extents"><methodname>pango.Font.get_glyph_extents</methodname>()</link>
method for details about the interpretation of the rectangles. The return
extents are in Pango units (1 device unit = pango.SCALE pango units).</para>

    </refsect2>

  <refsect2 id="method-pangolayoutline--get-pixel-extents">
      <title>pango.LayoutLine.get_pixel_extents</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_pixel_extents</methodname>
        </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a 2-tuple containing 4-tuples representing
the rectangles for the logical and ink extents in device
units.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.8 and above.</para>
      </note>

      <para>The <methodname>get_pixel_extents</methodname>() method returns
the logical and ink extents rectangles of the layout line in a 2-tuple
containing two 4-tuples which represent the rectangles. See the
documentation for the <link
linkend="method-pangofont--get-glyph-extents"><methodname>pango.Font.get_glyph_extents</methodname>()</link>
method for details about the interpretation of the rectangles. The return
extents are in device units (1 device unit = pango.SCALE pango
units).</para>

    </refsect2>

  <refsect2 id="method-pangolayoutline--index-to-x">
      <title>pango.LayoutLine.index_to_x</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>index_to_x</methodname>
          <methodparam><parameter
		       role="keyword">index</parameter></methodparam>
          <methodparam><parameter
		       role="keyword">trailing</parameter></methodparam>
        </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">index</parameter>&nbsp;:</term>
	  <listitem><simpara>the byte offset of a grapheme
within the layout</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">trailing</parameter>&nbsp;:</term>
	  <listitem><simpara>an integer indicating the edge of the grapheme
to retrieve the position of. If 0, the trailing edge of the grapheme,
if > 0, the leading edge of the grapheme.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the X position in Pango units</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.8 and above.</para>
      </note>

      <para>The <methodname>index_to_x</methodname>() method returns the X
position (in Pango units) of the grapheme at the byte offset specified by
<parameter>index</parameter> and edge specified by
<parameter>trailing</parameter>.</para>

    </refsect2>

  <refsect2 id="method-pangolayoutline--x-to-index">
      <title>pango.LayoutLine.x_to_index</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>x_to_index</methodname>
          <methodparam><parameter
		       role="keyword">x_pos</parameter></methodparam>
        </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">x_pos</parameter>&nbsp;:</term>
	  <listitem><simpara>the x offset (in Pango units) from the left
edge of the line.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a 3-tuple containing a boolean indicating if the
<parameter>x_pos</parameter> is inside the line, the byte offset of the
grapheme and the location in the grapheme.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.8 and above.</para>
      </note>

      <para>The <methodname>x_to_index</methodname>() method returns a
3-tuple containing a boolean that is <literal>True</literal> if x_pos is
inside the line, the location inside the grapheme - either zero, or the
number of characters in the grapheme. 0 represents the trailing edge of the
grapheme.</para>

    </refsect2>

  </refsect1>

</refentry>
