<?xml version="1.0"?>
<!-- This file was automatically generated from C sources - DO NOT EDIT!
To affect the contents of this file, edit the original C definitions,
and/or use gtk-doc annotations.  -->
<repository version="1.2"
            xmlns="http://www.gtk.org/introspection/core/1.0"
            xmlns:c="http://www.gtk.org/introspection/c/1.0"
            xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
  <include name="GObject" version="2.0"/>
  <include name="Gio" version="2.0"/>
  <c:include name="libmediaart/mediaart.h"/>
  <namespace name="MediaArt"
             version="1.0"
             shared-library="libmediaart-1.0.so.0.0"
             c:identifier-prefixes="MediaArt"
             c:symbol-prefixes="media_art">
    <enumeration name="Type" c:type="MediaArtType">
      <doc xml:space="preserve">This type categorized the type of media art we're dealing with.</doc>
      <member name="none" value="0" c:identifier="MEDIA_ART_NONE">
        <doc xml:space="preserve">No media art is available</doc>
      </member>
      <member name="album" value="1" c:identifier="MEDIA_ART_ALBUM">
        <doc xml:space="preserve">Media art is an album</doc>
      </member>
      <member name="video" value="2" c:identifier="MEDIA_ART_VIDEO">
        <doc xml:space="preserve">Media art is a movie or video</doc>
      </member>
    </enumeration>
    <function name="buffer_to_jpeg" c:identifier="media_art_buffer_to_jpeg">
      <return-value transfer-ownership="none">
        <type name="gboolean" c:type="gboolean"/>
      </return-value>
      <parameters>
        <parameter name="buffer" transfer-ownership="none">
          <type name="guint8" c:type="const unsigned char*"/>
        </parameter>
        <parameter name="len" transfer-ownership="none">
          <type name="gulong" c:type="size_t"/>
        </parameter>
        <parameter name="buffer_mime" transfer-ownership="none">
          <type name="utf8" c:type="const gchar*"/>
        </parameter>
        <parameter name="target" transfer-ownership="none">
          <type name="utf8" c:type="const gchar*"/>
        </parameter>
      </parameters>
    </function>
    <function name="file_to_jpeg" c:identifier="media_art_file_to_jpeg">
      <return-value transfer-ownership="none">
        <type name="gboolean" c:type="gboolean"/>
      </return-value>
      <parameters>
        <parameter name="filename" transfer-ownership="none">
          <type name="utf8" c:type="const gchar*"/>
        </parameter>
        <parameter name="target" transfer-ownership="none">
          <type name="utf8" c:type="const gchar*"/>
        </parameter>
      </parameters>
    </function>
    <function name="get_file"
              c:identifier="media_art_get_file"
              version="0.2.0">
      <doc xml:space="preserve">Gets the files pointing to cache files suitable for storing the media
art provided by the @artist, @title and @file arguments. @cache_file
will point to a location in the XDG user cache directory, meanwhile
@local_file will point to a cache file that resides in the same
filesystem than @file.

When done, both #GFile&lt;!-- --&gt;s must be freed with g_object_unref() if
non-%NULL.</doc>
      <return-value transfer-ownership="none">
        <type name="none" c:type="void"/>
      </return-value>
      <parameters>
        <parameter name="artist" transfer-ownership="none">
          <doc xml:space="preserve">the artist</doc>
          <type name="utf8" c:type="const gchar*"/>
        </parameter>
        <parameter name="title" transfer-ownership="none">
          <doc xml:space="preserve">the title</doc>
          <type name="utf8" c:type="const gchar*"/>
        </parameter>
        <parameter name="prefix" transfer-ownership="none">
          <doc xml:space="preserve">the prefix for cache files, for example "album"</doc>
          <type name="utf8" c:type="const gchar*"/>
        </parameter>
        <parameter name="file" transfer-ownership="none" allow-none="1">
          <doc xml:space="preserve">the file or %NULL</doc>
          <type name="Gio.File" c:type="GFile*"/>
        </parameter>
        <parameter name="cache_file"
                   direction="out"
                   caller-allocates="0"
                   transfer-ownership="full"
                   allow-none="1">
          <doc xml:space="preserve">the location to store a #GFile pointing to the user cache path, or %NULL</doc>
          <type name="Gio.File" c:type="GFile**"/>
        </parameter>
        <parameter name="local_file"
                   direction="out"
                   caller-allocates="0"
                   transfer-ownership="full"
                   allow-none="1">
          <doc xml:space="preserve">the location to store a #GFile pointing to a cache file in the same filesystem than @file, or %NULL.</doc>
          <type name="Gio.File" c:type="GFile**"/>
        </parameter>
      </parameters>
    </function>
    <function name="get_path"
              c:identifier="media_art_get_path"
              version="0.2.0">
      <doc xml:space="preserve">Get the path to media art for a given resource. Newly allocated data in
@path and @local_uri must be freed with g_free().</doc>
      <return-value transfer-ownership="none">
        <type name="none" c:type="void"/>
      </return-value>
      <parameters>
        <parameter name="artist" transfer-ownership="none">
          <doc xml:space="preserve">the artist</doc>
          <type name="utf8" c:type="const gchar*"/>
        </parameter>
        <parameter name="title" transfer-ownership="none">
          <doc xml:space="preserve">the title</doc>
          <type name="utf8" c:type="const gchar*"/>
        </parameter>
        <parameter name="prefix" transfer-ownership="none">
          <doc xml:space="preserve">the prefix, for example "album"</doc>
          <type name="utf8" c:type="const gchar*"/>
        </parameter>
        <parameter name="uri" transfer-ownership="none" allow-none="1">
          <doc xml:space="preserve">the uri of the file or %NULL</doc>
          <type name="utf8" c:type="const gchar*"/>
        </parameter>
        <parameter name="path"
                   direction="out"
                   caller-allocates="0"
                   transfer-ownership="full"
                   allow-none="1">
          <doc xml:space="preserve">the location to store the local path or %NULL</doc>
          <type name="utf8" c:type="gchar**"/>
        </parameter>
        <parameter name="local_uri"
                   direction="out"
                   caller-allocates="0"
                   transfer-ownership="full"
                   allow-none="1">
          <doc xml:space="preserve">the location to store the local uri or %NULL</doc>
          <type name="utf8" c:type="gchar**"/>
        </parameter>
      </parameters>
    </function>
    <function name="init" c:identifier="media_art_init" version="0.2.0">
      <doc xml:space="preserve">Initialize libmediaart.

This function initializes cache hash tables, backend plugins,
storage modules used for removable devices and connections to D-Bus.</doc>
      <return-value transfer-ownership="none">
        <doc xml:space="preserve">%TRUE if initialisation was successful, %FALSE otherwise.</doc>
        <type name="gboolean" c:type="gboolean"/>
      </return-value>
    </function>
    <function name="plugin_init" c:identifier="media_art_plugin_init">
      <return-value transfer-ownership="none">
        <type name="none" c:type="void"/>
      </return-value>
      <parameters>
        <parameter name="max_width" transfer-ownership="none">
          <type name="gint" c:type="gint"/>
        </parameter>
      </parameters>
    </function>
    <function name="plugin_shutdown" c:identifier="media_art_plugin_shutdown">
      <return-value transfer-ownership="none">
        <type name="none" c:type="void"/>
      </return-value>
    </function>
    <function name="process" c:identifier="media_art_process" version="0.2.0">
      <doc xml:space="preserve">This function is the same as media_art_process_file(), but takes the URI as
a string rather than a #GFile object.</doc>
      <return-value transfer-ownership="none">
        <doc xml:space="preserve">%TRUE in case of success, %FALSE otherwise.</doc>
        <type name="gboolean" c:type="gboolean"/>
      </return-value>
      <parameters>
        <parameter name="buffer" transfer-ownership="none">
          <doc xml:space="preserve">A buffer of binary image data</doc>
          <array length="1" zero-terminated="0" c:type="unsigned char*">
            <type name="guint8" c:type="unsigned char"/>
          </array>
        </parameter>
        <parameter name="len" transfer-ownership="none">
          <doc xml:space="preserve">The length of @buffer, in bytes</doc>
          <type name="gulong" c:type="size_t"/>
        </parameter>
        <parameter name="mime" transfer-ownership="none">
          <doc xml:space="preserve">The MIME type of the data stored in @buffer</doc>
          <type name="utf8" c:type="const gchar*"/>
        </parameter>
        <parameter name="type" transfer-ownership="none">
          <doc xml:space="preserve">The type of media that contained the image data</doc>
          <type name="Type" c:type="MediaArtType"/>
        </parameter>
        <parameter name="artist" transfer-ownership="none" allow-none="1">
          <doc xml:space="preserve">Artist name of the media</doc>
          <type name="utf8" c:type="const gchar*"/>
        </parameter>
        <parameter name="title" transfer-ownership="none" allow-none="1">
          <doc xml:space="preserve">Title of the media</doc>
          <type name="utf8" c:type="const gchar*"/>
        </parameter>
        <parameter name="uri" transfer-ownership="none">
          <doc xml:space="preserve">URI of the media file that contained the image data</doc>
          <type name="utf8" c:type="const gchar*"/>
        </parameter>
      </parameters>
    </function>
    <function name="process_file"
              c:identifier="media_art_process_file"
              version="0.2.0">
      <doc xml:space="preserve">Processes a media file. If you have extracted any embedded media art and
passed this in as @buffer, the image data will be converted to the correct
format and saved in the media art cache.

If @buffer is %NULL, libmediaart will search the parent directory of @file
for image files that are likely to be media art for @file, and if one is
found it will be saved in the media art cache.

If @file is on a removable filesystem, the media art file will be saved in a
cache on the removable file system rather than on the host machine.</doc>
      <return-value transfer-ownership="none">
        <doc xml:space="preserve">#TRUE if the file could be processed.</doc>
        <type name="gboolean" c:type="gboolean"/>
      </return-value>
      <parameters>
        <parameter name="buffer" transfer-ownership="none" allow-none="1">
          <doc xml:space="preserve">a buffer containing @file data, or %NULL</doc>
          <array length="1" zero-terminated="0" c:type="guchar*">
            <type name="guint8" c:type="guchar"/>
          </array>
        </parameter>
        <parameter name="len" transfer-ownership="none">
          <doc xml:space="preserve">length of @buffer, or 0</doc>
          <type name="gsize" c:type="gsize"/>
        </parameter>
        <parameter name="mime" transfer-ownership="none">
          <doc xml:space="preserve">MIME type of @buffer, or %NULL</doc>
          <type name="utf8" c:type="const gchar*"/>
        </parameter>
        <parameter name="type" transfer-ownership="none">
          <doc xml:space="preserve">The type of media</doc>
          <type name="Type" c:type="MediaArtType"/>
        </parameter>
        <parameter name="artist" transfer-ownership="none">
          <doc xml:space="preserve">The media file artist name, or %NULL</doc>
          <type name="utf8" c:type="const gchar*"/>
        </parameter>
        <parameter name="title" transfer-ownership="none">
          <doc xml:space="preserve">The media file title, or %NULL</doc>
          <type name="utf8" c:type="const gchar*"/>
        </parameter>
        <parameter name="file" transfer-ownership="none">
          <doc xml:space="preserve">File to be processed</doc>
          <type name="Gio.File" c:type="GFile*"/>
        </parameter>
      </parameters>
    </function>
    <function name="remove" c:identifier="media_art_remove" version="0.2.0">
      <doc xml:space="preserve">Removes media art for given album/artist/etc provided.</doc>
      <return-value transfer-ownership="none">
        <doc xml:space="preserve">#TRUE on success, otherwise #FALSE.</doc>
        <type name="gboolean" c:type="gboolean"/>
      </return-value>
      <parameters>
        <parameter name="artist" transfer-ownership="none">
          <doc xml:space="preserve">artist the media art belongs to</doc>
          <type name="utf8" c:type="const gchar*"/>
        </parameter>
        <parameter name="album" transfer-ownership="none" allow-none="1">
          <doc xml:space="preserve">album the media art belongs or %NULL</doc>
          <type name="utf8" c:type="const gchar*"/>
        </parameter>
      </parameters>
    </function>
    <function name="shutdown"
              c:identifier="media_art_shutdown"
              version="0.2.0">
      <doc xml:space="preserve">Clean up and free the resources created and mentioned in media_art_init().</doc>
      <return-value transfer-ownership="none">
        <type name="none" c:type="void"/>
      </return-value>
    </function>
    <function name="strip_invalid_entities"
              c:identifier="media_art_strip_invalid_entities"
              version="0.2.0">
      <doc xml:space="preserve">Strip a albumname or artistname string to prepare it for calculating the
media art path with it. Certain characters and charactersets will be stripped
and a newly allocated string returned which you must free with g_free().

This functions is used internally by media_art_get_file() and
media_art_get_path(). You will not normally need to call it yourself.</doc>
      <return-value transfer-ownership="full">
        <doc xml:space="preserve">copy of original but then stripped</doc>
        <type name="utf8" c:type="gchar*"/>
      </return-value>
      <parameters>
        <parameter name="original" transfer-ownership="none">
          <doc xml:space="preserve">original string</doc>
          <type name="utf8" c:type="const gchar*"/>
        </parameter>
      </parameters>
    </function>
  </namespace>
</repository>
