gcompris r3691 - in branches/gcomprixogoo: . boards/skins/babytoy boards/skins/gartoon src/administration-activity src/anim-activity src/awele-activity src/boards src/chat-activity src/chess_computer-activity src/electric-activity src/electric-activity/resources/electric src/fifteen-activity src/gcompris src/gnumch-equality-activity src/hanoi-activity src/hanoi_real-activity src/hexagon-activity src/magic_hat_minus-activity src/maze-activity src/pythontemplate-activity src/pythontest-activity src/redraw-activity src/searace-activity src/sudoku-activity src/tuxpaint-activity
- From: bcoudoin svn gnome org
- To: svn-commits-list gnome org
- Subject: gcompris r3691 - in branches/gcomprixogoo: . boards/skins/babytoy boards/skins/gartoon src/administration-activity src/anim-activity src/awele-activity src/boards src/chat-activity src/chess_computer-activity src/electric-activity src/electric-activity/resources/electric src/fifteen-activity src/gcompris src/gnumch-equality-activity src/hanoi-activity src/hanoi_real-activity src/hexagon-activity src/magic_hat_minus-activity src/maze-activity src/pythontemplate-activity src/pythontest-activity src/redraw-activity src/searace-activity src/sudoku-activity src/tuxpaint-activity
- Date: Sat, 24 Jan 2009 20:14:38 +0000 (UTC)
Author: bcoudoin
Date: Sat Jan 24 20:14:38 2009
New Revision: 3691
URL: http://svn.gnome.org/viewvc/gcompris?rev=3691&view=rev
Log:
Added a gc_set_default_background() api entry.
Exported it and gc_set_background_by_id() to python.
Removed the need for gcompris-bg.jpg which is now in skin.svg
Removed:
branches/gcomprixogoo/boards/skins/babytoy/gcompris-bg.jpg
branches/gcomprixogoo/boards/skins/gartoon/gcompris-bg.jpg
Modified:
branches/gcomprixogoo/ChangeLog
branches/gcomprixogoo/boards/skins/gartoon/skin.svg
branches/gcomprixogoo/src/administration-activity/administration.py
branches/gcomprixogoo/src/anim-activity/anim.py
branches/gcomprixogoo/src/awele-activity/awele.c
branches/gcomprixogoo/src/boards/menu2.c
branches/gcomprixogoo/src/boards/py-mod-gcompris.c
branches/gcomprixogoo/src/chat-activity/chat.py
branches/gcomprixogoo/src/chess_computer-activity/chess.c
branches/gcomprixogoo/src/electric-activity/electric.py
branches/gcomprixogoo/src/electric-activity/resources/electric/Makefile.am
branches/gcomprixogoo/src/fifteen-activity/fifteen.c
branches/gcomprixogoo/src/gcompris/gcompris.c
branches/gcomprixogoo/src/gcompris/gcompris.h
branches/gcomprixogoo/src/gnumch-equality-activity/gnumch.py
branches/gcomprixogoo/src/hanoi-activity/hanoi.c
branches/gcomprixogoo/src/hanoi_real-activity/hanoi_real.c
branches/gcomprixogoo/src/hexagon-activity/hexagon.py
branches/gcomprixogoo/src/magic_hat_minus-activity/magic_hat.c
branches/gcomprixogoo/src/maze-activity/maze.c
branches/gcomprixogoo/src/pythontemplate-activity/pythontemplate.py
branches/gcomprixogoo/src/pythontest-activity/pythontest.py
branches/gcomprixogoo/src/redraw-activity/redraw.py
branches/gcomprixogoo/src/searace-activity/searace.py
branches/gcomprixogoo/src/sudoku-activity/sudoku.py
branches/gcomprixogoo/src/tuxpaint-activity/tuxpaint.py
Modified: branches/gcomprixogoo/boards/skins/gartoon/skin.svg
==============================================================================
--- branches/gcomprixogoo/boards/skins/gartoon/skin.svg (original)
+++ branches/gcomprixogoo/boards/skins/gartoon/skin.svg Sat Jan 24 20:14:38 2009
@@ -2317,12 +2317,12 @@
inkscape:zoom="0.54542505"
inkscape:cx="250.00318"
inkscape:cy="342.58959"
- inkscape:current-layer="layer6"
+ inkscape:current-layer="layer1"
id="namedview6255"
inkscape:window-width="1272"
inkscape:window-height="743"
inkscape:window-x="0"
- inkscape:window-y="25"
+ inkscape:window-y="253"
showguides="true"
inkscape:guide-bbox="true"
showgrid="false">
@@ -2569,7 +2569,7 @@
style="opacity:1;fill:#ececec;fill-opacity:1;stroke:#000000;stroke-width:2.90213251;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
<g
- id="BUTTON_VERTICAL"
+ id="SELECTOR"
transform="matrix(0.835729,0,0,1.0177439,-654.5275,-83.993068)">
<rect
transform="matrix(0,-1,1,0,0,0)"
Modified: branches/gcomprixogoo/src/administration-activity/administration.py
==============================================================================
--- branches/gcomprixogoo/src/administration-activity/administration.py (original)
+++ branches/gcomprixogoo/src/administration-activity/administration.py Sat Jan 24 20:14:38 2009
@@ -93,8 +93,7 @@
self.gcomprisBoard.sublevel=1
self.gcomprisBoard.number_of_sublevel=1
gcompris.bar_set(0)
- gcompris.set_background(self.gcomprisBoard.canvas.get_root_item(),
- gcompris.skin.image_to_skin("gcompris-bg.jpg"))
+ gcompris.set_default_background(self.gcomprisBoard.canvas.get_root_item())
gcompris.bar_set_level(self.gcomprisBoard)
gcompris.bar_location(25, -1, 0.6)
Modified: branches/gcomprixogoo/src/anim-activity/anim.py
==============================================================================
--- branches/gcomprixogoo/src/anim-activity/anim.py (original)
+++ branches/gcomprixogoo/src/anim-activity/anim.py Sat Jan 24 20:14:38 2009
@@ -194,8 +194,7 @@
self.gcomprisBoard.sublevel=0
self.gcomprisBoard.number_of_sublevel=0
- gcompris.set_background(self.gcomprisBoard.canvas.get_root_item(),
- gcompris.skin.image_to_skin("gcompris-bg.jpg"))
+ gcompris.set_default_background(self.gcomprisBoard.canvas.get_root_item())
# Create our rootitem. We put each canvas item in it so at the end we
# only have to kill it. The canvas deletes all the items it contains automaticaly.
Modified: branches/gcomprixogoo/src/awele-activity/awele.c
==============================================================================
--- branches/gcomprixogoo/src/awele-activity/awele.c (original)
+++ branches/gcomprixogoo/src/awele-activity/awele.c Sat Jan 24 20:14:38 2009
@@ -249,12 +249,7 @@
static void
awele_next_level ()
{
- gchar *img;
-
- img = gc_skin_image_get ("gcompris-bg.jpg");
- gc_set_background (goo_canvas_get_root_item (gcomprisBoard->canvas),
- img);
- g_free(img);
+ gc_set_default_background (goo_canvas_get_root_item (gcomprisBoard->canvas));
gc_bar_set_level (gcomprisBoard);
Modified: branches/gcomprixogoo/src/boards/menu2.c
==============================================================================
--- branches/gcomprixogoo/src/boards/menu2.c (original)
+++ branches/gcomprixogoo/src/boards/menu2.c Sat Jan 24 20:14:38 2009
@@ -243,7 +243,7 @@
goo_canvas_svg_new (boardRootItem,
svg_handle,
- "svg-id", "#BUTTON_VERTICAL",
+ "svg-id", "#SELECTOR",
"pointer-events", GOO_CANVAS_EVENTS_NONE,
NULL);
Modified: branches/gcomprixogoo/src/boards/py-mod-gcompris.c
==============================================================================
--- branches/gcomprixogoo/src/boards/py-mod-gcompris.c (original)
+++ branches/gcomprixogoo/src/boards/py-mod-gcompris.c Sat Jan 24 20:14:38 2009
@@ -149,6 +149,51 @@
}
+/* GooCanvasItem *gc_set_background_by_id(GooCanvasGroup *parent,
+ RsvgHandle svg_handle, gchar *id); */
+static PyObject*
+py_gc_set_background_by_id(PyObject* self, PyObject* args)
+{
+ PyObject* pyCanvasGroup;
+ PyObject* pySvgHandle;
+ GooCanvasItem* canvasGroup;
+ RsvgHandle *svg_handle;
+ gchar* id;
+
+ /* Parse arguments */
+ if(!PyArg_ParseTuple(args, "OOs:gc_set_background_by_id",
+ &pyCanvasGroup, &pySvgHandle, &id))
+ return NULL;
+ canvasGroup = (GooCanvasItem*) pygobject_get(pyCanvasGroup);
+ svg_handle = (RsvgHandle*) pygobject_get(pySvgHandle);
+
+ /* Call the corresponding C function */
+ gc_set_background_by_id(canvasGroup, svg_handle, id);
+
+ return Py_None;
+}
+
+
+/* GooCanvasItem *gc_set_default_background(GooCanvasGroup *parent) */
+static PyObject*
+py_gc_set_default_background(PyObject* self, PyObject* args)
+{
+ PyObject* pyCanvasGroup;
+ GooCanvasItem* canvasGroup;
+
+ /* Parse arguments */
+ if(!PyArg_ParseTuple(args, "O:gc_set_background_by_id",
+ &pyCanvasGroup))
+ return NULL;
+ canvasGroup = (GooCanvasItem*) pygobject_get(pyCanvasGroup);
+
+ /* Call the corresponding C function */
+ gc_set_default_background(canvasGroup);
+
+ return Py_None;
+}
+
+
/* void gc_bar_set_level (GcomprisBoard *gcomprisBoard); */
static PyObject*
py_gc_bar_set_level(PyObject* self, PyObject* args)
@@ -172,7 +217,7 @@
}
-/* void gc_bar_set_repeat_icon (GdkPixbuf *pixmap); */
+/* void gc_bar_set_repeat_icon (RsvgHandle *svg_handle); */
static PyObject*
py_gc_bar_set_repeat_icon(PyObject* self, PyObject* args)
{
@@ -1512,6 +1557,8 @@
{ "end_board", py_gc_board_end, METH_VARARGS, "gc_board_end" },
{ "bar_start", py_gc_bar_start, METH_VARARGS, "gc_bar_start" },
{ "set_background", py_gc_set_background, METH_VARARGS, "gc_set_background" },
+ { "set_background_by_id", py_gc_set_background_by_id, METH_VARARGS, "gc_set_background_by_id" },
+ { "set_default_background", py_gc_set_default_background, METH_VARARGS, "gc_set_default_background" },
{ "bar_set_level", py_gc_bar_set_level, METH_VARARGS, "gc_bar_set_level" },
{ "bar_set_repeat_icon", py_gc_bar_set_repeat_icon, METH_VARARGS, "gc_bar_set_repeat_icon" },
{ "bar_set", py_gc_bar_set, METH_VARARGS, "gc_bar_set" },
Modified: branches/gcomprixogoo/src/chat-activity/chat.py
==============================================================================
--- branches/gcomprixogoo/src/chat-activity/chat.py (original)
+++ branches/gcomprixogoo/src/chat-activity/chat.py Sat Jan 24 20:14:38 2009
@@ -55,8 +55,7 @@
def start(self):
gcompris.bar_set (0)
gcompris.bar_location(gcompris.BOARD_WIDTH - 160, -1, 0.6)
- gcompris.set_background(self.gcomprisBoard.canvas.get_root_item(),
- gcompris.skin.image_to_skin("gcompris-bg.jpg"))
+ gcompris.set_default_background(self.gcomprisBoard.canvas.get_root_item())
self.rootitem = goocanvas.Group(parent = self.gcomprisBoard.canvas.get_root_item())
# The global area
Modified: branches/gcomprixogoo/src/chess_computer-activity/chess.c
==============================================================================
--- branches/gcomprixogoo/src/chess_computer-activity/chess.c (original)
+++ branches/gcomprixogoo/src/chess_computer-activity/chess.c Sat Jan 24 20:14:38 2009
@@ -377,12 +377,8 @@
{
register Square square;
register gshort rank;
- gchar *img;
- img = gc_skin_image_get("gcompris-bg.jpg");
- gc_set_background(goo_canvas_get_root_item(gcomprisBoard->canvas),
- img);
- g_free(img);
+ gc_set_default_background(goo_canvas_get_root_item(gcomprisBoard->canvas));
gc_bar_set_level(gcomprisBoard);
Modified: branches/gcomprixogoo/src/electric-activity/electric.py
==============================================================================
--- branches/gcomprixogoo/src/electric-activity/electric.py (original)
+++ branches/gcomprixogoo/src/electric-activity/electric.py Sat Jan 24 20:14:38 2009
@@ -46,8 +46,8 @@
# Part of UI : tools buttons
# TOOL SELECTION
self.tools = [
- ["DEL", "draw/tool-del.png", "draw/tool-del_on.png", gcompris.CURSOR_DEL],
- ["SELECT", "draw/tool-select.png", "draw/tool-select_on.png", gcompris.CURSOR_SELECT]
+ ["DEL", "electric/tool-del.png", "electric/tool-del_on.png", gcompris.CURSOR_DEL],
+ ["SELECT", "electric/tool-select.png", "electric/tool-select_on.png", gcompris.CURSOR_SELECT]
]
# These are used to let us restart only after the bonus is displayed.
@@ -76,8 +76,7 @@
gcompris.bar_location(gcompris.BOARD_WIDTH - 160, -1, 0.7)
- gcompris.set_background(self.gcomprisBoard.canvas.get_root_item(),
- gcompris.skin.image_to_skin("gcompris-bg.jpg"))
+ gcompris.set_default_background(self.gcomprisBoard.canvas.get_root_item())
self.display_game()
@@ -212,7 +211,7 @@
item = \
goocanvas.Image(
parent = self.rootitem,
- pixbuf = gcompris.utils.load_pixmap(gcompris.skin.image_to_skin(self.tools[i][1])),
+ pixbuf = gcompris.utils.load_pixmap(self.tools[i][1]),
x=x,
y=y
)
@@ -225,7 +224,7 @@
# Always select the SELECT item by default
self.current_tool = i
self.old_tool_item = item
- self.old_tool_item.props.pixbuf = gcompris.utils.load_pixmap(gcompris.skin.image_to_skin(self.tools[i][2]))
+ self.old_tool_item.props.pixbuf = gcompris.utils.load_pixmap(self.tools[i][2])
gcompris.set_cursor(self.tools[i][3]);
# Add the item in self.tools for later use
@@ -1602,14 +1601,10 @@
self.rootitem = electric.rootitem
- goocanvas.Image(
- parent = self.rootitem,
- pixbuf = gcompris.utils.load_pixmap(gcompris.skin.image_to_skin("draw/tool-selector.png")),
- x=5,
- y=5.0,
- width=107.0,
- height=517.0,
- )
+ goocanvas.Svg(parent = self.rootitem,
+ svg_handle = gcompris.skin.svg_get(),
+ svg_id = "#SELECTOR"
+ )
self.x = 15
self.y = 60
Modified: branches/gcomprixogoo/src/electric-activity/resources/electric/Makefile.am
==============================================================================
--- branches/gcomprixogoo/src/electric-activity/resources/electric/Makefile.am (original)
+++ branches/gcomprixogoo/src/electric-activity/resources/electric/Makefile.am Sat Jan 24 20:14:38 2009
@@ -1,11 +1,11 @@
imgdir = $(pkgdatadir)/@PACKAGE_DATA_DIR@/electric
img_DATA = \
+ battery.png \
battery_dead.png \
battery_icon.png \
- battery.png \
+ bulb1.png \
bulb10.png \
bulb11.png \
- bulb1.png \
bulb2.png \
bulb3.png \
bulb4.png \
@@ -15,16 +15,16 @@
bulb8.png \
bulb9.png \
bulb_icon.png \
- connect_icon.png \
connect.png \
+ connect_icon.png \
connect_spot.png \
- diode_icon.png \
- diode.png \
diod.png \
- resistor_icon.png \
+ diode.png \
+ diode_icon.png \
resistor.png \
- resistor_track_icon.png \
+ resistor_icon.png \
resistor_track.png \
+ resistor_track_icon.png \
resistor_wiper.png \
switch2_icon.png \
switch2_off.png \
@@ -32,6 +32,10 @@
switch_click.png \
switch_icon.png \
switch_off.png \
- switch_on.png
+ switch_on.png \
+ tool-del.png \
+ tool-del_on.png \
+ tool-select.png \
+ tool-select_on.png
EXTRA_DIST = $(img_DATA)
Modified: branches/gcomprixogoo/src/fifteen-activity/fifteen.c
==============================================================================
--- branches/gcomprixogoo/src/fifteen-activity/fifteen.c (original)
+++ branches/gcomprixogoo/src/fifteen-activity/fifteen.c Sat Jan 24 20:14:38 2009
@@ -160,12 +160,7 @@
/* set initial values for the next level */
static void fifteen_next_level()
{
- gchar *img;
-
- img = gc_skin_image_get("gcompris-bg.jpg");
- gc_set_background(goo_canvas_get_root_item(gcomprisBoard->canvas),
- img);
- g_free(img);
+ gc_set_default_background(goo_canvas_get_root_item(gcomprisBoard->canvas));
gc_bar_set_level(gcomprisBoard);
Modified: branches/gcomprixogoo/src/gcompris/gcompris.c
==============================================================================
--- branches/gcomprixogoo/src/gcompris/gcompris.c (original)
+++ branches/gcomprixogoo/src/gcompris/gcompris.c Sat Jan 24 20:14:38 2009
@@ -479,7 +479,7 @@
}
static void
-_set_svg_background(GooCanvasItem *parent, gchar *file)
+_set_svg_background(GooCanvasItem *parent, gchar *file, gchar *id)
{
RsvgHandle *rsvg_handle;
@@ -488,6 +488,7 @@
if(backgroundsvgimg)
g_object_set(backgroundsvgimg,
"svg-handle", rsvg_handle,
+ "svg-id", id,
NULL);
else
backgroundsvgimg = goo_canvas_svg_new (parent,
@@ -552,7 +553,7 @@
goo_canvas_item_remove(backgroundimg);
backgroundimg = NULL;
- _set_svg_background(parent, file);
+ _set_svg_background(parent, file, NULL);
}
else
{
@@ -584,6 +585,14 @@
goo_canvas_item_lower(backgroundsvgimg, NULL);
}
+void
+gc_set_default_background(GooCanvasItem *parent)
+{
+ gc_set_background_by_id(parent,
+ gc_skin_rsvg_get(),
+ "#BACKGROUND");
+}
+
/* Redraw the black background
*/
static gboolean
Modified: branches/gcomprixogoo/src/gcompris/gcompris.h
==============================================================================
--- branches/gcomprixogoo/src/gcompris/gcompris.h (original)
+++ branches/gcomprixogoo/src/gcompris/gcompris.h Sat Jan 24 20:14:38 2009
@@ -85,11 +85,39 @@
/* Control Bar methods */
void gc_bar_start (GooCanvas *theCanvas);
+/** Set the default background of your activity.
+ * Always set the background in your activity startup.
+ * activity startup.
+ * @param[in] parent is the canvas root item
+ */
+void gc_set_default_background(GooCanvasItem *parent);
+/** Set the given background of your activity.
+ * Always set the background in your activity startup.
+ * activity startup.
+ * @param[in] parent is the canvas root item
+ * @param[in] file is a relative file. It can be svg, png or jpg.
+ */
void gc_set_background(GooCanvasItem *parent, gchar *file);
+/** Set the given rsvg image as the activity background.
+ * Always set the background in your activity startup.
+ * @param[in] parent is the canvas root item
+ * @param[in] rsvg_handle is the svg background
+ * @param[in] id is the id of the item to display in rsvg_handle.
+ * Set id to NULL to display all the image.
+ */
void gc_set_background_by_id(GooCanvasItem *parent,
RsvgHandle *rsvg_handle,
gchar *id);
+/** Update the bar to display the current level
+ * You must maintain the current level in your GcomprisBoard->level.
+ * @param[in] gcomprisBoard is your activity handle
+ */
void gc_bar_set_level (GcomprisBoard *gcomprisBoard);
+/** The repeat icon as set with the flag GC_BAR_REPEAT can be
+ * overrided with your specific icon. Use this if the default
+ * repeat icon does not match your action.
+ * @param[in] svg_handle is the handle to the svg image.
+ */
void gc_bar_set_repeat_icon (RsvgHandle *svg_handle);
/* Status bar control */
@@ -114,13 +142,23 @@
GCOMPRIS_FILTER_UNDER,
GCOMPRIS_FILTER_ABOVE,
} GcomprisFilterType;
-
+/** Set the different option that must be present in the control bar.
+ * @param[in} glags is a bit mask of GComprisBarFlags.
+ */
void gc_bar_set (const GComprisBarFlags flags);
+/** Hide of show the control bar.
+ * @param[in] hide set to true to hide the bar.
+ */
void gc_bar_hide (gboolean hide);
+/** Specify where in your activity must be set the control bar
+ * @param[in] x is the x coordinate. Set to -1 to keep the default.
+ * @param[in] y is the x coordinate Set to -1 to keep the default.
+ * @param[in] zoom is the zoom factor. Set to -1 to keep the default.
+ */
void gc_bar_location (int x, int y, double zoom);
/* General */
-GooCanvas *gc_get_canvas(void);
+GooCanvas *gc_get_canvas(void);
GtkWidget *gc_get_window(void);
const gchar *gc_locale_get(void);
Modified: branches/gcomprixogoo/src/gnumch-equality-activity/gnumch.py
==============================================================================
--- branches/gcomprixogoo/src/gnumch-equality-activity/gnumch.py (original)
+++ branches/gcomprixogoo/src/gnumch-equality-activity/gnumch.py Sat Jan 24 20:14:38 2009
@@ -699,8 +699,7 @@
self.board.number_of_sublevel = self.levelset.num_sublevels
self.trog_wait = 1900
- gcompris.set_background(self.board.canvas.get_root_item(),
- gcompris.skin.image_to_skin("gcompris-bg.jpg"))
+ gcompris.set_default_background(self.gcomprisBoard.canvas.get_root_item())
gcompris.bar_set_level(self.board)
gcompris.bar_set(gcompris.BAR_LEVEL | gcompris.BAR_REPEAT)
Modified: branches/gcomprixogoo/src/hanoi-activity/hanoi.c
==============================================================================
--- branches/gcomprixogoo/src/hanoi-activity/hanoi.c (original)
+++ branches/gcomprixogoo/src/hanoi-activity/hanoi.c Sat Jan 24 20:14:38 2009
@@ -142,7 +142,6 @@
static void
start_board (GcomprisBoard *agcomprisBoard)
{
- gchar *img;
if(agcomprisBoard!=NULL)
{
@@ -153,9 +152,7 @@
gcomprisBoard->number_of_sublevel=1; /* Go to next level after this number of 'play' */
gc_bar_set(GC_BAR_LEVEL);
- gc_set_background(goo_canvas_get_root_item(gcomprisBoard->canvas),
- img = gc_skin_image_get("gcompris-bg.jpg"));
- g_free(img);
+ gc_set_default_background(goo_canvas_get_root_item(gcomprisBoard->canvas));
gc_drag_start(goo_canvas_get_root_item(gcomprisBoard->canvas),
(GcDragFunc)item_event,
Modified: branches/gcomprixogoo/src/hanoi_real-activity/hanoi_real.c
==============================================================================
--- branches/gcomprixogoo/src/hanoi_real-activity/hanoi_real.c (original)
+++ branches/gcomprixogoo/src/hanoi_real-activity/hanoi_real.c Sat Jan 24 20:14:38 2009
@@ -123,8 +123,6 @@
if(agcomprisBoard!=NULL)
{
- gchar *img;
-
gcomprisBoard=agcomprisBoard;
gcomprisBoard->level=1;
gcomprisBoard->maxlevel=2;
@@ -132,10 +130,7 @@
gcomprisBoard->number_of_sublevel=1; /* Go to next level after this number of 'play' */
gc_bar_set(GC_BAR_LEVEL);
- img = gc_skin_image_get("gcompris-bg.jpg");
- gc_set_background(goo_canvas_get_root_item(gcomprisBoard->canvas),
- img);
- g_free(img);
+ gc_set_default_background(goo_canvas_get_root_item(gcomprisBoard->canvas));
boardRootItem = NULL;
Modified: branches/gcomprixogoo/src/hexagon-activity/hexagon.py
==============================================================================
--- branches/gcomprixogoo/src/hexagon-activity/hexagon.py (original)
+++ branches/gcomprixogoo/src/hexagon-activity/hexagon.py Sat Jan 24 20:14:38 2009
@@ -45,8 +45,7 @@
self.gcomprisBoard.sublevel=1
self.gcomprisBoard.number_of_sublevel=1
gcompris.bar_set(gcompris.BAR_LEVEL)
- gcompris.set_background(self.gcomprisBoard.canvas.get_root_item(),
- gcompris.skin.image_to_skin("gcompris-bg.jpg"))
+ gcompris.set_default_background(self.gcomprisBoard.canvas.get_root_item())
gcompris.bar_set_level(self.gcomprisBoard)
self.set_level(1)
self.game_start()
Modified: branches/gcomprixogoo/src/magic_hat_minus-activity/magic_hat.c
==============================================================================
--- branches/gcomprixogoo/src/magic_hat_minus-activity/magic_hat.c (original)
+++ branches/gcomprixogoo/src/magic_hat_minus-activity/magic_hat.c Sat Jan 24 20:14:38 2009
@@ -169,7 +169,6 @@
{
if (agcomprisBoard != NULL) {
- gchar *img;
gcomprisBoard = agcomprisBoard;
gcomprisBoard->level = 1;
@@ -186,9 +185,7 @@
else
board_mode = DEFAULT_MODE;
- img = gc_skin_image_get("gcompris-bg.jpg");
- gc_set_background(goo_canvas_get_root_item(gcomprisBoard->canvas), img);
- g_free(img);
+ gc_set_default_background(goo_canvas_get_root_item(gcomprisBoard->canvas));
magic_hat_next_level();
Modified: branches/gcomprixogoo/src/maze-activity/maze.c
==============================================================================
--- branches/gcomprixogoo/src/maze-activity/maze.c (original)
+++ branches/gcomprixogoo/src/maze-activity/maze.c Sat Jan 24 20:14:38 2009
@@ -180,17 +180,14 @@
static void start_board (GcomprisBoard *agcomprisBoard) {
if(agcomprisBoard!=NULL) {
- gchar *img;
gcomprisBoard=agcomprisBoard;
/* disable im_context */
gcomprisBoard->disable_im_context = TRUE;
- img = gc_skin_image_get("gcompris-bg.jpg");
- gc_set_background(goo_canvas_get_root_item(gcomprisBoard->canvas),
- img);
- g_free(img);
+ gc_set_default_background(goo_canvas_get_root_item(gcomprisBoard->canvas));
+
gcomprisBoard->level=1;
gcomprisBoard->maxlevel=9;
@@ -1486,11 +1483,8 @@
static void
twoDdisplay()
{
- char *fileskin;
gc_sound_play_ogg ("sounds/flip.wav", NULL);
- fileskin = gc_skin_image_get("gcompris-bg.jpg");
- gc_set_background(goo_canvas_get_root_item(gcomprisBoard->canvas), fileskin);
- g_free(fileskin);
+ gc_set_default_background(goo_canvas_get_root_item(gcomprisBoard->canvas));
if (threedgroup)
g_object_set (threedgroup, "visibility", GOO_CANVAS_ITEM_INVISIBLE, NULL);
Modified: branches/gcomprixogoo/src/pythontemplate-activity/pythontemplate.py
==============================================================================
--- branches/gcomprixogoo/src/pythontemplate-activity/pythontemplate.py (original)
+++ branches/gcomprixogoo/src/pythontemplate-activity/pythontemplate.py Sat Jan 24 20:14:38 2009
@@ -44,8 +44,7 @@
gcompris.bar_set(gcompris.BAR_LEVEL)
# Set a background image
- gcompris.set_background(self.gcomprisBoard.canvas.get_root_item(),
- gcompris.skin.image_to_skin("gcompris-bg.jpg"))
+ gcompris.set_default_background(self.gcomprisBoard.canvas.get_root_item())
def end(self):
Modified: branches/gcomprixogoo/src/pythontest-activity/pythontest.py
==============================================================================
--- branches/gcomprixogoo/src/pythontest-activity/pythontest.py (original)
+++ branches/gcomprixogoo/src/pythontest-activity/pythontest.py Sat Jan 24 20:14:38 2009
@@ -110,8 +110,7 @@
self.colors['line'] = self.config_colors[color_name]
gcompris.bar_set(gcompris.BAR_CONFIG)
- gcompris.set_background(self.gcomprisBoard.canvas.get_root_item(),
- gcompris.skin.image_to_skin("gcompris-bg.jpg"))
+ gcompris.set_default_background(self.gcomprisBoard.canvas.get_root_item())
gcompris.bar_set_level(self.gcomprisBoard)
# Create our rootitem. We put each canvas item in it so at the end we
Modified: branches/gcomprixogoo/src/redraw-activity/redraw.py
==============================================================================
--- branches/gcomprixogoo/src/redraw-activity/redraw.py (original)
+++ branches/gcomprixogoo/src/redraw-activity/redraw.py Sat Jan 24 20:14:38 2009
@@ -100,8 +100,7 @@
self.gcomprisBoard.number_of_sublevel=1
gcompris.bar_set(gcompris.BAR_LEVEL)
- gcompris.set_background(self.gcomprisBoard.canvas.get_root_item(),
- gcompris.skin.image_to_skin("gcompris-bg.jpg"))
+ gcompris.set_default_background(self.gcomprisBoard.canvas.get_root_item())
gcompris.bar_set_level(self.gcomprisBoard)
gcompris.bar_location(4, -1, 0.6)
Modified: branches/gcomprixogoo/src/searace-activity/searace.py
==============================================================================
--- branches/gcomprixogoo/src/searace-activity/searace.py (original)
+++ branches/gcomprixogoo/src/searace-activity/searace.py Sat Jan 24 20:14:38 2009
@@ -107,12 +107,7 @@
# only have to kill it. The canvas deletes all the items it contains automaticaly.
self.rootitem = goocanvas.Group(parent = self.gcomprisBoard.canvas.get_root_item())
- pixmap = gcompris.utils.load_pixmap(gcompris.skin.image_to_skin("gcompris-bg.jpg"))
- item = goocanvas.Image(parent = self.rootitem,
- pixbuf = pixmap,
- x=0,
- y=0,
- )
+ gcompris.set_default_background(self.gcomprisBoard.canvas.get_root_item())
item.connect("button_press_event", self.ruler_item_event)
item.connect("button_release_event", self.ruler_item_event)
item.connect("motion_notify_event", self.ruler_item_event)
Modified: branches/gcomprixogoo/src/sudoku-activity/sudoku.py
==============================================================================
--- branches/gcomprixogoo/src/sudoku-activity/sudoku.py (original)
+++ branches/gcomprixogoo/src/sudoku-activity/sudoku.py Sat Jan 24 20:14:38 2009
@@ -94,8 +94,7 @@
gcompris.bar_set(gcompris.BAR_LEVEL|gcompris.BAR_REPEAT)
- gcompris.set_background(self.gcomprisBoard.canvas.get_root_item(),
- gcompris.skin.image_to_skin("gcompris-bg.jpg"))
+ gcompris.set_default_background(self.gcomprisBoard.canvas.get_root_item())
gcompris.bar_set_level(self.gcomprisBoard)
# Create our rootitem. We put each canvas item in it so at the end we
Modified: branches/gcomprixogoo/src/tuxpaint-activity/tuxpaint.py
==============================================================================
--- branches/gcomprixogoo/src/tuxpaint-activity/tuxpaint.py (original)
+++ branches/gcomprixogoo/src/tuxpaint-activity/tuxpaint.py Sat Jan 24 20:14:38 2009
@@ -128,8 +128,7 @@
gcompris.bar_set(0)
gcompris.bar_hide(1)
- gcompris.set_background(self.gcomprisBoard.canvas.get_root_item(),
- gcompris.skin.image_to_skin("gcompris-bg.jpg"))
+ gcompris.set_default_background(self.gcomprisBoard.canvas.get_root_item())
textItem = goocanvas.Text(
parent = self.rootitem,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]