<?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>micolous.id.au &#187; Coding</title>
	<atom:link href="http://micolous.id.au/archives/category/coding/feed/" rel="self" type="application/rss+xml" />
	<link>http://micolous.id.au</link>
	<description>the result of a blogging accident</description>
	<lastBuildDate>Mon, 05 Sep 2011 08:29:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Belated announcement: tollgate source released</title>
		<link>http://micolous.id.au/archives/2011/05/09/belated-announcement-tollgate-source-released/</link>
		<comments>http://micolous.id.au/archives/2011/05/09/belated-announcement-tollgate-source-released/#comments</comments>
		<pubDate>Sun, 08 May 2011 17:06:43 +0000</pubDate>
		<dc:creator>micolous</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://micolous.id.au/?p=375</guid>
		<description><![CDATA[Last weekend, tollgate&#8217;s source code was released. This is the project formerly known as portal2, which ran the captive portal system at StreetGeek and SAGAfest from January 2009 to September 2010. It&#8217;s a quota-managed captive portal system for Linux mainly &#8230; <a href="http://micolous.id.au/archives/2011/05/09/belated-announcement-tollgate-source-released/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Last weekend, tollgate&#8217;s source code was released.  This is the project formerly known as portal2, which ran the captive portal system at StreetGeek and SAGAfest from January 2009 to September 2010.  It&#8217;s a quota-managed captive portal system for Linux mainly aimed at LAN parties.</p>
<p>There&#8217;s a number of improvements in 2.8.4&#8242;s development branch already over 2.8.3:</p>
<ul>
<li>Local sign-in and events management system.</li>
<li>Port forwarding system.</li>
<li>Migrating several systems over so they work with Django 1.2, and removing some older legacy code.</li>
<li>All the local authentication hacks have been eliminated.</li>
<li>Fixed XSS issue in captive landing page.</li>
</ul>
<p>The code is released under the GNU Affero General Public License v3, and is available <a href="https://github.com/micolous/tollgate/">from my GitHub repository</a>.</p>
<p>At some point in the future this&#8217;ll be pulled into a 2.8.4 release, after some further janitorial work is done.  It&#8217;s been sitting around for a little while, may as well get it out there now.  Eventually this will be migrated to become a part of the LanConnect project, with optional integration with it&#8217;s databases.</p>
]]></content:encoded>
			<wfw:commentRss>http://micolous.id.au/archives/2011/05/09/belated-announcement-tollgate-source-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>QCQREncoder, QCGPS, Openbravo hacks</title>
		<link>http://micolous.id.au/archives/2010/12/05/qcqrencoder-qcgps-openbravo-hacks/</link>
		<comments>http://micolous.id.au/archives/2010/12/05/qcqrencoder-qcgps-openbravo-hacks/#comments</comments>
		<pubDate>Sat, 04 Dec 2010 16:32:05 +0000</pubDate>
		<dc:creator>micolous</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://micolous.id.au/?p=356</guid>
		<description><![CDATA[So, I&#8217;ve been busy a bit lately. I&#8217;ve written a QR Encoder patch for Quartz Composer based on libqrencode. You give it a string, and then it&#8217;ll encode it into an image. There&#8217;s another patch in my github which provides &#8230; <a href="http://micolous.id.au/archives/2010/12/05/qcqrencoder-qcgps-openbravo-hacks/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>So, I&#8217;ve been busy a bit lately.</p>
<p>I&#8217;ve written a <a href="https://github.com/micolous/QCQREncoder">QR Encoder patch for Quartz Composer based on libqrencode</a>.  You give it a string, and then it&#8217;ll encode it into an image.</p>
<p><img src="/static/resc/qrpatch.png" alt="[qr encoder patch]"/></p>
<p>There&#8217;s another patch in <a href="https://github.com/micolous">my github</a> which <a href="https://github.com/micolous/QCGPS">provides a client to GPSdX</a>.  It&#8217;s a bit buggy still, and only works with GPSd running on localhost with the older encoding method.  Unfortunately libgps is ridiculously annoying to work with, so I took the easy (incompatible) way out.</p>
<p>I&#8217;ve also <a href="https://github.com/micolous/Openbravo">patches for Openbravo POS</a>.  They make the &#8220;customer&#8221; price for an item be the buy price, allowing you to implement a simple discount for registered customers that isn&#8217;t based on a percentage.  It also includes Australian currency images and some minor UI modification to waste less screen space.</p>
<p>I&#8217;m currently working on cleaning portal2 up for release.  Which is fun.  Most of the legacy authentication hooks have been removed, and it&#8217;s getting closer to running standalone in a nice way.  As part of this I&#8217;m getting rid of lots of ugly and legacy code that was for Django 0.96.</p>
]]></content:encoded>
			<wfw:commentRss>http://micolous.id.au/archives/2010/12/05/qcqrencoder-qcgps-openbravo-hacks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More portal2 v2.8.3 API changes</title>
		<link>http://micolous.id.au/archives/2010/09/07/more-portal2-v2-8-3-api-changes/</link>
		<comments>http://micolous.id.au/archives/2010/09/07/more-portal2-v2-8-3-api-changes/#comments</comments>
		<pubDate>Tue, 07 Sep 2010 11:49:53 +0000</pubDate>
		<dc:creator>micolous</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Lanning]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://micolous.id.au/?p=330</guid>
		<description><![CDATA[There&#8217;s some more updates to portal2&#8242;s API. UserProfile objects (returned by whoami and whois_ip) now also include the user&#8217;s forum numeric user ID. This means that your application can track when a user has changed their username. Additionally, there&#8217;s now &#8230; <a href="http://micolous.id.au/archives/2010/09/07/more-portal2-v2-8-3-api-changes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s some more updates to portal2&#8242;s API.</p>
<p><code>UserProfile</code> objects (returned by <code>whoami</code> and <code>whois_ip</code>) now also include the user&#8217;s forum numeric user ID.  This means that your application can track when a user has changed their username.</p>
<p>Additionally, there&#8217;s now a new &#8220;python&#8221; output method for the HTTP GET API which gives the output of <a href="http://docs.python.org/library/functions.html#repr">repr()</a> on the result object.  It&#8217;s not recommended that you use this with Python (instead use XMLRPC), but there may be instances where you find this useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://micolous.id.au/archives/2010/09/07/more-portal2-v2-8-3-api-changes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>portal2 API v2.8.3</title>
		<link>http://micolous.id.au/archives/2010/08/24/portal2-api-v2-8-3/</link>
		<comments>http://micolous.id.au/archives/2010/08/24/portal2-api-v2-8-3/#comments</comments>
		<pubDate>Mon, 23 Aug 2010 15:10:40 +0000</pubDate>
		<dc:creator>micolous</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Lanning]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://micolous.id.au/?p=323</guid>
		<description><![CDATA[There&#8217;s been a minor change to the portal2 API as of v2.8.3 (to be deployed at LAN 10.09). Functions which attempt to identify you (usage, usage_history and whoami) will attempt to use cookie-based authentication before attempting to identify your computer &#8230; <a href="http://micolous.id.au/archives/2010/08/24/portal2-api-v2-8-3/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s been a minor change to the <a href="/projects/portal2/portal2_api/">portal2 API</a> as of v2.8.3 (to be deployed at LAN 10.09).  Functions which attempt to identify you (<code>usage</code>, <code>usage_history</code> and <code>whoami</code>) will attempt to use cookie-based authentication before attempting to identify your computer by MAC address.</p>
<p>This will allow in-browser applications to determine the identity of who you are logged in as before attempting to fall back to who owns the computer.</p>
<p>In other news, portal2 v2.8.3 now has a couple of other changes to it, such as support for clustering and a new graph on the usage page which is generated client side (and much faster than the server-side graph).</p>
]]></content:encoded>
			<wfw:commentRss>http://micolous.id.au/archives/2010/08/24/portal2-api-v2-8-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Xbox 360 Big Button: Round 2</title>
		<link>http://micolous.id.au/archives/2010/07/18/xbox-360-big-button-round-2/</link>
		<comments>http://micolous.id.au/archives/2010/07/18/xbox-360-big-button-round-2/#comments</comments>
		<pubDate>Sun, 18 Jul 2010 08:59:08 +0000</pubDate>
		<dc:creator>micolous</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Toys]]></category>

		<guid isPermaLink="false">http://micolous.id.au/?p=309</guid>
		<description><![CDATA[So, time for round 2 with the Big Button controllers. I covered this stuff a bit yesturday. I&#8217;ve since updated the driver so that it treats the directional buttons on the big button controllers as the X and Y axes. &#8230; <a href="http://micolous.id.au/archives/2010/07/18/xbox-360-big-button-round-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>So, time for round 2 with the Big Button controllers.  <a href="/archives/2010/07/18/xbox-360-big-button-ir-receiver/">I covered this stuff a bit yesturday</a>.</p>
<p>I&#8217;ve since <a href="/static/projects/bigbutton/xbox360bb-20100718.tar.bz2">updated the driver</a> so that it treats the directional buttons on the big button controllers as the X and Y axes.  This means that joydev.c will now detect the xbox360bb as a joystick driver, and so ordinary programs that use Linux&#8217;s joystick API can receive events from the controllers (and not just those that use evdev).</p>
<p>I also <a href="/static/projects/bigbutton/simon-20100718.tar.bz2">wrote a simple pygame version</a> of <em><a href="http://en.wikipedia.org/wiki/Simon_(game)">Simon</a></em>.  This works whenever you have four joystick devices attached to your computer.  You play by pressing any button on the controller.  The colours match up to how the Big Button controllers are presented in xbox360bb.  As soon as one person makes a mistake, the game ends.  The loser is reported on the console.</p>
]]></content:encoded>
			<wfw:commentRss>http://micolous.id.au/archives/2010/07/18/xbox-360-big-button-round-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>portal2 2.8.1 API documentation</title>
		<link>http://micolous.id.au/archives/2010/05/01/portal2-2-8-1-api-documentation/</link>
		<comments>http://micolous.id.au/archives/2010/05/01/portal2-2-8-1-api-documentation/#comments</comments>
		<pubDate>Fri, 30 Apr 2010 20:27:13 +0000</pubDate>
		<dc:creator>micolous</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Lanning]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://micolous.id.au/?p=278</guid>
		<description><![CDATA[There have been some requests that I make portal2&#8216;s API documentation available online and not just available at LANs. So I have published a copy of the portal2 API v2.8.1. This covers the (at the time of writing) current version &#8230; <a href="http://micolous.id.au/archives/2010/05/01/portal2-2-8-1-api-documentation/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>There have been some requests that I make <a href="/projects/portal2/">portal2</a>&#8216;s API documentation available online and not just available at LANs.  So I have published a copy of the <a href="/projects/portal2/portal2_api/">portal2 API v2.8.1</a>.  This covers the (at the time of writing) current version of portal2&#8242;s HTTP GET and XMLRPC APIs.</p>
<p>Unfortunately, there&#8217;s no online &#8220;simulator&#8221; available, but that should be trivial for someone to write if they&#8217;re testing their program.</p>
]]></content:encoded>
			<wfw:commentRss>http://micolous.id.au/archives/2010/05/01/portal2-2-8-1-api-documentation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TrolledFS: A filesystem with fake file contents</title>
		<link>http://micolous.id.au/archives/2010/04/22/trolledfs-a-filesystem-with-fake-file-contents/</link>
		<comments>http://micolous.id.au/archives/2010/04/22/trolledfs-a-filesystem-with-fake-file-contents/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 21:00:59 +0000</pubDate>
		<dc:creator>micolous</dc:creator>
				<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://micolous.id.au/?p=250</guid>
		<description><![CDATA[My friend [gm] had this idea for a filesystem. It would take a real filesystem, and then whenever a user requested to open a file, it would instead give them a contents of another file from another folder, determined by &#8230; <a href="http://micolous.id.au/archives/2010/04/22/trolledfs-a-filesystem-with-fake-file-contents/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>My friend <a href="http://gm.stackunderflow.com/blog/">[gm]</a> had this idea for a filesystem.  It would take a real filesystem, and then whenever a user requested to open a file, it would instead give them a contents of another file from another folder, determined by it&#8217;s file extension.  For example, it would map all AVI files to a single AVI file in another folder.</p>
<p>Because he didn&#8217;t implement it, and I got bored, I ended up <a href="http://micolous.id.au/static/projects/junkcode/trolledfs.py.bz2">writing &#8220;TrolledFS&#8221; as a FUSE filesystem module in Python</a>.</p>
<p>The module requests two options, <code>root</code>, which is the directory that provides the structure of the filesystem (ie: it will appear to be a copy of this folder), and <code>fakes</code>, a folder containing replacement files.  So if you requested <code>example.avi</code>, it would map it to the first file with the AVI extension in the fakes folder.</p>
<p>It is based on the Xmp.py (example) filesystem module from FUSE&#8217;s Python bindings, with all of the write calls filtered out.  Instead, filesystem will say it is a read-only filesystem.  If a file has no match in the fakes folder, the filesystem will say there was an I/O error.</p>
]]></content:encoded>
			<wfw:commentRss>http://micolous.id.au/archives/2010/04/22/trolledfs-a-filesystem-with-fake-file-contents/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Smooth scrolling marquees in GTK#</title>
		<link>http://micolous.id.au/archives/2010/04/20/smooth-scrolling-marquees-in-gtksharp/</link>
		<comments>http://micolous.id.au/archives/2010/04/20/smooth-scrolling-marquees-in-gtksharp/#comments</comments>
		<pubDate>Mon, 19 Apr 2010 20:06:28 +0000</pubDate>
		<dc:creator>micolous</dc:creator>
				<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://micolous.id.au/?p=244</guid>
		<description><![CDATA[Marquees aren&#8217;t normally supported in GTK#. You have to write an implementation yourself, using the ViewPort and Label controls. You can do that with this bit of code. It&#8217;s a bit of a hack, you need to add a bunch &#8230; <a href="http://micolous.id.au/archives/2010/04/20/smooth-scrolling-marquees-in-gtksharp/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Marquees aren&#8217;t normally supported in GTK#.  You have to write an implementation yourself, using the ViewPort and Label controls.  You can do that with this bit of code.  It&#8217;s a bit of a hack, you need to add a bunch of whitespace to your text to display so that the text properly &#8220;scrolls in&#8221; at the start, and scrolls out properly as well without graphical glitches.  This code runs nice and smooth by moving the text to the left by 3px every 33ms (so it works out to about 30fps).</p>
<p>Video demo (<a href="http://www.youtube.com/watch?v=HIO4fS-I-f4">or you can watch it on YouTube</a>):</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/HIO4fS-I-f4&#038;hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/HIO4fS-I-f4&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p>You need to put this code inside your Gtk.Window.</p>
<pre class="prettyprint">public partial class MainWindow : Gtk.Window
{
	// viewport which we use to contain the label and handle the scrolling of the marquee.
	private Viewport vpMarquee = new Viewport();

	// marquee text should have some padding before and after the text, to avoid rendering errors, and
	// to allow the text to "flow in" when it is reset after reaching the end.
	private Label lblMarquee = new Label("                                                                                                 [lblMarquee] Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec metus quam, ullamcorper eu suscipit quis, rutrum sit amet massa.                                                                                                 ");//" Nunc dapibus accumsan metus, commodo placerat urna blandit non. Nullam turpis justo, dictum quis dignissim non, vehicula vel lorem. Fusce congue purus odio, lobortis pulvinar neque. Integer dui odio, venenatis sed tincidunt in, fringilla id urna. Maecenas faucibus massa eu orci tincidunt ac vulputate nibh aliquam. Aliquam ullamcorper erat nunc. Vestibulum hendrerit adipiscing neque quis interdum.");

	public MainWindow () : base(Gtk.WindowType.Toplevel)
	{
		// normally you'd be using Stetic, so you need to call it's build-constructor.
		Build ();

		// add the control to the window.  in this example, i'm adding it to a VBox control as the last element.
		vpMarquee.BorderWidth = 0;
		vpMarquee.Add (lblMarquee);
		this.vbox1.PackEnd (vpMarquee, false, false, 0);

		// update marquee every 33ms (~30fps)
		GLib.Timeout.Add (33, new GLib.TimeoutHandler (MarqueeUpdate));

		// add other code here for other things...
	}

	bool MarqueeUpdate ()
	{
		Application.Invoke (delegate {
			// calculate the total amount of space the marquee requires.  this only works because I've manually set the size of the window,
			// otherwise you need another way to get the width of the window instead of this.
			double n = vpMarquee.Hadjustment.Upper - this.WidthRequest;
			if (n < 1)
				// safety incase we don't have an actual width calculated width
				n = 1;

			//Console.WriteLine("{0} > {1} ?", vpMarquee.Hadjustment.Value, n);
			if (vpMarquee.Hadjustment.Value >= n) {
				// we've reached the end.  reset the marquee to the 0-position.
				vpMarquee.Hadjustment.Value = 0;
			} else {
				// scroll the marquee to the left by 3px
				vpMarquee.Hadjustment.Value += 3;
			}

			// tell gtk# we want it to take into account the updated value.
			vpMarquee.Hadjustment.ChangeValue ();
			vpMarquee.Hadjustment.Change ();

			// redraw the control and it's children (the label).
			vpMarquee.ShowAll ();
		});

		// tell Timeout we want to be called again.
		return true;
	}

	// ... add more stuff here for other functionality.
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://micolous.id.au/archives/2010/04/20/smooth-scrolling-marquees-in-gtksharp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SDL VNC Server module (v2)</title>
		<link>http://micolous.id.au/archives/2010/02/17/sdl-vnc-server-module-v2/</link>
		<comments>http://micolous.id.au/archives/2010/02/17/sdl-vnc-server-module-v2/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 16:31:47 +0000</pubDate>
		<dc:creator>micolous</dc:creator>
				<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://micolous.id.au/?p=225</guid>
		<description><![CDATA[Time for a version two! There&#8217;s a new version of the patch to SDL 1.2.14. You need a clean source tree with this, so remove v1 of the patch before applying this one. Changes: Mouse cursors now work correctly. You &#8230; <a href="http://micolous.id.au/archives/2010/02/17/sdl-vnc-server-module-v2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Time for a version two!  There&#8217;s <a href="/static/projects/sdlvnc/SDL-video-vnc-v2.diff.bz2">a new version of the patch to SDL 1.2.14</a>.  You need a clean source tree with this, so remove v1 of the patch before applying this one.</p>
<p>Changes:</p>
<ul>
<li>Mouse cursors now work correctly.</li>
<li>You can now disable the &#8220;always shared&#8221; function of the VNC server and allow a client to take exclusive control with <code>SDL_VNC_ALWAYS_SHARED="0"</code>.</li>
<li>You can change the display number manually with <code>SDL_VNC_DISPLAY</code>.</li>
<li>8 bpp displays are now supported.</li>
<li>pygame applications work at 16, 24 and 32 bpp display depths. 8 doesn&#8217;t work properly.</li>
<li>This module now lies by default about the supported display depths reported by <code>SDL_ListModes</code>.  It defaults to 16 bpp only, in order to make pygame work properly.  You can change what it says this with <code>SDL_VNC_DEPTH</code>, or setting it to 0 to say all depths are supported.  This doesn&#8217;t limit calls to <code>SDL_SetVideoMode</code>.</li>
<li>You can tell the VNC server to ignore all client events by setting <code>SDL_VNC_VIEW_ONLY="1"</code>.</li>
</ul>
<p>There&#8217;s also a <code>README.VNC</code> included, which documents the functionality of the library and use of it&#8217;s environment variables.</p>
<p><strong>Edit (2010-08-29):</strong> Just to clarify, this software is licensed under the same terms as SDL 1.2.14 itself, <a href="http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html">the GNU Lesser General Public License version 2.1</a>, or at your option, any later version as published by the Free Software Foundation, Inc.</p>
]]></content:encoded>
			<wfw:commentRss>http://micolous.id.au/archives/2010/02/17/sdl-vnc-server-module-v2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SDL VNC Server module</title>
		<link>http://micolous.id.au/archives/2010/02/16/sdl-vnc-server-module/</link>
		<comments>http://micolous.id.au/archives/2010/02/16/sdl-vnc-server-module/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 19:45:32 +0000</pubDate>
		<dc:creator>micolous</dc:creator>
				<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://micolous.id.au/?p=218</guid>
		<description><![CDATA[I keep writing things related to VNC, and coding in C. It&#8217;s seriously starting to worry me. I&#8217;ve spent the last couple of days writing a new SDL video output module, which acts as a VNC server using libvncserver. Here &#8230; <a href="http://micolous.id.au/archives/2010/02/16/sdl-vnc-server-module/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I keep writing things related to VNC, and coding in C.  It&#8217;s seriously starting to worry me.</p>
<p>I&#8217;ve spent the last couple of days writing a new SDL video output module, which acts as a VNC server using <a href="http://libvncserver.sourceforge.net/">libvncserver</a>.  <a href="/static/projects/sdlvnc/SDL-video-vnc-v1.diff.bz2">Here are the patches against SDL 1.2.14</a>.  To use VNC support, you need to run <code>./configure</code> with <code>--enable-video-vnc</code>, and once built and installed, run the SDL application with the environment variable <code>SDL_VIDEODRIVER="vnc"</code>.</p>
<p>What works:</p>
<ul>
<li>16, 24 and 32-bit true-colour displays.</li>
<li>Mouse events.</li>
<li>Keyboard events.</li>
</ul>
<p>What&#8217;s left to do:</p>
<ul>
<li>Fix mouse cursors so they display correctly.</li>
<li>8-bit (paletted) displays.</li>
<li>Handle surface locking properly.</li>
<li>Reduce/eliminate tearing on frequent screen updates.</li>
<li>Run the libvncserver event loop inside SDL&#8217;s event loop system.</li>
<li>Implement a password on the VNC server and some sort of simple access control.</li>
<li>Implement a view-only mode.</li>
<li>Allow setting the display number manually.</li>
<li>pygame applications.</li>
<li>Fix screen resolution change colour issues.</li>
</ul>
<p>What will never work:</p>
<ul>
<li>OpenGL surfaces.</li>
<li>CDROMs, Joysticks and Sound over VNC.</li>
<li>YUV video output.</li>
</ul>
<p>I&#8217;ve had a lot of success with using <a href="http://www.sand-labs.org/owb/wiki">the Origyn web browser</a> (a WebKit/SDL-based web browser)  and <a href="http://www.paradroid.net/cgterm/">cgterm</a> (a SDL C64/C128 telnet client) with this output method.  Any SDL application that doesn&#8217;t use OpenGL surfaces <strong>should</strong> be able to run with this output module.</p>
<p>Some pictures:</p>
<p><a href="/static/projects/sdlvnc/sdl-video-vnc-v1-owb.png"><img src="/static/projects/sdlvnc/sdl-video-vnc-v1-owb_small.png" alt="[origyn web browser in tightvnc]" title="Origyn Web Browser (WebKit/SDL) in TightVNC"/></a> <a href="/static/projects/sdlvnc/sdl-video-vnc-v1-cgterm.png"><img src="/static/projects/sdlvnc/sdl-video-vnc-v1-cgterm_small.png" alt="[cgterm in tightvnc]" title="cgterm in TightVNC"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://micolous.id.au/archives/2010/02/16/sdl-vnc-server-module/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

