Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 73fe4a00047f4da05ba0ab78e4256829 > files > 158

libwmf-devel-0.2.8.4-26.fc14.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>player.c File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.2.18 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Data Structures</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Data Fields</a> &nbsp; <a class="qindex" href="globals.html">Globals</a> &nbsp; </center>
<hr><h1>player.c File Reference</h1><table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td nowrap align=right valign=top><a class="el" href="types_8h.html#a5">wmf_error_t</a>&nbsp;</td><td valign=bottom><a class="el" href="player_8c.html#a0">wmf_player_init</a> (<a class="el" href="types_8h.html#a22">wmfAPI</a> *API)</td></tr>
<tr><td nowrap align=right valign=top><a class="el" href="types_8h.html#a5">wmf_error_t</a>&nbsp;</td><td valign=bottom><a class="el" href="player_8c.html#a1">wmf_scan</a> (<a class="el" href="types_8h.html#a22">wmfAPI</a> *API, unsigned long flags, <a class="el" href="types_8h.html#a15">wmfD_Rect</a> *d_r)</td></tr>
<tr><td nowrap align=right valign=top><a class="el" href="types_8h.html#a5">wmf_error_t</a>&nbsp;</td><td valign=bottom><a class="el" href="player_8c.html#a2">wmf_size</a> (<a class="el" href="types_8h.html#a22">wmfAPI</a> *API, float *width, float *height)</td></tr>
<tr><td nowrap align=right valign=top><a class="el" href="types_8h.html#a5">wmf_error_t</a>&nbsp;</td><td valign=bottom><a class="el" href="player_8c.html#a3">wmf_display_size</a> (<a class="el" href="types_8h.html#a22">wmfAPI</a> *API, unsigned int *width, unsigned int *height, double res_x, double res_y)</td></tr>
<tr><td nowrap align=right valign=top><a class="el" href="types_8h.html#a5">wmf_error_t</a>&nbsp;</td><td valign=bottom><a class="el" href="player_8c.html#a4">wmf_play</a> (<a class="el" href="types_8h.html#a22">wmfAPI</a> *API, unsigned long flags, <a class="el" href="types_8h.html#a15">wmfD_Rect</a> *d_r)</td></tr>
</table>
<hr><h2>Function Documentation</h2>
<a name="a3" doxytag="player.c::wmf_display_size"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="types_8h.html#a5">wmf_error_t</a> wmf_display_size </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="types_8h.html#a22">wmfAPI</a> *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>API</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>unsigned int *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>width</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>unsigned int *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>height</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>double&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>res_x</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>double&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>res_y</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Get estimate of image display size.<dl compact><dt><b>Parameters: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>API</em>&nbsp;</td><td>
the API handle </td></tr>
<tr><td valign=top><em>width</em>&nbsp;</td><td>
width return </td></tr>
<tr><td valign=top><em>height</em>&nbsp;</td><td>
height return </td></tr>
<tr><td valign=top><em>res_x</em>&nbsp;</td><td>
x-resolution of display </td></tr>
<tr><td valign=top><em>res_y</em>&nbsp;</td><td>
y-resolution of display</td></tr>
</table>
</dl><a class="el" href="player_8c.html#a3">wmf_display_size()</a> returns image width in <code>*width</code> and image height in <code>*height</code>. <a class="el" href="player_8c.html#a2">wmf_size()</a> is used to get the calculated/estimate width and height of the image, and these values are converted to integer width and height estimates for display.
<p>
<dl compact><dt><b>Returns: </b></dt><dd>
Returns the library error state (<b>wmf_E_None</b> on success). Possible library error state of <b>wmf_E_Glitch</b> (the metafile has not been scanned). </dl>    </td>
  </tr>
</table>
<a name="a4" doxytag="player.c::wmf_play"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="types_8h.html#a5">wmf_error_t</a> wmf_play </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="types_8h.html#a22">wmfAPI</a> *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>API</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>unsigned long&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>flags</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="types_8h.html#a15">wmfD_Rect</a> *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>d_r</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Play the metafile.<dl compact><dt><b>Parameters: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>API</em>&nbsp;</td><td>
the API handle </td></tr>
<tr><td valign=top><em>flags</em>&nbsp;</td><td>
(unused) </td></tr>
<tr><td valign=top><em>d_r</em>&nbsp;</td><td>
for bounding-box return</td></tr>
</table>
</dl>Before the metafile can be played, it must be scanned - see <a class="el" href="player_8c.html#a1">wmf_scan()</a>.
<p>
The first time (and only the first time) the metafile is played, it first calls <b>device_open()</b> for the device layer specified (and initialized) in <a class="el" href="api_8h.html#a22">wmf_api_create()</a>. Then, and also each subsequent time the metafile is played, it calls <b>device_begin()</b>, plays the metafile (with calls to various other device layer functions), and finally it calls <b>device_end()</b>. <b>device_close()</b> is only ever called via <a class="el" href="api_8h.html#a23">wmf_api_destroy()</a>.
<p>
<code>d_r</code> is recomputed, but should not change.
<p>
<dl compact><dt><b>Returns: </b></dt><dd>
Returns the library error state (<b>wmf_E_None</b> on success). </dl>    </td>
  </tr>
</table>
<a name="a0" doxytag="player.c::wmf_player_init"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="types_8h.html#a5">wmf_error_t</a> wmf_player_init </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="types_8h.html#a22">wmfAPI</a> *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>
          <td class="md" valign="top">)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Initializes the metafile player (called by <a class="el" href="api_8h.html#a22">wmf_api_create()</a>)     </td>
  </tr>
</table>
<a name="a1" doxytag="player.c::wmf_scan"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="types_8h.html#a5">wmf_error_t</a> wmf_scan </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="types_8h.html#a22">wmfAPI</a> *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>API</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>unsigned long&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>flags</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="types_8h.html#a15">wmfD_Rect</a> *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>d_r</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Scan the metafile.<dl compact><dt><b>Parameters: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>API</em>&nbsp;</td><td>
the API handle </td></tr>
<tr><td valign=top><em>flags</em>&nbsp;</td><td>
(unused) </td></tr>
<tr><td valign=top><em>d_r</em>&nbsp;</td><td>
for bounding-box return</td></tr>
</table>
</dl>Before the metafile can be played, it must be scanned. This is because metafile headers do not always provide image size information. Although the device layer (the graphics exporter) is initialized in <a class="el" href="api_8h.html#a22">wmf_api_create()</a>, the output device is not opened until after the metafile is scanned. By scanning, therefore, the device layer can be provided on opening not only with size information but also a list of colors to expect (not including those in raster images) and of other required resources, if necessary. Finally, if scanning fails, then there's certainly no point in playing the metafile.
<p>
The bounding box, in device coordinates, is returned in <code>*d_r</code>.
<p>
<dl compact><dt><b>Returns: </b></dt><dd>
Returns the library error state (<b>wmf_E_None</b> on success). </dl>    </td>
  </tr>
</table>
<a name="a2" doxytag="player.c::wmf_size"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="types_8h.html#a5">wmf_error_t</a> wmf_size </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="types_8h.html#a22">wmfAPI</a> *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>API</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>float *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>width</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>float *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>height</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Get image size.<dl compact><dt><b>Parameters: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>API</em>&nbsp;</td><td>
the API handle </td></tr>
<tr><td valign=top><em>width</em>&nbsp;</td><td>
width return </td></tr>
<tr><td valign=top><em>height</em>&nbsp;</td><td>
height return</td></tr>
</table>
</dl><a class="el" href="player_8c.html#a2">wmf_size()</a> returns image width in <code>*width</code> and image height in <code>*height</code>. If supplied, the metafile header values are used, otherwise the width and height found by <a class="el" href="player_8c.html#a1">wmf_scan()</a> are used.
<p>
<dl compact><dt><b>Returns: </b></dt><dd>
Returns the library error state (<b>wmf_E_None</b> on success). Possible library error state of <b>wmf_E_Glitch</b> (the metafile has not been scanned). </dl>    </td>
  </tr>
</table>
<hr><address style="align: right;"><small>Generated on Tue Dec 10 19:53:51 2002 for libwmf by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 
width=110 height=53></a>1.2.18 </small></address>
</body>
</html>