-
Notifications
You must be signed in to change notification settings - Fork 0
/
INIT.c
64 lines (46 loc) · 1.07 KB
/
INIT.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
#include "A4Stuff.h"
#include "SetupA4.h"
#include <OSUtils.h>
#include <QuickDraw.h>
#define kINITid 0
typedef pascal void (*DrawMenuBarProc)();
DrawMenuBarProc oldDrawMenuBar;
pascal void myDrawMenuBar() {
long oldA4;
GrafPtr oldPort;
GrafPort myPort;
Rect notchRect;
short middleX;
oldA4 = SetCurrentA4();
RememberA4();
oldDrawMenuBar();
GetPort(&oldPort);
OpenPort(&myPort);
// Where is the middle of the screen?
middleX = myPort.portRect.right - myPort.portRect.left;
middleX /= 2;
middleX += myPort.portRect.left;
PenNormal();
SetRect(¬chRect, middleX-40, -10, middleX + 40, 18);
PaintRoundRect(¬chRect, 15, 15);
ClosePort(&myPort);
SetPort(oldPort);
SetA4(oldA4);
}
void main(void)
{
long oldA4;
Handle h;
oldA4 = SetCurrentA4();
RememberA4();
h = Get1Resource('INIT', kINITid);
if (h) {
DetachResource(h);
} else {
DebugStr("\pargh");
}
oldDrawMenuBar = (DrawMenuBarProc)GetToolTrapAddress(_DrawMenuBar);
SetToolTrapAddress((UniversalProcPtr)myDrawMenuBar, _DrawMenuBar);
/* restore the a4 world */
SetA4(oldA4);
}