-
Notifications
You must be signed in to change notification settings - Fork 74
/
MPhotoshop.p
194 lines (125 loc) · 3.38 KB
/
MPhotoshop.p
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
{Photoshop version 1.0.1, file: MPhotoshop.p
Computer History Museum, www.computerhistory.org
This material is (C)Copyright 1990 Adobe Systems Inc.
It may not be distributed to third parties.
It is licensed for non-commercial use according to
www.computerhistory.org/softwarelicense/photoshop/ }
PROGRAM Photoshop;
USES
{$LOAD MacIntf.LOAD}
MemTypes, QuickDraw, OSIntf, ToolIntf, PackIntf,
{$LOAD UMacApp.LOAD}
UObject, UList, UMacApp,
{$LOAD UPhotoshop.LOAD}
PaletteMgr, UConstants, UVMemory, UPhotoshop,
{$LOAD}
UPrinting, UDialog;
VAR
gPhotoshopApplication: TPhotoshopApplication;
{*****************************************************************************}
{$S ARes}
PROCEDURE AResDummy;
BEGIN
END;
{*****************************************************************************}
{$S ARes2}
PROCEDURE ARes2Dummy;
BEGIN
END;
{*****************************************************************************}
{$S ARes3}
PROCEDURE ARes3Dummy;
BEGIN
END;
{*****************************************************************************}
{$S ARes4}
PROCEDURE ARes4Dummy;
BEGIN
END;
{*****************************************************************************}
{$S AEncoded}
PROCEDURE AEncodedDummy;
BEGIN
END;
{*****************************************************************************}
{$S AInit}
PROCEDURE ClaimColorTable;
{ Kludge code, claims colors on the main screen of a Mac II }
VAR
size: INTEGER;
index: INTEGER;
device: GDHandle;
saveDevice: GDHandle;
BEGIN
IF gConfiguration.hasColorToolbox THEN
BEGIN
device := GetMainDevice;
CASE device^^.gdPMap^^.pixelSize OF
2: size := 3;
4: size := 15;
8: size := 255;
OTHERWISE
EXIT (ClaimColorTable)
END;
saveDevice := GetGDevice;
SetGDevice (device);
FOR index := 0 TO SIZE DO
BEGIN
ProtectEntry (index, FALSE);
ReserveEntry (index, FALSE)
END;
SetGDevice (saveDevice)
END
END;
{*****************************************************************************}
{$S ATerminate}
PROCEDURE UpdateScreen;
{ Kludge code, force a redraw of the main screen on a Mac II }
VAR
wp: WindowPtr;
ct: CTabHandle;
depth: INTEGER;
device: GDHandle;
saveDevice: GDHandle;
BEGIN
IF gConfiguration.hasColorToolbox THEN
BEGIN
device := GetMainDevice;
CASE device^^.gdPMap^^.pixelSize OF
2: depth := 2;
4: depth := 4;
8: depth := 8;
OTHERWISE
EXIT (UpdateScreen)
END;
ct := GetCTable (depth);
saveDevice := GetGDevice;
SetGDevice (device);
SetEntries (0, ct^^.ctSize, ct^^.ctTable);
SetGDevice (saveDevice);
wp := WindowPtr (NewCWindow (NIL, GetGrayRgn^^.rgnBBox, '',
FALSE, plainDBox, WindowPtr (-1),
FALSE, 0));
PaintBehind (WindowPeek (wp), GetGrayRgn)
END
END;
{*****************************************************************************}
{$S Main}
BEGIN
InitToolbox (8);
InitPrinting;
InitUDialog;
gBuffer := NewPtr (32768);
FailNil (gBuffer);
SetResidentSegment (GetSegNumber (@AResDummy), TRUE);
SetResidentSegment (GetSegNumber (@ARes2Dummy), TRUE);
SetResidentSegment (GetSegNumber (@ARes3Dummy), TRUE);
SetResidentSegment (GetSegNumber (@ARes4Dummy), TRUE);
SetResidentSegment (GetSegNumber (@AEncodedDummy), TRUE);
ClaimColorTable;
NEW (gPhotoshopApplication);
FailNil (gPhotoshopApplication);
gPhotoshopApplication.IPhotoshopApplication;
gPhotoshopApplication.Run;
UpdateScreen
END.