8tJc@ sddklZddkZddkZddklZddklZlZl Z l Z l Z ddk l Z ddklZddklZddklZdd klZdd klZddkZdd klZd Zd efdYZdeiefdYZdZdZ dei!e fdYZ"dei#e fdYZ$dei%fdYZ&dei e fdYZ'e$Z#dS(i(tdivisionN(tGcf(t RendererBasetGraphicsContextBasetFigureManagerBasetFigureCanvasBasetNavigationToolbar2(tmaxdict(tFigure(tPath(tMathTextParser(tcolorConverter(t SubplotTool(t_macosxcC stidS(sShow all the figures and enter the Cocoa mainloop. This function will not return until all windows are closed or the interpreter exits.N(R tshow(((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pyRst RendererMaccB seZdZedZdZdZddZddZ dZ dZ dZ ddd Z d Zd Zed Zd ZdZdZdZRS(s The renderer handles drawing/rendering operations. Most of the renderer's methods forwards the command to the renderer's graphics context. The renderer does not wrap a C object and is written in pure Python. i2cC sGti|||_||_||_t|_td|_dS(NtMacOSX( Rt__init__tdpitwidththeighttGraphicsContextMactgcR tmathtext_parser(tselfRRR((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pyR(s      cC s|||_|_dS(N(RR(RRR((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pytset_width_height0scC s4|dj ot|}n|i|||dS(N(tNonettuplet draw_path(RRtpatht transformtrgbFace((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pyR3s cC s:|dj ot|}n|i|||||dS(N(RRt draw_markers(RRt marker_patht marker_transRttransR((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pyR 8s cG s$|i}|d }|i|dS(Ni (Rtdraw_path_collection(RtargsR((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pyR$=s  cG s|i}|i|dS(N(Rtdraw_quad_mesh(RR%R((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pyR&Bs cC s$|ii|iid|iS(N(Rtsavet set_hatchR(R((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pytnew_gcFs c C sR|i|i\}}} |ii||||| ||||idS(N(t flipud_outt as_rgba_strRt draw_image( Rtxtytimtbboxtclippathtclippath_transtnrowstncolstdata((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pyR,Ks %c C s|i}|i}|||i||if} |ii| } | djo9|i|||i} ti d| dti } n|i |||| dS(Ngo@( tget_size_in_pointstget_texmanagerRtget_font_configttexdtgetRtget_greytnumpytarraytuint8t draw_mathtext( RRR-R.tstproptangletsizet texmanagertkeyR/tZ((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pytdraw_texQs   !cC sT|ii||i|\}}} } } } } |i|||d| idS(Ni(RtparseRR?tas_array(RRR-R.R@RARBtoxtoyRRtdescenttimagetused_characters((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pyt_draw_mathtext]s0c C s|o |i||||||nh|i}|i} |i} |i} |i| } |i||t||| | | |dS(N(ROt get_familyt get_weightt get_styleR6tpoints_to_pixelst draw_texttunicode( RRR-R.R@RARBtismathtfamilytweighttstyletpointsRC((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pyRTbs     cC s|djoG|i}|i}|i||d|\}}}|||fS|o>|ii||i|\} } } } } }}| | | fS|i}|i}|i}|i}|i |}|i it |||||\} } } | | d| fS(NtTeXtrendererg( R7R6tget_text_width_height_descentRRHRRPRQRRRSRRU(RR@RARVRDtfontsizetwthtdRJRKRRRLtfontsRNRWRXRYRZRC((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pyR]ms    0    -cC stS(N(tFalse(R((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pytflipyscC s|d|iS(NgR@(R(RRZ((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pyRSscC stS(N(tTrue(R((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pytoption_image_nocompositesN(t__name__t __module__t__doc__RR9RRRRR R$R&R)R,RGRORcRTR]RdRSRf(((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pyRs"            RcB s>eZdZdZedZdZdZdZRS(s4 The GraphicsContext wraps a Quartz graphics context. All methods are implemented at the C-level in macosx.GraphicsContext. These methods set drawing properties such as the line style, fill color, etc. The actual drawing is done by the Renderer, which draws into the GraphicsContext. cC s!ti|tii|dS(N(RRR tGraphicsContext(R((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pyRs cC s:ti||||i}tii||d dS(Ni(Rtset_foregroundtget_rgbR Rj(RtfgtisRGBtrgb((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pyRks cC s'ti||tii||dS(N(Rt set_graylevelR Rj(RRm((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pyRpscC s6ti|||pdStii||idS(N(Rtset_clip_rectangleR Rjtbounds(Rtbox((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pyRqscC s?ti|||pdS|i}tii||dS(N(Rt set_clip_pathtget_fully_transformed_pathR Rj(RR((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pyRts  ( RgRhRiRRcRkRpRqRt(((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pyRs     cC s.ti}|dj o|iindS(sN For performance reasons, we don't want to redraw the figure after each draw command. Instead, we mark the figure as invalid, so that it will be redrawn as soon as the event loop resumes via PyOS_InputHook. This function should be called after each draw event, even if matplotlib is not running interactively. N(Rt get_activeRtcanvast invalidate(t figManager((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pytdraw_if_interactives  cO s@|idt}|||}t|}t||}|S(s. Create a new figure manager instance t FigureClass(tpopRtFigureCanvasMactFigureManagerMac(tnumR%tkwargsR{tfigureRwtmanager((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pytnew_figure_managers  R}cB seZdZeiiZded&s(RRR t FigureManagert matplotlibtrcParamstNavigationToolbarMacRtNavigationToolbar2MacRRRwRtadd_axobserverR(RRwRttitleR((RsH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pyRs  cC s|iidS(N(Rwtdraw(R((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pyR(scC sti|idS(N(RtdestroyR(R((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pytclose+s(RgRhRiRRR(((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pyR~s  RcB sGeZdZdZdZdZdZdZdZRS(cC s||_tiitidd}h}x:d D]2}tii||d }|i|||}d|jo!|id}|| d}n||7}qW|i|idd\}}}} } t|t|}}||| fS(Ntt#s i(topentindexRtsplitRtint( RRR5t imagefiletlinetitmagicRRtmaxcolort imagedata((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pyR@s   !cC sQ|iii}|i}x"|D]}||ii|q"W|iidS(N(RwRtaxesRvtxaxistpanRx(Rt directionRtselectedR((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pytpanxOs  cC sQ|iii}|i}x"|D]}||ii|q"W|iidS(N(RwRRRvtyaxisRRx(RRRRR((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pytpanyVs  cC sQ|iii}|i}x"|D]}||ii|q"W|iidS(N(RwRRRvRtzoomRx(RRRRR((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pytzoomx]s  cC sQ|iii}|i}x"|D]}||ii|q"W|iidS(N(RwRRRvRRRx(RRRRR((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pytzoomyds  cC s5tid}|djodS|ii|dS(NsSave the figure(R tchoose_save_fileRRwt print_figure(RR((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pyt save_figureks ( RgRhRRRRRRR(((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pyR.s      RcB sPeZdZdZdZdZdZdZdZdZ RS(cC sti||dS(N(RR(RRw((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pyRsscC s3tiitidd}tii||dS(NRR(RRRRRR RR(RR((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pyt _init_toolbarvscC s|ii||||dS(N(Rwtset_rubberband(Rteventtx0ty0tx1ty1((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pytdraw_rubberbandzscC s|iidS(N(Rwtremove_rubberband(RR((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pytrelease}scC sti|dS(N(R t set_cursor(Rtcursor((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pyRscC s5tid}|djodS|ii|dS(NsSave the figure(R RRRwR(RR((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pyRs cC sDtdd}t|}|iddt|ii|}|S(Ntfigsizeiittopg?(ii(RR}tsubplots_adjustR RwR(RttoolfigRwttool((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pytprepare_configure_subplotss  cC s tii||iddS(Nsutf-8(R Rt set_messagetencode(RR((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pyRs( RgRhRRRRRRRR(((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pyRqs       ((t __future__RRR<tmatplotlib._pylab_helpersRtmatplotlib.backend_basesRRRRRtmatplotlib.cbookRtmatplotlib.figureRtmatplotlib.pathR tmatplotlib.mathtextR tmatplotlib.colorsR tmatplotlib.widgetsR Rtmatplotlib.backendsR RRRjRRzRRR}RR~RRR(((sH/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_macosx.pyts,  (  k' G C)