-
Notifications
You must be signed in to change notification settings - Fork 0
/
menu.c
78 lines (57 loc) · 1.18 KB
/
menu.c
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
#include <menu.h>
#include <resources.h>
#include "rlint.h"
void check_rMenuItem(Handle h) {
MenuItemTemplate *mi;
Ref ref;
mi = *(MenuItemTemplate **)h;
ref = mi->itemTitleRef;
if (mi->itemFlag & 0x0400) {
if (mi->itemFlag & 0x200) {
if (ref) check(rItemStruct, ref);
}
}
else if (mi->itemFlag & mRefResource) {
if (ref) check(rPString, ref);
}
}
void check_rMenu(Handle h) {
MenuTemplate *m;
unsigned i;
Ref ref;
m = *(MenuTemplate **)h;
if (m->menuFlag & mRefResource) {
ref = m->menuTitleRef;
if (ref) check(rPString, ref);
}
if (m->menuFlag & 0x2000) {
for (i = 0; ; ++i) {
ref = m->itemRefArray[i];
if (!ref) break;
check(rMenuItem, ref);
}
}
}
void check_rMenuBar(Handle h) {
MenuBarTemplate *mb;
unsigned i;
mb = *(MenuBarTemplate **)h;
if (mb->menuFlag & mRefResource) {
for (i = 0; ; ++i) {
Ref ref = mb->menuRefArray[i];
if (!ref) break;
check(rMenu, ref);
}
}
}
void check_rItemStruct(Handle h) {
itemStruct *ptr;
Ref ref;
ptr = *(itemStruct **)h;
if (ptr->itemFlag2 & mRefResource) {
ref = ptr->itemTitleRef;
if (ref) check(rPString, ref);
ref = ptr->itemIconRef;
if (ref) check(rIcon, ref);
}
}