1'''
2Wrappers for the "Quartz" related frameworks on MacOSX. These frameworks
3provide a number of graphics related API's.
4
5The frameworks wrapped by this package are:
6
7   * CoreGraphics - 2D Graphics, based on the PDF model
8
9   * ImageIO - Reading and writing images
10
11   * QuartzComposer - Working with "Quartz Composer" compositions
12
13   * QuartzCore  - Image processing and video image manipulation
14
15   * QuarzFilters - Image effects
16
17   * ImageKit - iPhoto-like views
18
19   * PDFKit - Working with PDF files
20
21   * CoreVideo - Managing digital video
22
23All frameworks can be accessed by importing the 'Quartz' module.
24
25These wrappers don't include documentation, please check Apple's documention
26for information on how to use this framework and PyObjC's documentation
27for general tips and tricks regarding the translation between Python
28and (Objective-)C frameworks
29
30NOTE: The actual wrappers are subpackages of ``Quartz``, they are not toplevel
31packages to avoid name clashes with Apple provided wrappers for CoreGraphics.
32
33WARNING: Running the unittests will change your display settings during the
34testrun, which will probably mess up your window layout.
35'''
36import ez_setup
37ez_setup.use_setuptools()
38
39from setuptools import setup, Extension
40try:
41    from PyObjCMetaData.commands import extra_cmdclass, extra_options
42except ImportError:
43    extra_cmdclass = {}
44    extra_options = lambda name: {}
45
46import os
47
48if int(os.uname()[2].split('.')[0]) > 8:
49    CV_CFLAGS=["-DWITH_CORE_VIDEO"]
50else:
51    CV_CFLAGS=[]
52
53if int(os.uname()[2].split('.')[0]) > 8:
54    CFLAGS = [  ]
55else:
56    CFLAGS=[ "-DNO_OBJC2_RUNTIME", "-DOS_TIGER" ]
57
58setup(
59    name='pyobjc-framework-Quartz',
60    version='2.2b3',
61    description = "Wrappers for the Quartz frameworks on Mac OS X",
62    long_description = __doc__,
63    author='Ronald Oussoren',
64    author_email='pyobjc-dev@lists.sourceforge.net',
65    url='http://pyobjc.sourceforge.net',
66    platforms = [ "MacOS X" ],
67    packages = [ "Quartz", "Quartz.CoreGraphics", "Quartz.ImageIO", "Quartz.QuartzCore", "Quartz.CoreVideo", "Quartz.QuartzComposer", "Quartz.ImageKit", "Quartz.PDFKit", "Quartz.QuartzFilters" ],
68    package_dir = { '': 'Lib' },
69    install_requires = [
70        'pyobjc-core>=2.2b3',
71        'pyobjc-framework-Cocoa>=2.2b3',
72    ],
73    package_data = {
74        '': ['*.bridgesupport']
75    },
76    test_suite='PyObjCTest',
77    cmdclass = extra_cmdclass,
78    options = extra_options('Quartz'),
79    zip_safe = True,
80    ext_modules = [
81        # CoreVideo
82        Extension('Quartz.CoreVideo._CVPixelBuffer',
83            [ 'Modules/_CVPixelBuffer.m' ],
84            extra_compile_args=CV_CFLAGS + CFLAGS),
85
86        # CoreGraphics
87        Extension('Quartz.CoreGraphics._inlines',
88            [ 'Modules/_CoreGraphics_inlines.m' ],
89            extra_compile_args=CFLAGS),
90        Extension('Quartz.CoreGraphics._callbacks',
91            [ 'Modules/_callbacks.m' ],
92            extra_compile_args=CFLAGS),
93        Extension('Quartz.CoreGraphics._doubleindirect',
94            [ 'Modules/_doubleindirect.m' ],
95            extra_compile_args=CFLAGS),
96        Extension('Quartz.CoreGraphics._sortandmap',
97            [ 'Modules/_sortandmap.m' ],
98            extra_compile_args=CFLAGS),
99        Extension('Quartz.CoreGraphics._coregraphics',
100            [ 'Modules/_coregraphics.m' ],
101            extra_compile_args=CFLAGS),
102    ],
103)
104