~ubuntu-branches/ubuntu/precise/gcompris/precise

« back to all changes in this revision

Viewing changes to src/billard-activity/billard.c

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2012-01-10 01:37:41 UTC
  • mto: This revision was merged to the branch mainline in revision 48.
  • Revision ID: package-import@ubuntu.com-20120110013741-q90ulmfrj910igm3
Tags: upstream-12.01
ImportĀ upstreamĀ versionĀ 12.01

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
                                     GooCanvasItem  *target,
69
69
                                     GdkEventButton *event,
70
70
                                     MachItem *machItem);
71
 
static void              minigolf_move(GList *item_list);
 
71
static gboolean          minigolf_move(GList *item_list);
72
72
 
73
73
static MachItem         *create_machine_item(MachItemType machItemType, double x, double y);
74
74
 
181
181
{
182
182
  if (gcomprisBoard)
183
183
    {
184
 
      if(g_strcasecmp(gcomprisBoard->type, "billard")==0)
 
184
      if(g_ascii_strcasecmp(gcomprisBoard->type, "billard")==0)
185
185
        {
186
186
          /* Set the plugin entry */
187
187
          gcomprisBoard->plugin=&menu_bp;
206
206
  /* Try the next level */
207
207
  minigolf_create_item(goo_canvas_get_root_item(gcomprisBoard->canvas));
208
208
 
209
 
  move_id = gtk_timeout_add (40, (GtkFunction) minigolf_move, item_list);
 
209
  move_id = g_timeout_add (40, (GSourceFunc)minigolf_move, item_list);
210
210
 
211
211
}
212
212
/* ==================================== */
217
217
    goo_canvas_item_remove(boardRootItem);
218
218
 
219
219
  if (move_id) {
220
 
    gtk_timeout_remove (move_id);
 
220
    g_source_remove (move_id);
221
221
    move_id = 0;
222
222
  }
223
223
 
360
360
 
361
361
      g_signal_connect(machItem->item,
362
362
                       "button_press_event",
363
 
                       (GtkSignalFunc) item_event,
 
363
                       (GCallback) item_event,
364
364
                       machItem);
365
365
      break;
366
366
    case MACH_VERT_WALL:
430
430
                                              NULL);
431
431
 
432
432
      g_signal_connect(machItem->item, "button_press_event",
433
 
                       (GtkSignalFunc) item_event,
 
433
                       (GCallback) item_event,
434
434
                       machItem);
435
435
 
436
436
      break;
465
465
                                              NULL);
466
466
 
467
467
      g_signal_connect(machItem->item, "enter_notify_event",
468
 
                       (GtkSignalFunc) item_event,
 
468
                       (GCallback) item_event,
469
469
                       machItem);
470
470
      break;
471
471
    }
503
503
}
504
504
 
505
505
/* Move */
506
 
static void minigolf_move(GList *item_list)
 
506
static gboolean minigolf_move(GList *item_list)
507
507
{
508
508
  GooCanvasBounds bounds;
509
509
  MachItem              *machItem;
550
550
                    gamewon = TRUE;
551
551
                    minigolf_destroy_all_items();
552
552
                    gc_bonus_display(gamewon, GC_BONUS_SMILEY);
553
 
                    return;
 
553
                    return(FALSE);
554
554
                  }
555
555
              }
556
556
            }
659
659
        }
660
660
 
661
661
    }
662
 
 
 
662
  return(TRUE);
663
663
}
664
664