hitori r51 - in trunk: . help help/C src



Author: pwithnall
Date: Mon Mar  9 18:31:54 2009
New Revision: 51
URL: http://svn.gnome.org/viewvc/hitori?rev=51&view=rev

Log:
2009-03-09  Philip Withnall  <philip tecnocode co uk>

	* Makefile.am:
	* src/interface.c (hitori_draw_board), (hitori_undo_cb),
	(hitori_redo_cb), (hitori_about_cb):
	* src/main.h:
	* src/rules.c (hitori_check_rule3): Fix some warnings, and list the
	documenters in the About dialogue.

2009-03-09  Philip Withnall  <philip tecnocode co uk>

	* C/hitori.xml:
	* Makefile.am: Generate a list of documenters from the documentation
	itself.



Modified:
   trunk/ChangeLog
   trunk/Makefile.am
   trunk/help/C/hitori.xml
   trunk/help/ChangeLog
   trunk/help/Makefile.am
   trunk/src/interface.c
   trunk/src/main.h
   trunk/src/rules.c

Modified: trunk/Makefile.am
==============================================================================
--- trunk/Makefile.am	(original)
+++ trunk/Makefile.am	Mon Mar  9 18:31:54 2009
@@ -1,4 +1,4 @@
-SUBDIRS = src po data help
+SUBDIRS = help src po data
 
 EXTRA_DIST =			\
 	autogen.sh		\

Modified: trunk/help/C/hitori.xml
==============================================================================
--- trunk/help/C/hitori.xml	(original)
+++ trunk/help/C/hitori.xml	Mon Mar  9 18:31:54 2009
@@ -42,9 +42,7 @@
 			<author> 
 				<firstname>Philip</firstname> 
 				<surname>Withnall</surname> 
-				<affiliation> 
-					<address><email>philip tecnocode co uk</email></address> 
-				</affiliation> 
+				<email>philip tecnocode co uk</email>
 			</author>
 		</authorgroup>
 		<!-- According to GNU FDL, revision history is mandatory if you are -->

Modified: trunk/help/Makefile.am
==============================================================================
--- trunk/help/Makefile.am	(original)
+++ trunk/help/Makefile.am	Mon Mar  9 18:31:54 2009
@@ -3,7 +3,8 @@
 
 DOC_MODULE = hitori
 DOC_ENTITIES = 
+DOC_H_FILE = hitori-docs.h
+DOC_H_DOCS = C/hitori.xml
 DOC_INCLUDES = legal.xml
-DOC_FIGURES = \
-             figures/hitori_main_window.png
+DOC_FIGURES = figures/hitori_main_window.png
 DOC_LINGUAS = en_GB sv

Modified: trunk/src/interface.c
==============================================================================
--- trunk/src/interface.c	(original)
+++ trunk/src/interface.c	Mon Mar  9 18:31:54 2009
@@ -33,6 +33,19 @@
 #define HINT_FLASHES 6
 #define HINT_INTERVAL 500
 
+/* Declarations for GtkBuilder */
+gboolean hitori_expose_cb (GtkWidget *drawing_area, GdkEventExpose *event, Hitori *hitori);
+gboolean hitori_button_release_cb (GtkWidget *drawing_area, GdkEventButton *event, Hitori *hitori);
+void hitori_destroy_cb (GtkWindow *window, Hitori *hitori);
+void hitori_new_game_cb (GtkAction *action, Hitori *hitori);
+void hitori_hint_cb (GtkAction *action, Hitori *hitori);
+void hitori_undo_cb (GtkAction *action, Hitori *hitori);
+void hitori_redo_cb (GtkAction *action, Hitori *hitori);
+void hitori_quit_cb (GtkAction *action, Hitori *hitori);
+void hitori_contents_cb (GtkAction *action, Hitori *hitori);
+void hitori_about_cb (GtkAction *action, Hitori *hitori);
+void hitori_board_size_cb (GtkRadioAction *action, GtkRadioAction *current, Hitori *hitori);
+
 GtkWidget *
 hitori_create_interface (Hitori *hitori)
 {
@@ -199,13 +212,12 @@
 	}
 
 	if (has_won == TRUE) {
+		GtkWidget *dialog;
+
 		/* Tell the user they've won, and don't draw any hints */
 		hitori_disable_events (hitori);
-		GtkWidget *dialog = gtk_message_dialog_new (NULL,
-				GTK_DIALOG_MODAL,
-				GTK_MESSAGE_INFO,
-				GTK_BUTTONS_OK,
-				_("You've won!"));
+		dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_OK,
+						 _("You've won!"));
 		gtk_dialog_run (GTK_DIALOG (dialog));
 		gtk_widget_destroy (dialog);
 		return;
@@ -422,7 +434,9 @@
 			hitori->board[hitori->undo_stack->cell.x][hitori->undo_stack->cell.y].status ^= CELL_TAG2;
 			break;
 		case UNDO_NEW_GAME:
+		default:
 			/* This is just here to stop the compiler warning */
+			g_assert_not_reached ();
 			break;
 	}
 
@@ -455,7 +469,9 @@
 			hitori->board[hitori->undo_stack->cell.x][hitori->undo_stack->cell.y].status ^= CELL_TAG2;
 			break;
 		case UNDO_NEW_GAME:
+		default:
 			/* This is just here to stop the compiler warning */
+			g_assert_not_reached ();
 			break;
 	}
 
@@ -496,6 +512,7 @@
 void
 hitori_about_cb (GtkAction *action, Hitori *hitori)
 {
+	#include "../help/hitori-docs.h"
 	gchar *license;
 	const gchar *authors[] =
 	{
@@ -527,6 +544,7 @@
 				"copyright", _("Copyright \xc2\xa9 2007-2009 Philip Withnall"),
 				"comments", _("A logic puzzle designed by Nikoli."),
 				"authors", authors,
+				"documenters", documentation_credits,
 				"translator-credits", _("translator-credits"),
 				"logo-icon-name", "hitori",
 				"license", license,

Modified: trunk/src/main.h
==============================================================================
--- trunk/src/main.h	(original)
+++ trunk/src/main.h	Mon Mar  9 18:31:54 2009
@@ -1,7 +1,7 @@
 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
 /*
  * Hitori
- * Copyright (C) Philip Withnall 2007-2008 <philip tecnocode co uk>
+ * Copyright (C) Philip Withnall 2007-2009 <philip tecnocode co uk>
  * 
  * Hitori is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -72,7 +72,7 @@
 	guint drawing_area_x_offset;
 	guint drawing_area_y_offset;
 
-	guint board_size;
+	guchar board_size;
 	HitoriCell **board;
 
 	gboolean debug;

Modified: trunk/src/rules.c
==============================================================================
--- trunk/src/rules.c	(original)
+++ trunk/src/rules.c	Mon Mar  9 18:31:54 2009
@@ -1,7 +1,7 @@
 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
 /*
  * Hitori
- * Copyright (C) Philip Withnall 2007-2008 <philip tecnocode co uk>
+ * Copyright (C) Philip Withnall 2007-2009 <philip tecnocode co uk>
  * 
  * Hitori is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -21,6 +21,7 @@
 #include <glib/gprintf.h>
 
 #include "main.h"
+#include "rules.h"
 
 /* Rule 1: There must only be one of each number in the unpainted cells
  * in each row and column.
@@ -221,7 +222,7 @@
 	 * one, the rule fails. Start at 2 to give room to subtract
 	 * 1 without underflowing, and also skip the first entry, as
 	 * it's reserved for ungrouped cells. */
-	for (i = 2; i <= max_group; i++) {
+	for (i = 2; i < max_group + 1; i++) {
 		if (group_bases[i - 1] != group_bases[i]) {
 			/* Rule failed */
 			g_free (group_bases);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]