
    cc4                     R    d dl Z d dlZd dlmZmZ ddlmZ d
dZd
dZd Z	d Z
d	 Zy)    N)Gdk	GdkPixbuf   )NoSelectionPathExceptionc                    |
t               | j                          | j                  t        j                  j
                         | j                  |       | j                  |dz  |dz  g       | j                  |       | j                  dddd       | j                          | j                  dddd       | j                          y)z5Draw a blueish area on `ccontext`, for the selection.N   g?g333333?g?      ?)r   new_pathset_antialiascairo	AntialiasNONEset_line_widthset_dashappend_pathset_source_rgbafill_preservestroke)ccontextcpath	thicknesss      ;/usr/lib/python3/dist-packages/drawing/utilities_overlay.py!utilities_show_overlay_on_contextr   
   s    	M ""		,,-	#	IM9q=12	e	#sC-		#sC-	    c                 4   t        ||z
  ||z
  |      }d}|d|z  k  r| j                  |       n1|d|z  k  r| j                  d|z         n| j                  d|z         t        | |||d       t        | |||d       t        | |||d       t        | |||d	       |rTt        | ||z   dz  ||d
       t        | |||z   dz  |d       t        | ||z   dz  ||d       t        | |||z   dz  |d       | j                  ||       | j	                  ||       | j	                  ||       | j	                  ||       | j                          | j                  |       | j                  d|z  d|z  g       | j                  dddd       | j                          y)zRequest the drawing of handles for a rectangle pixbuf having the provided
	coords. Handles are only decorative objects drawn on the surface to help the
	user understand the rationale of tools without relying on the mouse cursor.T         r   nwneseswneswr	   N)	_get_radiusr   _draw_arc_handlemove_toline_to
close_pathr   r   r   )cairo_contextx1x2y1y2r   radiuslateral_handless           r   !utilities_show_handles_on_contextr3      s    rBw"r'I
6
Q]y)q9}q9}-q9}--R6-R6-R6-R6=2b5!)R=="r"uai==2b5!)R=="r"uai=r2r2r2r2i(YI67sCc2r   c                 B   |dk(  r'dt         j                  z  }dt         j                  z  }n|dk(  rt         j                  }d}n|dk(  r$t         j                  }dt         j                  z  }n|dk(  r'dt         j                  z  }dt         j                  z  }n|d	k(  r$dt         j                  z  }t         j                  }n^|d
k(  rd}t         j                  }nF|dk(  rd}dt         j                  z  }n+|dk(  r&dt         j                  z  }dt         j                  z  }| j                  ||       | j                  |||       | j	                          | j                  dddd       | j                          | j                  dddd       | j                          y)zDraw a moon-like shape with the given orientation and radius. The coords
	are the center of the shape. The orientation is an enumeration provided as a
	string with the stupid n/nw/w/sw/s/se/e/ne format.r   r	   g       @r#           r    r$   g      r!   r%   r"   r&         ?N)mathpir)   arcr+   r   r   r   )r,   xyr1   orientationangle_1angle_2s          r   r(   r(   =   s^    4$''M'$''M'SGG''TGG'$''M'S477N'$''M'T477N'GG'S'GG'T'477N'S$''M'477N'q!1a'2sCc2sCc2r   c                 0    t        | dz  |dz  d|z  g      S )N      )min)dxdyr   s      r   r'   r'   b   s     RT2a4i())r   c                    | j                  dddd       | j                  g        t        dt        d|z              }| j	                  |       | j                  ||z   d       | j                  d||z          | j                  d||z          | j                          | j                  dddd       | j                  d|z  d|z  g       | j                          y )Nr5   r6   r   r   r   )
r   r   maxintr   r)   rel_line_tor*   stroke_preserver   )r,   
zoom_levelr&   hsizes        r    utilities_generic_canvas_outlinerM   h   s    sCc2As1z>"#d#q4x#1a$h'q!d(# sCc2T1t8,-r   )r   )r   r7   gi.repositoryr   r   selection_managerr   r   r3   r(   r'   rM    r   r   <module>rQ      s+     ( 7
" D#J*r   