gcompris r3389 - in trunk: . boards boards/skins/gartoon/boardicons po src/boards
- From: bcoudoin svn gnome org
- To: svn-commits-list gnome org
- Subject: gcompris r3389 - in trunk: . boards boards/skins/gartoon/boardicons po src/boards
- Date: Tue, 29 Apr 2008 23:27:07 +0100 (BST)
Author: bcoudoin
Date: Tue Apr 29 22:27:06 2008
New Revision: 3389
URL: http://svn.gnome.org/viewvc/gcompris?rev=3389&view=rev
Log:
Reintroduced the double click erase based activity.
Added:
trunk/boards/skins/gartoon/boardicons/erase_double_clic.svg
- copied unchanged from r2866, /trunk/boards/skins/gartoon/boardicons/erase_double_clic.svg
Modified:
trunk/ChangeLog
trunk/boards/Makefile.am
trunk/po/POTFILES.in
trunk/src/boards/erase.c
Modified: trunk/boards/Makefile.am
==============================================================================
--- trunk/boards/Makefile.am (original)
+++ trunk/boards/Makefile.am Tue Apr 29 22:27:06 2008
@@ -44,6 +44,7 @@
electric.xml.in \
enumerate.xml.in \
erase_clic.xml.in \
+ erase_doubleclick.xml.in \
erase.xml.in \
experience.xml.in \
experimental.xml.in \
Modified: trunk/po/POTFILES.in
==============================================================================
--- trunk/po/POTFILES.in (original)
+++ trunk/po/POTFILES.in Tue Apr 29 22:27:06 2008
@@ -81,6 +81,7 @@
boards/electric.xml.in
boards/enumerate.xml.in
boards/erase.xml.in
+boards/erase_doubleclick.xml.in
boards/erase_clic.xml.in
boards/experience.xml.in
boards/experimental.xml.in
Modified: trunk/src/boards/erase.c
==============================================================================
--- trunk/src/boards/erase.c (original)
+++ trunk/src/boards/erase.c Tue Apr 29 22:27:06 2008
@@ -56,8 +56,9 @@
static gint timer_id = 0;
-#define NORMAL 0
-#define CLIC 1
+#define NORMAL 0
+#define CLIC 1
+#define DOUBLECLIC 2
static gint board_mode = NORMAL;
@@ -188,6 +189,8 @@
if (strcmp(gcomprisBoard->mode,"clic")==0)
board_mode = CLIC;
+ else if (strcmp(gcomprisBoard->mode,"doubleclic")==0)
+ board_mode = DOUBLECLIC;
else {
board_mode = NORMAL;
gcomprisBoard->maxlevel=8;
@@ -481,7 +484,10 @@
static gint
item_event(GnomeCanvasItem *item, GdkEvent *event, gpointer data)
{
+ static GnomeCanvasItem *previous_clicked_item = NULL;
+ static guint32 previous_click_time = 0;
counter *c = (counter *) data;
+
if(board_paused)
return FALSE;
@@ -510,6 +516,26 @@
if (event->type != GDK_BUTTON_PRESS)
return FALSE;
+ if (board_mode == DOUBLECLIC)
+ {
+ if (event->type != GDK_BUTTON_PRESS)
+ return FALSE;
+ else
+ {
+ guint32 d = event->button.time - previous_click_time;
+ /* Click duration handicap depending on the level */
+ d += gcomprisBoard->level * 100;
+
+ if (previous_clicked_item != item
+ || d >= 850)
+ {
+ previous_clicked_item = item;
+ previous_click_time = event->button.time;
+ return FALSE;
+ }
+ }
+ }
+
erase_one_item (item);
return FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]