
    BPc                         d dl Z d dlmZ g dZ G d de j                  Zedk    r e                                             dS dS )    N)inkex_gettext)markerzmarker-startz
marker-midz
marker-endc                   *    e Zd ZdZd Zd Zd Zd ZdS )MarkersStrokePaintz9Add marker stroke to outline markers on selected objects.c                    |                     dt          j        dd           |                     dddd	           |                     d
t          j        ddd           |                     dt          j        dd           |                     dt          j        dd           |                     dt          j        t          j        d          d           |                     dt          j        dd           |                     dt          j        t          j        d          d           |                     d|                     d          | j        d           |                     dd           d S )Nz--modifyFz(Do not create a copy, modify the markers)typedefaulthelpz--type	fill_typesolidz>Replace the markers' fill with the object stroke or fill color)destr	   r
   z--alphaassign_alphaTz6Assign the object fill and stroke alpha to the markers)r   r   r	   r
   z--invertzInvert fill and stroke colorsz--assign_fillz"Assign a fill color to the markersz--fill_coloriQQzChoose a custom fill colorz--assign_strokez$Assign a stroke color to the markersz--stroke_colorz--tabmethodz'The selected UI-tab when OK was pressedz
--colortabz1The selected custom color tab when OK was pressed)r
   )add_argumentinkexBooleanColor
arg_methodmethod_custom)selfparss     5/usr/share/inkscape/extensions/markers_strokepaint.pyadd_argumentsz MarkersStrokePaint.add_arguments    s   ;	 	 	
 	
 	
 	Q	 	 	
 	
 	
 	I 	 	
 	
 	
 	0	 	 	
 	
 	
 	5	 	 	
 	
 	
 	K
++-	 	 	
 	
 	
 	7	 	 	
 	
 	
 	K
++-	 	 	
 	
 	
 	**&:	 	 	
 	
 	
 	R 	 	
 	
 	
 	
 	
    c                 r    | j         j        r| j         j        nd}| j         j        r| j         j        nd}||fS )zChoose custom colorsN)optionsassign_fill
fill_colorassign_strokestroke_color)r   _fillstrokes       r   r   z MarkersStrokePaint.method_custom\   s>    *.,*BLt|&&.2l.HR**dV|r   c                 2   |                     d          }|                     d          }| j        j        dk    r|}n#| j        j        dk    rd}n| j        j        r||}}| j        j        s(|                                }|                                }||fS )zUse object colorsr"   r#   r   filledN)	get_colorr   r   invertr   to_rgb)r   styler"   r#   s       r   method_objectz MarkersStrokePaint.method_objectb   s    v&&**<!W,,DD\#x//FF\  	(!4&D|( 	%;;==D]]__FV|r   c                 B   | j         j                                        D ]~}| j                            |j                  \  }}t          D ]P}|                    |          }t          |t          j	                  s3|9||j        v r0t          j
        t          d          |j        |         z             n|                                }| j        j        sM|                                }| j         j                            |           | j                             |          }|                    d|           |                    d|           ||j        |<   |D ]<}||j                            |d           ||j                            |d           =Rd S )Nzunable to locate marker: %sidzinkscape:stockidr#   r"   )svg	selectionvaluesr   tabr)   MARKERS
isinstancer   Markererrormsgr!   get_idmodifycopydefsappendget_unique_idset	set_color)r   noder"   r#   attrmarker_node	marker_idchilds           r   effectzMarkersStrokePaint.effectu   s   H&--// 	< 	<D<++DJ77LD& < <"jj..!+u|<< &44:+=+=N1%B#C#CdjQUFV#VWWW'..00	|* B"-"2"2"4"4KHM((555 $ 6 6y A AIi000 2I>>>#.
4 ( < <E)--fh???'--dF;;;	<)<	< 	<r   N)__name__
__module____qualname____doc__r   r   r*   rB    r   r   r   r      sW        CC:
 :
 :
x    &< < < < <r   r   __main__)	r   inkex.localizationr   r!   r1   EffectExtensionr   rC   runrG   r   r   <module>rL      s   .  1 1 1 1 1 1
@
@
@t< t< t< t< t<. t< t< t<n z r   