1/*
2 * Copyright (C) 2010 Apple Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 *    notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 *    notice, this list of conditions and the following disclaimer in the
11 *    documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23 * THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#ifndef QuickDrawCompatibility_h
27#define QuickDrawCompatibility_h
28
29#ifndef __LP64__
30
31#import <Carbon/Carbon.h>
32
33#if defined(QD_HEADERS_ARE_PRIVATE) && QD_HEADERS_ARE_PRIVATE
34
35#ifdef __cplusplus
36extern "C" {
37#endif
38
39#define MacSetRect SetRect
40#define MacSetRectRgn SetRectRgn
41#define MacUnionRgn UnionRgn
42
43extern Boolean EmptyRgn(RgnHandle);
44extern OSStatus CreateCGContextForPort(CGrafPtr, CGContextRef*);
45extern OSStatus SyncCGContextOriginWithPort(CGContextRef, CGrafPtr);
46extern PixMapHandle GetPortPixMap(CGrafPtr);
47extern QDErr NewGWorldFromPtr(GWorldPtr*, UInt32, const Rect*, CTabHandle, GDHandle, GWorldFlags, Ptr, SInt32);
48extern Rect* GetPortBounds(CGrafPtr, Rect*);
49extern Rect* GetRegionBounds(RgnHandle, Rect*);
50extern RgnHandle GetPortClipRegion(CGrafPtr, RgnHandle);
51extern RgnHandle GetPortVisibleRegion(CGrafPtr, RgnHandle);
52extern RgnHandle NewRgn();
53extern void BackColor(long);
54extern void DisposeGWorld(GWorldPtr);
55extern void DisposeRgn(RgnHandle);
56extern void ForeColor(long);
57extern void GetGWorld(CGrafPtr*, GDHandle*);
58extern void GetPort(GrafPtr*);
59extern void GlobalToLocal(Point*);
60extern void MacSetRect(Rect*, short, short, short, short);
61extern void MacSetRectRgn(RgnHandle, short, short, short, short);
62extern void MacUnionRgn(RgnHandle, RgnHandle, RgnHandle);
63extern void MovePortTo(short, short);
64extern void OffsetRect(Rect*, short, short);
65extern void OffsetRgn(RgnHandle, short, short);
66extern void PaintRect(const Rect*);
67extern void PenNormal();
68extern void PortSize(short, short);
69extern void RectRgn(RgnHandle, const Rect*);
70extern void SectRgn(RgnHandle, RgnHandle, RgnHandle);
71extern void SetGWorld(CGrafPtr, GDHandle);
72extern void SetOrigin(short, short);
73extern void SetPort(GrafPtr);
74extern void SetPortClipRegion(CGrafPtr, RgnHandle);
75extern void SetPortVisibleRegion(CGrafPtr, RgnHandle);
76
77enum {
78    blackColor = 33,
79    whiteColor = 30,
80    greenColor = 341,
81};
82
83#ifdef __cplusplus
84}
85#endif
86
87#endif // defined(QD_HEADERS_ARE_PRIVATE) && QD_HEADERS_ARE_PRIVATE
88
89#endif // __LP64__
90
91#endif // QuickDrawCompatibility_h
92