[gcompris/gcomprixogoo] Added an API entry to get the current cursor.



commit 8d16964de1ef91d437821052c9a1f6d9bb25609d
Author: Bruno Coudoin <bruno coudoin free fr>
Date:   Sat Feb 6 11:48:20 2010 +0100

    Added an API entry to get the current cursor.
    
    This allow the help dialog to get the previous cursor, set the default
    one and change again to the caller one in the end.

 src/gcompris/gcompris.c |    7 +++++++
 src/gcompris/gcompris.h |    1 +
 src/gcompris/help.c     |    8 +++++++-
 3 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/src/gcompris/gcompris.c b/src/gcompris/gcompris.c
index 64e2d68..715ae0a 100644
--- a/src/gcompris/gcompris.c
+++ b/src/gcompris/gcompris.c
@@ -94,6 +94,7 @@ static GtkWidget *widget_activation_entry;
 static GcomprisProperties *properties = NULL;
 static gboolean		   is_mapped = FALSE;
 static gboolean		   fullscreen;
+static guint		   gc_cursor_current;
 
 /****************************************************************************/
 /* Some constants.  */
@@ -438,6 +439,11 @@ board_widget_key_press_callback (GtkWidget   *widget,
   return FALSE;
 };
 
+guint gc_cursor_get()
+{
+  return gc_cursor_current;
+}
+
 void gc_cursor_set(guint gdk_cursor_type)
 {
   GdkCursor *cursor = NULL;
@@ -496,6 +502,7 @@ void gc_cursor_set(guint gdk_cursor_type)
 	gdk_pixbuf_unref(cursor_pixbuf);
       }
   }
+  gc_cursor_current = gdk_cursor_type;
 }
 
 /**
diff --git a/src/gcompris/gcompris.h b/src/gcompris/gcompris.h
index 6ed7516..eb3a3e7 100644
--- a/src/gcompris/gcompris.h
+++ b/src/gcompris/gcompris.h
@@ -170,6 +170,7 @@ void		 gc_locale_set(gchar *locale);
 char		*gc_locale_get_user_default(void);
 gchar		*gc_locale_get_name(gchar *locale);
 
+guint		 gc_cursor_get();
 void		 gc_cursor_set(guint gdk_cursor_type);
 
 typedef void     (*ImageSelectorCallBack)     (gchar* image,
diff --git a/src/gcompris/help.c b/src/gcompris/help.c
index 39cf3d5..b78c955 100644
--- a/src/gcompris/help.c
+++ b/src/gcompris/help.c
@@ -59,7 +59,9 @@ static GooCanvasItem *item_credit_text        = NULL;
 static GooCanvasItem *item_selected		= NULL;
 static GooCanvasItem *item_selected_text	= NULL;
 
-static GtkTextBuffer   *buffer_content;
+static GtkTextBuffer *buffer_content;
+static guint	      caller_cursor;
+
 /*
  * Main entry point
  * ----------------
@@ -102,6 +104,9 @@ void gc_help_start (GcomprisBoard *gcomprisBoard)
 
   gc_board_pause(TRUE);
 
+  caller_cursor = gc_cursor_get();
+  gc_cursor_set(GCOMPRIS_DEFAULT_CURSOR);
+
   item_selected = NULL;
   item_selected_text = NULL;
 
@@ -374,6 +379,7 @@ void gc_help_stop ()
 	  goo_canvas_item_remove(rootitem);
 	  rootitem = NULL;
 	}
+      gc_cursor_set(caller_cursor);
       gc_board_pause(FALSE);
     }
 



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