<?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="unixprint-functions">

  <refnamediv>
    <refname>gtkunixprint Functions</refname>
      <refpurpose>the built-in functions of the gtkunixprint
      module</refpurpose>
  </refnamediv>

  <refsect1>
    <title>Synopsis</title>

    <programlisting><methodsynopsis language="python">
      <methodname><link linkend="function-unixprint--enumerate-printers">gtkunixprint.enumerate_printers</link></methodname>
      <methodparam><parameter role="keyword">func</parameter></methodparam>
      <methodparam><parameter role="keyword">data</parameter><initializer>None</initializer></methodparam>
      <methodparam><parameter role="keyword">wait</parameter><initializer>True</initializer></methodparam>
      </methodsynopsis></programlisting>

  </refsect1>

  <refsect1>
    <title>Functions</title>

    <refsect2 id="function-unixprint--enumerate-printers">
      <title>gtkunixprint.enumerate_printers</title>

      <programlisting><methodsynopsis language="python">
      <methodname>gtkunixprint.enumerate_printers</methodname>
      <methodparam><parameter role="keyword">func</parameter></methodparam>
      <methodparam><parameter role="keyword">data</parameter><initializer>None</initializer></methodparam>
      <methodparam><parameter role="keyword">wait</parameter><initializer>True</initializer></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">func</parameter>&nbsp;:</term>
          <listitem><simpara>a function to call for each
          printer</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter role="keyword">data</parameter>&nbsp;:</term>
          <listitem><simpara>user data to pass to
          <parameter>func</parameter></simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter role="keyword">wait</parameter>&nbsp;:</term>
          <listitem><simpara>if <literal>True</literal>, wait in a recursive
          mainloop until all printers are enumerated; otherwise return
          early</simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This function is available in PyGTK 2.10 and above.</para>
      </note>

      <para>Calls the function specified by <parameter>func</parameter> for
      all <link
      linkend="class-gtkprinter"><classname>gtkunixprint.Printer</classname></link>s.
      If <parameter>func</parameter> returns <literal>True</literal>, the
      enumeration is stopped.</para>

      <para>The signature of func is:</para>
      <programlisting>
  def func(printer, user_data):
      </programlisting>
      <para>where <parameter>printer</parameter> is a <link
      linkend="class-gtkprinter"><classname>gtkunixprint.Printer</classname></link>
      object and <parameter>user_data</parameter> is
      <parameter>data</parameter>. Note if <parameter>data</parameter> is
      not specified <parameter>user_data</parameter> will not be passed to
      func.</para>

    </refsect2>

  </refsect1>

</refentry>
