<?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>therning.org/ magnus &#187; vala</title>
	<atom:link href="http://therning.org/magnus/archives/tag/vala/feed" rel="self" type="application/rss+xml" />
	<link>http://therning.org/magnus</link>
	<description>Incoherent mumblings</description>
	<lastBuildDate>Wed, 17 Mar 2010 00:39:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Epilicious is dead, say hello to BMS</title>
		<link>http://therning.org/magnus/archives/762</link>
		<comments>http://therning.org/magnus/archives/762#comments</comments>
		<pubDate>Fri, 23 Oct 2009 20:38:19 +0000</pubDate>
		<dc:creator>Magnus</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[epilicious]]></category>
		<category><![CDATA[epiphany]]></category>
		<category><![CDATA[seed]]></category>
		<category><![CDATA[vala]]></category>

		<guid isPermaLink="false">http://therning.org/magnus/?p=762</guid>
		<description><![CDATA[With Python being dropped as a language for extensions in epiphany 2.28 I needed to replace epilicious.  I tried writing it in JavaScript (seed was integrated in 2.28), but I gave up due to hitting too many hurdles on the way. Instead I decided to rewrite epilicious using Vala and a minimal layer of [...]]]></description>
			<content:encoded><![CDATA[<p>With Python being dropped as a language for extensions in epiphany 2.28 I needed to replace <a href="http://therning.org/magnus/computer/epilicious">epilicious</a>.  I tried writing it in JavaScript (<a href="http://live.gnome.org/Seed">seed</a> was integrated in 2.28), but I gave up due to hitting too many hurdles on the way. Instead I decided to rewrite epilicious using <a href="http://live.gnome.org/Vala">Vala</a> and a minimal layer of C.</p>

<p>It turned out to be very doable, despite epiphany&#8217;s extension API lacking Vala bindings (Cosimo Cecchi, I&#8217;m looking at <a href="http://uwstopia.nl/blog/2008/07/vala-bindings-for-epiphany-extensions">you</a> <img src='http://therning.org/magnus/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  ).  Basically I did the following setup:</p>

<ol>
<li>Add the extension following the instructions in <a href="http://projects.gnome.org/epiphany/documentation/extensions/index.html">Writing Epiphany Extensions</a> by Adam Hooper.</li>
<li>Add a check for valac in <code>configure.ac</code>.</li>
<li>Add a rule in the extension&#8217;s <code>Makefile.am</code> to generate a C header file for all the Vala code, for use from C.</li>
</ol>

<p>Then I started writing the actual extension.  I did the minimal amount of work in C, trying to escape as soon as possible into Vala.  In the few places I needed to call from Vala into C I would declare a delegate in Vala, and pass a function from C<sup>i</sup>.</p>

<p>I call this new version BMS, for <em>b</em>ook<em>m</em>ark <em>s</em>ynchronisation.  I have a <a href="http://therning.org/magnus_files/epiphany-extension-bms-1.0-2.src.tar.gz">patch for BMS that applies to epiphany 2.28.1</a>.  (The file also contain a <code>PKGBUILD</code> in order to delight Arch users <img src='http://therning.org/magnus/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  )</p>

<p>I should probably point out that while epilicious never could be called polished, BMS is even less so.  I might find the time to make it multi-threaded, so that it&#8217;s possible to do some sort of progress dialogue, but don&#8217;t hold your breath.  In the back of my mind is also the thought of rewriting it yet again, in JavaScript/seed.</p>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='linkbuttons'><a href='http://digg.com/submit?phase=2&amp;url=http://therning.org/magnus/archives/762&amp;title=Epilicious is dead, say hello to BMS' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://therning.org/magnus/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://reddit.com/submit?url=http://therning.org/magnus/archives/762&amp;title=Epilicious is dead, say hello to BMS' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://therning.org/magnus/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a>  <a title='See more bookmark and sharing options...' href='http://therning.org/magnus/archives/762#bookmarkify' rel='nofollow'><small>More&nbsp;&raquo;</small></a></div></div><ol class="footnotes"><li id="footnote_0_762" class="footnote">The format of <code>.vapi</code> files are unknown to me, and I haven&#8217;t managed to find much documentation.  Using function pointers seemed like an easier way, especially given that I needed this in exactly 3 places.</li></ol>]]></content:encoded>
			<wfw:commentRss>http://therning.org/magnus/archives/762/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
