gcompris r3663 - in branches/gcomprixogoo: boards/skins/babytoy boards/skins/gartoon src/boards src/gcompris src/goocanvas/src



Author: bcoudoin
Date: Fri Jan  2 17:15:33 2009
New Revision: 3663
URL: http://svn.gnome.org/viewvc/gcompris?rev=3663&view=rev

Log:
More work towards single file svg skin


Removed:
   branches/gcomprixogoo/boards/skins/babytoy/button_up.png
   branches/gcomprixogoo/boards/skins/babytoy/button_up_selected.png
   branches/gcomprixogoo/boards/skins/gartoon/button_up.png
   branches/gcomprixogoo/boards/skins/gartoon/button_up_selected.png
Modified:
   branches/gcomprixogoo/boards/skins/gartoon/skin.svg
   branches/gcomprixogoo/src/boards/menu2.c
   branches/gcomprixogoo/src/gcompris/help.c
   branches/gcomprixogoo/src/goocanvas/src/goocanvassvg.c

Modified: branches/gcomprixogoo/boards/skins/gartoon/skin.svg
==============================================================================
--- branches/gcomprixogoo/boards/skins/gartoon/skin.svg	(original)
+++ branches/gcomprixogoo/boards/skins/gartoon/skin.svg	Fri Jan  2 17:15:33 2009
@@ -283,16 +283,6 @@
     <linearGradient
        inkscape:collect="always"
        xlink:href="#linearGradient2806"
-       id="linearGradient2475"
-       gradientUnits="userSpaceOnUse"
-       gradientTransform="matrix(0.122817,0,0,0.122817,678.81705,414.71045)"
-       x1="274.81769"
-       y1="284.70993"
-       x2="324.22366"
-       y2="480.46399" />
-    <linearGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient2806"
        id="linearGradient2480"
        gradientUnits="userSpaceOnUse"
        gradientTransform="matrix(0.122817,0,0,0.122817,678.85505,357.77095)"
@@ -897,6 +887,26 @@
        y1="284.70993"
        x2="324.22366"
        y2="480.46399" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2806"
+       id="linearGradient2638"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.122817,0,0,0.122817,678.81705,414.71045)"
+       x1="274.81769"
+       y1="284.70993"
+       x2="324.22366"
+       y2="480.46399" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2806"
+       id="linearGradient2658"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.122817,0,0,0.122817,678.81705,414.71045)"
+       x1="274.81769"
+       y1="284.70993"
+       x2="324.22366"
+       y2="480.46399" />
   </defs>
   <sodipodi:namedview
      inkscape:document-units="mm"
@@ -905,9 +915,9 @@
      borderopacity="1.0"
      inkscape:pageopacity="0.0"
      inkscape:pageshadow="2"
-     inkscape:zoom="1.542695"
-     inkscape:cx="626.34637"
-     inkscape:cy="300.25474"
+     inkscape:zoom="3.08539"
+     inkscape:cx="506.74976"
+     inkscape:cy="428.88067"
      inkscape:current-layer="layer1"
      id="namedview6255"
      inkscape:window-width="1107"
@@ -948,7 +958,8 @@
   <g
      inkscape:label="Layer 1"
      inkscape:groupmode="layer"
-     id="layer1">
+     id="layer1"
+     style="display:inline">
     <path
        sodipodi:type="arc"
        style="fill:#1a1a1a;fill-opacity:1;stroke-linecap:round"
@@ -1096,7 +1107,7 @@
     </g>
     <g
        id="g17422"
-       transform="translate(-180.17121,-7.314904)">
+       transform="translate(38.925889,-239.37633)">
       <path
          transform="matrix(-0.183872,0,0,0.183872,501.60505,247.7762)"
          d="M -157.47986,322.08786 A 168.28732,168.28732 0 1 1 -494.0545,322.08786 A 168.28732,168.28732 0 1 1 -157.47986,322.08786 z"
@@ -1442,7 +1453,7 @@
          style="fill:url(#linearGradient2465);fill-opacity:1;stroke-linecap:round" />
     </g>
     <g
-       id="g17457"
+       id="DOWN"
        transform="translate(-185.80624,-262.13927)">
       <path
          transform="matrix(-0.1087594,0,0,0.1087594,688.40496,380.41128)"
@@ -1465,29 +1476,6 @@
          style="fill:url(#linearGradient2480);fill-opacity:1;stroke-linecap:round" />
     </g>
     <g
-       id="g17452"
-       transform="translate(-187.10267,-373.63247)">
-      <path
-         transform="matrix(-0.1087594,0,0,0.1087594,688.40496,437.6262)"
-         d="M -157.47986,322.08786 A 168.28732,168.28732 0 1 1 -494.0545,322.08786 A 168.28732,168.28732 0 1 1 -157.47986,322.08786 z"
-         sodipodi:ry="168.28732"
-         sodipodi:rx="168.28732"
-         sodipodi:cy="322.08786"
-         sodipodi:cx="-325.76718"
-         id="path17327"
-         style="fill:#0055d4;fill-opacity:1;stroke-linecap:round"
-         sodipodi:type="arc" />
-      <path
-         id="path2501"
-         d="M 703.88395,473.06842 C 703.88395,484.10932 712.84305,493.0684 723.88395,493.0684 C 734.92485,493.0684 743.88775,484.10932 743.88775,473.06842 C 743.88775,462.02753 734.92475,453.06844 723.88395,453.06844 C 712.84305,453.06844 703.88395,462.02753 703.88395,473.06842 z M 711.81715,475.02582 C 711.82635,474.2188 712.16545,473.38025 712.82265,472.723 L 721.50815,464.03754 C 722.16545,463.38029 723.00395,463.04079 723.81095,463.03197 C 723.83535,463.03171 723.85955,463.03547 723.88395,463.03581 C 724.71315,463.02429 725.58255,463.36043 726.25965,464.03754 L 734.94515,472.723 C 736.18225,473.96016 736.29425,475.84129 735.19455,476.941 C 734.09485,478.0407 732.21375,477.92869 730.97655,476.69153 L 723.88395,469.60268 L 716.79125,476.69153 C 715.55405,477.92869 713.67295,478.0407 712.57325,476.941 C 712.05775,476.42551 711.80905,475.73789 711.81715,475.02582 z"
-         style="fill:#1a1a1a;fill-opacity:1;stroke-linecap:round" />
-      <path
-         sodipodi:nodetypes="csss"
-         id="path2503"
-         d="M 742.52895,470.62094 C 742.56995,474.94904 705.36835,474.55144 705.36345,470.62094 C 705.35175,461.28034 713.68855,453.69964 723.94615,453.69964 C 734.20385,453.69964 742.44035,461.28244 742.52895,470.62094 z"
-         style="fill:url(#linearGradient2475);fill-opacity:1;stroke-linecap:round" />
-    </g>
-    <g
        id="EXIT"
        transform="translate(-65.518493,318.64948)">
       <path
@@ -1637,6 +1625,54 @@
            sodipodi:nodetypes="csss" />
       </g>
     </g>
+    <g
+       style="display:inline"
+       id="UP"
+       transform="translate(-189.75564,-371.81613)">
+      <path
+         transform="matrix(-0.1087594,0,0,0.1087594,688.40496,437.6262)"
+         d="M -157.47986,322.08786 A 168.28732,168.28732 0 1 1 -494.0545,322.08786 A 168.28732,168.28732 0 1 1 -157.47986,322.08786 z"
+         sodipodi:ry="168.28732"
+         sodipodi:rx="168.28732"
+         sodipodi:cy="322.08786"
+         sodipodi:cx="-325.76718"
+         id="path17327"
+         style="fill:#0055d4;fill-opacity:1;stroke-linecap:round"
+         sodipodi:type="arc" />
+      <path
+         id="path2501"
+         d="M 703.88395,473.06842 C 703.88395,484.10932 712.84305,493.0684 723.88395,493.0684 C 734.92485,493.0684 743.88775,484.10932 743.88775,473.06842 C 743.88775,462.02753 734.92475,453.06844 723.88395,453.06844 C 712.84305,453.06844 703.88395,462.02753 703.88395,473.06842 z M 711.81715,475.02582 C 711.82635,474.2188 712.16545,473.38025 712.82265,472.723 L 721.50815,464.03754 C 722.16545,463.38029 723.00395,463.04079 723.81095,463.03197 C 723.83535,463.03171 723.85955,463.03547 723.88395,463.03581 C 724.71315,463.02429 725.58255,463.36043 726.25965,464.03754 L 734.94515,472.723 C 736.18225,473.96016 736.29425,475.84129 735.19455,476.941 C 734.09485,478.0407 732.21375,477.92869 730.97655,476.69153 L 723.88395,469.60268 L 716.79125,476.69153 C 715.55405,477.92869 713.67295,478.0407 712.57325,476.941 C 712.05775,476.42551 711.80905,475.73789 711.81715,475.02582 z"
+         style="fill:#1a1a1a;fill-opacity:1;stroke-linecap:round" />
+      <path
+         sodipodi:nodetypes="csss"
+         id="path2503"
+         d="M 742.52895,470.62094 C 742.56995,474.94904 705.36835,474.55144 705.36345,470.62094 C 705.35175,461.28034 713.68855,453.69964 723.94615,453.69964 C 734.20385,453.69964 742.44035,461.28244 742.52895,470.62094 z"
+         style="fill:url(#linearGradient2638);fill-opacity:1;stroke-linecap:round" />
+    </g>
+    <g
+       style="display:inline"
+       id="UP_SELECTED"
+       transform="translate(-239.9924,-372.78845)">
+      <path
+         transform="matrix(-0.1087594,0,0,0.1087594,688.40496,437.6262)"
+         d="M -157.47986,322.08786 A 168.28732,168.28732 0 1 1 -494.0545,322.08786 A 168.28732,168.28732 0 1 1 -157.47986,322.08786 z"
+         sodipodi:ry="168.28732"
+         sodipodi:rx="168.28732"
+         sodipodi:cy="322.08786"
+         sodipodi:cx="-325.76718"
+         id="path2652"
+         style="fill:#36d400;fill-opacity:1;stroke-linecap:round"
+         sodipodi:type="arc" />
+      <path
+         id="path2654"
+         d="M 703.88395,473.06842 C 703.88395,484.10932 712.84305,493.0684 723.88395,493.0684 C 734.92485,493.0684 743.88775,484.10932 743.88775,473.06842 C 743.88775,462.02753 734.92475,453.06844 723.88395,453.06844 C 712.84305,453.06844 703.88395,462.02753 703.88395,473.06842 z M 711.81715,475.02582 C 711.82635,474.2188 712.16545,473.38025 712.82265,472.723 L 721.50815,464.03754 C 722.16545,463.38029 723.00395,463.04079 723.81095,463.03197 C 723.83535,463.03171 723.85955,463.03547 723.88395,463.03581 C 724.71315,463.02429 725.58255,463.36043 726.25965,464.03754 L 734.94515,472.723 C 736.18225,473.96016 736.29425,475.84129 735.19455,476.941 C 734.09485,478.0407 732.21375,477.92869 730.97655,476.69153 L 723.88395,469.60268 L 716.79125,476.69153 C 715.55405,477.92869 713.67295,478.0407 712.57325,476.941 C 712.05775,476.42551 711.80905,475.73789 711.81715,475.02582 z"
+         style="fill:#1a1a1a;fill-opacity:1;stroke-linecap:round" />
+      <path
+         sodipodi:nodetypes="csss"
+         id="path2656"
+         d="M 742.52895,470.62094 C 742.56995,474.94904 705.36835,474.55144 705.36345,470.62094 C 705.35175,461.28034 713.68855,453.69964 723.94615,453.69964 C 734.20385,453.69964 742.44035,461.28244 742.52895,470.62094 z"
+         style="fill:url(#linearGradient2658);fill-opacity:1;stroke-linecap:round" />
+    </g>
   </g>
   <g
      inkscape:groupmode="layer"

Modified: branches/gcomprixogoo/src/boards/menu2.c
==============================================================================
--- branches/gcomprixogoo/src/boards/menu2.c	(original)
+++ branches/gcomprixogoo/src/boards/menu2.c	Fri Jan  2 17:15:33 2009
@@ -95,7 +95,7 @@
 
 static gdouble get_ratio(GdkPixbuf *pixmap, gdouble size);
 
-#define P_X 15
+#define P_X 8
 #define P_Y 35
 #define P_W 80
 #define P_H 480

Modified: branches/gcomprixogoo/src/gcompris/help.c
==============================================================================
--- branches/gcomprixogoo/src/gcompris/help.c	(original)
+++ branches/gcomprixogoo/src/gcompris/help.c	Fri Jan  2 17:15:33 2009
@@ -27,7 +27,7 @@
 
 #define SOUNDLISTFILE PACKAGE
 
-#define GAP_TO_BUTTON -20
+#define GAP_TO_BUTTON -30
 
 static gboolean item_event_help (GooCanvasItem  *item,
 				 GooCanvasItem  *target,
@@ -89,7 +89,8 @@
 void gc_help_start (GcomprisBoard *gcomprisBoard)
 {
 
-  GdkPixbuf   *pixmap = NULL;
+  GdkPixbuf *pixmap;
+  gchar *item_id = "#UP";
   GooCanvasItem *item, *item2;
   gint y = 0;
   gint y_start = 0;
@@ -118,6 +119,7 @@
 			     NULL);
 
   GooCanvasBounds bounds;
+  guint pixmap_width = 40;
   goo_canvas_item_get_bounds(item, &bounds);
   x_start = bounds.x1;
   y_start = bounds.y1;
@@ -151,18 +153,19 @@
 		       NULL);
 
 
-  y_start += 120;
-
-  pixmap = gc_skin_pixmap_load("button_up.png");
+  y_start += 80;
 
   // Prerequisite Button
   if(prerequisite)
     {
-      item_prerequisite = goo_canvas_image_new (rootitem,
-						pixmap,
-						(BOARDWIDTH*0.2) - gdk_pixbuf_get_width(pixmap)/2,
-						y_start - gdk_pixbuf_get_height(pixmap) - 10,
-						NULL);
+      item_prerequisite = goo_canvas_svg_new (rootitem,
+					      gc_skin_rsvg_get(),
+					      "svg-id", item_id,
+					      "autocrop", TRUE,
+					      NULL);
+      SET_ITEM_LOCATION(item_prerequisite,
+			(BOARDWIDTH*0.2) - pixmap_width/2,
+			y_start  - 10)
 
       g_signal_connect(item_prerequisite, "button_press_event",
 			 (GtkSignalFunc) item_event_help,
@@ -173,7 +176,7 @@
 	goo_canvas_text_new (rootitem,
 			     _("Prerequisite"),
 			     BOARDWIDTH*0.20,
-			     y_start - gdk_pixbuf_get_height(pixmap)  + GAP_TO_BUTTON,
+			     y_start   + GAP_TO_BUTTON,
 			     -1,
 			     GTK_ANCHOR_CENTER,
 			     "font", gc_skin_font_content,
@@ -187,11 +190,14 @@
   // Goal Button
   if(goal)
     {
-      item_goal = goo_canvas_image_new (rootitem,
-					pixmap,
-					(BOARDWIDTH*0.4) - gdk_pixbuf_get_width(pixmap)/2,
-					y_start - gdk_pixbuf_get_height(pixmap) - 10,
-					NULL);
+      item_goal = goo_canvas_svg_new (rootitem,
+				      gc_skin_rsvg_get(),
+				      "svg-id", item_id,
+				      "autocrop", TRUE,
+				      NULL);
+      SET_ITEM_LOCATION(item_goal,
+			(BOARDWIDTH*0.4) - pixmap_width/2,
+			y_start  - 10);
 
       g_signal_connect(item_goal, "button_press_event",
 			 (GtkSignalFunc) item_event_help,
@@ -201,7 +207,7 @@
       item_goal_text = goo_canvas_text_new (rootitem,
 					    _("Goal"),
 					    BOARDWIDTH*0.4,
-					    y_start - gdk_pixbuf_get_height(pixmap)  + GAP_TO_BUTTON,
+					    y_start   + GAP_TO_BUTTON,
 					    -1,
 					    GTK_ANCHOR_CENTER,
 					    "font", gc_skin_font_content,
@@ -215,11 +221,14 @@
   // Manual Button
   if(manual)
     {
-      item_manual = goo_canvas_image_new (rootitem,
-					  pixmap,
-					  (BOARDWIDTH*0.6) - gdk_pixbuf_get_width(pixmap)/2,
-					  y_start - gdk_pixbuf_get_height(pixmap) - 10,
-					   NULL);
+      item_manual = goo_canvas_svg_new (rootitem,
+					gc_skin_rsvg_get(),
+					"svg-id", item_id,
+					"autocrop", TRUE,
+					NULL);
+      SET_ITEM_LOCATION(item_manual,
+			(BOARDWIDTH*0.6) - pixmap_width/2,
+			y_start  - 10);
 
       g_signal_connect(item_manual, "button_press_event",
 			 (GtkSignalFunc) item_event_help,
@@ -229,7 +238,7 @@
       item_manual_text = goo_canvas_text_new (rootitem,
 					      _("Manual"),
 					      BOARDWIDTH*0.6,
-					      y_start - gdk_pixbuf_get_height(pixmap)  + GAP_TO_BUTTON,
+					      y_start   + GAP_TO_BUTTON,
 					      -1,
 					      GTK_ANCHOR_CENTER,
 					      "font", gc_skin_font_content,
@@ -243,11 +252,14 @@
   // Credit Button
   if(credit)
     {
-      item_credit = goo_canvas_image_new (rootitem,
-					  pixmap,
-					  (BOARDWIDTH*0.8) - gdk_pixbuf_get_width(pixmap)/2,
-					  y_start - gdk_pixbuf_get_height(pixmap) - 10,
-					   NULL);
+      item_credit = goo_canvas_svg_new (rootitem,
+					gc_skin_rsvg_get(),
+					"svg-id", item_id,
+					"autocrop", TRUE,
+					NULL);
+      SET_ITEM_LOCATION(item_credit,
+			(BOARDWIDTH*0.8) - pixmap_width/2,
+			y_start  - 10);
 
       g_signal_connect(item_credit, "button_press_event",
 			 (GtkSignalFunc) item_event_help,
@@ -257,7 +269,7 @@
       item_credit_text = goo_canvas_text_new (rootitem,
 					      _("Credit"),
 					      BOARDWIDTH*0.8,
-					      y_start - gdk_pixbuf_get_height(pixmap)  + GAP_TO_BUTTON,
+					      y_start   + GAP_TO_BUTTON,
 					      -1,
 					      GTK_ANCHOR_CENTER,
 					      "font", gc_skin_font_content,
@@ -268,8 +280,6 @@
 			 "credit");
     }
 
-  gdk_pixbuf_unref(pixmap);
-
   // CONTENT
 
   // default text to display
@@ -295,7 +305,7 @@
       select_item(item_credit, item_credit_text);
     }
 
-  y_start += 5;
+  y_start += 45;
 
   /* Create a scrolled area for the text content */
   GtkWidget *view;
@@ -401,26 +411,24 @@
 
 static void select_item(GooCanvasItem *item, GooCanvasItem *item_text)
 {
-  GdkPixbuf   *pixmap = NULL;
+  gchar *item_id;
 
   if(item_selected)
     {
-      pixmap = gc_skin_pixmap_load("button_up.png");
+      item_id = "#UP";
       g_object_set(item_selected,
-		   "pixbuf", pixmap,
+		   "svg-id", item_id,
 		   NULL);
       g_object_set(item_selected_text,
 		   "fill-color-rgba", gc_skin_get_color("gcompris/helpunselect"),
 		   NULL);
 
-      gdk_pixbuf_unref(pixmap);
     }
 
-  pixmap = gc_skin_pixmap_load("button_up_selected.png");
+  item_id = "#UP_SELECTED";
   g_object_set(item,
-	       "pixbuf", pixmap,
+	       "svg-id", item_id,
 	       NULL);
-  gdk_pixbuf_unref(pixmap);
   g_object_set(item_text,
 	       "fill-color-rgba", gc_skin_get_color("gcompris/helpselect"),
 	       NULL);

Modified: branches/gcomprixogoo/src/goocanvas/src/goocanvassvg.c
==============================================================================
--- branches/gcomprixogoo/src/goocanvas/src/goocanvassvg.c	(original)
+++ branches/gcomprixogoo/src/goocanvas/src/goocanvassvg.c	Fri Jan  2 17:15:33 2009
@@ -296,6 +296,7 @@
       break;
     case PROP_AUTOCROP:
       canvas_svg->autocrop = g_value_get_boolean (value);
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;



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