Remove the workaround for missing gobject-introspection bindings of Rsvg
gobject introspection bindings for librsvg have been pushed to librsvg master [1] in 2.35.0, which solved [2]. We only have slight adopts to make in our usage, for example we can not pass the data property to the default constructor anymore and get_width and get_height is not available anymore for the handle, but we can use the properties instead. The sugar-toolkit-gtk3 and therefore Activities that have been ported to it do need a version of librsvg >= 2.35.0 to be able to work, which ships for example with Fedora 17. Signed-off-by: Simon Schampijer <simon@laptop.org> Acked-by: Daniel Drake <dsd@laptop.org> [1] http://git.gnome.org/browse/librsvg/ [2] https://bugzilla.gnome.org/show_bug.cgi?id=663049 [3] http://developer.gnome.org/rsvg/stable/RsvgHandle.html
This commit is contained in:
@@ -29,14 +29,13 @@ from gi.repository import GObject
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import Gdk
|
||||
from gi.repository import GdkPixbuf
|
||||
from gi.repository import Rsvg
|
||||
import cairo
|
||||
|
||||
from sugar3.graphics import style
|
||||
from sugar3.graphics.xocolor import XoColor
|
||||
from sugar3.util import LRU
|
||||
|
||||
from gi.repository import SugarExt
|
||||
|
||||
_BADGE_SIZE = 0.45
|
||||
|
||||
|
||||
@@ -64,7 +63,7 @@ class _SVGLoader(object):
|
||||
logging.error(
|
||||
'Icon %s, entity %s is invalid.', file_name, entity)
|
||||
|
||||
return SugarExt.RsvgWrapper.new(icon)
|
||||
return Rsvg.Handle.new_from_data(icon)
|
||||
|
||||
|
||||
class _IconInfo(object):
|
||||
@@ -260,8 +259,8 @@ class _IconBuffer(object):
|
||||
|
||||
if is_svg:
|
||||
handle = self._load_svg(icon_info.file_name)
|
||||
icon_width = handle.get_width()
|
||||
icon_height = handle.get_height()
|
||||
icon_width = handle.props.width
|
||||
icon_height = handle.props.height
|
||||
else:
|
||||
pixbuf = GdkPixbuf.Pixbuf.new_from_file(icon_info.file_name)
|
||||
icon_width = pixbuf.get_width()
|
||||
|
||||
Reference in New Issue
Block a user