mirror of
https://github.com/python/cpython.git
synced 2025-11-12 15:09:14 +00:00
Revived the Carbon.Help module, but implementing the MacHelp API in stead
of the defunct Balloons API. Help tags are TBD, but at least this gives us access to the help menu.
This commit is contained in:
parent
d94c28e467
commit
983258ed7e
6 changed files with 152 additions and 269 deletions
|
|
@ -1,66 +0,0 @@
|
||||||
# Generated from 'Balloons.h'
|
|
||||||
|
|
||||||
def FOUR_CHAR_CODE(x): return x
|
|
||||||
kTopLeftTipPointsLeftVariant = 0
|
|
||||||
kTopLeftTipPointsUpVariant = 1
|
|
||||||
kTopRightTipPointsUpVariant = 2
|
|
||||||
kTopRightTipPointsRightVariant = 3
|
|
||||||
kBottomRightTipPointsRightVariant = 4
|
|
||||||
kBottomRightTipPointsDownVariant = 5
|
|
||||||
kBottomLeftTipPointsDownVariant = 6
|
|
||||||
kBottomLeftTipPointsLeftVariant = 7
|
|
||||||
kBalloonVariantCount = 8
|
|
||||||
hmBalloonHelpVersion = 0x0002
|
|
||||||
kHMHelpMenuID = -16490
|
|
||||||
kHMAboutHelpItem = 1
|
|
||||||
kHMShowBalloonsItem = 3
|
|
||||||
kHMHelpID = -5696
|
|
||||||
kBalloonWDEFID = 126
|
|
||||||
helpItem = 1
|
|
||||||
hmDefaultOptions = 0
|
|
||||||
hmUseSubIDBit = 0
|
|
||||||
hmAbsoluteCoordsBit = 1
|
|
||||||
hmSaveBitsNoWindowBit = 2
|
|
||||||
hmSaveBitsWindowBit = 3
|
|
||||||
hmMatchInTitleBit = 4
|
|
||||||
hmUseSubIDMask = (1 << hmUseSubIDBit)
|
|
||||||
hmAbsoluteCoordsMask = (1 << hmAbsoluteCoordsBit)
|
|
||||||
hmSaveBitsNoWindowMask = (1 << hmSaveBitsNoWindowBit)
|
|
||||||
hmSaveBitsWindowMask = (1 << hmSaveBitsWindowBit)
|
|
||||||
hmMatchInTitleMask = (1 << hmMatchInTitleBit)
|
|
||||||
hmUseSubID = hmUseSubIDMask
|
|
||||||
hmAbsoluteCoords = hmAbsoluteCoordsMask
|
|
||||||
hmSaveBitsNoWindow = hmSaveBitsNoWindowMask
|
|
||||||
hmSaveBitsWindow = hmSaveBitsWindowMask
|
|
||||||
hmMatchInTitle = hmMatchInTitleMask
|
|
||||||
kHMStringItem = 1
|
|
||||||
kHMPictItem = 2
|
|
||||||
kHMStringResItem = 3
|
|
||||||
kHMTEResItem = 6
|
|
||||||
kHMSTRResItem = 7
|
|
||||||
kHMSkipItem = 256
|
|
||||||
kHMCompareItem = 512
|
|
||||||
kHMNamedResourceItem = 1024
|
|
||||||
kHMTrackCntlItem = 2048
|
|
||||||
khmmString = 1
|
|
||||||
khmmPict = 2
|
|
||||||
khmmStringRes = 3
|
|
||||||
khmmTEHandle = 4
|
|
||||||
khmmPictHandle = 5
|
|
||||||
khmmTERes = 6
|
|
||||||
khmmSTRRes = 7
|
|
||||||
kHMEnabledItem = 0
|
|
||||||
kHMTETextResType = FOUR_CHAR_CODE('TEXT')
|
|
||||||
kHMTEStyleResType = FOUR_CHAR_CODE('styl')
|
|
||||||
kHMDisabledItem = 1
|
|
||||||
kHMCheckedItem = 2
|
|
||||||
kHMOtherItem = 3
|
|
||||||
kHMRegularWindow = 0
|
|
||||||
kHMSaveBitsNoWindow = 1
|
|
||||||
kHMSaveBitsWindow = 2
|
|
||||||
kHMMenuResType = FOUR_CHAR_CODE('hmnu')
|
|
||||||
kHMDialogResType = FOUR_CHAR_CODE('hdlg')
|
|
||||||
kHMWindListResType = FOUR_CHAR_CODE('hwin')
|
|
||||||
kHMRectListResType = FOUR_CHAR_CODE('hrct')
|
|
||||||
kHMOverrideResType = FOUR_CHAR_CODE('hovr')
|
|
||||||
kHMFinderApplResType = FOUR_CHAR_CODE('hfdr')
|
|
||||||
58
Mac/Lib/Carbon/MacHelp.py
Normal file
58
Mac/Lib/Carbon/MacHelp.py
Normal file
|
|
@ -0,0 +1,58 @@
|
||||||
|
# Generated from 'MacHelp.h'
|
||||||
|
|
||||||
|
def FOUR_CHAR_CODE(x): return x
|
||||||
|
kMacHelpVersion = 0x0003
|
||||||
|
kHMSupplyContent = 0
|
||||||
|
kHMDisposeContent = 1
|
||||||
|
kHMNoContent = FOUR_CHAR_CODE('none')
|
||||||
|
kHMCFStringContent = FOUR_CHAR_CODE('cfst')
|
||||||
|
kHMPascalStrContent = FOUR_CHAR_CODE('pstr')
|
||||||
|
kHMStringResContent = FOUR_CHAR_CODE('str#')
|
||||||
|
kHMTEHandleContent = FOUR_CHAR_CODE('txth')
|
||||||
|
kHMTextResContent = FOUR_CHAR_CODE('text')
|
||||||
|
kHMStrResContent = FOUR_CHAR_CODE('str ')
|
||||||
|
kHMDefaultSide = 0
|
||||||
|
kHMOutsideTopScriptAligned = 1
|
||||||
|
kHMOutsideLeftCenterAligned = 2
|
||||||
|
kHMOutsideBottomScriptAligned = 3
|
||||||
|
kHMOutsideRightCenterAligned = 4
|
||||||
|
kHMOutsideTopLeftAligned = 5
|
||||||
|
kHMOutsideTopRightAligned = 6
|
||||||
|
kHMOutsideLeftTopAligned = 7
|
||||||
|
kHMOutsideLeftBottomAligned = 8
|
||||||
|
kHMOutsideBottomLeftAligned = 9
|
||||||
|
kHMOutsideBottomRightAligned = 10
|
||||||
|
kHMOutsideRightTopAligned = 11
|
||||||
|
kHMOutsideRightBottomAligned = 12
|
||||||
|
kHMOutsideTopCenterAligned = 13
|
||||||
|
kHMOutsideBottomCenterAligned = 14
|
||||||
|
kHMInsideRightCenterAligned = 15
|
||||||
|
kHMInsideLeftCenterAligned = 16
|
||||||
|
kHMInsideBottomCenterAligned = 17
|
||||||
|
kHMInsideTopCenterAligned = 18
|
||||||
|
kHMInsideTopLeftCorner = 19
|
||||||
|
kHMInsideTopRightCorner = 20
|
||||||
|
kHMInsideBottomLeftCorner = 21
|
||||||
|
kHMInsideBottomRightCorner = 22
|
||||||
|
kHMAbsoluteCenterAligned = 23
|
||||||
|
kHMTopSide = kHMOutsideTopScriptAligned
|
||||||
|
kHMLeftSide = kHMOutsideLeftCenterAligned
|
||||||
|
kHMBottomSide = kHMOutsideBottomScriptAligned
|
||||||
|
kHMRightSide = kHMOutsideRightCenterAligned
|
||||||
|
kHMTopLeftCorner = kHMOutsideTopLeftAligned
|
||||||
|
kHMTopRightCorner = kHMOutsideTopRightAligned
|
||||||
|
kHMLeftTopCorner = kHMOutsideLeftTopAligned
|
||||||
|
kHMLeftBottomCorner = kHMOutsideLeftBottomAligned
|
||||||
|
kHMBottomLeftCorner = kHMOutsideBottomLeftAligned
|
||||||
|
kHMBottomRightCorner = kHMOutsideBottomRightAligned
|
||||||
|
kHMRightTopCorner = kHMOutsideRightTopAligned
|
||||||
|
kHMRightBottomCorner = kHMOutsideRightBottomAligned
|
||||||
|
kHMContentProvided = 0
|
||||||
|
kHMContentNotProvided = 1
|
||||||
|
kHMContentNotProvidedDontPropagate = 2
|
||||||
|
kHMMinimumContentIndex = 0
|
||||||
|
kHMMaximumContentIndex = 1
|
||||||
|
errHMIllegalContentForMinimumState = -10980
|
||||||
|
errHMIllegalContentForMaximumState = -10981
|
||||||
|
kHMIllegalContentForMinimumState = errHMIllegalContentForMinimumState
|
||||||
|
kHelpTagEventHandlerTag = FOUR_CHAR_CODE('hevt')
|
||||||
|
|
@ -20,264 +20,141 @@
|
||||||
}} while(0)
|
}} while(0)
|
||||||
|
|
||||||
|
|
||||||
#include <Balloons.h>
|
#ifdef WITHOUT_FRAMEWORKS
|
||||||
|
#include <MacHelp.h>
|
||||||
|
#else
|
||||||
|
#include <Carbon/Carbon.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
static PyObject *Help_Error;
|
static PyObject *Help_Error;
|
||||||
|
|
||||||
static PyObject *Help_HMGetHelpMenuHandle(PyObject *_self, PyObject *_args)
|
static PyObject *Help_HMGetHelpMenu(PyObject *_self, PyObject *_args)
|
||||||
{
|
{
|
||||||
PyObject *_res = NULL;
|
PyObject *_res = NULL;
|
||||||
OSErr _err;
|
OSStatus _err;
|
||||||
MenuRef mh;
|
MenuRef outHelpMenu;
|
||||||
|
MenuItemIndex outFirstCustomItemIndex;
|
||||||
if (!PyArg_ParseTuple(_args, ""))
|
if (!PyArg_ParseTuple(_args, ""))
|
||||||
return NULL;
|
return NULL;
|
||||||
_err = HMGetHelpMenuHandle(&mh);
|
_err = HMGetHelpMenu(&outHelpMenu,
|
||||||
|
&outFirstCustomItemIndex);
|
||||||
if (_err != noErr) return PyMac_Error(_err);
|
if (_err != noErr) return PyMac_Error(_err);
|
||||||
_res = Py_BuildValue("O&",
|
_res = Py_BuildValue("O&H",
|
||||||
MenuObj_New, mh);
|
MenuObj_New, outHelpMenu,
|
||||||
|
outFirstCustomItemIndex);
|
||||||
return _res;
|
return _res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *Help_HMRemoveBalloon(PyObject *_self, PyObject *_args)
|
static PyObject *Help_HMAreHelpTagsDisplayed(PyObject *_self, PyObject *_args)
|
||||||
{
|
|
||||||
PyObject *_res = NULL;
|
|
||||||
OSErr _err;
|
|
||||||
if (!PyArg_ParseTuple(_args, ""))
|
|
||||||
return NULL;
|
|
||||||
_err = HMRemoveBalloon();
|
|
||||||
if (_err != noErr) return PyMac_Error(_err);
|
|
||||||
Py_INCREF(Py_None);
|
|
||||||
_res = Py_None;
|
|
||||||
return _res;
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *Help_HMIsBalloon(PyObject *_self, PyObject *_args)
|
|
||||||
{
|
{
|
||||||
PyObject *_res = NULL;
|
PyObject *_res = NULL;
|
||||||
Boolean _rv;
|
Boolean _rv;
|
||||||
if (!PyArg_ParseTuple(_args, ""))
|
if (!PyArg_ParseTuple(_args, ""))
|
||||||
return NULL;
|
return NULL;
|
||||||
_rv = HMIsBalloon();
|
_rv = HMAreHelpTagsDisplayed();
|
||||||
_res = Py_BuildValue("b",
|
_res = Py_BuildValue("b",
|
||||||
_rv);
|
_rv);
|
||||||
return _res;
|
return _res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *Help_HMGetBalloons(PyObject *_self, PyObject *_args)
|
static PyObject *Help_HMSetHelpTagsDisplayed(PyObject *_self, PyObject *_args)
|
||||||
{
|
{
|
||||||
PyObject *_res = NULL;
|
PyObject *_res = NULL;
|
||||||
Boolean _rv;
|
OSStatus _err;
|
||||||
if (!PyArg_ParseTuple(_args, ""))
|
Boolean inDisplayTags;
|
||||||
return NULL;
|
|
||||||
_rv = HMGetBalloons();
|
|
||||||
_res = Py_BuildValue("b",
|
|
||||||
_rv);
|
|
||||||
return _res;
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *Help_HMSetBalloons(PyObject *_self, PyObject *_args)
|
|
||||||
{
|
|
||||||
PyObject *_res = NULL;
|
|
||||||
OSErr _err;
|
|
||||||
Boolean flag;
|
|
||||||
if (!PyArg_ParseTuple(_args, "b",
|
if (!PyArg_ParseTuple(_args, "b",
|
||||||
&flag))
|
&inDisplayTags))
|
||||||
return NULL;
|
return NULL;
|
||||||
_err = HMSetBalloons(flag);
|
_err = HMSetHelpTagsDisplayed(inDisplayTags);
|
||||||
if (_err != noErr) return PyMac_Error(_err);
|
if (_err != noErr) return PyMac_Error(_err);
|
||||||
Py_INCREF(Py_None);
|
Py_INCREF(Py_None);
|
||||||
_res = Py_None;
|
_res = Py_None;
|
||||||
return _res;
|
return _res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *Help_HMSetFont(PyObject *_self, PyObject *_args)
|
static PyObject *Help_HMSetTagDelay(PyObject *_self, PyObject *_args)
|
||||||
{
|
{
|
||||||
PyObject *_res = NULL;
|
PyObject *_res = NULL;
|
||||||
OSErr _err;
|
OSStatus _err;
|
||||||
SInt16 font;
|
Duration inDelay;
|
||||||
if (!PyArg_ParseTuple(_args, "h",
|
if (!PyArg_ParseTuple(_args, "l",
|
||||||
&font))
|
&inDelay))
|
||||||
return NULL;
|
return NULL;
|
||||||
_err = HMSetFont(font);
|
_err = HMSetTagDelay(inDelay);
|
||||||
if (_err != noErr) return PyMac_Error(_err);
|
if (_err != noErr) return PyMac_Error(_err);
|
||||||
Py_INCREF(Py_None);
|
Py_INCREF(Py_None);
|
||||||
_res = Py_None;
|
_res = Py_None;
|
||||||
return _res;
|
return _res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *Help_HMSetFontSize(PyObject *_self, PyObject *_args)
|
static PyObject *Help_HMGetTagDelay(PyObject *_self, PyObject *_args)
|
||||||
{
|
{
|
||||||
PyObject *_res = NULL;
|
PyObject *_res = NULL;
|
||||||
OSErr _err;
|
OSStatus _err;
|
||||||
UInt16 fontSize;
|
Duration outDelay;
|
||||||
if (!PyArg_ParseTuple(_args, "H",
|
|
||||||
&fontSize))
|
|
||||||
return NULL;
|
|
||||||
_err = HMSetFontSize(fontSize);
|
|
||||||
if (_err != noErr) return PyMac_Error(_err);
|
|
||||||
Py_INCREF(Py_None);
|
|
||||||
_res = Py_None;
|
|
||||||
return _res;
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *Help_HMGetFont(PyObject *_self, PyObject *_args)
|
|
||||||
{
|
|
||||||
PyObject *_res = NULL;
|
|
||||||
OSErr _err;
|
|
||||||
SInt16 font;
|
|
||||||
if (!PyArg_ParseTuple(_args, ""))
|
if (!PyArg_ParseTuple(_args, ""))
|
||||||
return NULL;
|
return NULL;
|
||||||
_err = HMGetFont(&font);
|
_err = HMGetTagDelay(&outDelay);
|
||||||
if (_err != noErr) return PyMac_Error(_err);
|
if (_err != noErr) return PyMac_Error(_err);
|
||||||
_res = Py_BuildValue("h",
|
_res = Py_BuildValue("l",
|
||||||
font);
|
outDelay);
|
||||||
return _res;
|
return _res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *Help_HMGetFontSize(PyObject *_self, PyObject *_args)
|
static PyObject *Help_HMSetMenuHelpFromBalloonRsrc(PyObject *_self, PyObject *_args)
|
||||||
{
|
{
|
||||||
PyObject *_res = NULL;
|
PyObject *_res = NULL;
|
||||||
OSErr _err;
|
OSStatus _err;
|
||||||
UInt16 fontSize;
|
MenuRef inMenu;
|
||||||
if (!PyArg_ParseTuple(_args, ""))
|
SInt16 inHmnuRsrcID;
|
||||||
|
if (!PyArg_ParseTuple(_args, "O&h",
|
||||||
|
MenuObj_Convert, &inMenu,
|
||||||
|
&inHmnuRsrcID))
|
||||||
return NULL;
|
return NULL;
|
||||||
_err = HMGetFontSize(&fontSize);
|
_err = HMSetMenuHelpFromBalloonRsrc(inMenu,
|
||||||
if (_err != noErr) return PyMac_Error(_err);
|
inHmnuRsrcID);
|
||||||
_res = Py_BuildValue("H",
|
|
||||||
fontSize);
|
|
||||||
return _res;
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *Help_HMSetDialogResID(PyObject *_self, PyObject *_args)
|
|
||||||
{
|
|
||||||
PyObject *_res = NULL;
|
|
||||||
OSErr _err;
|
|
||||||
SInt16 resID;
|
|
||||||
if (!PyArg_ParseTuple(_args, "h",
|
|
||||||
&resID))
|
|
||||||
return NULL;
|
|
||||||
_err = HMSetDialogResID(resID);
|
|
||||||
if (_err != noErr) return PyMac_Error(_err);
|
if (_err != noErr) return PyMac_Error(_err);
|
||||||
Py_INCREF(Py_None);
|
Py_INCREF(Py_None);
|
||||||
_res = Py_None;
|
_res = Py_None;
|
||||||
return _res;
|
return _res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *Help_HMSetMenuResID(PyObject *_self, PyObject *_args)
|
static PyObject *Help_HMSetDialogHelpFromBalloonRsrc(PyObject *_self, PyObject *_args)
|
||||||
{
|
{
|
||||||
PyObject *_res = NULL;
|
PyObject *_res = NULL;
|
||||||
OSErr _err;
|
OSStatus _err;
|
||||||
SInt16 menuID;
|
DialogPtr inDialog;
|
||||||
SInt16 resID;
|
SInt16 inHdlgRsrcID;
|
||||||
if (!PyArg_ParseTuple(_args, "hh",
|
SInt16 inItemStart;
|
||||||
&menuID,
|
if (!PyArg_ParseTuple(_args, "O&hh",
|
||||||
&resID))
|
DlgObj_Convert, &inDialog,
|
||||||
|
&inHdlgRsrcID,
|
||||||
|
&inItemStart))
|
||||||
return NULL;
|
return NULL;
|
||||||
_err = HMSetMenuResID(menuID,
|
_err = HMSetDialogHelpFromBalloonRsrc(inDialog,
|
||||||
resID);
|
inHdlgRsrcID,
|
||||||
|
inItemStart);
|
||||||
if (_err != noErr) return PyMac_Error(_err);
|
if (_err != noErr) return PyMac_Error(_err);
|
||||||
Py_INCREF(Py_None);
|
Py_INCREF(Py_None);
|
||||||
_res = Py_None;
|
_res = Py_None;
|
||||||
return _res;
|
return _res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *Help_HMScanTemplateItems(PyObject *_self, PyObject *_args)
|
|
||||||
{
|
|
||||||
PyObject *_res = NULL;
|
|
||||||
OSErr _err;
|
|
||||||
SInt16 whichID;
|
|
||||||
SInt16 whichResFile;
|
|
||||||
ResType whichType;
|
|
||||||
if (!PyArg_ParseTuple(_args, "hhO&",
|
|
||||||
&whichID,
|
|
||||||
&whichResFile,
|
|
||||||
PyMac_GetOSType, &whichType))
|
|
||||||
return NULL;
|
|
||||||
_err = HMScanTemplateItems(whichID,
|
|
||||||
whichResFile,
|
|
||||||
whichType);
|
|
||||||
if (_err != noErr) return PyMac_Error(_err);
|
|
||||||
Py_INCREF(Py_None);
|
|
||||||
_res = Py_None;
|
|
||||||
return _res;
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *Help_HMGetDialogResID(PyObject *_self, PyObject *_args)
|
|
||||||
{
|
|
||||||
PyObject *_res = NULL;
|
|
||||||
OSErr _err;
|
|
||||||
SInt16 resID;
|
|
||||||
if (!PyArg_ParseTuple(_args, ""))
|
|
||||||
return NULL;
|
|
||||||
_err = HMGetDialogResID(&resID);
|
|
||||||
if (_err != noErr) return PyMac_Error(_err);
|
|
||||||
_res = Py_BuildValue("h",
|
|
||||||
resID);
|
|
||||||
return _res;
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *Help_HMGetMenuResID(PyObject *_self, PyObject *_args)
|
|
||||||
{
|
|
||||||
PyObject *_res = NULL;
|
|
||||||
OSErr _err;
|
|
||||||
SInt16 menuID;
|
|
||||||
SInt16 resID;
|
|
||||||
if (!PyArg_ParseTuple(_args, "h",
|
|
||||||
&menuID))
|
|
||||||
return NULL;
|
|
||||||
_err = HMGetMenuResID(menuID,
|
|
||||||
&resID);
|
|
||||||
if (_err != noErr) return PyMac_Error(_err);
|
|
||||||
_res = Py_BuildValue("h",
|
|
||||||
resID);
|
|
||||||
return _res;
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *Help_HMGetBalloonWindow(PyObject *_self, PyObject *_args)
|
|
||||||
{
|
|
||||||
PyObject *_res = NULL;
|
|
||||||
OSErr _err;
|
|
||||||
WindowPtr window;
|
|
||||||
if (!PyArg_ParseTuple(_args, ""))
|
|
||||||
return NULL;
|
|
||||||
_err = HMGetBalloonWindow(&window);
|
|
||||||
if (_err != noErr) return PyMac_Error(_err);
|
|
||||||
_res = Py_BuildValue("O&",
|
|
||||||
WinObj_New, window);
|
|
||||||
return _res;
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyMethodDef Help_methods[] = {
|
static PyMethodDef Help_methods[] = {
|
||||||
{"HMGetHelpMenuHandle", (PyCFunction)Help_HMGetHelpMenuHandle, 1,
|
{"HMGetHelpMenu", (PyCFunction)Help_HMGetHelpMenu, 1,
|
||||||
PyDoc_STR("() -> (MenuRef mh)")},
|
PyDoc_STR("() -> (MenuRef outHelpMenu, MenuItemIndex outFirstCustomItemIndex)")},
|
||||||
{"HMRemoveBalloon", (PyCFunction)Help_HMRemoveBalloon, 1,
|
{"HMAreHelpTagsDisplayed", (PyCFunction)Help_HMAreHelpTagsDisplayed, 1,
|
||||||
PyDoc_STR("() -> None")},
|
|
||||||
{"HMIsBalloon", (PyCFunction)Help_HMIsBalloon, 1,
|
|
||||||
PyDoc_STR("() -> (Boolean _rv)")},
|
PyDoc_STR("() -> (Boolean _rv)")},
|
||||||
{"HMGetBalloons", (PyCFunction)Help_HMGetBalloons, 1,
|
{"HMSetHelpTagsDisplayed", (PyCFunction)Help_HMSetHelpTagsDisplayed, 1,
|
||||||
PyDoc_STR("() -> (Boolean _rv)")},
|
PyDoc_STR("(Boolean inDisplayTags) -> None")},
|
||||||
{"HMSetBalloons", (PyCFunction)Help_HMSetBalloons, 1,
|
{"HMSetTagDelay", (PyCFunction)Help_HMSetTagDelay, 1,
|
||||||
PyDoc_STR("(Boolean flag) -> None")},
|
PyDoc_STR("(Duration inDelay) -> None")},
|
||||||
{"HMSetFont", (PyCFunction)Help_HMSetFont, 1,
|
{"HMGetTagDelay", (PyCFunction)Help_HMGetTagDelay, 1,
|
||||||
PyDoc_STR("(SInt16 font) -> None")},
|
PyDoc_STR("() -> (Duration outDelay)")},
|
||||||
{"HMSetFontSize", (PyCFunction)Help_HMSetFontSize, 1,
|
{"HMSetMenuHelpFromBalloonRsrc", (PyCFunction)Help_HMSetMenuHelpFromBalloonRsrc, 1,
|
||||||
PyDoc_STR("(UInt16 fontSize) -> None")},
|
PyDoc_STR("(MenuRef inMenu, SInt16 inHmnuRsrcID) -> None")},
|
||||||
{"HMGetFont", (PyCFunction)Help_HMGetFont, 1,
|
{"HMSetDialogHelpFromBalloonRsrc", (PyCFunction)Help_HMSetDialogHelpFromBalloonRsrc, 1,
|
||||||
PyDoc_STR("() -> (SInt16 font)")},
|
PyDoc_STR("(DialogPtr inDialog, SInt16 inHdlgRsrcID, SInt16 inItemStart) -> None")},
|
||||||
{"HMGetFontSize", (PyCFunction)Help_HMGetFontSize, 1,
|
|
||||||
PyDoc_STR("() -> (UInt16 fontSize)")},
|
|
||||||
{"HMSetDialogResID", (PyCFunction)Help_HMSetDialogResID, 1,
|
|
||||||
PyDoc_STR("(SInt16 resID) -> None")},
|
|
||||||
{"HMSetMenuResID", (PyCFunction)Help_HMSetMenuResID, 1,
|
|
||||||
PyDoc_STR("(SInt16 menuID, SInt16 resID) -> None")},
|
|
||||||
{"HMScanTemplateItems", (PyCFunction)Help_HMScanTemplateItems, 1,
|
|
||||||
PyDoc_STR("(SInt16 whichID, SInt16 whichResFile, ResType whichType) -> None")},
|
|
||||||
{"HMGetDialogResID", (PyCFunction)Help_HMGetDialogResID, 1,
|
|
||||||
PyDoc_STR("() -> (SInt16 resID)")},
|
|
||||||
{"HMGetMenuResID", (PyCFunction)Help_HMGetMenuResID, 1,
|
|
||||||
PyDoc_STR("(SInt16 menuID) -> (SInt16 resID)")},
|
|
||||||
{"HMGetBalloonWindow", (PyCFunction)Help_HMGetBalloonWindow, 1,
|
|
||||||
PyDoc_STR("() -> (WindowPtr window)")},
|
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ from bgenlocations import TOOLBOXDIR, BGENDIR
|
||||||
sys.path.append(BGENDIR)
|
sys.path.append(BGENDIR)
|
||||||
from scantools import Scanner
|
from scantools import Scanner
|
||||||
|
|
||||||
LONG = "Balloons"
|
LONG = "MacHelp"
|
||||||
SHORT = "help"
|
SHORT = "help"
|
||||||
OBJECT = "NOTUSED"
|
OBJECT = "NOTUSED"
|
||||||
|
|
||||||
|
|
@ -45,15 +45,22 @@ class MyScanner(Scanner):
|
||||||
|
|
||||||
def makeblacklisttypes(self):
|
def makeblacklisttypes(self):
|
||||||
return [
|
return [
|
||||||
"TipFunctionUPP",
|
## "TipFunctionUPP",
|
||||||
"HMMessageRecord",
|
## "HMMessageRecord",
|
||||||
"HMMessageRecord_ptr",
|
## "HMMessageRecord_ptr",
|
||||||
|
"HMWindowContentUPP",
|
||||||
|
"HMMenuTitleContentUPP",
|
||||||
|
"HMControlContentUPP",
|
||||||
|
"HMMenuItemContentUPP",
|
||||||
|
# For the moment
|
||||||
|
"HMHelpContentRec",
|
||||||
|
"HMHelpContentRec_ptr",
|
||||||
]
|
]
|
||||||
|
|
||||||
def makerepairinstructions(self):
|
def makerepairinstructions(self):
|
||||||
return [
|
return [
|
||||||
([("WindowPtr", "*", "OutMode")],
|
## ([("WindowPtr", "*", "OutMode")],
|
||||||
[("ExistingWindowPtr", "*", "*")]),
|
## [("ExistingWindowPtr", "*", "*")]),
|
||||||
]
|
]
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@
|
||||||
import string
|
import string
|
||||||
|
|
||||||
# Declarations that change for each manager
|
# Declarations that change for each manager
|
||||||
MACHEADERFILE = 'Balloons.h' # The Apple header file
|
|
||||||
MODNAME = '_Help' # The name of the module
|
MODNAME = '_Help' # The name of the module
|
||||||
OBJECTNAME = 'UNUSED' # The basic name of the objects used here
|
OBJECTNAME = 'UNUSED' # The basic name of the objects used here
|
||||||
KIND = 'Record' # Usually 'Ptr' or 'Handle'
|
KIND = 'Record' # Usually 'Ptr' or 'Handle'
|
||||||
|
|
@ -22,22 +21,26 @@ from macsupport import *
|
||||||
|
|
||||||
# Create the type objects
|
# Create the type objects
|
||||||
MenuRef = OpaqueByValueType("MenuRef", "MenuObj")
|
MenuRef = OpaqueByValueType("MenuRef", "MenuObj")
|
||||||
|
MenuItemIndex = Type("MenuItemIndex", "H")
|
||||||
|
|
||||||
#WindowPeek = OpaqueByValueType("WindowPeek", OBJECTPREFIX)
|
#WindowPeek = OpaqueByValueType("WindowPeek", OBJECTPREFIX)
|
||||||
|
|
||||||
RgnHandle = FakeType("(RgnHandle)0")
|
#RgnHandle = FakeType("(RgnHandle)0")
|
||||||
# XXXX Should be next, but this will break a lot of code...
|
# XXXX Should be next, but this will break a lot of code...
|
||||||
# RgnHandle = OpaqueByValueType("RgnHandle", "OptResObj")
|
# RgnHandle = OpaqueByValueType("RgnHandle", "OptResObj")
|
||||||
|
|
||||||
KeyMap = ArrayOutputBufferType("KeyMap")
|
#KeyMap = ArrayOutputBufferType("KeyMap")
|
||||||
##MacOSEventKind = Type("MacOSEventKind", "h") # Old-style
|
##MacOSEventKind = Type("MacOSEventKind", "h") # Old-style
|
||||||
##MacOSEventMask = Type("MacOSEventMask", "h") # Old-style
|
##MacOSEventMask = Type("MacOSEventMask", "h") # Old-style
|
||||||
EventMask = Type("EventMask", "H")
|
#EventMask = Type("EventMask", "H")
|
||||||
EventKind = Type("EventKind", "H")
|
#EventKind = Type("EventKind", "H")
|
||||||
|
|
||||||
includestuff = includestuff + """
|
includestuff = includestuff + """
|
||||||
#include <%s>""" % MACHEADERFILE + """
|
#ifdef WITHOUT_FRAMEWORKS
|
||||||
|
#include <MacHelp.h>
|
||||||
|
#else
|
||||||
|
#include <Carbon/Carbon.h>
|
||||||
|
#endif
|
||||||
"""
|
"""
|
||||||
|
|
||||||
class MyObjectDefinition(GlobalObjectDefinition):
|
class MyObjectDefinition(GlobalObjectDefinition):
|
||||||
|
|
|
||||||
4
setup.py
4
setup.py
|
|
@ -778,6 +778,8 @@ class PyBuildExt(build_ext):
|
||||||
extra_link_args=['-framework', 'Carbon']) )
|
extra_link_args=['-framework', 'Carbon']) )
|
||||||
exts.append( Extension('_AE', ['ae/_AEmodule.c'],
|
exts.append( Extension('_AE', ['ae/_AEmodule.c'],
|
||||||
extra_link_args=['-framework', 'Carbon']) )
|
extra_link_args=['-framework', 'Carbon']) )
|
||||||
|
exts.append( Extension('_AH', ['ah/_AHmodule.c'],
|
||||||
|
extra_link_args=['-framework', 'Carbon']) )
|
||||||
exts.append( Extension('_App', ['app/_Appmodule.c'],
|
exts.append( Extension('_App', ['app/_Appmodule.c'],
|
||||||
extra_link_args=['-framework', 'Carbon']) )
|
extra_link_args=['-framework', 'Carbon']) )
|
||||||
exts.append( Extension('_CarbonEvt', ['carbonevt/_CarbonEvtmodule.c'],
|
exts.append( Extension('_CarbonEvt', ['carbonevt/_CarbonEvtmodule.c'],
|
||||||
|
|
@ -797,6 +799,8 @@ class PyBuildExt(build_ext):
|
||||||
extra_link_args=['-framework', 'Carbon']) )
|
extra_link_args=['-framework', 'Carbon']) )
|
||||||
exts.append( Extension('_Fm', ['fm/_Fmmodule.c'],
|
exts.append( Extension('_Fm', ['fm/_Fmmodule.c'],
|
||||||
extra_link_args=['-framework', 'Carbon']) )
|
extra_link_args=['-framework', 'Carbon']) )
|
||||||
|
exts.append( Extension('_Help', ['help/_Helpmodule.c'],
|
||||||
|
extra_link_args=['-framework', 'Carbon']) )
|
||||||
exts.append( Extension('_Icn', ['icn/_Icnmodule.c'],
|
exts.append( Extension('_Icn', ['icn/_Icnmodule.c'],
|
||||||
extra_link_args=['-framework', 'Carbon']) )
|
extra_link_args=['-framework', 'Carbon']) )
|
||||||
exts.append( Extension('_IBCarbon', ['ibcarbon/_IBCarbon.c'],
|
exts.append( Extension('_IBCarbon', ['ibcarbon/_IBCarbon.c'],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue