refraction part 10 header updates...
authorReto Zingg <g.d0b3rm4n@gmail.com>
Sun, 27 Dec 2009 12:38:05 +0000 (14:38 +0200)
committerReto Zingg <g.d0b3rm4n@gmail.com>
Sun, 27 Dec 2009 12:38:05 +0000 (14:38 +0200)
data/mancala.html
data/mancala.sh
debian/copyright
src/callbacks.c
src/callbacks.h
src/launcher/Makefile
src/launcher/mancala-launcher.c
src/main.c
src/plugin/Makefile
src/plugin/mancala-ui-plugin.c

index d87e82c..f9cb653 100644 (file)
@@ -1,9 +1,32 @@
+<!--
+*
+* This file is part of Mancala
+*
+* Copyright (c) 2009 Reto Zingg
+* Text from cmancala game:
+* http://sourceforge.net/projects/cmancala/files/mancala-text/mancala-0.2.1/mancala-0.2.1.tar.gz/download
+*
+* This software is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public License
+* as published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful, but
+* WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA
+-->
 <html>
 <head></head>
 <body>
 <h1>Welcome to Mancala, the ancient African game of skill!</h1>
-<p>Mancala is a very simple, easy-to-learn game. Each player begins with a horizontal row of holes or pits filled with a certain number of stones. At either end of the board are the players' home pits, which are used to keep score. In this case, the human player has the left home pit and the upper row holes. A move is made by clicking into the hole you wish to move from. The stones are then picked up and distributed, one to each hole, moving toward your home pit is reached, and then moving through your opponent's row, bypassing his/her home, and moving back towards in a circle (counterclockwise), until all the stones have been distributed.</p>
-<p>If the last stone is placed in your home, you receive an extra turn. If the last stone lands in an empty hole on your side, you 'capture' the stones in the opposite hole on your opponent's side, moving them to your home.</p>
-<p>The game ends when one player cannot play (ie. there are no stones on his/her side of the board.  The player who has the most stones on his/her *side* wins.</p>
+<p><big>Mancala is a very simple, easy-to-learn game. Each player begins with a horizontal row of holes or pits filled with a certain number of stones. At either end of the board are the players' home pits, which are used to keep score. In this case, the human player has the left home pit and the upper row holes. A move is made by clicking into the hole you wish to move from. The stones are then picked up and distributed, one to each hole, moving toward your home pit is reached, and then moving through your opponent's row, bypassing his/her home, and moving back towards in a circle (counterclockwise), until all the stones have been distributed.</big></p>
+<p><big>If the last stone is placed in your home, you receive an extra turn. If the last stone lands in an empty hole on your side, you 'capture' the stones in the opposite hole on your opponent's side, moving them to your home.</big></p>
+<p><big>The game ends when one player cannot play (ie. there are no stones on his/her side of the board.  The player who has the most stones on his/her *side* wins.</big></p>
 </body>
 </html>
index 91844cb..f9819f8 100755 (executable)
@@ -1,4 +1,24 @@
 #!/bin/sh
+#
+#
+#  This file is part of Mancala
+#
+#  Copyright (C) 2009 Reto Zingg
+#
+#  Some of the code is based on the examples on:
+#  http://wiki.maemo.org/Documentation/Maemo_5_Developer_Guide
+#
+#  This program is free software; you can redistribute it and/or modify it
+#  under the terms of the GNU General Public License as published by the
+#  Free Software Foundation; either version 2, or (at your option) any
+#  later version.
+#
+#  This program is distributed in the hope that it will be useful, but
+#  WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  General Public License for more details, a copy of which may be found in
+#  the file COPYING provided in the main directory of this release.
+#
 
 /usr/bin/osso_games_startup /home/opt/mancala/data/mancala.conf
 
index 3fc31f6..891b4b1 100644 (file)
@@ -36,3 +36,7 @@ instruction code copyright (c) 2001 by URW++ GmbH. All Rights
 Reserved. Luxi is a registered trademark of Bigelow & Holmes Inc.
 
 see COPYRIGHT.BH file.
+
+parts from Crazyparking:
+http://repository.maemo.org/extras-testing/pool/fremantle/free/source/c/crazyparking/crazyparking_0.2.7-2.tar.gz
+License: GNU General Public License Version 2
index 70215ed..0b0e6cf 100644 (file)
@@ -1,9 +1,14 @@
 /*
-* This file is part of Crazy Parking
+* This file is part of Mancala
+*
+* Originally from Crazyparking:
 *
 * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia
 * http://www.indt.org/maemo
 *
+* adapted:
+* Copyright (c) 2009 Reto Zingg
+*
 * This software is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation; either version 2.1 of
 #include <stdio.h>
 #include <hgw/hgw.h>
 #include "callbacks.h"
-// #include "images.h"
-// #include "level.h"
+
 
 // Pause the game
 int exit_callback(int errcode) {
-//     FILE *han;
-
-//     // Save state
-//     han = fopen("/tmp/.crazyparking-save", "wb");
-//     if (han) {
-//             fwrite(&actual_level, sizeof(int), 1, han);
-//             fwrite(&moves, sizeof(int), 1, han);
-//             fwrite(car, sizeof(struct CAR), cars, han);
-//             fclose(han);
-//     }
-    fprintf(stderr, "exit_callback called...\n");
-
+    printf("exit_callback called...\n");
        return 0;
 }
 
 // Quit game
 int quit_callback(int errcode) {
-//     remove("/tmp/.crazyparking-save");
-    fprintf(stderr, "quit_callback called...\n");
+    printf("quit_callback called...\n");
        hgw_context_compat_destroy_quit(hgw_context);
        return 0;
 }
 
 int flush_callback(int errcode) {
-//     remove("/tmp/.crazyparking-save");
-    fprintf(stderr, "quit_callback called...\n");
+    printf("quit_callback called...\n");
        return 0;
 }
index 2afca93..baa1383 100644 (file)
@@ -1,6 +1,7 @@
 /*
-* This file is part of Crazy Parking
+* This file is part of Mancala
 *
+* Originally from Crazyparking:
 * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia
 * http://www.indt.org/maemo
 *
index a09eef0..16cc005 100644 (file)
@@ -3,24 +3,7 @@
 
 
 CC = gcc
-# DBG = gdb
-# STD = _GNU_SOURCE
-# CFLAGS = `sdl-config --cflags` -I/usr/local/include/SDL `pkg-config hildon-1 --cflags` -I/usr/include/dbus-1.0/ -I/usr/lib/dbus-1.0/include/
-# LFLAGS = `sdl-config --static-libs ` -lSDL_image -lSDL_ttf -lSDL_mixer `pkg-config hildon-1 --libs` `pkg-config --libs  libosso` -lhgw
 
-# MAIN_OBJ = main.o graphics.o mancala.o sounds.o play.o
-# MAIN_OBJ = graphics.o mancala.o sounds.o play.o callbacks.o
-# TEST_OBJ = ai-test.o mancala.o
-
-# NORMAL = ai.o
-# RECURSE = ai-init.o ai-recurse.o
-# ULTIMATE = ai-init.o ai-ultimate.o
-
-#'$<' is filename of input, '$@' is filename of output
-# .c.o:
-#      $(CC) -c -g$(DBG) -Wall $(CFLAGS) -D$(STD) $<
-# .h.o:
-#      $(CC) -c -g$(DBG) -Wall $(CFLAGS) -D$(STD) $<
 
 all:
        $(CC) mancala-launcher.c -o mancala-launcher
@@ -38,8 +21,3 @@ clean:
 clobber:       clean
        rm -f mancala-launcher
 
-distclean:     clobber
-       @echo "No configuration files to distclean yet."
-       @echo "I will do my best to make some! ;-)"
-
-# End Makefile
index 9c9624c..20462e2 100644 (file)
@@ -1,37 +1,38 @@
-/**
-   @file crazyparking.c
-
-   Wrapper crazyparking launcher
-   <p>
-   Copyright (c) 2005 INdT. All eigths reserved.
-
-   @author Andre Moreira Magalhaes <andre.magalhaes@indt.org.br>
+/*
+* This file is part of Mancala
+*
+* Idea from Crazyparking
+*
+* Copyright (c) 2009 Reto Zingg
+*
+* This software is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public License
+* as published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful, but
+* WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA
 */
 
 #include <stdio.h>
 #include <unistd.h>
 
-char *argh[] = { "/usr/games/wrapper/wrapper",
-                 "/home/opt/mancala/data/mancala.game",
-                NULL };
+char *wrapper_args[] = {"/usr/games/wrapper/wrapper",
+                        "/home/opt/mancala/data/mancala.game",
+                        NULL};
 
 int main(int argc, char *argv[])
 {
     
-    FILE *pFile;
-    
-    pFile = fopen ("/home/rzingg/mancala.debug", "a");
-    if (pFile) {
-        fprintf (pFile, "app launched...\n");
-        fclose (pFile);
-    }
-    
-    if (execv ("/usr/games/wrapper/wrapper", argh) == -1) {
-        pFile = fopen ("/home/rzingg/mancala.debug", "a");
-        if (pFile) {
-            fprintf (pFile, "cannot execute wrapper...\n");
-            fclose (pFile);
-        }
+    if (execv ("/usr/games/wrapper/wrapper", wrapper_args) == -1) {
+        printf("Launching mancala wrapper failed\n");
     }
 
     return 0;
index 5be3b90..d587d33 100644 (file)
@@ -1,4 +1,7 @@
 /*
+*
+*  This file is part of Mancala
+*
 *  Copyright (C) 2009 Reto Zingg
 *
 *  Some of the code is based on the examples on:
 *
 */
 
+/*********************************************************************
+**
+** NOT used at the moment...
+**
+*********************************************************************/
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
index 9496e4e..c55993b 100644 (file)
@@ -30,8 +30,5 @@ clean:
 clobber:       clean
        rm -f mancala-ui-plugin.so
 
-distclean:     clobber
-       @echo "No configuration files to distclean yet."
-       @echo "I will do my best to make some! ;-)"
 
-# End Makefile
+
index 68d3717..9fb5cf7 100644 (file)
@@ -1,9 +1,16 @@
 /*
-* This file is part of Crazyparking
+* This file is part of Mancala
 *
+* Originally from Crazyparking:
 * Copyright (C) 2005 INdT - Instituto Nokia de Tecnologia
 * http://www.indt.org/maemo
 *
+* adapted:
+* Copyright (c) 2009 Reto Zingg
+*
+* Some of the code is based on the examples on:
+* http://wiki.maemo.org/Documentation/Maemo_5_Developer_Guide
+*
 * This software is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation; either version 2.1 of
@@ -48,58 +55,61 @@ static StartupPluginInfo plugin_info = {
 
 STARTUP_INIT_PLUGIN(plugin_info, gs, FALSE, FALSE)
 
-static void destroy_help_subwindow (void)
-{
-    StartupApp *app = gs.ui->app;
-    osso_application_top(app->osso, app->path, NULL);
-}
-
-static void show_help_subwindow (void)
-{
-    GtkWidget *win;
-    GtkWidget *textbox;
-    GtkTextBuffer *textbox_buffer;
-    gchar *textbox_text;
-    PangoFontDescription *font_desc;
-    GtkWidget *pannable_text;
-    
-    /* Create the subwindow (a stackable window) */
-    win = hildon_stackable_window_new();
-    gtk_window_set_title ( GTK_WINDOW (win), "Help");
-
-    /* Create and pack labels */     
-    textbox_text = g_strdup_printf("Welcome to Mancala, the ancient African game of skill!\n\nMancala is a very simple, easy-to-learn game. Each player begins with a horizontal row of holes or pits filled with a certain number of stones. At either end of the board are the players' home pits, which are used to keep score. In this case, the human player has the left home pit and the upper row holes. A move is made by clicking into the hole you wish to move from. The stones are then picked up and distributed, one to each hole, moving toward your home pit is reached, and then moving through your opponent's row, bypassing his/her home, and moving back towards in a circle (counterclockwise), until all the stones have been distributed.\n\nIf the last stone is placed in your home, you receive an extra turn. If the last stone lands in an empty hole on your side, you 'capture' the stones in the opposite hole on your opponent's side, moving them to your home.\n\nThe game ends when one player cannot play (ie. there are no stones on his/her side of the board.  The player who has the most stones on his/her *side* wins.");
-    
-    textbox = hildon_text_view_new();
-    gtk_text_view_set_editable(GTK_TEXT_VIEW(textbox), FALSE);
-    // gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(textbox), FALSE);
-    gtk_text_view_set_indent(GTK_TEXT_VIEW(textbox), 10);
-    gtk_text_view_set_left_margin(GTK_TEXT_VIEW(textbox), 10);
-    gtk_text_view_set_right_margin(GTK_TEXT_VIEW(textbox), 10);
-    gtk_text_view_set_pixels_above_lines(GTK_TEXT_VIEW(textbox), 3);
-    gtk_text_view_set_pixels_below_lines(GTK_TEXT_VIEW(textbox), 2);
-    gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(textbox), GTK_WRAP_WORD);
-    // gtk_widget_set_sensitive(textbox, FALSE);
-    font_desc = pango_font_description_from_string ("vera 18");
-    gtk_widget_modify_font(textbox, font_desc);
-    pango_font_description_free (font_desc);
-    
-    textbox_buffer = hildon_text_view_get_buffer (HILDON_TEXT_VIEW (textbox));
-    
-    gtk_text_buffer_set_text(textbox_buffer, textbox_text, -1);
-    
-    
-    pannable_text = hildon_pannable_area_new();
-    hildon_pannable_area_add_with_viewport (HILDON_PANNABLE_AREA(pannable_text), textbox);
-    
-    gtk_container_add (GTK_CONTAINER (win), pannable_text);
-    
-    g_signal_connect (win, "destroy",    destroy_help_subwindow, NULL);
-    
-
-    /* This call show the window and also add the window to the stack */
-    gtk_widget_show_all (win);
-}
+// the following does not work proper until osso_game_startup is
+// implemented as stackable window...
+
+// static void destroy_help_subwindow (void)
+// {
+//     StartupApp *app = gs.ui->app;
+//     osso_application_top(app->osso, app->path, NULL);
+// }
+// 
+// static void show_help_subwindow (void)
+// {
+//     GtkWidget *win;
+//     GtkWidget *textbox;
+//     GtkTextBuffer *textbox_buffer;
+//     gchar *textbox_text;
+//     PangoFontDescription *font_desc;
+//     GtkWidget *pannable_text;
+//     
+//     /* Create the subwindow (a stackable window) */
+//     win = hildon_stackable_window_new();
+//     gtk_window_set_title ( GTK_WINDOW (win), "Help");
+// 
+//     /* Create and pack labels */     
+//     textbox_text = g_strdup_printf("Welcome to Mancala, the ancient African game of skill!\n\nMancala is a very simple, easy-to-learn game. Each player begins with a horizontal row of holes or pits filled with a certain number of stones. At either end of the board are the players' home pits, which are used to keep score. In this case, the human player has the left home pit and the upper row holes. A move is made by clicking into the hole you wish to move from. The stones are then picked up and distributed, one to each hole, moving toward your home pit is reached, and then moving through your opponent's row, bypassing his/her home, and moving back towards in a circle (counterclockwise), until all the stones have been distributed.\n\nIf the last stone is placed in your home, you receive an extra turn. If the last stone lands in an empty hole on your side, you 'capture' the stones in the opposite hole on your opponent's side, moving them to your home.\n\nThe game ends when one player cannot play (ie. there are no stones on his/her side of the board.  The player who has the most stones on his/her *side* wins.");
+//     
+//     textbox = hildon_text_view_new();
+//     gtk_text_view_set_editable(GTK_TEXT_VIEW(textbox), FALSE);
+//     // gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(textbox), FALSE);
+//     gtk_text_view_set_indent(GTK_TEXT_VIEW(textbox), 10);
+//     gtk_text_view_set_left_margin(GTK_TEXT_VIEW(textbox), 10);
+//     gtk_text_view_set_right_margin(GTK_TEXT_VIEW(textbox), 10);
+//     gtk_text_view_set_pixels_above_lines(GTK_TEXT_VIEW(textbox), 3);
+//     gtk_text_view_set_pixels_below_lines(GTK_TEXT_VIEW(textbox), 2);
+//     gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(textbox), GTK_WRAP_WORD);
+//     // gtk_widget_set_sensitive(textbox, FALSE);
+//     font_desc = pango_font_description_from_string ("vera 18");
+//     gtk_widget_modify_font(textbox, font_desc);
+//     pango_font_description_free (font_desc);
+//     
+//     textbox_buffer = hildon_text_view_get_buffer (HILDON_TEXT_VIEW (textbox));
+//     
+//     gtk_text_buffer_set_text(textbox_buffer, textbox_text, -1);
+//     
+//     
+//     pannable_text = hildon_pannable_area_new();
+//     hildon_pannable_area_add_with_viewport (HILDON_PANNABLE_AREA(pannable_text), textbox);
+//     
+//     gtk_container_add (GTK_CONTAINER (win), pannable_text);
+//     
+//     g_signal_connect (win, "destroy",    destroy_help_subwindow, NULL);
+//     
+// 
+//     /* This call show the window and also add the window to the stack */
+//     gtk_widget_show_all (win);
+// }
 
 
 static void show_help_browser (void)