<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
        <id>urn:www-linuxmint-com:feeds:atom</id>
	<title>The Linux Mint Planet &#187; Alberto Milone &#187; X-Bus – a daemon for input devices</title>
	<subtitle>The Linux Mint Planet &#187; Alberto Milone &#187; X-Bus – a daemon for input devices</subtitle>      
        <link rel="alternate" type="text/html" href="http://www.linuxmint.com/planet/" />
        <link rel="self" type="text/xml" href="http://www.linuxmint.com/planet/?media=atom"/>
        <updated>2009-11-21T12:29:10+01:00</updated>
	<entry>
		<id>http://albertomilone.com/wordpress/?p=362</id>
		<author><name>albertomilone</name></author>
		<title>Alberto Milone: X-Bus – a daemon for input devices</title>
                <link rel="alternate" type="text/html" href="http://albertomilone.com/wordpress/?p=362"/>		
		<updated>2009-07-02T16:00:11+02:00</updated>
		<published>2009-07-02T16:00:11+02:00</published>
		<content type="html"><![CDATA[	<p>What is X-Bus?</p>
<p>It&#8217;s a personal project I&#8217;ve been working on (among other things) since I joined Canonical. It&#8217;s a daemon which handles input devices through the XInput protocol. In the future I hope to add support for outputs too.</p>
<p>What&#8217;s the purpose of X-Bus?</p>
<p>Its main purpose is to provide developers with a common (and simplified) way to access XInput from languages which have DBus bindings (Python, Ruby, C, C++, Java, Perl, etc.). It is not specific to any desktop environment, even though it uses C++ and QT4 (see below).</p>
<p>Wouldn&#8217;t it be nice if we could have KDE, Gnome, Xfce, etc. applications which make use of the same backend with different frontends (as opposed to having different backends and frontends)?</p>
<p>Current features:</p>
<ul>
<li>Exposes XInput (listing/setting properties, catching signals, etc.) through Dbus with a simplified API.</li>
<li>Stores the (per-user) current inputs configuration in an XML file and applies it at startup or when requested.</li>
<li>Emits signals (through Dbus) when new devices are plugged in or unplugged (so that, for example your client application can refresh its UI to reflect the new situation).</li>
<li>Tracks keyboard activity so as to disable your touchpad when you&#8217;re typing.</li>
</ul>
<p>It&#8217;s an attempt to combine the features in syndaemon and xinput (the command line tool), from both of which X-Bus borrows code.</p>
<p>3 examples of what X-Bus can be used for:</p>
<ul>
<li>User interfaces to configure touchpads (which is the 1st thing I would like to work on).</li>
<li>User interfaces to configure touchscreens whose drivers support XInput (I still need to expose the calibration functions provided by XInput though).</li>
<li>Automatic rotation of your touchpad (figuratively speaking) when your screen is rotated (after <a href="http://bugs.freedesktop.org/show_bug.cgi?id=21129">this</a> is implemented).</li>
</ul>
<p>Why QT?</p>
<p>Because of its DBus and XML modules and because it&#8217;s a pleasure to work with QT in general.</p>
<p>Example: if you add the Q_SCRIPTABLE macro to the function in the header file, this function will be made available in your DBus interface. This applies to signals too. This makes maintenance a lot easier.</p>
<p>In my opinion it would be overkill to use the DBus low-level API and I don&#8217;t think the glib (DBus) bindings can offer what I described in the example (feel free to prove me wrong on this). Furthermore I would have to use an external xml module to perform validation and the things that I currently do with the xml file.</p>
<p>Doesn&#8217;t it duplicate efforts? Why don&#8217;t you work on $INSERT_DAEMON_HERE instead?</p>
<p>Yes, <a href="http://git.gnome.org/cgit/gnome-settings-daemon/commit/?id=4eb9bd09219afbb56f114a2d10bc585e24db803e">it does</a> (partially) but my point is: can we use $INSERT_DAEMON_HERE on KDE, Gnome, Xfce, etc. ?</p>
<p>Furthermore, if you have a look at X-Bus&#8217; API you&#8217;ll see that (currently) there&#8217;s very little duplication.</p>
<p>Where&#8217;s the code?</p>
<p><a href="https://code.launchpad.net/~albertomilone/x-bus/trunk">Source code</a> (have a look at the examples which are written in Python)<br />
<a href="https://launchpad.net/~albertomilone/+archive/x-bus-ppa">Packages</a></p>
<p>NOTE: this is just a first release and users won&#8217;t benefit from it without a user interface (unless they want to edit the xml file manually).</p> ]]></content>
</entry>
</feed>
