Getting rid of WITHOUT_FRAMEWORKS and ACCESSOR_CALLS_ARE_FUNCTIONS:

MacOS9isms.
This commit is contained in:
Jack Jansen 2003-11-19 16:13:35 +00:00
parent 10d176f77e
commit e48cef7aba
57 changed files with 57 additions and 520 deletions

View File

@ -23,12 +23,7 @@
#ifndef PyDoc_STR
#define PyDoc_STR(x) (x)
#endif
#ifdef WITHOUT_FRAMEWORKS
#include <AppleEvents.h>
#include <AEObjects.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_AEDesc_New(AEDesc *);

View File

@ -85,12 +85,7 @@ includestuff = includestuff + """
#ifndef PyDoc_STR
#define PyDoc_STR(x) (x)
#endif
#ifdef WITHOUT_FRAMEWORKS
#include <AppleEvents.h>
#include <AEObjects.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_AEDesc_New(AEDesc *);

View File

@ -20,11 +20,7 @@
}} while(0)
#ifdef WITHOUT_FRAMEWORKS
#include <AppleHelp.h>
#else
#include <Carbon/Carbon.h>
#endif
static PyObject *Ah_Error;

View File

@ -20,11 +20,7 @@ from macsupport import *
AHTOCType = Type("AHTOCType", "h")
includestuff = includestuff + """
#ifdef WITHOUT_FRAMEWORKS
#include <AppleHelp.h>
#else
#include <Carbon/Carbon.h>
#endif
"""

View File

@ -20,12 +20,7 @@
}} while(0)
#ifdef WITHOUT_FRAMEWORKS
#include <Appearance.h>
#else
#include <Carbon/Carbon.h>
#endif
int ThemeButtonDrawInfo_Convert(PyObject *v, ThemeButtonDrawInfo *p_itself)

View File

@ -79,12 +79,7 @@ ThemeButtonDrawUPP = FakeType("NULL")
includestuff = includestuff + """
#ifdef WITHOUT_FRAMEWORKS
#include <Appearance.h>
#else
#include <Carbon/Carbon.h>
#endif
int ThemeButtonDrawInfo_Convert(PyObject *v, ThemeButtonDrawInfo *p_itself)

View File

@ -74,11 +74,7 @@ MouseTrackingResult = UInt16
includestuff = r"""
#ifdef WITHOUT_FRAMEWORKS
#include <CarbonEvents.h>
#else
#include <Carbon/Carbon.h>
#endif
#include "macglue.h"

View File

@ -5,11 +5,7 @@
#ifdef WITHOUT_FRAMEWORKS
#include <CarbonEvents.h>
#else
#include <Carbon/Carbon.h>
#endif
#include "macglue.h"

View File

@ -20,18 +20,7 @@
}} while(0)
#ifdef WITHOUT_FRAMEWORKS
#include <CFBase.h>
#include <CFArray.h>
#include <CFData.h>
#include <CFDictionary.h>
#include <CFString.h>
#include <CFURL.h>
#include <CFPropertyList.h>
#include <CFPreferences.h>
#else
#include <CoreServices/CoreServices.h>
#endif
#include "pycfbridge.h"

View File

@ -42,18 +42,7 @@ class MethodSkipArg1(MethodGenerator):
# Create the type objects
includestuff = includestuff + """
#ifdef WITHOUT_FRAMEWORKS
#include <CFBase.h>
#include <CFArray.h>
#include <CFData.h>
#include <CFDictionary.h>
#include <CFString.h>
#include <CFURL.h>
#include <CFPropertyList.h>
#include <CFPreferences.h>
#else
#include <CoreServices/CoreServices.h>
#endif
#include "pycfbridge.h"

View File

@ -2,17 +2,7 @@
** Convert objects from Python to CoreFoundation and vice-versa.
*/
#ifdef WITHOUT_FRAMEWORKS
#include <CFBase.h>
#include <CFNumber.h>
#include <CFArray.h>
#include <CFData.h>
#include <CFDictionary.h>
#include <CFString.h>
#include <CFURL.h>
#else
#include <CoreServices/CoreServices.h>
#endif
#include "Python.h"
#include "macglue.h"

View File

@ -20,12 +20,7 @@
}} while(0)
#ifdef WITHOUT_FRAMEWORKS
#include <Quickdraw.h>
#include <CGContext.h>
#else
#include <ApplicationServices/ApplicationServices.h>
#endif
#if !TARGET_API_MAC_OSX
/* This code is adapted from the CallMachOFramework demo at:

View File

@ -23,12 +23,7 @@ RgnHandle = OpaqueByValueType("RgnHandle", "ResObj")
# Create the type objects
includestuff = includestuff + """
#ifdef WITHOUT_FRAMEWORKS
#include <Quickdraw.h>
#include <CGContext.h>
#else
#include <ApplicationServices/ApplicationServices.h>
#endif
#if !TARGET_API_MAC_OSX
/* This code is adapted from the CallMachOFramework demo at:

View File

@ -20,11 +20,7 @@
}} while(0)
#ifdef WITHOUT_FRAMEWORKS
#include <Components.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_CmpObj_New(Component);

View File

@ -21,11 +21,7 @@ from macsupport import *
# Create the type objects
includestuff = includestuff + """
#ifdef WITHOUT_FRAMEWORKS
#include <Components.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_CmpObj_New(Component);

View File

@ -20,12 +20,7 @@
}} while(0)
#ifdef WITHOUT_FRAMEWORKS
#include <Controls.h>
#include <ControlDefinitions.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_CtlObj_New(ControlHandle);

View File

@ -113,12 +113,7 @@ ControlSliderOrientation = UInt16
includestuff = includestuff + """
#ifdef WITHOUT_FRAMEWORKS
#include <Controls.h>
#include <ControlDefinitions.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_CtlObj_New(ControlHandle);

View File

@ -20,11 +20,7 @@
}} while(0)
#ifdef WITHOUT_FRAMEWORKS
#include <Dialogs.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_DlgObj_New(DialogRef);

View File

@ -31,11 +31,7 @@ StringPtr = Str255
EventMask = Type("EventMask", "H")
includestuff = includestuff + """
#ifdef WITHOUT_FRAMEWORKS
#include <Dialogs.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_DlgObj_New(DialogRef);

View File

@ -20,11 +20,7 @@
}} while(0)
#ifdef WITHOUT_FRAMEWORKS
#include <Drag.h>
#else
#include <Carbon/Carbon.h>
#endif
/* Callback glue routines */
DragTrackingHandlerUPP dragglue_TrackingHandlerUPP;

View File

@ -44,11 +44,7 @@ FlavorFlags = Type("FlavorFlags", "l")
DragTrackingMessage = Type("DragTrackingMessage", "h")
includestuff = includestuff + """
#ifdef WITHOUT_FRAMEWORKS
#include <Drag.h>
#else
#include <Carbon/Carbon.h>
#endif
/* Callback glue routines */
DragTrackingHandlerUPP dragglue_TrackingHandlerUPP;

View File

@ -20,11 +20,7 @@
}} while(0)
#ifdef WITHOUT_FRAMEWORKS
#include <Events.h>
#else
#include <Carbon/Carbon.h>
#endif
static PyObject *Evt_Error;

View File

@ -35,11 +35,7 @@ EventMask = Type("EventMask", "H")
EventKind = Type("EventKind", "H")
includestuff = includestuff + """
#ifdef WITHOUT_FRAMEWORKS
#include <Events.h>
#else
#include <Carbon/Carbon.h>
#endif
"""

View File

@ -20,11 +20,7 @@
}} while(0)
#ifdef WITHOUT_FRAMEWORKS
#include <Files.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern int _PyMac_GetFSSpec(PyObject *v, FSSpec *spec);

View File

@ -122,11 +122,7 @@ FSCatalogInfo_ptr = OpaqueType("FSCatalogInfo", "FSCatalogInfo")
#FSSpecArrayPtr
includestuff = includestuff + """
#ifdef WITHOUT_FRAMEWORKS
#include <Files.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern int _PyMac_GetFSSpec(PyObject *v, FSSpec *spec);

View File

@ -20,11 +20,7 @@
}} while(0)
#ifdef WITHOUT_FRAMEWORKS
#include <Fonts.h>
#else
#include <Carbon/Carbon.h>
#endif
/*

View File

@ -26,11 +26,7 @@ TextBuffer = RevVarInputBufferType()
includestuff = includestuff + """
#ifdef WITHOUT_FRAMEWORKS
#include <Fonts.h>
#else
#include <Carbon/Carbon.h>
#endif
/*

View File

@ -20,11 +20,7 @@
}} while(0)
#ifdef WITHOUT_FRAMEWORKS
#include <Folders.h>
#else
#include <Carbon/Carbon.h>
#endif
static PyObject *Folder_Error;

View File

@ -29,11 +29,7 @@ RoutingFlags = Type("RoutingFlags", "l")
includestuff = includestuff + """
#ifdef WITHOUT_FRAMEWORKS
#include <Folders.h>
#else
#include <Carbon/Carbon.h>
#endif
"""

View File

@ -23,11 +23,7 @@
#ifndef PyDoc_STR
#define PyDoc_STR(x) (x)
#endif
#ifdef WITHOUT_FRAMEWORKS
#include <MacHelp.h>
#else
#include <Carbon/Carbon.h>
#endif
static PyObject *Help_Error;

View File

@ -39,11 +39,7 @@ includestuff = includestuff + """
#ifndef PyDoc_STR
#define PyDoc_STR(x) (x)
#endif
#ifdef WITHOUT_FRAMEWORKS
#include <MacHelp.h>
#else
#include <Carbon/Carbon.h>
#endif
"""
class MyObjectDefinition(PEP253Mixin, GlobalObjectDefinition):

View File

@ -9,11 +9,7 @@ IBCarbonFunction = OSErrFunctionGenerator
IBCarbonMethod = OSErrMethodGenerator
includestuff = """
#ifdef WITHOUT_FRAMEWORKS
#include <IBCarbonRuntime.h>
#else
#include <Carbon/Carbon.h>
#endif /* WITHOUT_FRAMEWORKS */
#include "macglue.h"
#ifdef USE_TOOLBOX_OBJECT_GLUE

View File

@ -5,11 +5,7 @@
#ifdef WITHOUT_FRAMEWORKS
#include <IBCarbonRuntime.h>
#else
#include <Carbon/Carbon.h>
#endif /* WITHOUT_FRAMEWORKS */
#include "macglue.h"
#ifdef USE_TOOLBOX_OBJECT_GLUE

View File

@ -20,11 +20,7 @@
}} while(0)
#ifdef WITHOUT_FRAMEWORKS
#include <Icons.h>
#else
#include <Carbon/Carbon.h>
#endif
static PyObject *Icn_Error;

View File

@ -46,11 +46,7 @@ RGBColor = OpaqueType("RGBColor", "QdRGB")
#EventKind = Type("EventKind", "H")
includestuff = includestuff + """
#ifdef WITHOUT_FRAMEWORKS
#include <Icons.h>
#else
#include <Carbon/Carbon.h>
#endif
"""

View File

@ -20,11 +20,7 @@
}} while(0)
#ifdef WITHOUT_FRAMEWORKS
#include <Lists.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_ListObj_New(ListHandle);
@ -34,31 +30,6 @@ extern int _ListObj_Convert(PyObject *, ListHandle *);
#define ListObj_Convert _ListObj_Convert
#endif
#if !ACCESSOR_CALLS_ARE_FUNCTIONS
#define GetListPort(list) ((CGrafPtr)(*(list))->port)
#define GetListVerticalScrollBar(list) ((*(list))->vScroll)
#define GetListHorizontalScrollBar(list) ((*(list))->hScroll)
#define GetListActive(list) ((*(list))->lActive)
#define GetListClickTime(list) ((*(list))->clikTime)
#define GetListRefCon(list) ((*(list))->refCon)
#define GetListDefinition(list) ((*(list))->listDefProc) /* XXX Is this indeed the same? */
#define GetListUserHandle(list) ((*(list))->userHandle)
#define GetListDataHandle(list) ((*(list))->cells)
#define GetListFlags(list) ((*(list))->listFlags)
#define GetListSelectionFlags(list) ((*(list))->selFlags)
#define SetListViewBounds(list, bounds) (((*(list))->rView) = *(bounds))
#define SetListPort(list, port) (((*(list))->port) = (GrafPtr)(port))
#define SetListCellIndent(list, ind) (((*(list))->indent) = *(ind))
#define SetListClickTime(list, time) (((*(list))->clikTime) = (time))
#define SetListLastClick(list, click) (((*(list)->lastClick) = *(click))
#define SetListRefCon(list, refcon) (((*(list))->refCon) = (refcon))
#define SetListUserHandle(list, handle) (((*(list))->userHandle) = (handle))
#define SetListFlags(list, flags) (((*(list))->listFlags) = (flags))
#define SetListSelectionFlags(list, flags) (((*(list))->selFlags) = (flags))
#endif
#define as_List(x) ((ListHandle)x)
#define as_Resource(lh) ((Handle)lh)

View File

@ -39,11 +39,7 @@ CGrafPtr = OpaqueByValueType("CGrafPtr", "GrafObj")
EventModifiers = Type("EventModifiers", "H")
includestuff = includestuff + """
#ifdef WITHOUT_FRAMEWORKS
#include <Lists.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_ListObj_New(ListHandle);
@ -53,31 +49,6 @@ extern int _ListObj_Convert(PyObject *, ListHandle *);
#define ListObj_Convert _ListObj_Convert
#endif
#if !ACCESSOR_CALLS_ARE_FUNCTIONS
#define GetListPort(list) ((CGrafPtr)(*(list))->port)
#define GetListVerticalScrollBar(list) ((*(list))->vScroll)
#define GetListHorizontalScrollBar(list) ((*(list))->hScroll)
#define GetListActive(list) ((*(list))->lActive)
#define GetListClickTime(list) ((*(list))->clikTime)
#define GetListRefCon(list) ((*(list))->refCon)
#define GetListDefinition(list) ((*(list))->listDefProc) /* XXX Is this indeed the same? */
#define GetListUserHandle(list) ((*(list))->userHandle)
#define GetListDataHandle(list) ((*(list))->cells)
#define GetListFlags(list) ((*(list))->listFlags)
#define GetListSelectionFlags(list) ((*(list))->selFlags)
#define SetListViewBounds(list, bounds) (((*(list))->rView) = *(bounds))
#define SetListPort(list, port) (((*(list))->port) = (GrafPtr)(port))
#define SetListCellIndent(list, ind) (((*(list))->indent) = *(ind))
#define SetListClickTime(list, time) (((*(list))->clikTime) = (time))
#define SetListLastClick(list, click) (((*(list)->lastClick) = *(click))
#define SetListRefCon(list, refcon) (((*(list))->refCon) = (refcon))
#define SetListUserHandle(list, handle) (((*(list))->userHandle) = (handle))
#define SetListFlags(list, flags) (((*(list))->listFlags) = (flags))
#define SetListSelectionFlags(list, flags) (((*(list))->selFlags) = (flags))
#endif
#define as_List(x) ((ListHandle)x)
#define as_Resource(lh) ((Handle)lh)

View File

@ -20,12 +20,7 @@
}} while(0)
#ifdef WITHOUT_FRAMEWORKS
#include <Devices.h> /* Defines OpenDeskAcc in universal headers */
#include <Menus.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
@ -37,16 +32,6 @@ extern int _MenuObj_Convert(PyObject *, MenuHandle *);
#define MenuObj_Convert _MenuObj_Convert
#endif
#if !ACCESSOR_CALLS_ARE_FUNCTIONS
#define GetMenuID(menu) ((*(menu))->menuID)
#define GetMenuWidth(menu) ((*(menu))->menuWidth)
#define GetMenuHeight(menu) ((*(menu))->menuHeight)
#define SetMenuID(menu, id) ((*(menu))->menuID = (id))
#define SetMenuWidth(menu, width) ((*(menu))->menuWidth = (width))
#define SetMenuHeight(menu, height) ((*(menu))->menuHeight = (height))
#endif
#define as_Menu(h) ((MenuHandle)h)
#define as_Resource(h) ((Handle)h)

View File

@ -39,12 +39,7 @@ FMFontStyle = Type("FMFontStyle", "h")
UniChar = Type("UniChar", "h")
includestuff = includestuff + """
#ifdef WITHOUT_FRAMEWORKS
#include <Devices.h> /* Defines OpenDeskAcc in universal headers */
#include <Menus.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
@ -56,16 +51,6 @@ extern int _MenuObj_Convert(PyObject *, MenuHandle *);
#define MenuObj_Convert _MenuObj_Convert
#endif
#if !ACCESSOR_CALLS_ARE_FUNCTIONS
#define GetMenuID(menu) ((*(menu))->menuID)
#define GetMenuWidth(menu) ((*(menu))->menuWidth)
#define GetMenuHeight(menu) ((*(menu))->menuHeight)
#define SetMenuID(menu, id) ((*(menu))->menuID = (id))
#define SetMenuWidth(menu, width) ((*(menu))->menuWidth = (width))
#define SetMenuHeight(menu, height) ((*(menu))->menuHeight = (height))
#endif
#define as_Menu(h) ((MenuHandle)h)
#define as_Resource(h) ((Handle)h)

View File

@ -20,11 +20,7 @@
}} while(0)
#ifdef WITHOUT_FRAMEWORKS
#include <MacTextEditor.h>
#else
#include <Carbon/Carbon.h>
#endif
/* For now we declare them forward here. They'll go to mactoolbox later */
static PyObject *TXNObj_New(TXNObject);

View File

@ -20,11 +20,7 @@ from macsupport import *
# Create the type objects
includestuff = includestuff + """
#ifdef WITHOUT_FRAMEWORKS
#include <MacTextEditor.h>
#else
#include <Carbon/Carbon.h>
#endif
/* For now we declare them forward here. They'll go to mactoolbox later */
static PyObject *TXNObj_New(TXNObject);

View File

@ -20,11 +20,7 @@
}} while(0)
#ifdef WITHOUT_FRAMEWORKS
#include <QuickDraw.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_GrafObj_New(GrafPtr);
@ -42,69 +38,6 @@ extern int _QdRGB_Convert(PyObject *, RGBColorPtr);
#define QdRGB_Convert _QdRGB_Convert
#endif
#if !ACCESSOR_CALLS_ARE_FUNCTIONS
#define GetPortBitMapForCopyBits(port) ((const struct BitMap *)&((GrafPort *)(port))->portBits)
#define GetPortPixMap(port) (((CGrafPtr)(port))->portPixMap)
#define GetPortBounds(port, bounds) (*(bounds) = (port)->portRect, (bounds))
#define GetPortForeColor(port, color) (*(color) = (port)->rgbFgColor, (color))
#define GetPortBackColor(port, color) (*(color) = (port)->rgbBkColor, (color))
#define GetPortOpColor(port, color) (*(color) = (*(GVarHandle)((port)->grafVars))->rgbOpColor, (color))
#define GetPortHiliteColor(port, color) (*(color) = (*(GVarHandle)((port)->grafVars))->rgbHiliteColor, (color))
#define GetPortTextFont(port) ((port)->txFont)
#define GetPortTextFace(port) ((port)->txFace)
#define GetPortTextMode(port) ((port)->txMode)
#define GetPortTextSize(port) ((port)->txSize)
#define GetPortChExtra(port) ((port)->chExtra)
#define GetPortFracHPenLocation(port) ((port)->pnLocHFrac)
#define GetPortSpExtra(port) ((port)->spExtra)
#define GetPortPenVisibility(port) ((port)->pnVis)
#define GetPortVisibleRegion(port, rgn) ((rgn) = (port)->visRgn, (rgn))
#define GetPortClipRegion(port, rgn) ((rgn) = (port)->clipRgn, (rgn))
#define GetPortBackPixPat(port, pat) ((pat) = (port)->bkPixPat, (pat))
#define GetPortPenPixPat(port, pat) ((pat) = (port)->pnPixPat, (pat))
#define GetPortFillPixPat(port, pat) ((pat) = (port)->fillPixPat, (pat))
#define GetPortPenSize(port, pensize) (*(pensize) = (port)->pnSize, (pensize))
#define GetPortPenMode(port) ((port)->pnMode)
#define GetPortPenLocation(port, location) ((*location) = (port)->pnLoc, (location))
#define IsPortRegionBeingDefined(port) (!!((port)->rgnSave))
#define IsPortPictureBeingDefined(port) (!!((port)->picSave))
/* #define IsPortOffscreen(port) */
/* #define IsPortColor(port) */
#define SetPortBounds(port, bounds) ((port)->portRect = *(bounds))
#define SetPortOpColor(port, color) ((*(GVarHandle)((port)->grafVars))->rgbOpColor = *(color))
#define SetPortVisibleRegion(port, rgn) ((port)->visRgn = (rgn))
#define SetPortClipRegion(port, rgn) ((port)->clipRgn = (rgn))
#define SetPortBackPixPat(port, pat) ((port)->bkPixPat = (pat))
#define SetPortPenPixPat(port, pat) ((port)->pnPixPat = (pat))
#define SetPortFillPixPat(port, pat) ((port)->fillPixPat = (pat))
#define SetPortPenSize(port, pensize) ((port)->pnSize = (pensize))
#define SetPortPenMode(port, mode) ((port)->pnMode = (mode))
#define SetPortFracHPenLocation(port, frac) ((port)->pnLocHFrac = (frac))
/* On pixmaps */
#define GetPixBounds(pixmap, rect) (*(rect) = (*(pixmap))->bounds, (rect))
#define GetPixDepth(pixmap) ((*(pixmap))->pixelSize)
/* On regions */
#define GetRegionBounds(rgn, rect) (*(rect) = (*(rgn))->rgnBBox, (rect))
/* On QD Globals */
#define GetQDGlobalsRandomSeed() (qd.randSeed)
#define GetQDGlobalsScreenBits(bits) (*(bits) = qd.screenBits, (bits))
#define GetQDGlobalsArrow(crsr) (*(crsr) = qd.arrow, (crsr))
#define GetQDGlobalsDarkGray(pat) (*(pat) = qd.dkGray, (pat))
#define GetQDGlobalsLightGray(pat) (*(pat) = qd.ltGray, (pat))
#define GetQDGlobalsGray(pat) (*(pat) = qd.gray, (pat))
#define GetQDGlobalsBlack(pat) (*(pat) = qd.black, (pat))
#define GetQDGlobalsWhite(pat) (*(pat) = qd.white, (pat))
#define GetQDGlobalsThePort() ((CGrafPtr)qd.thePort)
#define SetQDGlobalsRandomSeed(seed) (qd.randSeed = (seed))
#define SetQDGlobalsArrow(crsr) (qd.arrow = *(crsr))
#endif /* ACCESSOR_CALLS_ARE_FUNCTIONS */
static PyObject *BMObj_NewCopied(BitMapPtr);
/*

View File

@ -66,11 +66,7 @@ PenState_ptr = StructInputBufferType('PenState')
TruncCode = Type("TruncCode", "h")
includestuff = includestuff + """
#ifdef WITHOUT_FRAMEWORKS
#include <QuickDraw.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_GrafObj_New(GrafPtr);
@ -88,69 +84,6 @@ extern int _QdRGB_Convert(PyObject *, RGBColorPtr);
#define QdRGB_Convert _QdRGB_Convert
#endif
#if !ACCESSOR_CALLS_ARE_FUNCTIONS
#define GetPortBitMapForCopyBits(port) ((const struct BitMap *)&((GrafPort *)(port))->portBits)
#define GetPortPixMap(port) (((CGrafPtr)(port))->portPixMap)
#define GetPortBounds(port, bounds) (*(bounds) = (port)->portRect, (bounds))
#define GetPortForeColor(port, color) (*(color) = (port)->rgbFgColor, (color))
#define GetPortBackColor(port, color) (*(color) = (port)->rgbBkColor, (color))
#define GetPortOpColor(port, color) (*(color) = (*(GVarHandle)((port)->grafVars))->rgbOpColor, (color))
#define GetPortHiliteColor(port, color) (*(color) = (*(GVarHandle)((port)->grafVars))->rgbHiliteColor, (color))
#define GetPortTextFont(port) ((port)->txFont)
#define GetPortTextFace(port) ((port)->txFace)
#define GetPortTextMode(port) ((port)->txMode)
#define GetPortTextSize(port) ((port)->txSize)
#define GetPortChExtra(port) ((port)->chExtra)
#define GetPortFracHPenLocation(port) ((port)->pnLocHFrac)
#define GetPortSpExtra(port) ((port)->spExtra)
#define GetPortPenVisibility(port) ((port)->pnVis)
#define GetPortVisibleRegion(port, rgn) ((rgn) = (port)->visRgn, (rgn))
#define GetPortClipRegion(port, rgn) ((rgn) = (port)->clipRgn, (rgn))
#define GetPortBackPixPat(port, pat) ((pat) = (port)->bkPixPat, (pat))
#define GetPortPenPixPat(port, pat) ((pat) = (port)->pnPixPat, (pat))
#define GetPortFillPixPat(port, pat) ((pat) = (port)->fillPixPat, (pat))
#define GetPortPenSize(port, pensize) (*(pensize) = (port)->pnSize, (pensize))
#define GetPortPenMode(port) ((port)->pnMode)
#define GetPortPenLocation(port, location) ((*location) = (port)->pnLoc, (location))
#define IsPortRegionBeingDefined(port) (!!((port)->rgnSave))
#define IsPortPictureBeingDefined(port) (!!((port)->picSave))
/* #define IsPortOffscreen(port) */
/* #define IsPortColor(port) */
#define SetPortBounds(port, bounds) ((port)->portRect = *(bounds))
#define SetPortOpColor(port, color) ((*(GVarHandle)((port)->grafVars))->rgbOpColor = *(color))
#define SetPortVisibleRegion(port, rgn) ((port)->visRgn = (rgn))
#define SetPortClipRegion(port, rgn) ((port)->clipRgn = (rgn))
#define SetPortBackPixPat(port, pat) ((port)->bkPixPat = (pat))
#define SetPortPenPixPat(port, pat) ((port)->pnPixPat = (pat))
#define SetPortFillPixPat(port, pat) ((port)->fillPixPat = (pat))
#define SetPortPenSize(port, pensize) ((port)->pnSize = (pensize))
#define SetPortPenMode(port, mode) ((port)->pnMode = (mode))
#define SetPortFracHPenLocation(port, frac) ((port)->pnLocHFrac = (frac))
/* On pixmaps */
#define GetPixBounds(pixmap, rect) (*(rect) = (*(pixmap))->bounds, (rect))
#define GetPixDepth(pixmap) ((*(pixmap))->pixelSize)
/* On regions */
#define GetRegionBounds(rgn, rect) (*(rect) = (*(rgn))->rgnBBox, (rect))
/* On QD Globals */
#define GetQDGlobalsRandomSeed() (qd.randSeed)
#define GetQDGlobalsScreenBits(bits) (*(bits) = qd.screenBits, (bits))
#define GetQDGlobalsArrow(crsr) (*(crsr) = qd.arrow, (crsr))
#define GetQDGlobalsDarkGray(pat) (*(pat) = qd.dkGray, (pat))
#define GetQDGlobalsLightGray(pat) (*(pat) = qd.ltGray, (pat))
#define GetQDGlobalsGray(pat) (*(pat) = qd.gray, (pat))
#define GetQDGlobalsBlack(pat) (*(pat) = qd.black, (pat))
#define GetQDGlobalsWhite(pat) (*(pat) = qd.white, (pat))
#define GetQDGlobalsThePort() ((CGrafPtr)qd.thePort)
#define SetQDGlobalsRandomSeed(seed) (qd.randSeed = (seed))
#define SetQDGlobalsArrow(crsr) (qd.arrow = *(crsr))
#endif /* ACCESSOR_CALLS_ARE_FUNCTIONS */
static PyObject *BMObj_NewCopied(BitMapPtr);
/*

View File

@ -20,11 +20,7 @@
}} while(0)
#ifdef WITHOUT_FRAMEWORKS
#include <QDOffscreen.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_GWorldObj_New(GWorldPtr);

View File

@ -34,11 +34,7 @@ GrafPtr = OpaqueByValueType("GrafPtr", "GrafObj")
QDErr = OSErrType("QDErr", 'h')
includestuff = includestuff + """
#ifdef WITHOUT_FRAMEWORKS
#include <QDOffscreen.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_GWorldObj_New(GWorldPtr);

View File

@ -20,12 +20,7 @@
}} while(0)
#ifdef WITHOUT_FRAMEWORKS
#include <Movies.h>
#else
/* #include <Carbon/Carbon.h> */
#include <QuickTime/QuickTime.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE

View File

@ -24,12 +24,7 @@ from macsupport import *
# Create the type objects
includestuff = includestuff + """
#ifdef WITHOUT_FRAMEWORKS
#include <Movies.h>
#else
/* #include <Carbon/Carbon.h> */
#include <QuickTime/QuickTime.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE

View File

@ -23,12 +23,7 @@
#ifndef PyDoc_STR
#define PyDoc_STR(x) (x)
#endif
#ifdef WITHOUT_FRAMEWORKS
#include <Resources.h>
#include <string.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_ResObj_New(Handle);

View File

@ -28,12 +28,7 @@ includestuff = includestuff + """
#ifndef PyDoc_STR
#define PyDoc_STR(x) (x)
#endif
#ifdef WITHOUT_FRAMEWORKS
#include <Resources.h>
#include <string.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_ResObj_New(Handle);

View File

@ -23,11 +23,7 @@
}} while(0)
#ifdef WITHOUT_FRAMEWORKS
#include <Scrap.h>
#else
#include <Carbon/Carbon.h>
#endif
static PyObject *Scrap_Error;

View File

@ -29,11 +29,7 @@ includestuff = includestuff + """
#ifndef PyDoc_STR
#define PyDoc_STR(x) (x)
#endif
#ifdef WITHOUT_FRAMEWORKS
#include <Scrap.h>
#else
#include <Carbon/Carbon.h>
#endif
/*
** Generate ScrapInfo records

View File

@ -20,12 +20,7 @@
}} while(0)
#ifdef WITHOUT_FRAMEWORKS
#include <Sound.h>
#include <OSUtils.h> /* for Set(Current)A5 */
#else
#include <Carbon/Carbon.h>
#endif
/* Convert a SndCommand argument */
static int
@ -1150,11 +1145,8 @@ void init_Snd(void)
PyModule_AddObject(m, "SndChannelType", (PyObject *)&SndChannel_Type);
SPB_Type.ob_type = &PyType_Type;
if (PyType_Ready(&SPB_Type) < 0) return;
#if 0
/* This would shadow the SPB routine, which is bad news (it is important) */
Py_INCREF(&SPB_Type);
PyModule_AddObject(m, "SPB", (PyObject *)&SPB_Type);
#endif
/* Backward-compatible name */
Py_INCREF(&SPB_Type);
PyModule_AddObject(m, "SPBType", (PyObject *)&SPB_Type);

View File

@ -17,12 +17,7 @@ class SndMethod(SndMixIn, OSErrMethodGenerator): pass
# includestuff etc. are imported from macsupport
includestuff = includestuff + """
#ifdef WITHOUT_FRAMEWORKS
#include <Sound.h>
#include <OSUtils.h> /* for Set(Current)A5 */
#else
#include <Carbon/Carbon.h>
#endif
"""
initstuff = initstuff + """

View File

@ -20,11 +20,7 @@
}} while(0)
#ifdef WITHOUT_FRAMEWORKS
#include <TextEdit.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_TEObj_New(TEHandle);

View File

@ -32,11 +32,7 @@ TextStyle = OpaqueType("TextStyle", "TextStyle")
TextStyle_ptr = TextStyle
includestuff = includestuff + """
#ifdef WITHOUT_FRAMEWORKS
#include <TextEdit.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_TEObj_New(TEHandle);

View File

@ -20,11 +20,7 @@
}} while(0)
#ifdef WITHOUT_FRAMEWORKS
#include <Windows.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_WinObj_New(WindowRef);

View File

@ -58,11 +58,7 @@ PropertyCreator = OSTypeType("PropertyCreator")
PropertyTag = OSTypeType("PropertyTag")
includestuff = includestuff + """
#ifdef WITHOUT_FRAMEWORKS
#include <Windows.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_WinObj_New(WindowRef);