Sophie

Sophie

distrib > Mandriva > 2011.0 > x86_64 > by-pkgid > e4e5aca55b6d7244e6bae95bf4fde3ca > files > 283

lib64edelib-devel-2.0-1.x86_64.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>edelib: Theme Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />



</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">edelib
   &#160;<span id="projectnumber">2.0.0</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="namespaceedelib.html">edelib</a>      </li>
      <li class="navelem"><a class="el" href="classedelib_1_1Theme.html">Theme</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">Theme Class Reference<div class="ingroups"><a class="el" href="group__widgets.html">FLTK widgets and functions</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<!-- doxytag: class="edelib::Theme" -->
<p>Theming engine for widgets.  
 <a href="classedelib_1_1Theme.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="Theme_8h_source.html">edelib/Theme.h</a>&gt;</code></p>

<p><a href="classedelib_1_1Theme-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classedelib_1_1Theme.html#a97ed3ed2b1cefd44b66dcf48b4649912">Theme</a> (const char *msg_domain=&quot;edelib&quot;)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classedelib_1_1Theme.html#a3784292775796cdaee95312b85675555">~Theme</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classedelib_1_1Theme.html#ae5154c28e02a4d72a8b9668f794b1a8e">load</a> (const char *f)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classedelib_1_1Theme.html#ae683fe63c33c388e9ba1c6392dd477eb">clear</a> (void)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classedelib_1_1Theme.html#a9a1d3998c0a3c1d42b7613463c7a7571">loaded</a> (void) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classedelib_1_1Theme.html#ad5f09d98ee57cc2141bc045516f9aa43">set_error_handler</a> (ThemeErrorHandler func, void *data=0)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classedelib_1_1Theme.html#aeae0361a895673fd6d5db3e8d952b50c">error_handler_data</a> (void) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">ThemeErrorHandler&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classedelib_1_1Theme.html#aee6506c558d43bf24f4ed84764ddbc69">error_handler</a> (void) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classedelib_1_1Theme.html#acb99be969a83b88957b842df172b62d2">prompt</a> (void)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classedelib_1_1Theme.html#ace70b5db744d833cd6be715770746086">get_item</a> (const char *style_name, const char *item_name, char *ret, unsigned int sz)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classedelib_1_1Theme.html#adc690bbe374044b913a974747ea1293d">get_item</a> (const char *style_name, const char *item_name, long &amp;ret, long fallback=0)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classedelib_1_1Theme.html#a2be24806b3dd19de5b3da301d63b7ad2">author</a> (void) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classedelib_1_1Theme.html#ada0f8ac2b219cc8a90659c3be9e3bf92">name</a> (void) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classedelib_1_1Theme.html#a770c8ec195396f1f535742a185823503">sample_image</a> (void) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">scheme *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classedelib_1_1Theme.html#a2beeabed1cfa7df6c70509a22186ee3b">get_interpreter</a> (void)</td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Theming engine for widgets. </p>
<p><a class="el" href="classedelib_1_1Theme.html" title="Theming engine for widgets.">Theme</a> class implements abastract theming engine suitable for FLTK and edelib widgets. Unlike <a class="el" href="classedelib_1_1Config.html" title="A config file reader.">Config</a> or <a class="el" href="classedelib_1_1Resource.html" title="Resource loader and saver.">Resource</a>, theme engine implements full language to load and parse theme files giving huge flexibility to represent the final visual appearance and behaviour.</p>
<p>This class should not be used directly to load themes; <a class="el" href="classedelib_1_1ThemeLoader.html" title="Themes loader.">ThemeLoader</a> should be used for that. </p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a97ed3ed2b1cefd44b66dcf48b4649912"></a><!-- doxytag: member="edelib::Theme::Theme" ref="a97ed3ed2b1cefd44b66dcf48b4649912" args="(const char *msg_domain=&quot;edelib&quot;)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classedelib_1_1Theme.html">Theme</a> </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>msg_domain</em> = <code>&quot;edelib&quot;</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Constructor. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">msg_domain</td><td>is used for translatable strings and should be set to application name that uses <a class="el" href="classedelib_1_1Theme.html" title="Theming engine for widgets.">Theme</a> class. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a3784292775796cdaee95312b85675555"></a><!-- doxytag: member="edelib::Theme::~Theme" ref="a3784292775796cdaee95312b85675555" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">~<a class="el" href="classedelib_1_1Theme.html">Theme</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Destructor. </p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a2be24806b3dd19de5b3da301d63b7ad2"></a><!-- doxytag: member="edelib::Theme::author" ref="a2be24806b3dd19de5b3da301d63b7ad2" args="(void) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const char* <a class="el" href="classedelib_1_1Theme.html#a2be24806b3dd19de5b3da301d63b7ad2">author</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Return author entry. </p>

</div>
</div>
<a class="anchor" id="ae683fe63c33c388e9ba1c6392dd477eb"></a><!-- doxytag: member="edelib::Theme::clear" ref="ae683fe63c33c388e9ba1c6392dd477eb" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classedelib_1_1Theme.html#ae683fe63c33c388e9ba1c6392dd477eb">clear</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Deinitialize interpreter and clears internal data. </p>

</div>
</div>
<a class="anchor" id="aee6506c558d43bf24f4ed84764ddbc69"></a><!-- doxytag: member="edelib::Theme::error_handler" ref="aee6506c558d43bf24f4ed84764ddbc69" args="(void) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ThemeErrorHandler <a class="el" href="classedelib_1_1Theme.html#aee6506c558d43bf24f4ed84764ddbc69">error_handler</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Return error handler or NULL if not set. </p>

</div>
</div>
<a class="anchor" id="aeae0361a895673fd6d5db3e8d952b50c"></a><!-- doxytag: member="edelib::Theme::error_handler_data" ref="aeae0361a895673fd6d5db3e8d952b50c" args="(void) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* <a class="el" href="classedelib_1_1Theme.html#aeae0361a895673fd6d5db3e8d952b50c">error_handler_data</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Return error handler data. </p>

</div>
</div>
<a class="anchor" id="a2beeabed1cfa7df6c70509a22186ee3b"></a><!-- doxytag: member="edelib::Theme::get_interpreter" ref="a2beeabed1cfa7df6c70509a22186ee3b" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">scheme* <a class="el" href="classedelib_1_1Theme.html#a2beeabed1cfa7df6c70509a22186ee3b">get_interpreter</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Return interpreter instance and can return NULL if theme isn't loaded successfully. This function makes sense only if you loaded some theme. </p>

</div>
</div>
<a class="anchor" id="ace70b5db744d833cd6be715770746086"></a><!-- doxytag: member="edelib::Theme::get_item" ref="ace70b5db744d833cd6be715770746086" args="(const char *style_name, const char *item_name, char *ret, unsigned int sz)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classedelib_1_1Theme.html#ace70b5db744d833cd6be715770746086">get_item</a> </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>style_name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>item_name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>ret</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>sz</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Get C string item from theme using <em>style_name</em> style. Item will be stored in <em>ret</em> using no more than <em>sz</em> bytes. Return true if found and <em>ret</em> was set. </p>

</div>
</div>
<a class="anchor" id="adc690bbe374044b913a974747ea1293d"></a><!-- doxytag: member="edelib::Theme::get_item" ref="adc690bbe374044b913a974747ea1293d" args="(const char *style_name, const char *item_name, long &amp;ret, long fallback=0)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classedelib_1_1Theme.html#ace70b5db744d833cd6be715770746086">get_item</a> </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>style_name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>item_name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long &amp;&#160;</td>
          <td class="paramname"><em>ret</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>fallback</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Get long item from theme using <em>style_name</em> style. If given item wasn't found, the function will return false and <em>ret</em> will have <em>fallback</em> value. Otherwise, <em>ret</em> will have value associated with <em>item_name</em>. </p>

</div>
</div>
<a class="anchor" id="ae5154c28e02a4d72a8b9668f794b1a8e"></a><!-- doxytag: member="edelib::Theme::load" ref="ae5154c28e02a4d72a8b9668f794b1a8e" args="(const char *f)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classedelib_1_1Theme.html#ae5154c28e02a4d72a8b9668f794b1a8e">load</a> </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>f</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Load and parse theme from given file. If fails returns false. </p>

</div>
</div>
<a class="anchor" id="a9a1d3998c0a3c1d42b7613463c7a7571"></a><!-- doxytag: member="edelib::Theme::loaded" ref="a9a1d3998c0a3c1d42b7613463c7a7571" args="(void) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classedelib_1_1Theme.html#a9a1d3998c0a3c1d42b7613463c7a7571">loaded</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Return true if theme loaded successfully. </p>

</div>
</div>
<a class="anchor" id="ada0f8ac2b219cc8a90659c3be9e3bf92"></a><!-- doxytag: member="edelib::Theme::name" ref="ada0f8ac2b219cc8a90659c3be9e3bf92" args="(void) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const char* <a class="el" href="classedelib_1_1Theme.html#ada0f8ac2b219cc8a90659c3be9e3bf92">name</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Return theme name. </p>

</div>
</div>
<a class="anchor" id="acb99be969a83b88957b842df172b62d2"></a><!-- doxytag: member="edelib::Theme::prompt" ref="acb99be969a83b88957b842df172b62d2" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classedelib_1_1Theme.html#acb99be969a83b88957b842df172b62d2">prompt</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Show prompt and wait for input. This function is intended to be called from console progams, as it will wait intfinitely for user input, where scheme/theme expressions could be evaluated.</p>
<p>This function is mostly for writing external tools for easier debugging. </p>

</div>
</div>
<a class="anchor" id="a770c8ec195396f1f535742a185823503"></a><!-- doxytag: member="edelib::Theme::sample_image" ref="a770c8ec195396f1f535742a185823503" args="(void) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const char* <a class="el" href="classedelib_1_1Theme.html#a770c8ec195396f1f535742a185823503">sample_image</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Return name of theme example image. </p>

</div>
</div>
<a class="anchor" id="ad5f09d98ee57cc2141bc045516f9aa43"></a><!-- doxytag: member="edelib::Theme::set_error_handler" ref="ad5f09d98ee57cc2141bc045516f9aa43" args="(ThemeErrorHandler func, void *data=0)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classedelib_1_1Theme.html#ad5f09d98ee57cc2141bc045516f9aa43">set_error_handler</a> </td>
          <td>(</td>
          <td class="paramtype">ThemeErrorHandler&#160;</td>
          <td class="paramname"><em>func</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>data</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Install error handler that will be called when error occured during reading/parsing phase. Handler should be installed before <em><a class="el" href="classedelib_1_1Theme.html#ae5154c28e02a4d72a8b9668f794b1a8e">load()</a></em> call. When <em><a class="el" href="classedelib_1_1Theme.html#ae5154c28e02a4d72a8b9668f794b1a8e">load()</a></em> completes and return status, handler function will not be called any more, so all collected errors could be displayed or processed further. </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>edelib/<a class="el" href="Theme_8h_source.html">Theme.h</a></li>
</ul>
</div><!-- contents -->


<hr class="footer"/><address class="footer"><small>
Generated on Tue Jun 5 2012 17:49:03 for edelib by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>