Commit 4fb09c9f authored by Bruno Coudoin's avatar Bruno Coudoin

Changed to use the new menu system. Now submenu are discovered dynamically

parent 93c70b69
2003-01-12 bruno <bruno.coudoin@free.fr>
* boards/*.xml.in: Changed to use the new menu system. Now submenu are discovered dynamically
* boards/images/scenery2_background.jpg: added a descent see color
* configure.in: removed unsused definition
* src/boards/clickgame.c: (clickgame_start): cleanup
* src/boards/machpuzzle.c: (machpuzzle_destroy_all_items),
(machpuzzle_create_item), (item_event), (create_machine_item),
(machpuzzle_move): improved but far from complete yet
* src/boards/menu.c: (menu_start), (menu_end), (menu_create_item),
(create_info_area): Changed to use the new menu system
* src/gcompris/gameutil.c: (gcompris_add_xml_to_data),
(gcompris_read_xml_file), (gcompris_get_board_from_section),
(boardlist_compare_func), (gcompris_get_menulist), (selectMenuXML),
(gcompris_load_menus): Changed to use the new menu system
* src/gcompris/gameutil.h: Changed to use the new menu system
* src/gcompris/gcompris-board.h:Changed to use the new menu system
* src/gcompris/gcompris-edit.c: (init_tree), (add_menu),
(parse_doc), (read_xml_file), (main):Changed to use the new menu system
* src/gcompris/gcompris.c: (setup_window), (gcompris_set_locale),
(gcompris_init):Changed to use the new menu system
* src/gcompris/gcompris.h:Changed to use the new menu system
2003-01-06 bruno <bruno.coudoin@free.fr>
* acconfig.h: removed an unused define for plugins
......
......@@ -3,6 +3,7 @@
<Board
name="advanced_colors"
type="advanced_colors"
section="/fun/colors/."
mode="*"
difficulty="3"
icon="boardicons/advanced_colors.png"
......
......@@ -3,6 +3,7 @@
<Board
name="algebra_by"
type="algebra"
section="/algebra/algebra/."
mode="*"
difficulty="3"
icon="boardicons/algebra_by.png"
......
......@@ -3,6 +3,8 @@
<Board
name="algebra"
type="menu"
section="/algebra"
difficulty="0"
icon="boardicons/algebra_group.png"
author="">
<_title>Go to Algebra activities</_title>
......
......@@ -3,6 +3,7 @@
<Board
name="algebra_guesscount"
type="algebra_guesscount"
section="/algebra/."
difficulty="3"
icon="boardicons/algebra_guesscount.png"
author="Pascal Georges (pascal.georges1@free.fr)"
......
......@@ -3,6 +3,7 @@
<Board
name="algebra_minus"
type="algebra"
section="/algebra/algebra/."
mode="-"
difficulty="2"
icon="boardicons/algebra_minus.png"
......
......@@ -3,6 +3,7 @@
<Board
name="algebra_plus"
type="algebra"
section="/algebra/algebra/."
mode="+"
difficulty="1"
icon="boardicons/algebra_plus.png"
......
......@@ -3,6 +3,7 @@
<Board
name="algebramenu"
type="menu"
section="/algebra/algebra"
icon="boardicons/algebramenu.png"
author="">
<_title>Go to Algebra activities</_title>
......
......@@ -3,6 +3,7 @@
<Board
name="babymatch"
type="shapegame"
section="/computer/."
icon="boardicons/babymatch.png"
difficulty="1"
author="Bruno Coudoin (bruno.coudoin@free.fr)"
......
......@@ -3,6 +3,7 @@
<Board
name="babyshapes"
type="shapegame"
section="/computer/."
icon="boardicons/babyshapes.png"
difficulty="1"
author="Bruno Coudoin (bruno.coudoin@free.fr) / Andre Connes (andre.connes@toulouse.iufm.fr)"
......
......@@ -3,16 +3,11 @@
<Board
name="boards"
type="menu"
section="/boards"
difficulty="0"
icon="boardicons/boards.png"
author="">
<_title>Go to board based activities</_title>
<_description>Left-Click with the mouse to select an activity</_description>
</Board>
<Data filename="paintings.xml"/>
<Data filename="memory.xml"/>
<Data filename="railroad.xml"/>
<Data filename="superbrain.xml"/>
<Data filename="chess.xml"/>
<Data filename="traffic.xml"/>
<Data filename="machpuzzle.xml"/>
</GCompris>
......@@ -3,6 +3,7 @@
<Board
name="canal_lock"
type="canal_lock"
section="/fun/."
icon="boardicons/canal_lock.png"
difficulty="2"
author="Bruno Coudoin (bruno.coudoin@free.fr)"
......
......@@ -3,6 +3,7 @@
<Board
name="chess"
type="menu"
section="/boards/chess"
icon="boardicons/chess.png"
author="">
<_title>Practice chess</_title>
......
......@@ -3,6 +3,7 @@
<Board
name="chess_computer"
type="chess"
section="/boards/chess/."
mode="computer"
icon="boardicons/chess_computer.png"
difficulty="2"
......
......@@ -3,6 +3,7 @@
<Board
name="chess_movelearn"
type="chess"
section="/boards/chess/."
mode="movelearn"
icon="boardicons/chess_movelearn.png"
difficulty="2"
......
......@@ -3,6 +3,7 @@
<Board
name="chess_partyend"
type="chess"
section="/boards/chess/."
mode="partyend"
icon="boardicons/chess_partyend.png"
difficulty="2"
......
......@@ -3,6 +3,7 @@
<Board
name="click_on_letter"
type="click_on_letter"
section="/reading/."
icon="boardicons/click_on_letter.png"
mandatory_sound_file="click_on_letter.ogg"
difficulty="1"
......
......@@ -3,6 +3,7 @@
<Board
name="clickgame"
type="clickgame"
section="/computer/."
icon="boardicons/clickgame.png"
difficulty="1"
author="Bruno Coudoin (bruno.coudoin@free.fr)"
......
......@@ -3,6 +3,7 @@
<Board
name="clockgame"
type="clockgame"
section="/fun/."
icon="boardicons/clockgame.png"
difficulty="2"
author="Bruno Coudoin (bruno.coudoin@free.fr)"
......
......@@ -3,6 +3,7 @@
<Board
name="colors"
type="colors"
section="/fun/colors/."
mode="*"
difficulty="1"
icon="boardicons/colors.png"
......
<?xml version="1.0" encoding="UTF-8"?>
<GCompris>
<Board
name="fun"
name="colors_group"
type="menu"
section="/fun/colors"
difficulty="0"
icon="boardicons/colors.png"
author="">
<_title>Go to colors activities</_title>
<_description>Left-Click with the mouse to select an activity</_description>
</Board>
<Data filename="colors.xml"/>
<Data filename="read_colors.xml"/>
<Data filename="advanced_colors.xml"/>
</GCompris>
......@@ -3,6 +3,8 @@
<Board
name="computer"
type="menu"
section="/computer"
difficulty="0"
icon="boardicons/computer.png"
author="">
<_title>Discover the Computer</_title>
......
......@@ -3,6 +3,7 @@
<Board
name="doubleentry"
type="shapegame"
section="/algebra/."
icon="boardicons/doubleentry.png"
difficulty="2"
author="Bruno Coudoin (bruno.coudoin@free.fr)"
......
......@@ -3,6 +3,7 @@
<Board
name="draw"
type="draw"
section="/fun/."
icon="boardicons/draw.png"
difficulty="1"
author="Bruno Coudoin (bruno.coudoin@free.fr)"
......
......@@ -3,6 +3,7 @@
<Board
name="enumerate"
type="enumerate"
section="/algebra/."
icon="boardicons/enumerate.png"
difficulty="1"
author="Bruno Coudoin (bruno.coudoin@free.fr)">
......
......@@ -2,7 +2,8 @@
<GCompris>
<Board
name="erase"
type="erase"
type="erase"
section="/computer/."
icon="boardicons/erase.png"
difficulty="1"
author="Bruno Coudoin (bruno.coudoin@free.fr)"
......
......@@ -3,17 +3,11 @@
<Board
name="fun"
type="menu"
section="/fun"
difficulty="0"
icon="boardicons/fun.png"
author="">
<_title>Go to Amusement activities</_title>
<_description>Left-Click with the mouse to select an activity</_description>
</Board>
<Data filename="draw.xml"/>
<Data filename="paratrooper.xml"/>
<Data filename="leftright.xml"/>
<Data filename="clockgame.xml"/>
<Data filename="canal_lock.xml"/>
<Data filename="geography.xml"/>
<Data filename="colors_group.xml"/>
<Data filename="maze3D.xml"/>
</GCompris>
......@@ -3,6 +3,7 @@
<Board
name="geography"
type="shapegame"
section="/fun/."
icon="boardicons/globe.png"
mandatory_sound_file="geography/peru.ogg"
difficulty="2"
......
......@@ -3,6 +3,7 @@
<Board
name="gletters"
type="gletters"
section="/computer/."
icon="boardicons/gletters.png"
difficulty="1"
author="Bruno Coudoin (bruno.coudoin@free.fr)"
......
......@@ -3,6 +3,7 @@
<Board
name="imageid"
type="imageid"
section="/reading/."
icon="boardicons/imageid.png"
difficulty="2"
author="Pascal Georges (pascal.georges1@free.fr)"
......
......@@ -3,6 +3,7 @@
<Board
name="imagename"
type="shapegame"
section="/reading/."
icon="boardicons/imagename.png"
difficulty="3"
author="Bruno Coudoin (bruno.coudoin@free.fr)"
......
boards/images/scenery2_background.jpg

45.9 KB | W: | H:

boards/images/scenery2_background.jpg

49.5 KB | W: | H:

boards/images/scenery2_background.jpg
boards/images/scenery2_background.jpg
boards/images/scenery2_background.jpg
boards/images/scenery2_background.jpg
  • 2-up
  • Swipe
  • Onion skin
......@@ -3,6 +3,7 @@
<Board
name="leftright"
type="leftright"
section="/fun/."
difficulty="1"
icon="boardicons/leftright.png"
author="Pascal Georges (pascal.georges1@free.fr)"
......
......@@ -3,6 +3,7 @@
<Board
name="machpuzzle"
type="machpuzzle"
section="/boards/."
icon="boardicons/erase.png"
difficulty="1"
author="Bruno Coudoin (bruno.coudoin@free.fr)"
......
......@@ -3,6 +3,7 @@
<Board
name="maze"
type="maze"
section="/computer/."
mode="2D"
icon="boardicons/maze.png"
difficulty="2"
......
......@@ -3,6 +3,7 @@
<Board
name="maze3D"
type="maze"
section="/fun/."
mode="3D"
icon="boardicons/maze3D.png"
difficulty="2"
......
......@@ -3,6 +3,7 @@
<Board
name="memory"
type="memory"
section="/boards/."
mode="image"
difficulty="1"
icon="boardicons/memory.png"
......
......@@ -3,6 +3,8 @@
<Board
name="menu"
type="menu"
section="/"
difficulty="0"
icon=""
author="">
<_title>GCompris Main Menu</_title>
......@@ -26,9 +28,4 @@ The stars means:
2 Stars - 5 to 6 years old
3 Stars - 7 to 8 years old</_manual>
</Board>
<Data filename="computer.xml"/>
<Data filename="fun.xml"/>
<Data filename="boards.xml"/>
<Data filename="reading.xml"/>
<Data filename="algebramenu.xml"/>
</GCompris>
......@@ -3,6 +3,7 @@
<Board
name="missing_letter"
type="missing_letter"
section="/reading/."
icon="boardicons/missing_letter.png"
difficulty="2"
author="Pascal Georges (pascal.georges1@free.fr)"
......
......@@ -3,6 +3,7 @@
<Board
name="money"
type="money"
section="/algebra/."
icon="boardicons/money.png"
difficulty="2"
author="Bruno Coudoin (bruno.coudoin@free.fr)"
......
......@@ -3,6 +3,7 @@
<Board
name="money_cents"
type="money"
section="/algebra/."
icon="boardicons/money_cents.png"
mode="WITH_CENTS"
difficulty="3"
......
......@@ -3,6 +3,7 @@
<Board
name="paintings"
type="shapegame"
section="/boards/."
icon="boardicons/shapegame.png"
difficulty="1"
author="Bruno Coudoin (bruno.coudoin@free.fr)"
......
......@@ -3,6 +3,7 @@
<Board
name="paratrooper"
type="paratrooper"
section="/fun/."
icon="boardicons/tuxpara.png"
difficulty="1"
author="Bruno Coudoin (bruno.coudoin@free.fr)">
......
......@@ -3,6 +3,7 @@
<Board
name="planegame"
type="planegame"
section="/algebra/."
icon="boardicons/helicogame.png"
difficulty="2"
author="Bruno Coudoin (bruno.coudoin@free.fr)">
......
......@@ -3,6 +3,7 @@
<Board
name="railroad"
type="railroad"
section="/boards/."
icon="boardicons/railroad.png"
difficulty="1"
author="Pascal Georges (pascal.georges1@free.fr)"
......
......@@ -3,6 +3,7 @@
<Board
name="read_colors"
type="read_colors"
section="/fun/colors/."
mode="*"
difficulty="2"
icon="boardicons/read_colors2.png"
......
......@@ -3,6 +3,7 @@
<Board
name="reading"
type="menu"
section="/reading"
icon="boardicons/book.png"
author="">
<_title>Go to the Reading activities</_title>
......
......@@ -3,6 +3,7 @@
<Board
name="readingh"
type="reading"
section="/reading/."
mode="horizontal"
icon="boardicons/readingh.png"
difficulty="2"
......
......@@ -3,6 +3,7 @@
<Board
name="readingv"
type="reading"
section="/reading/."
mode="vertical"
icon="boardicons/reading.png"
difficulty="2"
......
......@@ -3,6 +3,7 @@
<Board
name="reversecount"
type="reversecount"
section="/algebra/."
mode=""
difficulty="2"
icon="boardicons/reversecount.png"
......
......@@ -3,6 +3,7 @@
<Board
name="scalesboard"
type="shapegame"
section="/algebra/."
icon="boardicons/scalesicon.png"
difficulty="2"
author="Bruno Coudoin (bruno.coudoin@free.fr)"
......
......@@ -3,6 +3,7 @@
<Board
name="smallnumbers"
type="smallnumbers"
section="/computer/."
icon="boardicons/smallnumbers.png"
difficulty="1"
author="Bruno Coudoin (bruno.coudoin@free.fr)"
......
......@@ -3,6 +3,7 @@
<Board
name="superbrain"
type="superbrain"
section="/boards/."
icon="boardicons/superbrain.png"
difficulty="2"
author="Bruno Coudoin (bruno.coudoin@free.fr)"
......
......@@ -3,6 +3,7 @@
<Board
name="target"
type="target"
section="/algebra/."
mode=""
difficulty="2"
icon="boardicons/target.png"
......
......@@ -3,6 +3,7 @@
<Board
name="traffic"
type="traffic"
section="/boards/."
mode="image"
difficulty="2"
icon="boardicons/traffic.png"
......
......@@ -3,6 +3,7 @@
<Board
name="wordsgame"
type="wordsgame"
section="/computer/."
icon="boardicons/wordsgame.png"
difficulty="2"
author="Bruno Coudoin (bruno.coudoin@free.fr)"
......
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/gcompris/gcompris.c)
AM_INIT_AUTOMAKE(gcompris, 2.0.0)
AM_INIT_AUTOMAKE(gcompris, 2.1)
AM_CONFIG_HEADER(config.h)
AC_ISC_POSIX
......@@ -82,7 +82,6 @@ PACKAGE_HELP_DIR="${myprefix}/${DATADIRNAME}/gnome/help/${PACKAGE}"
AC_SUBST(PACKAGE_HELP_DIR)
dnl Plugin Directory
AC_DEFINE_UNQUOTED(PLUGINSUBS, "")
AC_DEFINE_UNQUOTED(PLUGIN_DIR, "${myprefix}/lib/gcompris")
AC_DEFINE_UNQUOTED(GNOME_ICONDIR, "${myprefix}/share/pixmaps")
......
/* gcompris - clickgame.c
*
* Time-stamp: <2002/04/14 00:20:48 bruno>
* Time-stamp: <2003/01/11 10:55:34 bruno>
*
* Copyright (C) 2000 Bruno Coudoin
*
......@@ -186,11 +186,14 @@ static void clickgame_start (GcomprisBoard *agcomprisBoard)
str = g_strdup_printf("%s/%s", gcomprisBoard->boarddir, namelist[i]->d_name);
str[strlen(str)-5]='x';
g_free(namelist[i]);
if(g_list_find_custom(pixmaplist, str, (GCompareFunc) strcmp) == NULL)
{
pixmaplist = g_list_append (pixmaplist, str);
}
}
g_free(namelist);
/* set initial values for this level */
gcomprisBoard->level = 1;
......
......@@ -43,7 +43,8 @@ struct _MachItem {
double ax, ay;
double xposo, xpos, vxo;
double yposo, ypos, vyo;
double bounce;
double elasticity;
double width, height;
double hotspotx[16];
double hotspoty[16];
};
......@@ -55,8 +56,6 @@ static GList *item_list = NULL;
GcomprisBoard *gcomprisBoard = NULL;
gboolean board_paused = TRUE;
static gint move_id = 0;
static gint score = 0;
static GnomeCanvasItem *score_item = NULL;
static double times_inc = 0.1;
static double gravity = 9.8;
static void start_board (GcomprisBoard *agcomprisBoard);
......@@ -220,17 +219,17 @@ static void machpuzzle_destroy_all_items()
}
boardRootItem = NULL;
if(item_list)
g_list_free(item_list);
item_list = NULL;
}
/* ==================================== */
static GnomeCanvasItem *machpuzzle_create_item(GnomeCanvasGroup *parent)
{
int i,j;
GnomeCanvasPoints *points;
GnomeCanvasItem *item;
MachItem *machItem;
GdkFont *gdk_font;
gdk_font = gdk_font_load (FONT_BOARD_BIG);
boardRootItem = GNOME_CANVAS_GROUP(
gnome_canvas_item_new (gnome_canvas_root(gcomprisBoard->canvas),
......@@ -239,82 +238,14 @@ static GnomeCanvasItem *machpuzzle_create_item(GnomeCanvasGroup *parent)
"y", (double) 0,
NULL));
// machItem = create_machine_item(MACH_BASKET_BALL, 20.0, 20.0);
machItem = create_machine_item(MACH_BASKET_BALL, 200.0, 100.0);
// machItem = create_machine_item(MACH_BILLARD_BALL, 250.0, 100.0);
// machItem = create_machine_item(MACH_FLYING_BALL, 450.0, 400.0);
machItem = create_machine_item(MACH_HORZ_WALL, 300.0, 300.0);
/* The border */
points = gnome_canvas_points_new(2);
points->coords[0] = (double) 1;
points->coords[1] = (double) 1;
points->coords[2] = (double) BOARDWIDTH;
points->coords[3] = (double) 1;
item = gnome_canvas_item_new (boardRootItem,
gnome_canvas_line_get_type (),
"points", points,
"fill_color", "white",
"width_pixels", 5,
NULL);
gnome_canvas_points_unref(points);
points = gnome_canvas_points_new(2);
points->coords[0] = (double) 1;
points->coords[1] = (double) 1;
points->coords[2] = (double) 1;
points->coords[3] = (double) BOARDHEIGHT;
item = gnome_canvas_item_new (boardRootItem,
gnome_canvas_line_get_type (),
"points", points,
"fill_color", "red",
"width_pixels", 5,
NULL);
gnome_canvas_points_unref(points);
points = gnome_canvas_points_new(2);
points->coords[0] = (double) BOARDWIDTH-1;
points->coords[1] = (double) 1;
points->coords[2] = (double) BOARDWIDTH-1;
points->coords[3] = (double) BOARDHEIGHT;
item = gnome_canvas_item_new (boardRootItem,
gnome_canvas_line_get_type (),
"points", points,
"fill_color", "red",
"width_pixels", 5,
NULL);
gnome_canvas_points_unref(points);
points = gnome_canvas_points_new(2);
points->coords[0] = (double) 1;
points->coords[1] = (double) BOARDHEIGHT-2;
points->coords[2] = (double) BOARDWIDTH;
points->coords[3] = (double) BOARDHEIGHT-2;
item = gnome_canvas_item_new (boardRootItem,
gnome_canvas_line_get_type (),
"points", points,
"fill_color", "red",
"width_pixels", 5,
NULL);
gnome_canvas_points_unref(points);
score_item = gnome_canvas_item_new (boardRootItem,
gnome_canvas_text_get_type (),
"text", "SCORE : 0",
"font_gdk", gdk_font,
"x", (double) BOARDWIDTH - 100,
"y", (double) BOARDHEIGHT - 50,
"anchor", GTK_ANCHOR_CENTER,
"fill_color", "red",
NULL);
machItem = create_machine_item(MACH_BASKET_BALL, 20.0, 20.0);
// machItem = create_machine_item(MACH_BASKET_BALL, 200.0, 100.0);
machItem = create_machine_item(MACH_BILLARD_BALL, 250.0, 100.0);
machItem = create_machine_item(MACH_FLYING_BALL, 450.0, 400.0);
machItem = create_machine_item(MACH_HORZ_WALL, 100.0, 300.0);
return NULL;
}
......@@ -361,13 +292,13 @@ item_event(GnomeCanvasItem *item, GdkEvent *event, MachItem *machItem)
case GDK_BUTTON_PRESS:
width = x2-x1;
// machItem->vyo = (y1 - machItem->ypos) * machItem->bounce;
// machItem->vyo = (y1 - machItem->ypos) * machItem->elasticity;
machItem->times = 0;
machItem->yposo = machItem->ypos;
machItem->xposo = machItem->xpos;
machItem->vyo = ((item_y-y1)<width/2?(width/2-(item_y-y1))*5:-1*(width/2-(y2-item_y))*5);
machItem->vxo = ((item_x-x1)<width/2?(width/2-(item_x-x1))*5:-1*(width/2-(x2-item_x))*5);
machItem->vyo = ((item_y-y1)<width/2?(width/2-(item_y-y1))*20:-1*(width/2-(y2-item_y))*20);
machItem->vxo = ((item_x-x1)<width/2?(width/2-(item_x-x1))*20:-1*(width/2-(x2-item_x))*20);
break;
default:
......@@ -425,7 +356,7 @@ static MachItem *create_machine_item(MachItemType machItemType, double x, double
machItem->vyo = 0;
machItem->ay = 0;