<!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: edelib/IconLoader.h Source File</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  <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 Page</span></a></li> <li><a href="pages.html"><span>Related 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><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File List</span></a></li> </ul> </div> </div> <div class="header"> <div class="headertitle"> <div class="title">edelib/IconLoader.h</div> </div> </div><!--header--> <div class="contents"> <div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> <a name="l00002"></a>00002 <span class="comment"> * $Id: IconLoader.h 2929 2009-11-12 11:45:27Z karijes $</span> <a name="l00003"></a>00003 <span class="comment"> *</span> <a name="l00004"></a>00004 <span class="comment"> * Icon loader via IconTheme</span> <a name="l00005"></a>00005 <span class="comment"> * Copyright (c) 2009 edelib authors</span> <a name="l00006"></a>00006 <span class="comment"> *</span> <a name="l00007"></a>00007 <span class="comment"> * This library is free software; you can redistribute it and/or</span> <a name="l00008"></a>00008 <span class="comment"> * modify it under the terms of the GNU Lesser General Public</span> <a name="l00009"></a>00009 <span class="comment"> * License as published by the Free Software Foundation; either</span> <a name="l00010"></a>00010 <span class="comment"> * version 2 of the License, or (at your option) any later version.</span> <a name="l00011"></a>00011 <span class="comment"> *</span> <a name="l00012"></a>00012 <span class="comment"> * This library is distributed in the hope that it will be useful,</span> <a name="l00013"></a>00013 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span> <a name="l00014"></a>00014 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span> <a name="l00015"></a>00015 <span class="comment"> * Lesser General Public License for more details.</span> <a name="l00016"></a>00016 <span class="comment"> *</span> <a name="l00017"></a>00017 <span class="comment"> * You should have received a copy of the GNU Lesser General Public License</span> <a name="l00018"></a>00018 <span class="comment"> * along with this library. If not, see <http://www.gnu.org/licenses/>.</span> <a name="l00019"></a>00019 <span class="comment"> */</span> <a name="l00020"></a>00020 <a name="l00021"></a>00021 <span class="preprocessor">#ifndef __EDELIB_ICONLOADER_H__</span> <a name="l00022"></a>00022 <span class="preprocessor"></span><span class="preprocessor">#define __EDELIB_ICONLOADER_H__</span> <a name="l00023"></a>00023 <span class="preprocessor"></span> <a name="l00024"></a>00024 <span class="preprocessor">#include "IconTheme.h"</span> <a name="l00025"></a>00025 <a name="l00026"></a>00026 <span class="keyword">class </span>Fl_Shared_Image; <a name="l00027"></a>00027 <span class="keyword">class </span>Fl_Widget; <a name="l00028"></a>00028 <a name="l00029"></a>00029 EDELIB_NS_BEGIN <a name="l00030"></a>00030 <a name="l00031"></a>00031 <span class="keyword">class </span>IconLoaderItem; <a name="l00032"></a>00032 <a name="l00039"></a><a class="code" href="namespaceedelib.html#a90b7d37aa8c1fd756f7a90718df42957">00039</a> <span class="keyword">enum</span> <a class="code" href="namespaceedelib.html#a90b7d37aa8c1fd756f7a90718df42957" title="Settable options for IconLoader functions.">IconLoaderOptions</a> { <a name="l00040"></a><a class="code" href="namespaceedelib.html#a90b7d37aa8c1fd756f7a90718df42957aba1980b96b21e424f1e9d38ea71e4798">00040</a> <a class="code" href="namespaceedelib.html#a90b7d37aa8c1fd756f7a90718df42957aba1980b96b21e424f1e9d38ea71e4798" title="do not see given the path as absolute icon path">ICON_LOADER_OPTION_NO_ABSOLUTE_PATH</a> = (1 << 1), <a name="l00041"></a><a class="code" href="namespaceedelib.html#a90b7d37aa8c1fd756f7a90718df42957add04a27cb61d996d52943d690316c6e3">00041</a> ICON_LOADER_OPTION_NO_WIDGET_REDRAW = (1 << 2), <a name="l00042"></a><a class="code" href="namespaceedelib.html#a90b7d37aa8c1fd756f7a90718df42957a53bc4070331c9c43ddc045d0d4276c87">00042</a> <a class="code" href="namespaceedelib.html#a90b7d37aa8c1fd756f7a90718df42957a53bc4070331c9c43ddc045d0d4276c87" title="do not scale icon">ICON_LOADER_OPTION_NO_ICON_SCALE</a> = (1 << 3) <a name="l00043"></a>00043 }; <a name="l00044"></a>00044 <a name="l00084"></a><a class="code" href="classedelib_1_1IconLoader.html">00084</a> <span class="keyword">class </span><a class="code" href="classedelib_1_1IconLoader.html" title="Loads icons with IconTheme.">IconLoader</a> { <a name="l00085"></a>00085 <span class="keyword">private</span>: <a name="l00086"></a>00086 <span class="keyword">static</span> <a class="code" href="classedelib_1_1IconLoader.html" title="Loads icons with IconTheme.">IconLoader</a>* pinstance; <a name="l00087"></a>00087 <a name="l00088"></a>00088 <a class="code" href="classedelib_1_1list.html">list<IconLoaderItem*></a> items; <a name="l00089"></a>00089 <a class="code" href="classedelib_1_1IconTheme.html" title="Finds named icon according to the given theme.">IconTheme</a>* curr_theme; <a name="l00090"></a>00090 <a name="l00091"></a>00091 <a class="code" href="classedelib_1_1IconLoader.html" title="Loads icons with IconTheme.">IconLoader</a>(); <a name="l00092"></a>00092 ~<a class="code" href="classedelib_1_1IconLoader.html" title="Loads icons with IconTheme.">IconLoader</a>(); <a name="l00093"></a>00093 <a class="code" href="classedelib_1_1IconLoader.html" title="Loads icons with IconTheme.">IconLoader</a>(<span class="keyword">const</span> <a class="code" href="classedelib_1_1IconLoader.html" title="Loads icons with IconTheme.">IconLoader</a>&); <a name="l00094"></a>00094 <a class="code" href="classedelib_1_1IconLoader.html" title="Loads icons with IconTheme.">IconLoader</a>& operator=(<span class="keyword">const</span> <a class="code" href="classedelib_1_1IconLoader.html" title="Loads icons with IconTheme.">IconLoader</a>&); <a name="l00095"></a>00095 <a name="l00096"></a>00096 <span class="keywordtype">void</span> clear_items(<span class="keywordtype">void</span>); <a name="l00097"></a>00097 <span class="keyword">public</span>: <a name="l00098"></a>00098 <span class="preprocessor">#ifndef SKIP_DOCS</span> <a name="l00099"></a>00099 <span class="preprocessor"></span> <span class="keyword">const</span> <span class="keywordtype">char</span>* get_icon_path(<span class="keyword">const</span> <span class="keywordtype">char</span>* name, <a class="code" href="namespaceedelib.html#aeb27e3dfb8d94ad24899ae092f5d00a0" title="Icon sizes to look for.">IconSizes</a> sz, <a class="code" href="namespaceedelib.html#ae2d9595634d229a9d997209ae87f5e39" title="Icon types to look for.">IconContext</a> ctx); <a name="l00100"></a>00100 Fl_Shared_Image* get_icon(<span class="keyword">const</span> <span class="keywordtype">char</span>* name, <a class="code" href="namespaceedelib.html#aeb27e3dfb8d94ad24899ae092f5d00a0" title="Icon sizes to look for.">IconSizes</a> sz, <a class="code" href="namespaceedelib.html#ae2d9595634d229a9d997209ae87f5e39" title="Icon types to look for.">IconContext</a> ctx, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> options); <a name="l00101"></a>00101 <span class="keywordtype">bool</span> set_icon(<span class="keyword">const</span> <span class="keywordtype">char</span>* name, Fl_Widget* widget, <a class="code" href="namespaceedelib.html#aeb27e3dfb8d94ad24899ae092f5d00a0" title="Icon sizes to look for.">IconSizes</a> sz, <a class="code" href="namespaceedelib.html#ae2d9595634d229a9d997209ae87f5e39" title="Icon types to look for.">IconContext</a> ctx, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> options); <a name="l00102"></a>00102 <span class="keywordtype">void</span> load_theme(<span class="keyword">const</span> <span class="keywordtype">char</span>* name); <a name="l00103"></a>00103 <span class="keywordtype">void</span> reload_icons(<span class="keywordtype">void</span>); <a name="l00104"></a>00104 <span class="keywordtype">void</span> repoll_icons(<span class="keywordtype">void</span>); <a name="l00105"></a>00105 <span class="keyword">const</span> <a class="code" href="classedelib_1_1IconTheme.html" title="Finds named icon according to the given theme.">IconTheme</a>* current_theme(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> curr_theme; } <a name="l00106"></a>00106 <a name="l00107"></a>00107 <span class="keyword">static</span> <a class="code" href="classedelib_1_1IconLoader.html" title="Loads icons with IconTheme.">IconLoader</a>* instance(); <a name="l00108"></a>00108 <span class="preprocessor">#endif</span> <a name="l00109"></a>00109 <span class="preprocessor"></span> <a name="l00114"></a>00114 <span class="keyword">static</span> <span class="keywordtype">void</span> init(<span class="keyword">const</span> <span class="keywordtype">char</span>* theme); <a name="l00115"></a>00115 <a name="l00119"></a><a class="code" href="classedelib_1_1IconLoader.html#a17fb021b480a1f220d2579807fa2e398">00119</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classedelib_1_1IconLoader.html#a17fb021b480a1f220d2579807fa2e398">init</a>(<span class="keywordtype">void</span>) { IconLoader::init(IconTheme::default_theme_name()); } <a name="l00120"></a>00120 <a name="l00124"></a>00124 <span class="keyword">static</span> <span class="keywordtype">void</span> shutdown(<span class="keywordtype">void</span>); <a name="l00125"></a>00125 <a name="l00129"></a>00129 <span class="keyword">static</span> <span class="keywordtype">bool</span> inited(<span class="keywordtype">void</span>); <a name="l00130"></a>00130 <a name="l00140"></a>00140 <span class="keyword">static</span> <span class="keywordtype">void</span> reload(<span class="keyword">const</span> <span class="keywordtype">char</span>* theme); <a name="l00141"></a>00141 <a name="l00151"></a>00151 <span class="keyword">static</span> <span class="keywordtype">void</span> repoll(<span class="keywordtype">void</span>); <a name="l00152"></a>00152 <a name="l00166"></a>00166 <span class="keyword">static</span> Fl_Shared_Image* <span class="keyword">get</span>(<span class="keyword">const</span> <span class="keywordtype">char</span>* name, <a class="code" href="namespaceedelib.html#aeb27e3dfb8d94ad24899ae092f5d00a0" title="Icon sizes to look for.">IconSizes</a> sz, <a class="code" href="namespaceedelib.html#ae2d9595634d229a9d997209ae87f5e39" title="Icon types to look for.">IconContext</a> ctx = <a class="code" href="namespaceedelib.html#ae2d9595634d229a9d997209ae87f5e39a775fab20e90387345fe41cbca4b203fc" title="Can be any icon context.">ICON_CONTEXT_ANY</a>, <a name="l00167"></a>00167 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> options = 0); <a name="l00168"></a>00168 <a name="l00172"></a>00172 <span class="keyword">static</span> <a class="code" href="classedelib_1_1String.html" title="A (relatively simple) string implementation.">String</a> get_path(<span class="keyword">const</span> <span class="keywordtype">char</span>* name, <a class="code" href="namespaceedelib.html#aeb27e3dfb8d94ad24899ae092f5d00a0" title="Icon sizes to look for.">IconSizes</a> sz, <a class="code" href="namespaceedelib.html#ae2d9595634d229a9d997209ae87f5e39" title="Icon types to look for.">IconContext</a> ctx = ICON_CONTEXT_ANY); <a name="l00173"></a>00173 <a name="l00186"></a>00186 <span class="keyword">static</span> <span class="keywordtype">bool</span> <span class="keyword">set</span>(Fl_Widget* widget, <span class="keyword">const</span> <span class="keywordtype">char</span>* name, <a class="code" href="namespaceedelib.html#aeb27e3dfb8d94ad24899ae092f5d00a0" title="Icon sizes to look for.">IconSizes</a> sz, <a class="code" href="namespaceedelib.html#ae2d9595634d229a9d997209ae87f5e39" title="Icon types to look for.">IconContext</a> ctx = <a class="code" href="namespaceedelib.html#ae2d9595634d229a9d997209ae87f5e39a775fab20e90387345fe41cbca4b203fc" title="Can be any icon context.">ICON_CONTEXT_ANY</a>, <a name="l00187"></a>00187 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> options = 0); <a name="l00188"></a>00188 <a name="l00192"></a>00192 <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="classedelib_1_1IconTheme.html" title="Finds named icon according to the given theme.">IconTheme</a>* theme(<span class="keywordtype">void</span>); <a name="l00193"></a>00193 <a name="l00200"></a>00200 <span class="keyword">static</span> <span class="keywordtype">void</span> set_fallback_icon(<span class="keyword">const</span> <span class="keywordtype">char</span>* name); <a name="l00201"></a>00201 <a name="l00205"></a>00205 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* get_fallback_icon(<span class="keywordtype">void</span>); <a name="l00206"></a>00206 <a name="l00211"></a>00211 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>** get_builtin_xpm_icon(<a class="code" href="namespaceedelib.html#aeb27e3dfb8d94ad24899ae092f5d00a0" title="Icon sizes to look for.">IconSizes</a> sz); <a name="l00212"></a>00212 }; <a name="l00213"></a>00213 <a name="l00214"></a>00214 EDELIB_NS_END <a name="l00215"></a>00215 <span class="preprocessor">#endif</span> </pre></div></div><!-- contents --> <hr class="footer"/><address class="footer"><small> Generated on Tue Jun 5 2012 17:49:02 for edelib by  <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>