<?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>Enrico Ros &#187; x.org</title>
	<atom:link href="http://www.enricoros.com/blog/tag/x-org/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.enricoros.com/blog</link>
	<description>Focused ideas, bleeding edge madness and code recipes.</description>
	<lastBuildDate>Sun, 17 Apr 2011 20:51:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Delicious Transblurency [1]</title>
		<link>http://www.enricoros.com/blog/2010/04/delicious-transblurency/</link>
		<comments>http://www.enricoros.com/blog/2010/04/delicious-transblurency/#comments</comments>
		<pubDate>Mon, 19 Apr 2010 07:53:37 +0000</pubDate>
		<dc:creator>Enrico Ros</dc:creator>
				<category><![CDATA[Computer Graphics]]></category>
		<category><![CDATA[avanguardia]]></category>
		<category><![CDATA[creativity]]></category>
		<category><![CDATA[fotowall]]></category>
		<category><![CDATA[kde4]]></category>
		<category><![CDATA[planetkde]]></category>
		<category><![CDATA[qt]]></category>
		<category><![CDATA[x.org]]></category>

		<guid isPermaLink="false">http://www.enricoros.com/blog/?p=514</guid>
		<description><![CDATA[The &#8216;focus&#8216; word has many meanings, ranging from the optical concept of &#8216;good convergence of light rays generated by an object&#8217; to the cognitive process of directing the attention to a particular target while ignoring other targets. Now the interesting part: this concept can be used in computers too, especially in user interfaces, to direct [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>The &#8216;<strong>focus</strong>&#8216; word has many meanings, ranging from the optical concept of &#8216;good convergence of light rays generated by an object&#8217; to the cognitive process of directing the attention to a particular target while ignoring other targets.<br />
Now the interesting part: this concept can be used in computers too, especially in user interfaces, to direct the user to relevant information or to help him through a step-by-step process. How to do that? Since every image you see on screen is &#8216;on focus&#8217; by default, you can easily <strong>unfocus</strong> unuseful information.</p>
<p><strong>Blurring</strong> is the act of altering images so they appear out of focus. My <a href="http://ariya.blogspot.com/2008/02/to-blur-or-not-to-blur.html">Maestro</a>[2] and other <a href="http://zrusin.blogspot.com/2006/07/more-blurring.html">illustriuos</a> people already talked extensively about this topic here on <a href="http://www.planetkde.org">planet KDE</a>. However you don&#8217;t improve the world until a technology becomes available to everybody, right?</p>
<p><a href="http://www.enricoros.com/blog/wp-content/uploads/2010/04/blurandmonochrome.png"><img class="alignright size-full wp-image-519" title="blurandmonochrome" src="http://www.enricoros.com/blog/wp-content/uploads/2010/04/blurandmonochrome.png" alt="" width="312" height="150" /></a>Then some days ago I read on <a href="http://www.notmart.org/index.php/Software/Small_goodies">notmart</a>&#8216;s blog that plasma and kwin supported blurring the background on windows.. so I rebuilt KDE4 svn, restarted it, and&#8230; boy.. does it make a difference! Look at Marco&#8217;s blog or at this picture I <span style="text-decoration: underline;">stole</span> from him! All the popups become instantly more readable, even krunner does, and you immediately get the feeling that the plasma panel and all the systray applets really are above your desktop and they look as they were made of some glass/plastic material.</p>
<p>So: why limiting this just to some plasma applets? Well, I think that the usage of this effect must be wise, however I wanted that for my app too&#8230;</p>
<h3>&#8230;&#8217;cause I like eye-candy! <img src='http://www.enricoros.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </h3>
<p>After a quick tour through the beautiful KDE svn I grabbed all the needed source code and loaded <a href="http://www.enricoros.com/opensource/fotowall/">Fotowall</a> in creator. Since I already had the structure for the <a href="http://labs.trolltech.com/blogs/2009/09/15/using-blur-behind-on-windows/">blur-behind on windows</a> in place, adding the KDE4 effect was really easy. Here are some samples of what you can get:</p>
<p style="text-align: center;"><a href="http://www.enricoros.com/blog/wp-content/uploads/2010/04/fotowall-window.jpg"><img class="size-medium wp-image-516  aligncenter" title="fotowall-window" src="http://www.enricoros.com/blog/wp-content/uploads/2010/04/fotowall-window-300x214.jpg" alt="Fotowall using KWin's new Blur effect." width="300" height="214" /></a></p>
<p>To activate the back blur you need:</p>
<ul>
<li>obviously an application with a transparent background. Qt easily allows to work with transparency on top-level windows.</li>
<li>you have to enable the &#8220;blur&#8221; effect in kwin&#8217;s &#8220;desktop effects&#8221; configuration.</li>
<li>a couple of lines of code to ask kwin to activate blurring to your window.</li>
</ul>
<p>Here is the code that does the magic:</p>
<pre class="brush: cpp; collapse: false; title: ; notranslate">
#if defined(Q_WS_X11)
/**
  Blur behind windows (on KDE4.5+)
  Uses a feature done for Plasma 4.5+ for hinting the window manager to draw
  blur behind the window.
*/
#include &lt;X11/Xlib.h&gt;
#include &lt;X11/Xatom.h&gt;
#include &lt;QX11Info&gt;
static bool kde4EnableBlurBehindWindow(WId window, bool enable, const QRegion &amp;region = QRegion())
{
    Display *dpy = QX11Info::display();
    Atom atom = XInternAtom(dpy, &quot;_KDE_NET_WM_BLUR_BEHIND_REGION&quot;, False);

    if (enable) {
        QVector&lt;QRect&gt; rects = region.rects();
        QVector&lt;quint32&gt; data;
        for (int i = 0; i &lt; rects.count(); i++) {
            const QRect r = rects[i];
            data &lt;&lt; r.x() &lt;&lt; r.y() &lt;&lt; r.width() &lt;&lt; r.height();
        }

        XChangeProperty(dpy, window, atom, XA_CARDINAL, 32, PropModeReplace,
                        reinterpret_cast&lt;const unsigned char *&gt;(data.constData()), data.size());
    } else {
        XDeleteProperty(dpy, window, atom);
    }
}
#endif
</pre>
<p>And then you can activate the blur on the caller widget with:</p>
<pre class="brush: cpp; collapse: false; title: ; notranslate">
    kde4EnableBlurBehindWindow(winId(), true);
</pre>
<p>You <em>could</em> add the back blur to your application too, however I advise you that the interface is not standardized, so don&#8217;t blame either me or the kwin authors if something changes. Here is another picture, because everybody loves them <img src='http://www.enricoros.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p style="text-align: center;"><a href="http://www.enricoros.com/blog/wp-content/uploads/2010/04/fotowall-mainscreen.png"><img class="size-medium wp-image-524    aligncenter" title="fotowall-mainscreen" src="http://www.enricoros.com/blog/wp-content/uploads/2010/04/fotowall-mainscreen-300x202.png" alt="Another back-blurred screen in Fotowall." width="300" height="202" /></a></p>
<p><a href="http://www.enricoros.com/blog/wp-content/uploads/2010/04/fotowall-mainscreen.png"></a>And now, as a side note, a picture from my new work place: the beautiful city of San Diego, blessed by the sun and by a ton of great programmers that by some chance happen to be co-workers of me <img src='http://www.enricoros.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  With all the blue sky and long days, I can&#8217;t imagine a more inspiring place for making new blog posts and code experiments!</p>
<p style="text-align: center;"><a href="http://www.enricoros.com/blog/wp-content/uploads/2010/04/erosinsd.jpg"><img class="size-medium wp-image-525    aligncenter" title="erosinsd" src="http://www.enricoros.com/blog/wp-content/uploads/2010/04/erosinsd-225x300.jpg" alt="" width="225" height="300" /></a></p>
<p>Notes:<br />
[1] obviously the name is completely made up <img src='http://www.enricoros.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /><br />
[2] Italian word meaning &#8220;teacher&#8221; as in <em>school</em> or <em>life</em> teacher</p>
<div class="shr-publisher-514"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.enricoros.com/blog/2010/04/delicious-transblurency/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>I&#8217;m going Multi-Touch</title>
		<link>http://www.enricoros.com/blog/2009/12/im-going-multi-touch/</link>
		<comments>http://www.enricoros.com/blog/2009/12/im-going-multi-touch/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 14:30:45 +0000</pubDate>
		<dc:creator>Enrico Ros</dc:creator>
				<category><![CDATA[Senza categoria]]></category>
		<category><![CDATA[avanguardia]]></category>
		<category><![CDATA[creativity]]></category>
		<category><![CDATA[multi-touch]]></category>
		<category><![CDATA[planetkde]]></category>
		<category><![CDATA[planetqt]]></category>
		<category><![CDATA[qt]]></category>
		<category><![CDATA[x.org]]></category>

		<guid isPermaLink="false">http://www.enricoros.com/blog/?p=407</guid>
		<description><![CDATA[This is one of the hottest topics of the moment: Multi-Touch (see the trends here). Every review of the just released Qt 4.6 mentions the Touch-and-Gestures framework and KDE is getting ready to use the technology &#8212; still it doesn&#8217;t work on X11 (yet). MultiTouch can be Fun ! I couldn&#8217;t resist, so for 99€ (120$) I [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>This is one of the <em>hottest topics</em> of the moment: <a href="http://en.wikipedia.org/wiki/Multi-touch" target="_blank">Multi-Touch</a> (see the trends <a href="http://www.google.com/trends?q=multitouch" target="_blank">here</a>). Every review of the <a href="http://labs.trolltech.com/blogs/2009/12/01/qt-460-released-early-due-to-good-behaviour/" target="_blank">just released</a> Qt <a href="http://doc.trolltech.com/4.6/">4.6</a> mentions the Touch-and-Gestures framework and KDE is <a href="http://www.notmart.org/index.php/Software/Multitouch_screencast_overload" target="_blank">getting ready to use the technology</a> &#8212; <span style="text-decoration: underline;">still it doesn&#8217;t work on X11</span> (<em>yet</em>).</p>
<h3>MultiTouch can be <em>Fun </em>!</h3>
<p><img class="alignright size-full wp-image-413" title="Wacom_Bamboo-Fun-small" src="http://www.enricoros.com/blog/wp-content/uploads/2009/12/Wacom_Bamboo-Fun-small1.png" alt="Wacom_Bamboo-Fun-small" width="197" height="124" />I couldn&#8217;t resist, so for 99€ (120$) I bought a <em>Bamboo Fun Pen &amp; Touclh</em> tablet. I find this really affordable, since you get: A. the precision of a graphics tablet (with 1024 pressure levels, back eraser, etc..) and B. a real 2-Pointers input device!</p>
<p>I tried the tablet on vista, with the latest drivers and the bundled applications bot I got disappointed because:<br />
<em>1.</em> <em>the scroll gesture is remapped to the mouse wheel</em>.. so you lose all the &#8216;analog&#8217; fun and it feels unconfortable.<br />
<em>2. the zoom gesture is remapped to CTRL+wheel</em>, awkward fixed-steps again.<br />
<em>3. the rotate gesture is not supported by any app</em> even the bundled ones i tried.</p>
<p>In the end I thought this was not &#8220;multi-touch&#8221;, but some silly gesture-detection broken hardware. <em>I was wrong</em>.</p>
<h3>Linux to the rescue</h3>
<p><a href="http://www.enricoros.com/blog/wp-content/uploads/2009/12/gesture-vortex-2H.png"><img class="size-full wp-image-438 aligncenter" title="gesture-vortex-2S" src="http://www.enricoros.com/blog/wp-content/uploads/2009/12/gesture-vortex-2S1.png" alt="gesture-vortex-2S" width="425" height="299" /></a><br />
<span style="text-decoration: underline;">Step 1</span>. After loading the wacom.ko module (updated with <a href="http://ubuntuforums.org/showthread.php?t=1321238#1" target="_blank">this</a> patch) the Linux kernel prints out stuff like this:</p>
<pre class="brush: plain; title: ; notranslate">
[default   ] data: 02 00  00 00 00 00 00  00 00 00 00  00 00 00 00 00  00 00 00 00
[finger 1  ] data: 02 00  7d 80 fe 00 8a  80 fc 00 87  00 00 00 00 00  81 11 00 00
[finger 1+2] data: 02 00  ae 80 b6 00 72  81 08 00 70  87 81 5b 00 72  81 21 00 00
[finger   2] data: 02 00  00 00 00 00 00  81 59 00 b4  6d 81 59 00 ba  80 11 00 00
</pre>
<p>Can you see it ? This <strong>is</strong> a 2-finger device! <img src='http://www.enricoros.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><span style="text-decoration: underline;">Step 2</span>. The Kernel understands the data and splits it into 2 input devices that Udev maps to <em>/dev/input/wacom</em> and <em>/dev/input/wacom-touch</em>. From here you can read higher level information <strong>for each finger</strong> such as the decoded <strong>position</strong>, <strong>pressure</strong>, click type (<strong>tap</strong>, <strong>doubletab</strong>), and more.</p>
<h3>I WANT QTouchEvents AND QGestures !!</h3>
<p>I do too <img src='http://www.enricoros.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  And I wanted to hack something about that. But I stopped here:</p>
<p><img class="aligncenter size-full wp-image-436" title="schema-problem" src="http://www.enricoros.com/blog/wp-content/uploads/2009/12/schema-problem.png" alt="schema-problem" width="507" height="207" /></p>
<p>We get the input from <em>evdev</em> and the Application needs <a href="http://doc.trolltech.com/4.6/qtouchevent.html" target="_blank">QTouchEvent</a>s and <a href="http://doc.trolltech.com/4.6/qgesture.html" target="_blank">QGesture</a>s, so the easy way would be to hack up a touchpoint feeder to the Qt framework that directly reads from evdev (<strong>evdev -&gt; qt</strong>). This would work fine for 1 application, but what about two? And what about moving the X cursor too? I think <strong>evdev-&gt;Xdriver-&gt;XInput2-&gt;qt</strong> is the solution, but we must be sure that <em>no valuable information is lost in the chain</em>, that the <em>event filtering is done in the right place</em> and obviously, that the X driver does a good job. Unfortunately <a href="http://cgit.freedesktop.org/~whot/xf86-input-wacom/" target="_blank">xf86-input-wacom</a> (X input driver for wacom&#8217;s kernel driver) doesn&#8217;t support my Bamboo Fun Touch &amp; Pen yet and moreover I don&#8217;t see MPX support in the sources, so I&#8217;m wondering how far away is the Qt multi-touch backend from seeing the light.</p>
<h3>Conclusion</h3>
<p>I don&#8217;t know which way the multi-touch will happen on linux, but I know for sure that we want to play with gestures and we want it soon <img src='http://www.enricoros.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>For more information:</p>
<ul>
<li>Peter Hutterer&#8217;s <a href="http://who-t.blogspot.com/" target="_parent">blog</a>. Peter is the MPX (Multi Pointer X) author and plays a big role in the X.org community.</li>
<li>X Input Extension 2.0 <a href="http://fedoraproject.org/wiki/Features/XI2" target="_blank">features</a>.</li>
<li>The <a href="http://linuxwacom.sourceforge.net/" target="_blank">Linux Wacom</a> project. A community-driven effort to develop kernel and X drivers.</li>
</ul>
<div class="shr-publisher-407"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.enricoros.com/blog/2009/12/im-going-multi-touch/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

