[Tux4kids-commits] r1323 - tuxtype/branches/gsoc-sarah/src
David Bruce
dbruce-guest at alioth.debian.org
Sat Aug 1 19:32:39 UTC 2009
Author: dbruce-guest
Date: 2009-08-01 19:32:39 +0000 (Sat, 01 Aug 2009)
New Revision: 1323
Added:
tuxtype/branches/gsoc-sarah/src/editor.c
tuxtype/branches/gsoc-sarah/src/editor.h
Modified:
tuxtype/branches/gsoc-sarah/src/Makefile.am
tuxtype/branches/gsoc-sarah/src/Makefile.in
tuxtype/branches/gsoc-sarah/src/titlescreen.c
Log:
added (nearly blank) files "editor.c" and "editor.h" for GSoC as this really isn't menu functionality.
Modified: tuxtype/branches/gsoc-sarah/src/Makefile.am
===================================================================
--- tuxtype/branches/gsoc-sarah/src/Makefile.am 2009-08-01 18:54:38 UTC (rev 1322)
+++ tuxtype/branches/gsoc-sarah/src/Makefile.am 2009-08-01 19:32:39 UTC (rev 1323)
@@ -74,7 +74,8 @@
pause.c \
convert_utf.c \
options.c \
- mysetenv.c
+ mysetenv.c \
+ editor.c
TuxType_SOURCES = $(tuxtype_SOURCES)
# The rc file has something to do with the icon in Windows, IIRC
@@ -92,6 +93,7 @@
convert_utf.h \
gettext.h \
compiler.h \
- mysetenv.h
+ mysetenv.h \
+ editor.h
Modified: tuxtype/branches/gsoc-sarah/src/Makefile.in
===================================================================
--- tuxtype/branches/gsoc-sarah/src/Makefile.in 2009-08-01 18:54:38 UTC (rev 1322)
+++ tuxtype/branches/gsoc-sarah/src/Makefile.in 2009-08-01 19:32:39 UTC (rev 1323)
@@ -54,7 +54,7 @@
practice.$(OBJEXT) audio.$(OBJEXT) snow.$(OBJEXT) \
scripting.$(OBJEXT) SDL_extras.$(OBJEXT) pixels.$(OBJEXT) \
pause.$(OBJEXT) convert_utf.$(OBJEXT) options.$(OBJEXT) \
- mysetenv.$(OBJEXT)
+ mysetenv.$(OBJEXT) editor.$(OBJEXT)
am_TuxType_OBJECTS = $(am__objects_1)
TuxType_OBJECTS = $(am_TuxType_OBJECTS)
TuxType_LDADD = $(LDADD)
@@ -65,7 +65,7 @@
practice.$(OBJEXT) audio.$(OBJEXT) snow.$(OBJEXT) \
scripting.$(OBJEXT) SDL_extras.$(OBJEXT) pixels.$(OBJEXT) \
pause.$(OBJEXT) convert_utf.$(OBJEXT) options.$(OBJEXT) \
- mysetenv.$(OBJEXT)
+ mysetenv.$(OBJEXT) editor.$(OBJEXT)
tuxtype_OBJECTS = $(am_tuxtype_OBJECTS)
tuxtype_LDADD = $(LDADD)
tuxtype_DEPENDENCIES =
@@ -291,7 +291,8 @@
pause.c \
convert_utf.c \
options.c \
- mysetenv.c
+ mysetenv.c \
+ editor.c
TuxType_SOURCES = $(tuxtype_SOURCES)
# The rc file has something to do with the icon in Windows, IIRC
@@ -308,7 +309,8 @@
convert_utf.h \
gettext.h \
compiler.h \
- mysetenv.h
+ mysetenv.h \
+ editor.h
all: all-am
@@ -383,6 +385,7 @@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alphabet.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/audio.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_utf.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/editor.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/laser.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/loaders.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/main.Po at am__quote@
Added: tuxtype/branches/gsoc-sarah/src/editor.c
===================================================================
--- tuxtype/branches/gsoc-sarah/src/editor.c (rev 0)
+++ tuxtype/branches/gsoc-sarah/src/editor.c 2009-08-01 19:32:39 UTC (rev 1323)
@@ -0,0 +1,20 @@
+/*
+* C Implementation: editor.c
+*
+// Description: Implementation of word- and phrase list-editing functionality for
+// Tux Typing
+//
+// Author: Sarah Frisk <ssfrisk at gmail.com> and David Bruce <davidstuartbruce at gmail.com>, (C) 2009
+//
+// Written for Google Summer of Code 2009
+//
+// Copyright: See COPYING file that comes with this distribution (briefly, GNU GPLv2+)
+*
+*/
+
+
+#include "globals.h"
+#include "funcs.h"
+#include "SDL_extras.h"
+#include "convert_utf.h"
+#include "editor.h"
\ No newline at end of file
Added: tuxtype/branches/gsoc-sarah/src/editor.h
===================================================================
--- tuxtype/branches/gsoc-sarah/src/editor.h (rev 0)
+++ tuxtype/branches/gsoc-sarah/src/editor.h 2009-08-01 19:32:39 UTC (rev 1323)
@@ -0,0 +1,18 @@
+//
+// C Interface: editor.h
+//
+// Description: Header for word- and phrase list-editing functionality for
+// Tux Typing
+//
+// Author: Sarah Frisk <ssfrisk at gmail.com> and David Bruce <davidstuartbruce at gmail.com>, (C) 2009
+//
+// Written for Google Summer of Code 2009
+//
+// Copyright: See COPYING file that comes with this distribution (briefly, GNU GPLv2+)
+//
+//
+
+#ifndef EDITOR_H
+#define EDITOR_H
+
+#endif
Modified: tuxtype/branches/gsoc-sarah/src/titlescreen.c
===================================================================
--- tuxtype/branches/gsoc-sarah/src/titlescreen.c 2009-08-01 18:54:38 UTC (rev 1322)
+++ tuxtype/branches/gsoc-sarah/src/titlescreen.c 2009-08-01 19:32:39 UTC (rev 1323)
@@ -21,7 +21,6 @@
#include "funcs.h"
#include "titlescreen.h"
#include "SDL_extras.h"
-#include "SDL_image.h"
#include "convert_utf.h"
/* --- media for menus --- */
@@ -1551,6 +1550,9 @@
}
+/* NOTE ChooseFile() is the function to pick custom word lists to edit. */
+/* We should change the name to something more descriptive. */
+
static void ChooseFile(void)
{
SDL_Surface* titles[MAX_WORD_LISTS] = {NULL};
@@ -1564,11 +1566,11 @@
int stop = 0;
int loc = 0;
int old_loc = 1;
-int number_of_lists = 0;
+ int number_of_lists = 0;
int themes = 0;
int i;
-int result = 0;
+ int result = 0;
char fn[FNLEN];
char fileNames[MAX_WORD_LISTS][FNLEN];
char wordTypes[MAX_WORD_LISTS][FNLEN];
@@ -1606,16 +1608,15 @@
if (themesFile->d_name[0] == '.')
continue;
- if (strcmp("CVS", themesFile->d_name)==0)
- continue;
+ if (strcmp("CVS", themesFile->d_name) == 0)
+ continue;
- sprintf(fn, "%s/%s" , settings.var_data_path, themesFile->d_name);
-
+ snprintf(fn, FNLEN, "%s/%s" , settings.var_data_path, themesFile->d_name);
/* CheckFile() returns 2 if dir, 1 if file, 0 if neither: */
if (CheckFile(fn) == 1)
- {
- /* We know it opens safely because CheckFile() returned 1 */
+ {
+ /* We know it opens safely because CheckFile() returned 1 */
fp = fopen(fn,"r");
/* HACK: we should get the names from file :) */
if (EOF ==fscanf(fp, "%[^\n]\n", wordTypes[themes]))
@@ -1624,8 +1625,7 @@
wordTypes[themes][0] = toupper(wordTypes[themes][0]);
fclose(fp);
strncpy( fileNames[themes++], themesFile->d_name, FNLEN-1 );
- }
-
+ }
} while (1);
More information about the Tux4kids-commits
mailing list