From 989566a7246b581c11ea8448453b4b3a686f54c1 Mon Sep 17 00:00:00 2001 From: Thomas Thurman Date: Sat, 22 Aug 2009 18:16:20 -0400 Subject: [PATCH] added online help --- Makefile | 3 +- debian/changelog | 9 +++++ help.html | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ rfk.c | 41 +++++++++++++++++++--- 4 files changed, 147 insertions(+), 5 deletions(-) create mode 100644 help.html diff --git a/Makefile b/Makefile index ad263b5..d77aa9f 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ all: rfk rfk: rfk.c - gcc -Wall -g rfk.c -o rfk `pkg-config --cflags --libs gtk+-2.0` `pkg-config hildon-1 --cflags --libs` + gcc -Wall -g rfk.c -o rfk `pkg-config --cflags --libs gtk+-2.0 hildon-1 dbus-glib-1 dbus-1` clean: rm -f rfk @@ -22,3 +22,4 @@ install: rfk rfk.png rfk-robot.png rfk-love.png rfk-kitten.png rfk.desktop install rfk-love.png ${DESTDIR}/usr/share/rfk install rfk-kitten.png ${DESTDIR}/usr/share/rfk install non-kitten-items.rfk ${DESTDIR}/usr/share/rfk + install help.html ${DESTDIR}/usr/share/rfk diff --git a/debian/changelog b/debian/changelog index ef479ff..b991a9c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +rfk (1.30-1) unstable; urgency=low + + * Robot can move diagonally + * Robot can run until an obstacle is found + * Items moved into a separate file + * Items converted to UTF-8 + + -- Thomas Thurman Tue, 27 May 2009 21:33:32 -0400 + rfk (1.20-1) unstable; urgency=low * Fix icon diff --git a/help.html b/help.html new file mode 100644 index 0000000..530a85b --- /dev/null +++ b/help.html @@ -0,0 +1,99 @@ + +robotfindskitten + + +

robotfindskitten

+ +

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.

+ +

You may learn more at the +robotfindskitten website.

+ +

You may scroll this help text. When you +are done, you may close this window and return +to robotfindskitten.

+ +

Moving robot around

+ +

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.

+ +

Secondly, you may use the arrow keys on the keyboard. However, +this does not allow you to move diagonally.

+ +

Thirdly, you may use the vi keys (also called the nethack keys). +They are:

+
+
+y  k  u
+h  ·  l
+b  j  n
+
+
+

+ +

Run, robot, run!

+

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.

+ +

Adding new non-kitten items

+

There is no way to do this. It should be in the next release.

+ +

Background

+

"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.

+ +

"`GO!' I told the box as it began to roll out of +my workshop into the frozen desert beyond. `FIND +KITTEN!'"

+ +

— The Book of Found Kittens, pages 43-4, author unknown

+ + + diff --git a/rfk.c b/rfk.c index e63edae..40785b3 100644 --- a/rfk.c +++ b/rfk.c @@ -3,9 +3,10 @@ * 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 #include #include #include @@ -120,7 +121,8 @@ show_message (const char *message) { 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)); } @@ -467,10 +469,41 @@ set_up_game (void) 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 -- 1.7.9.5