本文整理汇总了C++中PyMac_Error函数的典型用法代码示例。如果您正苦于以下问题:C++ PyMac_Error函数的具体用法?C++ PyMac_Error怎么用?C++ PyMac_Error使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PyMac_Error函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetMenuBarFromNib
static PyObject *IBNibRefObj_SetMenuBarFromNib(IBNibRefObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
CFStringRef inName;
if (!PyArg_ParseTuple(_args, "O&",
CFStringRefObj_Convert, &inName))
return NULL;
_err = SetMenuBarFromNib(_self->ob_itself,
inName);
if (_err != noErr) return PyMac_Error(_err);
Py_INCREF(Py_None);
_res = Py_None;
return _res;
}
示例2: PyMac_PRECHECK
static PyObject *AE_AEObjectInit(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
#ifndef AEObjectInit
PyMac_PRECHECK(AEObjectInit);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_err = AEObjectInit();
if (_err != noErr) return PyMac_Error(_err);
Py_INCREF(Py_None);
_res = Py_None;
return _res;
}
示例3: PyMac_PRECHECK
static PyObject *DragObj_DragPostScroll(DragObjObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
#ifndef DragPostScroll
PyMac_PRECHECK(DragPostScroll);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_err = DragPostScroll(_self->ob_itself);
if (_err != noErr) return PyMac_Error(_err);
Py_INCREF(Py_None);
_res = Py_None;
return _res;
}
示例4: PyMac_PRECHECK
static PyObject *Res_ResError(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
#ifndef ResError
PyMac_PRECHECK(ResError);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_err = ResError();
if (_err != noErr) return PyMac_Error(_err);
Py_INCREF(Py_None);
_res = Py_None;
return _res;
}
示例5: SndDoImmediate
static PyObject *SndCh_SndDoImmediate(SndChannelObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
SndCommand cmd;
if (!PyArg_ParseTuple(_args, "O&",
SndCmd_Convert, &cmd))
return NULL;
_err = SndDoImmediate(_self->ob_itself,
&cmd);
if (_err != noErr) return PyMac_Error(_err);
Py_INCREF(Py_None);
_res = Py_None;
return _res;
}
示例6: newiciobject
static iciobject *
newiciobject(OSType creator)
{
iciobject *self;
OSStatus err;
self = PyObject_NEW(iciobject, &Icitype);
if (self == NULL)
return NULL;
if ((err=ICStart(&self->inst, creator)) != 0 ) {
(void)PyMac_Error(err);
PyObject_DEL(self);
return NULL;
}
return self;
}
示例7: CreateNibReference
static PyObject *IBCarbon_CreateNibReference(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
CFStringRef inNibName;
IBNibRef outNibRef;
if (!PyArg_ParseTuple(_args, "O&",
CFStringRefObj_Convert, &inNibName))
return NULL;
_err = CreateNibReference(inNibName,
&outNibRef);
if (_err != noErr) return PyMac_Error(_err);
_res = Py_BuildValue("O&",
IBNibRefObj_New, outNibRef);
return _res;
}
示例8: LSCopyDisplayNameForURL
static PyObject *Launch_LSCopyDisplayNameForURL(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSStatus _err;
CFURLRef inURL;
CFStringRef outDisplayName;
if (!PyArg_ParseTuple(_args, "O&",
CFURLRefObj_Convert, &inURL))
return NULL;
_err = LSCopyDisplayNameForURL(inURL,
&outDisplayName);
if (_err != noErr) return PyMac_Error(_err);
_res = Py_BuildValue("O&",
CFStringRefObj_New, outDisplayName);
return _res;
}
示例9: PyMac_PRECHECK
static PyObject *Icn_NewIconSuite(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
IconSuiteRef theIconSuite;
#ifndef NewIconSuite
PyMac_PRECHECK(NewIconSuite);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_err = NewIconSuite(&theIconSuite);
if (_err != noErr) return PyMac_Error(_err);
_res = Py_BuildValue("O&",
ResObj_New, theIconSuite);
return _res;
}
示例10: SPBBytesToMilliseconds
static PyObject *Snd_SPBBytesToMilliseconds(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
long inRefNum;
long byteCount;
if (!PyArg_ParseTuple(_args, "l",
&inRefNum))
return NULL;
_err = SPBBytesToMilliseconds(inRefNum,
&byteCount);
if (_err != noErr) return PyMac_Error(_err);
_res = Py_BuildValue("l",
byteCount);
return _res;
}
示例11: GetCompressionName
static PyObject *Snd_GetCompressionName(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
OSType compressionType;
Str255 compressionName;
if (!PyArg_ParseTuple(_args, "O&",
PyMac_GetOSType, &compressionType))
return NULL;
_err = GetCompressionName(compressionType,
compressionName);
if (_err != noErr) return PyMac_Error(_err);
_res = Py_BuildValue("O&",
PyMac_BuildStr255, compressionName);
return _res;
}
示例12: GetSoundHeaderOffset
static PyObject *Snd_GetSoundHeaderOffset(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
SndListHandle sndHandle;
long offset;
if (!PyArg_ParseTuple(_args, "O&",
ResObj_Convert, &sndHandle))
return NULL;
_err = GetSoundHeaderOffset(sndHandle,
&offset);
if (_err != noErr) return PyMac_Error(_err);
_res = Py_BuildValue("l",
offset);
return _res;
}
示例13: SndManagerStatus
static PyObject *Snd_SndManagerStatus(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
short theLength;
SMStatus theStatus__out__;
if (!PyArg_ParseTuple(_args, "h",
&theLength))
return NULL;
_err = SndManagerStatus(theLength,
&theStatus__out__);
if (_err != noErr) return PyMac_Error(_err);
_res = Py_BuildValue("s#",
(char *)&theStatus__out__, (int)sizeof(SMStatus));
return _res;
}
示例14: RemoveReceiveHandler
static PyObject *Drag_RemoveReceiveHandler(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
WindowPtr theWindow = NULL;
OSErr _err;
if ( !PyArg_ParseTuple(_args, "|O&", WinObj_Convert, &theWindow) )
return NULL;
_err = RemoveReceiveHandler(dragglue_ReceiveHandlerUPP, theWindow);
if (_err != noErr) return PyMac_Error(_err);
Py_INCREF(Py_None);
_res = Py_None;
return _res;
}
示例15: PyMac_PRECHECK
static PyObject *AE_AEGetInteractionAllowed(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
AEInteractAllowed level;
#ifndef AEGetInteractionAllowed
PyMac_PRECHECK(AEGetInteractionAllowed);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_err = AEGetInteractionAllowed(&level);
if (_err != noErr) return PyMac_Error(_err);
_res = Py_BuildValue("b",
level);
return _res;
}