Sophie

Sophie

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

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: IconLoader 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_1IconLoader.html">IconLoader</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-static-methods">Static Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">IconLoader Class Reference</div>  </div>
</div><!--header-->
<div class="contents">
<!-- doxytag: class="edelib::IconLoader" -->
<p>Loads icons with <a class="el" href="classedelib_1_1IconTheme.html" title="Finds named icon according to the given theme.">IconTheme</a>.  
 <a href="classedelib_1_1IconLoader.html#details">More...</a></p>

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

<p><a href="classedelib_1_1IconLoader-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classedelib_1_1IconLoader.html#ae6a1fc1a85786c2a08ad1756dffd369f">init</a> (const char *<a class="el" href="classedelib_1_1IconLoader.html#aa733c54ee6fa59164ba9a0cf9bf401c7">theme</a>)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classedelib_1_1IconLoader.html#a17fb021b480a1f220d2579807fa2e398">init</a> (void)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classedelib_1_1IconLoader.html#af80085e2fde103b0fcdf58fcab027e47">shutdown</a> (void)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classedelib_1_1IconLoader.html#aef8e66f9d814646031d9b64730b7ba9a">inited</a> (void)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classedelib_1_1IconLoader.html#a8d87dbfe02906e010d04aa146b59c76a">reload</a> (const char *<a class="el" href="classedelib_1_1IconLoader.html#aa733c54ee6fa59164ba9a0cf9bf401c7">theme</a>)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classedelib_1_1IconLoader.html#a475d32a51dfe395709bfe22645ad48dd">repoll</a> (void)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static Fl_Shared_Image *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classedelib_1_1IconLoader.html#a9157a4694511492f70bf4d16a6be8ff0">get</a> (const char *name, <a class="el" href="namespaceedelib.html#aeb27e3dfb8d94ad24899ae092f5d00a0">IconSizes</a> sz, <a class="el" href="namespaceedelib.html#ae2d9595634d229a9d997209ae87f5e39">IconContext</a> ctx=<a class="el" href="namespaceedelib.html#ae2d9595634d229a9d997209ae87f5e39a775fab20e90387345fe41cbca4b203fc">ICON_CONTEXT_ANY</a>, unsigned long options=0)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classedelib_1_1String.html">String</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classedelib_1_1IconLoader.html#a1af868157773ecee51760a064baefb47">get_path</a> (const char *name, <a class="el" href="namespaceedelib.html#aeb27e3dfb8d94ad24899ae092f5d00a0">IconSizes</a> sz, <a class="el" href="namespaceedelib.html#ae2d9595634d229a9d997209ae87f5e39">IconContext</a> ctx=<a class="el" href="namespaceedelib.html#ae2d9595634d229a9d997209ae87f5e39a775fab20e90387345fe41cbca4b203fc">ICON_CONTEXT_ANY</a>)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classedelib_1_1IconLoader.html#a2232e9af315b5d62e861a2c6001a9004">set</a> (Fl_Widget *widget, const char *name, <a class="el" href="namespaceedelib.html#aeb27e3dfb8d94ad24899ae092f5d00a0">IconSizes</a> sz, <a class="el" href="namespaceedelib.html#ae2d9595634d229a9d997209ae87f5e39">IconContext</a> ctx=<a class="el" href="namespaceedelib.html#ae2d9595634d229a9d997209ae87f5e39a775fab20e90387345fe41cbca4b203fc">ICON_CONTEXT_ANY</a>, unsigned long options=0)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static const <a class="el" href="classedelib_1_1IconTheme.html">IconTheme</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classedelib_1_1IconLoader.html#aa733c54ee6fa59164ba9a0cf9bf401c7">theme</a> (void)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classedelib_1_1IconLoader.html#ad50785e08776efd056dcac2c2cb45e91">set_fallback_icon</a> (const char *name)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classedelib_1_1IconLoader.html#af4e7a582a8edea89acb1607b7ad61213">get_fallback_icon</a> (void)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static const char **&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classedelib_1_1IconLoader.html#a71dd2f34f40fc196bf664ca73101e0be">get_builtin_xpm_icon</a> (<a class="el" href="namespaceedelib.html#aeb27e3dfb8d94ad24899ae092f5d00a0">IconSizes</a> sz)</td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Loads icons with <a class="el" href="classedelib_1_1IconTheme.html" title="Finds named icon according to the given theme.">IconTheme</a>. </p>
<p><a class="el" href="classedelib_1_1IconLoader.html" title="Loads icons with IconTheme.">IconLoader</a> will initialize icon theme via <a class="el" href="classedelib_1_1IconTheme.html" title="Finds named icon according to the given theme.">IconTheme</a> and load given icon name or display it in target widget. It will also cache common requests for faster access or utilize Fl_Shared_Image for direct access to the image object.</p>
<p>One of the main goals of <a class="el" href="classedelib_1_1IconLoader.html" title="Loads icons with IconTheme.">IconLoader</a>, besides loading icons in various ways, is to allow dinamically icon pixmaps update on widgets, when icon theme was changed. With this, application would receive a new icon pixmaps without knowing that or without needs to be restarted. To allow this, you should let <a class="el" href="classedelib_1_1IconLoader.html" title="Loads icons with IconTheme.">IconLoader</a> load and set images on widgets (described briefly bellow).</p>
<p>Icons are searched and fetched via plain icon name; that name does not contains path nor extension. Using this approach (assuming common names are used), you can easily switch between themes without changing icon names. So, to load <em>foo.png</em> you should use <em>foo</em> name.</p>
<p>Here is the sample how to correctly display icon in Fl_Button object: </p>
<div class="fragment"><pre class="fragment">  <span class="comment">// ...</span>
  <a class="code" href="classedelib_1_1IconLoader.html#a17fb021b480a1f220d2579807fa2e398">IconLoader::init</a>();
  <span class="comment">// ...</span>
  Fl_Button* button = <span class="keyword">new</span> Fl_Button(...);
  <a class="code" href="classedelib_1_1IconLoader.html#a2232e9af315b5d62e861a2c6001a9004">IconLoader::set</a>(button, <span class="stringliteral">&quot;utilities-terminal&quot;</span>, <a class="code" href="namespaceedelib.html#aeb27e3dfb8d94ad24899ae092f5d00a0a95330f42bf6694d67ae04ed7b45fa80d" title="32x32">ICON_SIZE_MEDIUM</a>);
</pre></div><p>With this, <em>utilities-terminal</em> icon with requested size will be searched, and displayed in Fl_Button widget. If this icon wasn't found, a fallback icon will be used for that (by default <em>empty</em> icon is used).</p>
<p>Also, with this, <a class="el" href="classedelib_1_1IconLoader.html" title="Loads icons with IconTheme.">IconLoader</a> will track these widgets so when icon theme was changed, they would be appropriately refreshed.</p>
<p><a class="el" href="classedelib_1_1IconLoader.html#a17fb021b480a1f220d2579807fa2e398">IconLoader::init()</a> should not be called if <a class="el" href="classedelib_1_1Window.html" title="Window class.">edelib::Window</a> class is used; it will call it automatically.</p>
<p>To dinamically change icon theme and reload loaded icons, <a class="el" href="classedelib_1_1IconLoader.html#a8d87dbfe02906e010d04aa146b59c76a">IconLoader::reload()</a> should be used. This function will correctly update icon paths and redraw widgets. When <a class="el" href="classedelib_1_1Window.html" title="Window class.">Window</a> class is used, it will automatically call <a class="el" href="classedelib_1_1IconLoader.html#a8d87dbfe02906e010d04aa146b59c76a">reload()</a> when theme was changed, so there is no need to call it manually. </p>
</div><hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a9157a4694511492f70bf4d16a6be8ff0"></a><!-- doxytag: member="edelib::IconLoader::get" ref="a9157a4694511492f70bf4d16a6be8ff0" args="(const char *name, IconSizes sz, IconContext ctx=ICON_CONTEXT_ANY, unsigned long options=0)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static Fl_Shared_Image* <a class="el" href="classedelib_1_1IconLoader.html#a9157a4694511492f70bf4d16a6be8ff0">get</a> </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="namespaceedelib.html#aeb27e3dfb8d94ad24899ae092f5d00a0">IconSizes</a>&#160;</td>
          <td class="paramname"><em>sz</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="namespaceedelib.html#ae2d9595634d229a9d997209ae87f5e39">IconContext</a>&#160;</td>
          <td class="paramname"><em>ctx</em> = <code><a class="el" href="namespaceedelib.html#ae2d9595634d229a9d997209ae87f5e39a775fab20e90387345fe41cbca4b203fc">ICON_CONTEXT_ANY</a></code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long&#160;</td>
          <td class="paramname"><em>options</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns image object by searching icon that matches name, size and context. First, it will check if <em>name</em> is absolute path to the icon (unless <em>ICON_LOADER_OPTION_NO_ABSOLUTE_PATH</em> was used in <em>options</em>) and will try to load it. If fails, it will consult icon theme.</p>
<p>Returned icon will match <em>sz</em> size; if it is larger or smaller than the loaded, it will be scalled to the given size. If <em>ICON_LOADER_OPTION_NO_ICON_SCALE</em> was set, scaling will not be done.</p>
<p>If icon wasn't found, fallback icon will be loaded. If fails, NULL will be returned. For further members of Fl_Shared_Image, see FLTK documentation.</p>
<p><em>options</em> is used to OR IconLoaderOptions values. </p>

</div>
</div>
<a class="anchor" id="a71dd2f34f40fc196bf664ca73101e0be"></a><!-- doxytag: member="edelib::IconLoader::get_builtin_xpm_icon" ref="a71dd2f34f40fc196bf664ca73101e0be" args="(IconSizes sz)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static const char** <a class="el" href="classedelib_1_1IconLoader.html#a71dd2f34f40fc196bf664ca73101e0be">get_builtin_xpm_icon</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="namespaceedelib.html#aeb27e3dfb8d94ad24899ae092f5d00a0">IconSizes</a>&#160;</td>
          <td class="paramname"><em>sz</em></td><td>)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns XPM icon with given size. These icons are always present in edelib and should be used in cases when icon is not present in icon theme, or give icon theme wasn't installed at all. </p>

</div>
</div>
<a class="anchor" id="af4e7a582a8edea89acb1607b7ad61213"></a><!-- doxytag: member="edelib::IconLoader::get_fallback_icon" ref="af4e7a582a8edea89acb1607b7ad61213" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static const char* <a class="el" href="classedelib_1_1IconLoader.html#af4e7a582a8edea89acb1607b7ad61213">get_fallback_icon</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Return the name of fallback icon. Default is <em>empty</em>. </p>

</div>
</div>
<a class="anchor" id="a1af868157773ecee51760a064baefb47"></a><!-- doxytag: member="edelib::IconLoader::get_path" ref="a1af868157773ecee51760a064baefb47" args="(const char *name, IconSizes sz, IconContext ctx=ICON_CONTEXT_ANY)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classedelib_1_1String.html">String</a> <a class="el" href="classedelib_1_1IconLoader.html#a1af868157773ecee51760a064baefb47">get_path</a> </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="namespaceedelib.html#aeb27e3dfb8d94ad24899ae092f5d00a0">IconSizes</a>&#160;</td>
          <td class="paramname"><em>sz</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="namespaceedelib.html#ae2d9595634d229a9d997209ae87f5e39">IconContext</a>&#160;</td>
          <td class="paramname"><em>ctx</em> = <code><a class="el" href="namespaceedelib.html#ae2d9595634d229a9d997209ae87f5e39a775fab20e90387345fe41cbca4b203fc">ICON_CONTEXT_ANY</a></code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns full path to given icon name. If icon wasn't found, returned string will be empty. </p>

</div>
</div>
<a class="anchor" id="ae6a1fc1a85786c2a08ad1756dffd369f"></a><!-- doxytag: member="edelib::IconLoader::init" ref="ae6a1fc1a85786c2a08ad1756dffd369f" args="(const char *theme)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static void <a class="el" href="classedelib_1_1IconLoader.html#ae6a1fc1a85786c2a08ad1756dffd369f">init</a> </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>theme</em></td><td>)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Initialize loader code and load given theme name. This function <em>must</em> be called before further calls </p>

</div>
</div>
<a class="anchor" id="a17fb021b480a1f220d2579807fa2e398"></a><!-- doxytag: member="edelib::IconLoader::init" ref="a17fb021b480a1f220d2579807fa2e398" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static void <a class="el" href="classedelib_1_1IconLoader.html#ae6a1fc1a85786c2a08ad1756dffd369f">init</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Initialize loader code using default theme name (</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classedelib_1_1IconTheme.html#ad92c449d20dcc3b5b96f367ab1aaf5e1">IconTheme::default_theme_name()</a>) </dd></dl>

</div>
</div>
<a class="anchor" id="aef8e66f9d814646031d9b64730b7ba9a"></a><!-- doxytag: member="edelib::IconLoader::inited" ref="aef8e66f9d814646031d9b64730b7ba9a" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static bool <a class="el" href="classedelib_1_1IconLoader.html#aef8e66f9d814646031d9b64730b7ba9a">inited</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Check if data was loaded </p>

</div>
</div>
<a class="anchor" id="a8d87dbfe02906e010d04aa146b59c76a"></a><!-- doxytag: member="edelib::IconLoader::reload" ref="a8d87dbfe02906e010d04aa146b59c76a" args="(const char *theme)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static void <a class="el" href="classedelib_1_1IconLoader.html#a8d87dbfe02906e010d04aa146b59c76a">reload</a> </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>theme</em></td><td>)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Reload <a class="el" href="classedelib_1_1IconLoader.html" title="Loads icons with IconTheme.">IconLoader</a> with the new theme. This function is preferred to load another theme than <a class="el" href="classedelib_1_1IconLoader.html#af80085e2fde103b0fcdf58fcab027e47">shutdown()</a>/init() combination, since it will not clear all internal data.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>This function should not be used when <a class="el" href="classedelib_1_1Window.html" title="Window class.">edelib::Window</a> is used for window construcion; <a class="el" href="classedelib_1_1Window.html" title="Window class.">edelib::Window</a> tracks icon theme changes via XSETTINGS protocol and when needed, it will call this function. Manually calling it (but <a class="el" href="classedelib_1_1Window.html" title="Window class.">edelib::Window</a> is used), will change icon theme but XSETTINGS data will not be synced, yielding different themes in edelib and XSETTINGS aware toolkits (like Gtk+). </dd></dl>

</div>
</div>
<a class="anchor" id="a475d32a51dfe395709bfe22645ad48dd"></a><!-- doxytag: member="edelib::IconLoader::repoll" ref="a475d32a51dfe395709bfe22645ad48dd" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static void <a class="el" href="classedelib_1_1IconLoader.html#a475d32a51dfe395709bfe22645ad48dd">repoll</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Refresh internal cached icon paths. This function should be used in conjuction with <a class="el" href="classedelib_1_1IconLoader.html#a2232e9af315b5d62e861a2c6001a9004">set()</a> or <a class="el" href="classedelib_1_1IconLoader.html#a9157a4694511492f70bf4d16a6be8ff0">get()</a> functions. Since <a class="el" href="classedelib_1_1IconLoader.html" title="Loads icons with IconTheme.">IconLoader</a> can't dinamically track life of image objects or widget objects it will not be able to clear cached paths when these get destroyed. Paths are needed to be kept in case when icon theme was changed during program execution.</p>
<p>This function should be used when there are large number of <a class="el" href="classedelib_1_1IconLoader.html#a2232e9af315b5d62e861a2c6001a9004">set()</a>/get() and where widgets gets destroyed in the short period of time. If this wasn't used, internal cache would grow needlessly. </p>

</div>
</div>
<a class="anchor" id="a2232e9af315b5d62e861a2c6001a9004"></a><!-- doxytag: member="edelib::IconLoader::set" ref="a2232e9af315b5d62e861a2c6001a9004" args="(Fl_Widget *widget, const char *name, IconSizes sz, IconContext ctx=ICON_CONTEXT_ANY, unsigned long options=0)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static bool <a class="el" href="classedelib_1_1IconLoader.html#a2232e9af315b5d62e861a2c6001a9004">set</a> </td>
          <td>(</td>
          <td class="paramtype">Fl_Widget *&#160;</td>
          <td class="paramname"><em>widget</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="namespaceedelib.html#aeb27e3dfb8d94ad24899ae092f5d00a0">IconSizes</a>&#160;</td>
          <td class="paramname"><em>sz</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="namespaceedelib.html#ae2d9595634d229a9d997209ae87f5e39">IconContext</a>&#160;</td>
          <td class="paramname"><em>ctx</em> = <code><a class="el" href="namespaceedelib.html#ae2d9595634d229a9d997209ae87f5e39a775fab20e90387345fe41cbca4b203fc">ICON_CONTEXT_ANY</a></code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long&#160;</td>
          <td class="paramname"><em>options</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Load given icon and set widget to use it (it will call widget's image() function for that). This is the function you should use to set icon inside the widget, because it allows dynamic refreshing when icon theme was changed by redrawing the widget.</p>
<p>It will try to load icon the sam way as <a class="el" href="classedelib_1_1IconLoader.html#a9157a4694511492f70bf4d16a6be8ff0">get()</a> does: first it will check if <em>name</em> is absolute path then will go in icon theme. If this fails, it will try to load fallback icon and if succeeded (in one of the cases), it will redraw the widget (unless <em>ICON_LOADER_OPTION_NO_WIDGET_REDRAW</em> was OR-ed in <em>options</em>).</p>
<p>To retrieve the image object of set image, you can use image() function from given widget object. </p>

</div>
</div>
<a class="anchor" id="ad50785e08776efd056dcac2c2cb45e91"></a><!-- doxytag: member="edelib::IconLoader::set_fallback_icon" ref="ad50785e08776efd056dcac2c2cb45e91" args="(const char *name)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static void <a class="el" href="classedelib_1_1IconLoader.html#ad50785e08776efd056dcac2c2cb45e91">set_fallback_icon</a> </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em></td><td>)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Set fallback icon name. This name will be used to search alternative icon in icon theme when the target one wasn't found. Defauly fallback icon is <em>empty</em>.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>icon name will not be copied so make sure to have given string in static memory </dd></dl>

</div>
</div>
<a class="anchor" id="af80085e2fde103b0fcdf58fcab027e47"></a><!-- doxytag: member="edelib::IconLoader::shutdown" ref="af80085e2fde103b0fcdf58fcab027e47" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static void <a class="el" href="classedelib_1_1IconLoader.html#af80085e2fde103b0fcdf58fcab027e47">shutdown</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Shutdowns loader by cleaning internal data. Call <a class="el" href="classedelib_1_1IconLoader.html#a17fb021b480a1f220d2579807fa2e398">init()</a> to load it again </p>

</div>
</div>
<a class="anchor" id="aa733c54ee6fa59164ba9a0cf9bf401c7"></a><!-- doxytag: member="edelib::IconLoader::theme" ref="aa733c54ee6fa59164ba9a0cf9bf401c7" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static const <a class="el" href="classedelib_1_1IconTheme.html">IconTheme</a>* <a class="el" href="classedelib_1_1IconLoader.html#aa733c54ee6fa59164ba9a0cf9bf401c7">theme</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns <a class="el" href="classedelib_1_1IconTheme.html" title="Finds named icon according to the given theme.">IconTheme</a> object. </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>edelib/<a class="el" href="IconLoader_8h_source.html">IconLoader.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>