PyObject * PyMac_LoadCodeResourceModule(char *, char *); /* Load 'PYD ' resource from file */
struct filedescr *PyMac_FindModuleExtension(char *, size_t *, char *); /* Look for module in single folder */
-#if TARGET_API_MAC_OS8
-int PyMac_GetDirectory(FSSpec *dirfss, char *prompt); /* Ask user for a directory */
-void PyMac_PromptGetFile(short numTypes, ConstSFTypeListPtr typeList,
- StandardFileReply *reply, char *prompt); /* Ask user for file, with prompt */
-#endif /* TARGET_API_MAC_OS8 */
-
void PyMac_InitApplet(void); /* Initialize and run an Applet */
void PyMac_Initialize(void); /* Initialize function for embedding Python */
PyErr_Mac(ErrorObject, err);
return NULL;
}
-#if TARGET_API_MAC_CARBON
if (err=AEGetDescData(&desc, &fss, sizeof(FSSpec))) {
Py_DECREF(rv);
PyErr_Mac(ErrorObject, err);
return NULL;
}
-#else
- memcpy((void *)&fss, (void *)*desc.dataHandle, sizeof(FSSpec));
-#endif
rvitem = PyMac_BuildFSSpec(&fss);
PyList_SetItem(rv, i, rvitem);
AEDisposeDesc(&desc);
return _res;
}
-#if TARGET_API_MAC_CARBON
-
static PyObject *AEDesc_AEGetDescDataSize(AEDescObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
_rv);
return _res;
}
-#endif
static PyObject *AEDesc_AESend(AEDescObject *_self, PyObject *_args)
{
PyDoc_STR("(AEKeyword theAEKeyword, DescType typeCode, Buffer dataPtr) -> None")},
{"AEPutAttributeDesc", (PyCFunction)AEDesc_AEPutAttributeDesc, 1,
PyDoc_STR("(AEKeyword theAEKeyword, AEDesc theAEDesc) -> None")},
-
-#if TARGET_API_MAC_CARBON
{"AEGetDescDataSize", (PyCFunction)AEDesc_AEGetDescDataSize, 1,
PyDoc_STR("() -> (Size _rv)")},
-#endif
{"AESend", (PyCFunction)AEDesc_AESend, 1,
PyDoc_STR("(AESendMode sendMode, AESendPriority sendPriority, long timeOutInTicks) -> (AppleEvent reply)")},
{"AEResetTimer", (PyCFunction)AEDesc_AEResetTimer, 1,
return _res;
}
-#if TARGET_API_MAC_CARBON
-
static PyObject *AE_AEReplaceDescData(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
AEDesc_New, &theAEDesc);
return _res;
}
-#endif
static PyObject *AE_AEProcessAppleEvent(PyObject *_self, PyObject *_args)
{
PyDoc_STR("(Buffer factoringPtr, Boolean isRecord) -> (AEDescList resultList)")},
{"AECreateAppleEvent", (PyCFunction)AE_AECreateAppleEvent, 1,
PyDoc_STR("(AEEventClass theAEEventClass, AEEventID theAEEventID, AEAddressDesc target, AEReturnID returnID, AETransactionID transactionID) -> (AppleEvent result)")},
-
-#if TARGET_API_MAC_CARBON
{"AEReplaceDescData", (PyCFunction)AE_AEReplaceDescData, 1,
PyDoc_STR("(DescType typeCode, Buffer dataPtr) -> (AEDesc theAEDesc)")},
-#endif
{"AEProcessAppleEvent", (PyCFunction)AE_AEProcessAppleEvent, 1,
PyDoc_STR("(EventRecord theEventRecord) -> None")},
{"AEGetInteractionAllowed", (PyCFunction)AE_AEGetInteractionAllowed, 1,
"kAEUseStandardDispatch",
]
- def makegreylist(self):
- return [
- ('#if TARGET_API_MAC_CARBON', [
- 'AEGetDescDataSize',
- 'AEReplaceDescData',
- ])]
def makeblacklisttypes(self):
return [
"ProcPtr",
return _res;
}
-#if TARGET_API_MAC_CARBON
-
static PyObject *App_DrawThemeTextBox(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *App_TruncateThemeText(PyObject *_self, PyObject *_args)
{
outTruncated);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *App_GetThemeTextDimensions(PyObject *_self, PyObject *_args)
{
outBaseline);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *App_GetThemeTextShadowOutset(PyObject *_self, PyObject *_args)
{
PyMac_BuildRect, &outOutset);
return _res;
}
-#endif
static PyObject *App_DrawThemeScrollBarArrows(PyObject *_self, PyObject *_args)
{
return _res;
}
-#if TARGET_API_MAC_CARBON
-
static PyObject *App_GetThemeMetric(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
outMetric);
return _res;
}
-#endif
static PyMethodDef App_methods[] = {
{"RegisterAppearanceClient", (PyCFunction)App_RegisterAppearanceClient, 1,
PyDoc_STR("() -> (ThemeCheckBoxStyle outStyle)")},
{"UseThemeFont", (PyCFunction)App_UseThemeFont, 1,
PyDoc_STR("(ThemeFontID inFontID, ScriptCode inScript) -> None")},
-
-#if TARGET_API_MAC_CARBON
{"DrawThemeTextBox", (PyCFunction)App_DrawThemeTextBox, 1,
PyDoc_STR("(CFStringRef inString, ThemeFontID inFontID, ThemeDrawState inState, Boolean inWrapToWidth, Rect inBoundingBox, SInt16 inJust) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"TruncateThemeText", (PyCFunction)App_TruncateThemeText, 1,
PyDoc_STR("(CFMutableStringRef inString, ThemeFontID inFontID, ThemeDrawState inState, SInt16 inPixelWidthLimit, TruncCode inTruncWhere) -> (Boolean outTruncated)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetThemeTextDimensions", (PyCFunction)App_GetThemeTextDimensions, 1,
PyDoc_STR("(CFStringRef inString, ThemeFontID inFontID, ThemeDrawState inState, Boolean inWrapToWidth, Point ioBounds) -> (Point ioBounds, SInt16 outBaseline)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetThemeTextShadowOutset", (PyCFunction)App_GetThemeTextShadowOutset, 1,
PyDoc_STR("(ThemeFontID inFontID, ThemeDrawState inState) -> (Rect outOutset)")},
-#endif
{"DrawThemeScrollBarArrows", (PyCFunction)App_DrawThemeScrollBarArrows, 1,
PyDoc_STR("(Rect bounds, ThemeTrackEnableState enableState, ThemeTrackPressState pressState, Boolean isHoriz) -> (Rect trackBounds)")},
{"GetThemeScrollBarTrackRect", (PyCFunction)App_GetThemeScrollBarTrackRect, 1,
PyDoc_STR("(ThemeBrush inBrush, SInt16 inDepth, Boolean inColorDev) -> (RGBColor outColor)")},
{"GetThemeTextColor", (PyCFunction)App_GetThemeTextColor, 1,
PyDoc_STR("(ThemeTextColor inColor, SInt16 inDepth, Boolean inColorDev) -> (RGBColor outColor)")},
-
-#if TARGET_API_MAC_CARBON
{"GetThemeMetric", (PyCFunction)App_GetThemeMetric, 1,
PyDoc_STR("(ThemeMetric inMetric) -> (SInt32 outMetric)")},
-#endif
{NULL, NULL, 0}
};
"appearanceBadCursorIndexErr",
]
- def makegreylist(self):
- return [
- ('#if TARGET_API_MAC_CARBON', [
- 'GetThemeMetric',
- 'GetThemeTextShadowOutset',
- 'GetThemeTextDimensions',
- 'TruncateThemeText',
- 'DrawThemeTextBox',
- ])]
-
def makeblacklisttypes(self):
return [
"MenuTitleDrawingUPP",
return _res;
}
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *CmpInstObj_GetComponentInstanceA5(ComponentInstanceObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- long _rv;
-#ifndef GetComponentInstanceA5
- PyMac_PRECHECK(GetComponentInstanceA5);
-#endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = GetComponentInstanceA5(_self->ob_itself);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
-}
-#endif
-
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *CmpInstObj_SetComponentInstanceA5(ComponentInstanceObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- long theA5;
-#ifndef SetComponentInstanceA5
- PyMac_PRECHECK(SetComponentInstanceA5);
-#endif
- if (!PyArg_ParseTuple(_args, "l",
- &theA5))
- return NULL;
- SetComponentInstanceA5(_self->ob_itself,
- theA5);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
-}
-#endif
-
static PyObject *CmpInstObj_ComponentFunctionImplemented(ComponentInstanceObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
PyDoc_STR("() -> (Handle _rv)")},
{"SetComponentInstanceStorage", (PyCFunction)CmpInstObj_SetComponentInstanceStorage, 1,
PyDoc_STR("(Handle theStorage) -> None")},
-
-#if !TARGET_API_MAC_CARBON
- {"GetComponentInstanceA5", (PyCFunction)CmpInstObj_GetComponentInstanceA5, 1,
- PyDoc_STR("() -> (long _rv)")},
-#endif
-
-#if !TARGET_API_MAC_CARBON
- {"SetComponentInstanceA5", (PyCFunction)CmpInstObj_SetComponentInstanceA5, 1,
- PyDoc_STR("(long theA5) -> None")},
-#endif
{"ComponentFunctionImplemented", (PyCFunction)CmpInstObj_ComponentFunctionImplemented, 1,
PyDoc_STR("(short ftnNumber) -> (long _rv)")},
{"GetComponentVersion", (PyCFunction)CmpInstObj_GetComponentVersion, 1,
"OpenAComponent",
"GetComponentPublicResource", # Missing in CW Pro 6
"CallComponentGetPublicResource", # Missing in CW Pro 6
+ 'SetComponentInstanceA5',
+ 'GetComponentInstanceA5',
]
- def makegreylist(self):
- return [
- ('#if !TARGET_API_MAC_CARBON', [
- 'SetComponentInstanceA5',
- 'GetComponentInstanceA5',
- ])]
-
def makeblacklisttypes(self):
return [
"ResourceSpec",
#define as_Control(h) ((ControlHandle)h)
#define as_Resource(ctl) ((Handle)ctl)
-#if TARGET_API_MAC_CARBON
#define GetControlRect(ctl, rectp) GetControlBounds(ctl, rectp)
-#else
-#define GetControlRect(ctl, rectp) (*(rectp) = ((*(ctl))->contrlRect))
-#endif
#define MAXTABS 32 /* maximum number of tabs that we support in a tabs control */
/*
return _res;
}
-#if TARGET_API_MAC_CARBON
-
static PyObject *CtlObj_HandleControlContextualMenuClick(ControlObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
menuDisplayed);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_GetControlClickActivation(ControlObject *_self, PyObject *_args)
{
outResult);
return _res;
}
-#endif
static PyObject *CtlObj_HandleControlKey(ControlObject *_self, PyObject *_args)
{
return _res;
}
-#if TARGET_API_MAC_CARBON
-
static PyObject *CtlObj_HandleControlSetCursor(ControlObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
cursorWasSet);
return _res;
}
-#endif
static PyObject *CtlObj_MoveControl(ControlObject *_self, PyObject *_args)
{
return _res;
}
-#if TARGET_API_MAC_CARBON
-
static PyObject *CtlObj_SetControlTitleWithCFString(ControlObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_CopyControlTitleAsCFString(ControlObject *_self, PyObject *_args)
{
CFStringRefObj_New, outString);
return _res;
}
-#endif
static PyObject *CtlObj_GetControlValue(ControlObject *_self, PyObject *_args)
{
return _res;
}
-#if TARGET_API_MAC_CARBON
-
static PyObject *CtlObj_SetControlID(ControlObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_GetControlID(ControlObject *_self, PyObject *_args)
{
PyControlID_New, &outID);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_SetControlCommandID(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_GetControlCommandID(ControlObject *_self, PyObject *_args)
{
outCommandID);
return _res;
}
-#endif
static PyObject *CtlObj_RemoveControlProperty(ControlObject *_self, PyObject *_args)
{
return _res;
}
-#if TARGET_API_MAC_CARBON
-
static PyObject *CtlObj_GetControlPropertyAttributes(ControlObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
attributes);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_ChangeControlPropertyAttributes(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
static PyObject *CtlObj_GetControlRegion(ControlObject *_self, PyObject *_args)
{
return _res;
}
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *CtlObj_GetAuxiliaryControlRecord(ControlObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- Boolean _rv;
- AuxCtlHandle acHndl;
-#ifndef GetAuxiliaryControlRecord
- PyMac_PRECHECK(GetAuxiliaryControlRecord);
-#endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = GetAuxiliaryControlRecord(_self->ob_itself,
- &acHndl);
- _res = Py_BuildValue("bO&",
- _rv,
- ResObj_New, acHndl);
- return _res;
-}
-#endif
-
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *CtlObj_SetControlColor(ControlObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- CCTabHandle newColorTable;
-#ifndef SetControlColor
- PyMac_PRECHECK(SetControlColor);
-#endif
- if (!PyArg_ParseTuple(_args, "O&",
- ResObj_Convert, &newColorTable))
- return NULL;
- SetControlColor(_self->ob_itself,
- newColorTable);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
-}
-#endif
-
static PyObject *CtlObj_EmbedControl(ControlObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
return _res;
}
-#if TARGET_API_MAC_CARBON
-
static PyObject *CtlObj_HandleControlDragTracking(ControlObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
outLikesDrag);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_HandleControlDragReceive(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_SetControlDragTrackingEnabled(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_IsControlDragTrackingEnabled(ControlObject *_self, PyObject *_args)
{
tracks);
return _res;
}
-#endif
-
-#if ACCESSOR_CALLS_ARE_FUNCTIONS
static PyObject *CtlObj_GetControlBounds(ControlObject *_self, PyObject *_args)
{
PyMac_BuildRect, &bounds);
return _res;
}
-#endif
-
-#if ACCESSOR_CALLS_ARE_FUNCTIONS
static PyObject *CtlObj_IsControlHilited(ControlObject *_self, PyObject *_args)
{
_rv);
return _res;
}
-#endif
-
-#if ACCESSOR_CALLS_ARE_FUNCTIONS
static PyObject *CtlObj_GetControlHilite(ControlObject *_self, PyObject *_args)
{
_rv);
return _res;
}
-#endif
-
-#if ACCESSOR_CALLS_ARE_FUNCTIONS
static PyObject *CtlObj_GetControlOwner(ControlObject *_self, PyObject *_args)
{
WinObj_New, _rv);
return _res;
}
-#endif
-
-#if ACCESSOR_CALLS_ARE_FUNCTIONS
static PyObject *CtlObj_GetControlDataHandle(ControlObject *_self, PyObject *_args)
{
ResObj_New, _rv);
return _res;
}
-#endif
-
-#if ACCESSOR_CALLS_ARE_FUNCTIONS
static PyObject *CtlObj_GetControlPopupMenuHandle(ControlObject *_self, PyObject *_args)
{
MenuObj_New, _rv);
return _res;
}
-#endif
-
-#if ACCESSOR_CALLS_ARE_FUNCTIONS
static PyObject *CtlObj_GetControlPopupMenuID(ControlObject *_self, PyObject *_args)
{
_rv);
return _res;
}
-#endif
-
-#if ACCESSOR_CALLS_ARE_FUNCTIONS
static PyObject *CtlObj_SetControlDataHandle(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if ACCESSOR_CALLS_ARE_FUNCTIONS
static PyObject *CtlObj_SetControlBounds(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if ACCESSOR_CALLS_ARE_FUNCTIONS
static PyObject *CtlObj_SetControlPopupMenuHandle(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if ACCESSOR_CALLS_ARE_FUNCTIONS
static PyObject *CtlObj_SetControlPopupMenuID(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
static PyObject *CtlObj_GetBevelButtonMenuValue(ControlObject *_self, PyObject *_args)
{
return _res;
}
-#if TARGET_API_MAC_CARBON
-
static PyObject *CtlObj_SetBevelButtonContentInfo(ControlObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
_res = Py_None;
return _res;
}
-#endif
static PyObject *CtlObj_SetBevelButtonTransform(ControlObject *_self, PyObject *_args)
{
return _res;
}
-#if TARGET_API_MAC_CARBON
-
static PyObject *CtlObj_SetImageWellContentInfo(ControlObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
_res = Py_None;
return _res;
}
-#endif
static PyObject *CtlObj_SetImageWellTransform(ControlObject *_self, PyObject *_args)
{
return _res;
}
-#if TARGET_API_MAC_CARBON
-
static PyObject *CtlObj_GetDataBrowserViewStyle(ControlObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
PyMac_BuildOSType, style);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_SetDataBrowserViewStyle(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_EnableDataBrowserEditCommand(ControlObject *_self, PyObject *_args)
{
_rv);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_ExecuteDataBrowserEditCommand(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_GetDataBrowserSelectionAnchor(ControlObject *_self, PyObject *_args)
{
last);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_MoveDataBrowserSelectionAnchor(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_OpenDataBrowserContainer(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_CloseDataBrowserContainer(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_SortDataBrowserContainer(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_GetDataBrowserItems(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_GetDataBrowserItemCount(ControlObject *_self, PyObject *_args)
{
numItems);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_IsDataBrowserItemSelected(ControlObject *_self, PyObject *_args)
{
_rv);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_GetDataBrowserItemState(ControlObject *_self, PyObject *_args)
{
state);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_RevealDataBrowserItem(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_SetDataBrowserActiveItems(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_GetDataBrowserActiveItems(ControlObject *_self, PyObject *_args)
{
active);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_SetDataBrowserScrollBarInset(ControlObject *_self, PyObject *_args)
{
PyMac_BuildRect, &insetRect);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_GetDataBrowserScrollBarInset(ControlObject *_self, PyObject *_args)
{
PyMac_BuildRect, &insetRect);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_SetDataBrowserTarget(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_GetDataBrowserTarget(ControlObject *_self, PyObject *_args)
{
target);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_SetDataBrowserSortOrder(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_GetDataBrowserSortOrder(ControlObject *_self, PyObject *_args)
{
order);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_SetDataBrowserScrollPosition(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_GetDataBrowserScrollPosition(ControlObject *_self, PyObject *_args)
{
left);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_SetDataBrowserHasScrollBars(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_GetDataBrowserHasScrollBars(ControlObject *_self, PyObject *_args)
{
vert);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_SetDataBrowserSortProperty(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_GetDataBrowserSortProperty(ControlObject *_self, PyObject *_args)
{
property);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_SetDataBrowserSelectionFlags(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_GetDataBrowserSelectionFlags(ControlObject *_self, PyObject *_args)
{
selectionFlags);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_SetDataBrowserPropertyFlags(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_GetDataBrowserPropertyFlags(ControlObject *_self, PyObject *_args)
{
flags);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_SetDataBrowserEditText(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
#if TARGET_API_MAC_OSX
}
#endif
-#if TARGET_API_MAC_CARBON
-
static PyObject *CtlObj_GetDataBrowserEditText(ControlObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_SetDataBrowserEditItem(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_GetDataBrowserEditItem(ControlObject *_self, PyObject *_args)
{
property);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_GetDataBrowserItemPartBounds(ControlObject *_self, PyObject *_args)
{
PyMac_BuildRect, &bounds);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_RemoveDataBrowserTableViewColumn(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_GetDataBrowserTableViewColumnCount(ControlObject *_self, PyObject *_args)
{
numColumns);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_SetDataBrowserTableViewHiliteStyle(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_GetDataBrowserTableViewHiliteStyle(ControlObject *_self, PyObject *_args)
{
hiliteStyle);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_SetDataBrowserTableViewRowHeight(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_GetDataBrowserTableViewRowHeight(ControlObject *_self, PyObject *_args)
{
height);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_SetDataBrowserTableViewColumnWidth(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_GetDataBrowserTableViewColumnWidth(ControlObject *_self, PyObject *_args)
{
width);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_SetDataBrowserTableViewItemRowHeight(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_GetDataBrowserTableViewItemRowHeight(ControlObject *_self, PyObject *_args)
{
height);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_SetDataBrowserTableViewNamedColumnWidth(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_GetDataBrowserTableViewNamedColumnWidth(ControlObject *_self, PyObject *_args)
{
width);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_SetDataBrowserTableViewGeometry(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_GetDataBrowserTableViewGeometry(ControlObject *_self, PyObject *_args)
{
variableHeightRows);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_GetDataBrowserTableViewItemID(ControlObject *_self, PyObject *_args)
{
item);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_SetDataBrowserTableViewItemRow(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_GetDataBrowserTableViewItemRow(ControlObject *_self, PyObject *_args)
{
row);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_SetDataBrowserTableViewColumnPosition(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_GetDataBrowserTableViewColumnPosition(ControlObject *_self, PyObject *_args)
{
position);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_GetDataBrowserTableViewColumnProperty(ControlObject *_self, PyObject *_args)
{
property);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_AutoSizeDataBrowserListViewColumns(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_AddDataBrowserListViewColumn(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_SetDataBrowserListViewHeaderBtnHeight(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_GetDataBrowserListViewHeaderBtnHeight(ControlObject *_self, PyObject *_args)
{
height);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_SetDataBrowserListViewUsePlainBackground(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_GetDataBrowserListViewUsePlainBackground(ControlObject *_self, PyObject *_args)
{
usePlainBackground);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_SetDataBrowserListViewDisclosureColumn(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_GetDataBrowserListViewDisclosureColumn(ControlObject *_self, PyObject *_args)
{
expandableRows);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_GetDataBrowserColumnViewPath(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_GetDataBrowserColumnViewPathLength(ControlObject *_self, PyObject *_args)
{
pathLength);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_SetDataBrowserColumnViewDisplayType(ControlObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *CtlObj_GetDataBrowserColumnViewDisplayType(ControlObject *_self, PyObject *_args)
{
PyMac_BuildOSType, propertyType);
return _res;
}
-#endif
static PyObject *CtlObj_as_Resource(ControlObject *_self, PyObject *_args)
{
}
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *CtlObj_GetPopupData(ControlObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
-
- PopupPrivateDataHandle hdl;
-
- if ( (*_self->ob_itself)->contrlData == NULL ) {
- PyErr_SetString(Ctl_Error, "No contrlData handle in control");
- return 0;
- }
- hdl = (PopupPrivateDataHandle)(*_self->ob_itself)->contrlData;
- HLock((Handle)hdl);
- _res = Py_BuildValue("O&i", MenuObj_New, (*hdl)->mHandle, (int)(*hdl)->mID);
- HUnlock((Handle)hdl);
- return _res;
-
-}
-#endif
-
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *CtlObj_SetPopupData(ControlObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
-
- PopupPrivateDataHandle hdl;
- MenuHandle mHandle;
- short mID;
-
- if (!PyArg_ParseTuple(_args, "O&h", MenuObj_Convert, &mHandle, &mID) )
- return 0;
- if ( (*_self->ob_itself)->contrlData == NULL ) {
- PyErr_SetString(Ctl_Error, "No contrlData handle in control");
- return 0;
- }
- hdl = (PopupPrivateDataHandle)(*_self->ob_itself)->contrlData;
- (*hdl)->mHandle = mHandle;
- (*hdl)->mID = mID;
- Py_INCREF(Py_None);
- return Py_None;
-
-}
-#endif
-
static PyMethodDef CtlObj_methods[] = {
{"HiliteControl", (PyCFunction)CtlObj_HiliteControl, 1,
PyDoc_STR("(ControlPartCode hiliteState) -> None")},
PyDoc_STR("(Point startPoint, Rect limitRect, Rect slopRect, DragConstraint axis) -> None")},
{"TestControl", (PyCFunction)CtlObj_TestControl, 1,
PyDoc_STR("(Point testPoint) -> (ControlPartCode _rv)")},
-
-#if TARGET_API_MAC_CARBON
{"HandleControlContextualMenuClick", (PyCFunction)CtlObj_HandleControlContextualMenuClick, 1,
PyDoc_STR("(Point inWhere) -> (Boolean menuDisplayed)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetControlClickActivation", (PyCFunction)CtlObj_GetControlClickActivation, 1,
PyDoc_STR("(Point inWhere, EventModifiers inModifiers) -> (ClickActivationResult outResult)")},
-#endif
{"HandleControlKey", (PyCFunction)CtlObj_HandleControlKey, 1,
PyDoc_STR("(SInt16 inKeyCode, SInt16 inCharCode, EventModifiers inModifiers) -> (ControlPartCode _rv)")},
-
-#if TARGET_API_MAC_CARBON
{"HandleControlSetCursor", (PyCFunction)CtlObj_HandleControlSetCursor, 1,
PyDoc_STR("(Point localPoint, EventModifiers modifiers) -> (Boolean cursorWasSet)")},
-#endif
{"MoveControl", (PyCFunction)CtlObj_MoveControl, 1,
PyDoc_STR("(SInt16 h, SInt16 v) -> None")},
{"SizeControl", (PyCFunction)CtlObj_SizeControl, 1,
PyDoc_STR("(Str255 title) -> None")},
{"GetControlTitle", (PyCFunction)CtlObj_GetControlTitle, 1,
PyDoc_STR("() -> (Str255 title)")},
-
-#if TARGET_API_MAC_CARBON
{"SetControlTitleWithCFString", (PyCFunction)CtlObj_SetControlTitleWithCFString, 1,
PyDoc_STR("(CFStringRef inString) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"CopyControlTitleAsCFString", (PyCFunction)CtlObj_CopyControlTitleAsCFString, 1,
PyDoc_STR("() -> (CFStringRef outString)")},
-#endif
{"GetControlValue", (PyCFunction)CtlObj_GetControlValue, 1,
PyDoc_STR("() -> (SInt16 _rv)")},
{"SetControlValue", (PyCFunction)CtlObj_SetControlValue, 1,
PyDoc_STR("(SInt32 newMinimum) -> None")},
{"IsValidControlHandle", (PyCFunction)CtlObj_IsValidControlHandle, 1,
PyDoc_STR("() -> (Boolean _rv)")},
-
-#if TARGET_API_MAC_CARBON
{"SetControlID", (PyCFunction)CtlObj_SetControlID, 1,
PyDoc_STR("(ControlID inID) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetControlID", (PyCFunction)CtlObj_GetControlID, 1,
PyDoc_STR("() -> (ControlID outID)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"SetControlCommandID", (PyCFunction)CtlObj_SetControlCommandID, 1,
PyDoc_STR("(UInt32 inCommandID) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetControlCommandID", (PyCFunction)CtlObj_GetControlCommandID, 1,
PyDoc_STR("() -> (UInt32 outCommandID)")},
-#endif
{"RemoveControlProperty", (PyCFunction)CtlObj_RemoveControlProperty, 1,
PyDoc_STR("(OSType propertyCreator, OSType propertyTag) -> None")},
-
-#if TARGET_API_MAC_CARBON
{"GetControlPropertyAttributes", (PyCFunction)CtlObj_GetControlPropertyAttributes, 1,
PyDoc_STR("(OSType propertyCreator, OSType propertyTag) -> (UInt32 attributes)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"ChangeControlPropertyAttributes", (PyCFunction)CtlObj_ChangeControlPropertyAttributes, 1,
PyDoc_STR("(OSType propertyCreator, OSType propertyTag, UInt32 attributesToSet, UInt32 attributesToClear) -> None")},
-#endif
{"GetControlRegion", (PyCFunction)CtlObj_GetControlRegion, 1,
PyDoc_STR("(ControlPartCode inPart, RgnHandle outRegion) -> None")},
{"GetControlVariant", (PyCFunction)CtlObj_GetControlVariant, 1,
PyDoc_STR("(SInt32 data) -> None")},
{"GetControlReference", (PyCFunction)CtlObj_GetControlReference, 1,
PyDoc_STR("() -> (SInt32 _rv)")},
-
-#if !TARGET_API_MAC_CARBON
- {"GetAuxiliaryControlRecord", (PyCFunction)CtlObj_GetAuxiliaryControlRecord, 1,
- PyDoc_STR("() -> (Boolean _rv, AuxCtlHandle acHndl)")},
-#endif
-
-#if !TARGET_API_MAC_CARBON
- {"SetControlColor", (PyCFunction)CtlObj_SetControlColor, 1,
- PyDoc_STR("(CCTabHandle newColorTable) -> None")},
-#endif
{"EmbedControl", (PyCFunction)CtlObj_EmbedControl, 1,
PyDoc_STR("(ControlHandle inContainer) -> None")},
{"AutoEmbedControl", (PyCFunction)CtlObj_AutoEmbedControl, 1,
PyDoc_STR("() -> (UInt32 outFeatures)")},
{"GetControlDataSize", (PyCFunction)CtlObj_GetControlDataSize, 1,
PyDoc_STR("(ControlPartCode inPart, ResType inTagName) -> (Size outMaxSize)")},
-
-#if TARGET_API_MAC_CARBON
{"HandleControlDragTracking", (PyCFunction)CtlObj_HandleControlDragTracking, 1,
PyDoc_STR("(DragTrackingMessage inMessage, DragReference inDrag) -> (Boolean outLikesDrag)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"HandleControlDragReceive", (PyCFunction)CtlObj_HandleControlDragReceive, 1,
PyDoc_STR("(DragReference inDrag) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"SetControlDragTrackingEnabled", (PyCFunction)CtlObj_SetControlDragTrackingEnabled, 1,
PyDoc_STR("(Boolean tracks) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"IsControlDragTrackingEnabled", (PyCFunction)CtlObj_IsControlDragTrackingEnabled, 1,
PyDoc_STR("() -> (Boolean tracks)")},
-#endif
-
-#if ACCESSOR_CALLS_ARE_FUNCTIONS
{"GetControlBounds", (PyCFunction)CtlObj_GetControlBounds, 1,
PyDoc_STR("() -> (Rect bounds)")},
-#endif
-
-#if ACCESSOR_CALLS_ARE_FUNCTIONS
{"IsControlHilited", (PyCFunction)CtlObj_IsControlHilited, 1,
PyDoc_STR("() -> (Boolean _rv)")},
-#endif
-
-#if ACCESSOR_CALLS_ARE_FUNCTIONS
{"GetControlHilite", (PyCFunction)CtlObj_GetControlHilite, 1,
PyDoc_STR("() -> (UInt16 _rv)")},
-#endif
-
-#if ACCESSOR_CALLS_ARE_FUNCTIONS
{"GetControlOwner", (PyCFunction)CtlObj_GetControlOwner, 1,
PyDoc_STR("() -> (WindowPtr _rv)")},
-#endif
-
-#if ACCESSOR_CALLS_ARE_FUNCTIONS
{"GetControlDataHandle", (PyCFunction)CtlObj_GetControlDataHandle, 1,
PyDoc_STR("() -> (Handle _rv)")},
-#endif
-
-#if ACCESSOR_CALLS_ARE_FUNCTIONS
{"GetControlPopupMenuHandle", (PyCFunction)CtlObj_GetControlPopupMenuHandle, 1,
PyDoc_STR("() -> (MenuHandle _rv)")},
-#endif
-
-#if ACCESSOR_CALLS_ARE_FUNCTIONS
{"GetControlPopupMenuID", (PyCFunction)CtlObj_GetControlPopupMenuID, 1,
PyDoc_STR("() -> (short _rv)")},
-#endif
-
-#if ACCESSOR_CALLS_ARE_FUNCTIONS
{"SetControlDataHandle", (PyCFunction)CtlObj_SetControlDataHandle, 1,
PyDoc_STR("(Handle dataHandle) -> None")},
-#endif
-
-#if ACCESSOR_CALLS_ARE_FUNCTIONS
{"SetControlBounds", (PyCFunction)CtlObj_SetControlBounds, 1,
PyDoc_STR("(Rect bounds) -> None")},
-#endif
-
-#if ACCESSOR_CALLS_ARE_FUNCTIONS
{"SetControlPopupMenuHandle", (PyCFunction)CtlObj_SetControlPopupMenuHandle, 1,
PyDoc_STR("(MenuHandle popupMenu) -> None")},
-#endif
-
-#if ACCESSOR_CALLS_ARE_FUNCTIONS
{"SetControlPopupMenuID", (PyCFunction)CtlObj_SetControlPopupMenuID, 1,
PyDoc_STR("(short menuID) -> None")},
-#endif
{"GetBevelButtonMenuValue", (PyCFunction)CtlObj_GetBevelButtonMenuValue, 1,
PyDoc_STR("() -> (SInt16 outValue)")},
{"SetBevelButtonMenuValue", (PyCFunction)CtlObj_SetBevelButtonMenuValue, 1,
PyDoc_STR("(SInt16 inValue) -> None")},
{"GetBevelButtonMenuHandle", (PyCFunction)CtlObj_GetBevelButtonMenuHandle, 1,
PyDoc_STR("() -> (MenuHandle outHandle)")},
-
-#if TARGET_API_MAC_CARBON
{"SetBevelButtonContentInfo", (PyCFunction)CtlObj_SetBevelButtonContentInfo, 1,
PyDoc_STR("(ControlButtonContentInfo inContent) -> None")},
-#endif
{"SetBevelButtonTransform", (PyCFunction)CtlObj_SetBevelButtonTransform, 1,
PyDoc_STR("(IconTransformType transform) -> None")},
{"SetDisclosureTriangleLastValue", (PyCFunction)CtlObj_SetDisclosureTriangleLastValue, 1,
PyDoc_STR("() -> (Rect outContentRect)")},
{"SetTabEnabled", (PyCFunction)CtlObj_SetTabEnabled, 1,
PyDoc_STR("(SInt16 inTabToHilite, Boolean inEnabled) -> None")},
-
-#if TARGET_API_MAC_CARBON
{"SetImageWellContentInfo", (PyCFunction)CtlObj_SetImageWellContentInfo, 1,
PyDoc_STR("(ControlButtonContentInfo inContent) -> None")},
-#endif
{"SetImageWellTransform", (PyCFunction)CtlObj_SetImageWellTransform, 1,
PyDoc_STR("(IconTransformType inTransform) -> None")},
-
-#if TARGET_API_MAC_CARBON
{"GetDataBrowserViewStyle", (PyCFunction)CtlObj_GetDataBrowserViewStyle, 1,
PyDoc_STR("() -> (OSType style)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"SetDataBrowserViewStyle", (PyCFunction)CtlObj_SetDataBrowserViewStyle, 1,
PyDoc_STR("(OSType style) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"EnableDataBrowserEditCommand", (PyCFunction)CtlObj_EnableDataBrowserEditCommand, 1,
PyDoc_STR("(UInt32 command) -> (Boolean _rv)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"ExecuteDataBrowserEditCommand", (PyCFunction)CtlObj_ExecuteDataBrowserEditCommand, 1,
PyDoc_STR("(UInt32 command) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetDataBrowserSelectionAnchor", (PyCFunction)CtlObj_GetDataBrowserSelectionAnchor, 1,
PyDoc_STR("() -> (UInt32 first, UInt32 last)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"MoveDataBrowserSelectionAnchor", (PyCFunction)CtlObj_MoveDataBrowserSelectionAnchor, 1,
PyDoc_STR("(UInt32 direction, Boolean extendSelection) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"OpenDataBrowserContainer", (PyCFunction)CtlObj_OpenDataBrowserContainer, 1,
PyDoc_STR("(UInt32 container) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"CloseDataBrowserContainer", (PyCFunction)CtlObj_CloseDataBrowserContainer, 1,
PyDoc_STR("(UInt32 container) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"SortDataBrowserContainer", (PyCFunction)CtlObj_SortDataBrowserContainer, 1,
PyDoc_STR("(UInt32 container, Boolean sortChildren) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetDataBrowserItems", (PyCFunction)CtlObj_GetDataBrowserItems, 1,
PyDoc_STR("(UInt32 container, Boolean recurse, UInt32 state, Handle items) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetDataBrowserItemCount", (PyCFunction)CtlObj_GetDataBrowserItemCount, 1,
PyDoc_STR("(UInt32 container, Boolean recurse, UInt32 state) -> (UInt32 numItems)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"IsDataBrowserItemSelected", (PyCFunction)CtlObj_IsDataBrowserItemSelected, 1,
PyDoc_STR("(UInt32 item) -> (Boolean _rv)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetDataBrowserItemState", (PyCFunction)CtlObj_GetDataBrowserItemState, 1,
PyDoc_STR("(UInt32 item) -> (UInt32 state)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"RevealDataBrowserItem", (PyCFunction)CtlObj_RevealDataBrowserItem, 1,
PyDoc_STR("(UInt32 item, UInt32 propertyID, UInt8 options) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"SetDataBrowserActiveItems", (PyCFunction)CtlObj_SetDataBrowserActiveItems, 1,
PyDoc_STR("(Boolean active) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetDataBrowserActiveItems", (PyCFunction)CtlObj_GetDataBrowserActiveItems, 1,
PyDoc_STR("() -> (Boolean active)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"SetDataBrowserScrollBarInset", (PyCFunction)CtlObj_SetDataBrowserScrollBarInset, 1,
PyDoc_STR("() -> (Rect insetRect)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetDataBrowserScrollBarInset", (PyCFunction)CtlObj_GetDataBrowserScrollBarInset, 1,
PyDoc_STR("() -> (Rect insetRect)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"SetDataBrowserTarget", (PyCFunction)CtlObj_SetDataBrowserTarget, 1,
PyDoc_STR("(UInt32 target) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetDataBrowserTarget", (PyCFunction)CtlObj_GetDataBrowserTarget, 1,
PyDoc_STR("() -> (UInt32 target)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"SetDataBrowserSortOrder", (PyCFunction)CtlObj_SetDataBrowserSortOrder, 1,
PyDoc_STR("(UInt16 order) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetDataBrowserSortOrder", (PyCFunction)CtlObj_GetDataBrowserSortOrder, 1,
PyDoc_STR("() -> (UInt16 order)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"SetDataBrowserScrollPosition", (PyCFunction)CtlObj_SetDataBrowserScrollPosition, 1,
PyDoc_STR("(UInt32 top, UInt32 left) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetDataBrowserScrollPosition", (PyCFunction)CtlObj_GetDataBrowserScrollPosition, 1,
PyDoc_STR("() -> (UInt32 top, UInt32 left)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"SetDataBrowserHasScrollBars", (PyCFunction)CtlObj_SetDataBrowserHasScrollBars, 1,
PyDoc_STR("(Boolean horiz, Boolean vert) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetDataBrowserHasScrollBars", (PyCFunction)CtlObj_GetDataBrowserHasScrollBars, 1,
PyDoc_STR("() -> (Boolean horiz, Boolean vert)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"SetDataBrowserSortProperty", (PyCFunction)CtlObj_SetDataBrowserSortProperty, 1,
PyDoc_STR("(UInt32 property) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetDataBrowserSortProperty", (PyCFunction)CtlObj_GetDataBrowserSortProperty, 1,
PyDoc_STR("() -> (UInt32 property)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"SetDataBrowserSelectionFlags", (PyCFunction)CtlObj_SetDataBrowserSelectionFlags, 1,
PyDoc_STR("(UInt32 selectionFlags) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetDataBrowserSelectionFlags", (PyCFunction)CtlObj_GetDataBrowserSelectionFlags, 1,
PyDoc_STR("() -> (UInt32 selectionFlags)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"SetDataBrowserPropertyFlags", (PyCFunction)CtlObj_SetDataBrowserPropertyFlags, 1,
PyDoc_STR("(UInt32 property, UInt32 flags) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetDataBrowserPropertyFlags", (PyCFunction)CtlObj_GetDataBrowserPropertyFlags, 1,
PyDoc_STR("(UInt32 property) -> (UInt32 flags)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"SetDataBrowserEditText", (PyCFunction)CtlObj_SetDataBrowserEditText, 1,
PyDoc_STR("(CFStringRef text) -> None")},
-#endif
#if TARGET_API_MAC_OSX
{"CopyDataBrowserEditText", (PyCFunction)CtlObj_CopyDataBrowserEditText, 1,
PyDoc_STR("() -> (CFStringRef text)")},
#endif
-
-#if TARGET_API_MAC_CARBON
{"GetDataBrowserEditText", (PyCFunction)CtlObj_GetDataBrowserEditText, 1,
PyDoc_STR("(CFMutableStringRef text) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"SetDataBrowserEditItem", (PyCFunction)CtlObj_SetDataBrowserEditItem, 1,
PyDoc_STR("(UInt32 item, UInt32 property) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetDataBrowserEditItem", (PyCFunction)CtlObj_GetDataBrowserEditItem, 1,
PyDoc_STR("() -> (UInt32 item, UInt32 property)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetDataBrowserItemPartBounds", (PyCFunction)CtlObj_GetDataBrowserItemPartBounds, 1,
PyDoc_STR("(UInt32 item, UInt32 property, OSType part) -> (Rect bounds)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"RemoveDataBrowserTableViewColumn", (PyCFunction)CtlObj_RemoveDataBrowserTableViewColumn, 1,
PyDoc_STR("(UInt32 column) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetDataBrowserTableViewColumnCount", (PyCFunction)CtlObj_GetDataBrowserTableViewColumnCount, 1,
PyDoc_STR("() -> (UInt32 numColumns)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"SetDataBrowserTableViewHiliteStyle", (PyCFunction)CtlObj_SetDataBrowserTableViewHiliteStyle, 1,
PyDoc_STR("(UInt32 hiliteStyle) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetDataBrowserTableViewHiliteStyle", (PyCFunction)CtlObj_GetDataBrowserTableViewHiliteStyle, 1,
PyDoc_STR("() -> (UInt32 hiliteStyle)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"SetDataBrowserTableViewRowHeight", (PyCFunction)CtlObj_SetDataBrowserTableViewRowHeight, 1,
PyDoc_STR("(UInt16 height) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetDataBrowserTableViewRowHeight", (PyCFunction)CtlObj_GetDataBrowserTableViewRowHeight, 1,
PyDoc_STR("() -> (UInt16 height)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"SetDataBrowserTableViewColumnWidth", (PyCFunction)CtlObj_SetDataBrowserTableViewColumnWidth, 1,
PyDoc_STR("(UInt16 width) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetDataBrowserTableViewColumnWidth", (PyCFunction)CtlObj_GetDataBrowserTableViewColumnWidth, 1,
PyDoc_STR("() -> (UInt16 width)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"SetDataBrowserTableViewItemRowHeight", (PyCFunction)CtlObj_SetDataBrowserTableViewItemRowHeight, 1,
PyDoc_STR("(UInt32 item, UInt16 height) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetDataBrowserTableViewItemRowHeight", (PyCFunction)CtlObj_GetDataBrowserTableViewItemRowHeight, 1,
PyDoc_STR("(UInt32 item) -> (UInt16 height)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"SetDataBrowserTableViewNamedColumnWidth", (PyCFunction)CtlObj_SetDataBrowserTableViewNamedColumnWidth, 1,
PyDoc_STR("(UInt32 column, UInt16 width) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetDataBrowserTableViewNamedColumnWidth", (PyCFunction)CtlObj_GetDataBrowserTableViewNamedColumnWidth, 1,
PyDoc_STR("(UInt32 column) -> (UInt16 width)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"SetDataBrowserTableViewGeometry", (PyCFunction)CtlObj_SetDataBrowserTableViewGeometry, 1,
PyDoc_STR("(Boolean variableWidthColumns, Boolean variableHeightRows) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetDataBrowserTableViewGeometry", (PyCFunction)CtlObj_GetDataBrowserTableViewGeometry, 1,
PyDoc_STR("() -> (Boolean variableWidthColumns, Boolean variableHeightRows)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetDataBrowserTableViewItemID", (PyCFunction)CtlObj_GetDataBrowserTableViewItemID, 1,
PyDoc_STR("(UInt32 row) -> (UInt32 item)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"SetDataBrowserTableViewItemRow", (PyCFunction)CtlObj_SetDataBrowserTableViewItemRow, 1,
PyDoc_STR("(UInt32 item, UInt32 row) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetDataBrowserTableViewItemRow", (PyCFunction)CtlObj_GetDataBrowserTableViewItemRow, 1,
PyDoc_STR("(UInt32 item) -> (UInt32 row)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"SetDataBrowserTableViewColumnPosition", (PyCFunction)CtlObj_SetDataBrowserTableViewColumnPosition, 1,
PyDoc_STR("(UInt32 column, UInt32 position) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetDataBrowserTableViewColumnPosition", (PyCFunction)CtlObj_GetDataBrowserTableViewColumnPosition, 1,
PyDoc_STR("(UInt32 column) -> (UInt32 position)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetDataBrowserTableViewColumnProperty", (PyCFunction)CtlObj_GetDataBrowserTableViewColumnProperty, 1,
PyDoc_STR("(UInt32 column) -> (UInt32 property)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"AutoSizeDataBrowserListViewColumns", (PyCFunction)CtlObj_AutoSizeDataBrowserListViewColumns, 1,
PyDoc_STR("() -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"AddDataBrowserListViewColumn", (PyCFunction)CtlObj_AddDataBrowserListViewColumn, 1,
PyDoc_STR("(DataBrowserListViewColumnDesc columnDesc, UInt32 position) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"SetDataBrowserListViewHeaderBtnHeight", (PyCFunction)CtlObj_SetDataBrowserListViewHeaderBtnHeight, 1,
PyDoc_STR("(UInt16 height) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetDataBrowserListViewHeaderBtnHeight", (PyCFunction)CtlObj_GetDataBrowserListViewHeaderBtnHeight, 1,
PyDoc_STR("() -> (UInt16 height)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"SetDataBrowserListViewUsePlainBackground", (PyCFunction)CtlObj_SetDataBrowserListViewUsePlainBackground, 1,
PyDoc_STR("(Boolean usePlainBackground) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetDataBrowserListViewUsePlainBackground", (PyCFunction)CtlObj_GetDataBrowserListViewUsePlainBackground, 1,
PyDoc_STR("() -> (Boolean usePlainBackground)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"SetDataBrowserListViewDisclosureColumn", (PyCFunction)CtlObj_SetDataBrowserListViewDisclosureColumn, 1,
PyDoc_STR("(UInt32 column, Boolean expandableRows) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetDataBrowserListViewDisclosureColumn", (PyCFunction)CtlObj_GetDataBrowserListViewDisclosureColumn, 1,
PyDoc_STR("() -> (UInt32 column, Boolean expandableRows)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetDataBrowserColumnViewPath", (PyCFunction)CtlObj_GetDataBrowserColumnViewPath, 1,
PyDoc_STR("(Handle path) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetDataBrowserColumnViewPathLength", (PyCFunction)CtlObj_GetDataBrowserColumnViewPathLength, 1,
PyDoc_STR("() -> (UInt32 pathLength)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"SetDataBrowserColumnViewDisplayType", (PyCFunction)CtlObj_SetDataBrowserColumnViewDisplayType, 1,
PyDoc_STR("(OSType propertyType) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetDataBrowserColumnViewDisplayType", (PyCFunction)CtlObj_GetDataBrowserColumnViewDisplayType, 1,
PyDoc_STR("() -> (OSType propertyType)")},
-#endif
{"as_Resource", (PyCFunction)CtlObj_as_Resource, 1,
PyDoc_STR("() -> (Handle _rv)")},
{"GetControlRect", (PyCFunction)CtlObj_GetControlRect, 1,
PyDoc_STR("(part, type) -> ResObj")},
{"SetControlData_Callback", (PyCFunction)CtlObj_SetControlData_Callback, 1,
PyDoc_STR("(callbackfunc) -> None")},
-
-#if !TARGET_API_MAC_CARBON
- {"GetPopupData", (PyCFunction)CtlObj_GetPopupData, 1,
- PyDoc_STR(NULL)},
-#endif
-
-#if !TARGET_API_MAC_CARBON
- {"SetPopupData", (PyCFunction)CtlObj_SetPopupData, 1,
- PyDoc_STR(NULL)},
-#endif
{NULL, NULL, 0}
};
return _res;
}
-#if TARGET_API_MAC_CARBON
-
static PyObject *Ctl_GetControlByID(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
CtlObj_WhichControl, outControl);
return _res;
}
-#endif
static PyObject *Ctl_DumpControlHierarchy(PyObject *_self, PyObject *_args)
{
return _res;
}
-#if TARGET_API_MAC_CARBON
-
static PyObject *Ctl_SetAutomaticControlDragTrackingEnabledForWindow(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Ctl_IsAutomaticControlDragTrackingEnabledForWindow(PyObject *_self, PyObject *_args)
{
tracks);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Ctl_CreateBevelButtonControl(PyObject *_self, PyObject *_args)
{
CtlObj_New, outControl);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Ctl_CreateSliderControl(PyObject *_self, PyObject *_args)
{
setcallback(_res, kMyControlActionProcTag, liveTrackingProc, &c_callback);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Ctl_CreateDisclosureTriangleControl(PyObject *_self, PyObject *_args)
{
CtlObj_New, outControl);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Ctl_CreateProgressBarControl(PyObject *_self, PyObject *_args)
{
CtlObj_New, outControl);
return _res;
}
-#endif
#if TARGET_API_MAC_OSX
}
#endif
-#if TARGET_API_MAC_CARBON
-
static PyObject *Ctl_CreateLittleArrowsControl(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
CtlObj_New, outControl);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Ctl_CreateChasingArrowsControl(PyObject *_self, PyObject *_args)
{
CtlObj_New, outControl);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Ctl_CreateSeparatorControl(PyObject *_self, PyObject *_args)
{
CtlObj_New, outControl);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Ctl_CreateGroupBoxControl(PyObject *_self, PyObject *_args)
{
CtlObj_New, outControl);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Ctl_CreateCheckGroupBoxControl(PyObject *_self, PyObject *_args)
{
CtlObj_New, outControl);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Ctl_CreatePopupGroupBoxControl(PyObject *_self, PyObject *_args)
{
CtlObj_New, outControl);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Ctl_CreateImageWellControl(PyObject *_self, PyObject *_args)
{
CtlObj_New, outControl);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Ctl_CreatePopupArrowControl(PyObject *_self, PyObject *_args)
{
CtlObj_New, outControl);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Ctl_CreatePlacardControl(PyObject *_self, PyObject *_args)
{
CtlObj_New, outControl);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Ctl_CreateClockControl(PyObject *_self, PyObject *_args)
{
CtlObj_New, outControl);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Ctl_CreateUserPaneControl(PyObject *_self, PyObject *_args)
{
CtlObj_New, outControl);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Ctl_CreateEditTextControl(PyObject *_self, PyObject *_args)
{
CtlObj_New, outControl);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Ctl_CreateStaticTextControl(PyObject *_self, PyObject *_args)
{
CtlObj_New, outControl);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Ctl_CreatePictureControl(PyObject *_self, PyObject *_args)
{
CtlObj_New, outControl);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Ctl_CreateIconControl(PyObject *_self, PyObject *_args)
{
CtlObj_New, outControl);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Ctl_CreateWindowHeaderControl(PyObject *_self, PyObject *_args)
{
CtlObj_New, outControl);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Ctl_CreatePushButtonControl(PyObject *_self, PyObject *_args)
{
CtlObj_New, outControl);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Ctl_CreatePushButtonWithIconControl(PyObject *_self, PyObject *_args)
{
CtlObj_New, outControl);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Ctl_CreateRadioButtonControl(PyObject *_self, PyObject *_args)
{
CtlObj_New, outControl);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Ctl_CreateCheckBoxControl(PyObject *_self, PyObject *_args)
{
CtlObj_New, outControl);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Ctl_CreateScrollBarControl(PyObject *_self, PyObject *_args)
{
setcallback(_res, kMyControlActionProcTag, liveTrackingProc, &c_callback);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Ctl_CreatePopupButtonControl(PyObject *_self, PyObject *_args)
{
CtlObj_New, outControl);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Ctl_CreateRadioGroupControl(PyObject *_self, PyObject *_args)
{
CtlObj_New, outControl);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Ctl_CreateScrollingTextBoxControl(PyObject *_self, PyObject *_args)
{
CtlObj_New, outControl);
return _res;
}
-#endif
#if TARGET_API_MAC_OSX
}
#endif
-#if TARGET_API_MAC_CARBON
-
static PyObject *Ctl_CreateDataBrowserControl(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
CtlObj_New, outControl);
return _res;
}
-#endif
#if TARGET_API_MAC_OSX
return _res;
}
-#if TARGET_API_MAC_CARBON
-
static PyObject *Ctl_CreateTabsControl(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
CtlObj_New, outControl);
return _res;
}
-#endif
static PyMethodDef Ctl_methods[] = {
{"NewControl", (PyCFunction)Ctl_NewControl, 1,
PyDoc_STR("(Point testPoint, WindowPtr theWindow) -> (ControlPartCode _rv, ControlHandle theControl)")},
{"IdleControls", (PyCFunction)Ctl_IdleControls, 1,
PyDoc_STR("(WindowPtr inWindow) -> None")},
-
-#if TARGET_API_MAC_CARBON
{"GetControlByID", (PyCFunction)Ctl_GetControlByID, 1,
PyDoc_STR("(WindowPtr inWindow, ControlID inID) -> (ControlHandle outControl)")},
-#endif
{"DumpControlHierarchy", (PyCFunction)Ctl_DumpControlHierarchy, 1,
PyDoc_STR("(WindowPtr inWindow, FSSpec inDumpFile) -> None")},
{"CreateRootControl", (PyCFunction)Ctl_CreateRootControl, 1,
PyDoc_STR("(WindowPtr inWindow) -> None")},
{"ClearKeyboardFocus", (PyCFunction)Ctl_ClearKeyboardFocus, 1,
PyDoc_STR("(WindowPtr inWindow) -> None")},
-
-#if TARGET_API_MAC_CARBON
{"SetAutomaticControlDragTrackingEnabledForWindow", (PyCFunction)Ctl_SetAutomaticControlDragTrackingEnabledForWindow, 1,
PyDoc_STR("(WindowPtr theWindow, Boolean tracks) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"IsAutomaticControlDragTrackingEnabledForWindow", (PyCFunction)Ctl_IsAutomaticControlDragTrackingEnabledForWindow, 1,
PyDoc_STR("(WindowPtr theWindow) -> (Boolean tracks)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"CreateBevelButtonControl", (PyCFunction)Ctl_CreateBevelButtonControl, 1,
PyDoc_STR("(WindowPtr window, Rect boundsRect, CFStringRef title, UInt16 thickness, UInt16 behavior, ControlButtonContentInfo info, SInt16 menuID, UInt16 menuBehavior, UInt16 menuPlacement) -> (ControlHandle outControl)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"CreateSliderControl", (PyCFunction)Ctl_CreateSliderControl, 1,
PyDoc_STR("(WindowPtr window, Rect boundsRect, SInt32 value, SInt32 minimum, SInt32 maximum, UInt16 orientation, UInt16 numTickMarks, Boolean liveTracking, PyObject* liveTrackingProc) -> (ControlHandle outControl)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"CreateDisclosureTriangleControl", (PyCFunction)Ctl_CreateDisclosureTriangleControl, 1,
PyDoc_STR("(WindowPtr window, Rect boundsRect, UInt16 orientation, CFStringRef title, SInt32 initialValue, Boolean drawTitle, Boolean autoToggles) -> (ControlHandle outControl)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"CreateProgressBarControl", (PyCFunction)Ctl_CreateProgressBarControl, 1,
PyDoc_STR("(WindowPtr window, Rect boundsRect, SInt32 value, SInt32 minimum, SInt32 maximum, Boolean indeterminate) -> (ControlHandle outControl)")},
-#endif
#if TARGET_API_MAC_OSX
{"CreateRelevanceBarControl", (PyCFunction)Ctl_CreateRelevanceBarControl, 1,
PyDoc_STR("(WindowPtr window, Rect boundsRect, SInt32 value, SInt32 minimum, SInt32 maximum) -> (ControlHandle outControl)")},
#endif
-
-#if TARGET_API_MAC_CARBON
{"CreateLittleArrowsControl", (PyCFunction)Ctl_CreateLittleArrowsControl, 1,
PyDoc_STR("(WindowPtr window, Rect boundsRect, SInt32 value, SInt32 minimum, SInt32 maximum, SInt32 increment) -> (ControlHandle outControl)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"CreateChasingArrowsControl", (PyCFunction)Ctl_CreateChasingArrowsControl, 1,
PyDoc_STR("(WindowPtr window, Rect boundsRect) -> (ControlHandle outControl)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"CreateSeparatorControl", (PyCFunction)Ctl_CreateSeparatorControl, 1,
PyDoc_STR("(WindowPtr window, Rect boundsRect) -> (ControlHandle outControl)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"CreateGroupBoxControl", (PyCFunction)Ctl_CreateGroupBoxControl, 1,
PyDoc_STR("(WindowPtr window, Rect boundsRect, CFStringRef title, Boolean primary) -> (ControlHandle outControl)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"CreateCheckGroupBoxControl", (PyCFunction)Ctl_CreateCheckGroupBoxControl, 1,
PyDoc_STR("(WindowPtr window, Rect boundsRect, CFStringRef title, SInt32 initialValue, Boolean primary, Boolean autoToggle) -> (ControlHandle outControl)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"CreatePopupGroupBoxControl", (PyCFunction)Ctl_CreatePopupGroupBoxControl, 1,
PyDoc_STR("(WindowPtr window, Rect boundsRect, CFStringRef title, Boolean primary, SInt16 menuID, Boolean variableWidth, SInt16 titleWidth, SInt16 titleJustification, Style titleStyle) -> (ControlHandle outControl)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"CreateImageWellControl", (PyCFunction)Ctl_CreateImageWellControl, 1,
PyDoc_STR("(WindowPtr window, Rect boundsRect, ControlButtonContentInfo info) -> (ControlHandle outControl)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"CreatePopupArrowControl", (PyCFunction)Ctl_CreatePopupArrowControl, 1,
PyDoc_STR("(WindowPtr window, Rect boundsRect, UInt16 orientation, UInt16 size) -> (ControlHandle outControl)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"CreatePlacardControl", (PyCFunction)Ctl_CreatePlacardControl, 1,
PyDoc_STR("(WindowPtr window, Rect boundsRect) -> (ControlHandle outControl)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"CreateClockControl", (PyCFunction)Ctl_CreateClockControl, 1,
PyDoc_STR("(WindowPtr window, Rect boundsRect, UInt16 clockType, UInt32 clockFlags) -> (ControlHandle outControl)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"CreateUserPaneControl", (PyCFunction)Ctl_CreateUserPaneControl, 1,
PyDoc_STR("(WindowPtr window, Rect boundsRect, UInt32 features) -> (ControlHandle outControl)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"CreateEditTextControl", (PyCFunction)Ctl_CreateEditTextControl, 1,
PyDoc_STR("(WindowPtr window, Rect boundsRect, CFStringRef text, Boolean isPassword, Boolean useInlineInput, ControlFontStyleRec style) -> (ControlHandle outControl)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"CreateStaticTextControl", (PyCFunction)Ctl_CreateStaticTextControl, 1,
PyDoc_STR("(WindowPtr window, Rect boundsRect, CFStringRef text, ControlFontStyleRec style) -> (ControlHandle outControl)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"CreatePictureControl", (PyCFunction)Ctl_CreatePictureControl, 1,
PyDoc_STR("(WindowPtr window, Rect boundsRect, ControlButtonContentInfo content, Boolean dontTrack) -> (ControlHandle outControl)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"CreateIconControl", (PyCFunction)Ctl_CreateIconControl, 1,
PyDoc_STR("(WindowPtr window, Rect boundsRect, ControlButtonContentInfo icon, Boolean dontTrack) -> (ControlHandle outControl)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"CreateWindowHeaderControl", (PyCFunction)Ctl_CreateWindowHeaderControl, 1,
PyDoc_STR("(WindowPtr window, Rect boundsRect, Boolean isListHeader) -> (ControlHandle outControl)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"CreatePushButtonControl", (PyCFunction)Ctl_CreatePushButtonControl, 1,
PyDoc_STR("(WindowPtr window, Rect boundsRect, CFStringRef title) -> (ControlHandle outControl)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"CreatePushButtonWithIconControl", (PyCFunction)Ctl_CreatePushButtonWithIconControl, 1,
PyDoc_STR("(WindowPtr window, Rect boundsRect, CFStringRef title, ControlButtonContentInfo icon, UInt16 iconAlignment) -> (ControlHandle outControl)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"CreateRadioButtonControl", (PyCFunction)Ctl_CreateRadioButtonControl, 1,
PyDoc_STR("(WindowPtr window, Rect boundsRect, CFStringRef title, SInt32 initialValue, Boolean autoToggle) -> (ControlHandle outControl)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"CreateCheckBoxControl", (PyCFunction)Ctl_CreateCheckBoxControl, 1,
PyDoc_STR("(WindowPtr window, Rect boundsRect, CFStringRef title, SInt32 initialValue, Boolean autoToggle) -> (ControlHandle outControl)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"CreateScrollBarControl", (PyCFunction)Ctl_CreateScrollBarControl, 1,
PyDoc_STR("(WindowPtr window, Rect boundsRect, SInt32 value, SInt32 minimum, SInt32 maximum, SInt32 viewSize, Boolean liveTracking, PyObject* liveTrackingProc) -> (ControlHandle outControl)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"CreatePopupButtonControl", (PyCFunction)Ctl_CreatePopupButtonControl, 1,
PyDoc_STR("(WindowPtr window, Rect boundsRect, CFStringRef title, SInt16 menuID, Boolean variableWidth, SInt16 titleWidth, SInt16 titleJustification, Style titleStyle) -> (ControlHandle outControl)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"CreateRadioGroupControl", (PyCFunction)Ctl_CreateRadioGroupControl, 1,
PyDoc_STR("(WindowPtr window, Rect boundsRect) -> (ControlHandle outControl)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"CreateScrollingTextBoxControl", (PyCFunction)Ctl_CreateScrollingTextBoxControl, 1,
PyDoc_STR("(WindowPtr window, Rect boundsRect, SInt16 contentResID, Boolean autoScroll, UInt32 delayBeforeAutoScroll, UInt32 delayBetweenAutoScroll, UInt16 autoScrollAmount) -> (ControlHandle outControl)")},
-#endif
#if TARGET_API_MAC_OSX
{"CreateDisclosureButtonControl", (PyCFunction)Ctl_CreateDisclosureButtonControl, 1,
{"CreateRoundButtonControl", (PyCFunction)Ctl_CreateRoundButtonControl, 1,
PyDoc_STR("(WindowPtr inWindow, Rect inBoundsRect, SInt16 inSize, ControlButtonContentInfo inContent) -> (ControlHandle outControl)")},
#endif
-
-#if TARGET_API_MAC_CARBON
{"CreateDataBrowserControl", (PyCFunction)Ctl_CreateDataBrowserControl, 1,
PyDoc_STR("(WindowPtr window, Rect boundsRect, OSType style) -> (ControlHandle outControl)")},
-#endif
#if TARGET_API_MAC_OSX
{"CreateEditUnicodeTextControl", (PyCFunction)Ctl_CreateEditUnicodeTextControl, 1,
PyDoc_STR("(Point inWhere, WindowPtr inWindow) -> (ControlHandle _rv, SInt16 outPart)")},
{"as_Control", (PyCFunction)Ctl_as_Control, 1,
PyDoc_STR("(Handle h) -> (ControlHandle _rv)")},
-
-#if TARGET_API_MAC_CARBON
{"CreateTabsControl", (PyCFunction)Ctl_CreateTabsControl, 1,
PyDoc_STR("(WindowPtr window, Rect boundsRect, UInt16 size, UInt16 direction, ControlTabEntry tabArray) -> (ControlHandle outControl)")},
-#endif
{NULL, NULL, 0}
};
# too lazy for now
'GetImageWellContentInfo',
'GetBevelButtonContentInfo',
+ # OS8 only
+ 'GetAuxiliaryControlRecord',
+ 'SetControlColor',
]
def makegreylist(self):
return [
- ('#if !TARGET_API_MAC_CARBON', [
- 'GetAuxiliaryControlRecord',
- 'SetControlColor',
- # These have suddenly disappeared in UH 3.3.2...
-## 'GetBevelButtonMenuValue',
-## 'SetBevelButtonMenuValue',
-## 'GetBevelButtonMenuHandle',
-## 'SetBevelButtonTransform',
-## 'SetImageWellTransform',
-## 'GetTabContentRect',
-## 'SetTabEnabled',
-## 'SetDisclosureTriangleLastValue',
- ]),
- ('#if TARGET_API_MAC_CARBON', [
- 'IsAutomaticControlDragTrackingEnabledForWindow',
- 'SetAutomaticControlDragTrackingEnabledForWindow',
- 'HandleControlDragReceive',
- 'HandleControlDragTracking',
- 'GetControlByID',
- 'IsControlDragTrackingEnabled',
- 'SetControlDragTrackingEnabled',
- 'GetControlPropertyAttributes',
- 'ChangeControlPropertyAttributes',
- 'GetControlID',
- 'SetControlID',
- 'HandleControlSetCursor',
- 'GetControlClickActivation',
- 'HandleControlContextualMenuClick',
-
- "CreateScrollBarControl",
- "CreateSliderControl",
- "CreateBevelButtonControl",
- "CreateImageWellControl",
- "CreatePictureControl",
- "CreateIconControl",
- "CreatePushButtonWithIconControl",
- "SetBevelButtonContentInfo",
- "SetImageWellContentInfo",
- "AddDataBrowserListViewColumn",
-
- "CreateDataBrowserControl",
- "CreateScrollingTextBoxControl",
- "CreateRadioGroupControl",
- "CreatePopupButtonControl",
- "CreateCheckBoxControl",
- "CreateRadioButtonControl",
- "CreatePushButtonControl",
- "CreateWindowHeaderControl",
- "CreateStaticTextControl",
- "CreateEditTextControl",
- "CreateUserPaneControl",
- "CreateClockControl",
- "CreatePlacardControl",
- "CreatePopupArrowControl",
- "CreatePopupGroupBoxControl",
- "CreateCheckGroupBoxControl",
- "CreateGroupBoxControl",
- "CreateSeparatorControl",
- "CreateChasingArrowsControl",
- "CreateLittleArrowsControl",
- "CreateProgressBarControl",
- "CreateDisclosureTriangleControl",
- "GetDataBrowserColumnViewDisplayType",
- "SetDataBrowserColumnViewDisplayType",
- "GetDataBrowserColumnViewPathLength",
- "GetDataBrowserColumnViewPath",
- "GetDataBrowserListViewDisclosureColumn",
- "SetDataBrowserListViewDisclosureColumn",
- "GetDataBrowserListViewUsePlainBackground",
- "SetDataBrowserListViewUsePlainBackground",
- "GetDataBrowserListViewHeaderBtnHeight",
- "SetDataBrowserListViewHeaderBtnHeight",
- "AutoSizeDataBrowserListViewColumns",
- "GetDataBrowserTableViewColumnProperty",
- "GetDataBrowserTableViewColumnPosition",
- "SetDataBrowserTableViewColumnPosition",
- "GetDataBrowserTableViewItemRow",
- "SetDataBrowserTableViewItemRow",
- "GetDataBrowserTableViewItemID",
- "GetDataBrowserTableViewGeometry",
- "SetDataBrowserTableViewGeometry",
- "GetDataBrowserTableViewNamedColumnWidth",
- "SetDataBrowserTableViewNamedColumnWidth",
- "GetDataBrowserTableViewItemRowHeight",
- "SetDataBrowserTableViewItemRowHeight",
- "GetDataBrowserTableViewColumnWidth",
- "SetDataBrowserTableViewColumnWidth",
- "GetDataBrowserTableViewRowHeight",
- "SetDataBrowserTableViewRowHeight",
- "GetDataBrowserTableViewHiliteStyle",
- "SetDataBrowserTableViewHiliteStyle",
- "GetDataBrowserTableViewColumnCount",
- "RemoveDataBrowserTableViewColumn",
- "GetDataBrowserItemPartBounds",
- "GetDataBrowserEditItem",
- "SetDataBrowserEditItem",
- "GetDataBrowserEditText",
- "SetDataBrowserEditText",
- "GetDataBrowserPropertyFlags",
- "SetDataBrowserPropertyFlags",
- "GetDataBrowserSelectionFlags",
- "SetDataBrowserSelectionFlags",
- "GetDataBrowserSortProperty",
- "SetDataBrowserSortProperty",
- "GetDataBrowserHasScrollBars",
- "SetDataBrowserHasScrollBars",
- "GetDataBrowserScrollPosition",
- "SetDataBrowserScrollPosition",
- "GetDataBrowserSortOrder",
- "SetDataBrowserSortOrder",
- "GetDataBrowserTarget",
- "SetDataBrowserTarget",
- "GetDataBrowserScrollBarInset",
- "SetDataBrowserScrollBarInset",
- "GetDataBrowserActiveItems",
- "SetDataBrowserActiveItems",
- "RevealDataBrowserItem",
- "GetDataBrowserItemState",
- "IsDataBrowserItemSelected",
- "GetDataBrowserItemCount",
- "GetDataBrowserItems",
- "SortDataBrowserContainer",
- "CloseDataBrowserContainer",
- "OpenDataBrowserContainer",
- "MoveDataBrowserSelectionAnchor",
- "GetDataBrowserSelectionAnchor",
- "ExecuteDataBrowserEditCommand",
- "EnableDataBrowserEditCommand",
- "SetDataBrowserViewStyle",
- "GetDataBrowserViewStyle",
- "GetControlCommandID",
- "SetControlCommandID",
- "CopyControlTitleAsCFString",
- "SetControlTitleWithCFString",
- ]),
- ('#if ACCESSOR_CALLS_ARE_FUNCTIONS', [
- # XXX These are silly, they should be #defined to access the fields
- # directly. Later...
- 'GetControlBounds',
- 'IsControlHilited',
- 'GetControlHilite',
- 'GetControlOwner',
- 'GetControlDataHandle',
- 'GetControlPopupMenuHandle',
- 'GetControlPopupMenuID',
- 'SetControlDataHandle',
- 'SetControlBounds',
- 'SetControlPopupMenuHandle',
- 'SetControlPopupMenuID',
- ]),
('#if TARGET_API_MAC_OSX', [
'CreateRoundButtonControl',
'CreateDisclosureButtonControl',
#define as_Control(h) ((ControlHandle)h)
#define as_Resource(ctl) ((Handle)ctl)
-#if TARGET_API_MAC_CARBON
#define GetControlRect(ctl, rectp) GetControlBounds(ctl, rectp)
-#else
-#define GetControlRect(ctl, rectp) (*(rectp) = ((*(ctl))->contrlRect))
-#endif
#define MAXTABS 32 /* maximum number of tabs that we support in a tabs control */
/*
f.docstring = lambda: "(callbackfunc) -> None"
object.add(f)
-# And manual generators to get/set popup menu information
-getpopupdata_body = """
-PopupPrivateDataHandle hdl;
-
-if ( (*_self->ob_itself)->contrlData == NULL ) {
- PyErr_SetString(Ctl_Error, "No contrlData handle in control");
- return 0;
-}
-hdl = (PopupPrivateDataHandle)(*_self->ob_itself)->contrlData;
-HLock((Handle)hdl);
-_res = Py_BuildValue("O&i", MenuObj_New, (*hdl)->mHandle, (int)(*hdl)->mID);
-HUnlock((Handle)hdl);
-return _res;
-"""
-f = ManualGenerator("GetPopupData", getpopupdata_body, condition="#if !TARGET_API_MAC_CARBON")
-object.add(f)
-
-setpopupdata_body = """
-PopupPrivateDataHandle hdl;
-MenuHandle mHandle;
-short mID;
-
-if (!PyArg_ParseTuple(_args, "O&h", MenuObj_Convert, &mHandle, &mID) )
- return 0;
-if ( (*_self->ob_itself)->contrlData == NULL ) {
- PyErr_SetString(Ctl_Error, "No contrlData handle in control");
- return 0;
-}
-hdl = (PopupPrivateDataHandle)(*_self->ob_itself)->contrlData;
-(*hdl)->mHandle = mHandle;
-(*hdl)->mID = mID;
-Py_INCREF(Py_None);
-return Py_None;
-"""
-f = ManualGenerator("SetPopupData", setpopupdata_body, condition="#if !TARGET_API_MAC_CARBON")
-object.add(f)
createtabscontrol_body = """\
CtlObj_New, outControl);
return _res;"""
-f = ManualGenerator("CreateTabsControl", createtabscontrol_body, condition="#if TARGET_API_MAC_CARBON")
+f = ManualGenerator("CreateTabsControl", createtabscontrol_body)
f.docstring = lambda: "(WindowPtr window, Rect boundsRect, UInt16 size, UInt16 direction, ControlTabEntry tabArray) -> (ControlHandle outControl)"
module.add(f)
return _res;
}
-#if TARGET_API_MAC_CARBON
-
static PyObject *DlgObj_InsertDialogItem(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *DlgObj_RemoveDialogItems(DialogObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
static PyObject *DlgObj_StdFilterProc(DialogObject *_self, PyObject *_args)
{
PyDoc_STR("() -> (DialogItemIndex _rv)")},
{"ShortenDITL", (PyCFunction)DlgObj_ShortenDITL, 1,
PyDoc_STR("(DialogItemIndex numberItems) -> None")},
-
-#if TARGET_API_MAC_CARBON
{"InsertDialogItem", (PyCFunction)DlgObj_InsertDialogItem, 1,
PyDoc_STR("(DialogItemIndex afterItem, DialogItemType itemType, Handle itemHandle, Rect box) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"RemoveDialogItems", (PyCFunction)DlgObj_RemoveDialogItems, 1,
PyDoc_STR("(DialogItemIndex itemNo, DialogItemIndex amountToRemove, Boolean disposeItemData) -> None")},
-#endif
{"StdFilterProc", (PyCFunction)DlgObj_StdFilterProc, 1,
PyDoc_STR("() -> (Boolean _rv, EventRecord event, DialogItemIndex itemHit)")},
{"SetDialogDefaultItem", (PyCFunction)DlgObj_SetDialogDefaultItem, 1,
return _res;
}
-#if TARGET_API_MAC_CARBON
-
static PyObject *Dlg_GetParamText(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
_res = Py_None;
return _res;
}
-#endif
static PyObject *Dlg_NewFeaturesDialog(PyObject *_self, PyObject *_args)
{
PyDoc_STR("(SInt16 fontNum) -> None")},
{"ResetAlertStage", (PyCFunction)Dlg_ResetAlertStage, 1,
PyDoc_STR("() -> None")},
-
-#if TARGET_API_MAC_CARBON
{"GetParamText", (PyCFunction)Dlg_GetParamText, 1,
PyDoc_STR("(Str255 param0, Str255 param1, Str255 param2, Str255 param3) -> None")},
-#endif
{"NewFeaturesDialog", (PyCFunction)Dlg_NewFeaturesDialog, 1,
PyDoc_STR("(Rect inBoundsRect, Str255 inTitle, Boolean inIsVisible, SInt16 inProcID, WindowPtr inBehind, Boolean inGoAwayFlag, SInt32 inRefCon, Handle inItemListHandle, UInt32 inFlags) -> (DialogPtr _rv)")},
{"GetDialogFromWindow", (PyCFunction)Dlg_GetDialogFromWindow, 1,
'RunStandardAlert',
]
- def makegreylist(self):
- return [
- ('#if TARGET_API_MAC_CARBON', [
- 'InsertDialogItem',
- 'RemoveDialogItems',
- 'GetParamText',
- 'CloseStandardSheet',
- 'RunStandardAlert',
- ])]
-
def makeblacklisttypes(self):
return [
"AlertStdAlertParamPtr", # Too much work, for now
return _res;
}
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Evt_OSEventAvail(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- Boolean _rv;
- EventMask mask;
- EventRecord theEvent;
-#ifndef OSEventAvail
- PyMac_PRECHECK(OSEventAvail);
-#endif
- if (!PyArg_ParseTuple(_args, "H",
- &mask))
- return NULL;
- _rv = OSEventAvail(mask,
- &theEvent);
- _res = Py_BuildValue("bO&",
- _rv,
- PyMac_BuildEventRecord, &theEvent);
- return _res;
-}
-#endif
-
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Evt_GetOSEvent(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- Boolean _rv;
- EventMask mask;
- EventRecord theEvent;
-#ifndef GetOSEvent
- PyMac_PRECHECK(GetOSEvent);
-#endif
- if (!PyArg_ParseTuple(_args, "H",
- &mask))
- return NULL;
- _rv = GetOSEvent(mask,
- &theEvent);
- _res = Py_BuildValue("bO&",
- _rv,
- PyMac_BuildEventRecord, &theEvent);
- return _res;
-}
-#endif
-
static PyObject *Evt_FlushEvents(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
return _res;
}
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Evt_SystemClick(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- EventRecord theEvent;
- WindowPtr theWindow;
-#ifndef SystemClick
- PyMac_PRECHECK(SystemClick);
-#endif
- if (!PyArg_ParseTuple(_args, "O&O&",
- PyMac_GetEventRecord, &theEvent,
- WinObj_Convert, &theWindow))
- return NULL;
- SystemClick(&theEvent,
- theWindow);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
-}
-#endif
-
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Evt_SystemTask(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
-#ifndef SystemTask
- PyMac_PRECHECK(SystemTask);
-#endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- SystemTask();
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
-}
-#endif
-
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Evt_SystemEvent(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- Boolean _rv;
- EventRecord theEvent;
-#ifndef SystemEvent
- PyMac_PRECHECK(SystemEvent);
-#endif
- if (!PyArg_ParseTuple(_args, "O&",
- PyMac_GetEventRecord, &theEvent))
- return NULL;
- _rv = SystemEvent(&theEvent);
- _res = Py_BuildValue("b",
- _rv);
- return _res;
-}
-#endif
-
-#if TARGET_API_MAC_CARBON
-
static PyObject *Evt_GetGlobalMouse(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
PyMac_BuildPoint, globalMouse);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Evt_GetCurrentKeyModifiers(PyObject *_self, PyObject *_args)
{
_rv);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Evt_CheckEventQueueForUserCancel(PyObject *_self, PyObject *_args)
{
_rv);
return _res;
}
-#endif
static PyObject *Evt_KeyScript(PyObject *_self, PyObject *_args)
{
PyDoc_STR("(EventMask eventMask) -> (Boolean _rv, EventRecord theEvent)")},
{"PostEvent", (PyCFunction)Evt_PostEvent, 1,
PyDoc_STR("(EventKind eventNum, UInt32 eventMsg) -> None")},
-
-#if !TARGET_API_MAC_CARBON
- {"OSEventAvail", (PyCFunction)Evt_OSEventAvail, 1,
- PyDoc_STR("(EventMask mask) -> (Boolean _rv, EventRecord theEvent)")},
-#endif
-
-#if !TARGET_API_MAC_CARBON
- {"GetOSEvent", (PyCFunction)Evt_GetOSEvent, 1,
- PyDoc_STR("(EventMask mask) -> (Boolean _rv, EventRecord theEvent)")},
-#endif
{"FlushEvents", (PyCFunction)Evt_FlushEvents, 1,
PyDoc_STR("(EventMask whichMask, EventMask stopMask) -> None")},
-
-#if !TARGET_API_MAC_CARBON
- {"SystemClick", (PyCFunction)Evt_SystemClick, 1,
- PyDoc_STR("(EventRecord theEvent, WindowPtr theWindow) -> None")},
-#endif
-
-#if !TARGET_API_MAC_CARBON
- {"SystemTask", (PyCFunction)Evt_SystemTask, 1,
- PyDoc_STR("() -> None")},
-#endif
-
-#if !TARGET_API_MAC_CARBON
- {"SystemEvent", (PyCFunction)Evt_SystemEvent, 1,
- PyDoc_STR("(EventRecord theEvent) -> (Boolean _rv)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetGlobalMouse", (PyCFunction)Evt_GetGlobalMouse, 1,
PyDoc_STR("() -> (Point globalMouse)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetCurrentKeyModifiers", (PyCFunction)Evt_GetCurrentKeyModifiers, 1,
PyDoc_STR("() -> (UInt32 _rv)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"CheckEventQueueForUserCancel", (PyCFunction)Evt_CheckEventQueueForUserCancel, 1,
PyDoc_STR("() -> (Boolean _rv)")},
-#endif
{"KeyScript", (PyCFunction)Evt_KeyScript, 1,
PyDoc_STR("(short code) -> None")},
{"IsCmdChar", (PyCFunction)Evt_IsCmdChar, 1,
listname = "methods"
return classname, listname
- def makegreylist(self):
- return [
- ('#if !TARGET_API_MAC_CARBON', [
- 'SystemEvent',
- 'SystemTask',
- 'SystemClick',
- 'GetOSEvent',
- 'OSEventAvail',
- ]),
- ('#if TARGET_API_MAC_CARBON', [
- 'CheckEventQueueForUserCancel',
- 'GetCurrentKeyModifiers',
- 'GetGlobalMouse',
- ])]
-
def makeblacklistnames(self):
return [
"KeyTranslate",
"WaitNextEvent", # Manually generated because of optional region
# Constants with funny definitions
"osEvtMessageMask",
+ # OS8 calls
+ 'SystemEvent',
+ 'SystemTask',
+ 'SystemClick',
+ 'GetOSEvent',
+ 'OSEventAvail',
]
def makeblacklisttypes(self):
static PyObject *Fm_Error;
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Fm_InitFonts(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
-#ifndef InitFonts
- PyMac_PRECHECK(InitFonts);
-#endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- InitFonts();
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
-}
-#endif
-
static PyObject *Fm_GetFontName(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
return _res;
}
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Fm_SetFontLock(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- Boolean lockFlag;
-#ifndef SetFontLock
- PyMac_PRECHECK(SetFontLock);
-#endif
- if (!PyArg_ParseTuple(_args, "b",
- &lockFlag))
- return NULL;
- SetFontLock(lockFlag);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
-}
-#endif
-
static PyObject *Fm_SetFScaleDisable(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
return _res;
}
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Fm_FlushFonts(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- OSErr _err;
-#ifndef FlushFonts
- PyMac_PRECHECK(FlushFonts);
-#endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _err = FlushFonts();
- if (_err != noErr) return PyMac_Error(_err);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
-}
-#endif
-
static PyObject *Fm_GetSysFont(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
}
static PyMethodDef Fm_methods[] = {
-
-#if !TARGET_API_MAC_CARBON
- {"InitFonts", (PyCFunction)Fm_InitFonts, 1,
- PyDoc_STR("() -> None")},
-#endif
{"GetFontName", (PyCFunction)Fm_GetFontName, 1,
PyDoc_STR("(short familyID) -> (Str255 name)")},
{"GetFNum", (PyCFunction)Fm_GetFNum, 1,
PyDoc_STR("(Str255 name) -> (short familyID)")},
{"RealFont", (PyCFunction)Fm_RealFont, 1,
PyDoc_STR("(short fontNum, short size) -> (Boolean _rv)")},
-
-#if !TARGET_API_MAC_CARBON
- {"SetFontLock", (PyCFunction)Fm_SetFontLock, 1,
- PyDoc_STR("(Boolean lockFlag) -> None")},
-#endif
{"SetFScaleDisable", (PyCFunction)Fm_SetFScaleDisable, 1,
PyDoc_STR("(Boolean fscaleDisable) -> None")},
{"FontMetrics", (PyCFunction)Fm_FontMetrics, 1,
PyDoc_STR("(Boolean preserveGlyph) -> None")},
{"GetPreserveGlyph", (PyCFunction)Fm_GetPreserveGlyph, 1,
PyDoc_STR("() -> (Boolean _rv)")},
-
-#if !TARGET_API_MAC_CARBON
- {"FlushFonts", (PyCFunction)Fm_FlushFonts, 1,
- PyDoc_STR("() -> None")},
-#endif
{"GetSysFont", (PyCFunction)Fm_GetSysFont, 1,
PyDoc_STR("() -> (short _rv)")},
{"GetAppFont", (PyCFunction)Fm_GetAppFont, 1,
# Disabling them is the easiest path.
'SetAntiAliasedTextEnabled',
'IsAntiAliasedTextEnabled',
+ # OS8-only
+ 'InitFonts',
+ 'SetFontLock',
+ 'FlushFonts',
]
def makegreylist(self):
return [
('#if !TARGET_API_MAC_CARBON', [
- 'InitFonts',
- 'SetFontLock',
- 'FlushFonts',
])]
def makeblacklisttypes(self):
return [
extern int ResObj_Convert(PyObject *, Handle *); /* From Resmodule.c */
#ifdef WITHOUT_FRAMEWORKS
-// #if !TARGET_API_MAC_OS8
-// /* The Carbon headers define PRAGMA_ALIGN_SUPPORT to something illegal,
-// ** because you shouldn't use it for Carbon. All good and well, but portable
-// ** code still needs it. So, we undefine it here.
-// */
-// #undef PRAGMA_ALIGN_SUPPORTED
-// #define PRAGMA_ALIGN_SUPPORTED 0
-// #endif /* !TARGET_API_MAC_OS8 */
-
-// #include "ICAPI.h"
#include <InternetConfig.h>
#else
#include <Carbon/Carbon.h>
/* ---------------------------------------------------------------- */
-#if TARGET_API_MAC_OS8
-static char ici_ICFindConfigFile__doc__[] =
-"()->None; Find config file in standard places"
-;
-
-static PyObject *
-ici_ICFindConfigFile(iciobject *self, PyObject *args)
-{
- OSStatus err;
-
- if (!PyArg_ParseTuple(args, ""))
- return NULL;
- if ((err=ICFindConfigFile(self->inst, 0, NULL)) != 0 )
- return PyMac_Error(err);
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-
-static char ici_ICFindUserConfigFile__doc__[] =
-"(vRefNum, dirID)->None; Find config file in specified place"
-;
-
-static PyObject *
-ici_ICFindUserConfigFile(iciobject *self, PyObject *args)
-{
- OSStatus err;
- ICDirSpec where;
-
- if (!PyArg_ParseTuple(args, "sl", &where.vRefNum, &where.dirID))
- return NULL;
- if ((err=ICFindUserConfigFile(self->inst, &where)) != 0 )
- return PyMac_Error(err);
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-
-static char ici_ICChooseConfig__doc__[] =
-"()->None; Let the user choose a config file"
-;
-
-static PyObject *
-ici_ICChooseConfig(iciobject *self, PyObject *args)
-{
- OSStatus err;
-
- if (!PyArg_ParseTuple(args, ""))
- return NULL;
- if ((err=ICChooseConfig(self->inst)) != 0 )
- return PyMac_Error(err);
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-static char ici_ICChooseNewConfig__doc__[] =
-"()->None; Let the user choose a new config file"
-;
-
-static PyObject *
-ici_ICChooseNewConfig(iciobject *self, PyObject *args)
-{
- OSStatus err;
-
- if (!PyArg_ParseTuple(args, ""))
- return NULL;
- if ((err=ICChooseNewConfig(self->inst)) != 0 )
- return PyMac_Error(err);
- Py_INCREF(Py_None);
- return Py_None;
-}
-#endif /* TARGET_API_MAC_OS8 */
-
static char ici_ICGetSeed__doc__[] =
"()->int; Returns int that changes when configuration does"
static struct PyMethodDef ici_methods[] = {
-#if TARGET_API_MAC_OS8
- {"ICFindConfigFile", (PyCFunction)ici_ICFindConfigFile, METH_VARARGS, ici_ICFindConfigFile__doc__},
- {"ICFindUserConfigFile", (PyCFunction)ici_ICFindUserConfigFile, METH_VARARGS, ici_ICFindUserConfigFile__doc__},
- {"ICChooseConfig", (PyCFunction)ici_ICChooseConfig, METH_VARARGS, ici_ICChooseConfig__doc__},
- {"ICChooseNewConfig", (PyCFunction)ici_ICChooseNewConfig, METH_VARARGS, ici_ICChooseNewConfig__doc__},
-#endif /* TARGET_API_MAC_OS8 */
{"ICGetSeed", (PyCFunction)ici_ICGetSeed, METH_VARARGS, ici_ICGetSeed__doc__},
{"ICBegin", (PyCFunction)ici_ICBegin, METH_VARARGS, ici_ICBegin__doc__},
{"ICFindPrefHandle", (PyCFunction)ici_ICFindPrefHandle, METH_VARARGS, ici_ICFindPrefHandle__doc__},
return _res;
}
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Icn_IconServicesTerminate(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
-#ifndef IconServicesTerminate
- PyMac_PRECHECK(IconServicesTerminate);
-#endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- IconServicesTerminate();
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
-}
-#endif
-
static PyObject *Icn_IconRefToIconFamily(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
return _res;
}
-#if TARGET_API_MAC_CARBON
-
static PyObject *Icn_GetIconRefVariant(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
outTransform);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Icn_RegisterIconRefFromIconFile(PyObject *_self, PyObject *_args)
{
ResObj_New, theIconRef);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Icn_ReadIconFile(PyObject *_self, PyObject *_args)
{
ResObj_New, iconFamily);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Icn_WriteIconFile(PyObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
static PyMethodDef Icn_methods[] = {
{"GetCIcon", (PyCFunction)Icn_GetCIcon, 1,
PyDoc_STR("(Rect theRect, IconAlignmentType align, IconTransformType transform, Handle theSICN) -> None")},
{"PlotCIconHandle", (PyCFunction)Icn_PlotCIconHandle, 1,
PyDoc_STR("(Rect theRect, IconAlignmentType align, IconTransformType transform, CIconHandle theCIcon) -> None")},
-
-#if !TARGET_API_MAC_CARBON
- {"IconServicesTerminate", (PyCFunction)Icn_IconServicesTerminate, 1,
- PyDoc_STR("() -> None")},
-#endif
{"IconRefToIconFamily", (PyCFunction)Icn_IconRefToIconFamily, 1,
PyDoc_STR("(IconRef theIconRef, IconSelectorValue whichIcons) -> (IconFamilyHandle iconFamily)")},
{"IconFamilyToIconSuite", (PyCFunction)Icn_IconFamilyToIconSuite, 1,
PyDoc_STR("(SInt16 vRefNum) -> (Boolean customIconsEnabled)")},
{"IsIconRefMaskEmpty", (PyCFunction)Icn_IsIconRefMaskEmpty, 1,
PyDoc_STR("(IconRef iconRef) -> (Boolean _rv)")},
-
-#if TARGET_API_MAC_CARBON
{"GetIconRefVariant", (PyCFunction)Icn_GetIconRefVariant, 1,
PyDoc_STR("(IconRef inIconRef, OSType inVariant) -> (IconRef _rv, IconTransformType outTransform)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"RegisterIconRefFromIconFile", (PyCFunction)Icn_RegisterIconRefFromIconFile, 1,
PyDoc_STR("(OSType creator, OSType iconType, FSSpec iconFile) -> (IconRef theIconRef)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"ReadIconFile", (PyCFunction)Icn_ReadIconFile, 1,
PyDoc_STR("(FSSpec iconFile) -> (IconFamilyHandle iconFamily)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"WriteIconFile", (PyCFunction)Icn_WriteIconFile, 1,
PyDoc_STR("(IconFamilyHandle iconFamily, FSSpec iconFile) -> None")},
-#endif
{NULL, NULL, 0}
};
"svAllAvailableData",
# Something in a comment accidentally seen as a const definition
"err",
+ # OS8 only
+ 'IconServicesTerminate',
]
- def makegreylist(self):
- return [
- ('#if !TARGET_API_MAC_CARBON', [
- 'IconServicesTerminate',
- ]),
- ('#if TARGET_API_MAC_CARBON', [
- 'WriteIconFile',
- 'ReadIconFile',
- 'RegisterIconRefFromIconFile',
- 'GetIconRefVariant',
- ])]
-
def makeblacklisttypes(self):
return [
"IconActionUPP",
static ListDefUPP myListDefFunctionUPP;
-#if !TARGET_API_MAC_CARBON
-
-#define kJumpAbs 0x4EF9
-
-#pragma options align=mac68k
-typedef struct {
- short jmpabs; /* 4EF9 */
- ListDefUPP theUPP; /* 00000000 */
-} LDEFStub, **LDEFStubHandle;
-#pragma options align=reset
-
-static OSErr installLDEFStub(ListHandle list) {
- LDEFStubHandle stubH;
-
- stubH = (LDEFStubHandle)NewHandleClear(sizeof(LDEFStub));
- if (stubH == NULL)
- return MemError();
-
- (*stubH)->jmpabs = kJumpAbs;
- (*stubH)->theUPP = myListDefFunctionUPP;
- HLock((Handle) stubH);
-
- (*list)->listDefProc = (Handle)stubH;
- return noErr;
-}
-
-static void removeLDEFStub(ListHandle list) {
- if ((*list)->listDefProc)
- DisposeHandle((Handle)(*list)->listDefProc);
- (*list)->listDefProc = NULL;
-}
-
-#endif
static PyObject *List_Error;
PyObject_HEAD
ListHandle ob_itself;
PyObject *ob_ldef_func;
- int ob_have_ldef_stub;
int ob_must_be_disposed;
} ListObject;
if (it == NULL) return NULL;
it->ob_itself = itself;
it->ob_ldef_func = NULL;
- it->ob_have_ldef_stub = 0;
it->ob_must_be_disposed = 1;
SetListRefCon(itself, (long)it);
return (PyObject *)it;
{
Py_XDECREF(self->ob_ldef_func);
self->ob_ldef_func = NULL;
-#if !TARGET_API_MAC_CARBON
- if (self->ob_have_ldef_stub) removeLDEFStub(self->ob_itself);
-#endif
SetListRefCon(self->ob_itself, (long)0);
if (self->ob_must_be_disposed && self->ob_itself) LDispose(self->ob_itself);
PyObject_Del(self);
return NULL;
-#if TARGET_API_MAC_CARBON
/* Carbon applications use the CreateCustomList API */
theSpec.u.userProc = myListDefFunctionUPP;
CreateCustomList(&rView,
scrollVert,
&outList);
-#else
- /* pre-Carbon applications set the address in the LDEF
- to a routine descriptor referring to their list
- definition routine. */
- outList = LNew(&rView,
- &dataBounds,
- cellSize,
- 0,
- theWindow,
- drawIt, /* XXX must be false */
- hasGrow,
- scrollHoriz,
- scrollVert);
- if (installLDEFStub(outList) != noErr) {
- PyErr_SetString(PyExc_MemoryError, "can't create LDEF stub");
- return NULL;
- }
-#endif
_res = ListObj_New(outList);
if (_res == NULL)
return NULL;
Py_INCREF(listDefFunc);
((ListObject*)_res)->ob_ldef_func = listDefFunc;
-#if !TARGET_API_MAC_CARBON
- ((ListObject*)_res)->ob_have_ldef_stub = 1;
-#endif
return _res;
}
static ListDefUPP myListDefFunctionUPP;
-#if !TARGET_API_MAC_CARBON
-
-#define kJumpAbs 0x4EF9
-
-#pragma options align=mac68k
-typedef struct {
- short jmpabs; /* 4EF9 */
- ListDefUPP theUPP; /* 00000000 */
-} LDEFStub, **LDEFStubHandle;
-#pragma options align=reset
-
-static OSErr installLDEFStub(ListHandle list) {
- LDEFStubHandle stubH;
-
- stubH = (LDEFStubHandle)NewHandleClear(sizeof(LDEFStub));
- if (stubH == NULL)
- return MemError();
-
- (*stubH)->jmpabs = kJumpAbs;
- (*stubH)->theUPP = myListDefFunctionUPP;
- HLock((Handle) stubH);
-
- (*list)->listDefProc = (Handle)stubH;
- return noErr;
-}
-
-static void removeLDEFStub(ListHandle list) {
- if ((*list)->listDefProc)
- DisposeHandle((Handle)(*list)->listDefProc);
- (*list)->listDefProc = NULL;
-}
-
-#endif
"""
initstuff = initstuff + """
def outputStructMembers(self):
ObjectDefinition.outputStructMembers(self)
Output("PyObject *ob_ldef_func;")
- Output("int ob_have_ldef_stub;")
Output("int ob_must_be_disposed;")
def outputCheckNewArg(self):
def outputInitStructMembers(self):
ObjectDefinition.outputInitStructMembers(self)
Output("it->ob_ldef_func = NULL;")
- Output("it->ob_have_ldef_stub = 0;")
Output("it->ob_must_be_disposed = 1;")
Output("SetListRefCon(itself, (long)it);")
def outputFreeIt(self, itselfname):
Output("Py_XDECREF(self->ob_ldef_func);")
Output("self->ob_ldef_func = NULL;")
- Output("#if !TARGET_API_MAC_CARBON")
- Output("if (self->ob_have_ldef_stub) removeLDEFStub(self->ob_itself);");
- Output("#endif");
Output("SetListRefCon(self->ob_itself, (long)0);")
Output("if (self->ob_must_be_disposed && %s) LDispose(%s);", itselfname, itselfname)
return NULL;
-#if TARGET_API_MAC_CARBON
/* Carbon applications use the CreateCustomList API */
theSpec.u.userProc = myListDefFunctionUPP;
CreateCustomList(&rView,
scrollVert,
&outList);
-#else
-/* pre-Carbon applications set the address in the LDEF
-to a routine descriptor referring to their list
-definition routine. */
-outList = LNew(&rView,
- &dataBounds,
- cellSize,
- 0,
- theWindow,
- drawIt, /* XXX must be false */
- hasGrow,
- scrollHoriz,
- scrollVert);
-if (installLDEFStub(outList) != noErr) {
- PyErr_SetString(PyExc_MemoryError, "can't create LDEF stub");
- return NULL;
-}
-#endif
_res = ListObj_New(outList);
if (_res == NULL)
return NULL;
Py_INCREF(listDefFunc);
((ListObject*)_res)->ob_ldef_func = listDefFunc;
-#if !TARGET_API_MAC_CARBON
-((ListObject*)_res)->ob_have_ldef_stub = 1;
-#endif
return _res;\
"""
{"_Scrap", init_Scrap},
{"_TE", init_TE},
{"ColorPicker", initColorPicker},
-#if !TARGET_API_MAC_CARBON
- {"_Help", init_Help},
- {"Printing", initPrinting},
-#endif
-#if TARGET_API_MAC_CARBON
{"_CF", init_CF},
-#endif
-#if TARGET_API_MAC_CARBON
{"hfsplus", inithfsplus},
-#endif
#endif /* USE_TOOLBOX */
#ifdef USE_QT
{"_Cm", init_Cm},
static int
_mfs_GetFSSpecFromFSRef(PyObject *self, FSSpec *fssp)
{
-#if !TARGET_API_MAC_OS8
static FSRef *fsrp;
if ( is_mfsrobject(self) ) {
if ( FSGetCatalogInfo(&((mfsrobject *)self)->fsref, kFSCatInfoNone, NULL, NULL, fssp, NULL) == noErr )
return 1;
}
-#endif
return 0;
}
static int
_mfs_GetFSRefFromFSRef(PyObject *self, FSRef *fsrp)
{
-#if !TARGET_API_MAC_OS8
if ( is_mfsrobject(self) ) {
*fsrp = ((mfsrobject *)self)->fsref;
return 1;
}
-#endif
return 0;
}
static int
_mfs_GetFSRefFromFSSpec(PyObject *self, FSRef *fsrp)
{
-#if !TARGET_API_MAC_OS8
if ( is_mfssobject(self) ) {
if ( FSpMakeFSRef(&((mfssobject *)self)->fsspec, fsrp) == noErr )
return 1;
}
-#endif
return 0;
}
static PyObject *
mfss_FSpMakeFSRef(mfssobject *self, PyObject *args)
{
-#if TARGET_API_MAC_OS8
- PyErr_SetString(PyExc_NotImplementedError, "FSRef objects not supported on this platform");
- return 0;
-#else
OSErr err;
FSRef fsref;
return NULL;
}
return (PyObject *)newmfsrobject(&fsref);
-#endif
}
/* XXXX These routines should be replaced by a wrapper to the *FInfo routines */
/* End of code for FSSpec objects */
/* -------------------------------------------------------- */
-#if !TARGET_API_MAC_OS8
static PyObject *
mfsr_as_fsspec(mfsrobject *self, PyObject *args)
{
};
/* End of code for FSRef objects */
-#endif /* !TARGET_API_MAC_OS8 */
/* -------------------------------------------------------- */
static PyObject *
return Py_BuildValue("Oii", newmfssobject(&fss), (int)isfolder, (int)wasaliased);
}
-#if !TARGET_API_MAC_CARBON
-static PyObject *
-mfs_StandardGetFile(PyObject *self, PyObject *args)
-{
- SFTypeList list;
- short numtypes;
- StandardFileReply reply;
-
- list[0] = list[1] = list[2] = list[3] = 0;
- numtypes = 0;
- if (!PyArg_ParseTuple(args, "|O&O&O&O&", PyMac_GetOSType, &list[0],
- PyMac_GetOSType, &list[1], PyMac_GetOSType, &list[2],
- PyMac_GetOSType, &list[3]) )
- return NULL;
- while ( numtypes < 4 && list[numtypes] ) {
- numtypes++;
- }
- if ( numtypes == 0 )
- numtypes = -1;
- StandardGetFile((FileFilterUPP)0, numtypes, list, &reply);
- return Py_BuildValue("(Oi)", newmfssobject(&reply.sfFile), reply.sfGood);
-}
-
-static PyObject *
-mfs_PromptGetFile(PyObject *self, PyObject *args)
-{
- SFTypeList list;
- short numtypes;
- StandardFileReply reply;
- char *prompt = NULL;
-
- list[0] = list[1] = list[2] = list[3] = 0;
- numtypes = 0;
- if (!PyArg_ParseTuple(args, "s|O&O&O&O&", &prompt, PyMac_GetOSType, &list[0],
- PyMac_GetOSType, &list[1], PyMac_GetOSType, &list[2],
- PyMac_GetOSType, &list[3]) )
- return NULL;
- while ( numtypes < 4 && list[numtypes] ) {
- numtypes++;
- }
- if ( numtypes == 0 )
- numtypes = -1;
- PyMac_PromptGetFile(numtypes, list, &reply, prompt);
- return Py_BuildValue("(Oi)", newmfssobject(&reply.sfFile), reply.sfGood);
-}
-
-static PyObject *
-mfs_StandardPutFile(PyObject *self, PyObject *args)
-{
- Str255 prompt, dft;
- StandardFileReply reply;
-
- dft[0] = 0;
- if (!PyArg_ParseTuple(args, "O&|O&", PyMac_GetStr255, &prompt, PyMac_GetStr255, &dft) )
- return NULL;
- StandardPutFile(prompt, dft, &reply);
- return Py_BuildValue("(Oi)",newmfssobject(&reply.sfFile), reply.sfGood);
-}
-
-/*
-** Set initial directory for file dialogs */
-static PyObject *
-mfs_SetFolder(PyObject *self, PyObject *args)
-{
- FSSpec spec;
- FSSpec ospec;
- short orefnum;
- long oparid;
-
- /* Get old values */
- orefnum = -LMGetSFSaveDisk();
- oparid = LMGetCurDirStore();
- (void)FSMakeFSSpec(orefnum, oparid, "\pplaceholder", &ospec);
-
- /* Go to working directory by default */
- (void)FSMakeFSSpec(0, 0, "\p:placeholder", &spec);
- if (!PyArg_ParseTuple(args, "|O&", PyMac_GetFSSpec, &spec))
- return NULL;
- /* Set standard-file working directory */
- LMSetSFSaveDisk(-spec.vRefNum);
- LMSetCurDirStore(spec.parID);
- return (PyObject *)newmfssobject(&ospec);
-}
-#endif
-
static PyObject *
mfs_FSSpec(PyObject *self, PyObject *args)
{
static PyObject *
mfs_FSRef(PyObject *self, PyObject *args)
{
-#if TARGET_API_MAC_OS8
- PyErr_SetString(PyExc_NotImplementedError, "FSRef objects not supported on this platform");
- return 0;
-#else
FSRef fsr;
if (!PyArg_ParseTuple(args, "O&", PyMac_GetFSRef, &fsr))
return NULL;
return (PyObject *)newmfsrobject(&fsr);
-#endif
}
static PyObject *
return (PyObject *)newmfsaobject((AliasHandle)h);
}
-#if !TARGET_API_MAC_CARBON
-static PyObject *
-mfs_GetDirectory(PyObject *self, PyObject *args)
-{
- FSSpec fsdir;
- int ok;
- char *prompt = NULL;
-
- if (!PyArg_ParseTuple(args, "|s", &prompt) )
- return NULL;
-
- ok = PyMac_GetDirectory(&fsdir, prompt);
- return Py_BuildValue("(Oi)", newmfssobject(&fsdir), ok);
-}
-#endif
-
static PyObject *
mfs_FindFolder(PyObject *self, PyObject *args)
{
static struct PyMethodDef mfs_methods[] = {
{"ResolveAliasFile", mfs_ResolveAliasFile, 1},
-#if !TARGET_API_MAC_CARBON
- {"StandardGetFile", mfs_StandardGetFile, 1},
- {"PromptGetFile", mfs_PromptGetFile, 1},
- {"StandardPutFile", mfs_StandardPutFile, 1},
- {"GetDirectory", mfs_GetDirectory, 1},
- {"SetFolder", mfs_SetFolder, 1},
-#endif
{"FSSpec", mfs_FSSpec, 1},
{"FSRef", mfs_FSRef, 1},
{"RawFSSpec", mfs_RawFSSpec, 1},
int
PyMac_GetFSRef(PyObject *v, FSRef *fsr)
{
-#if TARGET_API_MAC_OS8
- PyErr_SetString(PyExc_TypeError, "FSRef objects not supported on this platform");
- return 0;
-#else
/* If it's an FSRef we're also okay. */
if (_mfs_GetFSRefFromFSRef(v, fsr))
return 1;
}
PyErr_SetString(PyExc_TypeError, "FSRef argument should be existing FSRef, FSSpec or (OSX only) pathname");
return 0;
-#endif
}
/* Convert FSSpec to PyObject */
PyObject *PyMac_BuildFSRef(FSRef *v)
{
-#if TARGET_API_MAC_OS8
- return NULL;
-#else
return (PyObject *)newmfsrobject(v);
-#endif
}
/*
#include <string.h>
#include <errno.h>
-#if TARGET_API_MAC_OS8
-/* Skip for Carbon */
-#include "macstat.h"
-#endif
-
#ifdef USE_GUSI
/* Remove defines from macstat.h */
#undef S_IFMT
#include <sys/types.h>
#include <sys/stat.h>
#else /* USE_GUSI */
-#if TARGET_API_MAC_OS8
-#define stat macstat
-#endif
#endif /* USE_GUSI */
#ifdef USE_GUSI2
}
#endif
-#if TARGET_API_MAC_OS8
-static PyObject *
-mac_getbootvol(self, args)
- PyObject *self;
- PyObject *args;
-{
- char *res;
- if (!PyArg_ParseTuple(args, ""))
- return NULL;
- Py_BEGIN_ALLOW_THREADS
- res = getbootvol();
- Py_END_ALLOW_THREADS
- if (res == NULL)
- return mac_error();
- return PyString_FromString(res);
-}
-#endif
-
static PyObject *
mac_getcwd(self, args)
PyObject *self;
static PyTypeObject StatResultType;
-#ifdef TARGET_API_MAC_OS8
-static PyStructSequence_Field xstat_result_fields[] = {
- COMMON_STAT_RESULT_FIELDS
- { "st_rsize" },
- { "st_creator" },
- { "st_type "},
- {0}
-};
-
-static PyStructSequence_Desc xstat_result_desc = {
- "mac.xstat_result",
- stat_result__doc__,
- xstat_result_fields,
- 13
-};
-
-static PyTypeObject XStatResultType;
-#endif
-
static PyObject *
_pystat_from_struct_stat(struct stat st, void* _mst)
{
PyObject *v;
-#if TARGET_API_MAC_OS8
- struct macstat *mst;
-
- if (_mst != NULL)
- v = PyStructSequence_New(&XStatResultType);
- else
-#endif
- v = PyStructSequence_New(&StatResultType);
+ v = PyStructSequence_New(&StatResultType);
PyStructSequence_SET_ITEM(v, 0, PyInt_FromLong((long)st.st_mode));
PyStructSequence_SET_ITEM(v, 1, PyInt_FromLong((long)st.st_ino));
PyStructSequence_SET_ITEM(v, 2, PyInt_FromLong((long)st.st_dev));
PyFloat_FromDouble((double)st.st_mtime));
PyStructSequence_SET_ITEM(v, 9,
PyFloat_FromDouble((double)st.st_ctime));
-#if TARGET_API_MAC_OS8
- if (_mst != NULL) {
- mst = (struct macstat *) _mst;
- PyStructSequence_SET_ITEM(v, 10,
- PyInt_FromLong((long)mst->st_rsize));
- PyStructSequence_SET_ITEM(v, 11,
- PyString_FromStringAndSize(mst->st_creator,
- 4));
- PyStructSequence_SET_ITEM(v, 12,
- PyString_FromStringAndSize(mst->st_type,
- 4));
+ if (PyErr_Occurred()) {
+ Py_DECREF(v);
+ return NULL;
}
-#endif
-
- if (PyErr_Occurred()) {
- Py_DECREF(v);
- return NULL;
- }
- return v;
+ return v;
}
}
#endif /* WEHAVE_FSTAT */
-#if TARGET_API_MAC_OS8
-static PyObject *
-mac_xstat(self, args)
- PyObject *self;
- PyObject *args;
-{
- struct macstat mst;
- struct stat st;
- char *path;
- int res;
- if (!PyArg_ParseTuple(args, "s", &path))
- return NULL;
- /*
- ** Convoluted: we want stat() and xstat() to agree, so we call both
- ** stat and macstat, and use the latter only for values not provided by
- ** the former.
- */
- Py_BEGIN_ALLOW_THREADS
- res = macstat(path, &mst);
- Py_END_ALLOW_THREADS
- if (res != 0)
- return mac_error();
- Py_BEGIN_ALLOW_THREADS
- res = stat(path, &st);
- Py_END_ALLOW_THREADS
- if (res != 0)
- return mac_error();
-
- return _pystat_from_struct_stat(st, (void*) &mst);
-}
-#endif
-
static PyObject *
mac_sync(self, args)
PyObject *self;
#endif
#ifdef WEHAVE_FSTAT
{"fstat", mac_fstat, 1},
-#endif
-#if TARGET_API_MAC_OS8
- {"getbootvol", mac_getbootvol, 1}, /* non-standard */
#endif
{"getcwd", mac_getcwd, 1},
{"listdir", mac_listdir, 1},
{"rename", mac_rename, 1},
{"rmdir", mac_rmdir, 1},
{"stat", mac_stat, 1},
-#if TARGET_API_MAC_OS8
- {"xstat", mac_xstat, 1},
-#endif
{"sync", mac_sync, 1},
{"remove", mac_unlink, 1},
{"unlink", mac_unlink, 1},
PyStructSequence_InitType(&StatResultType, &stat_result_desc);
PyDict_SetItemString(d, "stat_result", (PyObject*) &StatResultType);
-#if TARGET_API_MAC_OS8
- PyStructSequence_InitType(&XStatResultType, &xstat_result_desc);
- PyDict_SetItemString(d, "xstat_result", (PyObject*) &XStatResultType);
-#endif
}
return Py_None;
}
-#if TARGET_API_MAC_OS8
-/*----------------------------------------------------------------------*/
-/* STDWIN High Level Event interface */
-
-#include <EPPC.h>
-#include <Events.h>
-
-static char accepthle_doc[] = "Get arguments of pending high-level event";
-
-static PyObject *
-MacOS_AcceptHighLevelEvent(self, args)
- PyObject *self;
- PyObject *args;
-{
- TargetID sender;
- unsigned long refcon;
- Ptr buf;
- unsigned long len;
- OSErr err;
- PyObject *res;
-
- buf = NULL;
- len = 0;
- err = AcceptHighLevelEvent(&sender, &refcon, buf, &len);
- if (err == bufferIsSmall) {
- buf = malloc(len);
- if (buf == NULL)
- return PyErr_NoMemory();
- err = AcceptHighLevelEvent(&sender, &refcon, buf, &len);
- if (err != noErr) {
- free(buf);
- return PyErr_Mac(MacOS_Error, (int)err);
- }
- }
- else if (err != noErr)
- return PyErr_Mac(MacOS_Error, (int)err);
- res = Py_BuildValue("s#ls#",
- (char *)&sender, (int)(sizeof sender), refcon, (char *)buf, (int)len);
- free(buf);
- return res;
-}
-#endif
-
#if !TARGET_API_MAC_OSX
static char schedparams_doc[] = "Set/return mainloop interrupt check flag, etc";
#endif /* !TARGET_API_MAC_OSX */
static PyMethodDef MacOS_Methods[] = {
-#if TARGET_API_MAC_OS8
- {"AcceptHighLevelEvent", MacOS_AcceptHighLevelEvent, 1, accepthle_doc},
-#endif
{"GetCreatorAndType", MacOS_GetCreatorAndType, 1, getcrtp_doc},
{"SetCreatorAndType", MacOS_SetCreatorAndType, 1, setcrtp_doc},
#if !TARGET_API_MAC_OSX
}
#if TARGET_API_MAC_OSX
#define PY_RUNTIMEMODEL "macho"
-#elif TARGET_API_MAC_OS8
-#define PY_RUNTIMEMODEL "ppc"
#elif TARGET_API_MAC_CARBON
#define PY_RUNTIMEMODEL "carbon"
#else
return _res;
}
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *MenuObj_CountMItems(MenuObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- short _rv;
-#ifndef CountMItems
- PyMac_PRECHECK(CountMItems);
-#endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = CountMItems(_self->ob_itself);
- _res = Py_BuildValue("h",
- _rv);
- return _res;
-}
-#endif
-
static PyObject *MenuObj_CountMenuItems(MenuObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
return _res;
}
-#if TARGET_API_MAC_CARBON
-
static PyObject *MenuObj_IsValidMenu(MenuObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
_rv);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_GetMenuRetainCount(MenuObject *_self, PyObject *_args)
{
_rv);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_RetainMenu(MenuObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_ReleaseMenu(MenuObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_DuplicateMenu(MenuObject *_self, PyObject *_args)
{
MenuObj_New, outMenu);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_CopyMenuTitleAsCFString(MenuObject *_self, PyObject *_args)
{
CFStringRefObj_New, outString);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_SetMenuTitleWithCFString(MenuObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_InvalidateMenuSize(MenuObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_IsMenuSizeInvalid(MenuObject *_self, PyObject *_args)
{
_rv);
return _res;
}
-#endif
static PyObject *MenuObj_MacAppendMenu(MenuObject *_self, PyObject *_args)
{
return _res;
}
-#if TARGET_API_MAC_CARBON
-
static PyObject *MenuObj_CopyMenuItems(MenuObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_DeleteMenuItems(MenuObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_AppendMenuItemTextWithCFString(MenuObject *_self, PyObject *_args)
{
outNewItem);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_InsertMenuItemTextWithCFString(MenuObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
static PyObject *MenuObj_PopUpMenuSelect(MenuObject *_self, PyObject *_args)
{
return _res;
}
-#if TARGET_API_MAC_CARBON
-
static PyObject *MenuObj_InvalidateMenuEnabling(MenuObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_IsMenuBarInvalid(MenuObject *_self, PyObject *_args)
{
_rv);
return _res;
}
-#endif
static PyObject *MenuObj_MacInsertMenu(MenuObject *_self, PyObject *_args)
{
return _res;
}
-#if TARGET_API_MAC_CARBON
-
static PyObject *MenuObj_SetRootMenu(MenuObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
_res = Py_None;
return _res;
}
-#endif
-
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *MenuObj_CheckItem(MenuObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- short item;
- Boolean checked;
-#ifndef CheckItem
- PyMac_PRECHECK(CheckItem);
-#endif
- if (!PyArg_ParseTuple(_args, "hb",
- &item,
- &checked))
- return NULL;
- CheckItem(_self->ob_itself,
- item,
- checked);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
-}
-#endif
static PyObject *MenuObj_MacCheckMenuItem(MenuObject *_self, PyObject *_args)
{
return _res;
}
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *MenuObj_DisableItem(MenuObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- short item;
-#ifndef DisableItem
- PyMac_PRECHECK(DisableItem);
-#endif
- if (!PyArg_ParseTuple(_args, "h",
- &item))
- return NULL;
- DisableItem(_self->ob_itself,
- item);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
-}
-#endif
-
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *MenuObj_EnableItem(MenuObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- short item;
-#ifndef EnableItem
- PyMac_PRECHECK(EnableItem);
-#endif
- if (!PyArg_ParseTuple(_args, "h",
- &item))
- return NULL;
- EnableItem(_self->ob_itself,
- item);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
-}
-#endif
-
static PyObject *MenuObj_SetMenuItemCommandID(MenuObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
return _res;
}
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *MenuObj_SetMenuItemRefCon2(MenuObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- OSErr _err;
- SInt16 inItem;
- UInt32 inRefCon2;
-#ifndef SetMenuItemRefCon2
- PyMac_PRECHECK(SetMenuItemRefCon2);
-#endif
- if (!PyArg_ParseTuple(_args, "hl",
- &inItem,
- &inRefCon2))
- return NULL;
- _err = SetMenuItemRefCon2(_self->ob_itself,
- inItem,
- inRefCon2);
- if (_err != noErr) return PyMac_Error(_err);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
-}
-#endif
-
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *MenuObj_GetMenuItemRefCon2(MenuObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- OSErr _err;
- SInt16 inItem;
- UInt32 outRefCon2;
-#ifndef GetMenuItemRefCon2
- PyMac_PRECHECK(GetMenuItemRefCon2);
-#endif
- if (!PyArg_ParseTuple(_args, "h",
- &inItem))
- return NULL;
- _err = GetMenuItemRefCon2(_self->ob_itself,
- inItem,
- &outRefCon2);
- if (_err != noErr) return PyMac_Error(_err);
- _res = Py_BuildValue("l",
- outRefCon2);
- return _res;
-}
-#endif
-
static PyObject *MenuObj_SetMenuItemKeyGlyph(MenuObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
return _res;
}
-#if TARGET_API_MAC_CARBON
-
static PyObject *MenuObj_SetMenuItemHierarchicalMenu(MenuObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_GetMenuItemHierarchicalMenu(MenuObject *_self, PyObject *_args)
{
OptMenuObj_New, outHierMenu);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_CopyMenuItemTextAsCFString(MenuObject *_self, PyObject *_args)
{
CFStringRefObj_New, outString);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_SetMenuItemTextWithCFString(MenuObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_GetMenuItemIndent(MenuObject *_self, PyObject *_args)
{
outIndent);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_SetMenuItemIndent(MenuObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_GetMenuItemCommandKey(MenuObject *_self, PyObject *_args)
{
outKey);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_SetMenuItemCommandKey(MenuObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_GetMenuItemPropertyAttributes(MenuObject *_self, PyObject *_args)
{
attributes);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_ChangeMenuItemPropertyAttributes(MenuObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_GetMenuAttributes(MenuObject *_self, PyObject *_args)
{
outAttributes);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_ChangeMenuAttributes(MenuObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_GetMenuItemAttributes(MenuObject *_self, PyObject *_args)
{
outAttributes);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_ChangeMenuItemAttributes(MenuObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_DisableAllMenuItems(MenuObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_EnableAllMenuItems(MenuObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_MenuHasEnabledItems(MenuObject *_self, PyObject *_args)
{
_rv);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_GetMenuType(MenuObject *_self, PyObject *_args)
{
outType);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_CountMenuItemsWithCommandID(MenuObject *_self, PyObject *_args)
{
_rv);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_GetIndMenuItemWithCommandID(MenuObject *_self, PyObject *_args)
{
outIndex);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_EnableMenuCommand(MenuObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_DisableMenuCommand(MenuObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_IsMenuCommandEnabled(MenuObject *_self, PyObject *_args)
{
_rv);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_SetMenuCommandMark(MenuObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_GetMenuCommandMark(MenuObject *_self, PyObject *_args)
{
outMark);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_GetMenuCommandPropertySize(MenuObject *_self, PyObject *_args)
{
outSize);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_RemoveMenuCommandProperty(MenuObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_IsMenuItemInvalid(MenuObject *_self, PyObject *_args)
{
_rv);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_InvalidateMenuItems(MenuObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_UpdateInvalidMenuItems(MenuObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_CreateStandardFontMenu(MenuObject *_self, PyObject *_args)
{
outHierMenuCount);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_UpdateStandardFontMenu(MenuObject *_self, PyObject *_args)
{
outHierMenuCount);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *MenuObj_GetFontFamilyFromMenuSelection(MenuObject *_self, PyObject *_args)
{
outStyle);
return _res;
}
-#endif
static PyObject *MenuObj_GetMenuID(MenuObject *_self, PyObject *_args)
{
PyDoc_STR("() -> None")},
{"CalcMenuSize", (PyCFunction)MenuObj_CalcMenuSize, 1,
PyDoc_STR("() -> None")},
-
-#if !TARGET_API_MAC_CARBON
- {"CountMItems", (PyCFunction)MenuObj_CountMItems, 1,
- PyDoc_STR("() -> (short _rv)")},
-#endif
{"CountMenuItems", (PyCFunction)MenuObj_CountMenuItems, 1,
PyDoc_STR("() -> (short _rv)")},
{"GetMenuFont", (PyCFunction)MenuObj_GetMenuFont, 1,
PyDoc_STR("() -> (Boolean _rv)")},
{"SetMenuExcludesMarkColumn", (PyCFunction)MenuObj_SetMenuExcludesMarkColumn, 1,
PyDoc_STR("(Boolean excludesMark) -> None")},
-
-#if TARGET_API_MAC_CARBON
{"IsValidMenu", (PyCFunction)MenuObj_IsValidMenu, 1,
PyDoc_STR("() -> (Boolean _rv)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetMenuRetainCount", (PyCFunction)MenuObj_GetMenuRetainCount, 1,
PyDoc_STR("() -> (ItemCount _rv)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"RetainMenu", (PyCFunction)MenuObj_RetainMenu, 1,
PyDoc_STR("() -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"ReleaseMenu", (PyCFunction)MenuObj_ReleaseMenu, 1,
PyDoc_STR("() -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"DuplicateMenu", (PyCFunction)MenuObj_DuplicateMenu, 1,
PyDoc_STR("() -> (MenuHandle outMenu)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"CopyMenuTitleAsCFString", (PyCFunction)MenuObj_CopyMenuTitleAsCFString, 1,
PyDoc_STR("() -> (CFStringRef outString)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"SetMenuTitleWithCFString", (PyCFunction)MenuObj_SetMenuTitleWithCFString, 1,
PyDoc_STR("(CFStringRef inString) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"InvalidateMenuSize", (PyCFunction)MenuObj_InvalidateMenuSize, 1,
PyDoc_STR("() -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"IsMenuSizeInvalid", (PyCFunction)MenuObj_IsMenuSizeInvalid, 1,
PyDoc_STR("() -> (Boolean _rv)")},
-#endif
{"MacAppendMenu", (PyCFunction)MenuObj_MacAppendMenu, 1,
PyDoc_STR("(Str255 data) -> None")},
{"InsertResMenu", (PyCFunction)MenuObj_InsertResMenu, 1,
PyDoc_STR("(Str255 inString) -> None")},
{"InsertMenuItemText", (PyCFunction)MenuObj_InsertMenuItemText, 1,
PyDoc_STR("(Str255 inString, MenuItemIndex afterItem) -> None")},
-
-#if TARGET_API_MAC_CARBON
{"CopyMenuItems", (PyCFunction)MenuObj_CopyMenuItems, 1,
PyDoc_STR("(MenuItemIndex inFirstItem, ItemCount inNumItems, MenuHandle inDestMenu, MenuItemIndex inInsertAfter) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"DeleteMenuItems", (PyCFunction)MenuObj_DeleteMenuItems, 1,
PyDoc_STR("(MenuItemIndex inFirstItem, ItemCount inNumItems) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"AppendMenuItemTextWithCFString", (PyCFunction)MenuObj_AppendMenuItemTextWithCFString, 1,
PyDoc_STR("(CFStringRef inString, MenuItemAttributes inAttributes, MenuCommand inCommandID) -> (MenuItemIndex outNewItem)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"InsertMenuItemTextWithCFString", (PyCFunction)MenuObj_InsertMenuItemTextWithCFString, 1,
PyDoc_STR("(CFStringRef inString, MenuItemIndex inAfterItem, MenuItemAttributes inAttributes, MenuCommand inCommandID) -> None")},
-#endif
{"PopUpMenuSelect", (PyCFunction)MenuObj_PopUpMenuSelect, 1,
PyDoc_STR("(short top, short left, short popUpItem) -> (long _rv)")},
-
-#if TARGET_API_MAC_CARBON
{"InvalidateMenuEnabling", (PyCFunction)MenuObj_InvalidateMenuEnabling, 1,
PyDoc_STR("() -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"IsMenuBarInvalid", (PyCFunction)MenuObj_IsMenuBarInvalid, 1,
PyDoc_STR("() -> (Boolean _rv)")},
-#endif
{"MacInsertMenu", (PyCFunction)MenuObj_MacInsertMenu, 1,
PyDoc_STR("(MenuID beforeID) -> None")},
-
-#if TARGET_API_MAC_CARBON
{"SetRootMenu", (PyCFunction)MenuObj_SetRootMenu, 1,
PyDoc_STR("() -> None")},
-#endif
-
-#if !TARGET_API_MAC_CARBON
- {"CheckItem", (PyCFunction)MenuObj_CheckItem, 1,
- PyDoc_STR("(short item, Boolean checked) -> None")},
-#endif
{"MacCheckMenuItem", (PyCFunction)MenuObj_MacCheckMenuItem, 1,
PyDoc_STR("(short item, Boolean checked) -> None")},
{"SetMenuItemText", (PyCFunction)MenuObj_SetMenuItemText, 1,
PyDoc_STR("(short item, StyleParameter chStyle) -> None")},
{"GetItemStyle", (PyCFunction)MenuObj_GetItemStyle, 1,
PyDoc_STR("(short item) -> (Style chStyle)")},
-
-#if !TARGET_API_MAC_CARBON
- {"DisableItem", (PyCFunction)MenuObj_DisableItem, 1,
- PyDoc_STR("(short item) -> None")},
-#endif
-
-#if !TARGET_API_MAC_CARBON
- {"EnableItem", (PyCFunction)MenuObj_EnableItem, 1,
- PyDoc_STR("(short item) -> None")},
-#endif
{"SetMenuItemCommandID", (PyCFunction)MenuObj_SetMenuItemCommandID, 1,
PyDoc_STR("(SInt16 inItem, MenuCommand inCommandID) -> None")},
{"GetMenuItemCommandID", (PyCFunction)MenuObj_GetMenuItemCommandID, 1,
PyDoc_STR("(SInt16 inItem, UInt32 inRefCon) -> None")},
{"GetMenuItemRefCon", (PyCFunction)MenuObj_GetMenuItemRefCon, 1,
PyDoc_STR("(SInt16 inItem) -> (UInt32 outRefCon)")},
-
-#if !TARGET_API_MAC_CARBON
- {"SetMenuItemRefCon2", (PyCFunction)MenuObj_SetMenuItemRefCon2, 1,
- PyDoc_STR("(SInt16 inItem, UInt32 inRefCon2) -> None")},
-#endif
-
-#if !TARGET_API_MAC_CARBON
- {"GetMenuItemRefCon2", (PyCFunction)MenuObj_GetMenuItemRefCon2, 1,
- PyDoc_STR("(SInt16 inItem) -> (UInt32 outRefCon2)")},
-#endif
{"SetMenuItemKeyGlyph", (PyCFunction)MenuObj_SetMenuItemKeyGlyph, 1,
PyDoc_STR("(SInt16 inItem, SInt16 inGlyph) -> None")},
{"GetMenuItemKeyGlyph", (PyCFunction)MenuObj_GetMenuItemKeyGlyph, 1,
PyDoc_STR("(MenuItemIndex item) -> None")},
{"IsMenuItemIconEnabled", (PyCFunction)MenuObj_IsMenuItemIconEnabled, 1,
PyDoc_STR("(MenuItemIndex item) -> (Boolean _rv)")},
-
-#if TARGET_API_MAC_CARBON
{"SetMenuItemHierarchicalMenu", (PyCFunction)MenuObj_SetMenuItemHierarchicalMenu, 1,
PyDoc_STR("(MenuItemIndex inItem, MenuHandle inHierMenu) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetMenuItemHierarchicalMenu", (PyCFunction)MenuObj_GetMenuItemHierarchicalMenu, 1,
PyDoc_STR("(MenuItemIndex inItem) -> (MenuHandle outHierMenu)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"CopyMenuItemTextAsCFString", (PyCFunction)MenuObj_CopyMenuItemTextAsCFString, 1,
PyDoc_STR("(MenuItemIndex inItem) -> (CFStringRef outString)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"SetMenuItemTextWithCFString", (PyCFunction)MenuObj_SetMenuItemTextWithCFString, 1,
PyDoc_STR("(MenuItemIndex inItem, CFStringRef inString) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetMenuItemIndent", (PyCFunction)MenuObj_GetMenuItemIndent, 1,
PyDoc_STR("(MenuItemIndex inItem) -> (UInt32 outIndent)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"SetMenuItemIndent", (PyCFunction)MenuObj_SetMenuItemIndent, 1,
PyDoc_STR("(MenuItemIndex inItem, UInt32 inIndent) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetMenuItemCommandKey", (PyCFunction)MenuObj_GetMenuItemCommandKey, 1,
PyDoc_STR("(MenuItemIndex inItem, Boolean inGetVirtualKey) -> (UInt16 outKey)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"SetMenuItemCommandKey", (PyCFunction)MenuObj_SetMenuItemCommandKey, 1,
PyDoc_STR("(MenuItemIndex inItem, Boolean inSetVirtualKey, UInt16 inKey) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetMenuItemPropertyAttributes", (PyCFunction)MenuObj_GetMenuItemPropertyAttributes, 1,
PyDoc_STR("(MenuItemIndex item, OSType propertyCreator, OSType propertyTag) -> (UInt32 attributes)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"ChangeMenuItemPropertyAttributes", (PyCFunction)MenuObj_ChangeMenuItemPropertyAttributes, 1,
PyDoc_STR("(MenuItemIndex item, OSType propertyCreator, OSType propertyTag, UInt32 attributesToSet, UInt32 attributesToClear) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetMenuAttributes", (PyCFunction)MenuObj_GetMenuAttributes, 1,
PyDoc_STR("() -> (MenuAttributes outAttributes)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"ChangeMenuAttributes", (PyCFunction)MenuObj_ChangeMenuAttributes, 1,
PyDoc_STR("(MenuAttributes setTheseAttributes, MenuAttributes clearTheseAttributes) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetMenuItemAttributes", (PyCFunction)MenuObj_GetMenuItemAttributes, 1,
PyDoc_STR("(MenuItemIndex item) -> (MenuItemAttributes outAttributes)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"ChangeMenuItemAttributes", (PyCFunction)MenuObj_ChangeMenuItemAttributes, 1,
PyDoc_STR("(MenuItemIndex item, MenuItemAttributes setTheseAttributes, MenuItemAttributes clearTheseAttributes) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"DisableAllMenuItems", (PyCFunction)MenuObj_DisableAllMenuItems, 1,
PyDoc_STR("() -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"EnableAllMenuItems", (PyCFunction)MenuObj_EnableAllMenuItems, 1,
PyDoc_STR("() -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"MenuHasEnabledItems", (PyCFunction)MenuObj_MenuHasEnabledItems, 1,
PyDoc_STR("() -> (Boolean _rv)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetMenuType", (PyCFunction)MenuObj_GetMenuType, 1,
PyDoc_STR("() -> (UInt16 outType)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"CountMenuItemsWithCommandID", (PyCFunction)MenuObj_CountMenuItemsWithCommandID, 1,
PyDoc_STR("(MenuCommand inCommandID) -> (ItemCount _rv)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetIndMenuItemWithCommandID", (PyCFunction)MenuObj_GetIndMenuItemWithCommandID, 1,
PyDoc_STR("(MenuCommand inCommandID, UInt32 inItemIndex) -> (MenuHandle outMenu, MenuItemIndex outIndex)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"EnableMenuCommand", (PyCFunction)MenuObj_EnableMenuCommand, 1,
PyDoc_STR("(MenuCommand inCommandID) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"DisableMenuCommand", (PyCFunction)MenuObj_DisableMenuCommand, 1,
PyDoc_STR("(MenuCommand inCommandID) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"IsMenuCommandEnabled", (PyCFunction)MenuObj_IsMenuCommandEnabled, 1,
PyDoc_STR("(MenuCommand inCommandID) -> (Boolean _rv)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"SetMenuCommandMark", (PyCFunction)MenuObj_SetMenuCommandMark, 1,
PyDoc_STR("(MenuCommand inCommandID, UniChar inMark) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetMenuCommandMark", (PyCFunction)MenuObj_GetMenuCommandMark, 1,
PyDoc_STR("(MenuCommand inCommandID) -> (UniChar outMark)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetMenuCommandPropertySize", (PyCFunction)MenuObj_GetMenuCommandPropertySize, 1,
PyDoc_STR("(MenuCommand inCommandID, OSType inPropertyCreator, OSType inPropertyTag) -> (ByteCount outSize)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"RemoveMenuCommandProperty", (PyCFunction)MenuObj_RemoveMenuCommandProperty, 1,
PyDoc_STR("(MenuCommand inCommandID, OSType inPropertyCreator, OSType inPropertyTag) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"IsMenuItemInvalid", (PyCFunction)MenuObj_IsMenuItemInvalid, 1,
PyDoc_STR("(MenuItemIndex item) -> (Boolean _rv)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"InvalidateMenuItems", (PyCFunction)MenuObj_InvalidateMenuItems, 1,
PyDoc_STR("(MenuItemIndex firstItem, ItemCount numItems) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"UpdateInvalidMenuItems", (PyCFunction)MenuObj_UpdateInvalidMenuItems, 1,
PyDoc_STR("() -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"CreateStandardFontMenu", (PyCFunction)MenuObj_CreateStandardFontMenu, 1,
PyDoc_STR("(MenuItemIndex afterItem, MenuID firstHierMenuID, OptionBits options) -> (ItemCount outHierMenuCount)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"UpdateStandardFontMenu", (PyCFunction)MenuObj_UpdateStandardFontMenu, 1,
PyDoc_STR("() -> (ItemCount outHierMenuCount)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetFontFamilyFromMenuSelection", (PyCFunction)MenuObj_GetFontFamilyFromMenuSelection, 1,
PyDoc_STR("(MenuItemIndex item) -> (FMFontFamily outFontFamily, FMFontStyle outStyle)")},
-#endif
{"GetMenuID", (PyCFunction)MenuObj_GetMenuID, 1,
PyDoc_STR("() -> (MenuID _rv)")},
{"GetMenuWidth", (PyCFunction)MenuObj_GetMenuWidth, 1,
/* ---------------------- End object type Menu ---------------------- */
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Menu_InitProcMenu(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- short resID;
-#ifndef InitProcMenu
- PyMac_PRECHECK(InitProcMenu);
-#endif
- if (!PyArg_ParseTuple(_args, "h",
- &resID))
- return NULL;
- InitProcMenu(resID);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
-}
-#endif
-
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Menu_InitMenus(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
-#ifndef InitMenus
- PyMac_PRECHECK(InitMenus);
-#endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- InitMenus();
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
-}
-#endif
-
static PyObject *Menu_NewMenu(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
return _res;
}
-#if TARGET_API_MAC_CARBON
-
static PyObject *Menu_CreateNewMenu(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
MenuObj_New, outMenuRef);
return _res;
}
-#endif
static PyObject *Menu_MenuKey(PyObject *_self, PyObject *_args)
{
return _res;
}
-#if TARGET_API_MAC_CARBON
-
static PyObject *Menu_DuplicateMenuBar(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
ResObj_New, outMbar);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Menu_DisposeMenuBar(PyObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
static PyObject *Menu_GetMenuHandle(PyObject *_self, PyObject *_args)
{
return _res;
}
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Menu_SetMenuFlash(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- short count;
-#ifndef SetMenuFlash
- PyMac_PRECHECK(SetMenuFlash);
-#endif
- if (!PyArg_ParseTuple(_args, "h",
- &count))
- return NULL;
- SetMenuFlash(count);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
-}
-#endif
-
static PyObject *Menu_SetMenuFlashCount(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
return _res;
}
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Menu_SystemEdit(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- Boolean _rv;
- short editCmd;
-#ifndef SystemEdit
- PyMac_PRECHECK(SystemEdit);
-#endif
- if (!PyArg_ParseTuple(_args, "h",
- &editCmd))
- return NULL;
- _rv = SystemEdit(editCmd);
- _res = Py_BuildValue("b",
- _rv);
- return _res;
-}
-#endif
-
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Menu_SystemMenu(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- long menuResult;
-#ifndef SystemMenu
- PyMac_PRECHECK(SystemMenu);
-#endif
- if (!PyArg_ParseTuple(_args, "l",
- &menuResult))
- return NULL;
- SystemMenu(menuResult);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
-}
-#endif
-
static PyObject *Menu_IsMenuBarVisible(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
return _res;
}
-#if TARGET_API_MAC_CARBON
-
static PyObject *Menu_AcquireRootMenu(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
MenuObj_New, _rv);
return _res;
}
-#endif
static PyObject *Menu_DeleteMCEntries(PyObject *_self, PyObject *_args)
{
return _res;
}
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Menu_OpenDeskAcc(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- Str255 name;
-#ifndef OpenDeskAcc
- PyMac_PRECHECK(OpenDeskAcc);
-#endif
- if (!PyArg_ParseTuple(_args, "O&",
- PyMac_GetStr255, name))
- return NULL;
- OpenDeskAcc(name);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
-}
-#endif
-
static PyObject *Menu_as_Menu(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
return _res;
}
-#if TARGET_API_MAC_CARBON
-
static PyObject *Menu_CountMenuItemsWithCommandID(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
_rv);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Menu_GetIndMenuItemWithCommandID(PyObject *_self, PyObject *_args)
{
outIndex);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Menu_EnableMenuCommand(PyObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Menu_DisableMenuCommand(PyObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Menu_IsMenuCommandEnabled(PyObject *_self, PyObject *_args)
{
_rv);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Menu_SetMenuCommandMark(PyObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Menu_GetMenuCommandMark(PyObject *_self, PyObject *_args)
{
outMark);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Menu_GetMenuCommandPropertySize(PyObject *_self, PyObject *_args)
{
outSize);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Menu_RemoveMenuCommandProperty(PyObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
static PyMethodDef Menu_methods[] = {
-
-#if !TARGET_API_MAC_CARBON
- {"InitProcMenu", (PyCFunction)Menu_InitProcMenu, 1,
- PyDoc_STR("(short resID) -> None")},
-#endif
-
-#if !TARGET_API_MAC_CARBON
- {"InitMenus", (PyCFunction)Menu_InitMenus, 1,
- PyDoc_STR("() -> None")},
-#endif
{"NewMenu", (PyCFunction)Menu_NewMenu, 1,
PyDoc_STR("(MenuID menuID, Str255 menuTitle) -> (MenuHandle _rv)")},
{"MacGetMenu", (PyCFunction)Menu_MacGetMenu, 1,
PyDoc_STR("(short resourceID) -> (MenuHandle _rv)")},
-
-#if TARGET_API_MAC_CARBON
{"CreateNewMenu", (PyCFunction)Menu_CreateNewMenu, 1,
PyDoc_STR("(MenuID inMenuID, MenuAttributes inMenuAttributes) -> (MenuHandle outMenuRef)")},
-#endif
{"MenuKey", (PyCFunction)Menu_MenuKey, 1,
PyDoc_STR("(CharParameter ch) -> (long _rv)")},
{"MenuSelect", (PyCFunction)Menu_MenuSelect, 1,
PyDoc_STR("() -> (MenuBarHandle _rv)")},
{"SetMenuBar", (PyCFunction)Menu_SetMenuBar, 1,
PyDoc_STR("(MenuBarHandle mbar) -> None")},
-
-#if TARGET_API_MAC_CARBON
{"DuplicateMenuBar", (PyCFunction)Menu_DuplicateMenuBar, 1,
PyDoc_STR("(MenuBarHandle inMbar) -> (MenuBarHandle outMbar)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"DisposeMenuBar", (PyCFunction)Menu_DisposeMenuBar, 1,
PyDoc_STR("(MenuBarHandle inMbar) -> None")},
-#endif
{"GetMenuHandle", (PyCFunction)Menu_GetMenuHandle, 1,
PyDoc_STR("(MenuID menuID) -> (MenuHandle _rv)")},
{"MacDeleteMenu", (PyCFunction)Menu_MacDeleteMenu, 1,
PyDoc_STR("(MenuID menuID) -> None")},
{"ClearMenuBar", (PyCFunction)Menu_ClearMenuBar, 1,
PyDoc_STR("() -> None")},
-
-#if !TARGET_API_MAC_CARBON
- {"SetMenuFlash", (PyCFunction)Menu_SetMenuFlash, 1,
- PyDoc_STR("(short count) -> None")},
-#endif
{"SetMenuFlashCount", (PyCFunction)Menu_SetMenuFlashCount, 1,
PyDoc_STR("(short count) -> None")},
{"FlashMenuBar", (PyCFunction)Menu_FlashMenuBar, 1,
PyDoc_STR("(MenuID menuID) -> None")},
-
-#if !TARGET_API_MAC_CARBON
- {"SystemEdit", (PyCFunction)Menu_SystemEdit, 1,
- PyDoc_STR("(short editCmd) -> (Boolean _rv)")},
-#endif
-
-#if !TARGET_API_MAC_CARBON
- {"SystemMenu", (PyCFunction)Menu_SystemMenu, 1,
- PyDoc_STR("(long menuResult) -> None")},
-#endif
{"IsMenuBarVisible", (PyCFunction)Menu_IsMenuBarVisible, 1,
PyDoc_STR("() -> (Boolean _rv)")},
{"ShowMenuBar", (PyCFunction)Menu_ShowMenuBar, 1,
PyDoc_STR("() -> None")},
{"HideMenuBar", (PyCFunction)Menu_HideMenuBar, 1,
PyDoc_STR("() -> None")},
-
-#if TARGET_API_MAC_CARBON
{"AcquireRootMenu", (PyCFunction)Menu_AcquireRootMenu, 1,
PyDoc_STR("() -> (MenuHandle _rv)")},
-#endif
{"DeleteMCEntries", (PyCFunction)Menu_DeleteMCEntries, 1,
PyDoc_STR("(MenuID menuID, short menuItem) -> None")},
{"InitContextualMenus", (PyCFunction)Menu_InitContextualMenus, 1,
PyDoc_STR("(EventRecord inEvent) -> (Boolean _rv)")},
{"LMGetTheMenu", (PyCFunction)Menu_LMGetTheMenu, 1,
PyDoc_STR("() -> (SInt16 _rv)")},
-
-#if !TARGET_API_MAC_CARBON
- {"OpenDeskAcc", (PyCFunction)Menu_OpenDeskAcc, 1,
- PyDoc_STR("(Str255 name) -> None")},
-#endif
{"as_Menu", (PyCFunction)Menu_as_Menu, 1,
PyDoc_STR("(Handle h) -> (MenuHandle _rv)")},
{"GetMenu", (PyCFunction)Menu_GetMenu, 1,
PyDoc_STR("(short menuID) -> None")},
{"DrawMenuBar", (PyCFunction)Menu_DrawMenuBar, 1,
PyDoc_STR("() -> None")},
-
-#if TARGET_API_MAC_CARBON
{"CountMenuItemsWithCommandID", (PyCFunction)Menu_CountMenuItemsWithCommandID, 1,
PyDoc_STR("(MenuHandle inMenu, MenuCommand inCommandID) -> (ItemCount _rv)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetIndMenuItemWithCommandID", (PyCFunction)Menu_GetIndMenuItemWithCommandID, 1,
PyDoc_STR("(MenuHandle inMenu, MenuCommand inCommandID, UInt32 inItemIndex) -> (MenuHandle outMenu, MenuItemIndex outIndex)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"EnableMenuCommand", (PyCFunction)Menu_EnableMenuCommand, 1,
PyDoc_STR("(MenuHandle inMenu, MenuCommand inCommandID) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"DisableMenuCommand", (PyCFunction)Menu_DisableMenuCommand, 1,
PyDoc_STR("(MenuHandle inMenu, MenuCommand inCommandID) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"IsMenuCommandEnabled", (PyCFunction)Menu_IsMenuCommandEnabled, 1,
PyDoc_STR("(MenuHandle inMenu, MenuCommand inCommandID) -> (Boolean _rv)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"SetMenuCommandMark", (PyCFunction)Menu_SetMenuCommandMark, 1,
PyDoc_STR("(MenuHandle inMenu, MenuCommand inCommandID, UniChar inMark) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetMenuCommandMark", (PyCFunction)Menu_GetMenuCommandMark, 1,
PyDoc_STR("(MenuHandle inMenu, MenuCommand inCommandID) -> (UniChar outMark)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetMenuCommandPropertySize", (PyCFunction)Menu_GetMenuCommandPropertySize, 1,
PyDoc_STR("(MenuHandle inMenu, MenuCommand inCommandID, OSType inPropertyCreator, OSType inPropertyTag) -> (ByteCount outSize)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"RemoveMenuCommandProperty", (PyCFunction)Menu_RemoveMenuCommandProperty, 1,
PyDoc_STR("(MenuHandle inMenu, MenuCommand inCommandID, OSType inPropertyCreator, OSType inPropertyTag) -> None")},
-#endif
{NULL, NULL, 0}
};
-f = Function(void, 'OpenDeskAcc',
- (Str255, 'name', InMode),
- condition='#if !TARGET_API_MAC_CARBON'
-)
-functions.append(f)
-
f = Function(MenuHandle, 'as_Menu', (Handle, 'h', InMode))
functions.append(f)
f = Function(ItemCount, 'CountMenuItemsWithCommandID',
(OptMenuRef, 'inMenu', InMode),
(MenuCommand, 'inCommandID', InMode),
- condition='#if TARGET_API_MAC_CARBON',
)
functions.append(f)
(UInt32, 'inItemIndex', InMode),
(MenuRef, 'outMenu', OutMode),
(MenuItemIndex, 'outIndex', OutMode),
- condition='#if TARGET_API_MAC_CARBON',
)
functions.append(f)
f = Function(void, 'EnableMenuCommand',
(OptMenuRef, 'inMenu', InMode),
(MenuCommand, 'inCommandID', InMode),
- condition='#if TARGET_API_MAC_CARBON',
)
functions.append(f)
f = Function(void, 'DisableMenuCommand',
(OptMenuRef, 'inMenu', InMode),
(MenuCommand, 'inCommandID', InMode),
- condition='#if TARGET_API_MAC_CARBON',
)
functions.append(f)
f = Function(Boolean, 'IsMenuCommandEnabled',
(OptMenuRef, 'inMenu', InMode),
(MenuCommand, 'inCommandID', InMode),
- condition='#if TARGET_API_MAC_CARBON',
)
functions.append(f)
(OptMenuRef, 'inMenu', InMode),
(MenuCommand, 'inCommandID', InMode),
(UniChar, 'inMark', InMode),
- condition='#if TARGET_API_MAC_CARBON',
)
functions.append(f)
(OptMenuRef, 'inMenu', InMode),
(MenuCommand, 'inCommandID', InMode),
(UniChar, 'outMark', OutMode),
- condition='#if TARGET_API_MAC_CARBON',
)
functions.append(f)
(OSType, 'inPropertyCreator', InMode),
(OSType, 'inPropertyTag', InMode),
(ByteCount, 'outSize', OutMode),
- condition='#if TARGET_API_MAC_CARBON',
)
functions.append(f)
(MenuCommand, 'inCommandID', InMode),
(OSType, 'inPropertyCreator', InMode),
(OSType, 'inPropertyTag', InMode),
- condition='#if TARGET_API_MAC_CARBON',
)
functions.append(f)
"GetMenuTitle", # Funny arg/returnvalue
"SetMenuTitle",
"SetMenuTitleIcon", # void*
+ # OS8 calls:
+ 'GetMenuItemRefCon2',
+ 'SetMenuItemRefCon2',
+ 'EnableItem',
+ 'DisableItem',
+ 'CheckItem',
+ 'CountMItems',
+ 'OpenDeskAcc',
+ 'SystemEdit',
+ 'SystemMenu',
+ 'SetMenuFlash',
+ 'InitMenus',
+ 'InitProcMenu',
]
- def makegreylist(self):
- return [
- ('#if !TARGET_API_MAC_CARBON', [
- 'GetMenuItemRefCon2',
- 'SetMenuItemRefCon2',
- 'EnableItem',
- 'DisableItem',
- 'CheckItem',
- 'CountMItems',
- 'OpenDeskAcc',
- 'SystemEdit',
- 'SystemMenu',
- 'SetMenuFlash',
- 'InitMenus',
- 'InitProcMenu',
- ]),
- ('#if TARGET_API_MAC_CARBON', [
- 'DisposeMenuBar',
- 'DuplicateMenuBar',
- 'CreateNewMenu',
- 'GetFontFamilyFromMenuSelection',
- 'UpdateStandardFontMenu',
- 'CreateStandardFontMenu',
- 'RemoveMenuCommandProperty',
- 'GetMenuCommandPropertySize',
- 'IsMenuCommandEnabled',
- 'DisableMenuCommand',
- 'EnableMenuCommand',
- 'GetIndMenuItemWithCommandID',
- 'CountMenuItemsWithCommandID',
- 'MenuHasEnabledItems',
- 'EnableAllMenuItems',
- 'DisableAllMenuItems',
- 'ChangeMenuItemAttributes',
- 'GetMenuItemAttributes',
- 'ChangeMenuAttributes',
- 'GetMenuAttributes',
- 'ChangeMenuItemPropertyAttributes',
- 'GetMenuItemPropertyAttributes',
- 'AcquireRootMenu',
- 'UpdateInvalidMenuItems',
- 'InvalidateMenuItems',
- 'IsMenuItemInvalid',
- 'GetMenuCommandMark',
- 'SetMenuCommandMark',
- 'GetMenuType',
- 'SetMenuItemCommandKey',
- 'GetMenuItemCommandKey',
- 'SetMenuItemIndent',
- 'GetMenuItemIndent',
- 'SetMenuItemTextWithCFString',
- 'CopyMenuItemTextAsCFString',
- 'GetMenuItemHierarchicalMenu',
- 'SetMenuItemHierarchicalMenu',
- 'SetRootMenu',
- 'IsMenuBarInvalid',
- 'InvalidateMenuEnabling',
- 'InsertMenuItemTextWithCFString',
- 'AppendMenuItemTextWithCFString',
- 'DeleteMenuItems',
- 'CopyMenuItems',
- 'IsMenuSizeInvalid',
- 'InvalidateMenuSize',
- 'SetMenuTitleWithCFString',
- 'CopyMenuTitleAsCFString',
- 'DuplicateMenu',
- 'ReleaseMenu',
- 'RetainMenu',
- 'GetMenuRetainCount',
- 'IsValidMenu',
- ])]
-
def makeblacklisttypes(self):
return [
'MCTableHandle',
return _res;
}
-#if TARGET_API_MAC_OS8
-
-static PyObject *TXNObj_TXNTSMCheck(TXNObjectObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- Boolean _rv;
- EventRecord ioEvent;
-#ifndef TXNTSMCheck
- PyMac_PRECHECK(TXNTSMCheck);
-#endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = TXNTSMCheck(_self->ob_itself,
- &ioEvent);
- _res = Py_BuildValue("bO&",
- _rv,
- PyMac_BuildEventRecord, &ioEvent);
- return _res;
-}
-#endif
-
static PyObject *TXNObj_TXNSelectAll(TXNObjectObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
PyDoc_STR("(RgnHandle ioCursorRgn) -> None")},
{"TXNClick", (PyCFunction)TXNObj_TXNClick, 1,
PyDoc_STR("(EventRecord iEvent) -> None")},
-
-#if TARGET_API_MAC_OS8
- {"TXNTSMCheck", (PyCFunction)TXNObj_TXNTSMCheck, 1,
- PyDoc_STR("() -> (Boolean _rv, EventRecord ioEvent)")},
-#endif
{"TXNSelectAll", (PyCFunction)TXNObj_TXNSelectAll, 1,
PyDoc_STR("() -> None")},
{"TXNFocus", (PyCFunction)TXNObj_TXNFocus, 1,
"kTXNFontSizeAttributeSize",
"status",
"justification",
+ 'TXNTSMCheck', # OS8
]
def makegreylist(self):
return [
('#if TARGET_API_MAC_OS8', [
- 'TXNTSMCheck',
])]
#endif /* ACCESSOR_CALLS_ARE_FUNCTIONS */
-#if !TARGET_API_MAC_CARBON
-#define QDFlushPortBuffer(port, rgn) /* pass */
-#define QDIsPortBufferDirty(port) 0
-#define QDIsPortBuffered(port) 0
-#endif /* !TARGET_API_MAC_CARBON */
-
static PyObject *BMObj_NewCopied(BitMapPtr);
/*
return _res;
}
-#if TARGET_API_MAC_CARBON
-
static PyObject *GrafObj_IsValidPort(GrafPortObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
_rv);
return _res;
}
-#endif
static PyObject *GrafObj_GetPortPixMap(GrafPortObject *_self, PyObject *_args)
{
return _res;
}
-#if TARGET_API_MAC_CARBON
-
static PyObject *GrafObj_IsPortPolyBeingDefined(GrafPortObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
_rv);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *GrafObj_IsPortOffscreen(GrafPortObject *_self, PyObject *_args)
{
_rv);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *GrafObj_IsPortColor(GrafPortObject *_self, PyObject *_args)
{
_rv);
return _res;
}
-#endif
static PyObject *GrafObj_SetPortBounds(GrafPortObject *_self, PyObject *_args)
{
return _res;
}
-#if TARGET_API_MAC_CARBON
-
static PyObject *GrafObj_DisposePort(GrafPortObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
_res = Py_None;
return _res;
}
-#endif
static PyObject *GrafObj_QDIsPortBuffered(GrafPortObject *_self, PyObject *_args)
{
return _res;
}
-#if TARGET_API_MAC_CARBON
-
static PyObject *GrafObj_QDGetDirtyRegion(GrafPortObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *GrafObj_QDSetDirtyRegion(GrafPortObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
static PyMethodDef GrafObj_methods[] = {
{"MacSetPort", (PyCFunction)GrafObj_MacSetPort, 1,
PyDoc_STR("() -> None")},
-
-#if TARGET_API_MAC_CARBON
{"IsValidPort", (PyCFunction)GrafObj_IsValidPort, 1,
PyDoc_STR("() -> (Boolean _rv)")},
-#endif
{"GetPortPixMap", (PyCFunction)GrafObj_GetPortPixMap, 1,
PyDoc_STR("() -> (PixMapHandle _rv)")},
{"GetPortBitMapForCopyBits", (PyCFunction)GrafObj_GetPortBitMapForCopyBits, 1,
PyDoc_STR("() -> (Boolean _rv)")},
{"IsPortPictureBeingDefined", (PyCFunction)GrafObj_IsPortPictureBeingDefined, 1,
PyDoc_STR("() -> (Boolean _rv)")},
-
-#if TARGET_API_MAC_CARBON
{"IsPortPolyBeingDefined", (PyCFunction)GrafObj_IsPortPolyBeingDefined, 1,
PyDoc_STR("() -> (Boolean _rv)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"IsPortOffscreen", (PyCFunction)GrafObj_IsPortOffscreen, 1,
PyDoc_STR("() -> (Boolean _rv)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"IsPortColor", (PyCFunction)GrafObj_IsPortColor, 1,
PyDoc_STR("() -> (Boolean _rv)")},
-#endif
{"SetPortBounds", (PyCFunction)GrafObj_SetPortBounds, 1,
PyDoc_STR("(Rect rect) -> None")},
{"SetPortOpColor", (PyCFunction)GrafObj_SetPortOpColor, 1,
PyDoc_STR("(SInt32 penMode) -> None")},
{"SetPortFracHPenLocation", (PyCFunction)GrafObj_SetPortFracHPenLocation, 1,
PyDoc_STR("(short pnLocHFrac) -> None")},
-
-#if TARGET_API_MAC_CARBON
{"DisposePort", (PyCFunction)GrafObj_DisposePort, 1,
PyDoc_STR("() -> None")},
-#endif
{"QDIsPortBuffered", (PyCFunction)GrafObj_QDIsPortBuffered, 1,
PyDoc_STR("() -> (Boolean _rv)")},
{"QDIsPortBufferDirty", (PyCFunction)GrafObj_QDIsPortBufferDirty, 1,
PyDoc_STR("() -> (Boolean _rv)")},
{"QDFlushPortBuffer", (PyCFunction)GrafObj_QDFlushPortBuffer, 1,
PyDoc_STR("(RgnHandle region) -> None")},
-
-#if TARGET_API_MAC_CARBON
{"QDGetDirtyRegion", (PyCFunction)GrafObj_QDGetDirtyRegion, 1,
PyDoc_STR("(RgnHandle rgn) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"QDSetDirtyRegion", (PyCFunction)GrafObj_QDSetDirtyRegion, 1,
PyDoc_STR("(RgnHandle rgn) -> None")},
-#endif
{NULL, NULL, 0}
};
return _res;
}
-#if TARGET_API_MAC_CARBON
-
static PyObject *Qd_RgnToHandle(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
_res = Py_None;
return _res;
}
-#endif
static PyObject *Qd_DisposeRgn(PyObject *_self, PyObject *_args)
{
return _res;
}
-#if TARGET_API_MAC_CARBON
-
static PyObject *Qd_IsRegionRectangular(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
_rv);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Qd_CreateNewPort(PyObject *_self, PyObject *_args)
{
GrafObj_New, _rv);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Qd_SetQDError(PyObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
static PyObject *Qd_LMGetScrVRes(PyObject *_self, PyObject *_args)
{
PyDoc_STR("(RgnHandle dstRgn) -> None")},
{"BitMapToRegion", (PyCFunction)Qd_BitMapToRegion, 1,
PyDoc_STR("(RgnHandle region, BitMapPtr bMap) -> None")},
-
-#if TARGET_API_MAC_CARBON
{"RgnToHandle", (PyCFunction)Qd_RgnToHandle, 1,
PyDoc_STR("(RgnHandle region, Handle flattenedRgnDataHdl) -> None")},
-#endif
{"DisposeRgn", (PyCFunction)Qd_DisposeRgn, 1,
PyDoc_STR("(RgnHandle rgn) -> None")},
{"MacCopyRgn", (PyCFunction)Qd_MacCopyRgn, 1,
PyDoc_STR("(Cursor arrow) -> None")},
{"GetRegionBounds", (PyCFunction)Qd_GetRegionBounds, 1,
PyDoc_STR("(RgnHandle region) -> (Rect bounds)")},
-
-#if TARGET_API_MAC_CARBON
{"IsRegionRectangular", (PyCFunction)Qd_IsRegionRectangular, 1,
PyDoc_STR("(RgnHandle region) -> (Boolean _rv)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"CreateNewPort", (PyCFunction)Qd_CreateNewPort, 1,
PyDoc_STR("() -> (CGrafPtr _rv)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"SetQDError", (PyCFunction)Qd_SetQDError, 1,
PyDoc_STR("(OSErr err) -> None")},
-#endif
{"LMGetScrVRes", (PyCFunction)Qd_LMGetScrVRes, 1,
PyDoc_STR("() -> (SInt16 _rv)")},
{"LMSetScrVRes", (PyCFunction)Qd_LMSetScrVRes, 1,
'CursorComponentSetData',
]
- def makegreylist(self):
- return [
- ('#if !TARGET_API_MAC_CARBON', [
- ]),
- ('#if TARGET_API_MAC_CARBON', [
- 'IsPortOffscreen', # Lazy
- 'IsPortColor', # Lazy
- 'IsRegionRectangular',
- 'CreateNewPort',
- 'DisposePort',
- 'SetQDError',
- 'IsPortPolyBeingDefined',
- 'QDSetDirtyRegion',
- 'QDGetDirtyRegion',
- 'IsValidPort',
- 'RgnToHandle',
- ])]
-
-
def makeblacklisttypes(self):
return [
'CIconHandle', # Obsolete
#endif /* ACCESSOR_CALLS_ARE_FUNCTIONS */
-#if !TARGET_API_MAC_CARBON
-#define QDFlushPortBuffer(port, rgn) /* pass */
-#define QDIsPortBufferDirty(port) 0
-#define QDIsPortBuffered(port) 0
-#endif /* !TARGET_API_MAC_CARBON */
-
static PyObject *BMObj_NewCopied(BitMapPtr);
/*
return _res;
}
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *MovieObj_SetMovieAnchorDataRef(MovieObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- OSErr _err;
- Handle dataRef;
- OSType dataRefType;
-#ifndef SetMovieAnchorDataRef
- PyMac_PRECHECK(SetMovieAnchorDataRef);
-#endif
- if (!PyArg_ParseTuple(_args, "O&O&",
- ResObj_Convert, &dataRef,
- PyMac_GetOSType, &dataRefType))
- return NULL;
- _err = SetMovieAnchorDataRef(_self->ob_itself,
- dataRef,
- dataRefType);
- if (_err != noErr) return PyMac_Error(_err);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
-}
-#endif
-
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *MovieObj_GetMovieAnchorDataRef(MovieObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- OSErr _err;
- Handle dataRef;
- OSType dataRefType;
- long outFlags;
-#ifndef GetMovieAnchorDataRef
- PyMac_PRECHECK(GetMovieAnchorDataRef);
-#endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _err = GetMovieAnchorDataRef(_self->ob_itself,
- &dataRef,
- &dataRefType,
- &outFlags);
- if (_err != noErr) return PyMac_Error(_err);
- _res = Py_BuildValue("O&O&l",
- ResObj_New, dataRef,
- PyMac_BuildOSType, dataRefType,
- outFlags);
- return _res;
-}
-#endif
-
static PyObject *MovieObj_SetMovieColorTable(MovieObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
return _res;
}
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *MovieObj_GetMovieLoadState(MovieObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- long _rv;
-#ifndef GetMovieLoadState
- PyMac_PRECHECK(GetMovieLoadState);
-#endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = GetMovieLoadState(_self->ob_itself);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
-}
-#endif
-
static PyObject *MovieObj_NewMovieController(MovieObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
PyDoc_STR("(Handle dataRef, OSType dataRefType) -> None")},
{"GetMovieDefaultDataRef", (PyCFunction)MovieObj_GetMovieDefaultDataRef, 1,
PyDoc_STR("() -> (Handle dataRef, OSType dataRefType)")},
-
-#if !TARGET_API_MAC_CARBON
- {"SetMovieAnchorDataRef", (PyCFunction)MovieObj_SetMovieAnchorDataRef, 1,
- PyDoc_STR("(Handle dataRef, OSType dataRefType) -> None")},
-#endif
-
-#if !TARGET_API_MAC_CARBON
- {"GetMovieAnchorDataRef", (PyCFunction)MovieObj_GetMovieAnchorDataRef, 1,
- PyDoc_STR("() -> (Handle dataRef, OSType dataRefType, long outFlags)")},
-#endif
{"SetMovieColorTable", (PyCFunction)MovieObj_SetMovieColorTable, 1,
PyDoc_STR("(CTabHandle ctab) -> None")},
{"GetMovieColorTable", (PyCFunction)MovieObj_GetMovieColorTable, 1,
PyDoc_STR("(TimeValue time, TimeValue duration) -> (RgnHandle _rv)")},
{"GetMovieStatus", (PyCFunction)MovieObj_GetMovieStatus, 1,
PyDoc_STR("() -> (ComponentResult _rv, Track firstProblemTrack)")},
-
-#if !TARGET_API_MAC_CARBON
- {"GetMovieLoadState", (PyCFunction)MovieObj_GetMovieLoadState, 1,
- PyDoc_STR("() -> (long _rv)")},
-#endif
{"NewMovieController", (PyCFunction)MovieObj_NewMovieController, 1,
PyDoc_STR("(Rect movieRect, long someFlags) -> (MovieController _rv)")},
{"PutMovieOnScrap", (PyCFunction)MovieObj_PutMovieOnScrap, 1,
/* --------------------- End object type Movie ---------------------- */
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Qt_CheckQuickTimeRegistration(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- void * registrationKey;
- long flags;
-#ifndef CheckQuickTimeRegistration
- PyMac_PRECHECK(CheckQuickTimeRegistration);
-#endif
- if (!PyArg_ParseTuple(_args, "sl",
- ®istrationKey,
- &flags))
- return NULL;
- CheckQuickTimeRegistration(registrationKey,
- flags);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
-}
-#endif
-
static PyObject *Qt_EnterMovies(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
return _res;
}
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Qt_OpenADataHandler(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- OSErr _err;
- Handle dataRef;
- OSType dataHandlerSubType;
- Handle anchorDataRef;
- OSType anchorDataRefType;
- TimeBase tb;
- long flags;
- ComponentInstance dh;
-#ifndef OpenADataHandler
- PyMac_PRECHECK(OpenADataHandler);
-#endif
- if (!PyArg_ParseTuple(_args, "O&O&O&O&O&l",
- ResObj_Convert, &dataRef,
- PyMac_GetOSType, &dataHandlerSubType,
- ResObj_Convert, &anchorDataRef,
- PyMac_GetOSType, &anchorDataRefType,
- TimeBaseObj_Convert, &tb,
- &flags))
- return NULL;
- _err = OpenADataHandler(dataRef,
- dataHandlerSubType,
- anchorDataRef,
- anchorDataRefType,
- tb,
- flags,
- &dh);
- if (_err != noErr) return PyMac_Error(_err);
- _res = Py_BuildValue("O&",
- CmpInstObj_New, dh);
- return _res;
-}
-#endif
-
static PyObject *Qt_PasteHandleIntoMovie(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
return _res;
}
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Qt_SpriteMediaGetIndImageProperty(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- ComponentResult _rv;
- MediaHandler mh;
- short imageIndex;
- long imagePropertyType;
- void * imagePropertyValue;
-#ifndef SpriteMediaGetIndImageProperty
- PyMac_PRECHECK(SpriteMediaGetIndImageProperty);
-#endif
- if (!PyArg_ParseTuple(_args, "O&hls",
- CmpInstObj_Convert, &mh,
- &imageIndex,
- &imagePropertyType,
- &imagePropertyValue))
- return NULL;
- _rv = SpriteMediaGetIndImageProperty(mh,
- imageIndex,
- imagePropertyType,
- imagePropertyValue);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
-}
-#endif
-
static PyObject *Qt_SpriteMediaDisposeSprite(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
return _res;
}
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Qt_MovieMediaGetCurrentMovieProperty(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- ComponentResult _rv;
- MediaHandler mh;
- OSType whichProperty;
- void * value;
-#ifndef MovieMediaGetCurrentMovieProperty
- PyMac_PRECHECK(MovieMediaGetCurrentMovieProperty);
-#endif
- if (!PyArg_ParseTuple(_args, "O&O&s",
- CmpInstObj_Convert, &mh,
- PyMac_GetOSType, &whichProperty,
- &value))
- return NULL;
- _rv = MovieMediaGetCurrentMovieProperty(mh,
- whichProperty,
- value);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
-}
-#endif
-
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Qt_MovieMediaGetCurrentTrackProperty(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- ComponentResult _rv;
- MediaHandler mh;
- long trackID;
- OSType whichProperty;
- void * value;
-#ifndef MovieMediaGetCurrentTrackProperty
- PyMac_PRECHECK(MovieMediaGetCurrentTrackProperty);
-#endif
- if (!PyArg_ParseTuple(_args, "O&lO&s",
- CmpInstObj_Convert, &mh,
- &trackID,
- PyMac_GetOSType, &whichProperty,
- &value))
- return NULL;
- _rv = MovieMediaGetCurrentTrackProperty(mh,
- trackID,
- whichProperty,
- value);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
-}
-#endif
-
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Qt_MovieMediaGetChildMovieDataReference(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- ComponentResult _rv;
- MediaHandler mh;
- QTAtomID dataRefID;
- short dataRefIndex;
- OSType dataRefType;
- Handle dataRef;
- QTAtomID dataRefIDOut;
- short dataRefIndexOut;
-#ifndef MovieMediaGetChildMovieDataReference
- PyMac_PRECHECK(MovieMediaGetChildMovieDataReference);
-#endif
- if (!PyArg_ParseTuple(_args, "O&lh",
- CmpInstObj_Convert, &mh,
- &dataRefID,
- &dataRefIndex))
- return NULL;
- _rv = MovieMediaGetChildMovieDataReference(mh,
- dataRefID,
- dataRefIndex,
- &dataRefType,
- &dataRef,
- &dataRefIDOut,
- &dataRefIndexOut);
- _res = Py_BuildValue("lO&O&lh",
- _rv,
- PyMac_BuildOSType, dataRefType,
- ResObj_New, dataRef,
- dataRefIDOut,
- dataRefIndexOut);
- return _res;
-}
-#endif
-
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Qt_MovieMediaSetChildMovieDataReference(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- ComponentResult _rv;
- MediaHandler mh;
- QTAtomID dataRefID;
- OSType dataRefType;
- Handle dataRef;
-#ifndef MovieMediaSetChildMovieDataReference
- PyMac_PRECHECK(MovieMediaSetChildMovieDataReference);
-#endif
- if (!PyArg_ParseTuple(_args, "O&lO&O&",
- CmpInstObj_Convert, &mh,
- &dataRefID,
- PyMac_GetOSType, &dataRefType,
- ResObj_Convert, &dataRef))
- return NULL;
- _rv = MovieMediaSetChildMovieDataReference(mh,
- dataRefID,
- dataRefType,
- dataRef);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
-}
-#endif
-
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Qt_MovieMediaLoadChildMovieFromDataReference(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- ComponentResult _rv;
- MediaHandler mh;
- QTAtomID dataRefID;
-#ifndef MovieMediaLoadChildMovieFromDataReference
- PyMac_PRECHECK(MovieMediaLoadChildMovieFromDataReference);
-#endif
- if (!PyArg_ParseTuple(_args, "O&l",
- CmpInstObj_Convert, &mh,
- &dataRefID))
- return NULL;
- _rv = MovieMediaLoadChildMovieFromDataReference(mh,
- dataRefID);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
-}
-#endif
-
static PyObject *Qt_Media3DGetCurrentGroup(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
return _res;
}
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Qt_Media3DGetViewObject(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- ComponentResult _rv;
- MediaHandler mh;
- void * tq3viewObject;
-#ifndef Media3DGetViewObject
- PyMac_PRECHECK(Media3DGetViewObject);
-#endif
- if (!PyArg_ParseTuple(_args, "O&s",
- CmpInstObj_Convert, &mh,
- &tq3viewObject))
- return NULL;
- _rv = Media3DGetViewObject(mh,
- tq3viewObject);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
-}
-#endif
-
static PyObject *Qt_NewTimeBase(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
}
static PyMethodDef Qt_methods[] = {
-
-#if !TARGET_API_MAC_CARBON
- {"CheckQuickTimeRegistration", (PyCFunction)Qt_CheckQuickTimeRegistration, 1,
- PyDoc_STR("(void * registrationKey, long flags) -> None")},
-#endif
{"EnterMovies", (PyCFunction)Qt_EnterMovies, 1,
PyDoc_STR("() -> None")},
{"ExitMovies", (PyCFunction)Qt_ExitMovies, 1,
PyDoc_STR("(long flags) -> (Movie _rv)")},
{"GetDataHandler", (PyCFunction)Qt_GetDataHandler, 1,
PyDoc_STR("(Handle dataRef, OSType dataHandlerSubType, long flags) -> (Component _rv)")},
-
-#if !TARGET_API_MAC_CARBON
- {"OpenADataHandler", (PyCFunction)Qt_OpenADataHandler, 1,
- PyDoc_STR("(Handle dataRef, OSType dataHandlerSubType, Handle anchorDataRef, OSType anchorDataRefType, TimeBase tb, long flags) -> (ComponentInstance dh)")},
-#endif
{"PasteHandleIntoMovie", (PyCFunction)Qt_PasteHandleIntoMovie, 1,
PyDoc_STR("(Handle h, OSType handleType, Movie theMovie, long flags, ComponentInstance userComp) -> None")},
{"GetMovieImporterForDataRef", (PyCFunction)Qt_GetMovieImporterForDataRef, 1,
PyDoc_STR("(MediaHandler mh, QTAtomID variableID, float value) -> (ComponentResult _rv)")},
{"SpriteMediaGetActionVariable", (PyCFunction)Qt_SpriteMediaGetActionVariable, 1,
PyDoc_STR("(MediaHandler mh, QTAtomID variableID) -> (ComponentResult _rv, float value)")},
-
-#if !TARGET_API_MAC_CARBON
- {"SpriteMediaGetIndImageProperty", (PyCFunction)Qt_SpriteMediaGetIndImageProperty, 1,
- PyDoc_STR("(MediaHandler mh, short imageIndex, long imagePropertyType, void * imagePropertyValue) -> (ComponentResult _rv)")},
-#endif
{"SpriteMediaDisposeSprite", (PyCFunction)Qt_SpriteMediaDisposeSprite, 1,
PyDoc_STR("(MediaHandler mh, QTAtomID spriteID) -> (ComponentResult _rv)")},
{"SpriteMediaSetActionVariableToString", (PyCFunction)Qt_SpriteMediaSetActionVariableToString, 1,
PyDoc_STR("(MediaHandler mh, long buttonID, long transition) -> (ComponentResult _rv, char path)")},
{"FlashMediaGetSupportedSwfVersion", (PyCFunction)Qt_FlashMediaGetSupportedSwfVersion, 1,
PyDoc_STR("(MediaHandler mh) -> (ComponentResult _rv, UInt8 swfVersion)")},
-
-#if !TARGET_API_MAC_CARBON
- {"MovieMediaGetCurrentMovieProperty", (PyCFunction)Qt_MovieMediaGetCurrentMovieProperty, 1,
- PyDoc_STR("(MediaHandler mh, OSType whichProperty, void * value) -> (ComponentResult _rv)")},
-#endif
-
-#if !TARGET_API_MAC_CARBON
- {"MovieMediaGetCurrentTrackProperty", (PyCFunction)Qt_MovieMediaGetCurrentTrackProperty, 1,
- PyDoc_STR("(MediaHandler mh, long trackID, OSType whichProperty, void * value) -> (ComponentResult _rv)")},
-#endif
-
-#if !TARGET_API_MAC_CARBON
- {"MovieMediaGetChildMovieDataReference", (PyCFunction)Qt_MovieMediaGetChildMovieDataReference, 1,
- PyDoc_STR("(MediaHandler mh, QTAtomID dataRefID, short dataRefIndex) -> (ComponentResult _rv, OSType dataRefType, Handle dataRef, QTAtomID dataRefIDOut, short dataRefIndexOut)")},
-#endif
-
-#if !TARGET_API_MAC_CARBON
- {"MovieMediaSetChildMovieDataReference", (PyCFunction)Qt_MovieMediaSetChildMovieDataReference, 1,
- PyDoc_STR("(MediaHandler mh, QTAtomID dataRefID, OSType dataRefType, Handle dataRef) -> (ComponentResult _rv)")},
-#endif
-
-#if !TARGET_API_MAC_CARBON
- {"MovieMediaLoadChildMovieFromDataReference", (PyCFunction)Qt_MovieMediaLoadChildMovieFromDataReference, 1,
- PyDoc_STR("(MediaHandler mh, QTAtomID dataRefID) -> (ComponentResult _rv)")},
-#endif
{"Media3DGetCurrentGroup", (PyCFunction)Qt_Media3DGetCurrentGroup, 1,
PyDoc_STR("(MediaHandler mh, void * group) -> (ComponentResult _rv)")},
{"Media3DTranslateNamedObjectTo", (PyCFunction)Qt_Media3DTranslateNamedObjectTo, 1,
PyDoc_STR("(MediaHandler mh, void * tQ3CameraRange) -> (ComponentResult _rv)")},
{"Media3DGetCameraRange", (PyCFunction)Qt_Media3DGetCameraRange, 1,
PyDoc_STR("(MediaHandler mh, void * tQ3CameraRange) -> (ComponentResult _rv)")},
-
-#if !TARGET_API_MAC_CARBON
- {"Media3DGetViewObject", (PyCFunction)Qt_Media3DGetViewObject, 1,
- PyDoc_STR("(MediaHandler mh, void * tq3viewObject) -> (ComponentResult _rv)")},
-#endif
{"NewTimeBase", (PyCFunction)Qt_NewTimeBase, 1,
PyDoc_STR("() -> (TimeBase _rv)")},
{"ConvertTime", (PyCFunction)Qt_ConvertTime, 1,
"MakeTrackTimeTable", # Uses long * return?
"MakeMediaTimeTable", # ditto
## "VideoMediaGetStallCount", # Undefined in CW Pro 3 library
- ]
+ # OS8 only:
+ 'SpriteMediaGetIndImageProperty', # XXXX Why isn't this in carbon?
+ 'CheckQuickTimeRegistration',
+ 'SetMovieAnchorDataRef',
+ 'GetMovieAnchorDataRef',
+ 'GetMovieLoadState',
+ 'OpenADataHandler',
+ 'MovieMediaGetCurrentMovieProperty',
+ 'MovieMediaGetCurrentTrackProperty',
+ 'MovieMediaGetChildMovieDataReference',
+ 'MovieMediaSetChildMovieDataReference',
+ 'MovieMediaLoadChildMovieFromDataReference',
+ 'Media3DGetViewObject',
- def makegreylist(self):
- return [
- ('#if !TARGET_API_MAC_CARBON', [
- 'SpriteMediaGetIndImageProperty', # XXXX Why isn't this in carbon?
- 'CheckQuickTimeRegistration',
- 'SetMovieAnchorDataRef',
- 'GetMovieAnchorDataRef',
- 'GetMovieLoadState',
- 'OpenADataHandler',
- 'MovieMediaGetCurrentMovieProperty',
- 'MovieMediaGetCurrentTrackProperty',
- 'MovieMediaGetChildMovieDataReference',
- 'MovieMediaSetChildMovieDataReference',
- 'MovieMediaLoadChildMovieFromDataReference',
- 'Media3DGetViewObject',
- ])]
+ ]
def makeblacklisttypes(self):
return [
return _res;
}
-#if TARGET_API_MAC_OS8
-
-static PyObject *ResObj_RsrcMapEntry(ResourceObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- long _rv;
-#ifndef RsrcMapEntry
- PyMac_PRECHECK(RsrcMapEntry);
-#endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = RsrcMapEntry(_self->ob_itself);
- {
- OSErr _err = ResError();
- if (_err != noErr) return PyMac_Error(_err);
- }
- _res = Py_BuildValue("l",
- _rv);
- return _res;
-}
-#endif
-
static PyObject *ResObj_SetResAttrs(ResourceObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
PyDoc_STR("() -> (long _rv)")},
{"GetMaxResourceSize", (PyCFunction)ResObj_GetMaxResourceSize, 1,
PyDoc_STR("() -> (long _rv)")},
-
-#if TARGET_API_MAC_OS8
- {"RsrcMapEntry", (PyCFunction)ResObj_RsrcMapEntry, 1,
- PyDoc_STR("() -> (long _rv)")},
-#endif
{"SetResAttrs", (PyCFunction)ResObj_SetResAttrs, 1,
PyDoc_STR("(short attrs) -> None")},
{"ChangedResource", (PyCFunction)ResObj_ChangedResource, 1,
/* -------------------- End object type Resource -------------------- */
-#if TARGET_API_MAC_OS8
-
-static PyObject *Res_InitResources(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- short _rv;
-#ifndef InitResources
- PyMac_PRECHECK(InitResources);
-#endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = InitResources();
- {
- OSErr _err = ResError();
- if (_err != noErr) return PyMac_Error(_err);
- }
- _res = Py_BuildValue("h",
- _rv);
- return _res;
-}
-#endif
-
-#if TARGET_API_MAC_OS8
-
-static PyObject *Res_RsrcZoneInit(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
-#ifndef RsrcZoneInit
- PyMac_PRECHECK(RsrcZoneInit);
-#endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- RsrcZoneInit();
- {
- OSErr _err = ResError();
- if (_err != noErr) return PyMac_Error(_err);
- }
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
-}
-#endif
-
static PyObject *Res_CloseResFile(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
return _res;
}
-#if TARGET_API_MAC_OS8
-
-static PyObject *Res_CreateResFile(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- Str255 fileName;
-#ifndef CreateResFile
- PyMac_PRECHECK(CreateResFile);
-#endif
- if (!PyArg_ParseTuple(_args, "O&",
- PyMac_GetStr255, fileName))
- return NULL;
- CreateResFile(fileName);
- {
- OSErr _err = ResError();
- if (_err != noErr) return PyMac_Error(_err);
- }
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
-}
-#endif
-
-#if TARGET_API_MAC_OS8
-
-static PyObject *Res_OpenResFile(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- short _rv;
- Str255 fileName;
-#ifndef OpenResFile
- PyMac_PRECHECK(OpenResFile);
-#endif
- if (!PyArg_ParseTuple(_args, "O&",
- PyMac_GetStr255, fileName))
- return NULL;
- _rv = OpenResFile(fileName);
- {
- OSErr _err = ResError();
- if (_err != noErr) return PyMac_Error(_err);
- }
- _res = Py_BuildValue("h",
- _rv);
- return _res;
-}
-#endif
-
static PyObject *Res_UseResFile(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
return _res;
}
-#if TARGET_API_MAC_OS8
-
-static PyObject *Res_RGetResource(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- Handle _rv;
- ResType theType;
- short theID;
-#ifndef RGetResource
- PyMac_PRECHECK(RGetResource);
-#endif
- if (!PyArg_ParseTuple(_args, "O&h",
- PyMac_GetOSType, &theType,
- &theID))
- return NULL;
- _rv = RGetResource(theType,
- theID);
- {
- OSErr _err = ResError();
- if (_err != noErr) return PyMac_Error(_err);
- }
- _res = Py_BuildValue("O&",
- ResObj_New, _rv);
- return _res;
-}
-#endif
-
static PyObject *Res_HOpenResFile(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
return _res;
}
-#if TARGET_API_MAC_CARBON
-
static PyObject *Res_InsertResourceFile(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Res_DetachResourceFile(PyObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Res_FSpResourceFileAlreadyOpen(PyObject *_self, PyObject *_args)
{
refNum);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Res_FSpOpenOrphanResFile(PyObject *_self, PyObject *_args)
{
refNum);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Res_GetTopResourceFile(PyObject *_self, PyObject *_args)
{
refNum);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Res_GetNextResourceFile(PyObject *_self, PyObject *_args)
{
nextRefNum);
return _res;
}
-#endif
static PyObject *Res_FSOpenResFile(PyObject *_self, PyObject *_args)
{
return _res;
}
-#if TARGET_API_MAC_CARBON
-
static PyObject *Res_FSCreateResourceFile(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
PyMac_BuildFSSpec, &newSpec);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *Res_FSOpenResourceFile(PyObject *_self, PyObject *_args)
{
refNum);
return _res;
}
-#endif
static PyObject *Res_Handle(PyObject *_self, PyObject *_args)
{
}
static PyMethodDef Res_methods[] = {
-
-#if TARGET_API_MAC_OS8
- {"InitResources", (PyCFunction)Res_InitResources, 1,
- PyDoc_STR("() -> (short _rv)")},
-#endif
-
-#if TARGET_API_MAC_OS8
- {"RsrcZoneInit", (PyCFunction)Res_RsrcZoneInit, 1,
- PyDoc_STR("() -> None")},
-#endif
{"CloseResFile", (PyCFunction)Res_CloseResFile, 1,
PyDoc_STR("(short refNum) -> None")},
{"ResError", (PyCFunction)Res_ResError, 1,
PyDoc_STR("() -> None")},
{"CurResFile", (PyCFunction)Res_CurResFile, 1,
PyDoc_STR("() -> (short _rv)")},
-
-#if TARGET_API_MAC_OS8
- {"CreateResFile", (PyCFunction)Res_CreateResFile, 1,
- PyDoc_STR("(Str255 fileName) -> None")},
-#endif
-
-#if TARGET_API_MAC_OS8
- {"OpenResFile", (PyCFunction)Res_OpenResFile, 1,
- PyDoc_STR("(Str255 fileName) -> (short _rv)")},
-#endif
{"UseResFile", (PyCFunction)Res_UseResFile, 1,
PyDoc_STR("(short refNum) -> None")},
{"CountTypes", (PyCFunction)Res_CountTypes, 1,
PyDoc_STR("(short refNum, short attrs) -> None")},
{"OpenRFPerm", (PyCFunction)Res_OpenRFPerm, 1,
PyDoc_STR("(Str255 fileName, short vRefNum, SignedByte permission) -> (short _rv)")},
-
-#if TARGET_API_MAC_OS8
- {"RGetResource", (PyCFunction)Res_RGetResource, 1,
- PyDoc_STR("(ResType theType, short theID) -> (Handle _rv)")},
-#endif
{"HOpenResFile", (PyCFunction)Res_HOpenResFile, 1,
PyDoc_STR("(short vRefNum, long dirID, Str255 fileName, SignedByte permission) -> (short _rv)")},
{"HCreateResFile", (PyCFunction)Res_HCreateResFile, 1,
PyDoc_STR("(FSSpec spec, SignedByte permission) -> (short _rv)")},
{"FSpCreateResFile", (PyCFunction)Res_FSpCreateResFile, 1,
PyDoc_STR("(FSSpec spec, OSType creator, OSType fileType, ScriptCode scriptTag) -> None")},
-
-#if TARGET_API_MAC_CARBON
{"InsertResourceFile", (PyCFunction)Res_InsertResourceFile, 1,
PyDoc_STR("(SInt16 refNum, RsrcChainLocation where) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"DetachResourceFile", (PyCFunction)Res_DetachResourceFile, 1,
PyDoc_STR("(SInt16 refNum) -> None")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"FSpResourceFileAlreadyOpen", (PyCFunction)Res_FSpResourceFileAlreadyOpen, 1,
PyDoc_STR("(FSSpec resourceFile) -> (Boolean _rv, Boolean inChain, SInt16 refNum)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"FSpOpenOrphanResFile", (PyCFunction)Res_FSpOpenOrphanResFile, 1,
PyDoc_STR("(FSSpec spec, SignedByte permission) -> (SInt16 refNum)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetTopResourceFile", (PyCFunction)Res_GetTopResourceFile, 1,
PyDoc_STR("() -> (SInt16 refNum)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"GetNextResourceFile", (PyCFunction)Res_GetNextResourceFile, 1,
PyDoc_STR("(SInt16 curRefNum) -> (SInt16 nextRefNum)")},
-#endif
{"FSOpenResFile", (PyCFunction)Res_FSOpenResFile, 1,
PyDoc_STR("(FSRef ref, SignedByte permission) -> (short _rv)")},
{"FSCreateResFile", (PyCFunction)Res_FSCreateResFile, 1,
PyDoc_STR("(FSRef parentRef, Buffer nameLength) -> (FSRef newRef, FSSpec newSpec)")},
{"FSResourceFileAlreadyOpen", (PyCFunction)Res_FSResourceFileAlreadyOpen, 1,
PyDoc_STR("(FSRef resourceFileRef) -> (Boolean _rv, Boolean inChain, SInt16 refNum)")},
-
-#if TARGET_API_MAC_CARBON
{"FSCreateResourceFile", (PyCFunction)Res_FSCreateResourceFile, 1,
PyDoc_STR("(FSRef parentRef, Buffer nameLength, Buffer forkNameLength) -> (FSRef newRef, FSSpec newSpec)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"FSOpenResourceFile", (PyCFunction)Res_FSOpenResourceFile, 1,
PyDoc_STR("(FSRef ref, Buffer forkNameLength, SignedByte permissions) -> (SInt16 refNum)")},
-#endif
{"Handle", (PyCFunction)Res_Handle, 1,
PyDoc_STR("Convert a string to a Handle object.\n\nResource() and Handle() are very similar, but objects created with Handle() are\nby default automatically DisposeHandle()d upon object cleanup. Use AutoDispose()\nto change this.\n")},
{NULL, NULL, 0}
## "RmveResource", # RemoveResource
## "SizeResource", # GetResourceSizeOnDisk
## "MaxSizeRsrc", # GetMaxResourceSize
+ # OS8 only
+ 'RGetResource',
+ 'OpenResFile',
+ 'CreateResFile',
+ 'RsrcZoneInit',
+ 'InitResources',
+ 'RsrcMapEntry',
]
def makeblacklisttypes(self):
return [
]
- def makegreylist(self):
- return [
- ('#if TARGET_API_MAC_OS8', [
- 'RGetResource',
- 'OpenResFile',
- 'CreateResFile',
- 'RsrcZoneInit',
- 'InitResources',
- 'RsrcMapEntry',
- ]),
- ('#if TARGET_API_MAC_CARBON', [
- 'GetNextResourceFile',
- 'GetTopResourceFile',
- 'FSpOpenOrphanResFile',
- 'DetachResourceFile',
- 'InsertResourceFile',
- 'FSpResourceFileAlreadyOpen',
- 'FSOpenResourceFile',
- 'FSCreateResourceFile',
- ])]
-
def makerepairinstructions(self):
return [
([("Str255", "*", "InMode")],
#include <Carbon/Carbon.h>
#endif
-#if TARGET_API_MAC_OS8
-
-/*
-** Generate ScrapInfo records
-*/
-static PyObject *
-SCRRec_New(itself)
- ScrapStuff *itself;
-{
-
- return Py_BuildValue("lO&hhO&", itself->scrapSize,
- ResObj_New, itself->scrapHandle, itself->scrapCount, itself->scrapState,
- PyMac_BuildStr255, itself->scrapName);
-}
-#endif
-
static PyObject *Scrap_Error;
-#if !TARGET_API_MAC_OS8
/* ----------------------- Object type Scrap ------------------------ */
PyTypeObject Scrap_Type;
};
/* --------------------- End object type Scrap ---------------------- */
-#endif /* !TARGET_API_MAC_OS8 */
static PyObject *Scrap_LoadScrap(PyObject *_self, PyObject *_args)
{
return _res;
}
-#if TARGET_API_MAC_OS8
-
-static PyObject *Scrap_InfoScrap(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- ScrapStuffPtr _rv;
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = InfoScrap();
- _res = Py_BuildValue("O&",
- SCRRec_New, _rv);
- return _res;
-}
-
-static PyObject *Scrap_GetScrap(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- long _rv;
- Handle destination;
- ScrapFlavorType flavorType;
- SInt32 offset;
- if (!PyArg_ParseTuple(_args, "O&O&",
- ResObj_Convert, &destination,
- PyMac_GetOSType, &flavorType))
- return NULL;
- _rv = GetScrap(destination,
- flavorType,
- &offset);
- _res = Py_BuildValue("ll",
- _rv,
- offset);
- return _res;
-}
-
-static PyObject *Scrap_ZeroScrap(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- OSStatus _err;
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _err = ZeroScrap();
- if (_err != noErr) return PyMac_Error(_err);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
-}
-
-static PyObject *Scrap_PutScrap(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- OSStatus _err;
- SInt32 sourceBufferByteCount;
- ScrapFlavorType flavorType;
- char *sourceBuffer__in__;
- int sourceBuffer__len__;
- int sourceBuffer__in_len__;
- if (!PyArg_ParseTuple(_args, "lO&s#",
- &sourceBufferByteCount,
- PyMac_GetOSType, &flavorType,
- &sourceBuffer__in__, &sourceBuffer__in_len__))
- return NULL;
- _err = PutScrap(sourceBufferByteCount,
- flavorType,
- sourceBuffer__in__);
- if (_err != noErr) return PyMac_Error(_err);
- Py_INCREF(Py_None);
- _res = Py_None;
- sourceBuffer__error__: ;
- return _res;
-}
-#endif /* TARGET_API_MAC_OS8 */
-
-#if !TARGET_API_MAC_OS8
static PyObject *Scrap_GetCurrentScrap(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
_res = Py_None;
return _res;
}
-#endif
static PyMethodDef Scrap_methods[] = {
{"LoadScrap", (PyCFunction)Scrap_LoadScrap, 1,
"() -> None"},
{"UnloadScrap", (PyCFunction)Scrap_UnloadScrap, 1,
"() -> None"},
-
-#if TARGET_API_MAC_OS8
- {"InfoScrap", (PyCFunction)Scrap_InfoScrap, 1,
- "() -> (ScrapStuffPtr _rv)"},
- {"GetScrap", (PyCFunction)Scrap_GetScrap, 1,
- "(Handle destination, ScrapFlavorType flavorType) -> (long _rv, SInt32 offset)"},
- {"ZeroScrap", (PyCFunction)Scrap_ZeroScrap, 1,
- "() -> None"},
- {"PutScrap", (PyCFunction)Scrap_PutScrap, 1,
- "(SInt32 sourceBufferByteCount, ScrapFlavorType flavorType, Buffer sourceBuffer) -> None"},
-#endif
-
-#if !TARGET_API_MAC_OS8
{"GetCurrentScrap", (PyCFunction)Scrap_GetCurrentScrap, 1,
"() -> (ScrapRef scrap)"},
{"ClearCurrentScrap", (PyCFunction)Scrap_ClearCurrentScrap, 1,
"() -> None"},
{"CallInScrapPromises", (PyCFunction)Scrap_CallInScrapPromises, 1,
"() -> None"},
-#endif
{NULL, NULL, 0}
};
if (Scrap_Error == NULL ||
PyDict_SetItemString(d, "Error", Scrap_Error) != 0)
return;
-#if !TARGET_API_MAC_OS8
Scrap_Type.ob_type = &PyType_Type;
Py_INCREF(&Scrap_Type);
if (PyDict_SetItemString(d, "ScrapType", (PyObject *)&Scrap_Type) != 0)
Py_FatalError("can't initialize ScrapType");
-#endif
}
/* ======================= End module _Scrap ======================== */
def makeblacklistnames(self):
return [
"GetScrapFlavorInfoList",
+ 'InfoScrap',
+ 'GetScrap',
+ 'ZeroScrap',
+ 'PutScrap',
]
- def makegreylist(self):
- return [
- ('#if !TARGET_API_MAC_CARBON', [
- 'InfoScrap',
- 'GetScrap',
- 'ZeroScrap',
- 'PutScrap',
- ]),
- ('#if TARGET_API_MAC_CARBON', [
- 'CallInScrapPromises',
- 'ClearCurrentScrap',
- ])]
-
def makeblacklisttypes(self):
return [
'ScrapPromiseKeeperUPP',
#include <Carbon/Carbon.h>
#endif
-#if !TARGET_API_MAC_CARBON
-/* Create a SndCommand object (an (int, int, int) tuple) */
-static PyObject *
-SndCmd_New(SndCommand *pc)
-{
- return Py_BuildValue("hhl", pc->cmd, pc->param1, pc->param2);
-}
-#endif
-
/* Convert a SndCommand argument */
static int
SndCmd_Convert(PyObject *v, SndCommand *pc)
static pascal void SndCh_UserRoutine(SndChannelPtr chan, SndCommand *cmd); /* Forward */
static pascal void SPB_completion(SPBPtr my_spb); /* Forward */
-#if !TARGET_API_MAC_CARBON
-static pascal void SPB_interrupt(SPBPtr my_spb); /* Forward */
-#endif
static PyObject *Snd_Error;
return _res;
}
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *SndCh_SndStartFilePlay(SndChannelObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- OSErr _err;
- short fRefNum;
- short resNum;
- long bufferSize;
- Boolean async;
- if (!PyArg_ParseTuple(_args, "hhlb",
- &fRefNum,
- &resNum,
- &bufferSize,
- &async))
- return NULL;
- _err = SndStartFilePlay(_self->ob_itself,
- fRefNum,
- resNum,
- bufferSize,
- 0,
- 0,
- 0,
- async);
- if (_err != noErr) return PyMac_Error(_err);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
-}
-#endif
-
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *SndCh_SndPauseFilePlay(SndChannelObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- OSErr _err;
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _err = SndPauseFilePlay(_self->ob_itself);
- if (_err != noErr) return PyMac_Error(_err);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
-}
-#endif
-
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *SndCh_SndStopFilePlay(SndChannelObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- OSErr _err;
- Boolean quietNow;
- if (!PyArg_ParseTuple(_args, "b",
- &quietNow))
- return NULL;
- _err = SndStopFilePlay(_self->ob_itself,
- quietNow);
- if (_err != noErr) return PyMac_Error(_err);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
-}
-#endif
-
static PyObject *SndCh_SndChannelStatus(SndChannelObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
PyDoc_STR("(SndCommand cmd) -> None")},
{"SndPlay", (PyCFunction)SndCh_SndPlay, 1,
PyDoc_STR("(SndListHandle sndHandle, Boolean async) -> None")},
-
-#if !TARGET_API_MAC_CARBON
- {"SndStartFilePlay", (PyCFunction)SndCh_SndStartFilePlay, 1,
- PyDoc_STR("(short fRefNum, short resNum, long bufferSize, Boolean async) -> None")},
-#endif
-
-#if !TARGET_API_MAC_CARBON
- {"SndPauseFilePlay", (PyCFunction)SndCh_SndPauseFilePlay, 1,
- PyDoc_STR("() -> None")},
-#endif
-
-#if !TARGET_API_MAC_CARBON
- {"SndStopFilePlay", (PyCFunction)SndCh_SndStopFilePlay, 1,
- PyDoc_STR("(Boolean quietNow) -> None")},
-#endif
{"SndChannelStatus", (PyCFunction)SndCh_SndChannelStatus, 1,
PyDoc_STR("(short theLength) -> (SCStatus theStatus)")},
{"SndGetInfo", (PyCFunction)SndCh_SndGetInfo, 1,
return _res;
}
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Snd_SndControl(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- OSErr _err;
- short id;
- SndCommand cmd;
- if (!PyArg_ParseTuple(_args, "h",
- &id))
- return NULL;
- _err = SndControl(id,
- &cmd);
- if (_err != noErr) return PyMac_Error(_err);
- _res = Py_BuildValue("O&",
- SndCmd_New, &cmd);
- return _res;
-}
-#endif
-
static PyObject *Snd_SndSoundManagerVersion(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
return _res;
}
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Snd_MACEVersion(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- NumVersion _rv;
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = MACEVersion();
- _res = Py_BuildValue("O&",
- PyMac_BuildNumVersion, _rv);
- return _res;
-}
-#endif
-
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Snd_Comp3to1(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- char *buffer__in__;
- char *buffer__out__;
- long buffer__len__;
- int buffer__in_len__;
- StateBlock *state__in__;
- StateBlock state__out__;
- int state__in_len__;
- unsigned long numChannels;
- unsigned long whichChannel;
- if (!PyArg_ParseTuple(_args, "s#s#ll",
- &buffer__in__, &buffer__in_len__,
- (char **)&state__in__, &state__in_len__,
- &numChannels,
- &whichChannel))
- return NULL;
- if ((buffer__out__ = malloc(buffer__in_len__)) == NULL)
- {
- PyErr_NoMemory();
- goto buffer__error__;
- }
- buffer__len__ = buffer__in_len__;
- if (state__in_len__ != sizeof(StateBlock))
- {
- PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(StateBlock)");
- goto state__error__;
- }
- Comp3to1(buffer__in__, buffer__out__, (long)buffer__len__,
- state__in__, &state__out__,
- numChannels,
- whichChannel);
- _res = Py_BuildValue("s#s#",
- buffer__out__, (int)buffer__len__,
- (char *)&state__out__, (int)sizeof(StateBlock));
- state__error__: ;
- free(buffer__out__);
- buffer__error__: ;
- return _res;
-}
-#endif
-
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Snd_Exp1to3(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- char *buffer__in__;
- char *buffer__out__;
- long buffer__len__;
- int buffer__in_len__;
- StateBlock *state__in__;
- StateBlock state__out__;
- int state__in_len__;
- unsigned long numChannels;
- unsigned long whichChannel;
- if (!PyArg_ParseTuple(_args, "s#s#ll",
- &buffer__in__, &buffer__in_len__,
- (char **)&state__in__, &state__in_len__,
- &numChannels,
- &whichChannel))
- return NULL;
- if ((buffer__out__ = malloc(buffer__in_len__)) == NULL)
- {
- PyErr_NoMemory();
- goto buffer__error__;
- }
- buffer__len__ = buffer__in_len__;
- if (state__in_len__ != sizeof(StateBlock))
- {
- PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(StateBlock)");
- goto state__error__;
- }
- Exp1to3(buffer__in__, buffer__out__, (long)buffer__len__,
- state__in__, &state__out__,
- numChannels,
- whichChannel);
- _res = Py_BuildValue("s#s#",
- buffer__out__, (int)buffer__len__,
- (char *)&state__out__, (int)sizeof(StateBlock));
- state__error__: ;
- free(buffer__out__);
- buffer__error__: ;
- return _res;
-}
-#endif
-
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Snd_Comp6to1(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- char *buffer__in__;
- char *buffer__out__;
- long buffer__len__;
- int buffer__in_len__;
- StateBlock *state__in__;
- StateBlock state__out__;
- int state__in_len__;
- unsigned long numChannels;
- unsigned long whichChannel;
- if (!PyArg_ParseTuple(_args, "s#s#ll",
- &buffer__in__, &buffer__in_len__,
- (char **)&state__in__, &state__in_len__,
- &numChannels,
- &whichChannel))
- return NULL;
- if ((buffer__out__ = malloc(buffer__in_len__)) == NULL)
- {
- PyErr_NoMemory();
- goto buffer__error__;
- }
- buffer__len__ = buffer__in_len__;
- if (state__in_len__ != sizeof(StateBlock))
- {
- PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(StateBlock)");
- goto state__error__;
- }
- Comp6to1(buffer__in__, buffer__out__, (long)buffer__len__,
- state__in__, &state__out__,
- numChannels,
- whichChannel);
- _res = Py_BuildValue("s#s#",
- buffer__out__, (int)buffer__len__,
- (char *)&state__out__, (int)sizeof(StateBlock));
- state__error__: ;
- free(buffer__out__);
- buffer__error__: ;
- return _res;
-}
-#endif
-
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Snd_Exp1to6(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- char *buffer__in__;
- char *buffer__out__;
- long buffer__len__;
- int buffer__in_len__;
- StateBlock *state__in__;
- StateBlock state__out__;
- int state__in_len__;
- unsigned long numChannels;
- unsigned long whichChannel;
- if (!PyArg_ParseTuple(_args, "s#s#ll",
- &buffer__in__, &buffer__in_len__,
- (char **)&state__in__, &state__in_len__,
- &numChannels,
- &whichChannel))
- return NULL;
- if ((buffer__out__ = malloc(buffer__in_len__)) == NULL)
- {
- PyErr_NoMemory();
- goto buffer__error__;
- }
- buffer__len__ = buffer__in_len__;
- if (state__in_len__ != sizeof(StateBlock))
- {
- PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(StateBlock)");
- goto state__error__;
- }
- Exp1to6(buffer__in__, buffer__out__, (long)buffer__len__,
- state__in__, &state__out__,
- numChannels,
- whichChannel);
- _res = Py_BuildValue("s#s#",
- buffer__out__, (int)buffer__len__,
- (char *)&state__out__, (int)sizeof(StateBlock));
- state__error__: ;
- free(buffer__out__);
- buffer__error__: ;
- return _res;
-}
-#endif
-
static PyObject *Snd_GetSysBeepVolume(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
return _res;
}
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Snd_SndRecordToFile(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- OSErr _err;
- Point corner;
- OSType quality;
- short fRefNum;
- if (!PyArg_ParseTuple(_args, "O&O&h",
- PyMac_GetPoint, &corner,
- PyMac_GetOSType, &quality,
- &fRefNum))
- return NULL;
- _err = SndRecordToFile((ModalFilterUPP)0,
- corner,
- quality,
- fRefNum);
- if (_err != noErr) return PyMac_Error(_err);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
-}
-#endif
-
static PyObject *Snd_SPBSignInDevice(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
return _res;
}
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Snd_SPBRecordToFile(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- OSErr _err;
- short fRefNum;
- SPBPtr inParamPtr;
- Boolean asynchFlag;
- if (!PyArg_ParseTuple(_args, "hO&b",
- &fRefNum,
- SPBObj_Convert, &inParamPtr,
- &asynchFlag))
- return NULL;
- _err = SPBRecordToFile(fRefNum,
- inParamPtr,
- asynchFlag);
- if (_err != noErr) return PyMac_Error(_err);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
-}
-#endif
-
static PyObject *Snd_SPBPauseRecording(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
PyDoc_STR("(short duration) -> None")},
{"SndNewChannel", (PyCFunction)Snd_SndNewChannel, 1,
PyDoc_STR("(short synth, long init, PyObject* userRoutine) -> (SndChannelPtr chan)")},
-
-#if !TARGET_API_MAC_CARBON
- {"SndControl", (PyCFunction)Snd_SndControl, 1,
- PyDoc_STR("(short id) -> (SndCommand cmd)")},
-#endif
{"SndSoundManagerVersion", (PyCFunction)Snd_SndSoundManagerVersion, 1,
PyDoc_STR("() -> (NumVersion _rv)")},
{"SndManagerStatus", (PyCFunction)Snd_SndManagerStatus, 1,
PyDoc_STR("() -> (short sysBeepState)")},
{"SndSetSysBeepState", (PyCFunction)Snd_SndSetSysBeepState, 1,
PyDoc_STR("(short sysBeepState) -> None")},
-
-#if !TARGET_API_MAC_CARBON
- {"MACEVersion", (PyCFunction)Snd_MACEVersion, 1,
- PyDoc_STR("() -> (NumVersion _rv)")},
-#endif
-
-#if !TARGET_API_MAC_CARBON
- {"Comp3to1", (PyCFunction)Snd_Comp3to1, 1,
- PyDoc_STR("(Buffer buffer, StateBlock state, unsigned long numChannels, unsigned long whichChannel) -> (Buffer buffer, StateBlock state)")},
-#endif
-
-#if !TARGET_API_MAC_CARBON
- {"Exp1to3", (PyCFunction)Snd_Exp1to3, 1,
- PyDoc_STR("(Buffer buffer, StateBlock state, unsigned long numChannels, unsigned long whichChannel) -> (Buffer buffer, StateBlock state)")},
-#endif
-
-#if !TARGET_API_MAC_CARBON
- {"Comp6to1", (PyCFunction)Snd_Comp6to1, 1,
- PyDoc_STR("(Buffer buffer, StateBlock state, unsigned long numChannels, unsigned long whichChannel) -> (Buffer buffer, StateBlock state)")},
-#endif
-
-#if !TARGET_API_MAC_CARBON
- {"Exp1to6", (PyCFunction)Snd_Exp1to6, 1,
- PyDoc_STR("(Buffer buffer, StateBlock state, unsigned long numChannels, unsigned long whichChannel) -> (Buffer buffer, StateBlock state)")},
-#endif
{"GetSysBeepVolume", (PyCFunction)Snd_GetSysBeepVolume, 1,
PyDoc_STR("() -> (long level)")},
{"SetSysBeepVolume", (PyCFunction)Snd_SetSysBeepVolume, 1,
PyDoc_STR("() -> (NumVersion _rv)")},
{"SndRecord", (PyCFunction)Snd_SndRecord, 1,
PyDoc_STR("(Point corner, OSType quality) -> (SndListHandle sndHandle)")},
-
-#if !TARGET_API_MAC_CARBON
- {"SndRecordToFile", (PyCFunction)Snd_SndRecordToFile, 1,
- PyDoc_STR("(Point corner, OSType quality, short fRefNum) -> None")},
-#endif
{"SPBSignInDevice", (PyCFunction)Snd_SPBSignInDevice, 1,
PyDoc_STR("(short deviceRefNum, Str255 deviceName) -> None")},
{"SPBSignOutDevice", (PyCFunction)Snd_SPBSignOutDevice, 1,
PyDoc_STR("(long inRefNum) -> None")},
{"SPBRecord", (PyCFunction)Snd_SPBRecord, 1,
PyDoc_STR("(SPBPtr inParamPtr, Boolean asynchFlag) -> None")},
-
-#if !TARGET_API_MAC_CARBON
- {"SPBRecordToFile", (PyCFunction)Snd_SPBRecordToFile, 1,
- PyDoc_STR("(short fRefNum, SPBPtr inParamPtr, Boolean asynchFlag) -> None")},
-#endif
{"SPBPauseRecording", (PyCFunction)Snd_SPBPauseRecording, 1,
PyDoc_STR("(long inRefNum) -> None")},
{"SPBResumeRecording", (PyCFunction)Snd_SPBResumeRecording, 1,
}
}
-#if !TARGET_API_MAC_CARBON
-static pascal void
-SPB_interrupt(SPBPtr my_spb)
-{
- SPBObject *p = (SPBObject *)(my_spb->userLong);
-
- if (p && p->ob_interrupt) {
- long A5 = SetA5(p->ob_A5);
- p->ob_thiscallback = p->ob_interrupt; /* Hope we cannot get two at the same time */
- Py_AddPendingCall(SPB_CallCallBack, (void *)p);
- SetA5(A5);
- }
-}
-#endif
void init_Snd(void)
'rate48khz',
'rate44khz',
'kInvalidSource',
+ # OS8 only:
+ 'MACEVersion',
+ 'SPBRecordToFile',
+ 'Exp1to6',
+ 'Comp6to1',
+ 'Exp1to3',
+ 'Comp3to1',
+ 'SndControl',
+ 'SndStopFilePlay',
+ 'SndStartFilePlay',
+ 'SndPauseFilePlay',
+ 'SndRecordToFile',
]
- def makegreylist(self):
- return [
- ('#if !TARGET_API_MAC_CARBON', [
- 'MACEVersion',
- 'SPBRecordToFile',
- 'Exp1to6',
- 'Comp6to1',
- 'Exp1to3',
- 'Comp3to1',
- 'SndControl',
- 'SndStopFilePlay',
- 'SndStartFilePlay',
- 'SndPauseFilePlay',
- 'SndRecordToFile',
- ])]
-
def makeblacklisttypes(self):
return [
"GetSoundVol",
CompressionInfo = StructOutputBufferType('CompressionInfo')
includestuff = includestuff + """
-#if !TARGET_API_MAC_CARBON
-/* Create a SndCommand object (an (int, int, int) tuple) */
-static PyObject *
-SndCmd_New(SndCommand *pc)
-{
- return Py_BuildValue("hhl", pc->cmd, pc->param1, pc->param2);
-}
-#endif
-
/* Convert a SndCommand argument */
static int
SndCmd_Convert(PyObject *v, SndCommand *pc)
static pascal void SndCh_UserRoutine(SndChannelPtr chan, SndCommand *cmd); /* Forward */
static pascal void SPB_completion(SPBPtr my_spb); /* Forward */
-#if !TARGET_API_MAC_CARBON
-static pascal void SPB_interrupt(SPBPtr my_spb); /* Forward */
-#endif
"""
}
}
-#if !TARGET_API_MAC_CARBON
-static pascal void
-SPB_interrupt(SPBPtr my_spb)
-{
- SPBObject *p = (SPBObject *)(my_spb->userLong);
-
- if (p && p->ob_interrupt) {
- long A5 = SetA5(p->ob_A5);
- p->ob_thiscallback = p->ob_interrupt; /* Hope we cannot get two at the same time */
- Py_AddPendingCall(SPB_CallCallBack, (void *)p);
- SetA5(A5);
- }
-}
-#endif
"""
return _res;
}
-#if TARGET_API_MAC_CARBON
-
static PyObject *TE_TEGetScrapHandle(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
ResObj_New, _rv);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_CARBON
static PyObject *TE_TESetScrapHandle(PyObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
static PyObject *TE_LMGetWordRedraw(PyObject *_self, PyObject *_args)
{
PyDoc_STR("() -> None")},
{"TEToScrap", (PyCFunction)TE_TEToScrap, 1,
PyDoc_STR("() -> None")},
-
-#if TARGET_API_MAC_CARBON
{"TEGetScrapHandle", (PyCFunction)TE_TEGetScrapHandle, 1,
PyDoc_STR("() -> (Handle _rv)")},
-#endif
-
-#if TARGET_API_MAC_CARBON
{"TESetScrapHandle", (PyCFunction)TE_TESetScrapHandle, 1,
PyDoc_STR("(Handle value) -> None")},
-#endif
{"LMGetWordRedraw", (PyCFunction)TE_LMGetWordRedraw, 1,
PyDoc_STR("() -> (UInt8 _rv)")},
{"LMSetWordRedraw", (PyCFunction)TE_LMSetWordRedraw, 1,
## "TEGetHiliteRgn",
]
- def makegreylist(self):
- return [
- ('#if TARGET_API_MAC_CARBON', [
- 'TEGetScrapHandle',
- 'TESetScrapHandle',
- ])]
-
def makeblacklisttypes(self):
return [
"TEClickLoopUPP",
return _res;
}
-#if !TARGET_API_MAC_OS8
-
static PyObject *WinObj_GetWindowRetainCount(WindowObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
_rv);
return _res;
}
-#endif
-
-#if !TARGET_API_MAC_OS8
static PyObject *WinObj_RetainWindow(WindowObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if !TARGET_API_MAC_OS8
static PyObject *WinObj_ReleaseWindow(WindowObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if !TARGET_API_MAC_OS8
static PyObject *WinObj_ReshapeCustomWindow(WindowObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
static PyObject *WinObj_GetWindowWidgetHilite(WindowObject *_self, PyObject *_args)
{
return _res;
}
-#if !TARGET_API_MAC_OS8
-
static PyObject *WinObj_ChangeWindowAttributes(WindowObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
_res = Py_None;
return _res;
}
-#endif
-
-#if !TARGET_API_MAC_OS8
static PyObject *WinObj_SetWindowClass(WindowObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if !TARGET_API_MAC_OS8
static PyObject *WinObj_SetWindowModality(WindowObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if !TARGET_API_MAC_OS8
static PyObject *WinObj_GetWindowModality(WindowObject *_self, PyObject *_args)
{
WinObj_WhichWindow, outUnavailableWindow);
return _res;
}
-#endif
-
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *WinObj_SetWinColor(WindowObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- WCTabHandle newColorTable;
-#ifndef SetWinColor
- PyMac_PRECHECK(SetWinColor);
-#endif
- if (!PyArg_ParseTuple(_args, "O&",
- ResObj_Convert, &newColorTable))
- return NULL;
- SetWinColor(_self->ob_itself,
- newColorTable);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
-}
-#endif
static PyObject *WinObj_SetWindowContentColor(WindowObject *_self, PyObject *_args)
{
return _res;
}
-#if !TARGET_API_MAC_OS8
-
static PyObject *WinObj_ScrollWindowRect(WindowObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
_res = Py_None;
return _res;
}
-#endif
-
-#if !TARGET_API_MAC_OS8
static PyObject *WinObj_ScrollWindowRegion(WindowObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
static PyObject *WinObj_ClipAbove(WindowObject *_self, PyObject *_args)
{
return _res;
}
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *WinObj_SaveOld(WindowObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
-#ifndef SaveOld
- PyMac_PRECHECK(SaveOld);
-#endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- SaveOld(_self->ob_itself);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
-}
-#endif
-
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *WinObj_DrawNew(WindowObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- Boolean update;
-#ifndef DrawNew
- PyMac_PRECHECK(DrawNew);
-#endif
- if (!PyArg_ParseTuple(_args, "b",
- &update))
- return NULL;
- DrawNew(_self->ob_itself,
- update);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
-}
-#endif
-
static PyObject *WinObj_PaintOne(WindowObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
return _res;
}
-#if !TARGET_API_MAC_OS8
-
static PyObject *WinObj_GetNextWindowOfClass(WindowObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
WinObj_New, _rv);
return _res;
}
-#endif
-
-#if !TARGET_API_MAC_OS8
static PyObject *WinObj_SetWindowAlternateTitle(WindowObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if !TARGET_API_MAC_OS8
static PyObject *WinObj_CopyWindowAlternateTitle(WindowObject *_self, PyObject *_args)
{
CFStringRefObj_New, outTitle);
return _res;
}
-#endif
-
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *WinObj_IsValidWindowPtr(WindowObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- Boolean _rv;
-#ifndef IsValidWindowPtr
- PyMac_PRECHECK(IsValidWindowPtr);
-#endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = IsValidWindowPtr(_self->ob_itself);
- _res = Py_BuildValue("b",
- _rv);
- return _res;
-}
-#endif
static PyObject *WinObj_HiliteWindow(WindowObject *_self, PyObject *_args)
{
return _res;
}
-#if !TARGET_API_MAC_OS8
-
static PyObject *WinObj_SetWindowTitleWithCFString(WindowObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
_res = Py_None;
return _res;
}
-#endif
-
-#if !TARGET_API_MAC_OS8
static PyObject *WinObj_CopyWindowTitleAsCFString(WindowObject *_self, PyObject *_args)
{
CFStringRefObj_New, outString);
return _res;
}
-#endif
static PyObject *WinObj_SetWindowProxyFSSpec(WindowObject *_self, PyObject *_args)
{
return _res;
}
-#if !TARGET_API_MAC_OS8
-
static PyObject *WinObj_GetWindowGreatestAreaDevice(WindowObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
PyMac_BuildRect, &outGreatestDeviceRect);
return _res;
}
-#endif
-
-#if !TARGET_API_MAC_OS8
static PyObject *WinObj_ConstrainWindowToScreen(WindowObject *_self, PyObject *_args)
{
PyMac_BuildRect, &outStructure);
return _res;
}
-#endif
static PyObject *WinObj_HideWindow(WindowObject *_self, PyObject *_args)
{
return _res;
}
-#if !TARGET_API_MAC_OS8
-
static PyObject *WinObj_ShowSheetWindow(WindowObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
_res = Py_None;
return _res;
}
-#endif
-
-#if !TARGET_API_MAC_OS8
static PyObject *WinObj_HideSheetWindow(WindowObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if !TARGET_API_MAC_OS8
static PyObject *WinObj_GetSheetWindowParent(WindowObject *_self, PyObject *_args)
{
WinObj_WhichWindow, outParentWindow);
return _res;
}
-#endif
-
-#if !TARGET_API_MAC_OS8
static PyObject *WinObj_GetWindowPropertyAttributes(WindowObject *_self, PyObject *_args)
{
attributes);
return _res;
}
-#endif
-
-#if !TARGET_API_MAC_OS8
static PyObject *WinObj_ChangeWindowPropertyAttributes(WindowObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
static PyObject *WinObj_TrackBox(WindowObject *_self, PyObject *_args)
{
return _res;
}
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *WinObj_GetAuxWin(WindowObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- Boolean _rv;
- AuxWinHandle awHndl;
-#ifndef GetAuxWin
- PyMac_PRECHECK(GetAuxWin);
-#endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = GetAuxWin(_self->ob_itself,
- &awHndl);
- _res = Py_BuildValue("bO&",
- _rv,
- ResObj_New, awHndl);
- return _res;
-}
-#endif
-
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *WinObj_GetWindowGoAwayFlag(WindowObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- Boolean _rv;
-#ifndef GetWindowGoAwayFlag
- PyMac_PRECHECK(GetWindowGoAwayFlag);
-#endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = GetWindowGoAwayFlag(_self->ob_itself);
- _res = Py_BuildValue("b",
- _rv);
- return _res;
-}
-#endif
-
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *WinObj_GetWindowSpareFlag(WindowObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- Boolean _rv;
-#ifndef GetWindowSpareFlag
- PyMac_PRECHECK(GetWindowSpareFlag);
-#endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = GetWindowSpareFlag(_self->ob_itself);
- _res = Py_BuildValue("b",
- _rv);
- return _res;
-}
-#endif
-
static PyObject *WinObj_GetWindowPort(WindowObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
return _res;
}
-#if !TARGET_API_MAC_OS8
-
static PyObject *WinObj_IsWindowUpdatePending(WindowObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
_rv);
return _res;
}
-#endif
static PyObject *WinObj_MacGetNextWindow(WindowObject *_self, PyObject *_args)
{
return _res;
}
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *WinObj_GetWindowZoomFlag(WindowObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- Boolean _rv;
-#ifndef GetWindowZoomFlag
- PyMac_PRECHECK(GetWindowZoomFlag);
-#endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = GetWindowZoomFlag(_self->ob_itself);
- _res = Py_BuildValue("b",
- _rv);
- return _res;
-}
-#endif
-
static PyObject *WinObj_GetWindowStructureRgn(WindowObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
return _res;
}
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *WinObj_GetWindowTitleWidth(WindowObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- short _rv;
-#ifndef GetWindowTitleWidth
- PyMac_PRECHECK(GetWindowTitleWidth);
-#endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = GetWindowTitleWidth(_self->ob_itself);
- _res = Py_BuildValue("h",
- _rv);
- return _res;
-}
-#endif
-
static PyObject *WinObj_GetNextWindow(WindowObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
return _res;
}
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *WinObj_CloseWindow(WindowObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
-#ifndef CloseWindow
- PyMac_PRECHECK(CloseWindow);
-#endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- CloseWindow(_self->ob_itself);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
-}
-#endif
-
static PyObject *WinObj_MoveWindow(WindowObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
PyDoc_STR("() -> (UInt32 outCount)")},
{"CloneWindow", (PyCFunction)WinObj_CloneWindow, 1,
PyDoc_STR("() -> None")},
-
-#if !TARGET_API_MAC_OS8
{"GetWindowRetainCount", (PyCFunction)WinObj_GetWindowRetainCount, 1,
PyDoc_STR("() -> (ItemCount _rv)")},
-#endif
-
-#if !TARGET_API_MAC_OS8
{"RetainWindow", (PyCFunction)WinObj_RetainWindow, 1,
PyDoc_STR("() -> None")},
-#endif
-
-#if !TARGET_API_MAC_OS8
{"ReleaseWindow", (PyCFunction)WinObj_ReleaseWindow, 1,
PyDoc_STR("() -> None")},
-#endif
-
-#if !TARGET_API_MAC_OS8
{"ReshapeCustomWindow", (PyCFunction)WinObj_ReshapeCustomWindow, 1,
PyDoc_STR("() -> None")},
-#endif
{"GetWindowWidgetHilite", (PyCFunction)WinObj_GetWindowWidgetHilite, 1,
PyDoc_STR("() -> (WindowDefPartCode outHilite)")},
{"GetWindowClass", (PyCFunction)WinObj_GetWindowClass, 1,
PyDoc_STR("() -> (WindowClass outClass)")},
{"GetWindowAttributes", (PyCFunction)WinObj_GetWindowAttributes, 1,
PyDoc_STR("() -> (WindowAttributes outAttributes)")},
-
-#if !TARGET_API_MAC_OS8
{"ChangeWindowAttributes", (PyCFunction)WinObj_ChangeWindowAttributes, 1,
PyDoc_STR("(WindowAttributes setTheseAttributes, WindowAttributes clearTheseAttributes) -> None")},
-#endif
-
-#if !TARGET_API_MAC_OS8
{"SetWindowClass", (PyCFunction)WinObj_SetWindowClass, 1,
PyDoc_STR("(WindowClass inWindowClass) -> None")},
-#endif
-
-#if !TARGET_API_MAC_OS8
{"SetWindowModality", (PyCFunction)WinObj_SetWindowModality, 1,
PyDoc_STR("(WindowModality inModalKind, WindowPtr inUnavailableWindow) -> None")},
-#endif
-
-#if !TARGET_API_MAC_OS8
{"GetWindowModality", (PyCFunction)WinObj_GetWindowModality, 1,
PyDoc_STR("() -> (WindowModality outModalKind, WindowPtr outUnavailableWindow)")},
-#endif
-
-#if !TARGET_API_MAC_CARBON
- {"SetWinColor", (PyCFunction)WinObj_SetWinColor, 1,
- PyDoc_STR("(WCTabHandle newColorTable) -> None")},
-#endif
{"SetWindowContentColor", (PyCFunction)WinObj_SetWindowContentColor, 1,
PyDoc_STR("(RGBColor color) -> None")},
{"GetWindowContentColor", (PyCFunction)WinObj_GetWindowContentColor, 1,
PyDoc_STR("(PixPatHandle outPixPat) -> None")},
{"SetWindowContentPattern", (PyCFunction)WinObj_SetWindowContentPattern, 1,
PyDoc_STR("(PixPatHandle pixPat) -> None")},
-
-#if !TARGET_API_MAC_OS8
{"ScrollWindowRect", (PyCFunction)WinObj_ScrollWindowRect, 1,
PyDoc_STR("(Rect inScrollRect, SInt16 inHPixels, SInt16 inVPixels, ScrollWindowOptions inOptions, RgnHandle outExposedRgn) -> None")},
-#endif
-
-#if !TARGET_API_MAC_OS8
{"ScrollWindowRegion", (PyCFunction)WinObj_ScrollWindowRegion, 1,
PyDoc_STR("(RgnHandle inScrollRgn, SInt16 inHPixels, SInt16 inVPixels, ScrollWindowOptions inOptions, RgnHandle outExposedRgn) -> None")},
-#endif
{"ClipAbove", (PyCFunction)WinObj_ClipAbove, 1,
PyDoc_STR("() -> None")},
-
-#if !TARGET_API_MAC_CARBON
- {"SaveOld", (PyCFunction)WinObj_SaveOld, 1,
- PyDoc_STR("() -> None")},
-#endif
-
-#if !TARGET_API_MAC_CARBON
- {"DrawNew", (PyCFunction)WinObj_DrawNew, 1,
- PyDoc_STR("(Boolean update) -> None")},
-#endif
{"PaintOne", (PyCFunction)WinObj_PaintOne, 1,
PyDoc_STR("(RgnHandle clobberedRgn) -> None")},
{"PaintBehind", (PyCFunction)WinObj_PaintBehind, 1,
PyDoc_STR("(WindowPtr behindWindow) -> None")},
{"SelectWindow", (PyCFunction)WinObj_SelectWindow, 1,
PyDoc_STR("() -> None")},
-
-#if !TARGET_API_MAC_OS8
{"GetNextWindowOfClass", (PyCFunction)WinObj_GetNextWindowOfClass, 1,
PyDoc_STR("(WindowClass inWindowClass, Boolean mustBeVisible) -> (WindowPtr _rv)")},
-#endif
-
-#if !TARGET_API_MAC_OS8
{"SetWindowAlternateTitle", (PyCFunction)WinObj_SetWindowAlternateTitle, 1,
PyDoc_STR("(CFStringRef inTitle) -> None")},
-#endif
-
-#if !TARGET_API_MAC_OS8
{"CopyWindowAlternateTitle", (PyCFunction)WinObj_CopyWindowAlternateTitle, 1,
PyDoc_STR("() -> (CFStringRef outTitle)")},
-#endif
-
-#if !TARGET_API_MAC_CARBON
- {"IsValidWindowPtr", (PyCFunction)WinObj_IsValidWindowPtr, 1,
- PyDoc_STR("() -> (Boolean _rv)")},
-#endif
{"HiliteWindow", (PyCFunction)WinObj_HiliteWindow, 1,
PyDoc_STR("(Boolean fHilite) -> None")},
{"SetWRefCon", (PyCFunction)WinObj_SetWRefCon, 1,
PyDoc_STR("(Str255 title) -> None")},
{"GetWTitle", (PyCFunction)WinObj_GetWTitle, 1,
PyDoc_STR("() -> (Str255 title)")},
-
-#if !TARGET_API_MAC_OS8
{"SetWindowTitleWithCFString", (PyCFunction)WinObj_SetWindowTitleWithCFString, 1,
PyDoc_STR("(CFStringRef inString) -> None")},
-#endif
-
-#if !TARGET_API_MAC_OS8
{"CopyWindowTitleAsCFString", (PyCFunction)WinObj_CopyWindowTitleAsCFString, 1,
PyDoc_STR("() -> (CFStringRef outString)")},
-#endif
{"SetWindowProxyFSSpec", (PyCFunction)WinObj_SetWindowProxyFSSpec, 1,
PyDoc_STR("(FSSpec inFile) -> None")},
{"GetWindowProxyFSSpec", (PyCFunction)WinObj_GetWindowProxyFSSpec, 1,
PyDoc_STR("() -> (Rect userState)")},
{"SetWindowIdealUserState", (PyCFunction)WinObj_SetWindowIdealUserState, 1,
PyDoc_STR("(Rect userState) -> None")},
-
-#if !TARGET_API_MAC_OS8
{"GetWindowGreatestAreaDevice", (PyCFunction)WinObj_GetWindowGreatestAreaDevice, 1,
PyDoc_STR("(WindowRegionCode inRegion) -> (GDHandle outGreatestDevice, Rect outGreatestDeviceRect)")},
-#endif
-
-#if !TARGET_API_MAC_OS8
{"ConstrainWindowToScreen", (PyCFunction)WinObj_ConstrainWindowToScreen, 1,
PyDoc_STR("(WindowRegionCode inRegionCode, WindowConstrainOptions inOptions, Rect inScreenRect) -> (Rect outStructure)")},
-#endif
{"HideWindow", (PyCFunction)WinObj_HideWindow, 1,
PyDoc_STR("() -> None")},
{"MacShowWindow", (PyCFunction)WinObj_MacShowWindow, 1,
PyDoc_STR("(Boolean showFlag) -> None")},
{"MacIsWindowVisible", (PyCFunction)WinObj_MacIsWindowVisible, 1,
PyDoc_STR("() -> (Boolean _rv)")},
-
-#if !TARGET_API_MAC_OS8
{"ShowSheetWindow", (PyCFunction)WinObj_ShowSheetWindow, 1,
PyDoc_STR("(WindowPtr inParentWindow) -> None")},
-#endif
-
-#if !TARGET_API_MAC_OS8
{"HideSheetWindow", (PyCFunction)WinObj_HideSheetWindow, 1,
PyDoc_STR("() -> None")},
-#endif
-
-#if !TARGET_API_MAC_OS8
{"GetSheetWindowParent", (PyCFunction)WinObj_GetSheetWindowParent, 1,
PyDoc_STR("() -> (WindowPtr outParentWindow)")},
-#endif
-
-#if !TARGET_API_MAC_OS8
{"GetWindowPropertyAttributes", (PyCFunction)WinObj_GetWindowPropertyAttributes, 1,
PyDoc_STR("(OSType propertyCreator, OSType propertyTag) -> (UInt32 attributes)")},
-#endif
-
-#if !TARGET_API_MAC_OS8
{"ChangeWindowPropertyAttributes", (PyCFunction)WinObj_ChangeWindowPropertyAttributes, 1,
PyDoc_STR("(OSType propertyCreator, OSType propertyTag, UInt32 attributesToSet, UInt32 attributesToClear) -> None")},
-#endif
{"TrackBox", (PyCFunction)WinObj_TrackBox, 1,
PyDoc_STR("(Point thePt, WindowPartCode partCode) -> (Boolean _rv)")},
{"TrackGoAway", (PyCFunction)WinObj_TrackGoAway, 1,
PyDoc_STR("(Point thePt) -> (Boolean _rv)")},
-
-#if !TARGET_API_MAC_CARBON
- {"GetAuxWin", (PyCFunction)WinObj_GetAuxWin, 1,
- PyDoc_STR("() -> (Boolean _rv, AuxWinHandle awHndl)")},
-#endif
-
-#if !TARGET_API_MAC_CARBON
- {"GetWindowGoAwayFlag", (PyCFunction)WinObj_GetWindowGoAwayFlag, 1,
- PyDoc_STR("() -> (Boolean _rv)")},
-#endif
-
-#if !TARGET_API_MAC_CARBON
- {"GetWindowSpareFlag", (PyCFunction)WinObj_GetWindowSpareFlag, 1,
- PyDoc_STR("() -> (Boolean _rv)")},
-#endif
{"GetWindowPort", (PyCFunction)WinObj_GetWindowPort, 1,
PyDoc_STR("() -> (CGrafPtr _rv)")},
{"GetWindowKind", (PyCFunction)WinObj_GetWindowKind, 1,
PyDoc_STR("() -> (short _rv)")},
{"IsWindowHilited", (PyCFunction)WinObj_IsWindowHilited, 1,
PyDoc_STR("() -> (Boolean _rv)")},
-
-#if !TARGET_API_MAC_OS8
{"IsWindowUpdatePending", (PyCFunction)WinObj_IsWindowUpdatePending, 1,
PyDoc_STR("() -> (Boolean _rv)")},
-#endif
{"MacGetNextWindow", (PyCFunction)WinObj_MacGetNextWindow, 1,
PyDoc_STR("() -> (WindowPtr _rv)")},
{"GetWindowStandardState", (PyCFunction)WinObj_GetWindowStandardState, 1,
PyDoc_STR("() -> (Rect bounds)")},
{"IsWindowVisible", (PyCFunction)WinObj_IsWindowVisible, 1,
PyDoc_STR("() -> (Boolean _rv)")},
-
-#if !TARGET_API_MAC_CARBON
- {"GetWindowZoomFlag", (PyCFunction)WinObj_GetWindowZoomFlag, 1,
- PyDoc_STR("() -> (Boolean _rv)")},
-#endif
{"GetWindowStructureRgn", (PyCFunction)WinObj_GetWindowStructureRgn, 1,
PyDoc_STR("(RgnHandle r) -> None")},
{"GetWindowContentRgn", (PyCFunction)WinObj_GetWindowContentRgn, 1,
PyDoc_STR("(RgnHandle r) -> None")},
{"GetWindowUpdateRgn", (PyCFunction)WinObj_GetWindowUpdateRgn, 1,
PyDoc_STR("(RgnHandle r) -> None")},
-
-#if !TARGET_API_MAC_CARBON
- {"GetWindowTitleWidth", (PyCFunction)WinObj_GetWindowTitleWidth, 1,
- PyDoc_STR("() -> (short _rv)")},
-#endif
{"GetNextWindow", (PyCFunction)WinObj_GetNextWindow, 1,
PyDoc_STR("() -> (WindowPtr _rv)")},
-
-#if !TARGET_API_MAC_CARBON
- {"CloseWindow", (PyCFunction)WinObj_CloseWindow, 1,
- PyDoc_STR("() -> None")},
-#endif
{"MoveWindow", (PyCFunction)WinObj_MoveWindow, 1,
PyDoc_STR("(short hGlobal, short vGlobal, Boolean front) -> None")},
{"ShowWindow", (PyCFunction)WinObj_ShowWindow, 1,
return _res;
}
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Win_SetDeskCPat(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- PixPatHandle deskPixPat;
-#ifndef SetDeskCPat
- PyMac_PRECHECK(SetDeskCPat);
-#endif
- if (!PyArg_ParseTuple(_args, "O&",
- ResObj_Convert, &deskPixPat))
- return NULL;
- SetDeskCPat(deskPixPat);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
-}
-#endif
-
static PyObject *Win_CheckUpdate(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
return _res;
}
-#if !TARGET_API_MAC_OS8
-
static PyObject *Win_GetFrontWindowOfClass(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
WinObj_New, _rv);
return _res;
}
-#endif
-
-#if !TARGET_API_MAC_OS8
static PyObject *Win_FindWindowOfClass(PyObject *_self, PyObject *_args)
{
outWindowPart);
return _res;
}
-#endif
-
-#if !TARGET_API_MAC_OS8
static PyObject *Win_CreateStandardWindowMenu(PyObject *_self, PyObject *_args)
{
MenuObj_New, outMenu);
return _res;
}
-#endif
-
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Win_InitWindows(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
-#ifndef InitWindows
- PyMac_PRECHECK(InitWindows);
-#endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- InitWindows();
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
-}
-#endif
-
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Win_GetWMgrPort(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- GrafPtr wPort;
-#ifndef GetWMgrPort
- PyMac_PRECHECK(GetWMgrPort);
-#endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- GetWMgrPort(&wPort);
- _res = Py_BuildValue("O&",
- GrafObj_New, wPort);
- return _res;
-}
-#endif
-
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Win_GetCWMgrPort(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- CGrafPtr wMgrCPort;
-#ifndef GetCWMgrPort
- PyMac_PRECHECK(GetCWMgrPort);
-#endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- GetCWMgrPort(&wMgrCPort);
- _res = Py_BuildValue("O&",
- GrafObj_New, wMgrCPort);
- return _res;
-}
-#endif
-
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Win_InitFloatingWindows(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- OSStatus _err;
-#ifndef InitFloatingWindows
- PyMac_PRECHECK(InitFloatingWindows);
-#endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _err = InitFloatingWindows();
- if (_err != noErr) return PyMac_Error(_err);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
-}
-#endif
-
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Win_InvalRect(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- Rect badRect;
-#ifndef InvalRect
- PyMac_PRECHECK(InvalRect);
-#endif
- if (!PyArg_ParseTuple(_args, "O&",
- PyMac_GetRect, &badRect))
- return NULL;
- InvalRect(&badRect);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
-}
-#endif
-
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Win_InvalRgn(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- RgnHandle badRgn;
-#ifndef InvalRgn
- PyMac_PRECHECK(InvalRgn);
-#endif
- if (!PyArg_ParseTuple(_args, "O&",
- ResObj_Convert, &badRgn))
- return NULL;
- InvalRgn(badRgn);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
-}
-#endif
-
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Win_ValidRect(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- Rect goodRect;
-#ifndef ValidRect
- PyMac_PRECHECK(ValidRect);
-#endif
- if (!PyArg_ParseTuple(_args, "O&",
- PyMac_GetRect, &goodRect))
- return NULL;
- ValidRect(&goodRect);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
-}
-#endif
-
-#if !TARGET_API_MAC_CARBON
-
-static PyObject *Win_ValidRgn(PyObject *_self, PyObject *_args)
-{
- PyObject *_res = NULL;
- RgnHandle goodRgn;
-#ifndef ValidRgn
- PyMac_PRECHECK(ValidRgn);
-#endif
- if (!PyArg_ParseTuple(_args, "O&",
- ResObj_Convert, &goodRgn))
- return NULL;
- ValidRgn(goodRgn);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
-}
-#endif
static PyObject *Win_CollapseAllWindows(PyObject *_self, PyObject *_args)
{
return _res;
}
-#if !TARGET_API_MAC_OS8
-
static PyObject *Win_GetAvailableWindowPositioningBounds(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
PyMac_BuildRect, &availableRect);
return _res;
}
-#endif
-
-#if !TARGET_API_MAC_OS8
static PyObject *Win_DisableScreenUpdates(PyObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
-
-#if !TARGET_API_MAC_OS8
static PyObject *Win_EnableScreenUpdates(PyObject *_self, PyObject *_args)
{
_res = Py_None;
return _res;
}
-#endif
static PyObject *Win_PinRect(PyObject *_self, PyObject *_args)
{
PyDoc_STR("() -> None")},
{"AreFloatingWindowsVisible", (PyCFunction)Win_AreFloatingWindowsVisible, 1,
PyDoc_STR("() -> (Boolean _rv)")},
-
-#if !TARGET_API_MAC_CARBON
- {"SetDeskCPat", (PyCFunction)Win_SetDeskCPat, 1,
- PyDoc_STR("(PixPatHandle deskPixPat) -> None")},
-#endif
{"CheckUpdate", (PyCFunction)Win_CheckUpdate, 1,
PyDoc_STR("() -> (Boolean _rv, EventRecord theEvent)")},
{"MacFindWindow", (PyCFunction)Win_MacFindWindow, 1,
PyDoc_STR("() -> (WindowPtr _rv)")},
{"FrontNonFloatingWindow", (PyCFunction)Win_FrontNonFloatingWindow, 1,
PyDoc_STR("() -> (WindowPtr _rv)")},
-
-#if !TARGET_API_MAC_OS8
{"GetFrontWindowOfClass", (PyCFunction)Win_GetFrontWindowOfClass, 1,
PyDoc_STR("(WindowClass inWindowClass, Boolean mustBeVisible) -> (WindowPtr _rv)")},
-#endif
-
-#if !TARGET_API_MAC_OS8
{"FindWindowOfClass", (PyCFunction)Win_FindWindowOfClass, 1,
PyDoc_STR("(Point where, WindowClass inWindowClass) -> (WindowPtr outWindow, WindowPartCode outWindowPart)")},
-#endif
-
-#if !TARGET_API_MAC_OS8
{"CreateStandardWindowMenu", (PyCFunction)Win_CreateStandardWindowMenu, 1,
PyDoc_STR("(OptionBits inOptions) -> (MenuHandle outMenu)")},
-#endif
-
-#if !TARGET_API_MAC_CARBON
- {"InitWindows", (PyCFunction)Win_InitWindows, 1,
- PyDoc_STR("() -> None")},
-#endif
-
-#if !TARGET_API_MAC_CARBON
- {"GetWMgrPort", (PyCFunction)Win_GetWMgrPort, 1,
- PyDoc_STR("() -> (GrafPtr wPort)")},
-#endif
-
-#if !TARGET_API_MAC_CARBON
- {"GetCWMgrPort", (PyCFunction)Win_GetCWMgrPort, 1,
- PyDoc_STR("() -> (CGrafPtr wMgrCPort)")},
-#endif
-
-#if !TARGET_API_MAC_CARBON
- {"InitFloatingWindows", (PyCFunction)Win_InitFloatingWindows, 1,
- PyDoc_STR("() -> None")},
-#endif
-
-#if !TARGET_API_MAC_CARBON
- {"InvalRect", (PyCFunction)Win_InvalRect, 1,
- PyDoc_STR("(Rect badRect) -> None")},
-#endif
-
-#if !TARGET_API_MAC_CARBON
- {"InvalRgn", (PyCFunction)Win_InvalRgn, 1,
- PyDoc_STR("(RgnHandle badRgn) -> None")},
-#endif
-
-#if !TARGET_API_MAC_CARBON
- {"ValidRect", (PyCFunction)Win_ValidRect, 1,
- PyDoc_STR("(Rect goodRect) -> None")},
-#endif
-
-#if !TARGET_API_MAC_CARBON
- {"ValidRgn", (PyCFunction)Win_ValidRgn, 1,
- PyDoc_STR("(RgnHandle goodRgn) -> None")},
-#endif
{"CollapseAllWindows", (PyCFunction)Win_CollapseAllWindows, 1,
PyDoc_STR("(Boolean collapse) -> None")},
-
-#if !TARGET_API_MAC_OS8
{"GetAvailableWindowPositioningBounds", (PyCFunction)Win_GetAvailableWindowPositioningBounds, 1,
PyDoc_STR("(GDHandle inDevice) -> (Rect availableRect)")},
-#endif
-
-#if !TARGET_API_MAC_OS8
{"DisableScreenUpdates", (PyCFunction)Win_DisableScreenUpdates, 1,
PyDoc_STR("() -> None")},
-#endif
-
-#if !TARGET_API_MAC_OS8
{"EnableScreenUpdates", (PyCFunction)Win_EnableScreenUpdates, 1,
PyDoc_STR("() -> None")},
-#endif
{"PinRect", (PyCFunction)Win_PinRect, 1,
PyDoc_STR("(Rect theRect, Point thePt) -> (long _rv)")},
{"GetGrayRgn", (PyCFunction)Win_GetGrayRgn, 1,
)
methods.append(f)
-f = Method(Boolean, 'GetWindowZoomFlag',
- (WindowRef, 'theWindow', InMode),
- condition='#if !TARGET_API_MAC_CARBON'
-)
-methods.append(f)
-
f = Method(void, 'GetWindowStructureRgn',
(WindowRef, 'theWindow', InMode),
(RgnHandle, 'r', InMode),
)
methods.append(f)
-f = Method(short, 'GetWindowTitleWidth',
- (WindowRef, 'theWindow', InMode),
- condition='#if !TARGET_API_MAC_CARBON'
-)
-methods.append(f)
-
f = Method(ExistingWindowPtr, 'GetNextWindow',
(WindowRef, 'theWindow', InMode),
)
methods.append(f)
-# These have Mac prefixed to their name in the 3.1 universal headers,
-# so we add the old/real names by hand.
-f = Method(void, 'CloseWindow',
- (WindowPtr, 'theWindow', InMode),
- condition='#if !TARGET_API_MAC_CARBON'
-)
-methods.append(f)
-
f = Function(short, 'FindWindow',
(Point, 'thePoint', InMode),
(ExistingWindowPtr, 'theWindow', OutMode),
# Constants with funny definitions
'kMouseUpOutOfSlop',
'kAllWindowClasses',
+ # OS8 only:
+ 'GetAuxWin',
+ 'GetWindowDataHandle',
+ 'SaveOld',
+ 'DrawNew',
+ 'SetWinColor',
+ 'SetDeskCPat',
+ 'InitWindows',
+ 'InitFloatingWindows',
+ 'GetWMgrPort',
+ 'GetCWMgrPort',
+ 'ValidRgn', # Use versions with Window in their name
+ 'ValidRect',
+ 'InvalRgn',
+ 'InvalRect',
+ 'IsValidWindowPtr', # I think this is useless for Python, but not sure...
+ 'GetWindowZoomFlag', # Not available in Carbon
+ 'GetWindowTitleWidth', # Ditto
+ 'GetWindowGoAwayFlag',
+ 'GetWindowSpareFlag',
]
def makegreylist(self):
return [
- ('#if !TARGET_API_MAC_CARBON', [
- 'GetAuxWin',
- 'GetWindowDataHandle',
- 'SaveOld',
- 'DrawNew',
- 'SetWinColor',
- 'SetDeskCPat',
- 'InitWindows',
- 'InitFloatingWindows',
- 'GetWMgrPort',
- 'GetCWMgrPort',
- 'ValidRgn', # Use versions with Window in their name
- 'ValidRect',
- 'InvalRgn',
- 'InvalRect',
- 'IsValidWindowPtr', # I think this is useless for Python, but not sure...
- 'GetWindowZoomFlag', # Not available in Carbon
- 'GetWindowTitleWidth', # Ditto
- 'GetWindowGoAwayFlag',
- 'GetWindowSpareFlag',
- ]),
- ('#if !TARGET_API_MAC_OS8', [
- 'IsWindowUpdatePending',
- 'FindWindowOfClass',
- 'GetFrontWindowOfClass',
- 'ChangeWindowPropertyAttributes',
- 'GetWindowPropertyAttributes',
- 'GetNextWindowOfClass',
- 'ScrollWindowRegion',
- 'ScrollWindowRect',
- 'ChangeWindowAttributes',
- 'ReshapeCustomWindow',
- 'EnableScreenUpdates',
- 'DisableScreenUpdates',
- 'GetAvailableWindowPositioningBounds',
- 'CreateStandardWindowMenu',
- 'GetSheetWindowParent',
- 'HideSheetWindow',
- 'ShowSheetWindow',
- 'ConstrainWindowToScreen',
- 'GetWindowGreatestAreaDevice',
- 'CopyWindowTitleAsCFString',
- 'SetWindowTitleWithCFString',
- 'CopyWindowAlternateTitle',
- 'SetWindowAlternateTitle',
- 'GetWindowModality',
- 'SetWindowModality',
- 'SetWindowClass',
- 'ReleaseWindow',
- 'RetainWindow',
- 'GetWindowRetainCount',
- ]),
('#if TARGET_API_MAC_OSX', [
'TransitionWindowAndParent',
])]
#include "Python.h"
#include "macglue.h"
-#ifdef TARGET_API_MAC_OSX
-#define PATHNAMELEN 1024
-#else
#define PATHNAMELEN 256
-#endif
static int arg_count;
static char *arg_vector[256];
}
#endif
-
-#if !TARGET_API_MAC_OSX
/* Initialize FSSpec and full name of current application */
OSErr
applocation_inited = 1;
return 0;
}
-#endif /* !TARGET_API_MAC_OSX */
/* Check that there aren't any args remaining in the event */
got_one = 0;
for (n = 0; n < 100 && !got_one; n++) {
-#if !TARGET_API_MAC_CARBON
- SystemTask();
-#endif
ok = GetNextEvent(everyEvent, &event);
if (ok && event.what == kHighLevelEvent) {
AEProcessAppleEvent(&event);
PyMac_GetArgv(char ***pargv, int noevents)
{
arg_count = 0;
-#if TARGET_API_MAC_OSX
- /* In an OSX bundle argv[0] is okay */
- arg_count++;
-#else
(void)PyMac_init_process_location();
arg_vector[arg_count++] = strdup(PyMac_ApplicationPath);
-#endif /* TARGET_API_MAC_OSX */
if( !noevents ) {
set_ae_handlers();
#define HASTHREAD " WITHOUT_THREAD"
#endif
-#if TARGET_API_MAC_CARBON
-#define TARGET_API ""
-#else
-#define TARGET_API " PPC"
-#endif
-
-#define COMPILER " [CW" TARGET_API HASGUSI HASTHREAD"]"
+#define COMPILER " [CW" HASGUSI HASTHREAD"]"
#endif
#ifdef MPW
#include <unistd.h>
#endif
-#ifdef TARGET_API_MAC_OSX
-#define PATHNAMELEN 1024
-#else
#define PATHNAMELEN 256
-#endif
/* Return the initial python search path. This is called once from
** initsys() to initialize sys.path.
#include <Carbon/Carbon.h>
#endif
-#if !TARGET_API_MAC_OS8
-/* Unfortunately this call is probably slower... */
-#define LMGetTicks() TickCount()
-#endif
-
#ifdef __MWERKS__
#include <SIOUX.h>
extern void SIOUXSetupMenus(void);
#define MINIMUM_STACK_SIZE 8192
#endif
-#if TARGET_API_MAC_CARBON
/*
** On MacOSX StackSpace() lies: it gives the distance from heap end to stack pointer,
** but the stack cannot grow that far due to rlimit values. We cannot get at this value
** stack limit of 512K.
*/
#define MAXIMUM_STACK_SIZE (256*1024)
-#endif
/*
** We have to be careful, since we can't handle
*/
static MenuBarHandle sioux_mbar;
-/*
-** Some stuff for our GetDirectory and PromptGetFile routines
-*/
-struct hook_args {
- int selectcur_hit; /* Set to true when "select current" selected */
- char *prompt; /* The prompt */
-};
-#if !TARGET_API_MAC_OS8
-/* The StandardFile hooks don't exist in Carbon. This breaks GetDirectory,
-** but the macfsn code will replace it by a NavServices version anyway.
-*/
-#define myhook_upp NULL
-#else
-static DlgHookYDUPP myhook_upp;
-static int upp_inited = 0;
-#endif
-
/*
** The python-code event handler
*/
PyMac_ConsoleIsDead = 1;
}
-#if TARGET_API_MAC_OS8
-/*
-** Replacement routines for the PLstr... functions so we don't need
-** StdCLib.
-*/
-pascal void
-PLstrcpy(unsigned char *to, unsigned char *fr)
-{
- memcpy(to, fr, fr[0]+1);
-}
-
-pascal int
-PLstrcmp(unsigned char *s1, unsigned char *s2)
-{
- int res;
- int l = s1[0] < s2[0] ? s1[0] : s2[0];
-
- res = memcmp(s1+1, s2+1, l);
- if ( res != 0 )
- return res;
-
- if ( s1[0] < s2[0] )
- return -1;
- else if ( s1[0] > s2[0] )
- return 1;
- else
- return 0;
-}
-
-pascal unsigned char *
-PLstrrchr(unsigned char *str, unsigned char chr)
-{
- unsigned char *ptr = 0;
- unsigned char *p;
-
- for(p=str+1; p<str+str[0]; p++)
- if ( *p == chr )
- ptr = p;
- return ptr;
-}
-
-#endif /* TARGET_API_MAC_OS8 */
#endif /* USE_GUSI */
return buf;
}
-#if TARGET_API_MAC_OS8
-Point
-LMGetMouse(void)
-{
- return LMGetMouseLocation();
-}
-
-long LMGetExpandMem(void)
-{
- return 0;
-}
-
-void
-c2pstrcpy(unsigned char *dst, const char *src)
-{
- int len;
-
- len = strlen(src);
- if ( len > 255 ) len = 255;
- strncpy((char *)dst+1, src, len);
- dst[0] = len;
-}
-#endif /* TARGET_API_MAC_OS8 */
#ifdef USE_STACKCHECK
/* Check for stack overflow */
scan_event_queue(force)
int force;
{
-#if !TARGET_API_MAC_OS8
if ( interrupted || (!schedparams.check_interrupt && !force) )
return;
if ( CheckEventQueueForUserCancel() )
interrupted = 1;
-#else
- register EvQElPtr q;
-
- if ( interrupted || (!schedparams.check_interrupt && !force) || !PyMac_InForeground() )
- return;
- q = (EvQElPtr) LMGetEventQueue()->qHead;
-
- for (; q; q = (EvQElPtr)q->qLink) {
- if (q->evtQWhat == keyDown &&
- (char)q->evtQMessage == '.' &&
- (q->evtQModifiers & cmdKey) != 0) {
- FlushEvents(keyDownMask, 0);
- interrupted = 1;
- break;
- }
- }
-#endif
}
int
PyErr_CheckSignals()
{
if (schedparams.enabled) {
- if ( interrupted || (unsigned long)LMGetTicks() > schedparams.next_check ) {
+ if ( interrupted || (unsigned long)TickCount() > schedparams.next_check ) {
scan_event_queue(0);
if (interrupted) {
interrupted = 0;
}
if ( PyMac_Yield() < 0)
return -1;
- schedparams.next_check = (unsigned long)LMGetTicks()
+ schedparams.next_check = (unsigned long)TickCount()
+ schedparams.check_interval;
}
}
PyMac_HandleEventIntern(evp)
EventRecord *evp;
{
-#if TARGET_API_MAC_OS8
- if ( evp->what == mouseDown ) {
- WindowPtr wp;
-
- if ( FindWindow(evp->where, &wp) == inSysWindow ) {
- SystemClick(evp, wp);
- return;
- }
- }
-#endif
#ifdef __MWERKS__
{
int siouxdidit;
if( in_here > 1 || !schedparams.process_events ||
(python_event_handler && !maycallpython) ) {
if ( maxsleep >= 0 ) {
-#if TARGET_API_MAC_OS8
- SystemTask();
-#else
- int xxx = 0;
-#endif
+ /* XXXX Need to do something here */
}
} else {
- latest_time_ready = LMGetTicks() + maxsleep;
+ latest_time_ready = TickCount() + maxsleep;
do {
/* XXXX Hack by Jack.
** In time.sleep() you can click to another application
in_here--;
return -1;
}
- maxsleep = latest_time_ready - LMGetTicks();
+ maxsleep = latest_time_ready - TickCount();
} while ( maxsleep > 0 );
}
in_here--;
}
#endif /* !TARGET_API_MAC_OSX */
-
-#if TARGET_API_MAC_OS8
-/*
-** Helper routine for GetDirectory
-*/
-static pascal short
-myhook_proc(short item, DialogPtr theDialog, struct hook_args *dataptr)
-{
- if ( item == sfHookFirstCall && dataptr->prompt) {
- Handle prompth;
- short type;
- Rect rect;
-
- GetDialogItem(theDialog, PROMPT_ITEM, &type, &prompth, &rect);
- if ( prompth )
- SetDialogItemText(prompth, (unsigned char *)dataptr->prompt);
- } else
- if ( item == SELECTCUR_ITEM ) {
- item = sfItemCancelButton;
- dataptr->selectcur_hit = 1;
- }
- return item;
-}
-
-/*
-** Ask the user for a directory. I still can't understand
-** why Apple doesn't provide a standard solution for this...
-*/
-int
-PyMac_GetDirectory(dirfss, prompt)
- FSSpec *dirfss;
- char *prompt;
-{
- static SFTypeList list = {'fldr', 0, 0, 0};
- static Point where = {-1, -1};
- StandardFileReply reply;
- struct hook_args hook_args;
-
- if ( !upp_inited ) {
- myhook_upp = NewDlgHookYDProc(myhook_proc);
- upp_inited = 1;
- }
- if ( prompt && *prompt )
- hook_args.prompt = (char *)Pstring(prompt);
- else
- hook_args.prompt = NULL;
- hook_args.selectcur_hit = 0;
- CustomGetFile((FileFilterYDUPP)0, 1, list, &reply, GETDIR_ID, where, myhook_upp,
- NULL, NULL, NULL, (void *)&hook_args);
-
- reply.sfFile.name[0] = 0;
- if( FSMakeFSSpec(reply.sfFile.vRefNum, reply.sfFile.parID, reply.sfFile.name, dirfss) )
- return 0;
- return hook_args.selectcur_hit;
-}
-
-/*
-** Slightly extended StandardGetFile: accepts a prompt */
-void PyMac_PromptGetFile(short numTypes, ConstSFTypeListPtr typeList,
- StandardFileReply *reply, char *prompt)
-{
- static Point where = {-1, -1};
- struct hook_args hook_args;
-
- if ( !upp_inited ) {
- myhook_upp = NewDlgHookYDProc(myhook_proc);
- upp_inited = 1;
- }
- if ( prompt && *prompt )
- hook_args.prompt = (char *)Pstring(prompt);
- else
- hook_args.prompt = NULL;
- hook_args.selectcur_hit = 0;
- CustomGetFile((FileFilterYDUPP)0, numTypes, typeList, reply, GETFILEPROMPT_ID, where,
- myhook_upp, NULL, NULL, NULL, (void *)&hook_args);
-}
-#endif /* TARGET_API_MAC_OS8 */
-
-
#include <Windows.h>
#include <Fonts.h>
#include <Balloons.h>
-#if TARGET_API_MAC_CARBON
#include <CFBundle.h>
#include <CFURL.h>
#include <CFString.h>
#include <CFBase.h>
#include <CFArray.h>
-#endif /* TARGET_API_MAC_CARBON */
#include <Gestalt.h>
#include <Appearance.h>
#else
static void
init_mac_world(void)
{
-#if !TARGET_API_MAC_CARBON
- /* These aren't needed for carbon */
- MaxApplZone();
- InitGraf(&qd.thePort);
- InitFonts();
- InitWindows();
- TEInit();
- InitDialogs((long)0);
- InitMenus();
-#endif
InitCursor();
}
DisposeDialog(dialog);
exit(0);
}
-#if !TARGET_API_MAC_CARBON
- if ( item == OPT_HELP ) {
- HMSetBalloons(!HMGetBalloons());
- }
-#endif
-#if !TARGET_API_MAC_OSX
if ( item == OPT_CMDLINE ) {
int old_argc = *argcp;
int i;
/* XXXX Is it not safe to use free() here, apparently */
}
-#endif /* !TARGET_API_MAC_OSX */
#define OPT_ITEM(num, var) \
if ( item == (num) ) { \
p->var = !p->var; \
/* Get options from preference file (or from applet resource fork) */
PyMac_options.keep_console = POPT_KEEPCONSOLE_OUTPUT; /* default-default */
PyMac_options.unixnewlines = 1;
-#if !TARGET_API_MAC_OSX
PyMac_PreferenceOptions(&PyMac_options);
-#endif
if ( embedded ) {
static char *emb_argv[] = {"embedded-python", 0};
** In MachoPython we skip this step if we already have plausible
** command line arguments.
*/
-#if TARGET_API_MAC_OSX
- if (*argcp == 2 && strncmp((*argvp)[1], "-psn_", 5) == 0)
-#endif
*argcp = PyMac_GetArgv(argvp, PyMac_options.noargs);
-#if !TARGET_API_MAC_OSX
#ifndef NO_ARGV0_CHDIR
if (*argcp >= 1 && (*argvp)[0] && (*argvp)[0][0]) {
/* Workaround for MacOS X, which currently (DP4) doesn't set
if ( p ) *p = 0;
chdir(app_wd);
}
-#endif
#endif
/* Do interactive option setting, if allowed and <option> depressed */
PyMac_InteractiveOptions(&PyMac_options, argcp, argvp);
Py_NoSiteFlag = PyMac_options.nosite;
Py_TabcheckFlag = PyMac_options.tabwarn;
Py_DivisionWarningFlag = PyMac_options.divisionwarn;
-#if !TARGET_API_MAC_OSX
if ( PyMac_options.noargs ) {
/* don't process events at all without the scripts permission */
PyMacSchedParams scp;
/* Should we disable command-dot as well? */
PyMac_SetSchedParams(&scp);
}
-#endif /* !TARGET_API_MAC_OSX */
/* Set buffering */
if (PyMac_options.unbuffered) {
#endif /* USE_MAC_APPLET_SUPPORT */
-#if TARGET_API_MAC_OSX /* Really: TARGET_API_MAC_CARBON */
-
-static int
-locateResourcePy(CFStringRef resourceType, char *resourceName, char *resourceURLCStr, int length)
-{
- CFBundleRef mainBundle = NULL;
- CFURLRef URL, absoluteURL;
- CFStringRef filenameString, filepathString, rsrcString;
- CFIndex size, i;
- CFArrayRef arrayRef = NULL;
- int success = 0;
-
-#if TARGET_API_MAC_OSX
- CFURLPathStyle thePathStyle = kCFURLPOSIXPathStyle;
-#else
- CFURLPathStyle thePathStyle = kCFURLHFSPathStyle;
-#endif
-
- /* Get a reference to our main bundle */
- mainBundle = CFBundleGetMainBundle();
-
- /* If we are running inside a bundle, look through it. Otherwise, do nothing. */
- if (mainBundle) {
- /* Create a CFString with the resource name in it */
- rsrcString = CFStringCreateWithCString(0, resourceName, kCFStringEncodingMacRoman);
-
- /* Look for py files in the main bundle by type */
- arrayRef = CFBundleCopyResourceURLsOfType( mainBundle,
- resourceType,
- NULL );
-
- /* See if there are any filename matches */
- size = CFArrayGetCount(arrayRef);
- for (i = 0; i < size; i++) {
- URL = CFArrayGetValueAtIndex(arrayRef, i);
- filenameString = CFURLCopyLastPathComponent(URL);
- if (CFStringCompare(filenameString, rsrcString, 0) == kCFCompareEqualTo) {
- /* We found a match, get the file's full path */
- absoluteURL = CFURLCopyAbsoluteURL(URL);
- filepathString = CFURLCopyFileSystemPath(absoluteURL, thePathStyle);
- CFRelease(absoluteURL);
-
- /* Copy the full path into the caller's character buffer */
- success = CFStringGetCString(filepathString, resourceURLCStr, length,
- kCFStringEncodingMacRoman);
-
- CFRelease(filepathString);
- }
- CFRelease(filenameString);
- }
- CFRelease(arrayRef);
- CFRelease(rsrcString);
- }
- return success;
-}
-
-#endif /* TARGET_API_MAC_CARBON */
-
-#if TARGET_API_MAC_OSX
-
-int
-main(int argc, char **argv)
-{
- static char scriptpath[1024];
- char *script = NULL;
-
- /* First we see whether we have __rawmain__.py and run that if it
- ** is there
- */
- if (locateResourcePy(CFSTR("py"), "__rawmain__.py", scriptpath, 1024)) {
- /* If we have a raw main we don't do AppleEvent processing.
- ** Notice that this also means we keep the -psn.... argv[1]
- ** value intact. Not sure whether that is important to someone,
- ** but you never know...
- */
- script = scriptpath;
- } else if (locateResourcePy(CFSTR("pyc"), "__rawmain__.pyc", scriptpath, 1024)) {
- script = scriptpath;
- } else {
- /* Otherwise we look for __main__.py. Whether that is
- ** found or not we also process AppleEvent arguments.
- */
- if (locateResourcePy(CFSTR("py"), "__main__.py", scriptpath, 1024))
- script = scriptpath;
- else if (locateResourcePy(CFSTR("pyc"), "__main__.pyc", scriptpath, 1024))
- script = scriptpath;
-
- init_common(&argc, &argv, 0);
-
- }
-
- PyMac_Main(argc, argv, script);
- return 0;
-}
-
-#else
-
/* For normal application */
void
PyMac_InitApplication(void)
init_common(&argc, &argv, 0);
-#if TARGET_API_MAC_OSX /* Really: TARGET_API_MAC_CARBON */
- /* If we are running inside of a bundle, and a __main__.py is available, use it */
- if (locateResourcePy("__main__.py", scriptpath, 1024))
- script = scriptpath;
-#endif
-
if ( argc > 1 ) {
/* We're running a script. Attempt to change current directory */
char curwd[256], *endp;
}
PyMac_Main(argc, argv, script);
}
-#endif /* TARGET_API_MAC_OSX */
/* Main program */
if (Py_VerboseFlag ||
(command == NULL && filename == NULL && isatty((int)fileno(fp))))
fprintf(stderr, "%s %s on %s\n%s\n",
-#if !TARGET_API_MAC_OSX
"Python",
-#else
- "Pythonw",
-#endif
Py_GetVersion(), Py_GetPlatform(), COPYRIGHT);
if (filename != NULL) {
}
}
-#if !TARGET_API_MAC_OSX
/* We initialize the menubar here, hoping SIOUX is initialized by now */
PyMac_InitMenuBar();
-#endif
Py_Initialize();
/*NOTREACHED*/
}
-#if !TARGET_API_MAC_OSX
/*
** Reset the "unseen output" flag
*/
console_output_state = STATE_LASTWRITE;
PyMac_Exit(1);
}
-#endif /* !TARGET_API_MAC_OSX */
/*
** Terminate application
exit(status);
}
-#if !TARGET_API_MAC_OSX
/* Make the *original* argc/argv available to other modules.
This is rare, but it is needed by the secureware extension. */
*argc = orig_argc;
*argv = orig_argv;
}
-#endif
/* More cruft that shouldn't really be here, used in sysmodule.c */
-#if !TARGET_API_MAC_OSX
/* Return the program name -- some code out there needs this. */
char *
Py_GetProgramFullPath(void)
*p = '\r';
}
#endif /* WITHOUT_UNIX_NEWLINES */
-#endif /* !TARGET_API_MAC_OSX */
}
static bool input_pending()
{
-#if !TARGET_API_MAC_CARBON
- // Jack thinks that completely removing this code is a bit
- // too much...
- QHdrPtr eventQueue = LMGetEventQueue();
- EvQElPtr element = (EvQElPtr)eventQueue->qHead;
-
- // now, count the number of pending keyDown events.
- while (element != nil) {
- if (element->evtQWhat == keyDown || element->evtQWhat == autoKey)
- return true;
- element = (EvQElPtr)element->qLink;
- }
-#endif
return false;
}