Commit ae173b8d authored by Bruno Coudoin's avatar Bruno Coudoin

- Major review of the API. now all the API follows the naming convention:

          gc_<module>_<item>_<action> for example gc_board_end, gc_bar_start, ...
        - added in gc_core.h functions that are shared in the core only.
        - fixed python plugins to remove API entries not needed for activities.
parent 006afba8
No preview for this file type
docs/C/overview.jpg

46.8 KB | W: | H:

docs/C/overview.jpg

32.2 KB | W: | H:

docs/C/overview.jpg
docs/C/overview.jpg
docs/C/overview.jpg
docs/C/overview.jpg
  • 2-up
  • Swipe
  • Onion skin
......@@ -186,12 +186,12 @@ attribute is readeable and/or writable.</para>
<tbody>
<row>
<entry>gcompris.end_board()</entry>
<entry>void gcompris_end_board(void)</entry>
<entry>void gc_board_end(void)</entry>
<entry></entry>
</row>
<row>
<entry>gcompris.bar_start(gnomeCanvas)</entry>
<entry>void gcompris_bar_start(GnomeCanvas *theCanvas)</entry>
<entry>void gc_bar_start(GnomeCanvas *theCanvas)</entry>
<entry></entry>
</row>
<row>
......@@ -201,37 +201,22 @@ attribute is readeable and/or writable.</para>
</row>
<row>
<entry>gcompris.bar_set_level(gcomprisBoard)</entry>
<entry>void gcompris_bar_set_level(GcomprisBoard *gcomprisBoard)</entry>
<entry>void gc_bar_set_level(GcomprisBoard *gcomprisBoard)</entry>
<entry></entry>
</row>
<row>
<entry>gcompris.bar_set_repeat_icon(pixmap)</entry>
<entry>void gcompris_bar_set_repeat_icon(GdkPixbuf *pixmap)</entry>
<entry>void gc_bar_set_repeat_icon(GdkPixbuf *pixmap)</entry>
<entry></entry>
</row>
<row>
<entry>gcompris.bar_set(flags)</entry>
<entry>void gcompris_bar_set(const GComprisBarFlags flags)</entry>
<entry>void gc_bar_set(const GComprisBarFlags flags)</entry>
<entry></entry>
</row>
<row>
<entry>gcompris.bar_hide(hide)</entry>
<entry>void gcompris_bar_hide(gboolean hide)</entry>
<entry></entry>
</row>
<row>
<entry>gcompris.board_has_help(gcomprisBoard)</entry>
<entry>gboolean gcompris_board_has_help(GcomprisBoard *gcomprisBoard)</entry>
<entry>return a boolean</entry>
</row>
<row>
<entry>gcompris.help_start(gcomprisBoard)</entry>
<entry>void gcompris_help_start(GcomprisBoard *gcomprisBoard)</entry>
<entry></entry>
</row>
<row>
<entry>gcompris.help_stop()</entry>
<entry>void gcompris_help_stop(void)</entry>
<entry>void gc_bar_hide(gboolean hide)</entry>
<entry></entry>
</row>
<row>
......@@ -246,32 +231,32 @@ attribute is readeable and/or writable.</para>
</row>
<row>
<entry>gcompris.get_locale()</entry>
<entry>gchar* gcompris_get_locale(void)</entry>
<entry>gchar* gc_locale_get(void)</entry>
<entry>return a string</entry>
</row>
<row>
<entry>gcompris.set_locale(locale)</entry>
<entry>void gcompris_set_locale(gchar *locale)</entry>
<entry>void gc_locale_set(gchar *locale)</entry>
<entry></entry>
</row>
<row>
<entry>gcompris.set_cursor(cursor_type)</entry>
<entry>void gcompris_set_cursor(guint gdk_cursor_type)</entry>
<entry>void gc_cursor_set(guint gdk_cursor_type)</entry>
<entry></entry>
</row>
<row>
<entry>gcompris.images_selector_start(gcomprisBoard, dataset, callback)</entry>
<entry>void gcompris_images_selector_start (GcomprisBoard *gcomprisBoard, gchar *dataset, ImageSelectorCallBack imscb)</entry>
<entry>void gc_selector_images_start (GcomprisBoard *gcomprisBoard, gchar *dataset, ImageSelectorCallBack imscb)</entry>
<entry>The callback must be a callable object</entry>
</row>
<row>
<entry>gcompris.images_selector_stop()</entry>
<entry>void gcompris_images_selector_stop(void)</entry>
<entry>void gc_selector_images_stop(void)</entry>
<entry></entry>
</row>
<row>
<entry>gcompris.exit()</entry>
<entry>void gcompris_exit(void)</entry>
<entry>void gc_exit(void)</entry>
<entry></entry>
</row>
<row>
......@@ -286,22 +271,22 @@ attribute is readeable and/or writable.</para>
</row>
<row>
<entry>gcompris.file_selector_load(gcomprisBoard, rootdir, file_types, callback)</entry>
<entry>void gcompris_file_selector_load (GcomprisBoard *gcomprisBoard, gchar *rootdir, gchar *file_types, FileSelectorCallBack fscb)</entry>
<entry>void gc_selector_file_load (GcomprisBoard *gcomprisBoard, gchar *rootdir, gchar *file_types, FileSelectorCallBack fscb)</entry>
<entry>The callback must be a callable object</entry>
</row>
<row>
<entry>gcompris.file_selector_save(gcomprisBoard, rootdir, file_types, callback)</entry>
<entry>void gcompris_file_selector_save(GcomprisBoard *gcomprisBoard, gchar *rootdir,gchar *file_types, FileSelectorCallBack fscb)</entry>
<entry>void gc_selector_file_save(GcomprisBoard *gcomprisBoard, gchar *rootdir,gchar *file_types, FileSelectorCallBack fscb)</entry>
<entry>The callback must be a callable object</entry>
</row>
<row>
<entry>gcompris.file_selector_stop()</entry>
<entry>void gcompris_file_selector_stop(void)</entry>
<entry>void gc_selector_file_stop(void)</entry>
<entry></entry>
</row>
<row>
<entry>gcompris.get_database()</entry>
<entry>gchar* gcompris_get_database(void)</entry>
<entry>gchar* gc_db_get_filename(void)</entry>
<entry>return the filename (string) of the database (fullpath)</entry>
</row>
</tbody>
......@@ -503,47 +488,47 @@ attribute is readeable and/or writable.</para>
</row>
<row>
<entry>gcompris.utils.set_image_focus(item, focus)</entry>
<entry>void gcompris_set_image_focus(GnomeCanvasItem *item, gboolean focus)</entry>
<entry>void gc_item_focus_set(GnomeCanvasItem *item, gboolean focus)</entry>
<entry></entry>
</row>
<row>
<entry>gcompris.utils.item_event_focus(item, event, dest_item)</entry>
<entry>gint gcompris_item_event_focus(GnomeCanvasItem *item, GdkEvent *event, GnomeCanvasItem *dest_item)</entry>
<entry>gint gc_item_focus_event(GnomeCanvasItem *item, GdkEvent *event, GnomeCanvasItem *dest_item)</entry>
<entry>return an integer</entry>
</row>
<row>
<entry>gcompris.utils.item_absolute_move(item, x, y)</entry>
<entry>void item_absolute_move(GnomeCanvasItem *item, int x, int y)</entry>
<entry>void gc_item_absolute_move(GnomeCanvasItem *item, int x, int y)</entry>
<entry></entry>
</row>
<row>
<entry>gcompris.utils.item_rotate(item, angle)</entry>
<entry>void item_rotate(GnomeCanvasItem *item, double angle)</entry>
<entry>void gc_item_rotate(GnomeCanvasItem *item, double angle)</entry>
<entry></entry>
</row>
<row>
<entry>gcompris.utils.item_rotate_relative(item, angle)</entry>
<entry>void item_rotate_relative(GnomeCanvasItem *item, double angle)</entry>
<entry>void gc_item_rotate_relative(GnomeCanvasItem *item, double angle)</entry>
<entry></entry>
</row>
<row>
<entry>gcompris.utils.item_rotate_with_center(item, angle, x, y)</entry>
<entry>void item_rotate_with_center(GnomeCanvasItem *item, double angle, int x, int y)</entry>
<entry>void gc_item_rotate_with_center(GnomeCanvasItem *item, double angle, int x, int y)</entry>
<entry></entry>
</row>
<row>
<entry>gcompris.utils.item_rotate_relative_with_center(item, angle, x, y)</entry>
<entry>void item_rotate_relative_with_center(GnomeCanvasItem *item, double angle, int x, int y)</entry>
<entry>void gc_item_rotate_relative_with_center(GnomeCanvasItem *item, double angle, int x, int y)</entry>
<entry></entry>
</row>
<row>
<entry>gcompris.utils.dialog(str, callback)</entry>
<entry>void gcompris_dialog(gchar *str, DialogBoxCallBack callback)</entry>
<entry>void gc_dialog(gchar *str, DialogBoxCallBack callback)</entry>
<entry>The callback must be a callable object</entry>
</row>
<row>
<entry>gcompris.utils.dialog_close()</entry>
<entry>void gcompris_dialog_close()</entry>
<entry>void gc_dialog_close()</entry>
<entry></entry>
</row>
</tbody>
......
......@@ -117,7 +117,7 @@ static void pause_board (gboolean pause)
if(gcomprisBoard==NULL)
return;
gcompris_bar_hide(FALSE);
gc_bar_hide(FALSE);
if(gamewon == TRUE && pause == FALSE) /* the game is won */
game_won();
......@@ -135,7 +135,7 @@ static void start_board (GcomprisBoard *agcomprisBoard) {
gcomprisBoard->sublevel = 1;
gcomprisBoard->number_of_sublevel = 8;
gcompris_bar_set(GCOMPRIS_BAR_LEVEL);
gc_bar_set(GC_BAR_LEVEL);
gcompris_score_start(SCORESTYLE_NOTE,
gcomprisBoard->width - 220,
gcomprisBoard->height - 50,
......@@ -206,7 +206,7 @@ static void colors_next_level() {
gamewon = FALSE;
gcompris_score_set(gcomprisBoard->sublevel);
gcompris_bar_set_level(gcomprisBoard);
gc_bar_set_level(gcomprisBoard);
/* initialize board only once*/
if (gcomprisBoard->sublevel == 1) {
......@@ -272,7 +272,7 @@ static GnomeCanvasItem *colors_create_item(GnomeCanvasGroup *parent) {
NULL));
str = g_strdup_printf("%s/%s", gcomprisBoard->boarddir, "advanced_colors_highlight.png");
highlight_pixmap = gcompris_load_pixmap(str);
highlight_pixmap = gc_pixmap_load(str);
highlight_image_item = gnome_canvas_item_new (boardRootItem,
gnome_canvas_pixbuf_get_type (),
......@@ -296,7 +296,7 @@ static GnomeCanvasItem *colors_create_item(GnomeCanvasGroup *parent) {
/* setup the clock */
str = g_strdup_printf("%s%d.png", "gcompris/timers/clock",errors);
clock_pixmap = gcompris_load_pixmap(str);
clock_pixmap = gc_pixmap_load(str);
clock_image_item = gnome_canvas_item_new (boardRootItem,
gnome_canvas_pixbuf_get_type (),
......@@ -355,7 +355,7 @@ static gboolean ok_timeout() {
}
static void ok() {
gcompris_bar_hide(TRUE);
gc_bar_hide(TRUE);
// leave time to display the right answer
g_timeout_add(TIME_CLICK_TO_BONUS, ok_timeout, NULL);
}
......@@ -407,7 +407,7 @@ static void update_clock() {
gtk_object_destroy (GTK_OBJECT(clock_image_item));
clock_pixmap = gcompris_load_pixmap(str);
clock_pixmap = gc_pixmap_load(str);
clock_image_item = gnome_canvas_item_new (boardRootItem,
gnome_canvas_pixbuf_get_type (),
......@@ -437,7 +437,7 @@ static void highlight_selected(int c) {
x -= highlight_width/2;
y -= highlight_height;
gnome_canvas_item_show(highlight_image_item);
item_absolute_move(highlight_image_item, x, y);
gc_item_absolute_move(highlight_image_item, x, y);
}
/* ===================================
......@@ -488,9 +488,9 @@ static void add_xml_data(xmlDocPtr doc, xmlNodePtr xmlnode, GNode * child)
text = (char *)xmlNodeListGetString(doc, xmlnode->xmlChildrenNode, 1);
colors[i] = text;
} else { // get correct language
if ( !strncmp(lang, gcompris_get_locale(), strlen(lang)) ) {
if ( !strncmp(lang, gc_locale_get(), strlen(lang)) ) {
text = (char *)xmlNodeListGetString(doc, xmlnode->xmlChildrenNode, 1);
g_warning("color prop::lang=%s locale=%s text=%s\n", lang, gcompris_get_locale(), text);
g_warning("color prop::lang=%s locale=%s text=%s\n", lang, gc_locale_get(), text);
colors[i] = text;
}
}
......
......@@ -167,7 +167,7 @@ static void start_board (GcomprisBoard *agcomprisBoard)
gcomprisBoard->width - 220,
gcomprisBoard->height - 50,
gcomprisBoard->number_of_sublevel);
gcompris_bar_set(GCOMPRIS_BAR_LEVEL|GCOMPRIS_BAR_OK);
gc_bar_set(GC_BAR_LEVEL|GC_BAR_OK);
/* The mode defines the operation */
......@@ -346,7 +346,7 @@ static void timer_end()
static void algebra_next_level()
{
gcompris_bar_set_level(gcomprisBoard);
gc_bar_set_level(gcomprisBoard);
gcompris_score_set(gcomprisBoard->sublevel);
algebra_destroy_all_items();
......
......@@ -192,17 +192,17 @@ static void start_board (GcomprisBoard *agcomprisBoard) {
g_warning("loading pixmaps in start_board\n");
for (i=0; i<NUM_VALUES; i++) {
str = g_strdup_printf("%s/%d.png", gcomprisBoard->boarddir,num_values[i]);
num_pixmap[i] = gcompris_load_pixmap(str);
num_pixmap[i] = gc_pixmap_load(str);
g_free(str);
}
for (i=0; i<5; i++) {
str = g_strdup_printf("%s/%s.png", gcomprisBoard->boarddir,oper_images[i]);
oper_pixmap[i] = gcompris_load_pixmap(str);
oper_pixmap[i] = gc_pixmap_load(str);
g_free(str);
}
str = g_strdup_printf("%s/%s", gcomprisBoard->boarddir,"button.png");
button_pixmap = gcompris_load_pixmap(str);
button_pixmap = gc_pixmap_load(str);
g_free(str);
gcompris_set_background(gnome_canvas_root(gcomprisBoard->canvas),"gcompris/animals/tiger1_by_Ralf_Schmode.jpg");
......@@ -214,7 +214,7 @@ static void start_board (GcomprisBoard *agcomprisBoard) {
50,
gcomprisBoard->height - 50,
gcomprisBoard->number_of_sublevel);
gcompris_bar_set(GCOMPRIS_BAR_LEVEL|GCOMPRIS_BAR_OK);
gc_bar_set(GC_BAR_LEVEL|GC_BAR_OK);
algebra_guesscount_next_level();
......@@ -259,7 +259,7 @@ static gboolean is_our_board (GcomprisBoard *gcomprisBoard) {
/* ==================================== */
/* set initial values for the next level */
static void algebra_guesscount_next_level() {
gcompris_bar_set_level(gcomprisBoard);
gc_bar_set_level(gcomprisBoard);
algebra_guesscount_destroy_all_items();
gamewon = FALSE;
......@@ -640,7 +640,7 @@ static gint item_event_num(GnomeCanvasItem *item, GdkEvent *event, gpointer data
if (item != ptr_token_selected[token_count-1]->item)
return FALSE;
// we put back in its original place a number item
item_absolute_move(item, t->xOffset_original, Y_NUM);
gc_item_absolute_move(item, t->xOffset_original, Y_NUM);
token_count--;
update_line_calcul();
t->isMoved = FALSE;
......@@ -655,7 +655,7 @@ static gint item_event_num(GnomeCanvasItem *item, GdkEvent *event, gpointer data
return FALSE;
}
item_absolute_move(item, x_token_offset[token_count-1], y_token_offset[token_count-1]);
gc_item_absolute_move(item, x_token_offset[token_count-1], y_token_offset[token_count-1]);
t->isMoved = TRUE;
// update result text items
......
......@@ -72,13 +72,13 @@ static void start_board(GcomprisBoard *b)
board->sublevel=1;
board->number_of_sublevel=1;
gcompris_score_start(SCORESTYLE_NOTE, 10, 50, board->number_of_sublevel);
gcompris_bar_set(GCOMPRIS_BAR_LEVEL);
gcompris_bar_set_level(board);
gc_bar_set(GC_BAR_LEVEL);
gc_bar_set_level(board);
gcompris_score_set(board->sublevel);
animation = gcompris_load_animation( "animtest/test.txt" );
animation = gc_anim_load( "animtest/test.txt" );
anim_item = (GnomeCanvasItem*)
gcompris_activate_animation( gnome_canvas_root(board->canvas),
gc_anim_activate( gnome_canvas_root(board->canvas),
animation );
gnome_canvas_item_set(anim_item,
"x", (double) CENTER_LEFT_X,
......@@ -96,8 +96,8 @@ static void end_board()
{
if(board != NULL)
{
gcompris_deactivate_animation(anim_item);
gcompris_free_animation(animation);
gc_anim_deactivate(anim_item);
gc_anim_free(animation);
}
}
......
......@@ -105,14 +105,14 @@ static void pause_board (gboolean pause)
timeout = g_timeout_add (2000,
(GSourceFunc) to_computer,
NULL);
anim_item = gcompris_activate_animation( boardRootItem,
anim_item = gc_anim_activate( boardRootItem,
animation );
gnome_canvas_item_show(GNOME_CANVAS_ITEM(anim_item->canvas));
}
}
else{
if (computer_turn){
gcompris_deactivate_animation(anim_item);
gc_anim_deactivate(anim_item);
if (timeout){
g_source_remove(timeout);
timeout = 0;
......@@ -140,17 +140,17 @@ start_board (GcomprisBoard * agcomprisBoard)
* this number of 'play' */
str = gcompris_image_to_skin("button_reload.png");
pixmap = gcompris_load_pixmap(str);
pixmap = gc_pixmap_load(str);
g_free(str);
if(pixmap) {
gcompris_bar_set_repeat_icon(pixmap);
gc_bar_set_repeat_icon(pixmap);
gdk_pixbuf_unref(pixmap);
gcompris_bar_set(GCOMPRIS_BAR_LEVEL|GCOMPRIS_BAR_REPEAT_ICON);
gc_bar_set(GC_BAR_LEVEL|GC_BAR_REPEAT_ICON);
} else {
gcompris_bar_set(GCOMPRIS_BAR_LEVEL|GCOMPRIS_BAR_REPEAT);
gc_bar_set(GC_BAR_LEVEL|GC_BAR_REPEAT);
}
animation = gcompris_load_animation( "connect4/sablier.txt" );
animation = gc_anim_load( "connect4/sablier.txt" );
awele_next_level ();
......@@ -168,7 +168,7 @@ end_board ()
if (gcomprisBoard != NULL)
{
pause_board (TRUE);
gcompris_free_animation(animation);
gc_anim_free(animation);
awele_destroy_all_items ();
}
gcomprisBoard = NULL;
......@@ -198,7 +198,7 @@ is_our_board (GcomprisBoard * gcomprisBoard)
*/
static void repeat (){
if (computer_turn){
gcompris_deactivate_animation(anim_item);
gc_anim_deactivate(anim_item);
if (timeout){
g_source_remove(timeout);
timeout = 0;
......@@ -218,7 +218,7 @@ set_level (guint level)
gcomprisBoard->sublevel = 1;
if (computer_turn){
gcompris_deactivate_animation(anim_item);
gc_anim_deactivate(anim_item);
if (timeout){
g_source_remove(timeout);
timeout = 0;
......@@ -245,7 +245,7 @@ awele_next_level ()
img);
g_free(img);
gcompris_bar_set_level (gcomprisBoard);
gc_bar_set_level (gcomprisBoard);
awele_destroy_all_items ();
gamewon = FALSE;
......@@ -262,7 +262,7 @@ awele_next_level ()
timeout = g_timeout_add (2000,
(GSourceFunc) to_computer,
NULL);
anim_item = gcompris_activate_animation( boardRootItem,
anim_item = gc_anim_activate( boardRootItem,
animation );
gnome_canvas_item_show(GNOME_CANVAS_ITEM(anim_item->canvas));
......@@ -325,7 +325,7 @@ awele_create_item (GnomeCanvasGroup * parent)
/*
* Load the cute frame
*/
pixmap = gcompris_load_pixmap ("awele/awele_frame.png");
pixmap = gc_pixmap_load ("awele/awele_frame.png");
gnome_canvas_item_new (boardRootItem,
gnome_canvas_pixbuf_get_type (),
......@@ -420,13 +420,13 @@ awele_create_item (GnomeCanvasGroup * parent)
{
sprintf (buffer, "%d", i + 1);
xpmFile[12] = buffer[0];
graphsElt->pixbufButton[i] = gcompris_load_pixmap (xpmFile);
graphsElt->pixbufButton[i] = gc_pixmap_load (xpmFile);
xpmFileNotify[12] = buffer[0];
graphsElt->pixbufButtonNotify[i] =
gcompris_load_pixmap (xpmFileNotify);
gc_pixmap_load (xpmFileNotify);
xpmFileClic[12] = buffer[0];
graphsElt->pixbufButtonClicked[i] =
gcompris_load_pixmap (xpmFileClic);
gc_pixmap_load (xpmFileClic);
/*
* Ajustement de l'ordonnee x, pour positionner le bouton sur la barre de boutons.
......@@ -538,7 +538,7 @@ awele_create_item (GnomeCanvasGroup * parent)
{
sprintf (buffer, "%d", i + 1);
xpmFile[12] = buffer[0];
graphsElt->pixbufBeans[i] = gcompris_load_pixmap (xpmFile);
graphsElt->pixbufBeans[i] = gc_pixmap_load (xpmFile);
}
/**
......@@ -663,7 +663,7 @@ static gboolean to_computer(gpointer data)
coup = think (staticAwale, gcomprisBoard->level);
gcompris_deactivate_animation(anim_item);
gc_anim_deactivate(anim_item);
computer_turn = FALSE;
if (coup >= 0){
......@@ -761,7 +761,7 @@ buttonClick (GtkWidget * item, GdkEvent * event, gpointer data)
timeout = g_timeout_add (2000,
(GSourceFunc) to_computer,
NULL);
anim_item = gcompris_activate_animation( boardRootItem,
anim_item = gc_anim_activate( boardRootItem,
animation );
}
}
......
......@@ -170,7 +170,7 @@ static void start_board (GcomprisBoard *agcomprisBoard)
canal_lock_next_level();
gcompris_bar_set(0);
gc_bar_set(0);
animation = FALSE;
......@@ -232,7 +232,7 @@ static void canal_lock_next_level()
gcompris_set_background(gnome_canvas_root(gcomprisBoard->canvas),
"canal_lock/canal_lock_bg.png");
gcompris_bar_set_level(gcomprisBoard);
gc_bar_set_level(gcomprisBoard);
canal_lock_destroy_all_items();
gamewon = FALSE;
......@@ -272,7 +272,7 @@ static GnomeCanvasItem *canal_lock_create_item(GnomeCanvasGroup *parent)
NULL));
/* The boat */
pixmap = gcompris_load_pixmap("gcompris/misc/tuxboat.png");
pixmap = gc_pixmap_load("gcompris/misc/tuxboat.png");
tuxboat_item = gnome_canvas_item_new (boardRootItem,
gnome_canvas_pixbuf_get_type (),
......@@ -284,7 +284,7 @@ static GnomeCanvasItem *canal_lock_create_item(GnomeCanvasGroup *parent)
(GtkSignalFunc) item_event,
NULL);
gtk_signal_connect(GTK_OBJECT(tuxboat_item), "event",
(GtkSignalFunc) gcompris_item_event_focus,
(GtkSignalFunc) gc_item_focus_event,
NULL);
tuxboat_width = gdk_pixbuf_get_width(pixmap);
......
......@@ -185,7 +185,7 @@ static void start_board (GcomprisBoard *agcomprisBoard)
#ifndef WIN32
if (!g_file_test (GNUCHESS, G_FILE_TEST_EXISTS)) {
gcompris_dialog(_("Error: The external program gnuchess is mandatory\nto play chess in gcompris.\nFind this program on http://www.rpmfind.net or in your\nGNU/Linux distribution\nAnd check it is located here: "GNUCHESS), gcompris_end_board);
gc_dialog(_("Error: The external program gnuchess is mandatory\nto play chess in gcompris.\nFind this program on http://www.rpmfind.net or in your\nGNU/Linux distribution\nAnd check it is located here: "GNUCHESS), gc_board_end);
return;
}
......@@ -216,15 +216,15 @@ static void start_board (GcomprisBoard *agcomprisBoard)
case PARTYEND:
case MOVELEARN:
gcomprisBoard->maxlevel=9;
gcompris_bar_set(GCOMPRIS_BAR_LEVEL);
gc_bar_set(GC_BAR_LEVEL);
break;
default:
gcompris_bar_set(0);
gc_bar_set(0);
}
if(start_child (GNUCHESS, &read_chan,
&write_chan, &gnuchess_pid)==FALSE) {
gcompris_dialog(_("Error: The external program gnuchess is mandatory\nto play chess in gcompris.\nFind this program on http://www.rpmfind.net or in your\nGNU/Linux distribution\nAnd check it is in "GNUCHESS), gcompris_end_board);
gc_dialog(_("Error: The external program gnuchess is mandatory\nto play chess in gcompris.\nFind this program on http://www.rpmfind.net or in your\nGNU/Linux distribution\nAnd check it is in "GNUCHESS), gc_board_end);
return;
}
......@@ -305,7 +305,7 @@ static void chess_next_level()
img);
g_free(img);
gcompris_bar_set_level(gcomprisBoard);
gc_bar_set_level(gcomprisBoard);
chess_destroy_all_items();
gamewon = FALSE;
......@@ -501,7 +501,7 @@ static GnomeCanvasItem *chess_create_item(GnomeCanvasGroup *parent)
else
str = g_strdup_printf("chess/W%c.png", piece_to_ascii(piece));
pixmap = gcompris_load_pixmap(str);
pixmap = gc_pixmap_load(str);
// g_warning("loading piece %s\n", str);
g_free(str);
item = gnome_canvas_item_new (boardRootItem,
......@@ -701,7 +701,7 @@ static void move_piece_to(Square from, Square to)
else
str = g_strdup_printf("chess/W%c.png", piece_to_ascii(piece));
pixmap = gcompris_load_pixmap(str);
pixmap = gc_pixmap_load(str);
g_free(str);
g_warning("loading piece %c\n", piece_to_ascii(piece));
gnome_canvas_item_set (dest_square->piece_item,
......
......@@ -259,7 +259,7 @@ static gboolean sounds_are_fine()
if(!properties->fx)
{
gcompris_dialog(_("Error: this activity cannot be played with the\nsound effects disabled.\nGo to the configuration dialog to\nenable the sound"), board_stop);
gc_dialog(_("Error: this activity cannot be played with the\nsound effects disabled.\nGo to the configuration dialog to\nenable the sound"), board_stop);
return(NOT_OK);
}
......@@ -272,30 +272,30 @@ static gboolean sounds_are_fine()
letter_str = gcompris_alphabet_sound(letter);
g_free(letter);
str2 = gcompris_find_absolute_filename("sounds/$LOCALE/alphabet/%s", letter_str);
str2 = gc_file_find_absolute("sounds/$LOCALE/alphabet/%s", letter_str);
if (!str2)
{
gchar *locale = NULL;
locale = g_strndup(gcompris_get_locale(), 2);
locale = g_strndup(gc_locale_get(), 2);
gcompris_reset_locale();
gcompris_change_locale("en_US");
str2 = gcompris_find_absolute_filename("sounds/en/alphabet/%s", letter_str);
str2 = gc_file_find_absolute("sounds/en/alphabet/%s", letter_str);
if (!str2)
{
gchar *msg = g_strdup_printf( _("Error: this activity requires that you first install\nthe packages with gcompris voices for the locale '%s' or '%s'"),
locale, "en");
gcompris_dialog(msg, board_stop);
gc_dialog(msg, board_stop);
g_free(msg);
return (NOT_OK);
}
else
{
gchar *msg = g_strdup_printf( _("Error: this activity requires that you first install\nthe packages with GCompris voices for the locale '%s' ! Fallback to english, sorry!"), locale);
gcompris_dialog(msg, click_on_letter_next_level);
gc_dialog(msg, click_on_letter_next_level);
g_free(msg);
g_free(str2);
return(OK_NO_INIT);
......@@ -316,9 +316,9 @@ static void
click_on_letter_next_level()
{
/* It must be set it for the warning dialogs */
gcompris_bar_set(GCOMPRIS_BAR_CONFIG|GCOMPRIS_BAR_LEVEL|GCOMPRIS_BAR_REPEAT);
gc_bar_set(GC_BAR_CONFIG|GC_BAR_LEVEL|GC_BAR_REPEAT);
gcompris_bar_set_level(gcomprisBoard);
gc_bar_set_level(gcomprisBoard);
click_on_letter_destroy_all_items();
gamewon = FALSE;
......@@ -405,7 +405,7 @@ static GnomeCanvasItem *click_on_letter_create_item(GnomeCanvasGroup *parent)
NULL));
button_pixmap = gcompris_load_pixmap("images/wagon-yellow.png");
button_pixmap = gc_pixmap_load("images/wagon-yellow.png");
yOffset = VERTICAL_SEPARATION;
xOffset = 5;
......@@ -435,7 +435,7 @@ static GnomeCanvasItem *click_on_letter_create_item(GnomeCanvasGroup *parent)
gtk_signal_connect(GTK_OBJECT(l_items[i]), "event", (GtkSignalFunc) item_event, GINT_TO_POINTER(i));
gtk_signal_connect(GTK_OBJECT(buttons[i]), "event", (GtkSignalFunc) item_event, GINT_TO_POINTER(i));
// gtk_signal_connect(GTK_OBJECT(buttons[i]), "event", (GtkSignalFunc) gcompris_item_event_focus, NULL);
// gtk_signal_connect(GTK_OBJECT(buttons[i]), "event", (GtkSignalFunc) gc_item_focus_event, NULL);
}
......@@ -519,7 +519,7 @@ static void highlight_selected(GnomeCanvasItem * item) {
}
if (selected_button != NULL && selected_button != button) {
button_pixmap = gcompris_load_pixmap("images/wagon-yellow.png");
button_pixmap = gc_pixmap_load("images/wagon-yellow.png");
/* Warning changing the image needs to update pixbuf_ref for the focus usage */
g_object_set_data (G_OBJECT (selected_button), "pixbuf_ref", button_pixmap);
gnome_canvas_item_set(selected_button, "pixbuf", button_pixmap, NULL);
......@@ -527,7 +527,7 @@ static void highlight_selected(GnomeCanvasItem * item) {
}
if (selected_button != button) {
button_pixmap_selected = gcompris_load_pixmap("images/wagon-green.png");
button_pixmap_selected = gc_pixmap_load("images/wagon-green.png");
/* Warning changing the image needs to update pixbuf_ref for the focus usage */
g_object_set_data (G_OBJECT (button), "pixbuf_ref", button_pixmap_selected);
gnome_canvas_item_set(button, "pixbuf", button_pixmap_selected, NULL);
......
/* gcompris - clickgame.c
*
* Time-stamp: <2006/08/13 17:56:34 bruno>
* Time-stamp: <2006/08/20 08:10:07 bruno>
*
* Copyright (C) 2000 Bruno Coudoin
*
......@@ -42,7 +42,6 @@ static gint dummy_id = 0;
static gint animate_id = 0;
static gint drop_items_id = 0;
static GList *pixmaplist = NULL;
static GList *imagelist = NULL;
typedef struct {
......@@ -77,6 +76,40 @@ static guint32 fallSpeed = 0;
static double speed = 0.0;
static double imageZoom = 0.0;
// List of images to use in the game
static gchar *pixmapList[] =
{
"fishes/blueking2_%d.png",
"fishes/butfish_%d.png",
"fishes/cichlid1_%d.png",
"fishes/cichlid4_%d.png",
"fishes/collaris_%d.png",
"fishes/discus2_%d.png",
"fishes/discus3_%d.png",
"fishes/eel_%d.png",
"fishes/f00_%d.png",
"fishes/f01_%d.png",
"fishes/f02_%d.png",
"fishes/f03_%d.png",
"fishes/f04_%d.png",
"fishes/f05_%d.png",
"fishes/f06_%d.png",
"fishes/f07_%d.png",
"fishes/f08_%d.png",
"fishes/f09_%d.png",