gnome-edu r16 - trunk/garfunkel/src
- From: brunobol svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-edu r16 - trunk/garfunkel/src
- Date: Mon, 16 Jun 2008 02:02:24 +0000 (UTC)
Author: brunobol
Date: Mon Jun 16 02:02:24 2008
New Revision: 16
URL: http://svn.gnome.org/viewvc/gnome-edu?rev=16&view=rev
Log:
Garfunkel - some issues fixed
Modified:
trunk/garfunkel/src/garfunkel.c
Modified: trunk/garfunkel/src/garfunkel.c
==============================================================================
--- trunk/garfunkel/src/garfunkel.c (original)
+++ trunk/garfunkel/src/garfunkel.c Mon Jun 16 02:02:24 2008
@@ -73,11 +73,11 @@
gtk_widget_add_events (GTK_WIDGET (garfunkel), GDK_KEY_PRESS_MASK);
gtk_widget_add_events (GTK_WIDGET (garfunkel), GDK_BUTTON_PRESS_MASK);
- garfunkel->priv = g_new0 (GarfunkelPrivate, 1);
-
- garfunkel->priv->lights = 0;
- garfunkel->priv->sequence = NULL;
- garfunkel->priv->user_sequence = NULL;
+ garfunkel->priv = g_new0 (GarfunkelPrivate, 1);
+
+ garfunkel->priv->lights = 0;
+ garfunkel->priv->sequence = NULL;
+ garfunkel->priv->user_sequence = NULL;
}
static void garfunkel_finalize(GObject* object) {
@@ -115,7 +115,7 @@
garfunkel = GARFUNKEL (g_object_new (GARFUNKEL_TYPE, NULL));
gp = garfunkel->priv;
-
+
filename = g_build_filename (DEFAULT_THEME_DIR, "garfunkel.svg");
gp->svg_handle = rsvg_handle_new_from_file (filename, NULL);
@@ -149,7 +149,7 @@
cairo_translate(cr,
(width - (100 * (factor / 100))) / 2 ,
(height - (100 * (factor / 100))) / 2);
-
+
/* Scaling */
cairo_scale (cr, factor / 100.0, factor / 100.0);
@@ -184,8 +184,9 @@
cr = gdk_cairo_create (widget->window);
cairo_rectangle (cr,
- event->area.x, event->area.y,
- event->area.width, event->area.height);
+ event->area.x, event->area.y,
+ event->area.width, event->area.height);
+
cairo_clip (cr);
garfunkel_draw (widget, cr);
@@ -198,19 +199,19 @@
static void
garfunkel_redraw (Garfunkel *garfunkel)
{
- GtkWidget *widget;
- GdkRegion *region;
-
- widget = GTK_WIDGET (garfunkel);
+ GtkWidget *widget;
+ GdkRegion *region;
- if (!widget->window) return;
-
- region = gdk_drawable_get_clip_region (widget->window);
- /* redraw the cairo canvas completely by exposing it */
- gdk_window_invalidate_region (widget->window, region, TRUE);
- gdk_window_process_updates (widget->window, TRUE);
+ widget = GTK_WIDGET (garfunkel);
+
+ if (!widget->window) return;
+
+ region = gdk_drawable_get_clip_region (widget->window);
+ /* redraw the cairo canvas completely by exposing it */
+ gdk_window_invalidate_region (widget->window, region, TRUE);
+ gdk_window_process_updates (widget->window, TRUE);
- gdk_region_destroy (region);
+ gdk_region_destroy (region);
}
@@ -232,13 +233,17 @@
{
Garfunkel *garfunkel = (Garfunkel *) data;
- g_usleep (200000);
+ GarfunkelPrivate * gp= NULL;
- garfunkel->priv->lights = 0;
+ gp = garfunkel->priv;
+
+ g_usleep (gp->blink_time / 2);
+
+ gp->lights = 0;
garfunkel_redraw (garfunkel);
- g_usleep (garfunkel->priv->blink_time);
+ g_usleep (gp->blink_time);
}
@@ -273,7 +278,7 @@
gint32 color;
- color = g_random_int_range (0, 3);
+ color = g_random_int_range (0, 4);
gp->sequence = g_slist_append (gp->sequence, GINT_TO_POINTER (1 << color));
}
@@ -293,8 +298,8 @@
while(tmplist){
garfunkel_blink (garfunkel, GPOINTER_TO_INT (tmplist->data), GFK_BLINK_SPEED_NORMAL);
-
- tmplist = g_slist_next(tmplist);
+
+ tmplist = g_slist_next(tmplist);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]