summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/menu/menuedit.py
blob: f613d8b5ccbecbdac65f3966f5837d2b56cb2c39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
f = Function(MenuHandle, 'as_Menu', (Handle, 'h', InMode))
functions.append(f)

f = Method(Handle, 'as_Resource', (MenuHandle, 'h', InMode))
methods.append(f)

# The following have "Mac" prepended to their names in the include file
# since UH 3.1, sigh...
f = Function(MenuHandle, 'GetMenu',
    (short, 'resourceID', InMode),
)
functions.append(f)

f = Method(void, 'AppendMenu',
    (MenuHandle, 'menu', InMode),
    (ConstStr255Param, 'data', InMode),
)
methods.append(f)

f = Method(void, 'InsertMenu',
    (MenuHandle, 'theMenu', InMode),
    (short, 'beforeID', InMode),
)
methods.append(f)

f = Function(void, 'DeleteMenu',
    (short, 'menuID', InMode),
)
functions.append(f)

f = Method(void, 'InsertMenuItem',
    (MenuHandle, 'theMenu', InMode),
    (ConstStr255Param, 'itemString', InMode),
    (short, 'afterItem', InMode),
)
methods.append(f)

f = Method(void, 'EnableMenuItem',
    (MenuHandle, 'theMenu', InMode),
    (UInt16, 'item', InMode),
)
methods.append(f)

f = Method(void, 'CheckMenuItem',
    (MenuRef, 'theMenu', InMode),
    (short, 'item', InMode),
    (Boolean, 'checked', InMode),
)
methods.append(f)


f = Function(void, 'DrawMenuBar',
)
functions.append(f)


#
# The following functions take an *optional* MenuRef as their first argument
#

f = Function(ItemCount, 'CountMenuItemsWithCommandID',
    (OptMenuRef, 'inMenu', InMode),
    (MenuCommand, 'inCommandID', InMode),
)
functions.append(f)

f = Function(OSStatus, 'GetIndMenuItemWithCommandID',
    (OptMenuRef, 'inMenu', InMode),
    (MenuCommand, 'inCommandID', InMode),
    (UInt32, 'inItemIndex', InMode),
    (MenuRef, 'outMenu', OutMode),
    (MenuItemIndex, 'outIndex', OutMode),
)
functions.append(f)

f = Function(void, 'EnableMenuCommand',
    (OptMenuRef, 'inMenu', InMode),
    (MenuCommand, 'inCommandID', InMode),
)
functions.append(f)

f = Function(void, 'DisableMenuCommand',
    (OptMenuRef, 'inMenu', InMode),
    (MenuCommand, 'inCommandID', InMode),
)
functions.append(f)

f = Function(Boolean, 'IsMenuCommandEnabled',
    (OptMenuRef, 'inMenu', InMode),
    (MenuCommand, 'inCommandID', InMode),
)
functions.append(f)

f = Function(OSStatus, 'SetMenuCommandMark',
    (OptMenuRef, 'inMenu', InMode),
    (MenuCommand, 'inCommandID', InMode),
    (UniChar, 'inMark', InMode),
)
functions.append(f)

f = Function(OSStatus, 'GetMenuCommandMark',
    (OptMenuRef, 'inMenu', InMode),
    (MenuCommand, 'inCommandID', InMode),
    (UniChar, 'outMark', OutMode),
)
functions.append(f)

f = Function(OSStatus, 'GetMenuCommandPropertySize',
    (OptMenuRef, 'inMenu', InMode),
    (MenuCommand, 'inCommandID', InMode),
    (OSType, 'inPropertyCreator', InMode),
    (OSType, 'inPropertyTag', InMode),
    (ByteCount, 'outSize', OutMode),
)
functions.append(f)

f = Function(OSStatus, 'RemoveMenuCommandProperty',
    (OptMenuRef, 'inMenu', InMode),
    (MenuCommand, 'inCommandID', InMode),
    (OSType, 'inPropertyCreator', InMode),
    (OSType, 'inPropertyTag', InMode),
)
functions.append(f)