gcompris r3683 - in branches/gcomprixogoo: boards/skins/babytoy boards/skins/gartoon src/bargame-activity src/boards src/guessnumber-activity src/login-activity src/redraw-activity src/reversecount-activity src/searace-activity
- From: bcoudoin svn gnome org
- To: svn-commits-list gnome org
- Subject: gcompris r3683 - in branches/gcomprixogoo: boards/skins/babytoy boards/skins/gartoon src/bargame-activity src/boards src/guessnumber-activity src/login-activity src/redraw-activity src/reversecount-activity src/searace-activity
- Date: Sat, 17 Jan 2009 21:47:28 +0000 (UTC)
Author: bcoudoin
Date: Sat Jan 17 21:47:28 2009
New Revision: 3683
URL: http://svn.gnome.org/viewvc/gcompris?rev=3683&view=rev
Log:
ok button is now in skin.svg
Removed:
branches/gcomprixogoo/boards/skins/babytoy/ok.png
branches/gcomprixogoo/boards/skins/gartoon/ok.png
Modified:
branches/gcomprixogoo/src/bargame-activity/bargame.py
branches/gcomprixogoo/src/boards/py-mod-skin.c
branches/gcomprixogoo/src/boards/py-mod-utils.c
branches/gcomprixogoo/src/guessnumber-activity/guessnumber.py
branches/gcomprixogoo/src/login-activity/login.py
branches/gcomprixogoo/src/redraw-activity/redraw.py
branches/gcomprixogoo/src/reversecount-activity/reversecount.c
branches/gcomprixogoo/src/searace-activity/searace.py
Modified: branches/gcomprixogoo/src/bargame-activity/bargame.py
==============================================================================
--- branches/gcomprixogoo/src/bargame-activity/bargame.py (original)
+++ branches/gcomprixogoo/src/bargame-activity/bargame.py Sat Jan 17 21:47:28 2009
@@ -247,12 +247,15 @@
self.answer.set_number_of_balls(self.number_balls[self.gcomprisBoard.sublevel-1])
# The OK Button
- pixmap = gcompris.utils.load_pixmap(gcompris.skin.image_to_skin("ok.png"))
- item = goocanvas.Image(parent = self.rootitem,
- pixbuf = pixmap,
- x = gcompris.BOARD_WIDTH - pixmap.get_width() - 10,
- y = gcompris.BOARD_HEIGHT - 210
- )
+ item = goocanvas.Svg(parent = self.rootitem,
+ svg_handle = gcompris.skin.svg_get(),
+ svg_id = "#OK"
+ )
+ item.translate(item.get_bounds().x1 * -1
+ + gcompris.BOARD_WIDTH - (item.get_bounds().x2 - item.get_bounds().x1) - 10,
+ item.get_bounds().y1 * -1
+ + gcompris.BOARD_HEIGHT - 230)
+
item.connect("button_press_event", self.ok_event)
gcompris.utils.item_focus_init(item, None)
Modified: branches/gcomprixogoo/src/boards/py-mod-skin.c
==============================================================================
--- branches/gcomprixogoo/src/boards/py-mod-skin.c (original)
+++ branches/gcomprixogoo/src/boards/py-mod-skin.c Sat Jan 17 21:47:28 2009
@@ -75,6 +75,29 @@
}
+/* GdkPixbuf *gc_skin_rsvg_get(); */
+static PyObject*
+py_gc_skin_rsvg_get(PyObject* self, PyObject* args)
+{
+ RsvgHandle* result;
+ PyObject* pyresult;
+
+ /* Parse arguments */
+ if(!PyArg_ParseTuple(args, ":gc_skin_rsvg_get"))
+ return NULL;
+
+ /* Call the corresponding C function */
+ result = gc_skin_rsvg_get();
+
+ /* Create and return the result */
+ pyresult = (PyObject*) pygobject_new((GObject*) result);
+
+ g_object_unref(result);
+
+ return(pyresult);
+}
+
+
/* guint32 gc_skin_get_color_default(gchar* id, guint32 def); */
static PyObject*
py_gc_skin_get_color_default(PyObject* self, PyObject* args)
@@ -156,6 +179,7 @@
static PyMethodDef PythonGcomprisSkinModule[] = {
{ "image_to_skin", py_gc_skin_image_get, METH_VARARGS, "gc_skin_image_get" },
{ "load_pixmap", py_gc_skin_pixmap_load, METH_VARARGS, "gc_skin_pixmap_load" },
+ { "svg_get", py_gc_skin_rsvg_get, METH_VARARGS, "gc_skin_rsvg_get" },
{ "get_color_default", py_gc_skin_get_color_default, METH_VARARGS,
"gc_skin_get_color_default" },
{ "get_font_default", py_gc_skin_get_font_default, METH_VARARGS,
Modified: branches/gcomprixogoo/src/boards/py-mod-utils.c
==============================================================================
--- branches/gcomprixogoo/src/boards/py-mod-utils.c (original)
+++ branches/gcomprixogoo/src/boards/py-mod-utils.c Sat Jan 17 21:47:28 2009
@@ -418,7 +418,7 @@
static PyMethodDef PythonGcomprisUtilsModule[] = {
{ "load_pixmap", py_gc_pixmap_load, METH_VARARGS, "gc_pixmap_load" },
- { "load_svg", py_gc_svg_load, METH_VARARGS, "gc_svg_load" },
+ { "load_svg", py_gc_svg_load, METH_VARARGS, "gc_rsvg_load" },
{ "find_file_absolute", py_gc_file_find_absolute, METH_VARARGS, "gc_file_find_absolute" },
{ "item_focus_init", py_gc_item_focus_init, METH_VARARGS, "gc_item_focus_init" },
{ "item_focus_remove", py_gc_item_focus_remove, METH_VARARGS, "gc_item_focus_remove" },
Modified: branches/gcomprixogoo/src/guessnumber-activity/guessnumber.py
==============================================================================
--- branches/gcomprixogoo/src/guessnumber-activity/guessnumber.py (original)
+++ branches/gcomprixogoo/src/guessnumber-activity/guessnumber.py Sat Jan 17 21:47:28 2009
@@ -237,12 +237,15 @@
)
# The OK Button
- pixmap = gcompris.utils.load_pixmap(gcompris.skin.image_to_skin("ok.png"))
- item = goocanvas.Image(parent = self.rootitem,
- pixbuf = pixmap,
- x = gcompris.BOARD_WIDTH - pixmap.get_width() - 30,
- y = 65
- )
+ item = goocanvas.Svg(parent = self.rootitem,
+ svg_handle = gcompris.skin.svg_get(),
+ svg_id = "#OK"
+ )
+ item.translate(item.get_bounds().x1 * -1
+ + gcompris.BOARD_WIDTH - (item.get_bounds().x2 - item.get_bounds().x1) - 30,
+ item.get_bounds().y1 * -1
+ + 65)
+
item.connect("button_press_event", self.ok_event, text_item)
gcompris.utils.item_focus_init(item, None)
Modified: branches/gcomprixogoo/src/login-activity/login.py
==============================================================================
--- branches/gcomprixogoo/src/login-activity/login.py (original)
+++ branches/gcomprixogoo/src/login-activity/login.py Sat Jan 17 21:47:28 2009
@@ -255,7 +255,6 @@
current_line = 0
max_letter_by_line = (gcompris.BOARD_WIDTH-start_x*2)/step_x
letter_by_line = max_letter_by_line
- button_pixbuf = gcompris.utils.load_pixmap(gcompris.skin.image_to_skin("ok.png"))
for letter in letters:
@@ -265,12 +264,15 @@
else:
text = letter.upper() + letter.lower()
- item = goocanvas.Image(
- parent = self.letter_rootitem,
- pixbuf = button_pixbuf,
- x = x - button_pixbuf.get_width()/2,
- y = y - button_pixbuf.get_height()/2,
- )
+ item = goocanvas.Svg(parent = self.rootitem,
+ svg_handle = gcompris.skin.svg_get(),
+ svg_id = "#OK"
+ )
+ item.translate(item.get_bounds().x1 * -1
+ + x - (item.get_bounds().x2 - item.get_bounds().x1) / 2,
+ item.get_bounds().y1 * -1
+ + y - (item.get_bounds().y2 - item.get_bounds().y1) / 2)
+
# This item is clickeable and it must be seen
gcompris.utils.item_focus_init(item, None)
item.connect("button_press_event", self.letter_click_event,
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 17 21:47:28 2009
@@ -43,14 +43,14 @@
# TOOL SELECTION
self.tools = [
- ["RECT", "draw/tool-rectangle.png", "draw/tool-rectangle_on.png", gcompris.CURSOR_RECT],
- ["FILL_RECT", "draw/tool-filledrectangle.png", "draw/tool-filledrectangle_on.png", gcompris.CURSOR_FILLRECT],
- ["CIRCLE", "draw/tool-circle.png", "draw/tool-circle_on.png", gcompris.CURSOR_CIRCLE],
- ["FILL_CIRCLE", "draw/tool-filledcircle.png", "draw/tool-filledcircle_on.png", gcompris.CURSOR_FILLCIRCLE],
- ["LINE", "draw/tool-line.png", "draw/tool-line_on.png", gcompris.CURSOR_LINE],
- ["DEL", "draw/tool-del.png", "draw/tool-del_on.png", gcompris.CURSOR_DEL],
- ["FILL", "draw/tool-fill.png", "draw/tool-fill_on.png", gcompris.CURSOR_FILL],
- ["SELECT", "draw/tool-select.png", "draw/tool-select_on.png", gcompris.CURSOR_SELECT]
+ ["RECT", "anim/tool-rectangle.png", "anim/tool-rectangle_on.png", gcompris.CURSOR_RECT],
+ ["FILL_RECT", "anim/tool-filledrectangle.png", "anim/tool-filledrectangle_on.png", gcompris.CURSOR_FILLRECT],
+ ["CIRCLE", "anim/tool-circle.png", "anim/tool-circle_on.png", gcompris.CURSOR_CIRCLE],
+ ["FILL_CIRCLE", "anim/tool-filledcircle.png", "anim/tool-filledcircle_on.png", gcompris.CURSOR_FILLCIRCLE],
+ ["LINE", "anim/tool-line.png", "anim/tool-line_on.png", gcompris.CURSOR_LINE],
+ ["DEL", "anim/tool-del.png", "anim/tool-del_on.png", gcompris.CURSOR_DEL],
+ ["FILL", "anim/tool-fill.png", "anim/tool-fill_on.png", gcompris.CURSOR_FILL],
+ ["SELECT", "anim/tool-select.png", "anim/tool-select_on.png", gcompris.CURSOR_SELECT]
]
self.current_tool=0
@@ -340,7 +340,7 @@
goocanvas.Image(
parent = self.rootitem,
- pixbuf = gcompris.utils.load_pixmap(gcompris.skin.image_to_skin("draw/tool-selector.png")),
+ pixbuf = gcompris.utils.load_pixmap("anim/tool-selector.png"),
x=5,
y=5.0,
width=30.0
@@ -360,7 +360,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 = theX,
y = y
)
@@ -371,16 +371,19 @@
# The last item is select, we select it 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]);
# The OK Button
- pixmap = gcompris.utils.load_pixmap(gcompris.skin.image_to_skin("ok.png"))
- item = goocanvas.Image(parent = self.rootitem,
- pixbuf = pixmap,
- x = 20,
- y = gcompris.BOARD_HEIGHT - 100
- )
+ item = goocanvas.Svg(parent = self.rootitem,
+ svg_handle = gcompris.skin.svg_get(),
+ svg_id = "#OK"
+ )
+ item.translate(item.get_bounds().x1 * -1
+ + 20,
+ item.get_bounds().y1 * -1
+ + gcompris.BOARD_HEIGHT - 100)
+
item.connect("button_press_event", self.ok_event)
gcompris.utils.item_focus_init(item, None)
Modified: branches/gcomprixogoo/src/reversecount-activity/reversecount.c
==============================================================================
--- branches/gcomprixogoo/src/reversecount-activity/reversecount.c (original)
+++ branches/gcomprixogoo/src/reversecount-activity/reversecount.c Sat Jan 17 21:47:28 2009
@@ -534,18 +534,16 @@
g_object_unref(svg_handle);
// OK Button (Validation)
- GdkPixbuf *pixmap = NULL;
- pixmap = gc_skin_pixmap_load("ok.png");
- item = goo_canvas_image_new (boardRootItem,
- pixmap,
- dice_area_x -
- gdk_pixbuf_get_width(pixmap) - 15,
- block_height + 20,
- NULL);
+ item = goo_canvas_svg_new (boardRootItem,
+ gc_skin_rsvg_get(),
+ "svg-id", "#OK",
+ NULL);
+ SET_ITEM_LOCATION(item,
+ dice_area_x - 60,
+ block_height + 20);
g_signal_connect(item, "button_press_event",
(GtkSignalFunc) process_ok, NULL);
gc_item_focus_init(item, NULL);
- gdk_pixbuf_unref(pixmap);
// Tux
tuxRootItem = goo_canvas_group_new (boardRootItem, NULL);
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 17 21:47:28 2009
@@ -131,14 +131,16 @@
# The OK Button
- pixmap = gcompris.utils.load_pixmap(gcompris.skin.image_to_skin("ok.png"))
- item = goocanvas.Image(parent = self.rootitem,
- pixbuf = pixmap,
- )
+ item = goocanvas.Svg(parent = self.rootitem,
+ svg_handle = gcompris.skin.svg_get(),
+ svg_id = "#OK"
+ )
zoom = 0.7
+ item.translate( (item.get_bounds().x1 * -1)
+ + ( gcompris.BOARD_WIDTH / 2 + 25 ) / zoom,
+ (item.get_bounds().y1 * -1)
+ + (gcompris.BOARD_HEIGHT - 125) / zoom )
item.scale(zoom, zoom)
- item.set_properties(x = (gcompris.BOARD_WIDTH / 2 + 40) / zoom,
- y = (gcompris.BOARD_HEIGHT - 90) / zoom)
item.connect("button_press_event", self.ok_event)
gcompris.utils.item_focus_init(item, None)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]