<!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: Introduction and concepts</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 class="current"><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><a href="files.html"><span>Files</span></a></li> </ul> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="themedoc.html">Themes and theming details</a> </li> </ul> </div> </div> <div class="header"> <div class="headertitle"> <div class="title">Introduction and concepts </div> </div> </div><!--header--> <div class="contents"> <div class="textblock"><h2><a class="anchor" id="themeintro_intro"></a> Introduction</h2> <p>edelib theming facility allows theming widgets, their behavior and theming full applications. It also can behave as container for other themes, like sound theme or icon theme.</p> <p>At first this sounds pretty abstract and that is true: theming facility is abstracted as much as possible.</p> <p>Today, themed can be everything: widget look, behavior, sound events, icons and wallpapers, fonts and etc. Some toolkits and environments provides something so called <em>metatheme</em>, a theme that has a bunch of other, unrelated themes like themes for icons or GUI look. edelib theming implementation behaves (at some point) as metatheme too.</p> <p>To allow this, <a class="el" href="classedelib_1_1Theme.html" title="Theming engine for widgets.">edelib::Theme</a> implements a Scheme-like language to load, parse and eventually transform theme code. Actually, <a class="el" href="classedelib_1_1Theme.html" title="Theming engine for widgets.">edelib::Theme</a> provides a full Scheme language (based on <a href="http://tinyscheme.sourceforge.net">TinyScheme</a> engine), but you will often see only the small parts of it.</p> <h2><a class="anchor" id="themeintro_concepts"></a> Concepts</h2> <p>Theme is introducing a few terms known from other toolkits and environments, where some have pretty the same meaning and some have a different one.</p> <h3><a class="anchor" id="themeintro_style"></a> Style</h3> <p>Theme style is a set of elements with values. Elements can be anything, like font size or background color. When application is querying certain preferences (e.g. font size), it do that from certain style.</p> <p>Each styles in the same theme must have a unique name. In the case of duplicate names, first found style will be used.</p> <h3><a class="anchor" id="themeintro_scheme"></a> Scheme</h3> <p>Scheme is engine for painting widgets. Scheme is term from FLTK (see Fl::scheme() in FLTK documentation) and should not be confused with Scheme language; you can see schemes for FLTK as <em>engines</em> for GTK+. Schemes are implemented in C++ and uses FLTK low level drawing facility to paint widget elements.</p> <p>Currently schemes can't be extended and theme loader uses a few of them already built in FLTK code.</p> <h3><a class="anchor" id="themeintro_item"></a> Style item</h3> <p>Style item is entry in one style. Style item can be e.g. font color or anything that some application see as value for theming.</p> <h3><a class="anchor" id="themeintro_themefile"></a> Theme file</h3> <p>Theme file is the file with one or bunch of styles. First file loaded from every theme is <em>main.ewt</em> (ewt here means Ede Widget Theme). Here is an example how <em>main.ewt</em> can look like: </p> <div class="fragment"><pre class="fragment">;; <span class="keyword">this</span> is a comment (theme.name <span class="stringliteral">"Sample Theme"</span>) (theme.author <span class="stringliteral">"John Foo <john@foo.com>"</span>) (theme.sample <span class="stringliteral">"img.jpg"</span>) (theme.style <span class="stringliteral">"ede"</span> [ scheme <span class="stringliteral">"gtk+"</span> background_color <span class="stringliteral">"dark slate gray"</span> background_color2 <span class="stringliteral">"#043456"</span> foreground_color <span class="stringliteral">"red"</span> font <span class="stringliteral">"sans 12"</span> icon_theme <span class="stringliteral">"edeneu"</span> ]) </pre></div> </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>