2 /* ========================== Module Help =========================== */
9 #include "pymactoolbox.h"
13 static PyObject
*Help_Error
;
15 static PyObject
*Help_HMGetHelpMenuHandle(_self
, _args
)
19 PyObject
*_res
= NULL
;
22 if (!PyArg_ParseTuple(_args
, ""))
24 _err
= HMGetHelpMenuHandle(&mh
);
25 if (_err
!= noErr
) return PyMac_Error(_err
);
26 _res
= Py_BuildValue("O&",
31 static PyObject
*Help_HMRemoveBalloon(_self
, _args
)
35 PyObject
*_res
= NULL
;
37 if (!PyArg_ParseTuple(_args
, ""))
39 _err
= HMRemoveBalloon();
40 if (_err
!= noErr
) return PyMac_Error(_err
);
46 static PyObject
*Help_HMIsBalloon(_self
, _args
)
50 PyObject
*_res
= NULL
;
52 if (!PyArg_ParseTuple(_args
, ""))
55 _res
= Py_BuildValue("b",
60 static PyObject
*Help_HMGetBalloons(_self
, _args
)
64 PyObject
*_res
= NULL
;
66 if (!PyArg_ParseTuple(_args
, ""))
68 _rv
= HMGetBalloons();
69 _res
= Py_BuildValue("b",
74 static PyObject
*Help_HMSetBalloons(_self
, _args
)
78 PyObject
*_res
= NULL
;
81 if (!PyArg_ParseTuple(_args
, "b",
84 _err
= HMSetBalloons(flag
);
85 if (_err
!= noErr
) return PyMac_Error(_err
);
91 static PyObject
*Help_HMSetFont(_self
, _args
)
95 PyObject
*_res
= NULL
;
98 if (!PyArg_ParseTuple(_args
, "h",
101 _err
= HMSetFont(font
);
102 if (_err
!= noErr
) return PyMac_Error(_err
);
108 static PyObject
*Help_HMSetFontSize(_self
, _args
)
112 PyObject
*_res
= NULL
;
115 if (!PyArg_ParseTuple(_args
, "H",
118 _err
= HMSetFontSize(fontSize
);
119 if (_err
!= noErr
) return PyMac_Error(_err
);
125 static PyObject
*Help_HMGetFont(_self
, _args
)
129 PyObject
*_res
= NULL
;
132 if (!PyArg_ParseTuple(_args
, ""))
134 _err
= HMGetFont(&font
);
135 if (_err
!= noErr
) return PyMac_Error(_err
);
136 _res
= Py_BuildValue("h",
141 static PyObject
*Help_HMGetFontSize(_self
, _args
)
145 PyObject
*_res
= NULL
;
148 if (!PyArg_ParseTuple(_args
, ""))
150 _err
= HMGetFontSize(&fontSize
);
151 if (_err
!= noErr
) return PyMac_Error(_err
);
152 _res
= Py_BuildValue("H",
157 static PyObject
*Help_HMSetDialogResID(_self
, _args
)
161 PyObject
*_res
= NULL
;
164 if (!PyArg_ParseTuple(_args
, "h",
167 _err
= HMSetDialogResID(resID
);
168 if (_err
!= noErr
) return PyMac_Error(_err
);
174 static PyObject
*Help_HMSetMenuResID(_self
, _args
)
178 PyObject
*_res
= NULL
;
182 if (!PyArg_ParseTuple(_args
, "hh",
186 _err
= HMSetMenuResID(menuID
,
188 if (_err
!= noErr
) return PyMac_Error(_err
);
194 static PyObject
*Help_HMScanTemplateItems(_self
, _args
)
198 PyObject
*_res
= NULL
;
203 if (!PyArg_ParseTuple(_args
, "hhO&",
206 PyMac_GetOSType
, &whichType
))
208 _err
= HMScanTemplateItems(whichID
,
211 if (_err
!= noErr
) return PyMac_Error(_err
);
217 static PyObject
*Help_HMGetDialogResID(_self
, _args
)
221 PyObject
*_res
= NULL
;
224 if (!PyArg_ParseTuple(_args
, ""))
226 _err
= HMGetDialogResID(&resID
);
227 if (_err
!= noErr
) return PyMac_Error(_err
);
228 _res
= Py_BuildValue("h",
233 static PyObject
*Help_HMGetMenuResID(_self
, _args
)
237 PyObject
*_res
= NULL
;
241 if (!PyArg_ParseTuple(_args
, "h",
244 _err
= HMGetMenuResID(menuID
,
246 if (_err
!= noErr
) return PyMac_Error(_err
);
247 _res
= Py_BuildValue("h",
252 static PyObject
*Help_HMGetBalloonWindow(_self
, _args
)
256 PyObject
*_res
= NULL
;
259 if (!PyArg_ParseTuple(_args
, ""))
261 _err
= HMGetBalloonWindow(&window
);
262 if (_err
!= noErr
) return PyMac_Error(_err
);
263 _res
= Py_BuildValue("O&",
268 static PyMethodDef Help_methods
[] = {
269 {"HMGetHelpMenuHandle", (PyCFunction
)Help_HMGetHelpMenuHandle
, 1,
270 "() -> (MenuHandle mh)"},
271 {"HMRemoveBalloon", (PyCFunction
)Help_HMRemoveBalloon
, 1,
273 {"HMIsBalloon", (PyCFunction
)Help_HMIsBalloon
, 1,
274 "() -> (Boolean _rv)"},
275 {"HMGetBalloons", (PyCFunction
)Help_HMGetBalloons
, 1,
276 "() -> (Boolean _rv)"},
277 {"HMSetBalloons", (PyCFunction
)Help_HMSetBalloons
, 1,
278 "(Boolean flag) -> None"},
279 {"HMSetFont", (PyCFunction
)Help_HMSetFont
, 1,
280 "(SInt16 font) -> None"},
281 {"HMSetFontSize", (PyCFunction
)Help_HMSetFontSize
, 1,
282 "(UInt16 fontSize) -> None"},
283 {"HMGetFont", (PyCFunction
)Help_HMGetFont
, 1,
284 "() -> (SInt16 font)"},
285 {"HMGetFontSize", (PyCFunction
)Help_HMGetFontSize
, 1,
286 "() -> (UInt16 fontSize)"},
287 {"HMSetDialogResID", (PyCFunction
)Help_HMSetDialogResID
, 1,
288 "(SInt16 resID) -> None"},
289 {"HMSetMenuResID", (PyCFunction
)Help_HMSetMenuResID
, 1,
290 "(SInt16 menuID, SInt16 resID) -> None"},
291 {"HMScanTemplateItems", (PyCFunction
)Help_HMScanTemplateItems
, 1,
292 "(SInt16 whichID, SInt16 whichResFile, ResType whichType) -> None"},
293 {"HMGetDialogResID", (PyCFunction
)Help_HMGetDialogResID
, 1,
294 "() -> (SInt16 resID)"},
295 {"HMGetMenuResID", (PyCFunction
)Help_HMGetMenuResID
, 1,
296 "(SInt16 menuID) -> (SInt16 resID)"},
297 {"HMGetBalloonWindow", (PyCFunction
)Help_HMGetBalloonWindow
, 1,
298 "() -> (WindowPtr window)"},
313 m
= Py_InitModule("Help", Help_methods
);
314 d
= PyModule_GetDict(m
);
315 Help_Error
= PyMac_GetOSErrException();
316 if (Help_Error
== NULL
||
317 PyDict_SetItemString(d
, "Error", Help_Error
) != 0)
318 Py_FatalError("can't initialize Help.Error");
321 /* ======================== End module Help ========================= */