<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Blog of Tim Janik &#187; Rapicorn</title>
	<atom:link href="http://blogs.gnome.org/timj/category/rapicorn/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.gnome.org/timj</link>
	<description>Technical ramblings by Tim Janik</description>
	<lastBuildDate>Tue, 15 Sep 2009 07:59:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>16.06.2008 Sinfex &#8211; Simple Infix Expression Evaluator</title>
		<link>http://blogs.gnome.org/timj/2008/06/16/16062008-sinfex-simple-infix-expression-evaluator/</link>
		<comments>http://blogs.gnome.org/timj/2008/06/16/16062008-sinfex-simple-infix-expression-evaluator/#comments</comments>
		<pubDate>Mon, 16 Jun 2008 22:10:35 +0000</pubDate>
		<dc:creator>Tim Janik</dc:creator>
				<category><![CDATA[Rapicorn]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/timj/2008/06/16/16062008-sinfex-simple-infix-expression-evaluator/</guid>
		<description><![CDATA[
 The XML GUI definition files used in Rapicorn and also in Beast (described briefly in an  earlier blog post) supported a simple $(function,arguments...) evaluation syntax, similar to GNU Make. I&#8217;ve never been very happy with this syntax, but it was fairly easy to implement at the start and followed naturally from early $VARIABLE [...]]]></description>
			<content:encoded><![CDATA[<p><!--- paragraph break -->
<p align="left"> The XML GUI definition files used in <a href="http://rapicorn.org">Rapicorn</a> and also in <a href="http://beast.gtk.org">Beast</a> (described briefly in an <a href="http://blogs.gnome.org/timj/2005/07/31/31072005-rapicorn/"> earlier blog post</a>) supported a simple <code>$(function,arguments...)</code> evaluation syntax, similar to GNU Make. I&#8217;ve never been very happy with this syntax, but it was fairly easy to implement at the start and followed naturally from early <code>$VARIABLE</code> expansion features. At some point last year I considered various alternative syntax variants and discussed the ideas with <a href="http://blogs.gnome.org/stw/">Stefan Westerfeld</a>. Over the course of the last two months, I finally got around to implement them. </p>
<p> <!--- paragraph break -->
<p align="left"> I&#8217;ve never grown familiar with <a href="http://en.wikipedia.org/wiki/Reverse_Polish_notation"> reverse polish notation</a>, and although <a href="http://beast.gtk.org/bsescm.1.html">Guile is the canonical scripting language for Beast</a>, I&#8217;ve always found myself very inefficient with expressing my thoughts in lisp expressions. So the new syntax definitely had to support <a href="http://en.wikipedia.org/wiki/Infix_notation">infix expressions</a> &#8211; despite the more complex parsing logic required to parse them. <a href="http://www.gnu.org/software/bison/">Bison</a> already ships with an example calculator that parses infix expressions, so that&#8217;s a quick start as far as the syntax rules go. Integration is quite a different story though, more on that later. </p>
<p> <!--- paragraph break -->
<p align="left"> Since in Rapicorn the expressions are used to compute widget property values, they are likely to be executed <strong>very often</strong>, i.e. each time a widget is created from an XML file description. Consequently, I wanted to use a pre-parsed <a href="http://en.wikipedia.org/wiki/Abstract_syntax_tree">AST</a> to carry out the evaluation and avoid mixing evaluation logic with parser logic, which would have forced reparsing expressions upon each evaluation. At first I quickly threw together some C++ classes for the arithmetic operators and used those as nodes for the AST, similar to: </p>
<pre>  class ASTNodeNot : virtual public ASTNode {
    ASTNode &amp;m_operand;
  public:
    explicit ASTNodeNot (ASTNode &amp;operand) :
      m_operand (a)
    {}
    virtual Value
    eval (Env *env) const
    {
      Value a = m_operand.eval();
      return Value (!a.asbool());
    }
  };
</pre>
<p> <!--- paragraph break -->
<p align="left"> The supported syntax is quickly summarized: </p>
<pre>  Operators: ( + - * / ** &lt; > &lt;= >= == != or and not )
  Functions: name ( args... )
  Inputs:    FloatingPoint 'SingleQuotedString' "DoubleQuotedString"
</pre>
<p align="left"> In this notation, <code>FloatingPoint</code> includes hexadecimal numbers and of course integers and the quoted strings support C style escape sequences like octal numbers, &#8216;<code>&#92;n</code>&#8216;, &#8216;<code>&#92;t</code>&#8216; and so on. The functions can be implemented by the parser API user, but a good set of standard arithmetic functions is already supported like ceil(), floor(), min(), max(), log(), etc. So it&#8217;s a very basic parser, but covers the vast majority of expressions needed to position widgets or configure packing properties. </p>
<p> <!--- paragraph break -->
<p align="left"> One thing that turned out to be tricky is the binary operator semantics for strings. At the very least, I wanted support for <code>"string" + "string"</code> and <code>"string" == "string"</code>. Since both operators are supported for numbers as well, the exact behavior of <code>"string" + FloatingPoint</code> and <code>"string" == FloatingPoint</code> had to be defined. I managed to find a few programming language precedents here in Perl, Python, and ECMAScript (Javascript). They of course all handle the cases differently. In the end I settled with <a href="http://en.wikipedia.org/wiki/Ecmascript">ECMAScript</a> semantics: </p>
<pre>  Value1 == Value2  # does string comparisons if both values are strings
  Value1 + Value2   # does string conversion if either value is a string
</pre>
<p> <!--- paragraph break -->
<p align="left"> Unit testing for the parser turned out to be particularly easy to implement. All that&#8217;s needed is a small utility that reads expressions and prints/verifies the evaluation results. Throwing in some additional shell code allowed a normal text file to drive unit testing. It simply contains expressions and expected results on alternating lines. Btw, <a href="http://tiswww.case.edu/php/chet/readline/rltop.html">libreadline</a> can be really handy in cases like this. Using it takes a mere 5-10 lines of additional code to support a nice interactive command line interface including history for the evaluator test shell. </p>
<p> <!--- paragraph break -->
<p align="left"> After some initial testing, the C++ AST node classes seemed like an awful lot of pointers, fragmentation and <a href="http://en.wikipedia.org/wiki/Vtable"> VTable</a> calls for a supposedly straight forward expression evaluation. Also, adding the missing destruction semantics would have significantly increased the existing class logic. So I tried to come up with a leaner and foremost flat memory presentation. In the end, I settled with a single array that grows in 4 byte (integer) steps, embeds strings literally (padded to 4 byte alignment) and uses array offsets instead of pointers for references. A single multiplication operator is encoded with 3 integers that way: <code>MUL_opcode factor1_index factor2_index</code>. That&#8217;s essentially 12 bytes per binary operator, still significantly more than the parser input, but also significantly smaller than allocating an equivalent C++ class. Evaluation of the expression stored in the array doesn&#8217;t need any VTable calls, and a single straight forward evaluation function can be used, that implements the different operators as switch statement cases. Also release semantics are persuasively trivial for a single consecutive array. </p>
<p> <!--- paragraph break -->
<p align="left"> What&#8217;s left was to figure a way to embed expression evaluation in XML values or text blocks. Previously, <code>$(expression)</code> was substituted everywhere, but with the new syntax, variables (or rather <em>constants</em> defined within the Rapicorn core or via the &#8216;<code>&lt;arg:ArgName default="5"/></code>&#8216; syntax supported by Rapicorn XML files) didn&#8217;t use a <code>$</code>-prefix anymore. So sticking with <code>$()</code> seemed to make little sense. As it&#8217;s implemented now, backticks are used to cause expression evaluation, with the empty expression evaluating to a single backtick: </p>
<pre>  XML Value/Text         Parser Result
    Foo  5 + 5      ->     Foo  5 + 5
    Foo `5 + 5`     ->     Foo 10
    ``Foo``         ->     `Foo`
</pre>
<p> <!--- paragraph break -->
<p align="left"> We will see how useful the current expression style turns out to be. I don&#8217;t consider every implementation bit outlined here solidly engraved into stone yet. So as always, I&#8217;m open to constructive feedback. </p>
<p> <!--- paragraph break -->
<p align="left"> As forewarned, I have a few more words on integrating <a href="http://flex.sourceforge.net/">Flex</a> and Bison with each other and into one&#8217;s own library. First, Flex and Bison turned out not to be exactly simple to configure, especially if none of the generated symbols should be exported from a library or clash with a possible second parser linked into the same library or program. Also some fiddling is required to pass on proper line count information from the lexer to the parser, getting character counts as well is non-trivial but lucky wasn&#8217;t strictly needed for Rapicorn expressions. The simplest setup I managed to come up with works as follows: </p>
<pre>  sinfex.hh     # public API
  sinfeximpl.hh # internal structure definitions
  sinfex.cc     # evaluator implementation
  sinfex.l      # scanner rules for Flex
  sinfex.y      # parser rules for Bison
  sinfex.lgen   # generated by Flex
  sinfex.ygen   # generated by Bison
</pre>
<p align="left"> The only compiled file in this list is <code>sinfex.cc</code> which includes <code>sinfex.lgen</code> and <code>sinfex.ygen</code> as part of an anonymous C++ namespace. A linker script <code><a href="http://git.testbit.eu/Rapicorn/tree/rapicorn/ldscript.map">ldscript.map</a></code> used when finally linking the library prevents anonymous symbols from being exported. The anonymous namespacing of everything declared in <code>sinfex.lgen</code> and <code>sinfex.ygen</code> is what prevents clashes with a possible second parser linked into the library. This isn&#8217;t as elegant as i was hoping for, but at least effective in a practical sense. There unfortunately is <strong>no way</strong> to configure Flex or Bison to generate only <em>static</em> functions and variables. And yes, I have also looked into variants like flex++, bison++, bisonc++, byacc, etc, but they usually show much of the same problems and also tend to make matters worse by generating more files or more complex code. </p>
<p> <!--- paragraph break --></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/timj/2008/06/16/16062008-sinfex-simple-infix-expression-evaluator/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>24.04.2008 Announcing Rapicorn 8.4.0</title>
		<link>http://blogs.gnome.org/timj/2008/04/24/24042008-announcing-rapicorn-840/</link>
		<comments>http://blogs.gnome.org/timj/2008/04/24/24042008-announcing-rapicorn-840/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 22:24:38 +0000</pubDate>
		<dc:creator>Tim Janik</dc:creator>
				<category><![CDATA[Rapicorn]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/timj/2008/04/24/24042008-announcing-rapicorn-840/</guid>
		<description><![CDATA[
  Rapicorn 8.4.0 has just been released to the world:  Rapicorn v8.4.0 Announcement
 
 Lots of things have happened since the last snapshot over a year ago, some of which kept me from making releases or snapshots earlier. ;-)
Others actually took place in the code base as interesting developments, summarized below.

 There&#8217;s quite [...]]]></description>
			<content:encoded><![CDATA[<p><!--- paragraph break --></p>
<p align="left"> <a href="http://rapicorn.org/files/2008/rapicorn-8.4.0.tar.bz2"> Rapicorn 8.4.0</a> has just been released to the world: <a href="http://rapicorn.org/pipermail/rapicorn-list/2008-April/000002.html"> Rapicorn v8.4.0 Announcement</a></p>
<p> <!--- paragraph break --></p>
<p align="left"> Lots of things have happened since the last snapshot over a year ago, some of which kept me from making releases or snapshots earlier. ;-)<br />
Others actually took place in the code base as interesting developments, summarized below.</p>
<p><!--- paragraph break --></p>
<p align="left"> There&#8217;s quite some more stuff in my development queue, but at some point one just has to draw a line and throw out what&#8217;s vaguely ready so far, so this is it for today:</p>
<p> <!--- paragraph break --></p>
<pre>  Overview of changes in Rapicorn 8.4.0:</pre>
<p><!--- paragraph break --></p>
<pre>  * Changed versioning scheme to YEAR.WEEK.REVISION.
  * License update to GNU LGPL 2.1.
  * Added a publically installed tool: rapidrun
  * Support println() and close() commands in GUI files.
  * Introduce simple Application and Window object APIs.
  * Merged libbirnet into Rapicorn as librapicorncore.
  * Implemented expose region merging/comprssion.
  * Reiimplemented rectangle gradient shader.
  * Switched to autogenerated ChangeLogs.
  * Improved feedback on parser errors.
  * Fixed Gtk+ version checks.
  * Added PNG saving support.
  * Removed PERL build dependency.
  * Rewrote asyncronous main loops.
  * Many improvements to text editing areas.
  * Speed up blitting logic for local displays.
  * Added SIMD optimized rendering functions for MMX CPUs.
  * Fixed some reference counting issues and child removal.
  * Improved vertical text ellipsization to line granularity.
  * Removed error prone default values from property mechanism.
  * Install tutorial under ${prefix}/doc/rapicornXXXX/tutorial/.
  * Misc compiler and threading fixes, depend on g++-3.4.6.
  * Lots of bug fixes, cleanups and improved test coverage.</pre>
<p><!--- paragraph break --></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/timj/2008/04/24/24042008-announcing-rapicorn-840/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>05.04.2007 Rapicorn Website</title>
		<link>http://blogs.gnome.org/timj/2007/04/05/05042007-rapicorn-website/</link>
		<comments>http://blogs.gnome.org/timj/2007/04/05/05042007-rapicorn-website/#comments</comments>
		<pubDate>Thu, 05 Apr 2007 02:10:49 +0000</pubDate>
		<dc:creator>Tim Janik</dc:creator>
				<category><![CDATA[Rapicorn]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/timj/2007/04/05/05042007-rapicorn-website/</guid>
		<description><![CDATA[ The generation rules for the Rapicorn website are now finally in place: 
 -&#62; rapicorn.org &#60;- 
 This should help to clear up some of the motivations behind the Rapicorn project, in particular how it relates to Gtk+ and why it aims at implementing features that are to some extend already covered by Gtk+ [...]]]></description>
			<content:encoded><![CDATA[<p> The generation rules for the Rapicorn website are now finally in place: </p>
<p> -&gt; <a href="http://rapicorn.org/">rapicorn.org</a> &lt;- </p>
<p> This should help to clear up some of the motivations behind the Rapicorn project, in particular how it relates to <a href="http://www.gtk.org/">Gtk+</a> and why it aims at implementing features that are to some extend already covered by Gtk+ or other projects like <a href="http://developer.gnome.org/doc/API/2.0/libgnomecanvas/">GnomeCanvas</a>. <br /> Here is a small excerpt to wetten the appetite: <br /> <code>
<pre>	These days Gtk+ is [...] a very successful toolkit.
	However, maintenance and continuous development of a project at this scope
	and scale come at significant costs in terms of development flexibility
	and compatibility. It is not anymore a suitable place for evolution of new
	experimental GUI technologies and quick paradigm shifts. So radically new
	toolkit approaches or design ideas now need to be explored elsewhere and
	only if successful and applicable can reflect back onto Gtk+ development.
	-
	Rapicorn explores some approaches which are simply different from
	established Gtk+ paradigms.</pre>
<p></code> </p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/timj/2007/04/05/05042007-rapicorn-website/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>22.01.2007 Rapicorn-0.1.2</title>
		<link>http://blogs.gnome.org/timj/2007/01/22/22012007-rapicorn-012/</link>
		<comments>http://blogs.gnome.org/timj/2007/01/22/22012007-rapicorn-012/#comments</comments>
		<pubDate>Mon, 22 Jan 2007 14:42:04 +0000</pubDate>
		<dc:creator>Tim Janik</dc:creator>
				<category><![CDATA[Rapicorn]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/timj/2007/01/22/22012007-rapicorn-012/</guid>
		<description><![CDATA[ The last Rapicorn snapshot had a couple build and compiler issues which could be fixed meanwhile, so here is the &#8220;real&#8221; 0.1.2 release:  rapicorn-0.1.2.tar.gz  It&#8217;s still a technology preview release with known issues, nevertheless useful to look at. The release NEWS: 
 Rapicorn 0.1.2:  * added Image support for PNG images. [...]]]></description>
			<content:encoded><![CDATA[<p> The last <a href="http://blogs.gnome.org/view/timj/2006/11/28/0">Rapicorn snapshot</a> had a couple build and compiler issues which could be fixed meanwhile, so here is the &#8220;real&#8221; 0.1.2 release: <br /> <a href="http://rapicorn.gtk.org/rapicorn-ftp/v0.1/rapicorn-0.1.2.tar.gz">rapicorn-0.1.2.tar.gz</a> <br /> It&#8217;s still a technology preview release with known issues, nevertheless useful to look at. The release NEWS: </p>
<p> Rapicorn 0.1.2: <br /> * added Image support for PNG images. <br /> * added HSlider, VSlider, Arrow, dot-grid. <br /> * added ScrollArea. <br /> * added Adjustments. <br /> * added command system allowing on-click properties. <br /> * added reset logic to recover from stale event situations. <br /> * added requisition tuning to allow iterative size allocations. <br /> * added event grabbing. <br /> * added MainLoop. <br /> * added Thread-per-Window paradigm. <br /> * added Viewport abstraction of drawing backends. <br /> * added color schemes. <br /> * added simple function Evaluator for XML properties. <br /> * added Markup to labels. <br /> * added focus handling for Items. <br /> * added TextEditor prototype. <br /> * added Region to handle rectangle arrays. <br /> * added partial screen updates. <br /> * removed libcairo/libpixman dependency. <br /> * overhauled Table shrinking logic. <br /> * upgraded Birnet library. </p>
<p> Known Issues: <br /> + instabilities/hangs upon main loop exit. <br /> + possible build issues with g++ versions &lt; 3.4.6. </p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/timj/2007/01/22/22012007-rapicorn-012/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>29.11.2006 Rapicorn snapshot</title>
		<link>http://blogs.gnome.org/timj/2006/11/28/29112006-rapicorn-snapshot/</link>
		<comments>http://blogs.gnome.org/timj/2006/11/28/29112006-rapicorn-snapshot/#comments</comments>
		<pubDate>Tue, 28 Nov 2006 19:23:06 +0000</pubDate>
		<dc:creator>Tim Janik</dc:creator>
				<category><![CDATA[Rapicorn]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/timj/2006/11/28/29112006-rapicorn-snapshot/</guid>
		<description><![CDATA[ So Herzi pressed me to make another Rapicorn snapshot available. The result of which is now up here: rapicorn-0.1.2-snapshot.tar.gz  It&#8217;s still very much a technology preview, but shaping well in various aspects. Here&#8217;s the release NEWS: 
 Rapicorn 0.1.2:  * added Image support for PNG images.  * added HSlider, VSlider, Arrow, [...]]]></description>
			<content:encoded><![CDATA[<p> So <a href="http://herzi.eu/">Herzi</a> pressed me to make another <a href="http://rapicorn.org">Rapicorn</a> snapshot available. The result of which is now up here: <a href="http://rapicorn.org/rapicorn-ftp/v0.1/rapicorn-0.1.2-snapshot.tar.gz">rapicorn-0.1.2-snapshot.tar.gz</a> <br /> It&#8217;s still very much a technology preview, but shaping well in various aspects. Here&#8217;s the release NEWS: </p>
<p> Rapicorn 0.1.2: <br /> * added Image support for PNG images. <br /> * added HSlider, VSlider, Arrow, dot-grid. <br /> * added ScrollArea. <br /> * added Adjustments. <br /> * added command system allowing on-click properties. <br /> * added reset logic to recover from stale event situations. <br /> * added requisition tuning to allow iterative size allocations. <br /> * added event grabbing. <br /> * added MainLoop. <br /> * added Thread-per-Window paradigm. <br /> * added Viewport abstraction of drawing backends. <br /> * added color schemes. <br /> * added simple function Evaluator for XML properties. <br /> * added Markup to labels. <br /> * added focus handling for Items. <br /> * added TextEditor prototype. <br /> * added Region to handle rectangle arrays. <br /> * added partial screen updates. <br /> * removed libcairo/libpixman dependency. <br /> * overhauled Table shrinking logic. <br /> * upgraded Birnet library. </p>
<p> Known Issues: <br /> + instabilities upon main loop exit. <br /> + possible build issues with g++ versions other than 3.4. </p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/timj/2006/11/28/29112006-rapicorn-snapshot/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>30.08.2006 Scroll-Area and Sliders</title>
		<link>http://blogs.gnome.org/timj/2006/08/30/30082006-scroll-area-and-sliders/</link>
		<comments>http://blogs.gnome.org/timj/2006/08/30/30082006-scroll-area-and-sliders/#comments</comments>
		<pubDate>Wed, 30 Aug 2006 18:44:12 +0000</pubDate>
		<dc:creator>Tim Janik</dc:creator>
				<category><![CDATA[Rapicorn]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/timj/2006/08/30/30082006-scroll-area-and-sliders/</guid>
		<description><![CDATA[ It has been a while since i last blogged about Rapicorn and worked on new features for it. So here are some updates.
In order to get a scrollable area implemented, i first started out with the h/v slider implementations. That in turn required sorting out of the basic threading and main loop models (Rapicorn [...]]]></description>
			<content:encoded><![CDATA[<p> It has been a while since i last <a href="http://blogs.gnome.org/view/timj/2005/07/31/">blogged about Rapicorn</a> and worked on new features for it. So here are some updates.</p>
<p>In order to get a scrollable area implemented, i first started out with the h/v slider implementations. That in turn required sorting out of the basic threading and main loop models (Rapicorn supports thread-per-window mode) to get timers going. I then ended up implementing 3 different gadgets to make up the sliders: SliderArea, SliderTrough and SliderSkid. I managed to keep the code generic enough with regards to packing abilities and movement to support horizontal and vertical scales as well as scrollbars with these 3 gadgets.</p>
<p>For the curious, an XML excerpt that packs together the necessary frames, buttons, boxes, ambience (shading) and functional gadgets for a vslider is here: <a href="http://rapicorn.gtk.org/mirror/def-vslider-20060830.txt">Rapicorn vslider definition</a> (23 lines).</p>
<p>Since Rapicorn currently has to support Gtk+/Gdk &gt;= 2.6.x as rendering backend, scrolling had to be implemented with <a href="http://developer.gnome.org/doc/API/2.0/gdk/gdk-Drawing-Primitives.html#gdk-draw-drawable">gdk_draw_drawable()</a> + <a href="http://developer.gnome.org/doc/API/2.0/gdk/gdk-Events.html#gdk-event-get-graphics-expose">gdk_event_get_graphics_expose()</a>. Once this dependency can be raised, we&#8217;ll use <a href="http://developer.gnome.org/doc/API/2.0/gdk/gdk-Windows.html#gdk-window-move-region">gdk_window_move_region()</a> however. Tonight, i managed to complete the coordinate offset handling and got event processing going inside the scroll area, so here&#8217;s a button toggled inside a scroll area:</p>
<p align="center"><img src="http://www.rapicorn.org/screenshotdir/scroller.png" /></p>
<p> A couple other things also got fixed, like the Appearance/ColorScheme handling. E.g. here&#8217;s a blue test window, where the color scheme is derived from a set of just 3 base colors:</p>
<p align="center"><img src="http://www.rapicorn.org/screenshotdir/slider+scroll+blue.png" /></p>
<p> I&#8217;ll probably put up another tarball soon, after some polishing of the build setup and the window/main loop destruction phases.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/timj/2006/08/30/30082006-scroll-area-and-sliders/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>06.08.2005</title>
		<link>http://blogs.gnome.org/timj/2005/08/06/06082005/</link>
		<comments>http://blogs.gnome.org/timj/2005/08/06/06082005/#comments</comments>
		<pubDate>Sat, 06 Aug 2005 18:00:37 +0000</pubDate>
		<dc:creator>Tim Janik</dc:creator>
				<category><![CDATA[Rapicorn]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/timj/2005/08/06/06082005/</guid>
		<description><![CDATA[ I just implemented the PNG image loader for rapicorn, albeit without animations so far. Regarding the Animated PNG specification, i actually got word from Stuart Parmenter in response to my recent blog entry, that the spec should be fixed up and finalized in the near future. So there&#8217;s still hope for a low-complexity animation [...]]]></description>
			<content:encoded><![CDATA[<p> I just implemented the PNG image loader for <a href="http://www.rapicorn.org">rapicorn</a>, albeit without animations so far. Regarding the <a href="http://www.vlad1.com/~vladimir/projects/apng/">Animated PNG specification</a>, i actually got word from <a href="http://pavlov.net/">Stuart Parmenter</a> in response to my <a href="http://blogs.gnome.org/view/timj/2005/07/23">recent blog entry</a>, that the spec should be fixed up and finalized in the near future. So there&#8217;s still hope for a low-complexity animation format. </p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/timj/2005/08/06/06082005/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>31.07.2005 &#8211; Rapicorn</title>
		<link>http://blogs.gnome.org/timj/2005/07/31/31072005-rapicorn/</link>
		<comments>http://blogs.gnome.org/timj/2005/07/31/31072005-rapicorn/#comments</comments>
		<pubDate>Sun, 31 Jul 2005 10:08:51 +0000</pubDate>
		<dc:creator>Tim Janik</dc:creator>
				<category><![CDATA[Rapicorn]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/timj/2005/07/31/31072005-rapicorn/</guid>
		<description><![CDATA[ I have been asked some about rapicorn recently, so&#8230;  In spring 2005, i started working on a gnome-canvas replacement for beast. A bunch of GUI/toolkit design ideas that accumulated over the last few years have influenced the design of this. For a change, i coded this up in C++ so i am not [...]]]></description>
			<content:encoded><![CDATA[<p> I have been asked some about <a href="http://rapicorn.org">rapicorn</a> recently, so&#8230; <br /> In spring 2005, i started working on a <a href="http://developer.gnome.org/doc/API/2.0/libgnomecanvas/">gnome-canvas</a> replacement for <a href="http://beast.gtk.org">beast</a>. A bunch of GUI/toolkit design ideas that accumulated over the last few years have influenced the design of this. For a change, i coded this up in C++ so i am not forced to produce the large amounts of boilerplate code that <a href="http://developer.gnome.org/doc/API/2.0/gobject/">GObject</a> requires. It is only with C++, where typesafe interface lookups for composite widgets can be implemented. That is, a container holding a child of a specific interface (say a box containing a text entry which implements the Text interface) integrates that interface into its public API via:
<pre><code> Text &amp;text = container.interface&lt;Text&gt;();</code></pre>
<p> This can be extended to allow passing in widget ids, for instance to tell apart the buttons of a dialog:
<pre><code> Button &amp;button = file_selector.interface&lt;Button&gt; ("cancel-button");</code></pre>
<p> And to access the text of the cancel button:
<pre><code> Label &amp;label = file_selector.interface&lt;Label&gt; ("cancel-button");</code></pre>
<p> The core idea is to build larger widgets out of micro widgets (very simple things like frame, label, table, image, rectangle shader, etc.) by writing concise xml statements. This may look like so: <code>
<pre>		&lt;button hexpand="1" left-attach="50" bottom-attach="59" &gt;
		  &lt;label _text="Expand Button" /&gt;
		&lt;/button&gt;</pre>
<p></code> This would be a button, packed into a table at 50-51 horizontally and 59-60 vertically. Also, the button is expanded horizontally within the table container and contains a label with translated text. These xml style widget definitions were originally developed for Gtk+ code and can be found as &#8220;<a href="http://beast.gtk.org/beast-gxk.3.html#gxk_radget_parse">radgets</a>&#8221; in recent beast releases. The notation is powerful and conscise enough that nearly all beast dialogs could be defined in a <a href="http://cvs.gnome.org/viewcvs/beast/beast-gtk/dialogs/radgets-beast.xml?view=markup">single xml file</a>. <br /> Another major design aspect is strict seperation of <a href="http://heim.ifi.uio.no/~trygver/themes/mvc/mvc-index.html">model, view and controller</a> logic, down to such simple things like toggle buttons. Most popular toolkits out there already allow seperation between model and view, but fail short on seperating the controller logic and making it pluggable (customizable). Most often this causes code more complicated than neccessary, where the view and controller logics are closely tied up, and result in hacks or code duplication in third party products to change controller behaviour as desired. Turning controller functionality into its own object instance which may be customized or replaced by the toolkit user, will help to reduce third party hacks and increase structure of the toolkit code. <br /> Last but not least, an often heared request for beast was changing its outlook, so it looks more like &#8220;cool&#8221; music applications found under windows: <a href="http://testbit.eu/~timj/blogstuff/audition1.jpg">(AU)</a>, <a href="http://www.propellerheads.se/products/reason/index.cfm?fuseaction=get_article&amp;article=closeupreason">(RE)</a>, <a href="http://www.steinberg.de/images/ProductImages/1Cubase-SE_big.jpg">(CU)</a>. This will involve working more with images, font rendering, alpha blending and dithering for standard GUI components than is intended with stock Gtk+, so this kind of featurism is also supposed to end up in rapicorn instead. <br /> That being said, rapicorn hasn&#8217;t left initial design phase yet and much of what is there or will be there soon may not survive future releases because we&#8217;re still testing out new ideas and concepts. Semi frequent releases however will be made available at <a href="http://rapicorn.org/rapicorn-ftp/">the rapicorn ftp directory</a>, mostly in response to someone asking me to put up a new tarball. </p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/timj/2005/07/31/31072005-rapicorn/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>23.07.2005</title>
		<link>http://blogs.gnome.org/timj/2005/07/23/23072005/</link>
		<comments>http://blogs.gnome.org/timj/2005/07/23/23072005/#comments</comments>
		<pubDate>Sat, 23 Jul 2005 11:52:57 +0000</pubDate>
		<dc:creator>Tim Janik</dc:creator>
				<category><![CDATA[Rapicorn]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/timj/2005/07/23/23072005/</guid>
		<description><![CDATA[ Implemented images in rapicorn. So far, the various pixstream formats produced by gdk-pixbuf-csource can be deserialized and displayed, here&#8217;s a screenshot. The next item on the list is supporting libpng natively, ideally i&#8217;d add support for simple animations along the way, but the Animated PNG specification doesn&#8217;t seem to be moving forward anymore&#8230; 
]]></description>
			<content:encoded><![CDATA[<p> Implemented images in <a href="http://www.rapicorn.org">rapicorn</a>. So far, the various pixstream formats produced by <a href="http://developer.gnome.org/doc/API/2.0/gdk-pixbuf/gdk-pixbuf-csource.html">gdk-pixbuf-csource</a> can be deserialized and displayed, <a href="http://www.rapicorn.org/screenshotdir/rapicorn-with-images.jpg">here&#8217;s a screenshot</a>. The next item on the list is supporting <a href="http://www.libpng.org/">libpng</a> natively, ideally i&#8217;d add support for simple animations along the way, but the <a href="http://www.vlad1.com/~vladimir/projects/apng/">Animated PNG specification</a> doesn&#8217;t seem to be moving forward anymore&#8230; </p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/timj/2005/07/23/23072005/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>29.06.2005</title>
		<link>http://blogs.gnome.org/timj/2005/06/30/29062005/</link>
		<comments>http://blogs.gnome.org/timj/2005/06/30/29062005/#comments</comments>
		<pubDate>Thu, 30 Jun 2005 17:02:20 +0000</pubDate>
		<dc:creator>Tim Janik</dc:creator>
				<category><![CDATA[Rapicorn]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/timj/2005/06/30/29062005/</guid>
		<description><![CDATA[ Majorly improved the speed of rectangle shading in Rapicorn, here&#8217;s a quick-and-dirty random number generator which is still good enough for dithering: 
	inline uint32 quick_rand32 (void)
	{
	  static uint32 accu = 2147483563;
	  accu = 1664525 * accu + 1013904223;
	  return accu;
	}
 This has been the major speed-up-knob, other aspects were as confusing [...]]]></description>
			<content:encoded><![CDATA[<p> Majorly improved the speed of rectangle shading in <a href="http://rapicorn.org/">Rapicorn</a>, here&#8217;s a quick-and-dirty random number generator which is still good enough for dithering: <code>
<pre>	inline uint32 quick_rand32 (void)
	{
	  static uint32 accu = 2147483563;
	  accu = 1664525 * accu + 1013904223;
	  return accu;
	}</pre>
<p></code> This has been the major speed-up-knob, other aspects were as confusing as profiling often gets, e.g. -ffast-math actually slowed down the rectangle shader by 13%. </p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/timj/2005/06/30/29062005/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
