Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 641acdd

Browse files
committed
fixed gtk vert text bug
svn path=/trunk/matplotlib/; revision=171
1 parent 90f16e6 commit 641acdd

4 files changed

Lines changed: 103 additions & 51 deletions

File tree

MANIFEST

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -247,32 +247,6 @@ agg2/svg/agg_svg_path_tokenizer.h
247247
agg2/svg/svg_test.cpp
248248
examples/README
249249
examples/__init__.py
250-
examples/_tmp_alignment_test.py
251-
examples/_tmp_arctest.py
252-
examples/_tmp_axes_demo.py
253-
examples/_tmp_bar_stacked.py
254-
examples/_tmp_barchart_demo.py
255-
examples/_tmp_color_demo.py
256-
examples/_tmp_csd_demo.py
257-
examples/_tmp_figtext.py
258-
examples/_tmp_histogram_demo.py
259-
examples/_tmp_legend_demo.py
260-
examples/_tmp_legend_demo2.py
261-
examples/_tmp_line_styles.py
262-
examples/_tmp_log_demo.py
263-
examples/_tmp_log_test.py
264-
examples/_tmp_mri_with_eeg.py
265-
examples/_tmp_multiple_figs_demo.py
266-
examples/_tmp_pcolor_demo.py
267-
examples/_tmp_psd_demo.py
268-
examples/_tmp_scatter_demo.py
269-
examples/_tmp_scatter_demo2.py
270-
examples/_tmp_simple_plot.py
271-
examples/_tmp_stock_demo.py
272-
examples/_tmp_subplot_demo.py
273-
examples/_tmp_table_demo.py
274-
examples/_tmp_text_handles.py
275-
examples/_tmp_text_themes.py
276250
examples/alignment_test.py
277251
examples/anim.py
278252
examples/arctest.py

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191

9292

9393
setup(name="matplotlib",
94-
version= '0.51f',
94+
version= '0.51h',
9595
description = "Matlab style python plotting package",
9696
author = "John D. Hunter",
9797
author_email="[email protected]",

setupext.py

Lines changed: 99 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,58 @@
11
"""
22
Some helper functions for building the C extensions
3+
4+
BUILDING ON WIN32
5+
6+
* You need to make the cygwin import library. Assuming you have a
7+
typical cygwin and python install, run the script importlib22.bat or
8+
importlib23.bat to build the python2.2 or 2.3 import libs
9+
10+
* You need to following libraries (saved in win32_static):
11+
12+
http://gnuwin32.sourceforge.net/downlinks/freetype.php
13+
http://gnuwin32.sourceforge.net/downlinks/zlib.php
14+
http://gnuwin32.sourceforge.net/downlinks/libgw32c.php
15+
http://gnuwin32.sourceforge.net/downlinks/libpng.php
16+
http://www.activestate.com/Products/Download/Download.plex?id=ActiveTcl
17+
18+
* To install the gtk packages, you need pkg-config. This is
19+
included in the GTK development lib. You should have the GTK
20+
runtime and development libs installed to C:\GTK and make sure
21+
c:\GTK\lib and c:\GTK\bin are in your PATH. Also, copy
22+
win32_static/pygtk-2.0.pc to c:\GTK\lib\pkgconfig
23+
24+
* You must patch distutils for python23 or python22 to build agg
25+
with g++. See
26+
http://mail.python.org/pipermail/distutils-sig/2004-January/003553.html.
27+
Edit c:/Python23/lib/distutils/cygwinccompiler.py and add the line
28+
to the two set_executables calls
29+
30+
compiler_cxx='g++ -mcygwin -O -Wall',
31+
32+
* build command
33+
34+
> python setup.py build --compiler=mingw32 > build23.out
35+
36+
* make the windows installer
37+
38+
> python setup.py bdist_wininst
39+
40+
Note on some systems this fails with a "extensions need to be
41+
built with the same version of the compiler" message. The
42+
following workaround helps
43+
44+
> python setup.py build --compiler=mingw32 bdist_wininst > build23.out
45+
46+
See for details http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=mailman.1060311735.32666.python-list%40python.org&rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26q%3Dpython%2B%2522extensions%2Bneed%2Bto%2Bbe%2Bbuilt%2Bwith%2Bthe%2Bsame%2Bversion%2Bof%2Bthe%2Bcompiler%2522
47+
48+
49+
Current problems:
50+
51+
c:\mingw\bin\dllwrap.exe -mno-cygwin -mdll -static --entry _DllMain@12 --output-lib build\temp.win32-2.2\Release\lib_tkagg.a --def build\temp.win32-2.2\Release\_tkagg.def -s build\temp.win32-2.2\Release\_tkagg.o -LC:/Python23/dlls -Lwin32_static -LC:\PYTHON22\libs -ltk84 -ltcl84 -lfreetype -lpng -lz -lgw32c -lstdc++ -lm -lpython22 -o build\lib.win32-2.2\matplotlib\backends\_tkagg.pyd
52+
error: command 'dllwrap' failed with exit status 1
53+
54+
ideas: libstdc++ or libpython22 need to be moved up in link order?
55+
356
"""
457
import sys, os
558
from distutils.core import Extension
@@ -22,7 +75,9 @@
2275

2376
def getoutput(s):
2477
'get the output of a system command'
25-
return os.popen(s).read().strip()
78+
79+
ret = os.popen(s).read().strip()
80+
return ret
2681

2782

2883
def add_agg_flags(module):
@@ -32,7 +87,7 @@ def add_agg_flags(module):
3287
module.libraries.extend(['freetype', 'png', 'z'])
3388
if sys.platform == 'win32':
3489
module.include_dirs.extend(
35-
['c:/GnuWin32/include', ] )
90+
['win32_static/include', ] )
3691
module.library_dirs.append('win32_static')
3792
module.libraries.append('gw32c')
3893

@@ -55,8 +110,8 @@ def add_ft2font_flags(module):
55110
module.libraries.extend(['freetype', 'z'])
56111
if sys.platform == 'win32':
57112
module.include_dirs.extend(
58-
[ 'c:/GnuWin32/include', # for ft2build.h
59-
'c:/GnuWin32/include/freetype', # renamed from freetype2
113+
[ 'win32_static/include', # for ft2build.h
114+
'win32_static/include/freetype', # renamed from freetype2
60115
]
61116
)
62117
module.library_dirs.append('win32_static')
@@ -72,37 +127,58 @@ def add_ft2font_flags(module):
72127

73128
def add_pygtk_flags(module):
74129
'Add the module flags to build extensions which use gtk'
75-
pygtkIncludes = getoutput('pkg-config --cflags-only-I pygtk-2.0').split()
76-
gtkIncludes = getoutput('pkg-config --cflags-only-I gtk+-2.0').split()
77-
includes = pygtkIncludes + gtkIncludes
78-
module.include_dirs.extend([include[2:] for include in includes])
79130

80-
pygtkLinker = getoutput('pkg-config --libs pygtk-2.0').split()
81-
gtkLinker = getoutput('pkg-config --libs gtk+-2.0').split()
82-
linkerFlags = pygtkLinker + gtkLinker
131+
if sys.platform=='win32':
132+
# popen broken on my win32 plaform so I can't use pkgconfig
133+
module.library_dirs.extend(
134+
['C:/GTK/bin', 'C:/GTK/lib'])
83135

84-
module.libraries.extend(
85-
[flag[2:] for flag in linkerFlags if flag.startswith('-l')])
86136

87-
module.library_dirs.extend(
88-
[flag[2:] for dir in linkerFlags if flag.startswith('-L')])
137+
module.include_dirs.extend(
138+
['win32_static/include/pygtk-2.0',
139+
'C:/GTK/include',
140+
'C:/GTK/include/glib-2.0',
141+
'C:/GTK/lib/glib-2.0/include',
142+
'C:/GTK/include/gtk-2.0',
143+
'C:/GTK/lib/gtk-2.0/include',
144+
'C:/GTK/include/atk-1.0',
145+
'C:/GTK/include/pango-1.0',
146+
])
147+
148+
module.libraries.extend([
149+
'gtk-win32-2.0', 'gdk-win32-2.0', 'atk-1.0',
150+
'gdk_pixbuf-2.0', 'pangowin32-1.0', 'gdi32',
151+
'pango-1.0', 'gobject-2.0', 'gmodule-2.0',
152+
'glib-2.0', 'intl', 'iconv'])
89153

90-
if sys.platform=='win32':
91-
module.library_dirs.extend(['C:\\GTK\\bin', 'C:\\GTK\\lib'])
92-
module.extra_link_args.extend(
93-
[flag for flag in linkerFlags if not
94-
(flag.startswith('-l') or flag.startswith('-L'))])
154+
else:
155+
pygtkIncludes = getoutput('pkg-config --cflags-only-I pygtk-2.0').split()
156+
gtkIncludes = getoutput('pkg-config --cflags-only-I gtk+-2.0').split()
157+
includes = pygtkIncludes + gtkIncludes
158+
module.include_dirs.extend([include[2:] for include in includes])
95159

160+
pygtkLinker = getoutput('pkg-config --libs pygtk-2.0').split()
161+
gtkLinker = getoutput('pkg-config --libs gtk+-2.0').split()
162+
linkerFlags = pygtkLinker + gtkLinker
96163

164+
module.libraries.extend(
165+
[flag[2:] for flag in linkerFlags if flag.startswith('-l')])
166+
167+
module.library_dirs.extend(
168+
[flag[2:] for dir in linkerFlags if flag.startswith('-L')])
169+
170+
171+
module.extra_link_args.extend(
172+
[flag for flag in linkerFlags if not
173+
(flag.startswith('-l') or flag.startswith('-L'))])
97174

98-
99175

100176
def add_tk_flags(module):
101177
'Add the module flags to build extensions which use tk'
102178

103179
if sys.platform=='win32':
104-
module.include_dirs.extend(['C:\\Tcl\\include'])
105-
module.library_dirs.extend(['C:\\Tcl\\lib'])
180+
module.include_dirs.extend(['win32_static/include/tcl'])
181+
module.library_dirs.extend(['C:/Python23/dlls'])
106182
module.libraries.extend(['tk84', 'tcl84'])
107183
else:
108184
module.libraries.extend(['tk', 'tcl'])

src/_backend_agg.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
*
33
* $Header$
44
* $Log$
5+
* Revision 1.4 2004/03/03 19:27:43 jdh2358
6+
* fixed gtk vert text bug
7+
*
58
* Revision 1.3 2004/03/02 20:47:52 jdh2358
69
* update htdocs - lots of small fixes
710
*
@@ -19,7 +22,6 @@
1922
#include <fstream>
2023
#include <cmath>
2124
#include <cstdio>
22-
#include <freetype/freetype.h>
2325

2426
#include "agg_arrowhead.h"
2527
#include "agg_conv_concat.h"

0 commit comments

Comments
 (0)