Home | History | Annotate | Download | only in Misc
      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
     36 extern "C" {
     37 #endif
     38 
     39 #define MacSetRect SetRect
     40 #define MacSetRectRgn SetRectRgn
     41 #define MacUnionRgn UnionRgn
     42 
     43 extern Boolean EmptyRgn(RgnHandle);
     44 extern OSStatus CreateCGContextForPort(CGrafPtr, CGContextRef*);
     45 extern OSStatus SyncCGContextOriginWithPort(CGContextRef, CGrafPtr);
     46 extern PixMapHandle GetPortPixMap(CGrafPtr);
     47 extern QDErr NewGWorldFromPtr(GWorldPtr*, UInt32, const Rect*, CTabHandle, GDHandle, GWorldFlags, Ptr, SInt32);
     48 extern Rect* GetPortBounds(CGrafPtr, Rect*);
     49 extern Rect* GetRegionBounds(RgnHandle, Rect*);
     50 extern RgnHandle GetPortClipRegion(CGrafPtr, RgnHandle);
     51 extern RgnHandle GetPortVisibleRegion(CGrafPtr, RgnHandle);
     52 extern RgnHandle NewRgn();
     53 extern void BackColor(long);
     54 extern void DisposeGWorld(GWorldPtr);
     55 extern void DisposeRgn(RgnHandle);
     56 extern void ForeColor(long);
     57 extern void GetGWorld(CGrafPtr*, GDHandle*);
     58 extern void GetPort(GrafPtr*);
     59 extern void GlobalToLocal(Point*);
     60 extern void MacSetRect(Rect*, short, short, short, short);
     61 extern void MacSetRectRgn(RgnHandle, short, short, short, short);
     62 extern void MacUnionRgn(RgnHandle, RgnHandle, RgnHandle);
     63 extern void MovePortTo(short, short);
     64 extern void OffsetRect(Rect*, short, short);
     65 extern void OffsetRgn(RgnHandle, short, short);
     66 extern void PaintRect(const Rect*);
     67 extern void PenNormal();
     68 extern void PortSize(short, short);
     69 extern void RectRgn(RgnHandle, const Rect*);
     70 extern void SectRgn(RgnHandle, RgnHandle, RgnHandle);
     71 extern void SetGWorld(CGrafPtr, GDHandle);
     72 extern void SetOrigin(short, short);
     73 extern void SetPort(GrafPtr);
     74 extern void SetPortClipRegion(CGrafPtr, RgnHandle);
     75 extern void SetPortVisibleRegion(CGrafPtr, RgnHandle);
     76 
     77 enum {
     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