File: //usr/share/inkscape/extensions/ink2canvas.pyc
�
��Yc @ sy d Z d d l Z d d l m Z d d l j Z e j Z d e j f d � � YZ e
d k ru e � Z e j � n d S( s�
Copyright (C) 2011 Karlisson Bezerra <contact@hacktoon.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
i����N( t Canvast
Ink2Canvasc B sG e Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z RS( c C s t j j | � d | _ d S( N( t inkext Effectt __init__t Nonet canvas( t self( ( s, /usr/share/inkscape/extensions/ink2canvas.pyR s c C s) d d l } | j j | j j � � d S( Ni����( t syst stdoutt writeR t output( R R ( ( s, /usr/share/inkscape/extensions/ink2canvas.pyR s c C s | j j d � d S( Nt }i ( t tagt split( R t node( ( s, /usr/share/inkscape/extensions/ink2canvas.pyt get_tag_name$ s c C s� | j � } | j d | � } | j t j d d � � } | j d | d � } g } x$ | D] } | j | j d � � q^ W| j d � r� t j | | � St j | | � Sd S( Ns
//*[@id='%s']t hreft xlinks //svg:linearGradient[@id='%s']i t stylet r( t get_gradient_hreft xpathSinglet getR t addNSt appendt svgt RadialGradientDeft LinearGradientDef( R t elemt url_idt gradientt url_stopst gstopst colorst stop( ( s, /usr/share/inkscape/extensions/ink2canvas.pyt get_gradient_defs( s
c C s | j � r n d S( N( t has_clip( R R ( ( s, /usr/share/inkscape/extensions/ink2canvas.pyt
get_clip_defs7 s c C s� x� | D]� } | j t j j k r( q n | j | � } | j � } t t | � sX q n d } d } t t | � | | | j
� } | j � r� | j | � } n | j
| � | j � | j | � | j � q Wd S( N( R
R t etreet CommentR t
capitalizet hasattrR R t getattrR t has_gradientR$ t startt drawt walk_treet end( R t rootR R
t
class_nameR t clipR ( ( s, /usr/share/inkscape/extensions/ink2canvas.pyR/ <