annotate Mac/Modules/help/_Helpmodule.c @ 79675:c0a2294de787 2.7

Issue #16199: Backport 2to3 typo fix from 3.2.
author Chris Jerdonek <chris.jerdonek@gmail.com>
date Thu, 11 Oct 2012 16:15:46 -0700
parents fd25030223b0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2 /* ========================== Module _Help ========================== */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4 #include "Python.h"
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
5
47473
c34e34057714 MacOS X: Enable 4-way universal builds
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 31133
diff changeset
6 #ifndef __LP64__
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
7
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
8
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
9 #include "pymactoolbox.h"
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
10
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
11 /* Macro to test whether a weak-loaded CFM function exists */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
12 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
13 PyErr_SetString(PyExc_NotImplementedError, \
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
14 "Not available in this shared library/OS version"); \
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
15 return NULL; \
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
16 }} while(0)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
17
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
18
25075
31a774a6f604 Revived the Carbon.Help module, but implementing the MacHelp API in stead
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
19 #include <Carbon/Carbon.h>
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
20
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
21 static PyObject *Help_Error;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
22
25075
31a774a6f604 Revived the Carbon.Help module, but implementing the MacHelp API in stead
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
23 static PyObject *Help_HMGetHelpMenu(PyObject *_self, PyObject *_args)
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
24 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
25 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
26 OSStatus _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
27 MenuRef outHelpMenu;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
28 MenuItemIndex outFirstCustomItemIndex;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
29 if (!PyArg_ParseTuple(_args, ""))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
30 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
31 _err = HMGetHelpMenu(&outHelpMenu,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
32 &outFirstCustomItemIndex);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
33 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
34 _res = Py_BuildValue("O&H",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
35 MenuObj_New, outHelpMenu,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
36 outFirstCustomItemIndex);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
37 return _res;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
38 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
39
25075
31a774a6f604 Revived the Carbon.Help module, but implementing the MacHelp API in stead
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
40 static PyObject *Help_HMAreHelpTagsDisplayed(PyObject *_self, PyObject *_args)
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
41 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
42 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
43 Boolean _rv;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
44 if (!PyArg_ParseTuple(_args, ""))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
45 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
46 _rv = HMAreHelpTagsDisplayed();
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
47 _res = Py_BuildValue("b",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
48 _rv);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
49 return _res;
25075
31a774a6f604 Revived the Carbon.Help module, but implementing the MacHelp API in stead
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
50 }
31a774a6f604 Revived the Carbon.Help module, but implementing the MacHelp API in stead
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
51
31a774a6f604 Revived the Carbon.Help module, but implementing the MacHelp API in stead
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
52 static PyObject *Help_HMSetHelpTagsDisplayed(PyObject *_self, PyObject *_args)
31a774a6f604 Revived the Carbon.Help module, but implementing the MacHelp API in stead
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
53 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
54 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
55 OSStatus _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
56 Boolean inDisplayTags;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
57 if (!PyArg_ParseTuple(_args, "b",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
58 &inDisplayTags))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
59 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
60 _err = HMSetHelpTagsDisplayed(inDisplayTags);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
61 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
62 Py_INCREF(Py_None);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
63 _res = Py_None;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
64 return _res;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
65 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
66
25075
31a774a6f604 Revived the Carbon.Help module, but implementing the MacHelp API in stead
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
67 static PyObject *Help_HMSetTagDelay(PyObject *_self, PyObject *_args)
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
68 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
69 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
70 OSStatus _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
71 Duration inDelay;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
72 if (!PyArg_ParseTuple(_args, "l",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
73 &inDelay))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
74 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
75 _err = HMSetTagDelay(inDelay);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
76 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
77 Py_INCREF(Py_None);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
78 _res = Py_None;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
79 return _res;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
80 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
81
25075
31a774a6f604 Revived the Carbon.Help module, but implementing the MacHelp API in stead
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
82 static PyObject *Help_HMGetTagDelay(PyObject *_self, PyObject *_args)
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
83 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
84 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
85 OSStatus _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
86 Duration outDelay;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
87 if (!PyArg_ParseTuple(_args, ""))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
88 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
89 _err = HMGetTagDelay(&outDelay);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
90 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
91 _res = Py_BuildValue("l",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
92 outDelay);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
93 return _res;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
94 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
95
25075
31a774a6f604 Revived the Carbon.Help module, but implementing the MacHelp API in stead
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
96 static PyObject *Help_HMSetMenuHelpFromBalloonRsrc(PyObject *_self, PyObject *_args)
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
97 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
98 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
99 OSStatus _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
100 MenuRef inMenu;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
101 SInt16 inHmnuRsrcID;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
102 if (!PyArg_ParseTuple(_args, "O&h",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
103 MenuObj_Convert, &inMenu,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
104 &inHmnuRsrcID))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
105 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
106 _err = HMSetMenuHelpFromBalloonRsrc(inMenu,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
107 inHmnuRsrcID);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
108 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
109 Py_INCREF(Py_None);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
110 _res = Py_None;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
111 return _res;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
112 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
113
25075
31a774a6f604 Revived the Carbon.Help module, but implementing the MacHelp API in stead
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
114 static PyObject *Help_HMSetDialogHelpFromBalloonRsrc(PyObject *_self, PyObject *_args)
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
115 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
116 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
117 OSStatus _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
118 DialogPtr inDialog;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
119 SInt16 inHdlgRsrcID;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
120 SInt16 inItemStart;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
121 if (!PyArg_ParseTuple(_args, "O&hh",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
122 DlgObj_Convert, &inDialog,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
123 &inHdlgRsrcID,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
124 &inItemStart))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
125 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
126 _err = HMSetDialogHelpFromBalloonRsrc(inDialog,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
127 inHdlgRsrcID,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
128 inItemStart);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
129 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
130 Py_INCREF(Py_None);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
131 _res = Py_None;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
132 return _res;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
133 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
134
31133
c6f16504c8c2 Finished update to UH 3.4.2.
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
135 static PyObject *Help_HMHideTag(PyObject *_self, PyObject *_args)
c6f16504c8c2 Finished update to UH 3.4.2.
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
136 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
137 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
138 OSStatus _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
139 if (!PyArg_ParseTuple(_args, ""))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
140 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
141 _err = HMHideTag();
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
142 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
143 Py_INCREF(Py_None);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
144 _res = Py_None;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
145 return _res;
31133
c6f16504c8c2 Finished update to UH 3.4.2.
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
146 }
c6f16504c8c2 Finished update to UH 3.4.2.
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
147
47473
c34e34057714 MacOS X: Enable 4-way universal builds
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 31133
diff changeset
148 #endif /* __LP64__ */
c34e34057714 MacOS X: Enable 4-way universal builds
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 31133
diff changeset
149
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
150 static PyMethodDef Help_methods[] = {
47473
c34e34057714 MacOS X: Enable 4-way universal builds
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 31133
diff changeset
151 #ifndef __LP64__
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
152 {"HMGetHelpMenu", (PyCFunction)Help_HMGetHelpMenu, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
153 PyDoc_STR("() -> (MenuRef outHelpMenu, MenuItemIndex outFirstCustomItemIndex)")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
154 {"HMAreHelpTagsDisplayed", (PyCFunction)Help_HMAreHelpTagsDisplayed, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
155 PyDoc_STR("() -> (Boolean _rv)")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
156 {"HMSetHelpTagsDisplayed", (PyCFunction)Help_HMSetHelpTagsDisplayed, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
157 PyDoc_STR("(Boolean inDisplayTags) -> None")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
158 {"HMSetTagDelay", (PyCFunction)Help_HMSetTagDelay, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
159 PyDoc_STR("(Duration inDelay) -> None")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
160 {"HMGetTagDelay", (PyCFunction)Help_HMGetTagDelay, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
161 PyDoc_STR("() -> (Duration outDelay)")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
162 {"HMSetMenuHelpFromBalloonRsrc", (PyCFunction)Help_HMSetMenuHelpFromBalloonRsrc, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
163 PyDoc_STR("(MenuRef inMenu, SInt16 inHmnuRsrcID) -> None")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
164 {"HMSetDialogHelpFromBalloonRsrc", (PyCFunction)Help_HMSetDialogHelpFromBalloonRsrc, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
165 PyDoc_STR("(DialogPtr inDialog, SInt16 inHdlgRsrcID, SInt16 inItemStart) -> None")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
166 {"HMHideTag", (PyCFunction)Help_HMHideTag, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
167 PyDoc_STR("() -> None")},
47473
c34e34057714 MacOS X: Enable 4-way universal builds
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 31133
diff changeset
168 #endif /* __LP64__ */
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
169 {NULL, NULL, 0}
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
170 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
171
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
172
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
173
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
174
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
175 void init_Help(void)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
176 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
177 PyObject *m;
47473
c34e34057714 MacOS X: Enable 4-way universal builds
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 31133
diff changeset
178 #ifndef __LP64__
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
179 PyObject *d;
47473
c34e34057714 MacOS X: Enable 4-way universal builds
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 31133
diff changeset
180 #endif /* __LP64__ */
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
181
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
182
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
183
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
184
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
185 m = Py_InitModule("_Help", Help_methods);
47473
c34e34057714 MacOS X: Enable 4-way universal builds
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 31133
diff changeset
186 #ifndef __LP64__
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
187 d = PyModule_GetDict(m);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
188 Help_Error = PyMac_GetOSErrException();
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
189 if (Help_Error == NULL ||
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
190 PyDict_SetItemString(d, "Error", Help_Error) != 0)
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47473
diff changeset
191 return;
47473
c34e34057714 MacOS X: Enable 4-way universal builds
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 31133
diff changeset
192 #endif /* __LP64__ */
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
193 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
194
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
195 /* ======================== End module _Help ======================== */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
196