mirror of
https://github.com/python/cpython.git
synced 2024-11-28 04:15:11 +08:00
Getting rid of pre-Carbon (MacOS8) support. All code depending on
TARGET_API_MAC_OS8 (or !TARGET_API_MAC_CARBON) is gone. Also some TARGET_API_MAC_OSX conditional code is gone, because it is no longer used on OSX-only Python (only in MacPython-OS9).
This commit is contained in:
parent
6bf45c6752
commit
6c7e326eaa
@ -83,12 +83,6 @@ int PyMac_FindCodeResourceModule(PyStringObject *, char *, char *); /* Test for
|
||||
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 */
|
||||
|
||||
|
@ -351,15 +351,11 @@ navrr_getattr(navrrobject *self, char *name)
|
||||
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);
|
||||
|
@ -610,8 +610,6 @@ static PyObject *AEDesc_AEPutAttributeDesc(AEDescObject *_self, PyObject *_args)
|
||||
return _res;
|
||||
}
|
||||
|
||||
#if TARGET_API_MAC_CARBON
|
||||
|
||||
static PyObject *AEDesc_AEGetDescDataSize(AEDescObject *_self, PyObject *_args)
|
||||
{
|
||||
PyObject *_res = NULL;
|
||||
@ -626,7 +624,6 @@ static PyObject *AEDesc_AEGetDescDataSize(AEDescObject *_self, PyObject *_args)
|
||||
_rv);
|
||||
return _res;
|
||||
}
|
||||
#endif
|
||||
|
||||
static PyObject *AEDesc_AESend(AEDescObject *_self, PyObject *_args)
|
||||
{
|
||||
@ -807,11 +804,8 @@ static PyMethodDef AEDesc_methods[] = {
|
||||
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,
|
||||
@ -1048,8 +1042,6 @@ static PyObject *AE_AECreateAppleEvent(PyObject *_self, PyObject *_args)
|
||||
return _res;
|
||||
}
|
||||
|
||||
#if TARGET_API_MAC_CARBON
|
||||
|
||||
static PyObject *AE_AEReplaceDescData(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
PyObject *_res = NULL;
|
||||
@ -1075,7 +1067,6 @@ static PyObject *AE_AEReplaceDescData(PyObject *_self, PyObject *_args)
|
||||
AEDesc_New, &theAEDesc);
|
||||
return _res;
|
||||
}
|
||||
#endif
|
||||
|
||||
static PyObject *AE_AEProcessAppleEvent(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
@ -1360,11 +1351,8 @@ static PyMethodDef AE_methods[] = {
|
||||
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,
|
||||
|
@ -51,12 +51,6 @@ class AppleEventsScanner(Scanner):
|
||||
"kAEUseStandardDispatch",
|
||||
]
|
||||
|
||||
def makegreylist(self):
|
||||
return [
|
||||
('#if TARGET_API_MAC_CARBON', [
|
||||
'AEGetDescDataSize',
|
||||
'AEReplaceDescData',
|
||||
])]
|
||||
def makeblacklisttypes(self):
|
||||
return [
|
||||
"ProcPtr",
|
||||
|
@ -924,8 +924,6 @@ static PyObject *App_UseThemeFont(PyObject *_self, PyObject *_args)
|
||||
return _res;
|
||||
}
|
||||
|
||||
#if TARGET_API_MAC_CARBON
|
||||
|
||||
static PyObject *App_DrawThemeTextBox(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
PyObject *_res = NULL;
|
||||
@ -959,9 +957,6 @@ static PyObject *App_DrawThemeTextBox(PyObject *_self, PyObject *_args)
|
||||
_res = Py_None;
|
||||
return _res;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if TARGET_API_MAC_CARBON
|
||||
|
||||
static PyObject *App_TruncateThemeText(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
@ -994,9 +989,6 @@ 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)
|
||||
{
|
||||
@ -1030,9 +1022,6 @@ 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)
|
||||
{
|
||||
@ -1056,7 +1045,6 @@ static PyObject *App_GetThemeTextShadowOutset(PyObject *_self, PyObject *_args)
|
||||
PyMac_BuildRect, &outOutset);
|
||||
return _res;
|
||||
}
|
||||
#endif
|
||||
|
||||
static PyObject *App_DrawThemeScrollBarArrows(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
@ -1658,8 +1646,6 @@ static PyObject *App_GetThemeTextColor(PyObject *_self, PyObject *_args)
|
||||
return _res;
|
||||
}
|
||||
|
||||
#if TARGET_API_MAC_CARBON
|
||||
|
||||
static PyObject *App_GetThemeMetric(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
PyObject *_res = NULL;
|
||||
@ -1679,7 +1665,6 @@ static PyObject *App_GetThemeMetric(PyObject *_self, PyObject *_args)
|
||||
outMetric);
|
||||
return _res;
|
||||
}
|
||||
#endif
|
||||
|
||||
static PyMethodDef App_methods[] = {
|
||||
{"RegisterAppearanceClient", (PyCFunction)App_RegisterAppearanceClient, 1,
|
||||
@ -1754,26 +1739,14 @@ static PyMethodDef App_methods[] = {
|
||||
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,
|
||||
@ -1822,11 +1795,8 @@ static PyMethodDef App_methods[] = {
|
||||
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}
|
||||
};
|
||||
|
||||
|
@ -51,16 +51,6 @@ class MyScanner(Scanner):
|
||||
"appearanceBadCursorIndexErr",
|
||||
]
|
||||
|
||||
def makegreylist(self):
|
||||
return [
|
||||
('#if TARGET_API_MAC_CARBON', [
|
||||
'GetThemeMetric',
|
||||
'GetThemeTextShadowOutset',
|
||||
'GetThemeTextDimensions',
|
||||
'TruncateThemeText',
|
||||
'DrawThemeTextBox',
|
||||
])]
|
||||
|
||||
def makeblacklisttypes(self):
|
||||
return [
|
||||
"MenuTitleDrawingUPP",
|
||||
|
@ -186,44 +186,6 @@ static PyObject *CmpInstObj_SetComponentInstanceStorage(ComponentInstanceObject
|
||||
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;
|
||||
@ -286,16 +248,6 @@ static PyMethodDef CmpInstObj_methods[] = {
|
||||
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,
|
||||
|
@ -59,15 +59,10 @@ class MyScanner(Scanner):
|
||||
"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",
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -94,160 +94,13 @@ class MyScanner(Scanner):
|
||||
# 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',
|
||||
|
@ -132,11 +132,7 @@ static PyObject *CtlObj_WhichControl(ControlHandle);
|
||||
|
||||
#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 */
|
||||
/*
|
||||
@ -769,42 +765,6 @@ f = ManualGenerator("SetControlData_Callback", setcontroldata_callback_body);
|
||||
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 = """\
|
||||
@ -862,7 +822,7 @@ _res = Py_BuildValue("O&",
|
||||
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)
|
||||
|
||||
|
@ -447,8 +447,6 @@ static PyObject *DlgObj_ShortenDITL(DialogObject *_self, PyObject *_args)
|
||||
return _res;
|
||||
}
|
||||
|
||||
#if TARGET_API_MAC_CARBON
|
||||
|
||||
static PyObject *DlgObj_InsertDialogItem(DialogObject *_self, PyObject *_args)
|
||||
{
|
||||
PyObject *_res = NULL;
|
||||
@ -476,9 +474,6 @@ static PyObject *DlgObj_InsertDialogItem(DialogObject *_self, PyObject *_args)
|
||||
_res = Py_None;
|
||||
return _res;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if TARGET_API_MAC_CARBON
|
||||
|
||||
static PyObject *DlgObj_RemoveDialogItems(DialogObject *_self, PyObject *_args)
|
||||
{
|
||||
@ -504,7 +499,6 @@ static PyObject *DlgObj_RemoveDialogItems(DialogObject *_self, PyObject *_args)
|
||||
_res = Py_None;
|
||||
return _res;
|
||||
}
|
||||
#endif
|
||||
|
||||
static PyObject *DlgObj_StdFilterProc(DialogObject *_self, PyObject *_args)
|
||||
{
|
||||
@ -911,16 +905,10 @@ static PyMethodDef DlgObj_methods[] = {
|
||||
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,
|
||||
@ -1390,8 +1378,6 @@ static PyObject *Dlg_ResetAlertStage(PyObject *_self, PyObject *_args)
|
||||
return _res;
|
||||
}
|
||||
|
||||
#if TARGET_API_MAC_CARBON
|
||||
|
||||
static PyObject *Dlg_GetParamText(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
PyObject *_res = NULL;
|
||||
@ -1416,7 +1402,6 @@ static PyObject *Dlg_GetParamText(PyObject *_self, PyObject *_args)
|
||||
_res = Py_None;
|
||||
return _res;
|
||||
}
|
||||
#endif
|
||||
|
||||
static PyObject *Dlg_NewFeaturesDialog(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
@ -1539,11 +1524,8 @@ static PyMethodDef Dlg_methods[] = {
|
||||
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,
|
||||
|
@ -60,16 +60,6 @@ class MyScanner(Scanner):
|
||||
'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
|
||||
|
@ -211,52 +211,6 @@ static PyObject *Evt_PostEvent(PyObject *_self, PyObject *_args)
|
||||
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;
|
||||
@ -276,67 +230,6 @@ static PyObject *Evt_FlushEvents(PyObject *_self, PyObject *_args)
|
||||
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;
|
||||
@ -351,9 +244,6 @@ static PyObject *Evt_GetGlobalMouse(PyObject *_self, PyObject *_args)
|
||||
PyMac_BuildPoint, globalMouse);
|
||||
return _res;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if TARGET_API_MAC_CARBON
|
||||
|
||||
static PyObject *Evt_GetCurrentKeyModifiers(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
@ -369,9 +259,6 @@ 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)
|
||||
{
|
||||
@ -387,7 +274,6 @@ static PyObject *Evt_CheckEventQueueForUserCancel(PyObject *_self, PyObject *_ar
|
||||
_rv);
|
||||
return _res;
|
||||
}
|
||||
#endif
|
||||
|
||||
static PyObject *Evt_KeyScript(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
@ -613,48 +499,14 @@ static PyMethodDef Evt_methods[] = {
|
||||
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,
|
||||
|
@ -36,21 +36,6 @@ class MyScanner(Scanner):
|
||||
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",
|
||||
@ -58,6 +43,12 @@ class MyScanner(Scanner):
|
||||
"WaitNextEvent", # Manually generated because of optional region
|
||||
# Constants with funny definitions
|
||||
"osEvtMessageMask",
|
||||
# OS8 calls
|
||||
'SystemEvent',
|
||||
'SystemTask',
|
||||
'SystemClick',
|
||||
'GetOSEvent',
|
||||
'OSEventAvail',
|
||||
]
|
||||
|
||||
def makeblacklisttypes(self):
|
||||
|
@ -59,23 +59,6 @@ FMRec_Convert(PyObject *v, FMetricRec *p_itself)
|
||||
|
||||
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;
|
||||
@ -132,25 +115,6 @@ static PyObject *Fm_RealFont(PyObject *_self, PyObject *_args)
|
||||
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;
|
||||
@ -295,25 +259,6 @@ static PyObject *Fm_GetPreserveGlyph(PyObject *_self, PyObject *_args)
|
||||
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;
|
||||
@ -366,22 +311,12 @@ static PyObject *Fm_QDTextBounds(PyObject *_self, PyObject *_args)
|
||||
}
|
||||
|
||||
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,
|
||||
@ -400,11 +335,6 @@ static PyMethodDef Fm_methods[] = {
|
||||
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,
|
||||
|
@ -42,14 +42,15 @@ class MyScanner(Scanner):
|
||||
# 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 [
|
||||
|
@ -35,16 +35,6 @@ PERFORMANCE OF THIS SOFTWARE.
|
||||
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>
|
||||
@ -67,79 +57,6 @@ static PyTypeObject Icitype;
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
#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"
|
||||
@ -423,12 +340,6 @@ ici_ICMapTypeCreator(iciobject *self, PyObject *args)
|
||||
|
||||
|
||||
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__},
|
||||
|
@ -606,23 +606,6 @@ static PyObject *Icn_PlotCIconHandle(PyObject *_self, PyObject *_args)
|
||||
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;
|
||||
@ -1338,8 +1321,6 @@ static PyObject *Icn_IsIconRefMaskEmpty(PyObject *_self, PyObject *_args)
|
||||
return _res;
|
||||
}
|
||||
|
||||
#if TARGET_API_MAC_CARBON
|
||||
|
||||
static PyObject *Icn_GetIconRefVariant(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
PyObject *_res = NULL;
|
||||
@ -1362,9 +1343,6 @@ static PyObject *Icn_GetIconRefVariant(PyObject *_self, PyObject *_args)
|
||||
outTransform);
|
||||
return _res;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if TARGET_API_MAC_CARBON
|
||||
|
||||
static PyObject *Icn_RegisterIconRefFromIconFile(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
@ -1391,9 +1369,6 @@ static PyObject *Icn_RegisterIconRefFromIconFile(PyObject *_self, PyObject *_arg
|
||||
ResObj_New, theIconRef);
|
||||
return _res;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if TARGET_API_MAC_CARBON
|
||||
|
||||
static PyObject *Icn_ReadIconFile(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
@ -1414,9 +1389,6 @@ 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)
|
||||
{
|
||||
@ -1438,7 +1410,6 @@ static PyObject *Icn_WriteIconFile(PyObject *_self, PyObject *_args)
|
||||
_res = Py_None;
|
||||
return _res;
|
||||
}
|
||||
#endif
|
||||
|
||||
static PyMethodDef Icn_methods[] = {
|
||||
{"GetCIcon", (PyCFunction)Icn_GetCIcon, 1,
|
||||
@ -1491,11 +1462,6 @@ static PyMethodDef Icn_methods[] = {
|
||||
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,
|
||||
@ -1558,26 +1524,14 @@ static PyMethodDef Icn_methods[] = {
|
||||
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}
|
||||
};
|
||||
|
||||
|
@ -46,20 +46,10 @@ class MyScanner(Scanner):
|
||||
"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",
|
||||
|
@ -64,39 +64,6 @@ extern int _ListObj_Convert(PyObject *, ListHandle *);
|
||||
|
||||
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;
|
||||
|
||||
@ -110,7 +77,6 @@ typedef struct ListObject {
|
||||
PyObject_HEAD
|
||||
ListHandle ob_itself;
|
||||
PyObject *ob_ldef_func;
|
||||
int ob_have_ldef_stub;
|
||||
int ob_must_be_disposed;
|
||||
} ListObject;
|
||||
|
||||
@ -125,7 +91,6 @@ PyObject *ListObj_New(ListHandle itself)
|
||||
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;
|
||||
@ -145,9 +110,6 @@ static void ListObj_dealloc(ListObject *self)
|
||||
{
|
||||
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);
|
||||
@ -901,7 +863,6 @@ static PyObject *List_CreateCustomList(PyObject *_self, PyObject *_args)
|
||||
return NULL;
|
||||
|
||||
|
||||
#if TARGET_API_MAC_CARBON
|
||||
/* Carbon applications use the CreateCustomList API */
|
||||
theSpec.u.userProc = myListDefFunctionUPP;
|
||||
CreateCustomList(&rView,
|
||||
@ -915,33 +876,12 @@ static PyObject *List_CreateCustomList(PyObject *_self, PyObject *_args)
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -83,39 +83,6 @@ extern int _ListObj_Convert(PyObject *, ListHandle *);
|
||||
|
||||
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 + """
|
||||
@ -159,7 +126,6 @@ class MyObjectDefinition(PEP253Mixin, GlobalObjectDefinition):
|
||||
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):
|
||||
@ -171,16 +137,12 @@ class MyObjectDefinition(PEP253Mixin, GlobalObjectDefinition):
|
||||
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)
|
||||
|
||||
@ -285,7 +247,6 @@ if (!PyArg_ParseTuple(_args, "O&O&O&(iO)O&bbbb",
|
||||
return NULL;
|
||||
|
||||
|
||||
#if TARGET_API_MAC_CARBON
|
||||
/* Carbon applications use the CreateCustomList API */
|
||||
theSpec.u.userProc = myListDefFunctionUPP;
|
||||
CreateCustomList(&rView,
|
||||
@ -299,33 +260,12 @@ 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;\
|
||||
"""
|
||||
|
||||
|
@ -244,16 +244,8 @@ struct _inittab _PyImport_Inittab[] = {
|
||||
{"_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},
|
||||
|
@ -382,7 +382,6 @@ _mfs_GetFSSpecFromFSSpec(PyObject *self, FSSpec *fssp)
|
||||
static int
|
||||
_mfs_GetFSSpecFromFSRef(PyObject *self, FSSpec *fssp)
|
||||
{
|
||||
#if !TARGET_API_MAC_OS8
|
||||
static FSRef *fsrp;
|
||||
|
||||
if ( is_mfsrobject(self) ) {
|
||||
@ -390,7 +389,6 @@ _mfs_GetFSSpecFromFSRef(PyObject *self, FSSpec *fssp)
|
||||
if ( FSGetCatalogInfo(&((mfsrobject *)self)->fsref, kFSCatInfoNone, NULL, NULL, fssp, NULL) == noErr )
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -398,12 +396,10 @@ _mfs_GetFSSpecFromFSRef(PyObject *self, FSSpec *fssp)
|
||||
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;
|
||||
}
|
||||
|
||||
@ -411,12 +407,10 @@ _mfs_GetFSRefFromFSRef(PyObject *self, FSRef *fsrp)
|
||||
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;
|
||||
}
|
||||
|
||||
@ -533,10 +527,6 @@ mfss_NewAliasMinimal(mfssobject *self, PyObject *args)
|
||||
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;
|
||||
|
||||
@ -548,7 +538,6 @@ mfss_FSpMakeFSRef(mfssobject *self, PyObject *args)
|
||||
return NULL;
|
||||
}
|
||||
return (PyObject *)newmfsrobject(&fsref);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* XXXX These routines should be replaced by a wrapper to the *FInfo routines */
|
||||
@ -777,7 +766,6 @@ statichere PyTypeObject Mfsstype = {
|
||||
|
||||
/* End of code for FSSpec objects */
|
||||
/* -------------------------------------------------------- */
|
||||
#if !TARGET_API_MAC_OS8
|
||||
static PyObject *
|
||||
mfsr_as_fsspec(mfsrobject *self, PyObject *args)
|
||||
{
|
||||
@ -891,7 +879,6 @@ statichere PyTypeObject Mfsrtype = {
|
||||
};
|
||||
|
||||
/* End of code for FSRef objects */
|
||||
#endif /* !TARGET_API_MAC_OS8 */
|
||||
/* -------------------------------------------------------- */
|
||||
|
||||
static PyObject *
|
||||
@ -911,91 +898,6 @@ mfs_ResolveAliasFile(PyObject *self, PyObject *args)
|
||||
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)
|
||||
{
|
||||
@ -1009,16 +911,11 @@ 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 *
|
||||
@ -1056,22 +953,6 @@ mfs_RawAlias(PyObject *self, PyObject *args)
|
||||
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)
|
||||
{
|
||||
@ -1143,13 +1024,6 @@ mfs_NewAliasMinimalFromFullPath(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},
|
||||
@ -1170,10 +1044,6 @@ static struct PyMethodDef mfs_methods[] = {
|
||||
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;
|
||||
@ -1195,17 +1065,12 @@ PyMac_GetFSRef(PyObject *v, FSRef *fsr)
|
||||
}
|
||||
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
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -32,11 +32,6 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
#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
|
||||
@ -49,9 +44,6 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
#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
|
||||
@ -239,24 +231,6 @@ mac_fdopen(self, args)
|
||||
}
|
||||
#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;
|
||||
@ -471,38 +445,12 @@ static PyStructSequence_Desc stat_result_desc = {
|
||||
|
||||
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));
|
||||
@ -516,26 +464,12 @@ _pystat_from_struct_stat(struct stat st, void* _mst)
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@ -579,38 +513,6 @@ mac_fstat(self, args)
|
||||
}
|
||||
#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;
|
||||
@ -683,9 +585,6 @@ static struct PyMethodDef mac_methods[] = {
|
||||
#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},
|
||||
@ -696,9 +595,6 @@ static struct PyMethodDef mac_methods[] = {
|
||||
{"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},
|
||||
@ -823,8 +719,4 @@ initmac()
|
||||
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
|
||||
}
|
||||
|
@ -348,49 +348,6 @@ MacOS_SetCreatorAndType(PyObject *self, PyObject *args)
|
||||
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";
|
||||
|
||||
@ -701,9 +658,6 @@ MacOS_OutputSeen(PyObject *self, PyObject *args)
|
||||
#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
|
||||
@ -759,8 +713,6 @@ initMacOS(void)
|
||||
}
|
||||
#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
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,9 +1,3 @@
|
||||
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)
|
||||
|
||||
@ -67,7 +61,6 @@ functions.append(f)
|
||||
f = Function(ItemCount, 'CountMenuItemsWithCommandID',
|
||||
(OptMenuRef, 'inMenu', InMode),
|
||||
(MenuCommand, 'inCommandID', InMode),
|
||||
condition='#if TARGET_API_MAC_CARBON',
|
||||
)
|
||||
functions.append(f)
|
||||
|
||||
@ -77,28 +70,24 @@ f = Function(OSStatus, 'GetIndMenuItemWithCommandID',
|
||||
(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)
|
||||
|
||||
@ -106,7 +95,6 @@ f = Function(OSStatus, 'SetMenuCommandMark',
|
||||
(OptMenuRef, 'inMenu', InMode),
|
||||
(MenuCommand, 'inCommandID', InMode),
|
||||
(UniChar, 'inMark', InMode),
|
||||
condition='#if TARGET_API_MAC_CARBON',
|
||||
)
|
||||
functions.append(f)
|
||||
|
||||
@ -114,7 +102,6 @@ f = Function(OSStatus, 'GetMenuCommandMark',
|
||||
(OptMenuRef, 'inMenu', InMode),
|
||||
(MenuCommand, 'inCommandID', InMode),
|
||||
(UniChar, 'outMark', OutMode),
|
||||
condition='#if TARGET_API_MAC_CARBON',
|
||||
)
|
||||
functions.append(f)
|
||||
|
||||
@ -124,7 +111,6 @@ f = Function(OSStatus, 'GetMenuCommandPropertySize',
|
||||
(OSType, 'inPropertyCreator', InMode),
|
||||
(OSType, 'inPropertyTag', InMode),
|
||||
(ByteCount, 'outSize', OutMode),
|
||||
condition='#if TARGET_API_MAC_CARBON',
|
||||
)
|
||||
functions.append(f)
|
||||
|
||||
@ -133,7 +119,6 @@ f = Function(OSStatus, 'RemoveMenuCommandProperty',
|
||||
(MenuCommand, 'inCommandID', InMode),
|
||||
(OSType, 'inPropertyCreator', InMode),
|
||||
(OSType, 'inPropertyTag', InMode),
|
||||
condition='#if TARGET_API_MAC_CARBON',
|
||||
)
|
||||
functions.append(f)
|
||||
|
||||
|
@ -44,80 +44,21 @@ class MyScanner(Scanner):
|
||||
"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',
|
||||
|
@ -245,27 +245,6 @@ static PyObject *TXNObj_TXNClick(TXNObjectObject *_self, PyObject *_args)
|
||||
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;
|
||||
@ -1193,11 +1172,6 @@ static PyMethodDef TXNObj_methods[] = {
|
||||
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,
|
||||
|
@ -78,12 +78,12 @@ kTXNFontSizeAttributeSize = 4
|
||||
"kTXNFontSizeAttributeSize",
|
||||
"status",
|
||||
"justification",
|
||||
'TXNTSMCheck', # OS8
|
||||
]
|
||||
|
||||
def makegreylist(self):
|
||||
return [
|
||||
('#if TARGET_API_MAC_OS8', [
|
||||
'TXNTSMCheck',
|
||||
])]
|
||||
|
||||
|
||||
|
@ -105,12 +105,6 @@ extern int _QdRGB_Convert(PyObject *, RGBColorPtr);
|
||||
|
||||
#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);
|
||||
|
||||
/*
|
||||
@ -219,8 +213,6 @@ static PyObject *GrafObj_MacSetPort(GrafPortObject *_self, PyObject *_args)
|
||||
return _res;
|
||||
}
|
||||
|
||||
#if TARGET_API_MAC_CARBON
|
||||
|
||||
static PyObject *GrafObj_IsValidPort(GrafPortObject *_self, PyObject *_args)
|
||||
{
|
||||
PyObject *_res = NULL;
|
||||
@ -235,7 +227,6 @@ static PyObject *GrafObj_IsValidPort(GrafPortObject *_self, PyObject *_args)
|
||||
_rv);
|
||||
return _res;
|
||||
}
|
||||
#endif
|
||||
|
||||
static PyObject *GrafObj_GetPortPixMap(GrafPortObject *_self, PyObject *_args)
|
||||
{
|
||||
@ -636,8 +627,6 @@ static PyObject *GrafObj_IsPortPictureBeingDefined(GrafPortObject *_self, PyObje
|
||||
return _res;
|
||||
}
|
||||
|
||||
#if TARGET_API_MAC_CARBON
|
||||
|
||||
static PyObject *GrafObj_IsPortPolyBeingDefined(GrafPortObject *_self, PyObject *_args)
|
||||
{
|
||||
PyObject *_res = NULL;
|
||||
@ -652,9 +641,6 @@ static PyObject *GrafObj_IsPortPolyBeingDefined(GrafPortObject *_self, PyObject
|
||||
_rv);
|
||||
return _res;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if TARGET_API_MAC_CARBON
|
||||
|
||||
static PyObject *GrafObj_IsPortOffscreen(GrafPortObject *_self, PyObject *_args)
|
||||
{
|
||||
@ -670,9 +656,6 @@ 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)
|
||||
{
|
||||
@ -688,7 +671,6 @@ static PyObject *GrafObj_IsPortColor(GrafPortObject *_self, PyObject *_args)
|
||||
_rv);
|
||||
return _res;
|
||||
}
|
||||
#endif
|
||||
|
||||
static PyObject *GrafObj_SetPortBounds(GrafPortObject *_self, PyObject *_args)
|
||||
{
|
||||
@ -860,8 +842,6 @@ static PyObject *GrafObj_SetPortFracHPenLocation(GrafPortObject *_self, PyObject
|
||||
return _res;
|
||||
}
|
||||
|
||||
#if TARGET_API_MAC_CARBON
|
||||
|
||||
static PyObject *GrafObj_DisposePort(GrafPortObject *_self, PyObject *_args)
|
||||
{
|
||||
PyObject *_res = NULL;
|
||||
@ -875,7 +855,6 @@ static PyObject *GrafObj_DisposePort(GrafPortObject *_self, PyObject *_args)
|
||||
_res = Py_None;
|
||||
return _res;
|
||||
}
|
||||
#endif
|
||||
|
||||
static PyObject *GrafObj_QDIsPortBuffered(GrafPortObject *_self, PyObject *_args)
|
||||
{
|
||||
@ -924,8 +903,6 @@ static PyObject *GrafObj_QDFlushPortBuffer(GrafPortObject *_self, PyObject *_arg
|
||||
return _res;
|
||||
}
|
||||
|
||||
#if TARGET_API_MAC_CARBON
|
||||
|
||||
static PyObject *GrafObj_QDGetDirtyRegion(GrafPortObject *_self, PyObject *_args)
|
||||
{
|
||||
PyObject *_res = NULL;
|
||||
@ -944,9 +921,6 @@ static PyObject *GrafObj_QDGetDirtyRegion(GrafPortObject *_self, PyObject *_args
|
||||
_res = Py_None;
|
||||
return _res;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if TARGET_API_MAC_CARBON
|
||||
|
||||
static PyObject *GrafObj_QDSetDirtyRegion(GrafPortObject *_self, PyObject *_args)
|
||||
{
|
||||
@ -966,16 +940,12 @@ 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,
|
||||
@ -1026,21 +996,12 @@ static PyMethodDef GrafObj_methods[] = {
|
||||
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,
|
||||
@ -1061,27 +1022,18 @@ static PyMethodDef GrafObj_methods[] = {
|
||||
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}
|
||||
};
|
||||
|
||||
@ -2548,8 +2500,6 @@ static PyObject *Qd_BitMapToRegion(PyObject *_self, PyObject *_args)
|
||||
return _res;
|
||||
}
|
||||
|
||||
#if TARGET_API_MAC_CARBON
|
||||
|
||||
static PyObject *Qd_RgnToHandle(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
PyObject *_res = NULL;
|
||||
@ -2568,7 +2518,6 @@ static PyObject *Qd_RgnToHandle(PyObject *_self, PyObject *_args)
|
||||
_res = Py_None;
|
||||
return _res;
|
||||
}
|
||||
#endif
|
||||
|
||||
static PyObject *Qd_DisposeRgn(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
@ -5005,8 +4954,6 @@ static PyObject *Qd_GetRegionBounds(PyObject *_self, PyObject *_args)
|
||||
return _res;
|
||||
}
|
||||
|
||||
#if TARGET_API_MAC_CARBON
|
||||
|
||||
static PyObject *Qd_IsRegionRectangular(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
PyObject *_res = NULL;
|
||||
@ -5023,9 +4970,6 @@ static PyObject *Qd_IsRegionRectangular(PyObject *_self, PyObject *_args)
|
||||
_rv);
|
||||
return _res;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if TARGET_API_MAC_CARBON
|
||||
|
||||
static PyObject *Qd_CreateNewPort(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
@ -5041,9 +4985,6 @@ 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)
|
||||
{
|
||||
@ -5060,7 +5001,6 @@ static PyObject *Qd_SetQDError(PyObject *_self, PyObject *_args)
|
||||
_res = Py_None;
|
||||
return _res;
|
||||
}
|
||||
#endif
|
||||
|
||||
static PyObject *Qd_LMGetScrVRes(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
@ -6456,11 +6396,8 @@ static PyMethodDef Qd_methods[] = {
|
||||
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,
|
||||
@ -6723,21 +6660,12 @@ static PyMethodDef Qd_methods[] = {
|
||||
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,
|
||||
|
@ -118,25 +118,6 @@ extend = 0x40
|
||||
'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
|
||||
|
@ -151,12 +151,6 @@ extern int _QdRGB_Convert(PyObject *, RGBColorPtr);
|
||||
|
||||
#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);
|
||||
|
||||
/*
|
||||
|
@ -6276,58 +6276,6 @@ static PyObject *MovieObj_GetMovieDefaultDataRef(MovieObject *_self, PyObject *_
|
||||
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;
|
||||
@ -6534,24 +6482,6 @@ static PyObject *MovieObj_GetMovieStatus(MovieObject *_self, PyObject *_args)
|
||||
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;
|
||||
@ -6859,16 +6789,6 @@ static PyMethodDef MovieObj_methods[] = {
|
||||
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,
|
||||
@ -6887,11 +6807,6 @@ static PyMethodDef MovieObj_methods[] = {
|
||||
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,
|
||||
@ -6981,28 +6896,6 @@ PyTypeObject Movie_Type = {
|
||||
/* --------------------- 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;
|
||||
@ -7135,44 +7028,6 @@ static PyObject *Qt_GetDataHandler(PyObject *_self, PyObject *_args)
|
||||
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;
|
||||
@ -8846,35 +8701,6 @@ static PyObject *Qt_SpriteMediaGetActionVariable(PyObject *_self, PyObject *_arg
|
||||
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;
|
||||
@ -9258,151 +9084,6 @@ static PyObject *Qt_FlashMediaGetSupportedSwfVersion(PyObject *_self, PyObject *
|
||||
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;
|
||||
@ -9636,29 +9317,6 @@ static PyObject *Qt_Media3DGetCameraRange(PyObject *_self, PyObject *_args)
|
||||
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;
|
||||
@ -9834,11 +9492,6 @@ static PyObject *Qt_MoviesTask(PyObject *_self, PyObject *_args)
|
||||
}
|
||||
|
||||
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,
|
||||
@ -9855,11 +9508,6 @@ static PyMethodDef Qt_methods[] = {
|
||||
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,
|
||||
@ -9988,11 +9636,6 @@ static PyMethodDef Qt_methods[] = {
|
||||
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,
|
||||
@ -10025,31 +9668,6 @@ static PyMethodDef Qt_methods[] = {
|
||||
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,
|
||||
@ -10070,11 +9688,6 @@ static PyMethodDef Qt_methods[] = {
|
||||
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,
|
||||
|
@ -62,24 +62,21 @@ class MyScanner(Scanner):
|
||||
"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 [
|
||||
|
@ -311,28 +311,6 @@ static PyObject *ResObj_GetMaxResourceSize(ResourceObject *_self, PyObject *_arg
|
||||
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;
|
||||
@ -523,11 +501,6 @@ static PyMethodDef ResObj_methods[] = {
|
||||
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,
|
||||
@ -702,49 +675,6 @@ PyTypeObject Resource_Type = {
|
||||
/* -------------------- 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;
|
||||
@ -800,53 +730,6 @@ static PyObject *Res_CurResFile(PyObject *_self, PyObject *_args)
|
||||
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;
|
||||
@ -1308,33 +1191,6 @@ static PyObject *Res_OpenRFPerm(PyObject *_self, PyObject *_args)
|
||||
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;
|
||||
@ -1444,8 +1300,6 @@ static PyObject *Res_FSpCreateResFile(PyObject *_self, PyObject *_args)
|
||||
return _res;
|
||||
}
|
||||
|
||||
#if TARGET_API_MAC_CARBON
|
||||
|
||||
static PyObject *Res_InsertResourceFile(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
PyObject *_res = NULL;
|
||||
@ -1466,9 +1320,6 @@ static PyObject *Res_InsertResourceFile(PyObject *_self, PyObject *_args)
|
||||
_res = Py_None;
|
||||
return _res;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if TARGET_API_MAC_CARBON
|
||||
|
||||
static PyObject *Res_DetachResourceFile(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
@ -1487,9 +1338,6 @@ 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)
|
||||
{
|
||||
@ -1517,9 +1365,6 @@ 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)
|
||||
{
|
||||
@ -1543,9 +1388,6 @@ 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)
|
||||
{
|
||||
@ -1563,9 +1405,6 @@ 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)
|
||||
{
|
||||
@ -1586,7 +1425,6 @@ static PyObject *Res_GetNextResourceFile(PyObject *_self, PyObject *_args)
|
||||
nextRefNum);
|
||||
return _res;
|
||||
}
|
||||
#endif
|
||||
|
||||
static PyObject *Res_FSOpenResFile(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
@ -1672,8 +1510,6 @@ static PyObject *Res_FSResourceFileAlreadyOpen(PyObject *_self, PyObject *_args)
|
||||
return _res;
|
||||
}
|
||||
|
||||
#if TARGET_API_MAC_CARBON
|
||||
|
||||
static PyObject *Res_FSCreateResourceFile(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
PyObject *_res = NULL;
|
||||
@ -1710,9 +1546,6 @@ static PyObject *Res_FSCreateResourceFile(PyObject *_self, PyObject *_args)
|
||||
PyMac_BuildFSSpec, &newSpec);
|
||||
return _res;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if TARGET_API_MAC_CARBON
|
||||
|
||||
static PyObject *Res_FSOpenResourceFile(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
@ -1742,7 +1575,6 @@ static PyObject *Res_FSOpenResourceFile(PyObject *_self, PyObject *_args)
|
||||
refNum);
|
||||
return _res;
|
||||
}
|
||||
#endif
|
||||
|
||||
static PyObject *Res_Handle(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
@ -1771,32 +1603,12 @@ 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,
|
||||
@ -1839,11 +1651,6 @@ static PyMethodDef Res_methods[] = {
|
||||
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,
|
||||
@ -1852,52 +1659,28 @@ static PyMethodDef Res_methods[] = {
|
||||
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}
|
||||
|
@ -45,33 +45,19 @@ class ResourcesScanner(Scanner):
|
||||
## "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")],
|
||||
|
@ -29,25 +29,8 @@
|
||||
#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;
|
||||
@ -280,7 +263,6 @@ PyTypeObject Scrap_Type = {
|
||||
};
|
||||
|
||||
/* --------------------- End object type Scrap ---------------------- */
|
||||
#endif /* !TARGET_API_MAC_OS8 */
|
||||
|
||||
static PyObject *Scrap_LoadScrap(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
@ -308,79 +290,6 @@ static PyObject *Scrap_UnloadScrap(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;
|
||||
@ -420,33 +329,18 @@ static PyObject *Scrap_CallInScrapPromises(PyObject *_self, PyObject *_args)
|
||||
_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}
|
||||
};
|
||||
|
||||
@ -467,12 +361,10 @@ void init_Scrap(void)
|
||||
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 ======================== */
|
||||
|
@ -40,21 +40,12 @@ class MyScanner(Scanner):
|
||||
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',
|
||||
|
@ -27,15 +27,6 @@
|
||||
#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)
|
||||
@ -54,9 +45,6 @@ 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;
|
||||
|
||||
@ -147,72 +135,6 @@ static PyObject *SndCh_SndPlay(SndChannelObject *_self, PyObject *_args)
|
||||
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;
|
||||
@ -276,21 +198,6 @@ static PyMethodDef SndCh_methods[] = {
|
||||
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,
|
||||
@ -579,26 +486,6 @@ static PyObject *Snd_SndNewChannel(PyObject *_self, PyObject *_args)
|
||||
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;
|
||||
@ -655,201 +542,6 @@ static PyObject *Snd_SndSetSysBeepState(PyObject *_self, PyObject *_args)
|
||||
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;
|
||||
@ -1041,31 +733,6 @@ static PyObject *Snd_SndRecord(PyObject *_self, PyObject *_args)
|
||||
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;
|
||||
@ -1172,30 +839,6 @@ static PyObject *Snd_SPBRecord(PyObject *_self, PyObject *_args)
|
||||
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;
|
||||
@ -1356,11 +999,6 @@ static PyMethodDef Snd_methods[] = {
|
||||
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,
|
||||
@ -1369,31 +1007,6 @@ static PyMethodDef Snd_methods[] = {
|
||||
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,
|
||||
@ -1416,11 +1029,6 @@ static PyMethodDef Snd_methods[] = {
|
||||
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,
|
||||
@ -1433,11 +1041,6 @@ static PyMethodDef Snd_methods[] = {
|
||||
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,
|
||||
@ -1521,20 +1124,6 @@ SPB_completion(SPBPtr my_spb)
|
||||
}
|
||||
}
|
||||
|
||||
#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)
|
||||
|
@ -49,25 +49,21 @@ class SoundScanner(Scanner):
|
||||
'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",
|
||||
|
@ -96,15 +96,6 @@ SMStatus = StructOutputBufferType('SMStatus')
|
||||
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)
|
||||
@ -123,9 +114,6 @@ 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
|
||||
"""
|
||||
|
||||
|
||||
@ -192,20 +180,6 @@ SPB_completion(SPBPtr my_spb)
|
||||
}
|
||||
}
|
||||
|
||||
#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
|
||||
"""
|
||||
|
||||
|
||||
|
@ -1197,8 +1197,6 @@ static PyObject *TE_TEToScrap(PyObject *_self, PyObject *_args)
|
||||
return _res;
|
||||
}
|
||||
|
||||
#if TARGET_API_MAC_CARBON
|
||||
|
||||
static PyObject *TE_TEGetScrapHandle(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
PyObject *_res = NULL;
|
||||
@ -1213,9 +1211,6 @@ static PyObject *TE_TEGetScrapHandle(PyObject *_self, PyObject *_args)
|
||||
ResObj_New, _rv);
|
||||
return _res;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if TARGET_API_MAC_CARBON
|
||||
|
||||
static PyObject *TE_TESetScrapHandle(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
@ -1232,7 +1227,6 @@ static PyObject *TE_TESetScrapHandle(PyObject *_self, PyObject *_args)
|
||||
_res = Py_None;
|
||||
return _res;
|
||||
}
|
||||
#endif
|
||||
|
||||
static PyObject *TE_LMGetWordRedraw(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
@ -1299,16 +1293,10 @@ static PyMethodDef TE_methods[] = {
|
||||
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,
|
||||
|
@ -43,13 +43,6 @@ class MyScanner(Scanner):
|
||||
## "TEGetHiliteRgn",
|
||||
]
|
||||
|
||||
def makegreylist(self):
|
||||
return [
|
||||
('#if TARGET_API_MAC_CARBON', [
|
||||
'TEGetScrapHandle',
|
||||
'TESetScrapHandle',
|
||||
])]
|
||||
|
||||
def makeblacklisttypes(self):
|
||||
return [
|
||||
"TEClickLoopUPP",
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -6,12 +6,6 @@ f = Method(Boolean, 'IsWindowVisible',
|
||||
)
|
||||
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),
|
||||
@ -30,25 +24,11 @@ f = Method(void, 'GetWindowUpdateRgn',
|
||||
)
|
||||
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),
|
||||
|
@ -49,62 +49,30 @@ class MyScanner(Scanner):
|
||||
# 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',
|
||||
])]
|
||||
|
@ -54,11 +54,7 @@ typedef unsigned long refcontype;
|
||||
#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];
|
||||
@ -79,8 +75,6 @@ strdup(const char *src)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if !TARGET_API_MAC_OSX
|
||||
/* Initialize FSSpec and full name of current application */
|
||||
|
||||
OSErr
|
||||
@ -104,7 +98,6 @@ PyMac_init_process_location(void)
|
||||
applocation_inited = 1;
|
||||
return 0;
|
||||
}
|
||||
#endif /* !TARGET_API_MAC_OSX */
|
||||
|
||||
/* Check that there aren't any args remaining in the event */
|
||||
|
||||
@ -229,9 +222,6 @@ event_loop(void)
|
||||
|
||||
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);
|
||||
@ -245,13 +235,8 @@ int
|
||||
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();
|
||||
|
@ -47,13 +47,7 @@ PERFORMANCE OF THIS SOFTWARE.
|
||||
#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
|
||||
|
@ -38,11 +38,7 @@ PERFORMANCE OF THIS SOFTWARE.
|
||||
#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.
|
||||
|
@ -51,11 +51,6 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
#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);
|
||||
@ -85,7 +80,6 @@ extern pascal char *PLstrrchr(const unsigned char *, short);
|
||||
#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
|
||||
@ -93,7 +87,6 @@ extern pascal char *PLstrrchr(const unsigned char *, short);
|
||||
** stack limit of 512K.
|
||||
*/
|
||||
#define MAXIMUM_STACK_SIZE (256*1024)
|
||||
#endif
|
||||
|
||||
/*
|
||||
** We have to be careful, since we can't handle
|
||||
@ -147,23 +140,6 @@ int PyMac_ConsoleIsDead;
|
||||
*/
|
||||
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
|
||||
*/
|
||||
@ -256,48 +232,6 @@ PyMac_StopGUSISpin() {
|
||||
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 */
|
||||
|
||||
|
||||
@ -316,29 +250,6 @@ Pstring(char *str)
|
||||
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 */
|
||||
@ -420,35 +331,17 @@ static void
|
||||
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;
|
||||
@ -457,7 +350,7 @@ PyErr_CheckSignals()
|
||||
}
|
||||
if ( PyMac_Yield() < 0)
|
||||
return -1;
|
||||
schedparams.next_check = (unsigned long)LMGetTicks()
|
||||
schedparams.next_check = (unsigned long)TickCount()
|
||||
+ schedparams.check_interval;
|
||||
}
|
||||
}
|
||||
@ -498,16 +391,6 @@ void
|
||||
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;
|
||||
@ -568,14 +451,10 @@ PyMac_DoYield(int maxsleep, int maycallpython)
|
||||
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
|
||||
@ -590,7 +469,7 @@ PyMac_DoYield(int maxsleep, int maycallpython)
|
||||
in_here--;
|
||||
return -1;
|
||||
}
|
||||
maxsleep = latest_time_ready - LMGetTicks();
|
||||
maxsleep = latest_time_ready - TickCount();
|
||||
} while ( maxsleep > 0 );
|
||||
}
|
||||
in_here--;
|
||||
@ -730,82 +609,3 @@ SIOUXDoAboutBox(void)
|
||||
}
|
||||
|
||||
#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 */
|
||||
|
||||
|
||||
|
@ -38,13 +38,11 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
#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
|
||||
@ -94,16 +92,6 @@ void PyMac_Exit(int); /* Forward */
|
||||
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();
|
||||
}
|
||||
|
||||
@ -176,12 +164,6 @@ PyMac_InteractiveOptions(PyMac_PrefRecord *p, int *argcp, char ***argvp)
|
||||
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;
|
||||
@ -202,7 +184,6 @@ PyMac_InteractiveOptions(PyMac_PrefRecord *p, int *argcp, char ***argvp)
|
||||
|
||||
/* 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; \
|
||||
@ -279,9 +260,7 @@ init_common(int *argcp, char ***argvp, int embedded)
|
||||
/* 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};
|
||||
@ -293,11 +272,7 @@ init_common(int *argcp, char ***argvp, int embedded)
|
||||
** 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
|
||||
@ -310,7 +285,6 @@ init_common(int *argcp, char ***argvp, int embedded)
|
||||
if ( p ) *p = 0;
|
||||
chdir(app_wd);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
/* Do interactive option setting, if allowed and <option> depressed */
|
||||
PyMac_InteractiveOptions(&PyMac_options, argcp, argvp);
|
||||
@ -324,7 +298,6 @@ init_common(int *argcp, char ***argvp, int embedded)
|
||||
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;
|
||||
@ -334,7 +307,6 @@ init_common(int *argcp, char ***argvp, int embedded)
|
||||
/* Should we disable command-dot as well? */
|
||||
PyMac_SetSchedParams(&scp);
|
||||
}
|
||||
#endif /* !TARGET_API_MAC_OSX */
|
||||
|
||||
/* Set buffering */
|
||||
if (PyMac_options.unbuffered) {
|
||||
@ -446,103 +418,6 @@ PyMac_Initialize(void)
|
||||
|
||||
#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)
|
||||
@ -556,12 +431,6 @@ 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;
|
||||
@ -582,7 +451,6 @@ PyMac_InitApplication(void)
|
||||
}
|
||||
PyMac_Main(argc, argv, script);
|
||||
}
|
||||
#endif /* TARGET_API_MAC_OSX */
|
||||
|
||||
/* Main program */
|
||||
|
||||
@ -605,11 +473,7 @@ PyMac_Main(int argc, char **argv, char *filename)
|
||||
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) {
|
||||
@ -620,10 +484,8 @@ PyMac_Main(int argc, char **argv, char *filename)
|
||||
}
|
||||
}
|
||||
|
||||
#if !TARGET_API_MAC_OSX
|
||||
/* We initialize the menubar here, hoping SIOUX is initialized by now */
|
||||
PyMac_InitMenuBar();
|
||||
#endif
|
||||
|
||||
Py_Initialize();
|
||||
|
||||
@ -651,7 +513,6 @@ PyMac_Main(int argc, char **argv, char *filename)
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
|
||||
#if !TARGET_API_MAC_OSX
|
||||
/*
|
||||
** Reset the "unseen output" flag
|
||||
*/
|
||||
@ -683,7 +544,6 @@ abort(void)
|
||||
console_output_state = STATE_LASTWRITE;
|
||||
PyMac_Exit(1);
|
||||
}
|
||||
#endif /* !TARGET_API_MAC_OSX */
|
||||
|
||||
/*
|
||||
** Terminate application
|
||||
@ -739,7 +599,6 @@ PyMac_Exit(int status)
|
||||
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. */
|
||||
|
||||
@ -749,10 +608,8 @@ Py_GetArgcArgv(int *argc,char ***argv)
|
||||
*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)
|
||||
@ -796,5 +653,4 @@ __convert_to_newlines(unsigned char * buf, size_t * n_ptr)
|
||||
*p = '\r';
|
||||
}
|
||||
#endif /* WITHOUT_UNIX_NEWLINES */
|
||||
#endif /* !TARGET_API_MAC_OSX */
|
||||
|
||||
|
@ -174,19 +174,6 @@ int GUSISIOUXSocket::isatty()
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user