Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cbed91b

Browse files
committed
Merging appropriate 2.1.1 fixes back into the main trunk.
1 parent cb60dae commit cbed91b

26 files changed

Lines changed: 162 additions & 122 deletions

Mac/Contrib/osam/OSAm.prj

30 KB
Binary file not shown.

Mac/Contrib/osam/ScriptRunner.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,26 @@
2121
#include <script.h>
2222
#include <resources.h>
2323

24+
#ifdef TARGET_API_MAC_CARBON
25+
static
26+
p2cstr(StringPtr p)
27+
{
28+
unsigned char *c = p;
29+
int len = c[0];
30+
strncpy((char *)c+1, (char *)c, len);
31+
c[len] = 0;
32+
}
2433

34+
static c2pstr(const char *cc)
35+
{
36+
char *c = (char *)cc; /* Ouch */
37+
int len = strlen(c);
38+
39+
if ( len > 255 ) len = 255;
40+
strncpy(c, c+1, len);
41+
c[0] = len;
42+
}
43+
#endif
2544

2645
OSAError LoadScriptingComponent (ComponentInstance * scriptingComponent);
2746

Mac/Demo/PICTbrowse/ICONbrowse.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ class MyDialog(FrameWork.DialogWindow):
119119
def open(self, id, contents):
120120
self.id = id
121121
FrameWork.DialogWindow.open(self, ID_MAIN)
122-
self.wid.SetDialogDefaultItem(MAIN_SHOW)
122+
self.dlg.SetDialogDefaultItem(MAIN_SHOW)
123123
self.contents = contents
124-
self.ctl = self.wid.GetDialogItemAsControl(MAIN_LIST)
124+
self.ctl = self.dlg.GetDialogItemAsControl(MAIN_LIST)
125125
h = self.ctl.GetControlData_Handle(Controls.kControlListBoxPart,
126126
Controls.kControlListBoxListHandleTag)
127127
self.list = List.as_List(h)

Mac/Demo/PICTbrowse/PICTbrowse.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ class MyDialog(FrameWork.DialogWindow):
9797
def open(self, id, contents):
9898
self.id = id
9999
FrameWork.DialogWindow.open(self, ID_MAIN)
100-
self.wid.SetDialogDefaultItem(MAIN_SHOW)
100+
self.dlg.SetDialogDefaultItem(MAIN_SHOW)
101101
self.contents = contents
102-
self.ctl = self.wid.GetDialogItemAsControl(MAIN_LIST)
102+
self.ctl = self.dlg.GetDialogItemAsControl(MAIN_LIST)
103103
h = self.ctl.GetControlData_Handle(Controls.kControlListBoxPart,
104104
Controls.kControlListBoxListHandleTag)
105105
self.list = List.as_List(h)

Mac/Demo/PICTbrowse/PICTbrowse2.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def do_update(self, *args):
9898

9999
def fitrect(self):
100100
"""Return self.pictrect scaled to fit in window"""
101-
graf = self.wid.GetWindowPort()
101+
graf = self.dlg.GetWindowPort()
102102
screenrect = graf.portRect
103103
picwidth = self.pictrect[2] - self.pictrect[0]
104104
picheight = self.pictrect[3] - self.pictrect[1]
@@ -119,9 +119,9 @@ class MyDialog(FrameWork.DialogWindow):
119119
def open(self, id, contents):
120120
self.id = id
121121
FrameWork.DialogWindow.open(self, ID_MAIN)
122-
self.wid.SetDialogDefaultItem(MAIN_SHOW)
122+
self.dlg.SetDialogDefaultItem(MAIN_SHOW)
123123
self.contents = contents
124-
self.ctl = self.wid.GetDialogItemAsControl(MAIN_LIST)
124+
self.ctl = self.dlg.GetDialogItemAsControl(MAIN_LIST)
125125
h = self.ctl.GetControlData_Handle(Controls.kControlListBoxPart,
126126
Controls.kControlListBoxListHandleTag)
127127
self.list = List.as_List(h)

Mac/Demo/PICTbrowse/oldPICTbrowse.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ class MyDialog(FrameWork.DialogWindow):
9696
def open(self, id, contents):
9797
self.id = id
9898
FrameWork.DialogWindow.open(self, ID_MAIN)
99-
self.wid.SetDialogDefaultItem(MAIN_SHOW)
100-
tp, h, rect = self.wid.GetDialogItem(MAIN_LIST)
99+
self.dlg.SetDialogDefaultItem(MAIN_SHOW)
100+
tp, h, rect = self.dlg.GetDialogItem(MAIN_LIST)
101101
rect2 = rect[0]+1, rect[1]+1, rect[2]-17, rect[3]-17 # Scroll bar space
102102
self.list = List.LNew(rect2, (0, 0, 1, len(contents)), (0,0), 0, self.wid,
103103
0, 1, 1, 1)
@@ -145,7 +145,7 @@ def do_show(self, *args):
145145
self.parent.showPICT(resid)
146146

147147
def do_rawupdate(self, window, event):
148-
tp, h, rect = self.wid.GetDialogItem(MAIN_LIST)
148+
tp, h, rect = self.dlg.GetDialogItem(MAIN_LIST)
149149
Qd.SetPort(self.wid)
150150
Qd.FrameRect(rect)
151151
self.list.LUpdate(self.wid.GetWindowPort().visRgn)

Mac/Demo/mlte/mlted.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def open(self, path, name, data):
2424
self.path = path
2525
self.name = name
2626
r = windowbounds(400, 400)
27-
w = Win.NewWindow(r, name, 1, 0, -1, 1, 0x55555555)
27+
w = Win.NewWindow(r, name, 1, 0, -1, 1, 0)
2828
self.wid = w
2929
flags = MacTextEditor.kTXNDrawGrowIconMask|MacTextEditor.kTXNWantHScrollBarMask| \
3030
MacTextEditor.kTXNWantVScrollBarMask
@@ -361,6 +361,8 @@ def clear(self, *args):
361361
def idle(self, event):
362362
if self.active:
363363
self.active.do_idle(event)
364+
else:
365+
Qd.SetCursor(Qd.qd.arrow)
364366

365367
def main():
366368
Mlte.TXNInitTextension(0)

Mac/Demo/textedit/ped.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def open(self, path, name, data):
1919
self.path = path
2020
self.name = name
2121
r = windowbounds(400, 400)
22-
w = Win.NewWindow(r, name, 1, 0, -1, 1, 0x55555555)
22+
w = Win.NewWindow(r, name, 1, 0, -1, 1, 0)
2323
self.wid = w
2424
x0, y0, x1, y1 = self.wid.GetWindowPort().portRect
2525
x0 = x0 + 4
@@ -338,6 +338,8 @@ def clear(self, *args):
338338
def idle(self, *args):
339339
if self.active:
340340
self.active.do_idle()
341+
else:
342+
Qd.SetCursor(Qd.qd.arrow)
341343

342344
def main():
343345
App = Ped()

Mac/Demo/waste/htmled.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import os
1616
import macfs
1717
import MACFS
18-
import regsub
1918
import string
2019
import htmllib
2120

@@ -47,7 +46,7 @@ def open(self, path, name, data):
4746
self.path = path
4847
self.name = name
4948
r = windowbounds(400, 400)
50-
w = Win.NewWindow(r, name, 1, 0, -1, 1, 0x55555555)
49+
w = Win.NewWindow(r, name, 1, 0, -1, 1, 0)
5150
self.wid = w
5251
vr = LEFTMARGIN, 0, r[2]-r[0]-15, r[3]-r[1]-15
5352
dr = (0, 0, vr[2], 0)
@@ -445,7 +444,7 @@ def send_flowing_data(self, data):
445444
self.ted.WEInsert(data, None, None)
446445

447446
def send_literal_data(self, data):
448-
data = regsub.gsub('\n', '\r', data)
447+
data = string.replace(data, '\n', '\r')
449448
data = string.expandtabs(data)
450449
self.ted.WEInsert(data, None, None)
451450

@@ -775,6 +774,8 @@ def clear(self, *args):
775774
def idle(self, event):
776775
if self.active:
777776
self.active.do_idle(event)
777+
else:
778+
Qd.SetCursor(Qd.qd.arrow)
778779

779780
def newRuler(self, obj):
780781
"""Insert a new ruler. Make it as wide as the window minus 2 pxls"""

Mac/Demo/waste/swed.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def open(self, path, name, data):
3434
self.path = path
3535
self.name = name
3636
r = windowbounds(400, 400)
37-
w = Win.NewWindow(r, name, 1, 0, -1, 1, 0x55555555)
37+
w = Win.NewWindow(r, name, 1, 0, -1, 1, 0)
3838
self.wid = w
3939
vr = 0, 0, r[2]-r[0]-15, r[3]-r[1]-15
4040
dr = (0, 0, 10240, 0)
@@ -603,6 +603,8 @@ def clear(self, *args):
603603
def idle(self, event):
604604
if self.active:
605605
self.active.do_idle(event)
606+
else:
607+
Qd.SetCursor(Qd.qd.arrow)
606608

607609
def getfontnames():
608610
names = []

0 commit comments

Comments
 (0)