MacOS9isms.
/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
- PyErr_SetString(PyExc_NotImplementedError, \
- "Not available in this shared library/OS version"); \
- return NULL; \
+ PyErr_SetString(PyExc_NotImplementedError, \
+ "Not available in this shared library/OS version"); \
+ return NULL; \
}} while(0)
#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 *);
#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 *);
/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
- PyErr_SetString(PyExc_NotImplementedError, \
- "Not available in this shared library/OS version"); \
- return NULL; \
+ PyErr_SetString(PyExc_NotImplementedError, \
+ "Not available in this shared library/OS version"); \
+ return NULL; \
}} while(0)
-#ifdef WITHOUT_FRAMEWORKS
-#include <AppleHelp.h>
-#else
#include <Carbon/Carbon.h>
-#endif
static PyObject *Ah_Error;
AHTOCType = Type("AHTOCType", "h")
includestuff = includestuff + """
-#ifdef WITHOUT_FRAMEWORKS
-#include <AppleHelp.h>
-#else
#include <Carbon/Carbon.h>
-#endif
"""
/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
- PyErr_SetString(PyExc_NotImplementedError, \
- "Not available in this shared library/OS version"); \
- return NULL; \
+ PyErr_SetString(PyExc_NotImplementedError, \
+ "Not available in this shared library/OS version"); \
+ return NULL; \
}} while(0)
-#ifdef WITHOUT_FRAMEWORKS
-#include <Appearance.h>
-#else
#include <Carbon/Carbon.h>
-#endif
-
int ThemeButtonDrawInfo_Convert(PyObject *v, ThemeButtonDrawInfo *p_itself)
includestuff = includestuff + """
-#ifdef WITHOUT_FRAMEWORKS
-#include <Appearance.h>
-#else
#include <Carbon/Carbon.h>
-#endif
-
int ThemeButtonDrawInfo_Convert(PyObject *v, ThemeButtonDrawInfo *p_itself)
includestuff = r"""
-#ifdef WITHOUT_FRAMEWORKS
-#include <CarbonEvents.h>
-#else
#include <Carbon/Carbon.h>
-#endif
#include "macglue.h"
-#ifdef WITHOUT_FRAMEWORKS
-#include <CarbonEvents.h>
-#else
#include <Carbon/Carbon.h>
-#endif
#include "macglue.h"
}} 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"
# 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"
** 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"
/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
- PyErr_SetString(PyExc_NotImplementedError, \
- "Not available in this shared library/OS version"); \
- return NULL; \
+ PyErr_SetString(PyExc_NotImplementedError, \
+ "Not available in this shared library/OS version"); \
+ return NULL; \
}} 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:
# 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:
/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
- PyErr_SetString(PyExc_NotImplementedError, \
- "Not available in this shared library/OS version"); \
- return NULL; \
+ PyErr_SetString(PyExc_NotImplementedError, \
+ "Not available in this shared library/OS version"); \
+ return NULL; \
}} while(0)
-#ifdef WITHOUT_FRAMEWORKS
-#include <Components.h>
-#else
#include <Carbon/Carbon.h>
-#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_CmpObj_New(Component);
# 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);
/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
- PyErr_SetString(PyExc_NotImplementedError, \
- "Not available in this shared library/OS version"); \
- return NULL; \
+ PyErr_SetString(PyExc_NotImplementedError, \
+ "Not available in this shared library/OS version"); \
+ return NULL; \
}} 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);
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);
}} while(0)
-#ifdef WITHOUT_FRAMEWORKS
-#include <Dialogs.h>
-#else
#include <Carbon/Carbon.h>
-#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_DlgObj_New(DialogRef);
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);
/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
- PyErr_SetString(PyExc_NotImplementedError, \
- "Not available in this shared library/OS version"); \
- return NULL; \
+ PyErr_SetString(PyExc_NotImplementedError, \
+ "Not available in this shared library/OS version"); \
+ return NULL; \
}} while(0)
-#ifdef WITHOUT_FRAMEWORKS
-#include <Drag.h>
-#else
#include <Carbon/Carbon.h>
-#endif
/* Callback glue routines */
DragTrackingHandlerUPP dragglue_TrackingHandlerUPP;
DragTrackingMessage = Type("DragTrackingMessage", "h")
includestuff = includestuff + """
-#ifdef WITHOUT_FRAMEWORKS
-#include <Drag.h>
-#else
#include <Carbon/Carbon.h>
-#endif
/* Callback glue routines */
DragTrackingHandlerUPP dragglue_TrackingHandlerUPP;
/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
- PyErr_SetString(PyExc_NotImplementedError, \
- "Not available in this shared library/OS version"); \
- return NULL; \
+ PyErr_SetString(PyExc_NotImplementedError, \
+ "Not available in this shared library/OS version"); \
+ return NULL; \
}} while(0)
-#ifdef WITHOUT_FRAMEWORKS
-#include <Events.h>
-#else
#include <Carbon/Carbon.h>
-#endif
static PyObject *Evt_Error;
EventKind = Type("EventKind", "H")
includestuff = includestuff + """
-#ifdef WITHOUT_FRAMEWORKS
-#include <Events.h>
-#else
#include <Carbon/Carbon.h>
-#endif
"""
}} 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);
#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);
/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
- PyErr_SetString(PyExc_NotImplementedError, \
- "Not available in this shared library/OS version"); \
- return NULL; \
+ PyErr_SetString(PyExc_NotImplementedError, \
+ "Not available in this shared library/OS version"); \
+ return NULL; \
}} while(0)
-#ifdef WITHOUT_FRAMEWORKS
-#include <Fonts.h>
-#else
#include <Carbon/Carbon.h>
-#endif
/*
includestuff = includestuff + """
-#ifdef WITHOUT_FRAMEWORKS
-#include <Fonts.h>
-#else
#include <Carbon/Carbon.h>
-#endif
/*
/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
- PyErr_SetString(PyExc_NotImplementedError, \
- "Not available in this shared library/OS version"); \
- return NULL; \
+ PyErr_SetString(PyExc_NotImplementedError, \
+ "Not available in this shared library/OS version"); \
+ return NULL; \
}} while(0)
-#ifdef WITHOUT_FRAMEWORKS
-#include <Folders.h>
-#else
#include <Carbon/Carbon.h>
-#endif
static PyObject *Folder_Error;
includestuff = includestuff + """
-#ifdef WITHOUT_FRAMEWORKS
-#include <Folders.h>
-#else
#include <Carbon/Carbon.h>
-#endif
"""
/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
- PyErr_SetString(PyExc_NotImplementedError, \
- "Not available in this shared library/OS version"); \
- return NULL; \
+ PyErr_SetString(PyExc_NotImplementedError, \
+ "Not available in this shared library/OS version"); \
+ return NULL; \
}} while(0)
#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;
#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):
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
-#ifdef WITHOUT_FRAMEWORKS
-#include <IBCarbonRuntime.h>
-#else
#include <Carbon/Carbon.h>
-#endif /* WITHOUT_FRAMEWORKS */
#include "macglue.h"
#ifdef USE_TOOLBOX_OBJECT_GLUE
/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
- PyErr_SetString(PyExc_NotImplementedError, \
- "Not available in this shared library/OS version"); \
- return NULL; \
+ PyErr_SetString(PyExc_NotImplementedError, \
+ "Not available in this shared library/OS version"); \
+ return NULL; \
}} while(0)
-#ifdef WITHOUT_FRAMEWORKS
-#include <Icons.h>
-#else
#include <Carbon/Carbon.h>
-#endif
static PyObject *Icn_Error;
#EventKind = Type("EventKind", "H")
includestuff = includestuff + """
-#ifdef WITHOUT_FRAMEWORKS
-#include <Icons.h>
-#else
#include <Carbon/Carbon.h>
-#endif
"""
/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
- PyErr_SetString(PyExc_NotImplementedError, \
- "Not available in this shared library/OS version"); \
- return NULL; \
+ PyErr_SetString(PyExc_NotImplementedError, \
+ "Not available in this shared library/OS version"); \
+ return NULL; \
}} while(0)
-#ifdef WITHOUT_FRAMEWORKS
-#include <Lists.h>
-#else
#include <Carbon/Carbon.h>
-#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_ListObj_New(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)
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);
#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)
/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
- PyErr_SetString(PyExc_NotImplementedError, \
- "Not available in this shared library/OS version"); \
- return NULL; \
+ PyErr_SetString(PyExc_NotImplementedError, \
+ "Not available in this shared library/OS version"); \
+ return NULL; \
}} 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
#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)
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
#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)
/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
- PyErr_SetString(PyExc_NotImplementedError, \
- "Not available in this shared library/OS version"); \
- return NULL; \
+ PyErr_SetString(PyExc_NotImplementedError, \
+ "Not available in this shared library/OS version"); \
+ return NULL; \
}} 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);
# 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);
}} while(0)
-#ifdef WITHOUT_FRAMEWORKS
-#include <QuickDraw.h>
-#else
#include <Carbon/Carbon.h>
-#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_GrafObj_New(GrafPtr);
#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);
/*
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);
#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);
/*
/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
- PyErr_SetString(PyExc_NotImplementedError, \
- "Not available in this shared library/OS version"); \
- return NULL; \
+ PyErr_SetString(PyExc_NotImplementedError, \
+ "Not available in this shared library/OS version"); \
+ return NULL; \
}} while(0)
-#ifdef WITHOUT_FRAMEWORKS
-#include <QDOffscreen.h>
-#else
#include <Carbon/Carbon.h>
-#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_GWorldObj_New(GWorldPtr);
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);
}} while(0)
-#ifdef WITHOUT_FRAMEWORKS
-#include <Movies.h>
-#else
-/* #include <Carbon/Carbon.h> */
#include <QuickTime/QuickTime.h>
-#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
# 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
/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
- PyErr_SetString(PyExc_NotImplementedError, \
- "Not available in this shared library/OS version"); \
- return NULL; \
+ PyErr_SetString(PyExc_NotImplementedError, \
+ "Not available in this shared library/OS version"); \
+ return NULL; \
}} while(0)
#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);
#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);
}} while(0)
-#ifdef WITHOUT_FRAMEWORKS
-#include <Scrap.h>
-#else
#include <Carbon/Carbon.h>
-#endif
static PyObject *Scrap_Error;
#ifndef PyDoc_STR
#define PyDoc_STR(x) (x)
#endif
-#ifdef WITHOUT_FRAMEWORKS
-#include <Scrap.h>
-#else
#include <Carbon/Carbon.h>
-#endif
/*
** Generate ScrapInfo records
/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
- PyErr_SetString(PyExc_NotImplementedError, \
- "Not available in this shared library/OS version"); \
- return NULL; \
+ PyErr_SetString(PyExc_NotImplementedError, \
+ "Not available in this shared library/OS version"); \
+ return NULL; \
}} 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
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);
# 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 + """
/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
- PyErr_SetString(PyExc_NotImplementedError, \
- "Not available in this shared library/OS version"); \
- return NULL; \
+ PyErr_SetString(PyExc_NotImplementedError, \
+ "Not available in this shared library/OS version"); \
+ return NULL; \
}} while(0)
-#ifdef WITHOUT_FRAMEWORKS
-#include <TextEdit.h>
-#else
#include <Carbon/Carbon.h>
-#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_TEObj_New(TEHandle);
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);
}} while(0)
-#ifdef WITHOUT_FRAMEWORKS
-#include <Windows.h>
-#else
#include <Carbon/Carbon.h>
-#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_WinObj_New(WindowRef);
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);