Commit 898c36ea authored by Bruno Coudoin's avatar Bruno Coudoin
Browse files

Removed some more warnings

	Fixed config file searching (was broken on win98)
	Improved traffic activity background and icon based on the
	red car from Franck
parent 583d68a5
2005-10-01 Bruno coudoin <bruno.coudoin@free.fr>
Removed some more warnings
Fixed config file searching (was broken on win98)
Improved traffic activity background and icon based on the
red car from Franck
* boards/boardicons/traffic.png:
* boards/traffic/traffic-bg.jpg:
* boards/traffic/traffic.png:
* src/boards/chess_position.c: (position_set_initial_partyend),
(position_set_initial_movelearn), (position_display):
* src/boards/click_on_letter.c: (save_table):
* src/boards/gletters.c: (conf_ok):
* src/boards/hanoi.c: (item_event):
* src/boards/hanoi_real.c: (hanoi_create_item):
* src/boards/money_widget.c:
* src/boards/traffic.c: (start_board), (traffic_create_item),
(cars_from_strv):
* src/gcompris/board.c: (init_plugins):
* src/gcompris/board_config.c: (gcompris_get_locales_asset_list),
(gcompris_textview_destroy), (gcompris_textbuffer_changed),
(gcompris_textview_yes):
* src/gcompris/images_selector.c: (item_event_imageset_selector),
(item_event_scroll), (parseImage), (read_dataset_directory):
* src/gcompris/main.c: (main):
* src/gcompris/properties.c: (get_gcompris_conf_name),
(gcompris_properties_new), (gcompris_properties_save):
2005-10-01 Bruno coudoin <bruno.coudoin@free.fr>
Cleanup of clockgame.c, make a good usage of it's 2 background images.
......
boards/boardicons/traffic.png

9.33 KB | W: | H:

boards/boardicons/traffic.png

9.34 KB | W: | H:

boards/boardicons/traffic.png
boards/boardicons/traffic.png
boards/boardicons/traffic.png
boards/boardicons/traffic.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -25,6 +25,7 @@
#include <stdlib.h>
#include <string.h>
#include "chess_position.h"
#include "chess_notation.h"
struct _PositionPrivate {
......@@ -216,7 +217,6 @@ position_set_initial (Position *pos)
void
position_set_initial_partyend (Position *pos, int level)
{
unsigned int a;
register Square square;
register gshort rank;
......@@ -283,7 +283,6 @@ position_set_initial_partyend (Position *pos, int level)
void
position_set_initial_movelearn (Position *pos, int level)
{
unsigned int a;
register Square square;
register gshort rank;
......@@ -384,7 +383,6 @@ void
position_display (Position *pos)
{
register Square square;
register Piece piece;
register gshort rank;
for (rank = 8; rank >= 1; rank--) {
......
......@@ -547,6 +547,8 @@ static GHFunc save_table (gpointer key,
board_conf,
(gchar *) key,
(gchar *) value);
return NULL;
}
static GcomprisConfCallback conf_ok(GHashTable *table)
......
/* gcompris - gletters.c
*
* Time-stamp: <2005/09/25 00:18:36 yves>
* Time-stamp: <2005/10/01 13:56:29 bruno>
*
* Copyright (C) 2000 Bruno Coudoin
*
......@@ -746,12 +746,6 @@ static GcomprisConfCallback conf_ok(GHashTable *table)
profile_conf = NULL;
}
static gboolean check_text(gchar *key, gchar *text, GtkLabel *label){
gtk_label_set_markup(label, text);
return TRUE;
}
static void
gletter_config_start(GcomprisBoard *agcomprisBoard,
GcomprisProfile *aProfile)
......
......@@ -71,10 +71,6 @@ static int number_of_item_y = 0;
static int item_width;
static int item_height;
/* Keep here the limit of the column */
static gint limit_column_x1[MAX_NUMBER_X];
static gint limit_column_x2[MAX_NUMBER_X];
static guint colorlist [] =
{
0x00FFFFFF,
......@@ -276,6 +272,7 @@ static void hanoi_destroy_all_items()
}
#if 0
static void dump_solution()
{
guint i, j;
......@@ -297,6 +294,7 @@ static void print_piece(PieceItem *piece)
{
g_warning("Piece: (%d,%d=%2d/%d)\n", piece->i, piece->j, piece->color, piece->on_top);
}
#endif
/* ==================================== */
static GnomeCanvasItem *hanoi_create_item(GnomeCanvasGroup *parent)
......@@ -674,7 +672,7 @@ item_event(GnomeCanvasItem *item, GdkEvent *event, PieceItem *data)
case GDK_BUTTON_RELEASE:
if(dragging)
{
gint i,j;
gint i;
gint tmpi, tmpj;
double tmpx, tmpy;
PieceItem *piece_src;
......
......@@ -279,7 +279,7 @@ static GnomeCanvasItem *hanoi_create_item(GnomeCanvasGroup *parent)
"x", (double) BOARDWIDTH/2 +1,
"y", (double) BOARDHEIGHT - 50 +1,
"anchor", GTK_ANCHOR_NORTH,
"fill_color", "black",
"fill_color_rgba", gcompris_skin_color_shadow,
"justification", GTK_JUSTIFY_CENTER,
NULL);
......
......@@ -107,6 +107,7 @@ money_widget_get_type ()
return money_widget_type;
}
#if 0
static void
finalize (GtkObject *object)
{
......@@ -129,6 +130,7 @@ finalize (GtkObject *object)
moneyWidget->priv = NULL;
}
#endif
static void
class_init (Money_WidgetClass *class)
......
......@@ -20,6 +20,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <string.h>
#include <ctype.h>
#include <math.h>
#include <assert.h>
......@@ -85,11 +86,8 @@ gboolean load_level(guint level, guint card);
static jam current_card ={0,0,0,NULL};
static void draw_border(GnomeCanvasGroup *rootBorder);
static void draw_grid (GnomeCanvasGroup *rootBorder);
static gint cars_from_strv(char *strv);
static void load_error(void);
static void load_not_found(void);
/* Description of this plugin */
static BoardPlugin menu_bp =
......@@ -171,8 +169,7 @@ static void start_board (GcomprisBoard *agcomprisBoard)
gcompris_bar_set(GCOMPRIS_BAR_LEVEL|GCOMPRIS_BAR_REPEAT);
}
gcompris_set_background(gnome_canvas_root(gcomprisBoard->canvas),
"traffic/traffic-bg.jpg");
gcompris_set_background(gnome_canvas_root(gcomprisBoard->canvas), "traffic/traffic.png");
traffic_next_level();
......@@ -268,7 +265,6 @@ static void traffic_destroy_all_items()
/* ==================================== */
static GnomeCanvasItem *traffic_create_item(GnomeCanvasGroup *parent)
{
int i,j;
GnomeCanvasGroup *borderItem = NULL;
boardRootItem = GNOME_CANVAS_GROUP(
......@@ -283,7 +279,6 @@ static GnomeCanvasItem *traffic_create_item(GnomeCanvasGroup *parent)
"x", (double) OFSET_X,
"y", (double) OFSET_Y,
NULL));
// draw_border(borderItem);
draw_grid(borderItem);
allcars= GNOME_CANVAS_GROUP(
......@@ -382,38 +377,6 @@ void draw_car(car *thiscar)
gtk_object_set_data(GTK_OBJECT(car_rect),"whatami",(gpointer)"car_rect");
}
static void draw_border(GnomeCanvasGroup *rootBorder)
{
GnomeCanvasItem *border;
GnomeCanvasPoints *points;
double mypoints[]={
0,0,
261,0,
261,90,
251,90,
251,9,
9,9,
9,251,
251,251,
251,130,
261,130,
261,261,
0,261,
0,0
};
points=gnome_canvas_points_new(13);
memcpy(points->coords,mypoints,sizeof(mypoints));
border=gnome_canvas_item_new(rootBorder,
gnome_canvas_polygon_get_type(),
"points", points,
"fill_color", "black",
"outline_color", NULL,
"width_units", 0.0,
NULL);
}
void draw_jam(jam *myjam)
{
int whichcar;
......@@ -645,7 +608,6 @@ gint cars_from_strv(char *strv)
{
car *ccar;
char x,y,id;
int col, row;
int number_of_cars = 0;
gboolean more_car = TRUE;
......@@ -722,13 +684,3 @@ gint cars_from_strv(char *strv)
return number_of_cars;
}
void load_error(void)
{
board_finished(BOARD_FINISHED_RANDOM);
}
void load_not_found(void)
{
board_finished(BOARD_FINISHED_RANDOM);
}
......@@ -17,8 +17,12 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <string.h>
#include "gcompris.h"
static struct BoardPluginData *bp_data;
#if defined _WIN32 || defined __WIN32__
......@@ -87,7 +91,6 @@ static gchar *plugin_paths[] = {
void init_plugins(void)
{
guint i=0;
BoardPlugin **boards_list = NULL;
bp_data = g_malloc0(sizeof (struct BoardPluginData));
......
/* gcompris - board_config.c
*
* Time-stamp: <2005/09/18 00:01:46 yves>
* Time-stamp: <2005/10/01 14:34:12 bruno>
*
* Copyright (C) 2001 Pascal Georges
*
......@@ -19,6 +19,8 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <string.h>
#include "gcompris.h"
#include "assetml.h"
......@@ -688,7 +690,6 @@ GList *gcompris_get_locales_asset_list(gchar *dataset, gchar* categories,
GList *gl_result;
AssetML *assetml;
gchar* resultfile = NULL;
locales = gcompris_get_locales_list();
......@@ -800,6 +801,8 @@ void *gcompris_textview_destroy (GtkButton *button,
gpointer user_data){
g_free(((user_param_type *)user_data)->key);
g_free(user_data);
return NULL;
}
......@@ -808,6 +811,8 @@ void *gcompris_textbuffer_changed (GtkTextBuffer *buffer,
gtk_widget_set_sensitive (GTK_WIDGET(user_data),
TRUE);
return NULL;
}
void *gcompris_textview_yes (GtkButton *button,
......@@ -850,6 +855,8 @@ void *gcompris_textview_yes (GtkButton *button,
g_free (in_memoriam_key);
}
g_free(text);
return NULL;
}
GtkTextView *gcompris_textview(const gchar *label,
......
/* gcompris - images_selector.c
*
* Time-stamp: <2005/09/29 23:09:06 bruno>
* Time-stamp: <2005/10/01 14:49:05 bruno>
*
* Copyright (C) 2000 Bruno Coudoin
*
......@@ -500,11 +500,11 @@ item_event_imageset_selector(GnomeCanvasItem *item, GdkEvent *event, gpointer da
/* We must display the list of images for this set */
image_list = (GList *)g_object_get_data (G_OBJECT (item), "imagelist");
g_return_if_fail (image_list != NULL);
g_return_val_if_fail (image_list != NULL, FALSE);
/* We must display the list of images for this set */
rootitem_set = (GnomeCanvasItem *)g_object_get_data (G_OBJECT (item), "rootitem");
g_return_if_fail (rootitem_set != NULL);
g_return_val_if_fail (rootitem_set != NULL, FALSE);
imageset_done = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "imageset_done"));
......@@ -585,7 +585,7 @@ item_event_scroll(GnomeCanvasItem *item, GdkEvent *event, GnomeCanvas *canvas)
{
int x, y;
if(!rootitem)
return;
return FALSE;
switch (event->type)
{
......@@ -615,10 +615,10 @@ parseImage (xmlDocPtr doc, xmlNodePtr cur) {
gchar *pathname = NULL;
gchar *absolutepath;
GList *imageList = NULL; /* List of Images */
gboolean havePathName = FALSE, lsdir = FALSE;
gboolean havePathName = FALSE;
gchar *type = NULL;
GDir *imageset_directory;
GError **error;
GError **error = NULL;
/* get the filename of this ImageSet */
imageSetName = xmlGetProp(cur,"filename");
......@@ -802,7 +802,7 @@ read_dataset_directory(gchar *dataset_dir)
{
GError **error;
GError **error = NULL;
GDir *dataset_directory = g_dir_open (dataset_dir, 0, error);
gchar *fname, *absolute_fname;
......
......@@ -30,4 +30,6 @@ int
main (int argc, char *argv[])
{
gcompris_init(argc, argv);
return(0);
}
/* gcompris - properties.c
*
* Time-stamp: <2005/09/28 21:02:52 bruno>
* Time-stamp: <2005/10/01 14:03:36 bruno>
*
* Copyright (C) 2000,2003 Bruno Coudoin
*
......@@ -41,6 +41,8 @@
# include <windows.h>
#endif
static gchar *config_file = NULL;
/*
* return 1 if parsing OK, 0 otherwise
* the return value is returned in retval
......@@ -110,14 +112,24 @@ gchar *get_gcompris_user_root_directory ()
return g_strconcat(home_dir, "/.gcompris", NULL);
}
/** return the name of the configuration file used
* the name has the full path and is platform dependant
* must not be freed by the caller.
*
*/
gchar *get_gcompris_conf_name()
{
/* why not the same name ? */
if(config_file)
return(config_file);
/* Was never called, mus calculate it */
if (g_get_home_dir()==NULL) {
return g_strconcat(get_gcompris_user_root_directory(), "/gcompris.cfg", NULL);
config_file = g_strconcat(get_gcompris_user_root_directory(), "/gcompris.cfg", NULL);
} else {
return g_strconcat(get_gcompris_user_root_directory(), "/gcompris.conf", NULL);
config_file = g_strconcat(get_gcompris_user_root_directory(), "/gcompris.conf", NULL);
}
return(config_file);
}
/* get the default database name */
......@@ -136,7 +148,7 @@ gchar *get_default_database_name (gchar *shared_dir)
GcomprisProperties *gcompris_properties_new ()
{
GcomprisProperties *tmp;
char *config_file;
char *config_file = get_gcompris_conf_name();
GScanner *scanner;
int filefd;
gchar *full_rootdir;
......@@ -189,14 +201,10 @@ GcomprisProperties *gcompris_properties_new ()
create_rootdir(full_rootdir);
g_free(full_rootdir);
config_file = get_gcompris_conf_name();
g_warning("config_file %s", config_file);
filefd = open(config_file, O_RDONLY);
g_free(config_file);
if(filefd > 0) {
/* create a new scanner */
......@@ -316,11 +324,9 @@ void gcompris_properties_destroy (GcomprisProperties *props)
void gcompris_properties_save (GcomprisProperties *props)
{
char *config_file;
char *config_file = get_gcompris_conf_name();
FILE *filefd;
config_file = g_strconcat(get_gcompris_user_root_directory(), "/gcompris.conf", NULL);
filefd = fopen(config_file, "w+");
if(!filefd) {
......@@ -328,8 +334,6 @@ void gcompris_properties_save (GcomprisProperties *props)
return;
}
g_free(config_file);
fprintf(filefd, "%s=%d\n", "music", props->music);
fprintf(filefd, "%s=%d\n", "fx", props->fx);
fprintf(filefd, "%s=%d\n", "screensize", props->screensize);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment