gcompris r3269 - in branches/gcomprixogoo/src: boards gcompris railroad-activity



Author: bcoudoin
Date: Sun Feb 24 20:29:24 2008
New Revision: 3269
URL: http://svn.gnome.org/viewvc/gcompris?rev=3269&view=rev

Log:
many small improvements. now the focus api is reentrant to support
size changing items.



Modified:
   branches/gcomprixogoo/src/boards/menu2.c
   branches/gcomprixogoo/src/gcompris/bar.c
   branches/gcomprixogoo/src/gcompris/board.c
   branches/gcomprixogoo/src/gcompris/config.c
   branches/gcomprixogoo/src/gcompris/gameutil.c
   branches/gcomprixogoo/src/gcompris/gcompris.c
   branches/gcomprixogoo/src/gcompris/menu.c
   branches/gcomprixogoo/src/gcompris/profile.c
   branches/gcomprixogoo/src/gcompris/properties.c
   branches/gcomprixogoo/src/gcompris/soundutil.c
   branches/gcomprixogoo/src/railroad-activity/railroad.c

Modified: branches/gcomprixogoo/src/boards/menu2.c
==============================================================================
--- branches/gcomprixogoo/src/boards/menu2.c	(original)
+++ branches/gcomprixogoo/src/boards/menu2.c	Sun Feb 24 20:29:24 2008
@@ -111,7 +111,7 @@
 #define D_INT_Y 5
 
 #define I_X 140
-#define I_Y 400
+#define I_Y 410
 #define I_W 600
 #define I_H 125
 
@@ -209,8 +209,6 @@
   icon_size_panel = ICON_SIZE_PANEL;
   icon_size_top = ICON_SIZE_TOP;
 
-  g_warning ("menu2 : start  board");
-
   if(agcomprisBoard != NULL)
     {
       gchar *img;
@@ -460,9 +458,6 @@
 
   ratio = get_ratio (menu_pixmap, icon_size);
 
-  if (ratio < 1.0)
-    g_warning("Resize %s", board->icon_name);
-
   pixmap_w = gdk_pixbuf_get_width(menu_pixmap) * ratio;
   pixmap_h = gdk_pixbuf_get_height(menu_pixmap) * ratio;
 
@@ -493,7 +488,6 @@
 
       /* We search a fixed path sound file */
       soundfile = gc_file_find_absolute(board->mandatory_sound_file);
-      g_warning("Checking mandatory_sound_file %s\n", board->mandatory_sound_file);
 
       if (!soundfile || !gc_prop_get()->fx)
 	{

Modified: branches/gcomprixogoo/src/gcompris/bar.c
==============================================================================
--- branches/gcomprixogoo/src/gcompris/bar.c	(original)
+++ branches/gcomprixogoo/src/gcompris/bar.c	Sun Feb 24 20:29:24 2008
@@ -50,6 +50,7 @@
 static void	 setup_item_signals (GooCanvasItem *item, gchar* name);
 static gboolean	 _bar_down(void *ignore);
 static void	 _bar_up();
+static void	 _force_bar_down();
 
 static gint current_level = -1;
 static gint current_flags = -1;
@@ -66,6 +67,7 @@
 
 static gint sound_play_id = 0;
 static gint bar_down_id = 0;
+static gboolean _hidden;
 
 static void  confirm_quit(gboolean answer);
 
@@ -238,7 +240,8 @@
 		"visibility", GOO_CANVAS_ITEM_INVISIBLE,
 		NULL);
 
-  _bar_down(NULL);
+  _hidden = FALSE;
+  _force_bar_down(NULL);
 }
 
 
@@ -404,6 +407,26 @@
 }
 
 static void
+_force_bar_down()
+{
+  if(bar_down_id)
+    g_source_remove (bar_down_id);
+
+  bar_down_id=0;
+
+  /* Hide it faster than normal */
+  goo_canvas_item_animate(rootitem,
+			  0,
+			  BOARDHEIGHT - 20,
+			  1,
+			  0,
+			  TRUE,
+			  100,
+			  10,
+			  GOO_CANVAS_ANIMATE_FREEZE);
+}
+
+static void
 _bar_up()
 {
   goo_canvas_item_raise(rootitem, NULL);
@@ -427,6 +450,8 @@
   /* Non yet initialized : Something Wrong */
   g_assert(level_item);
 
+  _hidden = hide;
+
   if(hide)
     {
       if(exit_item)
@@ -456,6 +481,8 @@
       gc_bar_set(current_flags);
 
     }
+
+  _force_bar_down();
 }
 
 /*-------------------------------------------------------------------------------*/
@@ -523,6 +550,9 @@
 		 GdkEventCrossing *event,
 		 char *data)
 {
+  if(_hidden)
+    return FALSE;
+
   bar_reset_sound_id();
   sound_play_id = g_timeout_add (1000, (GtkFunction) bar_play_sound, data);
   _bar_up();

Modified: branches/gcomprixogoo/src/gcompris/board.c
==============================================================================
--- branches/gcomprixogoo/src/gcompris/board.c	(original)
+++ branches/gcomprixogoo/src/gcompris/board.c	Sun Feb 24 20:29:24 2008
@@ -234,7 +234,7 @@
 
 	if(bp->is_our_board(gcomprisBoard)) {
 	  /* Great, we found our plugin */
-	  g_warning("We found the correct plugin for board %s (type=%s)\n",
+	  g_message("We found the correct plugin for board %s (type=%s)\n",
 		    gcomprisBoard->name, gcomprisBoard->type);
 
 	  gcomprisBoard->plugin = bp;
@@ -252,7 +252,7 @@
 
 	if(bp->is_our_board(gcomprisBoard)) {
 	  /* Great, we found our plugin */
-	  g_warning("We found the correct plugin for board %s (type=%s)\n",
+	  g_message("We found the correct plugin for board %s (type=%s)\n",
 		  gcomprisBoard->name, gcomprisBoard->type);
 
 	  gcomprisBoard->plugin = bp;
@@ -262,7 +262,7 @@
       }
     }
 
-  g_warning("No plugin library found for board type '%s', requested by '%s'",
+  g_message("No plugin library found for board type '%s', requested by '%s'",
 	    gcomprisBoard->type,  gcomprisBoard->filename);
 
   return FALSE;
@@ -295,7 +295,7 @@
 
   gmodule = g_module_open (gmodule_file, 0);
   if(gmodule) {
-    g_warning("opened module %s with name %s\n", gmodule_file, type);
+    g_message("opened module %s with name %s\n", gmodule_file, type);
   } else {
     g_warning("Failed to open module %s with name %s (error=%s)\n", gmodule_file,
 	      type, g_module_error());
@@ -320,7 +320,7 @@
 
       if(bp->is_our_board(gcomprisBoard)) {
 	/* Great, we found our plugin */
-	g_warning("We found the correct plugin for board %s (type=%s)\n", gcomprisBoard->name, gcomprisBoard->type);
+	g_message("We found the correct plugin for board %s (type=%s)\n", gcomprisBoard->name, gcomprisBoard->type);
 
 	/* done in is_our_board gcomprisBoard->plugin = bp; */
 
@@ -330,7 +330,7 @@
 
 	return TRUE;
       } else {
-	g_warning("We found a plugin with the name %s but is_our_board() returned FALSE (type=%s)\n",
+	g_message("We found a plugin with the name %s but is_our_board() returned FALSE (type=%s)\n",
 		  gcomprisBoard->name,
 		  gcomprisBoard->type);
       }
@@ -339,7 +339,7 @@
 		gcomprisBoard->filename);
     }
   }
-  g_warning("No plugin library found for board type '%s', requested by '%s'",
+  g_message("No plugin library found for board type '%s', requested by '%s'",
 	    gcomprisBoard->type,  gcomprisBoard->filename);
 
   return FALSE;
@@ -382,7 +382,7 @@
       if(gc_board_get_current_board_plugin()->pause_board)
 	gc_board_get_current_board_plugin()->pause_board(pause);
     }
-  else g_warning ("No boards to pause ?");
+  else g_message ("No boards to pause ?");
 }
 
 void

Modified: branches/gcomprixogoo/src/gcompris/config.c
==============================================================================
--- branches/gcomprixogoo/src/gcompris/config.c	(original)
+++ branches/gcomprixogoo/src/gcompris/config.c	Sun Feb 24 20:29:24 2008
@@ -743,6 +743,7 @@
 		    "pixbuf", (properties->fullscreen ? pixmap_checked : pixmap_unchecked),
 		    NULL);
 
+      gc_item_focus_init(item, NULL);
     }
   else if(!strcmp((char *)data, "music"))
     {
@@ -758,6 +759,7 @@
 	{
 	  gc_sound_bg_reopen();
 	}
+      gc_item_focus_init(item, NULL);
     }
   else if(!strcmp((char *)data, "effect"))
     {
@@ -765,6 +767,7 @@
       g_object_set (item,
 		    "pixbuf", (properties->fx ? pixmap_checked : pixmap_unchecked),
 		    NULL);
+      gc_item_focus_init(item, NULL);
     }
   else if(!strcmp((char *)data, "locale_previous"))
     {

Modified: branches/gcomprixogoo/src/gcompris/gameutil.c
==============================================================================
--- branches/gcomprixogoo/src/gcompris/gameutil.c	(original)
+++ branches/gcomprixogoo/src/gcompris/gameutil.c	Sun Feb 24 20:29:24 2008
@@ -238,6 +238,9 @@
  * Optionnaly, provide a target_item that will be focused
  * by events on source_item.
  *
+ * Warning: You must call it each time the size of the focused
+ *          item size changes.
+ *
  */
 #define GAP 4
 void gc_item_focus_init(GooCanvasItem *source_item,
@@ -245,6 +248,7 @@
 {
   GooCanvasItem *highlight_item;
   GooCanvasBounds bounds;
+  gboolean already_created = FALSE;
 
   if(!target_item)
     target_item = source_item;
@@ -259,20 +263,25 @@
   highlight_item = g_object_get_data (G_OBJECT(target_item),
 		     "highlight_item");
 
+  if(highlight_item)
+    {
+      already_created = TRUE;
+      goo_canvas_item_remove(highlight_item);
+    }
+
   /* Create the highlight_item */
-  if(!highlight_item)
-    highlight_item =
-      goo_canvas_rect_new (goo_canvas_item_get_parent(target_item),
-			   bounds.x1 - GAP,
-			   bounds.y1 - GAP,
-			   bounds.x2 - bounds.x1 + GAP*2,
-			   bounds.y2 - bounds.y1 + GAP*2,
-			   "stroke_color_rgba", 0xFFFFFFFFL,
-			   "fill_color_rgba", 0xFF000090L,
-			   "line-width", (double) 2,
-			   "radius-x", (double) 10,
-			   "radius-y", (double) 10,
-			   NULL);
+  highlight_item =
+    goo_canvas_rect_new (goo_canvas_item_get_parent(target_item),
+			 bounds.x1 - GAP,
+			 bounds.y1 - GAP,
+			 bounds.x2 - bounds.x1 + GAP*2,
+			 bounds.y2 - bounds.y1 + GAP*2,
+			 "stroke_color_rgba", 0xFFFFFFFFL,
+			 "fill_color_rgba", 0xFF000090L,
+			 "line-width", (double) 2,
+			 "radius-x", (double) 10,
+			 "radius-y", (double) 10,
+			 NULL);
 
   g_object_set_data (G_OBJECT(target_item), "highlight_item",
 		     highlight_item);
@@ -281,12 +290,15 @@
   		"visibility", GOO_CANVAS_ITEM_INVISIBLE,
   		NULL);
 
-  g_signal_connect(source_item, "enter_notify_event",
-		   (GtkSignalFunc) gc_item_focus_event,
-		   target_item);
-  g_signal_connect(source_item, "leave_notify_event",
-		   (GtkSignalFunc) gc_item_focus_event,
-		   target_item);
+  if(!already_created)
+    {
+      g_signal_connect(source_item, "enter_notify_event",
+		       (GtkSignalFunc) gc_item_focus_event,
+		       target_item);
+      g_signal_connect(source_item, "leave_notify_event",
+		       (GtkSignalFunc) gc_item_focus_event,
+		       target_item);
+    }
 }
 
 /*

Modified: branches/gcomprixogoo/src/gcompris/gcompris.c
==============================================================================
--- branches/gcomprixogoo/src/gcompris/gcompris.c	(original)
+++ branches/gcomprixogoo/src/gcompris/gcompris.c	Sun Feb 24 20:29:24 2008
@@ -376,12 +376,12 @@
     {
       if (gtk_im_context_filter_keypress (properties->context, event))
 	{
-	  g_warning("%d key is handled by context", kv);
+	  g_message("%d key is handled by context", kv);
 	  return TRUE;
 	}
     }
 
-  g_warning("%d key is NOT handled by context", kv);
+  g_message("%d key is NOT handled by context", kv);
   /* If the board needs to receive key pressed */
   /* NOTE: If a board receives key press, it must bind the ENTER Keys to OK
    *       whenever possible
@@ -637,14 +637,14 @@
   }
 
   if(!icon_file)
-      g_warning ("Couldn't find file %s !", icon_file);
+      g_message ("Couldn't find file %s !", icon_file);
   else
     {
       icon_pixbuf = gc_net_load_pixmap(icon_file);
 
       if (!icon_pixbuf)
 	{
-	  g_warning ("Failed to load pixbuf file: %s\n",
+	  g_message ("Failed to load pixbuf file: %s\n",
 		     icon_file);
 	}
       g_free(icon_file);
@@ -781,7 +781,7 @@
     gc_dialog(tmpstr, NULL);
     g_free(tmpstr);
   } else {
-    g_warning("Fine, we got the gcomprisBoardMenu, xml boards parsing went fine");
+    g_message("Fine, we got the gcomprisBoardMenu, xml boards parsing went fine");
     gc_board_play(board_to_start);
   }
 
@@ -1047,7 +1047,7 @@
       gc_fullscreen_set(properties->fullscreen);
       is_mapped = TRUE;
     }
-  g_warning("gcompris window is now mapped");
+  g_message("gcompris window is now mapped");
 }
 
 /*
@@ -1057,7 +1057,7 @@
 void gc_terminate(int signum)
 {
 
-  g_warning("GCompris got the %d signal, starting exit procedure", signum);
+  g_message("GCompris got the %d signal, starting exit procedure", signum);
 
   gc_exit();
 
@@ -1065,55 +1065,30 @@
 
 static void load_properties ()
 {
-  gchar *prefix_dir;
-  gchar *tmpstr;
-
   properties = gc_prop_new ();
 
   /* Initialize the binary relocation API
    *  http://autopackage.org/docs/binreloc/
    */
   if(gbr_init (NULL))
-    g_warning("Binary relocation enabled");
+    g_message("Binary relocation enabled");
   else
-    g_warning("Binary relocation disabled");
-
-  prefix_dir = gbr_find_prefix(NULL);
-  g_warning("prefix_dir=%s\n", prefix_dir);
+    g_message("Binary relocation disabled");
 
-  /* Check if we are in the source code (developper usage) */
-  tmpstr = g_strconcat(prefix_dir, "/gcompris/gcompris.c", NULL);
-  if(g_file_test(tmpstr, G_FILE_TEST_EXISTS))
-    {
-      /* Set all directory to get data from the source code we are run in */
-      properties->package_data_dir = g_strconcat(prefix_dir, "/../boards", NULL);
-
-      /* In source code, locale mo files are not generated, use the installed one */
-      properties->package_locale_dir = g_strdup(PACKAGE_LOCALE_DIR);
-
-      properties->package_plugin_dir = g_strconcat(prefix_dir, "/boards/.libs", NULL);
-      properties->package_python_plugin_dir = g_strconcat(prefix_dir, "/boards/python",
-							  NULL);
-      properties->system_icon_dir = g_strconcat(prefix_dir, "/..", NULL);
-      properties->menu_dir = g_strdup(prefix_dir);
-    }
-  else
-    {
-      gchar *pkg_data_dir = gbr_find_data_dir(PACKAGE_DATA_DIR);
-      gchar *pkg_clib_dir = gbr_find_lib_dir(PACKAGE_CLIB_DIR);
+  {
+    gchar *pkg_data_dir = gbr_find_data_dir(PACKAGE_DATA_DIR);
+    gchar *pkg_clib_dir = gbr_find_lib_dir(PACKAGE_CLIB_DIR);
 
-      properties->package_data_dir = g_strconcat(pkg_data_dir, "/gcompris/boards", NULL);
-      properties->package_locale_dir = gbr_find_locale_dir(PACKAGE_LOCALE_DIR);
-      properties->package_plugin_dir = g_strconcat(pkg_clib_dir, "/gcompris", NULL);
-      properties->package_python_plugin_dir = g_strconcat(pkg_data_dir, "/gcompris/python",
-							  NULL);
-      properties->system_icon_dir = g_strconcat(pkg_data_dir, "/pixmaps", NULL);
-      properties->menu_dir = g_strdup(properties->package_data_dir);
-      g_free(pkg_data_dir);
-      g_free(pkg_clib_dir);
-    }
-  g_free(tmpstr);
-  g_free(prefix_dir);
+    properties->package_data_dir = g_strconcat(pkg_data_dir, "/gcompris/boards", NULL);
+    properties->package_locale_dir = gbr_find_locale_dir(PACKAGE_LOCALE_DIR);
+    properties->package_plugin_dir = g_strconcat(pkg_clib_dir, "/gcompris", NULL);
+    properties->package_python_plugin_dir = g_strconcat(pkg_data_dir, "/gcompris/python",
+							NULL);
+    properties->system_icon_dir = g_strconcat(pkg_data_dir, "/pixmaps", NULL);
+    properties->menu_dir = g_strdup(properties->package_data_dir);
+    g_free(pkg_data_dir);
+    g_free(pkg_clib_dir);
+  }
 
   /* Display the directory value we have */
   printf("package_data_dir         = %s\n", properties->package_data_dir);
@@ -1199,10 +1174,10 @@
 #endif
 
   if(gc_locale!=NULL && strcmp(locale, gc_locale))
-    g_warning("Requested locale '%s' got '%s'", locale, gc_locale);
+    g_message("Requested locale '%s' got '%s'", locale, gc_locale);
 
   if(gc_locale==NULL)
-    g_warning("Failed to set requested locale %s got %s", locale, gc_locale);
+    g_message("Failed to set requested locale %s got %s", locale, gc_locale);
 
   /* Override the env locale to what the user requested */
   /* This makes gettext to give us the new locale text  */
@@ -1238,7 +1213,7 @@
 static void
 start_bg_music (gchar *file)
 {
-  g_warning ("start_bg_music %s", file);
+  g_message ("start_bg_music %s", file);
   gc_sound_bg_reopen();
 }
 
@@ -1357,7 +1332,7 @@
 	}
       else
 	{
-	  g_warning("Using %s as config directory.", popt_config_dir);
+	  g_message("Using %s as config directory.", popt_config_dir);
 	  g_free(properties->config_dir);
 	  properties->config_dir = g_strdup(popt_config_dir);
 	}
@@ -1409,21 +1384,21 @@
 
   if (popt_mute)
     {
-      g_warning("Sound disabled");
+      g_message("Sound disabled");
       properties->music = FALSE;
       properties->fx = FALSE;
     }
 
   if (popt_sound)
     {
-      g_warning("Sound enabled");
+      g_message("Sound enabled");
       properties->music = TRUE;
       properties->fx = TRUE;
     }
 
   if (popt_cursor)
     {
-      g_warning("Default gnome cursor enabled");
+      g_message("Default gnome cursor enabled");
       properties->defaultcursor = GDK_LEFT_PTR;
     }
 #ifdef WIN32
@@ -1432,26 +1407,26 @@
 
   if (popt_experimental)
     {
-      g_warning("Experimental boards allowed");
+      g_message("Experimental boards allowed");
       properties->experimental  = TRUE;
     }
 
   if (popt_no_quit)
     {
-      g_warning("Disable quit button");
+      g_message("Disable quit button");
       properties->disable_quit = TRUE;
     }
 
   if (popt_no_config)
     {
-      g_warning("Disable config button");
+      g_message("Disable config button");
       properties->disable_config = TRUE;
     }
 
   if (popt_difficulty_filter>=0)
     {
       /* This option provide less capacity than the GUI since we cannot set the filter_style */
-      g_warning("Display only activities of level %d", popt_difficulty_filter);
+      g_message("Display only activities of level %d", popt_difficulty_filter);
       properties->difficulty_filter = popt_difficulty_filter;
       properties->filter_style      = GCOMPRIS_FILTER_EQUAL;
     }
@@ -1529,7 +1504,7 @@
       exit(0);
     }
     else {
-      g_warning("Using menu %s as root.", popt_root_menu);
+      g_message("Using menu %s as root.", popt_root_menu);
       g_free(properties->root_menu);
       properties->root_menu = g_strdup(popt_root_menu);
     }
@@ -1540,13 +1515,13 @@
       if ((!g_file_test(popt_user_dir, G_FILE_TEST_IS_DIR)) ||
 	  (g_access(popt_user_dir, popt_administration? R_OK : W_OK ) == -1))
 	{
-	  g_warning("%s does not exists or is not %s ", popt_user_dir,
+	  g_message("%s does not exists or is not %s ", popt_user_dir,
 		    popt_administration? "readable" : "writable");
 	  exit(0);
 	}
       else
 	{
-	  g_warning("Using %s as user directory.", popt_user_dir);
+	  g_message("Using %s as user directory.", popt_user_dir);
 	  g_free(properties->user_dir);
 	  properties->user_dir = g_strdup(popt_user_dir);
 	}
@@ -1577,7 +1552,7 @@
 	 properties->config_dir,
 	 properties->user_dir);
 #ifdef USE_SQLITE
-  printf("   Database '%s'\n",properties->database);
+  printf("   Database '%s'\n", properties->database);
 #endif
 
   if (popt_create_db)
@@ -1585,35 +1560,35 @@
       gchar *dirname = g_path_get_dirname (properties->database);
       if (g_access(dirname, W_OK)==-1)
 	{
-	  g_warning("Cannot create %s : %s is not writable !", properties->database, dirname);
+	  g_message("Cannot create %s : %s is not writable !", properties->database, dirname);
 	  exit (0);
 	}
       /* We really want to recreate it, erase the old one */
-      g_warning("Removing %s database.", properties->database);
+      g_message("Removing %s database.", properties->database);
       unlink(properties->database);
     }
 
   if (popt_administration){
     if (popt_database){
       if (g_access(popt_database,R_OK|W_OK)==-1){
-	g_warning("%s exists but is not writable", popt_database);
+	g_message("%s exists but is not writable", popt_database);
 	exit(0);
       }
     }
-    g_warning("Running in administration mode");
+    g_message("Running in administration mode");
     properties->administration = TRUE;
-    g_warning("Music disabled");
+    g_message("Music disabled");
     properties->music = FALSE;
     properties->fx = FALSE;
-    g_warning("Fullscreen and cursor is disabled");
+    g_message("Fullscreen and cursor is disabled");
     properties->fullscreen = FALSE;
     properties->defaultcursor = GDK_LEFT_PTR;
   }
 
   if (popt_reread_menu){
-    g_warning("Rebuild db from xml files");
+    g_message("Rebuild db from xml files");
     if (g_access(properties->database, W_OK)==-1)
-      g_warning("Cannot reread menu when database is read-only !");
+      g_message("Cannot reread menu when database is read-only !");
     else
       properties->reread_menu = TRUE;
   }
@@ -1648,7 +1623,7 @@
       else {
 	if (strcmp(popt_drag_mode, "both") == 0)
 	  properties->drag_mode = GC_DRAG_MODE_BOTH;
-	else g_warning("Unknown drag mode ! Valids modes are \"normal\", \"2clicks\" and \"both\"");
+	else g_message("Unknown drag mode ! Valids modes are \"normal\", \"2clicks\" and \"both\"");
       }
     }
   }

Modified: branches/gcomprixogoo/src/gcompris/menu.c
==============================================================================
--- branches/gcomprixogoo/src/gcompris/menu.c	(original)
+++ branches/gcomprixogoo/src/gcompris/menu.c	Sun Feb 24 20:29:24 2008
@@ -209,7 +209,7 @@
 			credit
 			);
 
-    g_warning("db board written %d in %d  %s/%s",
+    g_message("db board written %d in %d  %s/%s",
 	      gcomprisBoard->board_id, gcomprisBoard->section_id,
 	      gcomprisBoard->section, gcomprisBoard->name);
 
@@ -270,8 +270,8 @@
 
       if(!g_file_test ((filename), G_FILE_TEST_EXISTS))
 	{
-	  g_warning("Couldn't find file %s !", fname);
-	  g_warning("Couldn't find file %s !", filename);
+	  g_message("Couldn't find file %s !", fname);
+	  g_message("Couldn't find file %s !", filename);
 	  g_free(filename);
 	  g_free(gcomprisBoard);
 	  return NULL;
@@ -494,7 +494,6 @@
     }
     cell = cell->next;
   }
-  g_warning("suppress_int_from_list value %d not found", value);
   return list;
 }
 
@@ -522,14 +521,14 @@
   GList *list_old_boards_id = NULL;
 
   if (!g_file_test(dirname, G_FILE_TEST_IS_DIR)) {
-    g_warning("Failed to parse board in '%s' because it's not a directory\n", dirname);
+    g_message("Failed to parse board in '%s' because it's not a directory\n", dirname);
     return;
   }
 
   dir = g_dir_open(dirname, 0, NULL);
 
   if (!dir) {
-    g_warning("gc_menu_load : no menu found in %s", dirname);
+    g_message("gc_menu_load : no menu found in %s", dirname);
     return;
   } else {
     if (db)

Modified: branches/gcomprixogoo/src/gcompris/profile.c
==============================================================================
--- branches/gcomprixogoo/src/gcompris/profile.c	(original)
+++ branches/gcomprixogoo/src/gcompris/profile.c	Sun Feb 24 20:29:24 2008
@@ -46,7 +46,7 @@
   if (user)
     properties->logged_user = user;
   else {
-    g_warning("No user, getting one from system.");
+    g_message("No user, getting one from system.");
     GcomprisUser *sys_user = g_malloc0(sizeof(GcomprisUser));
 
     const gchar *user_name = g_get_user_name ();

Modified: branches/gcomprixogoo/src/gcompris/properties.c
==============================================================================
--- branches/gcomprixogoo/src/gcompris/properties.c	(original)
+++ branches/gcomprixogoo/src/gcompris/properties.c	Sun Feb 24 20:29:24 2008
@@ -357,7 +357,7 @@
 			 &length,
 			 NULL)) {
 
-    g_warning("Loading config file '%s'", config_file);
+    g_message("Loading config file '%s'", config_file);
 
     /* create a new scanner */
     scanner = g_scanner_new(NULL);
@@ -534,7 +534,6 @@
   g_free(props->server);
   g_free(props->root_menu);
   g_free(props);
-  g_warning("properties free");
 }
 
 void

Modified: branches/gcomprixogoo/src/gcompris/soundutil.c
==============================================================================
--- branches/gcomprixogoo/src/gcompris/soundutil.c	(original)
+++ branches/gcomprixogoo/src/gcompris/soundutil.c	Sun Feb 24 20:29:24 2008
@@ -79,11 +79,11 @@
   switch( GST_MESSAGE_TYPE( msg ) )
     {
     case GST_MESSAGE_EOS:
-      g_warning("fx_bus: EOS START");
+      g_message("fx_bus: EOS START");
       gc_sound_fx_close();
       gc_sound_callback((gchar *)data);
       fx_play();
-      g_warning("fx_bus: EOS END");
+      g_message("fx_bus: EOS END");
       break;
     default:
       break;
@@ -97,7 +97,7 @@
 {
   switch( GST_MESSAGE_TYPE( msg ) ) {
     case GST_MESSAGE_EOS:
-        g_warning("bg_bus: EOS");
+        g_message("bg_bus: EOS");
 	gc_sound_bg_close();
 	bg_play(NULL);
 	break;
@@ -129,7 +129,7 @@
 void
 gc_sound_fx_close()
 {
-  g_warning("gc_sound_fx_close");
+  g_message("gc_sound_fx_close");
   if (fx_pipeline)
     {
       gst_element_set_state(fx_pipeline, GST_STATE_NULL);
@@ -242,7 +242,7 @@
   dir = g_dir_open(music_dir, 0, NULL);
 
   if (!dir) {
-    g_warning ("Couldn't open music dir: %s", music_dir);
+    g_message ("Couldn't open music dir: %s", music_dir);
     g_free(music_dir);
     return NULL;
   }
@@ -293,7 +293,7 @@
 
   if(!bg_pipeline)
     {
-      g_warning("Failed to build the gstreamer pipeline (for background music)");
+      g_message("Failed to build the gstreamer pipeline (for background music)");
       gc_prop_get()->music = 0;
       return NULL;
     }
@@ -304,7 +304,7 @@
 
   gchar *uri = g_strconcat("file://", absolute_file, NULL);
   g_free(absolute_file);
-  g_warning("  bg_play %s", uri);
+  g_message("  bg_play %s", uri);
 
   g_object_set (G_OBJECT (bg_pipeline), "uri", uri, NULL);
 
@@ -312,7 +312,7 @@
 							     GST_STATE_PLAYING);
   gst_element_get_state(bg_pipeline, NULL, NULL, 1000*GST_MSECOND);
   if( statechanged == GST_STATE_CHANGE_SUCCESS) {
-    g_warning("%s : bg_playing\n",__FUNCTION__);
+    g_message("%s : bg_playing\n",__FUNCTION__);
   }
 
   g_free(uri);
@@ -338,7 +338,7 @@
   if(!file)
     return;
 
-  g_warning("  fx_play %s", file);
+  g_message("  fx_play %s", file);
 
   absolute_file = gc_file_find_absolute(file);
 
@@ -350,14 +350,14 @@
 
   if (!fx_pipeline)
     {
-      g_warning("Failed to build the gstreamer pipeline");
+      g_message("Failed to build the gstreamer pipeline");
       gc_prop_get()->fx = 0;
       return;
     }
 
   gchar *uri = g_strconcat("file://", absolute_file, NULL);
   g_free(absolute_file);
-  g_warning("   uri '%s'", uri);
+  g_message("   uri '%s'", uri);
 
   g_object_set (G_OBJECT (fx_pipeline), "uri", uri, NULL);
   gst_bus_add_watch (gst_pipeline_get_bus (GST_PIPELINE (fx_pipeline)),
@@ -367,7 +367,7 @@
 							     GST_STATE_PLAYING);
   gst_element_get_state(fx_pipeline, NULL, NULL, 1000*GST_MSECOND);
   if( statechanged == GST_STATE_CHANGE_SUCCESS) {
-    g_warning("%s : fx_playing\n",__FUNCTION__);
+    g_message("%s : fx_playing\n",__FUNCTION__);
   }
 
   g_free(uri);
@@ -387,7 +387,7 @@
     {
       tmpSound = g_list_nth_data( pending_queue, 0 );
       pending_queue = g_list_remove( pending_queue, tmpSound );
-      g_warning( "... get_next_sound_to_play : %s\n", tmpSound );
+      g_message( "... get_next_sound_to_play : %s\n", tmpSound );
     }
 
   return tmpSound;
@@ -438,7 +438,7 @@
 
   list = g_list_append(list, (gpointer)sound);
 
-  g_warning("Adding %s in the play list queue\n", sound);
+  g_message("Adding %s in the play list queue\n", sound);
 
   va_start( ap, sound);
   while( (tmp = va_arg (ap, char *)))
@@ -473,7 +473,7 @@
     return;
 
   if (sound_policy == PLAY_AND_INTERRUPT ) {
-    g_warning("halt music");
+    g_message("halt music");
     while ( g_list_length(pending_queue) > 0 )
     {
       tmpSound = g_list_nth_data( pending_queue, 0 );
@@ -550,11 +550,11 @@
 
   if (cb)
     {
-      g_warning("calling callback for %s", file);
+      g_message("calling callback for %s", file);
       cb(file);
     }
   else
-    g_warning("%s has no callback", file);
+    g_message("%s has no callback", file);
 
   g_hash_table_remove(sound_callbacks, file);
 

Modified: branches/gcomprixogoo/src/railroad-activity/railroad.c
==============================================================================
--- branches/gcomprixogoo/src/railroad-activity/railroad.c	(original)
+++ branches/gcomprixogoo/src/railroad-activity/railroad.c	Sun Feb 24 20:29:24 2008
@@ -171,9 +171,9 @@
       gcomprisBoard->sublevel=1;
       gcomprisBoard->number_of_sublevel=NUMBER_OF_SUBLEVELS; /* Go to next level after this number of 'play' */
       gc_score_start(SCORESTYLE_NOTE,
-			   gcomprisBoard->width - 220,
-			   gcomprisBoard->height - 50,
-			   gcomprisBoard->number_of_sublevel);
+		     gcomprisBoard->width - 220,
+		     gcomprisBoard->height - 50,
+		     gcomprisBoard->number_of_sublevel);
 
 
       str = gc_skin_image_get("button_reload.png");
@@ -281,7 +281,10 @@
   gc_score_set(gcomprisBoard->sublevel);
 
   /* Try the next level */
-  railroad_create_item(goo_canvas_get_root_item(gcomprisBoard->canvas));
+  boardRootItem = goo_canvas_group_new (goo_canvas_get_root_item(gcomprisBoard->canvas),
+					NULL);
+
+  railroad_create_item(boardRootItem);
 }
 /* ==================================== */
 /* Destroy all the items */
@@ -293,16 +296,13 @@
   boardRootItem = NULL;
 }
 /* ==================================== */
-static GooCanvasItem *railroad_create_item(GooCanvasItem *parent)
+static GooCanvasItem *railroad_create_item(GooCanvasItem *boardRootItem)
 {
   int xOffset = 0, yOffset = 0;
   int i, r, l = 1;
   GdkPixbuf * pixmap = NULL;
   GooCanvasItem *item;
 
-  boardRootItem = goo_canvas_group_new (goo_canvas_get_root_item(gcomprisBoard->canvas),
-					NULL);
-
   /* Create a root group for the answer */
   answerRootItem = goo_canvas_group_new (boardRootItem, NULL);
 
@@ -399,8 +399,6 @@
 
   gamewon = TRUE;
 
-  // DEBUG
-  g_warning("l answer = %d\tl model = %d\n", g_list_length(int_answer_list), g_list_length(int_model_list));
   if (g_list_length(int_answer_list) != g_list_length(int_model_list))
     gamewon = FALSE;
   else
@@ -411,13 +409,6 @@
 	break;
       }
     }
-  // DUMP lists
-  g_warning("answer:\n");
-  for (i=0; i<g_list_length(int_answer_list); i++)
-    g_warning(" i = \t%d val = \t%d\n", i, GPOINTER_TO_INT(g_list_nth_data(int_answer_list,i)) );
-  g_warning("model:\n");
-  for (i=0; i<g_list_length(int_model_list); i++)
-    g_warning(" i = \t%d val = \t%d\n", i, GPOINTER_TO_INT(g_list_nth_data(int_model_list,i)) );
 
   gc_bonus_display(gamewon, GC_BONUS_FLOWER);
 }
@@ -449,7 +440,6 @@
   switch (event->type)
     {
     case GDK_BUTTON_PRESS:
-      g_warning("GDK_BUTTON_PRESS item %d\tlength answer = %d\n",item_number,g_list_length(item_answer_list));
       gc_sound_play_ogg ("sounds/bleep.wav", NULL);
       xOffset = 0;
       for (i=0; i<g_list_length(item_answer_list); i++) {
@@ -507,7 +497,6 @@
     {
     case GDK_BUTTON_PRESS:
       gc_sound_play_ogg ("sounds/smudge.wav", NULL);
-      g_warning("Deleting %d\n",item_number);
       local_item = g_list_nth_data(item_answer_list,item_number);
       item_answer_list = g_list_remove( item_answer_list, local_item );
       goo_canvas_item_remove(local_item);
@@ -542,7 +531,6 @@
   if(!gcomprisBoard)
     return;
 
-  g_warning("+++ reposition_answer\n");
   for (i=0; i<g_list_length(item_answer_list); i++) {
     GooCanvasBounds bounds;
     item = g_list_nth_data(item_answer_list,i);
@@ -560,7 +548,6 @@
   if(!gcomprisBoard)
     return;
 
-  g_warning("+++ reposition_model\n");
   goo_canvas_item_translate(modelRootItem, 0, 0);
   for (i=0; i<model_size; i++) {
     GooCanvasBounds bounds;



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