HEX
Server: LiteSpeed
System: Linux standart9.isimtescil.net 3.10.0-962.3.2.lve1.5.26.7.el7.x86_64 #1 SMP Wed Oct 2 07:53:12 EDT 2019 x86_64
User: karalev (5310)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends/backend_template.pyc
�
`�3Lc@ s�dZddlmZddlZddlmZddlmZmZm	Z	m
Z
ddlmZddl
mZdefd	��YZd
efd��YZd�Zd
�Zd�Zde
fd��YZde	fd��YZeZdS(s�
This is a fully functional do nothing backend to provide a template to
backend writers.  It is fully functional in that you can select it as
a backend with

  import matplotlib
  matplotlib.use('Template')

and your matplotlib scripts will (should!) run without error, though
no output is produced.  This provides a nice starting point for
backend writers because you can selectively implement methods
(draw_rectangle, draw_lines, etc...) and slowly see your figure come
to life w/o having to have a full blown implementation before getting
any results.

Copy this to backend_xxx.py and replace all instances of 'template'
with 'xxx'.  Then implement the class methods and functions below, and
add 'xxx' to the switchyard in matplotlib/backends/__init__.py and
'xxx' to the backends list in the validate_backend methon in
matplotlib/__init__.py and you're off.  You can use your backend with::

  import matplotlib
  matplotlib.use('xxx')
  from pylab import *
  plot([1,2,3])
  show()

matplotlib also supports external backends, so you can place you can
use any module in your PYTHONPATH with the syntax::

  import matplotlib
  matplotlib.use('module://my_backend')

where my_backend.py is your module name.  Thus syntax is also
recognized in the rc file and in the -d argument in pylab, eg::

  python simple_plot.py -dmodule://my_backend

The files that are most relevant to backend_writers are

  matplotlib/backends/backend_your_backend.py
  matplotlib/backend_bases.py
  matplotlib/backends/__init__.py
  matplotlib/__init__.py
  matplotlib/_pylab_helpers.py

Naming Conventions

  * classes Upper or MixedUpperCase

  * varables lower or lowerUpper

  * functions lower or underscore_separated

i����(tdivisionN(tGcf(tRendererBasetGraphicsContextBasetFigureManagerBasetFigureCanvasBase(tFigure(tBboxtRendererTemplatecB seeZdZd�Zd
d�Zd�Zed�Zd�Z	d�Z
d�Zd�Zd	�Z
RS(s�
    The renderer handles drawing/rendering operations.

    This is a minimal do-nothing class that can be used to get started when
    writing a new backend. Refer to backend_bases.RendererBase for
    documentation of the classes methods.
    cC s
||_dS(N(tdpi(tselfR	((sW/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends/backend_template.pyt__init__KscC sdS(N((R
tgctpatht	transformtrgbFace((sW/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends/backend_template.pyt	draw_pathNscC sdS(N((R
Rtxtytim((sW/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends/backend_template.pyt
draw_imagehscC sdS(N((R
RRRtstproptangletismath((sW/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends/backend_template.pyt	draw_textkscC stS(N(tTrue(R
((sW/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends/backend_template.pytflipynscC sdS(Nid(idid((R
((sW/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends/backend_template.pytget_canvas_width_heightqscC sdS(Ni(iii((R
RRR((sW/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends/backend_template.pytget_text_width_height_descenttscC st�S(N(tGraphicsContextTemplate(R
((sW/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends/backend_template.pytnew_gcwscC s|S(N((R
tpoints((sW/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends/backend_template.pytpoints_to_pixelszsN(t__name__t
__module__t__doc__RtNoneRRtFalseRRRRRR!(((sW/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends/backend_template.pyRCs						RcB seZdZRS(s�
    The graphics context provides the color, line styles, etc...  See the gtk
    and postscript backends for examples of mapping the graphics context
    attributes (cap styles, join styles, line widths, colors) to a particular
    backend.  In GTK this is done by wrapping a gtk.gdk.GC object and
    forwarding the appropriate calls to it using a dictionary mapping styles
    to gdk constants.  In Postscript, all the work is done by the renderer,
    mapping line styles to postscript calls.

    If it's more appropriate to do the mapping at the renderer level (as in
    the postscript backend), you don't need to override any of the GC methods.
    If it's more appropriate to wrap an instance (as in the GTK backend) and
    do the mapping here, you'll need to override several of the setter
    methods.

    The base GraphicsContext stores colors as a RGB tuple on the unit
    interval, eg, (0.5, 0.0, 1.0). You may need to map this to colors
    appropriate for your backend.
    (R"R#R$(((sW/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends/backend_template.pyR�scC sdS(s�
    For image backends - is not required
    For GUI backends - this should be overriden if drawing should be done in
    interactive python mode
    N((((sW/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends/backend_template.pytdraw_if_interactive�scC sxtj�D]}q
WdS(s:
    For image backends - is not required
    For GUI backends - show() is usually the last line of a pylab script and
    tells the backend that it is time to draw.  In interactive mode, this may
    be a do nothing func.  See the GTK backend for an example of how to handle
    interactive versus batch mode
    N(Rtget_all_fig_managers(tmanager((sW/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends/backend_template.pytshow�scO s@|jdt�}|||�}t|�}t||�}|S(s.
    Create a new figure manager instance
    tFigureClass(tpopRtFigureCanvasTemplatetFigureManagerTemplate(tnumtargstkwargsR+tthisFigtcanvasR)((sW/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends/backend_template.pytnew_figure_manager�s
R-cB sBeZdZd�Zejj�Zded<d�Zd�ZRS(s�
    The canvas the figure renders into.  Calls the draw and print fig
    methods, creates the renderers, etc...

    Public attribute

      figure - A Figure instance

    Note GUI templates will want to connect events for button presses,
    mouse movements and key presses to functions that call the base
    class methods button_press_event, button_release_event,
    motion_notify_event, key_press_event, and key_release_event.  See,
    eg backend_gtk.py, backend_wx.py and backend_tkagg.py
    cC s&t|jj�}|jj|�dS(s4
        Draw the figure using the renderer
        N(RtfigureR	tdraw(R
trenderer((sW/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends/backend_template.pyR6�ssMy magic Foo formattfoocO sdS(s�
        Write out format foo.  The dpi, facecolor and edgecolor are restored
        to their original values after this call, so you don't need to
        save and restore them.
        N((R
tfilenameR0R1((sW/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends/backend_template.pyt	print_foo�scC sdS(NR8((R
((sW/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends/backend_template.pytget_default_filetype�s(	R"R#R$R6Rt	filetypestcopyR:R;(((sW/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends/backend_template.pyR-�s	
	R.cB seZdZRS(s�
    Wrap everything up into a window for the pylab interface

    For non interactive backends, the base class does all the work
    (R"R#R$(((sW/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends/backend_template.pyR.�s(R$t
__future__Rt
matplotlibtmatplotlib._pylab_helpersRtmatplotlib.backend_basesRRRRtmatplotlib.figureRtmatplotlib.transformsRRRR'R*R4R-R.t
FigureManager(((sW/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/backends/backend_template.pyt<module>7s"@		
	*