From: <jd...@us...> - 2008-12-09 03:49:15
|
Revision: 6530 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6530&view=rev Author: jdh2358 Date: 2008-12-09 03:49:11 +0000 (Tue, 09 Dec 2008) Log Message: ----------- added mdehoon's native macosx patch Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/lib/matplotlib/mathtext.py trunk/matplotlib/lib/matplotlib/rcsetup.py trunk/matplotlib/matplotlibrc.template trunk/matplotlib/setup.cfg.template trunk/matplotlib/setup.py trunk/matplotlib/setupext.py Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2008-12-09 03:37:16 UTC (rev 6529) +++ trunk/matplotlib/CHANGELOG 2008-12-09 03:49:11 UTC (rev 6530) @@ -1,3 +1,5 @@ +2008-12-08 Added mdehoon's native maxosx backend from sf patch 2179017 + 2008-12-08 Removed the prints in the set_*style commands. Return the list of pprinted strings instead Modified: trunk/matplotlib/lib/matplotlib/mathtext.py =================================================================== --- trunk/matplotlib/lib/matplotlib/mathtext.py 2008-12-09 03:37:16 UTC (rev 6529) +++ trunk/matplotlib/lib/matplotlib/mathtext.py 2008-12-09 03:49:11 UTC (rev 6530) @@ -2749,7 +2749,8 @@ 'ps' : MathtextBackendPs, 'pdf' : MathtextBackendPdf, 'svg' : MathtextBackendSvg, - 'cairo' : MathtextBackendCairo + 'cairo' : MathtextBackendCairo, + 'macosx': MathtextBackendAgg, } _font_type_mapping = { Modified: trunk/matplotlib/lib/matplotlib/rcsetup.py =================================================================== --- trunk/matplotlib/lib/matplotlib/rcsetup.py 2008-12-09 03:37:16 UTC (rev 6529) +++ trunk/matplotlib/lib/matplotlib/rcsetup.py 2008-12-09 03:49:11 UTC (rev 6530) @@ -23,8 +23,8 @@ # The capitalized forms are needed for ipython at present; this may # change for later versions. -interactive_bk = ['GTK', 'GTKAgg', 'GTKCairo', 'FltkAgg', 'QtAgg', 'Qt4Agg', - 'TkAgg', 'WX', 'WXAgg', 'CocoaAgg'] +interactive_bk = ['GTK', 'GTKAgg', 'GTKCairo', 'FltkAgg', 'MacOSX', + 'QtAgg', 'Qt4Agg', 'TkAgg', 'WX', 'WXAgg', 'CocoaAgg'] non_interactive_bk = ['agg', 'cairo', 'emf', 'gdk', Modified: trunk/matplotlib/matplotlibrc.template =================================================================== --- trunk/matplotlib/matplotlibrc.template 2008-12-09 03:37:16 UTC (rev 6529) +++ trunk/matplotlib/matplotlibrc.template 2008-12-09 03:49:11 UTC (rev 6530) @@ -24,9 +24,9 @@ #### CONFIGURATION BEGINS HERE # the default backend; one of GTK GTKAgg GTKCairo CocoaAgg FltkAgg -# QtAgg Qt4Agg TkAgg WX WXAgg Agg Cairo GDK PS PDF SVG Template You -# can also deploy your own backend outside of matplotlib by referring -# to the module name (which must be in the PYTHONPATH) as +# MacOSX QtAgg Qt4Agg TkAgg WX WXAgg Agg Cairo GDK PS PDF SVG Template +# You can also deploy your own backend outside of matplotlib by +# referring to the module name (which must be in the PYTHONPATH) as # 'module://my_backend' backend : %(backend)s Modified: trunk/matplotlib/setup.cfg.template =================================================================== --- trunk/matplotlib/setup.cfg.template 2008-12-09 03:37:16 UTC (rev 6529) +++ trunk/matplotlib/setup.cfg.template 2008-12-09 03:49:11 UTC (rev 6530) @@ -32,9 +32,9 @@ [gui_support] # Matplotlib supports multiple GUI toolkits, including Cocoa, -# GTK, Fltk, Qt, Qt4, Tk, and WX. Support for many of these -# toolkits requires AGG, the Anti-Grain Geometry library, which -# is provided by matplotlib and built by default. +# GTK, Fltk, MacOSX, Qt, Qt4, Tk, and WX. Support for many of +# these toolkits requires AGG, the Anti-Grain Geometry library, +# which is provided by matplotlib and built by default. # # Some backends are written in pure Python, and others require # extension code to be compiled. By default, matplotlib checks @@ -59,16 +59,17 @@ #gtkagg = False #tkagg = False #wxagg = False +#macosx = False [rc_options] # User-configurable options # -# Default backend, one of: Agg, Cairo, CocoaAgg, GTK, GTKAgg, -# GTKCairo, FltkAgg, Pdf, Ps, QtAgg, Qt4Agg, SVG, TkAgg, WX, WXAgg. +# Default backend, one of: Agg, Cairo, CocoaAgg, GTK, GTKAgg, GTKCairo, +# FltkAgg, MacOSX, Pdf, Ps, QtAgg, Qt4Agg, SVG, TkAgg, WX, WXAgg. # # The Agg, Ps, Pdf and SVG backends do not require external -# dependencies. Do not choose GTK, GTKAgg, GTKCairo, TkAgg or WXAgg if -# you have disabled the relevent extension modules. Agg will be used +# dependencies. Do not choose GTK, GTKAgg, GTKCairo, MacOSX, TkAgg or WXAgg +# if you have disabled the relevent extension modules. Agg will be used # by default. # #backend = Agg Modified: trunk/matplotlib/setup.py =================================================================== --- trunk/matplotlib/setup.py 2008-12-09 03:37:16 UTC (rev 6529) +++ trunk/matplotlib/setup.py 2008-12-09 03:49:11 UTC (rev 6530) @@ -26,15 +26,15 @@ import glob from distutils.core import setup from setupext import build_agg, build_gtkagg, build_tkagg, build_wxagg,\ - build_ft2font, build_image, build_windowing, build_path, \ + build_macosx, build_ft2font, build_image, build_windowing, build_path, \ build_contour, build_delaunay, build_nxutils, build_traits, build_gdk, \ build_ttconv, print_line, print_status, print_message, \ print_raw, check_for_freetype, check_for_libpng, check_for_gtk, \ - check_for_tk, check_for_wx, check_for_numpy, check_for_qt, check_for_qt4, \ - check_for_cairo, check_provide_traits, check_provide_pytz, \ - check_provide_dateutil, check_provide_configobj, check_for_dvipng, \ - check_for_ghostscript, check_for_latex, check_for_pdftops, \ - check_for_datetime, options, build_png + check_for_tk, check_for_wx, check_for_macosx, check_for_numpy, \ + check_for_qt, check_for_qt4, check_for_cairo, check_provide_traits, \ + check_provide_pytz, check_provide_dateutil, check_provide_configobj, \ + check_for_dvipng, check_for_ghostscript, check_for_latex, \ + check_for_pdftops, check_for_datetime, options, build_png #import distutils.sysconfig # jdh @@ -149,6 +149,11 @@ build_gtkagg(ext_modules, packages) rc['backend'] = 'GTKAgg' +if options['build_macosx']: + if check_for_macosx() or (options['build_macosx'] is True): + build_macosx(ext_modules, packages) + rc['backend'] = 'MacOSX' + # These are informational only. We don't build any extensions for them. check_for_qt() check_for_qt4() Modified: trunk/matplotlib/setupext.py =================================================================== --- trunk/matplotlib/setupext.py 2008-12-09 03:37:16 UTC (rev 6529) +++ trunk/matplotlib/setupext.py 2008-12-09 03:49:11 UTC (rev 6530) @@ -76,6 +76,7 @@ BUILT_TTCONV = False BUILT_GTKAGG = False BUILT_IMAGE = False +BUILT_MACOSX = False BUILT_TKAGG = False BUILT_WXAGG = False BUILT_WINDOWING = False @@ -105,6 +106,7 @@ 'build_gtkagg': 'auto', 'build_tkagg': 'auto', 'build_wxagg': 'auto', + 'build_macosx': 'auto', 'build_image': True, 'build_windowing': True, 'backend': None, @@ -867,6 +869,17 @@ print_message(explanation) return gotit +def check_for_macosx(): + gotit = False + import sys + if sys.platform=='darwin': + gotit = True + if gotit: + print_status("Mac OS X native", "yes") + else: + print_status("Mac OS X native", "no") + return gotit + def query_tcltk(): """Tries to open a Tk window in order to query the Tk object about its library paths. This should never be called more than once by the same process, as Tk intricacies @@ -1214,6 +1227,19 @@ ext_modules.append(module) BUILT_WXAGG = True + +def build_macosx(ext_modules, packages): + global BUILT_MACOSX + if BUILT_MACOSX: return # only build it if you you haven't already + module = Extension('matplotlib.backends._macosx', + ['src/_macosx.m'], + extra_link_args = ['-framework','Cocoa'], + ) + add_numpy_flags(module) + ext_modules.append(module) + BUILT_MACOSX = True + + def build_png(ext_modules, packages): global BUILT_PNG if BUILT_PNG: return # only build it if you you haven't already This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |