gcompris r3667 - in branches/gcomprixogoo: . boards/skins/gartoon src src/administration-activity/admin src/administration-activity/resources/administration src/doubleclick-activity src/gcompris src/penalty-activity src/penalty-activity/resources/penalty
- From: bcoudoin svn gnome org
- To: svn-commits-list gnome org
- Subject: gcompris r3667 - in branches/gcomprixogoo: . boards/skins/gartoon src src/administration-activity/admin src/administration-activity/resources/administration src/doubleclick-activity src/gcompris src/penalty-activity src/penalty-activity/resources/penalty
- Date: Sun, 11 Jan 2009 19:43:33 +0000 (UTC)
Author: bcoudoin
Date: Sun Jan 11 19:43:32 2009
New Revision: 3667
URL: http://svn.gnome.org/viewvc/gcompris?rev=3667&view=rev
Log:
Added support for detecting and loading .svg and .svgz files through rsvg
in our internal gc_pixmap_load() method.
More work towards full svg skin
Added:
branches/gcomprixogoo/src/administration-activity/resources/administration/config_boards.svgz (contents, props changed)
branches/gcomprixogoo/src/administration-activity/resources/administration/config_groups.svgz (contents, props changed)
branches/gcomprixogoo/src/administration-activity/resources/administration/config_profiles.svgz (contents, props changed)
branches/gcomprixogoo/src/administration-activity/resources/administration/config_reports.svgz (contents, props changed)
branches/gcomprixogoo/src/administration-activity/resources/administration/config_users.svgz (contents, props changed)
Removed:
branches/gcomprixogoo/boards/skins/gartoon/config_boards.png
branches/gcomprixogoo/boards/skins/gartoon/config_groups.png
branches/gcomprixogoo/boards/skins/gartoon/config_profiles.png
branches/gcomprixogoo/boards/skins/gartoon/config_reports.png
branches/gcomprixogoo/boards/skins/gartoon/config_users.png
branches/gcomprixogoo/src/administration-activity/resources/administration/tuxplane.png
branches/gcomprixogoo/src/doubleclick-activity/
Modified:
branches/gcomprixogoo/ChangeLog
branches/gcomprixogoo/configure.in
branches/gcomprixogoo/src/Makefile.am
branches/gcomprixogoo/src/administration-activity/admin/board_list.py
branches/gcomprixogoo/src/administration-activity/admin/module.py
branches/gcomprixogoo/src/administration-activity/resources/administration/Makefile.am
branches/gcomprixogoo/src/gcompris/gc_net.c
branches/gcomprixogoo/src/penalty-activity/penalty.xml.in
branches/gcomprixogoo/src/penalty-activity/resources/penalty/Makefile.am
Modified: branches/gcomprixogoo/configure.in
==============================================================================
--- branches/gcomprixogoo/configure.in (original)
+++ branches/gcomprixogoo/configure.in Sun Jan 11 19:43:32 2009
@@ -617,9 +617,6 @@
src/crane-activity/Makefile
src/crane-activity/resources/Makefile
src/crane-activity/resources/crane/Makefile
-src/doubleclick-activity/Makefile
-src/doubleclick-activity/resources/Makefile
-src/doubleclick-activity/resources/doubleclick/Makefile
src/doubleentry-activity/Makefile
src/doubleentry-activity/resources/Makefile
src/doubleentry-activity/resources/doubleentry/Makefile
Modified: branches/gcomprixogoo/src/Makefile.am
==============================================================================
--- branches/gcomprixogoo/src/Makefile.am (original)
+++ branches/gcomprixogoo/src/Makefile.am Sun Jan 11 19:43:32 2009
@@ -21,7 +21,6 @@
colors-activity \
crane-activity \
doubleentry-activity \
- doubleclick-activity \
enumerate-activity \
erase-activity \
erase_clic-activity \
Modified: branches/gcomprixogoo/src/administration-activity/admin/board_list.py
==============================================================================
--- branches/gcomprixogoo/src/administration-activity/admin/board_list.py (original)
+++ branches/gcomprixogoo/src/administration-activity/admin/board_list.py Sun Jan 11 19:43:32 2009
@@ -229,7 +229,7 @@
if board_cell[0] == None:
row_dict[''] = \
model.append(None,
- [self.pixbuf_admin_at_height('administration/tuxplane.png', height),
+ [self.pixbuf_admin_at_height('administration/tuxplane.svg', height),
_('Main menu') + '\n' + '/',
not board_cell[1].board_id in self.out_dict[self.active_profile.profile_id],
'%s/%s' % (board_cell[1].section,board_cell[1].name), self.pixbuf_configurable(board_cell[1])])
Modified: branches/gcomprixogoo/src/administration-activity/admin/module.py
==============================================================================
--- branches/gcomprixogoo/src/administration-activity/admin/module.py (original)
+++ branches/gcomprixogoo/src/administration-activity/admin/module.py Sun Jan 11 19:43:32 2009
@@ -45,7 +45,7 @@
return 999
def init(self, index, select_area, callback):
- height = 80
+ height = 90
x = select_area[0] + (select_area[2] - select_area[0]) / 2
y1 = select_area[1] + height * index + 2
y2 = select_area[1] + height * (index + 1) + 1
@@ -72,9 +72,9 @@
y1 += 5
itemimg = goocanvas.Image(
parent = self.root_select_item,
- pixbuf = gcompris.utils.load_pixmap(gcompris.skin.image_to_skin("config_" +
- self.module_name +
- ".png")),
+ pixbuf = gcompris.utils.load_pixmap("administration/config_" +
+ self.module_name +
+ ".svgz"),
x = x,
y = y1,
)
@@ -84,7 +84,7 @@
itemimg.connect("button_press_event", callback, self)
gcompris.utils.item_focus_init(itemimg, None)
- y1 += bounds.y2 - bounds.y1
+ y1 += bounds.y2 - bounds.y1 + 3
item = goocanvas.Text(
parent = self.root_select_item,
Modified: branches/gcomprixogoo/src/administration-activity/resources/administration/Makefile.am
==============================================================================
--- branches/gcomprixogoo/src/administration-activity/resources/administration/Makefile.am (original)
+++ branches/gcomprixogoo/src/administration-activity/resources/administration/Makefile.am Sun Jan 11 19:43:32 2009
@@ -1,6 +1,11 @@
imgdir = $(pkgdatadir)/@PACKAGE_DATA_DIR@/administration
img_DATA = \
- tuxplane.png
+ tuxplane.svg \
+ config_boards.svgz \
+ config_groups.svgz \
+ config_profiles.svgz \
+ config_reports.svgz \
+ config_users.svgz
EXTRA_DIST = $(img_DATA) ${xml_in_files}
CLEANFILES = $(xml_DATA)
Added: branches/gcomprixogoo/src/administration-activity/resources/administration/config_boards.svgz
==============================================================================
Binary file. No diff available.
Added: branches/gcomprixogoo/src/administration-activity/resources/administration/config_groups.svgz
==============================================================================
Binary file. No diff available.
Added: branches/gcomprixogoo/src/administration-activity/resources/administration/config_profiles.svgz
==============================================================================
Binary file. No diff available.
Added: branches/gcomprixogoo/src/administration-activity/resources/administration/config_reports.svgz
==============================================================================
Binary file. No diff available.
Added: branches/gcomprixogoo/src/administration-activity/resources/administration/config_users.svgz
==============================================================================
Binary file. No diff available.
Modified: branches/gcomprixogoo/src/gcompris/gc_net.c
==============================================================================
--- branches/gcomprixogoo/src/gcompris/gc_net.c (original)
+++ branches/gcomprixogoo/src/gcompris/gc_net.c Sun Jan 11 19:43:32 2009
@@ -1,4 +1,4 @@
-/* gcompris - gameutil_net.c
+/* gcompris - gc_net.c
*
* Copyright (C) 2006 Bruno Coudoin
*
@@ -18,15 +18,30 @@
#include "gc_net.h"
#include "gc_core.h"
+#include <string.h>
+
+static gboolean
+path_represents_svg_image (const char *path)
+{
+ /* Synchronous mime sniffing is a really bad idea here
+ * since it's only useful for people adding custom icons,
+ * and if they're doing that, they can behave themselves
+ * and use a .svg extension.
+ */
+ return path != NULL && (strstr (path, ".svg") != NULL || strstr (path, ".svgz") != NULL);
+}
/** Load a pixmap localy
*
* \param pixmapfile : a full path to the file to load as an image
* \return a GdkPixbuf or NULL
*/
-GdkPixbuf *gc_net_load_pixmap(const char *url)
+GdkPixbuf *gc_net_load_pixmap(const char *file)
{
- return(gdk_pixbuf_new_from_file (url, NULL));
+ if (path_represents_svg_image (file))
+ return(rsvg_pixbuf_from_file (file, NULL));
+ else
+ return(gdk_pixbuf_new_from_file (file, NULL));
}
/** Load an xml file from the network
Modified: branches/gcomprixogoo/src/penalty-activity/penalty.xml.in
==============================================================================
--- branches/gcomprixogoo/src/penalty-activity/penalty.xml.in (original)
+++ branches/gcomprixogoo/src/penalty-activity/penalty.xml.in Sun Jan 11 19:43:32 2009
@@ -4,7 +4,7 @@
name="penalty"
type="python:penalty"
section="/computer/mouse"
- icon="boardicons/penalty.svg"
+ icon="penalty.svg"
difficulty="2"
author="Bruno Coudoin (bruno coudoin free fr)"
boarddir="">
Modified: branches/gcomprixogoo/src/penalty-activity/resources/penalty/Makefile.am
==============================================================================
--- branches/gcomprixogoo/src/penalty-activity/resources/penalty/Makefile.am (original)
+++ branches/gcomprixogoo/src/penalty-activity/resources/penalty/Makefile.am Sun Jan 11 19:43:32 2009
@@ -1,4 +1,4 @@
-imgdir = $(pkgdatadir)/@PACKAGE_DATA_DIR@/ballcatch
+imgdir = $(pkgdatadir)/@PACKAGE_DATA_DIR@/penalty
img_DATA = \
penalty_bg.svgz
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]