Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 0e77bba279395d1c9e1f98c452d3b010 > files > 61

edje-devel-1.0.0-2.fc15.i686.rpm

<html>
<head>
    <title>Edje: embryo_timer.edc</title>
    <meta http-equiv="content-type" content="text/html;charset=UTF-8">
    <meta name="author" content="Andres Blanc" >
    
    <link rel="icon" href="img/favicon.png" type="image/x-icon">
    <link rel="shortcut icon" href="img/favicon.png" type="image/x-icon">
    <link rel="icon" href="img/favicon.png" type="image/ico">
    <link rel="shortcut icon" href="img/favicon.png" type="image/ico">

    <link rel="stylesheet" type="text/css" href="e.css">
    <link rel="stylesheet" type="text/css" href="edoxy.css">
</head>

<body>

<div id="container">

<div id="header">
<div class="layout">
    
    <h1><span>Enlightenment</span></h1>
    <h2><span>Beauty at your fingertips</span></h2>

    <table cellspacing="0" cellpadding="0" width="100%"><tr>
      <td id="header_logo">
        <a href="http://www.enlightenment.org"></a>
      </td>
      <td id="header_menu">
        <table cellspacing="0" cellpadding="0" align="right"><tr>
          <td class="nav_passive"><a class="nav_passive" href="http://www.enlightenment.org/p.php?p=home">Home</a></td> 
          <td class="nav_passive"><a class="nav_passive" href="http://www.enlightenment.org/p.php?p=news">News</a></td> 
          <td class="nav_passive"><a class="nav_passive" href="http://www.enlightenment.org/p.php?p=about">About</a></td> 
          <td class="nav_passive"><a class="nav_passive" href="http://www.enlightenment.org/p.php?p=download">Download</a></td> 
          <td class="nav_passive"><a class="nav_passive" href="http://www.enlightenment.org/p.php?p=support">Support</a></td> 
          <td class="nav_passive"><a class="nav_passive" href="http://www.enlightenment.org/p.php?p=contribute">Contribute</a></td> 
          <td class="nav_passive"><a class="nav_passive" href="http://www.enlightenment.org/p.php?p=contact">Contact</a></td> 
          <td class="nav_passive"><a class="nav_passive" href="http://trac.enlightenment.org/e">Tracker</a></td>
          <td class="nav_passive"><a class="nav_passive" href="http://www.enlightenment.org/p.php?p=docs">Docs</a></td> 
        </tr></table>          
      </td>
      <td id="header_last"></td>
    </tr></table>

    <div class="doxytitle">
        Edje Documentation <small>at Tue Feb 8 2011</small>
    </div>

    <div class="menu-container">
        <div class="submenu">
            <ul class="current">
                <li><a href="files.html">Files</a></li>
                <li><a href="Edje__Edit_8h.html">Edje Edit API</a></li>
                <li><a href="examples.html">Examples</a></li>
                <li><a href="luaref.html">LUA scripting</a></li>
                <li><a href="Edje_8h.html">Edje API</a></li>
                <li><a href="edcref.html">EDC Reference</a></li>
                <li class="current"><a  href="index.html">Main Page</a></li>
            </ul>
        </div>
    </div>


    <div class="clear"></div>
</div>
</div>

<div id="content">
<div class="layout">
<!-- Generated by Doxygen 1.7.3 -->
</div>
<div class="header">
  <div class="headertitle">
<h1>embryo_timer.edc</h1>  </div>
</div>
<div class="contents">
<p>This example show the usage of timers in embryo.</p>
<div class="fragment"><pre class="fragment">collections {
   group { <a name="a0"></a><a class="code" href="edje__data_8c.html#a8f8f80d37794cde9472343e4487ba3eb">name</a>: <span class="stringliteral">&quot;main&quot;</span>;
      script {
         <span class="keyword">public</span> timer_cb(val) {
            <span class="keyword">new</span> x, y, w, h;
            <span class="keyword">new</span> buf[32];

            <span class="comment">/* set labels with object info */</span>
            get_geometry(PART:<span class="stringliteral">&quot;red_rect&quot;</span>, x, y, w, h);
            snprintf(buf, <span class="keyword">sizeof</span>(buf), <span class="stringliteral">&quot;Timer called %d times.&quot;</span>, val);
            set_text(PART:<span class="stringliteral">&quot;label1&quot;</span>, buf)
            snprintf(buf, <span class="keyword">sizeof</span>(buf), <span class="stringliteral">&quot;Object x: %d  w: %d&quot;</span>, x, w);
            set_text(PART:<span class="stringliteral">&quot;label2&quot;</span>, buf)

            <span class="comment">/* renew the timer */</span>
            timer(1 / 30, <span class="stringliteral">&quot;timer_cb&quot;</span>, val + 1);
         }
      }
      parts {
         part { <a class="code" href="edje__data_8c.html#a8f8f80d37794cde9472343e4487ba3eb">name</a>: <span class="stringliteral">&quot;bg&quot;</span>;
            <a name="a1"></a><a class="code" href="edje__data_8c.html#a0dae2edc8bfd2bedabfa38415c35f3ec">type</a>: RECT;
            description { state: <span class="stringliteral">&quot;default&quot;</span> 0.0;
               color: 255 255 255 255;
            }
         }
         part { <a class="code" href="edje__data_8c.html#a8f8f80d37794cde9472343e4487ba3eb">name</a>: <span class="stringliteral">&quot;label1&quot;</span>;
            <a class="code" href="edje__data_8c.html#a0dae2edc8bfd2bedabfa38415c35f3ec">type</a>: TEXT;
            description { state: <span class="stringliteral">&quot;default&quot;</span> 0.0;
               color: 0 0 0 255;
               text {
                  text: <span class="stringliteral">&quot;&quot;</span>;
                  font: <span class="stringliteral">&quot;Sans&quot;</span>;
                  size: 12;
                  align: 0.0 0.7;
               }
            }
         }
         part { <a class="code" href="edje__data_8c.html#a8f8f80d37794cde9472343e4487ba3eb">name</a>: <span class="stringliteral">&quot;label2&quot;</span>;
            <a class="code" href="edje__data_8c.html#a0dae2edc8bfd2bedabfa38415c35f3ec">type</a>: TEXT;
            description { state: <span class="stringliteral">&quot;default&quot;</span> 0.0;
               color: 0 0 0 255;
               text {
                  font: <span class="stringliteral">&quot;Sans&quot;</span>;
                  size: 12;
                  align: 0.0 0.8;
               }
            }
         }
         part { <a class="code" href="edje__data_8c.html#a8f8f80d37794cde9472343e4487ba3eb">name</a>: <span class="stringliteral">&quot;red_rect&quot;</span>;
            <a class="code" href="edje__data_8c.html#a0dae2edc8bfd2bedabfa38415c35f3ec">type</a>: RECT;
            description { state: <span class="stringliteral">&quot;default&quot;</span> 0.0;
               color: 255 0 0 255;
               max: 30 30;
               align: 0.1 0.2;
            }
            description { state: <span class="stringliteral">&quot;default&quot;</span> 1.0;
               inherit: <span class="stringliteral">&quot;default&quot;</span> 0.0;
               color: 0 0 255 255;
               max: 50 30;
               align: 0.9 0.2;
            }
         }
      }
      programs {
         <span class="comment">/* move the red rect back an forth in a loop */</span>
         program { <a class="code" href="edje__data_8c.html#a8f8f80d37794cde9472343e4487ba3eb">name</a>: <span class="stringliteral">&quot;init&quot;</span>;
            signal: <span class="stringliteral">&quot;load&quot;</span>;
            source: <span class="stringliteral">&quot;&quot;</span>;
            action: STATE_SET <span class="stringliteral">&quot;default&quot;</span> 1.0;
            transition: SINUSOIDAL 1.0;
            target: <span class="stringliteral">&quot;red_rect&quot;</span>;
            after: <span class="stringliteral">&quot;loop&quot;</span>;
         }
         program { <a class="code" href="edje__data_8c.html#a8f8f80d37794cde9472343e4487ba3eb">name</a>: <span class="stringliteral">&quot;loop&quot;</span>;
            action: STATE_SET <span class="stringliteral">&quot;default&quot;</span> 0.0;
            transition: SINUSOIDAL 1.0;
            target: <span class="stringliteral">&quot;red_rect&quot;</span>;
            after: <span class="stringliteral">&quot;init&quot;</span>;
         }
         <span class="comment">/* run the timer_cb for the first time */</span>
         program { <a class="code" href="edje__data_8c.html#a8f8f80d37794cde9472343e4487ba3eb">name</a>: <span class="stringliteral">&quot;init2&quot;</span>;
            signal: <span class="stringliteral">&quot;load&quot;</span>;
            source: <span class="stringliteral">&quot;&quot;</span>;
            script {
                timer_cb(0);
            }
         }
      }
   }
}
</pre></div> </div>
</div>
 
 <div id="push"></div>
 </div> <!-- #content -->
  </div> <!-- .layout -->
 
 </div> <!-- #container -->
 
 
  <div id="footer">
    <table><tr>
      <td class="copyright">Copyright &copy;2011 Enlightenment</td>
      <td class="generated">Docs generated Tue Feb 8 2011 17:28:42</td>
    </tr></table>
  </div>


</body>
</html>