--- /dev/null
+<html>
+<head><title>robotfindskitten</title></head>
+<style type="text/css">
+body {
+ color: green;
+ background-color: black;
+ text-align: center;
+ font-size: 20pt;
+ font-family: serif;
+}
+h1 {
+ font-size: 40pt;
+}
+a {
+ color: yellow;
+}
+</style>
+<body>
+<h1>robotfindskitten</h1>
+
+<p>robotfindskitten is a Zen simulation. robot must find kitten
+in an area full of non-kitten items. The original version was
+written in 1997 by the illustrious Leonard Richardson for the Nerth
+Pork robotfindskitten contest. This Maemo port was written by
+Thomas Thurman in 2009.</p>
+
+<p>You may learn more at <a href="http://www.robotfindskitten.org">the
+robotfindskitten website</a>.</p>
+
+<p>You may scroll this help text. When you
+are done, you may close this window and return
+to robotfindskitten</a>.</p>
+
+<h2>Moving robot around</h2>
+
+<p>There are three ways to move robot around. Firstly, you may tap
+on any side of robot to move robot in that direction, including
+diagonally.</p>
+
+<p>Secondly, you may use the arrow keys on the keyboard. However,
+this does not allow you to move diagonally.</p>
+
+<p>Thirdly, you may use the vi keys (also called the nethack keys).
+They are:</p>
+<center>
+<big><big><pre>
+y k u
+h · l
+b j n
+</pre></big></big>
+</center>
+</p>
+
+<h2>Run, robot, run!</h2>
+<p>If you are controlling robot with the keyboard, then holding
+down Shift as you move will make robot run until meeting
+an item or the wall.</p>
+
+<h2>Adding new non-kitten items</h2>
+<p>There is no way to do this. It should be in the next release.</p>
+
+<h2>Background</h2>
+<p>"Day and night I feverishly worked upon the
+machine, creating both a soul which could desire
+its goal, and a body with which it could realize
+it. Many who saw my creation called it an
+abomination, and denied me grant money. But they
+could not dissuade me from my impossible task. It
+was a spectre that tormented me always, a ghost I
+had to give a form and a life, lest it consume me
+from the inside. And when at last my task was
+done, when the grey box on wheels was complete and
+when it, as well as I, knew what had to be done, I
+felt deep sympathy for the machine. For I had not
+destroyed the phantom, but merely exorcized it
+into another body. The robot knew not why this
+task had to be performed, for I could not imbue it
+with knowledge I did not myself posess. And at the
+same time, I felt a sweeping sense of relief sweep
+over me, that somehow, the dream that had driven
+me for my entire life had come one step closer to
+fruition. "As I vocally activated the robot, I
+realized that it was following my instructions,
+but not out of any desire to obey me. Had I
+remained silent, it would have performed
+exactly the same operations. We were two beings
+controlled by the same force now. And yet, seeking
+vainly to hold some illusion of control over the
+machine I thought I had created, I gave my final
+command.</p>
+
+<p>"`GO!' I told the box as it began to roll out of
+my workshop into the frozen desert beyond. `FIND
+KITTEN!'"</p>
+
+<p><cite>— The Book of Found Kittens</cite>, pages 43-4, author unknown</p>
+
+</body>
+</html>
* ported to maemo by Thomas Thurman, 2009
* suggestions welcome
* Compile with:
- * gcc -Wall -g rfk.c -o rfk `pkg-config --cflags --libs gtk+-2.0 hildon-1`
+ * gcc -Wall -g rfk.c -o rfk `pkg-config --cflags --libs gtk+-2.0 hildon-1 dbus-glib-1 dbus-1`
*/
+#include <dbus/dbus-glib.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <glib.h>
{
HildonNote* note = HILDON_NOTE
(hildon_note_new_information (GTK_WINDOW (window),
- message));
+ message?message:
+ "Some message was supposed to be here."));
gtk_dialog_run (GTK_DIALOG (note));
gtk_widget_destroy (GTK_WIDGET (note));
}
gtk_widget_show_all (window);
}
-void
+/****************************************************************/
+/* Online help. */
+/****************************************************************/
+gboolean
get_help (gpointer button, gpointer data)
{
- show_message ("Not yet implemented.");
+ DBusGConnection *connection;
+ GError *error = NULL;
+ DBusGProxy *proxy;
+
+ connection = dbus_g_bus_get (DBUS_BUS_SESSION,
+ &error);
+ if (connection == NULL)
+ {
+ show_message (error->message);
+ g_error_free (error);
+ return FALSE;
+ }
+
+ proxy = dbus_g_proxy_new_for_name (connection,
+ "com.nokia.osso_browser",
+ "/com/nokia/osso_browser/request",
+ "com.nokia.osso_browser");
+
+ error = NULL;
+ if (!dbus_g_proxy_call (proxy, "load_url", &error,
+ G_TYPE_STRING, "/usr/share/rfk/help.html",
+ G_TYPE_INVALID,
+ G_TYPE_INVALID))
+ {
+ show_message (error->message);
+ g_error_free (error);
+ return FALSE;
+ }
+ return FALSE;
}
void