<?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>Prince of Code Blog</title>
	<atom:link href="http://princeofcode.com/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://princeofcode.com/blog</link>
	<description>software and stuff</description>
	<lastBuildDate>Mon, 04 Oct 2010 01:42:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>We&#8217;re going to GDC Online!</title>
		<link>http://princeofcode.com/blog/?p=409</link>
		<comments>http://princeofcode.com/blog/?p=409#comments</comments>
		<pubDate>Mon, 04 Oct 2010 01:27:22 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[awesomium]]></category>
		<category><![CDATA[khrona]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[gdc]]></category>
		<category><![CDATA[gdc online]]></category>
		<category><![CDATA[graduation]]></category>
		<category><![CDATA[hiring]]></category>

		<guid isPermaLink="false">http://princeofcode.com/blog/?p=409</guid>
		<description><![CDATA[Lots of stuff can happen in nine months. Let me give a recap: I graduated in early August with my Bachelor's of Science in Computer Science from Sam Houston State University. Was a pretty wild ride-- met some cool people and learned some neat stuff (mostly about myself-- which was probably more important anyways). I'm overjoyed that I've finished my degree but [...]]]></description>
			<content:encoded><![CDATA[<p>Lots of stuff has gone down in the past couple months. Let me give a recap:</p>
<h1>I Graduated</h1>
<p><a href="http://princeofcode.com/blog/wp-content/uploads/2010/10/grad2.jpg"><img src="http://princeofcode.com/blog/wp-content/uploads/2010/10/grad2.jpg" alt="Obligatory Graduation Photo" title="Obligatory Graduation Photo" width="471" height="467" class="aligncenter size-full wp-image-417" /></a></p>
<p>Yup, that&#8217;s me in the fancy hat. I graduated in early August with my Bachelor&#8217;s of Science in Computer Science from Sam Houston State University.</p>
<p>Was a pretty wild ride&#8211; met some cool people and learned some neat stuff (mostly about myself&#8211; which was probably more important anyways).</p>
<p>I&#8217;m overjoyed that I&#8217;ve finished my degree but I&#8217;m really under no illusions about this thing; no degree (especially not a Bachelor&#8217;s) is a magic wand. If anything, university has taught me one thing: if I want something, I&#8217;m going to have to work for it&#8212; hard. Which brings me to my next topic:</p>
<h1>Khrona (My Company) is Growing</h1>
<p><a href="http://princeofcode.com/blog/wp-content/uploads/2010/10/khrona_print_logo.png"><img src="http://princeofcode.com/blog/wp-content/uploads/2010/10/khrona_print_logo.png" alt="Khrona Logo" title="Khrona Logo" width="441" height="172" class="aligncenter size-full wp-image-451" /></a></p>
<p>In retrospect, it probably wasn&#8217;t the smartest idea to launch a software company by myself while still finishing school.</p>
<p>As crazy as it was, things still somehow turned out alright&#8211; we&#8217;re now turning a decent profit and making new sales regularly. So much so, in fact, I recently hired my best friend and fellow programmer, Robert, to help out with development and marketing. I&#8217;m training him right now in my spare time and he&#8217;s already made a couple contributions (like the sample projects in the latest Awesomium SDK).</p>
<p>I&#8217;m also looking to hire a designer to help out with the site, branding, and promotional material&#8212; I designed most of the site, demos, and logos for Khrona and Awesomium completely by myself (which is pretty incredible considering I&#8217;m primarily a programmer) but it&#8217;s currently taking up a large part of my time that I&#8217;d rather allocate elsewhere (like the development of some of my other projects). Let me know if you have any recommendations!</p>
<h1>New Release, Awesomium v1.6 RC1</h1>
<p><a href="http://www.khrona.com/2010/09/18/super-hot-new-release-awesomium-v1-6-rc1-out-now/"><img src="http://princeofcode.com/blog/wp-content/uploads/2010/10/awesomium_1.6_rc1_dark_small.png" alt="Awesomium 1.6 RC1 Logo" title="Awesomium 1.6 RC1 Logo" width="470" height="149" class="aligncenter size-full wp-image-455" /></a></p>
<p>It took a couple extra months to get out but we finally <a href="http://www.khrona.com/2010/09/18/super-hot-new-release-awesomium-v1-6-rc1-out-now/">launched</a> version 1.6 of Awesomium! I&#8217;m rather proud of the latest iteration of Awesomium due to its super-sexy crash isolation (multi-process architecture baby!), Flash support on Mac OSX, and mega-useful resource interception system.</p>
<p>We&#8217;ll be pushing out another release candidate quite soon (RC2) to fix a couple issues that testers found last week but, for the most part, 1.6 is approaching a stable release. (After nearly a year of development, exciting!)</p>
<h1>We&#8217;re Going to GDC Online in Austin, Texas</h1>
<p><a href="http://gdconline.com"><img src="http://princeofcode.com/blog/wp-content/uploads/2010/10/gdc-online-logo.jpg" alt="GDC Online Logo" title="GDC Online Logo" width="360" height="270" class="aligncenter size-full wp-image-480" /></a></p>
<p>We&#8217;ll be attending <a href="http://www.gdconline.com/">Game Developers Conference Online</a> this week (I leave for Austin tomorrow morning). This is my first GDC and so I am absolutely stoked&#8211; doubly so concerning that GDC Online focuses on game development in the context of the Internet (which is completely &#8220;my thing&#8221;).</p>
<p>Also, we made t-shirts! Here&#8217;s a blurry pic from my iPhone:</p>
<p><a href="http://princeofcode.com/blog/wp-content/uploads/2010/10/osm_shirt_back.jpg"><img src="http://princeofcode.com/blog/wp-content/uploads/2010/10/osm_shirt_back.jpg" alt="Khrona/Awesomium Shirt (back)" title="Khrona/Awesomium Shirt (back)" width="482" height="557" class="aligncenter size-full wp-image-467" /></a></p>
<p>Yes, that is &#8220;Awesomium&#8221; printed in the style of the &#8220;Metallica&#8221; logo.</p>
<p>Come say hi or grab a beer with us if you&#8217;re attending the conference as well! We&#8217;ll probably be wearing these bad-ass shirts the entire week.</p>
]]></content:encoded>
			<wfw:commentRss>http://princeofcode.com/blog/?feed=rss2&amp;p=409</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Good to Be Back</title>
		<link>http://princeofcode.com/blog/?p=390</link>
		<comments>http://princeofcode.com/blog/?p=390#comments</comments>
		<pubDate>Tue, 19 Jan 2010 23:47:39 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[awesomium]]></category>
		<category><![CDATA[khrona]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[akarui]]></category>
		<category><![CDATA[codebasehq]]></category>
		<category><![CDATA[hiatus]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[v1.5]]></category>
		<category><![CDATA[v1.6]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://princeofcode.com/blog/?p=390</guid>
		<description><![CDATA[Well, I've just returned from a three-month hiatus and I gotta say it feels good to be back. I took the time off so that I could focus on two things: planning my new company and finishing my degree. Speaking of which, I'm happy to announce that the KHRONA site finally went live [...]]]></description>
			<content:encoded><![CDATA[<p>Well, I&#8217;ve just returned from a three-month hiatus and I gotta say it feels good to be back. I took the time off so that I could focus on two things: planning my new company and finishing my degree.</p>
<p>Speaking of which, I&#8217;m happy to announce that the KHRONA site finally went live. I went through at least nine different major design revisions until I settled on the final template (which happened to be the first design, go figure). Check it out at <a href="http://www.khrona.com">KHRONA.com</a> and tell me what you think.<br />
<a href="http://www.khrona.com"><img src="http://princeofcode.com/blog/wp-content/uploads/2010/01/khrona-chrome-mini.jpg" alt="KHRONA Logo" title="KHRONA Logo" width="499" height="140" class="aligncenter size-full wp-image-404" /></a></p>
<p>There&#8217;s still much work left to be done with the site&#8211; I&#8217;m using this new service, <a href="http://www.codebasehq.com">CodeBaseHQ</a>, to manage issue tracking, repositories, and team management for Awesomium and our other software. I&#8217;ve only had the past week to play around with it but I&#8217;ve already fallen in love with its simplicity and power. Anyways, I spent the last few days integrating their XML API so that users can view all open issues directly on our site. I thought it would be rather trivial until I realized that I&#8217;m limited to 80 API requests an hour so I ended up spending most of my time writing a fancy little SQL-based cache to get around this. This turned out to actually be a good thing since the cache also helped speed up page loads (woo, fun accomplishment of the week).</p>
<p>Oh, by the way, Awesomium v1.5 is now available for download/licensing! Click <a href="http://www.khrona.com/products/awesomium">here</a> to check it out. Honestly, this build was quite ready to be shipped since at least October but, since the project has now switched hands to KHRONA, I couldn&#8217;t launch the release until the company was fully formed and live.</p>
<p>As for those who have expressed concern that $5000 is a little steep for a commercial license, I think you&#8217;ll be very pleased to hear that we are working out an additional pricing tier that will be much more friendly to indie-developers. Until this materializes, please feel free to <a href="http://www.khrona.com/products/awesomium/download">try out the SDK</a> in your own projects&#8211; Awesomium is still free for non-commercial use and internal evaluation, you only need to purchase a license once your commercial application begins distribution.</p>
<p>I&#8217;m now working on a maintenance release of Awesomium 1.5.1 that includes a few fixes and enhancements (primarily, the ability to catch and handle external navigations&#8211; such as those initiated via target=&#8221;_blank&#8221; or a Flash plugin). Look for it in about a week.</p>
<p>Development of Awesomium 1.6 has been well under way for a while now (the branch actually started back in August). The new build will be bringing some mighty new features including: multi-process architecture (for crash isolation among other things), Linux support, performance boosts, and better compatibility with HTML5. I&#8217;m still debating whether or not to include support for HTML5 video&#8211; I&#8217;m considering dropping it for now as it will increase the size of the library significantly and I don&#8217;t see too much widespread use of the <a href="http://www.w3schools.com/html5/tag_video.asp">tag</a>. (If you think otherwise, please let me know in the comments).</p>
<p>As for future plans, my second priority after Awesomium is launching Akarui, our cross-platform Flash embedding layer. Not much work has been done on the project since last year and I&#8217;m eager to start back up on it. We&#8217;ll just have to see how much time I have left over from my other exploits.</p>
]]></content:encoded>
			<wfw:commentRss>http://princeofcode.com/blog/?feed=rss2&amp;p=390</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>NaviDemo v2.0, Released At Last!</title>
		<link>http://princeofcode.com/blog/?p=374</link>
		<comments>http://princeofcode.com/blog/?p=374#comments</comments>
		<pubDate>Sun, 11 Oct 2009 08:14:03 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[awesomium]]></category>
		<category><![CDATA[khrona]]></category>
		<category><![CDATA[navilibrary]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[licensing]]></category>
		<category><![CDATA[navidemo]]></category>
		<category><![CDATA[non-commercial]]></category>

		<guid isPermaLink="false">http://princeofcode.com/blog/?p=374</guid>
		<description><![CDATA[The final build of NaviDemo v2.0 has just been released, get it while it's hot! In case you don't know what it is, NaviDemo is a fully-functional 3D web-browser that was created to demonstrate one of the possible applications of Awesomium. It's actually really fun to use as more than just [..]]]></description>
			<content:encoded><![CDATA[<p><a href="http://princeofcode.com/blog/wp-content/uploads/2009/10/navidemo2_logo.png"><img src="http://princeofcode.com/blog/wp-content/uploads/2009/10/navidemo2_logo.png" alt="NaviDemo v2 Logo" title="NaviDemo v2 Logo" width="499" height="241" class="aligncenter size-full wp-image-377" /></a><br />
<br/></p>
<p>The final build of NaviDemo v2.0 has just been released, <strong><a href="http://princeofcode.com/awesomium.php#downloads">get it while it&#8217;s hot</a></strong>! In case you don&#8217;t know what it is, NaviDemo is a fully-functional 3D web-browser that was created to demonstrate one of the possible applications of Awesomium. It&#8217;s actually really fun to use as more than just a demo; think of it as a visual alternative to tabbed browsing&#8211; you can group related web pages by location, see the full contents of multiple web pages at a glance, and intuitively navigate through your active web-browsing experience in the context of a 3D terrain. Try it out, you might like it!<br />
<br/></p>
<p>Check out the following video for a little preview:</p>
<p><object width="480" height="295"><param name="movie" value="http://www.youtube.com/v/jbkEmWw9krc&#038;hl=en&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/jbkEmWw9krc&#038;hl=en&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="295"></embed></object></p>
<p><br/></p>
<p>On a different note, I now recognize that students, university-folk, closet programmers, and other tinkerers make up a large part of the Awesomium user base. As a student myself, I think it would be most unwise to keep this technology out of reach of some of the most inventive and innovative minds around&#8211; we&#8217;re only at the tip of the iceberg in terms of discovering all the uses for Awesomium and since this project is still young, I wouldn&#8217;t want to do anything that might stifle such beneficial activity. With this realization in hand, I would like to announce that Awesomium v1.5 will be free for non-commercial use.</p>
<p>We have come to some conclusions regarding commercial licensing as well and will be announcing some of those details in the coming week. Stay tuned for those and more updates and enjoy the new NaviDemo!</p>
]]></content:encoded>
			<wfw:commentRss>http://princeofcode.com/blog/?feed=rss2&amp;p=374</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>A quick update</title>
		<link>http://princeofcode.com/blog/?p=349</link>
		<comments>http://princeofcode.com/blog/?p=349#comments</comments>
		<pubDate>Mon, 28 Sep 2009 06:04:33 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[awesomium]]></category>
		<category><![CDATA[khrona]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[awesomium v1.5]]></category>
		<category><![CDATA[licenses]]></category>
		<category><![CDATA[sdl]]></category>
		<category><![CDATA[test suite]]></category>
		<category><![CDATA[web flow]]></category>

		<guid isPermaLink="false">http://princeofcode.com/blog/?p=349</guid>
		<description><![CDATA[Hey everyone, I just wanted to give a quick update as to the current happenings with Awesomium and KHRONA.]]></description>
			<content:encoded><![CDATA[<p>Hey everyone, I just wanted to give a quick update as to the current happenings with Awesomium and KHRONA.</p>
<p>First off, I must admit that I underestimated the time it would take to put together a company, draw up a solid set of licenses, and put all the necessary infrastructure in place to sell software online seriously. I personally apologize for the delay but I am confident that my decision to take it slow and steady in this critical juncture will benefit everyone in the end. On that note, things are finally falling into place and we&#8217;re almost ready to announce further details regarding the release of Awesomium v1.5, stay tuned folks!</p>
<p>On the development side, I&#8217;ve been putting together a new, cross-platform, SDL-based demo as an embedding example for the upcoming release. The &#8220;Web Flow&#8221; Demo is a simple web-browser with a 3D cover-flow-like interface:</p>
<p><center><a href="http://princeofcode.com/blog/wp-content/uploads/2009/09/29941143.png"><img src="http://princeofcode.com/blog/wp-content/uploads/2009/09/29941143-300x223.png" alt="Web-Flow Demo" title="Web-Flow Demo" width="300" height="223" class="aligncenter size-medium wp-image-351" /></a></center></p>
<p>In other news, a fair amount of engineering has been put into development of a new test suite to ensure the stability of current and future releases. Awesomium v1.5 has now undergone internal testing for the past month and I can confidently announce that it is ready for production release. I&#8217;m really excited about this development and can&#8217;t wait to get this build out the door and into your hands!</p>
]]></content:encoded>
			<wfw:commentRss>http://princeofcode.com/blog/?feed=rss2&amp;p=349</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>New and Improved: Javascript Integration in Awesomium</title>
		<link>http://princeofcode.com/blog/?p=285</link>
		<comments>http://princeofcode.com/blog/?p=285#comments</comments>
		<pubDate>Thu, 27 Aug 2009 18:35:32 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[awesomium]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[v1.5]]></category>

		<guid isPermaLink="false">http://princeofcode.com/blog/?p=285</guid>
		<description><![CDATA[Javascript integration has been much improved in the upcoming release of Awesomium! You can now create global Javascript objects and manipulate them directly from C++, call Javascript functions with native C++ variables, and evaluate arbitrary Unicode strings of Javascript. What’s more, the workhorse of our Javascript/C++ integration, the JSValue class, has been extended to support Objects, Arrays, and Unicode Strings in addition to its [...]]]></description>
			<content:encoded><![CDATA[<p>Javascript integration has been much improved in the upcoming release of Awesomium! You can now create global Javascript objects and manipulate them directly from C++, call Javascript functions with native C++ variables, and evaluate arbitrary Unicode strings of Javascript. What’s more, the workhorse of our Javascript/C++ integration, the JSValue class, has been extended to support Objects, Arrays, and Unicode Strings in addition to its existing support for Booleans, Standard Strings, Numbers, and Null!</p>
<p><br/></p>
<h2>Global Javascript Objects</h2>
<p>In previous versions, you could manipulate the &#8216;Client&#8217; object by setting properties and registering callbacks via WebView::setProperty and WebView::setCallback, respectively, and access it via Javascript as a global object. This concept has now been extended so that you can create as many global Javascript objects as you like per WebView—you’re no longer limited to working with a single &#8216;Client&#8217; object. These objects are linked to the lifetime of the WebView so this feature is quite useful for specifying persistent data for each WebView.</p>
<p>Creating, manipulating, and accessing these objects is very simple in the new API. To create an object, simply call WebView::createObject with the name that you want the object to appear as in Javascript.</p>
<p>For example:</p>
<pre>
myWebView->createObject(L"MyObject");
</pre>
<p>The above would create a global Javascript object that you can access as &#8220;MyObject&#8221; from any web page loaded into your WebView. Note that WebView::createObject accepts a wide string (hence &#8216;L&#8217;, the wide string literal prefix).</p>
<p>Of course, creating objects alone isn&#8217;t very useful&#8211; to give the object some properties, you can use WebView::setObjectProperty:</p>
<pre>
myWebView->setObjectProperty(L"MyObject", L"name", "foobar");
myWebView->setObjectProperty(L"MyObject", L"color", "Blue");
myWebView->setObjectProperty(L"MyObject", L"level", 25);
</pre>
<p>You can set as many properties as you want, setting a property more than once will replace the previous value. Notice that the last parameter to setObjectProperty accepts a JSValue (more on that later).</p>
<p>Another nifty feature of these global Javascript objects is that you can bind C++ callbacks to them and invoke events from Javascript. For example:</p>
<pre>
myWebView->setObjectCallback(L"MyObject", L"myCallback");
</pre>
<p>The above code would add a new method, &#8220;myCallback&#8221;, to &#8220;MyObject&#8221; that, when called from any page via Javascript, will invoke WebViewListener::onCallback with the name of the object, the name of the callback, and the arguments passed, if any.</p>
<p>For example, say you made a button that calls &#8220;myCallback&#8221; with a single string argument (&#8221;hello!&#8221;) when clicked:</p>
<pre>
&lt;input type="button" value="Click Me!"
    onclick="MyObject.myCallback('hello!')" /&gt;
</pre>
<p>You could then intercept this callback in WebViewListener::onCallback (you&#8217;ll need to register your WebViewListener first via WebView::setListener):</p>
<pre>
void MyListener::onCallback(const std::wstring&#038; objectName, const
    std::wstring&#038; callbackName, const Awesomium::JSArguments&#038; args)
{
    if(objectName == L"MyObject" &#038;&#038; callbackName == L"myCallback")
        std::wstring value = args[0].toString(); // value is 'hello!'
}
</pre>
<p><br/></p>
<h2>JSValue Improvements</h2>
<p>The JSValue class has also undergone some major improvements with its new support for Objects, Arrays, and Unicode Strings. The JSValue class is used as an intermediary to translate C++ types into Javascript variables and vice-versa. To get a better understanding of how this relationship works, here’s how types are mapped between Javascript and C++ using JSValue:</p>
<table>
<tr>
<th>Javascript</th>
<th>C++</th>
</tr>
<tr>
<td>Number</td>
<td>double or int</td>
</tr>
<tr>
<td>Boolean</td>
<td>bool</td>
</tr>
<tr>
<td>String</td>
<td>std::wstring or std::string</td>
</tr>
<tr>
<td>Object</td>
<td>std::map&lt;std::wstring, JSValue&gt;</td>
</tr>
<tr>
<td>Array</td>
<td>std::vector&lt;JSValue&gt;</td>
</tr>
<tr>
<td>Null or Undefined</td>
<td>JSValue with null type</td>
</tr>
</table>
<p><br/></p>
<h3>JSValue Type: Unicode Strings</h3>
<p>The support for wide strings was added as part of the initiative to improve Unicode support in Awesomium; almost every bit of relevant API now supports Unicode strings. This change also affects JSValue::toString, which now returns a wide string instead of a standard string.</p>
<p><br/></p>
<h3>JSValue Type: Objects</h3>
<p>Support for passing Javascript Objects to/from C++ is one of the biggest new features in Awesomium v1.5. As specified in the table above, these Objects are modeled in C++ as a std::map with a string key and a JSValue for a value (typedef&#8217;d as JSValue::Object).</p>
<p>For example, say you had an object &#8216;Person&#8217; in Javascript:</p>
<pre>
var Person = {
   name: 'Bob',
   age: 22,
};
</pre>
<p>You could then retrieve a copy of this object in C++:</p>
<pre>
JSValue myValue = myWebView->executeJavascriptWithResult("Person").get();

if(myValue.isObject())
{
   JSValue::Object person = myValue.getObject();

   std::wstring name = person[L"name"].toString(); // value is 'Bob'
   int age = person[L"age"].toInteger(); // value is '22'
}
</pre>
<p><br/></p>
<h3>JSValue Type: Arrays</h3>
<p>JSValue also now supports Javascript Arrays! On the C++ side, Arrays are modeled as a std::vector of JSValues (typedef&#8217;d as JSValue::Array).</p>
<p>So, for example, if you had the following array in Javascript:</p>
<pre>
var myArray = [1, 2, "three", 4, "five"];
</pre>
<p>You could access it in C++ like so:</p>
<pre>
JSValue myValue = myWebView->executeJavascriptWithResult("myArray").get();

if(myValue.isArray())
{
   JSValue::Array myArray = myValue.getArray();

   int first = myArray[0].toInteger(); // value is '1'
   int second = myArray[1].toInteger();  // value is '2'
   std::wstring third = myArray[2].toString(); // value is 'three'
}
</pre>
<p><br/></p>
<h3>Compositions of JSValues</h3>
<p>It is also worthy to note that JSValue is flexible enough to accommodate compositions of arrays, objects, and other types. It supports arrays of arrays, arrays of objects, objects with array values, and all other nested permutations along this line.</p>
<p>For example, say you wanted to create a JSValue that is functionally equivalent to the following Javascript Object:</p>
<pre>
var Player = {
   name: 'Rex',
   HP: 1000,
   items: ['Armor', 'Sword', 'Gauntlets'],
   stats: {
      strength: 57,
      defense: 90,
      dexterity: 24
   }
};
</pre>
<p>You could model this Object in C++ as so:</p>
<pre>
JSValue::Object player;

player[L"name"] = "Rex";
player[L"HP"] = 1000;

JSValue::Array items;
items.push_back("Armor");
items.push_back("Sword");
items.push_back("Gauntlets");

player[L"items"] = items;

JSValue::Object stats;
stats[L"strength"] = 57;
stats[L"defense"] = 90;
stats[L"dexterity"] = 24;

player[L"stats"] = stats;
</pre>
<p><br/></p>
<h2>Direct Calling of Javascript Functions</h2>
<p>You can now call a Javascript function directly with JSValues as parameters! </p>
<p>The only way to emulate this behavior previously was to create several temporary properties using the &#8216;Client&#8217; object for your parameters and then call your function with the referenced properties via WebView::executeJavascript. This cumbersome method has been deprecated in favor of the new &#8220;quick-path&#8221; WebView::callJavascriptFunction.</p>
<p>Say you had the following function in Javascript:</p>
<pre>
function addChatMessage(nickname, message) {
   chat = document.getElementById('chat');
   chat.innerText = nickname + ": " + message;
}
</pre>
<p>You can now call it directly from C++ like so:</p>
<pre>
JSArguments args;
args.push_back("Bob");
args.push_back("Hello world!");

myWebView->callJavascriptFunction(L"", L"addChatMessage", args);
</pre>
<p><br/></p>
<h3>Calling Functions Contained Within An Object</h3>
<p>As you may have noticed above, I&#8217;ve specified an empty wide string (L&#8221;") as the first parameter of WebView::callJavascriptFunction. This is because the first parameter allows you to specify the <i>Object</i> that contains the function. In the above example, I&#8217;ve specified an empty string to indicate that this function is in the global scope (and thus is not contained within any object).</p>
<p>Here&#8217;s an example of how to call a function contained within an Object; say you had the following defined in Javascript:</p>
<pre>
var MusicBox = {
   currentTrack: '',
   isPlaying: false,
   play: function(track) {
      this.isPlaying = true;
      this.currentTrack = track;
      displayMsg = document.getElementById('display');
      displayMsg.innerText = "Now playing: " + this.currentTrack;
   }
};
</pre>
<p>You could call this function from C++ by the following:</p>
<pre>
JSArguments args;
args.push_back("Moonlight Sonata");

myWebView->callJavascriptFunction(L"MusicBox", L"play", args);
</pre>
<p><br/></p>
<h2>Conclusion</h2>
<p>It is now easier than ever to pass data between Javascript and C++ using Awesomium v1.5. The new &#8220;Global Javascript Objects&#8221; feature simplifies the task of exposing data in your application to Javascript, JSValue&#8217;s new support for Array and Object types makes it a snap to share complex structures, and direct calling of Javascript functions with JSValue parameters is faster and easier to use than existing methods.</p>
<p>I hope you&#8217;ll enjoy some of these new enhancements to Awesomium! More features and details of the upcoming release will be announced soon, so stay tuned to this blog.</p>
]]></content:encoded>
			<wfw:commentRss>http://princeofcode.com/blog/?feed=rss2&amp;p=285</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Meet &#8216;Khrona&#8217;, My New Company!</title>
		<link>http://princeofcode.com/blog/?p=267</link>
		<comments>http://princeofcode.com/blog/?p=267#comments</comments>
		<pubDate>Mon, 17 Aug 2009 09:31:56 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[awesomium]]></category>
		<category><![CDATA[khrona]]></category>
		<category><![CDATA[personal]]></category>

		<guid isPermaLink="false">http://princeofcode.com/blog/?p=267</guid>
		<description><![CDATA[As part of my commitment to help advance the current state of embedded web technology, I'm happy to announce that I have formed a new company, Khrona, to bring some of my software to market! This is pretty big step for me but I ultimately decided that this was the best way to ensure the long-term potentiality of my technology. This development will impact the Awesomium library in several ways. [..]]]></description>
			<content:encoded><![CDATA[<p>As part of my commitment to help advance the current state of embedded web technology, I&#8217;m happy to announce that I have formed a new company, <a href="http://khrona.com">Khrona</a>, to bring some of my software to market! This is pretty big step for me but I ultimately decided that this was the best way to ensure the long-term potentiality of my technology.</p>
<p>This development will impact the <a href="http://princeofcode.com/awesomium.php">Awesomium</a> library in several ways. Existing releases of Awesomium will no longer be maintained or supported. Future releases of the library will be conducted through Khrona under a new set of commercial licenses. More information about the upcoming release of v1.5 as well as details about the licenses offered shall be announced soon&#8211; you may subscribe to receive updates via e-mail <a href="http://princeofcode.com/awesomium.php">on this page</a>.</p>
<p>Awesomium won&#8217;t be Khrona&#8217;s only product (though it will be where most of its resources will be allocated)&#8211; I don&#8217;t want to let the cat out of the bag just yet but I&#8217;ve got another software project in development that has quite the potential to change the way we browse the web. To stay in the loop, make sure to bookmark the future home of Khrona at <a href="http://khrona.com">KHRONA.COM</a>!</p>
<p>P.S., <em>For those wondering about the timing of this announcement, I must assure you that this has nothing to do with <a href="http://princeofcode.com/blog/?p=257">CCP Games&#8217; use of Awesomium in EVE Online</a>&#8211; the formation of Khrona was planned more than a month ago and so this is merely coincidence.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://princeofcode.com/blog/?feed=rss2&amp;p=267</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>EVE Online To Use Awesomium In New In-Game Web-Browser!</title>
		<link>http://princeofcode.com/blog/?p=257</link>
		<comments>http://princeofcode.com/blog/?p=257#comments</comments>
		<pubDate>Sat, 15 Aug 2009 00:27:11 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[awesomium]]></category>
		<category><![CDATA[EVE Online]]></category>
		<category><![CDATA[in-game web-browser]]></category>

		<guid isPermaLink="false">http://princeofcode.com/blog/?p=257</guid>
		<description><![CDATA[EVE Online has just announced on their developer blog that they will be using Awesomium in their new in-game web-browser, code-named "Moondoggie"! You can read more here: http://www.eveonline.com/devblog.asp?a=blog&#038;bid=682]]></description>
			<content:encoded><![CDATA[<p><center><img src="http://princeofcode.com/images/eve_online_logo.png" alt="EVE Online Logo" /></center></p>
<p>EVE Online has just announced on their developer blog that they will be using <a href="http://princeofcode.com/awesomium.php">Awesomium</a> in their new in-game web-browser, code-named &#8220;Moondoggie&#8221;! You can <a href="http://www.eveonline.com/devblog.asp?a=blog&#038;bid=682">read all about it here</a>!</p>
<p>I&#8217;m really excited about this new development and am overjoyed at the prospect of Awesomium reaching all the users in the EVE Online universe!</p>
]]></content:encoded>
			<wfw:commentRss>http://princeofcode.com/blog/?feed=rss2&amp;p=257</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>The Player Demo &#8211; V2 Update</title>
		<link>http://princeofcode.com/blog/?p=249</link>
		<comments>http://princeofcode.com/blog/?p=249#comments</comments>
		<pubDate>Fri, 14 Aug 2009 23:30:34 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[mmorpg]]></category>
		<category><![CDATA[ogre3d]]></category>
		<category><![CDATA[player demo]]></category>
		<category><![CDATA[raknet]]></category>

		<guid isPermaLink="false">http://princeofcode.com/blog/?p=249</guid>
		<description><![CDATA[Last week I released an update to &#8220;The Player Demo&#8221; on the Ogre3D forums. If you&#8217;ve never heard of it, the demo is essentially an example of the basic concepts behind creating an online, multiplayer game with Ogre3D and RakNet. In the demo, you can login with a nickname, run around the terrain, and chat [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I <a href="http://www.ogre3d.org/forums/viewtopic.php?f=11&#038;t=51802">released an update</a> to &#8220;<a href="http://princeofcode.com/player.php">The Player Demo</a>&#8221; on the Ogre3D forums. If you&#8217;ve never heard of it, the demo is essentially an example of the basic concepts behind creating an online, multiplayer game with Ogre3D and RakNet. In the demo, you can login with a nickname, run around the terrain, and chat with other players.</p>
<p>My motivation for creating the demo is to get more people interested in creating their own online games and to provide them with a well-documented example that&#8217;s easy to hack and modify. I personally learned the most by reverse-engineering other people&#8217;s code (I grew up writing server emulators for most of the popular MMORPGs) and so I thought this might be helpful way to teach others.</p>
<p>Eventually, I would like to expand the demo a little bit more with an additional scripting layer (I&#8217;m thinking Lua or Javascript via V8) and back-end database (possibly MySQL or SQLite) as well as implement basic NPCs, fighting, death/respawning, player stats (HP/Exp./Level), and user accounts/registration. The trick will be trying to exemplify some of the most common features of today&#8217;s MMORPGs without getting too specific (which would limit applicability of the demo) or too complex (which would impact the project&#8217;s size and ease of understanding the codebase).</p>
<p>Anyways, here&#8217;s a few screenshots from the latest update to &#8220;The Player Demo&#8221;:</p>
<p><a href="http://princeofcode.com/images/player/screen1.jpg"><img src="http://princeofcode.com/images/player/screen1_s.jpg" /></a><br />
<a href="http://princeofcode.com/images/player/screen2.jpg"><img src="http://princeofcode.com/images/player/screen2_s.jpg" /></a><br />
<a href="http://princeofcode.com/images/player/screen3.jpg"><img src="http://princeofcode.com/images/player/screen3_s.jpg" /></a><br />
<a href="http://princeofcode.com/images/player/screen4.jpg"><img src="http://princeofcode.com/images/player/screen4_s.jpg" /></a></p>
<p>You can download the precompiled binaries and source for the demo <a href="http://princeofcode.com/player.php#download">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://princeofcode.com/blog/?feed=rss2&amp;p=249</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>New Awesomium Feature: URL Filtering System</title>
		<link>http://princeofcode.com/blog/?p=230</link>
		<comments>http://princeofcode.com/blog/?p=230#comments</comments>
		<pubDate>Fri, 31 Jul 2009 20:19:36 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[awesomium]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://princeofcode.com/blog/?p=230</guid>
		<description><![CDATA[A nifty new security feature will be coming in the next release of Awesomium-- you now have complete control over what resources can be accessed by a WebView via the new URL Filtering API!]]></description>
			<content:encoded><![CDATA[<p>A nifty new security feature will be coming in the next release of Awesomium&#8211; you now have complete control over what resources can be accessed by a WebView via the new URL Filtering API!</p>
<p>Two modes of operation are supported: a <strong>blacklist</strong> and a <strong>whitelist</strong>. Under the blacklist mode, all resource requests and page navigations are <em>allowed</em> except those that match the URLs you describe. For the whitelist mode, it&#8217;s the opposite: all requests and navigations are <em>denied</em> except those that match the URLs you describe.</p>
<p>To describe a URL or set of URLs, you may specify one or more strings with wildcards. So, for example, to describe all URLs with the domain &#8220;princeofcode.com&#8221;, you would specify &#8220;http://princeofcode.com/*&#8221;.</p>
<p>As a convenience, you may also use &#8220;local://&#8221; in your URL filter strings to describe the base directory (set via WebCore::setBaseDirectory).</p>
<p>This features makes it really easy to sandbox a WebView so that it may only access local resources:</p>
<p><code>myWebView->setURLFilteringMode(UFM_WHITELIST);<br />
myWebView->addURLFilter("local://*");</code></p>
<p>Or, maybe you wish to block users from accessing some specific video sites:</p>
<p><code>myWebView->setURLFilteringMode(UFM_BLACKLIST);<br />
myWebView->addURLFilter("http://youtube.com/*");<br />
myWebView->addURLFilter("http://vimeo.com/*");<br />
myWebView->addURLFilter("http://metacafe.com/*");</code></p>
<p>What&#8217;s more, the URL filtering system is extremely flexible&#8211; these modes and filters can be applied to each WebView independently and you may also modify/remove modes and filters at runtime.</p>
<p>Hope yall find this new feature useful, this is just one of the new security enhancements that will be coming in the next release! I&#8217;ll be revealing some new features next week, so stay tuned to this blog!</p>
]]></content:encoded>
			<wfw:commentRss>http://princeofcode.com/blog/?feed=rss2&amp;p=230</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Blog Remodeling, New Flickr Account, and New Awesomium Features</title>
		<link>http://princeofcode.com/blog/?p=223</link>
		<comments>http://princeofcode.com/blog/?p=223#comments</comments>
		<pubDate>Sat, 25 Jul 2009 00:05:17 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[awesomium]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[chromium]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[flickr]]></category>
		<category><![CDATA[google site search]]></category>

		<guid isPermaLink="false">http://princeofcode.com/blog/?p=223</guid>
		<description><![CDATA[I spent part of last week remodeling my blog as part of the site-wide rehaul. I personally like it a lot more than the previous one&#8211; it&#8217;s a lot more readable, easier to navigate, and the overall design fits in better with how I want to come across.
The navigation/search bar at the very top is [...]]]></description>
			<content:encoded><![CDATA[<p>I spent part of last week remodeling my blog as part of the site-wide rehaul. I personally like it a lot more than the previous one&#8211; it&#8217;s a lot more readable, easier to navigate, and the overall design fits in better with how I want to come across.</p>
<p>The navigation/search bar at the very top is also new and will eventually be a shared component across all of the pages of my new site. I implemented the search bar using Google Custom Site Search which means that it indexes not only my main site content but my blog, forums, and wiki too. I hope that these changes will improve the usability of my site and decrease the time it takes to find what you&#8217;re looking for.</p>
<p>Also, since this new blog theme supports Flickr integration (see the &#8216;Photostream&#8217; panel on the side of my blog), I&#8217;ve created a Flickr account so I can share some my IRL photos with yall. I just put up a portion of the shots I took on my San Francisco trip this past May; check it out if you&#8217;re bored.</p>
<p>In software-related news, I&#8217;ve been working really hard lately on the new Awesomium release. So many new changes have gone in since v1.08 that I don&#8217;t know where to start. Well, first off&#8211; it&#8217;s been updated to a much more recent Chromium build which has solved several stability issues (the previous build crashed upon encountering Flash content wrapped in an i-frame) and improved performance by a bit. Then from there, I&#8217;ve implemented a URL filtering system (blacklisting/whitelisting), on-disk cache, on-disk cookies, platform-independent keyboard event injection, custom plugins path, AJAX requests for external resources from local files, handling for local:// schemes, arrays in JSValue, improved unicode-support greatly, fixed several crash-on-exit bugs, and more! </p>
<p>There&#8217;s lots of other neat things still to come and I&#8217;ll be blogging in detail about some of the new Awesomium features in the coming weeks. Stay tuned!</p>
]]></content:encoded>
			<wfw:commentRss>http://princeofcode.com/blog/?feed=rss2&amp;p=223</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

