σ
 m[c           @` sR  d  Z  d d l m Z m Z m Z m Z d d l Z d d l Z e j d k  r^ d d l	 Z
 n  d d l m Z d d l m Z d d l Td d	 l m Z d
 e j d e j Z d e j f d     YZ d e j e f d     YZ e j d  d e f d     Y Z e j d  d e f d     Y Z e j d e f d     Y Z d S(   u[   
GTK+ Matplotlib interface using cairo (not GDK) drawing operations.
Author: Steve Chaplin
i    (   t   absolute_importt   divisiont   print_functiont   unicode_literalsNi   i   (   t   cbook(   t   backend_cairo(   t   *(   t   _BackendGTKu   PyGTK(%d.%d.%d) u   Pycairo(%s)t   RendererGTKCairoc           B` s,   e  Z e j d k r! d   Z n	 d   Z RS(   i   i   i    c         C` s   | j    |  j _ d  S(   N(   t   cairo_createt   gct   ctx(   t   selft   pixmap(    (    sC   lib/python2.7/site-packages/matplotlib/backends/backend_gtkcairo.pyt
   set_pixmap   s    c         C` s   t  j j |  |  j _ d  S(   N(   t   cairot   gtkt   gdk_cairo_createR
   R   (   R   R   (    (    sC   lib/python2.7/site-packages/matplotlib/backends/backend_gtkcairo.pyR      s    (   i   i   i    (   t   __name__t
   __module__R   t   pygtk_versionR   (    (    (    sC   lib/python2.7/site-packages/matplotlib/backends/backend_gtkcairo.pyR      s   t   FigureCanvasGTKCairoc           B` s<   e  Z e j j   Z e j e j j  d    Z d   Z	 RS(   c         O` s3   t  d d d d d t t |   j | |   d  S(   Nu   2.2t   messageu°   The GTKCairo backend is deprecated. It is untested and will be removed in Matplotlib 3.0. Use the GTK3Cairo backend instead. See Matplotlib usage FAQ for more info on backends.t   alternativeu	   GTK3Cairo(   t   warn_deprecatedt   superR   t   __init__(   R   t   argst   kwargs(    (    sC   lib/python2.7/site-packages/matplotlib/backends/backend_gtkcairo.pyR   $   s    	c         C` s   t  |  j j  |  _ d S(   u0   Override to use cairo (rather than GDK) rendererN(   R   t   figuret   dpit	   _renderer(   R   (    (    sC   lib/python2.7/site-packages/matplotlib/backends/backend_gtkcairo.pyt   _renderer_init.   s    (
   R   R   t   FigureCanvasGTKt	   filetypest   copyt   updateR   t   FigureCanvasCairoR   R    (    (    (    sC   lib/python2.7/site-packages/matplotlib/backends/backend_gtkcairo.pyR       s   	
u   2.1t   FigureManagerGTKCairoc           B` s   e  Z d    Z RS(   c         C` s2   t  j d d k r( t | |  j  } n d  } | S(   Nu   toolbaru   toolbar2(   t
   matplotlibt   rcParamst   NavigationToolbar2GTKCairot   windowt   None(   R   t   canvast   toolbar(    (    sC   lib/python2.7/site-packages/matplotlib/backends/backend_gtkcairo.pyt   _get_toolbar6   s    (   R   R   R.   (    (    (    sC   lib/python2.7/site-packages/matplotlib/backends/backend_gtkcairo.pyR&   4   s   t   NavigationToolbar2Cairoc           B` s   e  Z d    Z RS(   c         C` s
   t  |  S(   N(   R   (   R   t   fig(    (    sC   lib/python2.7/site-packages/matplotlib/backends/backend_gtkcairo.pyt   _get_canvasC   s    (   R   R   R1   (    (    (    sC   lib/python2.7/site-packages/matplotlib/backends/backend_gtkcairo.pyR/   A   s   t   _BackendGTKCairoc           B` s   e  Z e Z e Z RS(    (   R   R   R   t   FigureCanvast   FigureManagerGTKt   FigureManager(    (    (    sC   lib/python2.7/site-packages/matplotlib/backends/backend_gtkcairo.pyR2   G   s   (   i   i   i    (   t   __doc__t
   __future__R    R   R   R   t   sixR   R   t	   cairo.gtkR   R'   R   t   matplotlib.backendsR   t   matplotlib.backends.backend_gtkR   t   backend_versiont   RendererCairoR   R%   R!   R   t
   deprecatedR4   R&   t   NavigationToolbar2GTKR/   t   exportR2   (    (    (    sC   lib/python2.7/site-packages/matplotlib/backends/backend_gtkcairo.pyt   <module>   s&   "

		