mirror of
https://github.com/AdaCore/cpython.git
synced 2026-02-12 12:57:15 -08:00
Merging appropriate 2.1.1 fixes back into the main trunk.
This commit is contained in:
Binary file not shown.
@@ -21,7 +21,26 @@
|
||||
#include <script.h>
|
||||
#include <resources.h>
|
||||
|
||||
#ifdef TARGET_API_MAC_CARBON
|
||||
static
|
||||
p2cstr(StringPtr p)
|
||||
{
|
||||
unsigned char *c = p;
|
||||
int len = c[0];
|
||||
strncpy((char *)c+1, (char *)c, len);
|
||||
c[len] = 0;
|
||||
}
|
||||
|
||||
static c2pstr(const char *cc)
|
||||
{
|
||||
char *c = (char *)cc; /* Ouch */
|
||||
int len = strlen(c);
|
||||
|
||||
if ( len > 255 ) len = 255;
|
||||
strncpy(c, c+1, len);
|
||||
c[0] = len;
|
||||
}
|
||||
#endif
|
||||
|
||||
OSAError LoadScriptingComponent (ComponentInstance * scriptingComponent);
|
||||
|
||||
|
||||
@@ -119,9 +119,9 @@ class MyDialog(FrameWork.DialogWindow):
|
||||
def open(self, id, contents):
|
||||
self.id = id
|
||||
FrameWork.DialogWindow.open(self, ID_MAIN)
|
||||
self.wid.SetDialogDefaultItem(MAIN_SHOW)
|
||||
self.dlg.SetDialogDefaultItem(MAIN_SHOW)
|
||||
self.contents = contents
|
||||
self.ctl = self.wid.GetDialogItemAsControl(MAIN_LIST)
|
||||
self.ctl = self.dlg.GetDialogItemAsControl(MAIN_LIST)
|
||||
h = self.ctl.GetControlData_Handle(Controls.kControlListBoxPart,
|
||||
Controls.kControlListBoxListHandleTag)
|
||||
self.list = List.as_List(h)
|
||||
|
||||
@@ -97,9 +97,9 @@ class MyDialog(FrameWork.DialogWindow):
|
||||
def open(self, id, contents):
|
||||
self.id = id
|
||||
FrameWork.DialogWindow.open(self, ID_MAIN)
|
||||
self.wid.SetDialogDefaultItem(MAIN_SHOW)
|
||||
self.dlg.SetDialogDefaultItem(MAIN_SHOW)
|
||||
self.contents = contents
|
||||
self.ctl = self.wid.GetDialogItemAsControl(MAIN_LIST)
|
||||
self.ctl = self.dlg.GetDialogItemAsControl(MAIN_LIST)
|
||||
h = self.ctl.GetControlData_Handle(Controls.kControlListBoxPart,
|
||||
Controls.kControlListBoxListHandleTag)
|
||||
self.list = List.as_List(h)
|
||||
|
||||
@@ -98,7 +98,7 @@ class PICTwindow(FrameWork.Window):
|
||||
|
||||
def fitrect(self):
|
||||
"""Return self.pictrect scaled to fit in window"""
|
||||
graf = self.wid.GetWindowPort()
|
||||
graf = self.dlg.GetWindowPort()
|
||||
screenrect = graf.portRect
|
||||
picwidth = self.pictrect[2] - self.pictrect[0]
|
||||
picheight = self.pictrect[3] - self.pictrect[1]
|
||||
@@ -119,9 +119,9 @@ class MyDialog(FrameWork.DialogWindow):
|
||||
def open(self, id, contents):
|
||||
self.id = id
|
||||
FrameWork.DialogWindow.open(self, ID_MAIN)
|
||||
self.wid.SetDialogDefaultItem(MAIN_SHOW)
|
||||
self.dlg.SetDialogDefaultItem(MAIN_SHOW)
|
||||
self.contents = contents
|
||||
self.ctl = self.wid.GetDialogItemAsControl(MAIN_LIST)
|
||||
self.ctl = self.dlg.GetDialogItemAsControl(MAIN_LIST)
|
||||
h = self.ctl.GetControlData_Handle(Controls.kControlListBoxPart,
|
||||
Controls.kControlListBoxListHandleTag)
|
||||
self.list = List.as_List(h)
|
||||
|
||||
@@ -96,8 +96,8 @@ class MyDialog(FrameWork.DialogWindow):
|
||||
def open(self, id, contents):
|
||||
self.id = id
|
||||
FrameWork.DialogWindow.open(self, ID_MAIN)
|
||||
self.wid.SetDialogDefaultItem(MAIN_SHOW)
|
||||
tp, h, rect = self.wid.GetDialogItem(MAIN_LIST)
|
||||
self.dlg.SetDialogDefaultItem(MAIN_SHOW)
|
||||
tp, h, rect = self.dlg.GetDialogItem(MAIN_LIST)
|
||||
rect2 = rect[0]+1, rect[1]+1, rect[2]-17, rect[3]-17 # Scroll bar space
|
||||
self.list = List.LNew(rect2, (0, 0, 1, len(contents)), (0,0), 0, self.wid,
|
||||
0, 1, 1, 1)
|
||||
@@ -145,7 +145,7 @@ class MyDialog(FrameWork.DialogWindow):
|
||||
self.parent.showPICT(resid)
|
||||
|
||||
def do_rawupdate(self, window, event):
|
||||
tp, h, rect = self.wid.GetDialogItem(MAIN_LIST)
|
||||
tp, h, rect = self.dlg.GetDialogItem(MAIN_LIST)
|
||||
Qd.SetPort(self.wid)
|
||||
Qd.FrameRect(rect)
|
||||
self.list.LUpdate(self.wid.GetWindowPort().visRgn)
|
||||
|
||||
@@ -24,7 +24,7 @@ class MlteWindow(Window):
|
||||
self.path = path
|
||||
self.name = name
|
||||
r = windowbounds(400, 400)
|
||||
w = Win.NewWindow(r, name, 1, 0, -1, 1, 0x55555555)
|
||||
w = Win.NewWindow(r, name, 1, 0, -1, 1, 0)
|
||||
self.wid = w
|
||||
flags = MacTextEditor.kTXNDrawGrowIconMask|MacTextEditor.kTXNWantHScrollBarMask| \
|
||||
MacTextEditor.kTXNWantVScrollBarMask
|
||||
@@ -361,6 +361,8 @@ class Mlted(Application):
|
||||
def idle(self, event):
|
||||
if self.active:
|
||||
self.active.do_idle(event)
|
||||
else:
|
||||
Qd.SetCursor(Qd.qd.arrow)
|
||||
|
||||
def main():
|
||||
Mlte.TXNInitTextension(0)
|
||||
|
||||
@@ -19,7 +19,7 @@ class TEWindow(ScrolledWindow):
|
||||
self.path = path
|
||||
self.name = name
|
||||
r = windowbounds(400, 400)
|
||||
w = Win.NewWindow(r, name, 1, 0, -1, 1, 0x55555555)
|
||||
w = Win.NewWindow(r, name, 1, 0, -1, 1, 0)
|
||||
self.wid = w
|
||||
x0, y0, x1, y1 = self.wid.GetWindowPort().portRect
|
||||
x0 = x0 + 4
|
||||
@@ -338,6 +338,8 @@ class Ped(Application):
|
||||
def idle(self, *args):
|
||||
if self.active:
|
||||
self.active.do_idle()
|
||||
else:
|
||||
Qd.SetCursor(Qd.qd.arrow)
|
||||
|
||||
def main():
|
||||
App = Ped()
|
||||
|
||||
@@ -15,7 +15,6 @@ import Scrap
|
||||
import os
|
||||
import macfs
|
||||
import MACFS
|
||||
import regsub
|
||||
import string
|
||||
import htmllib
|
||||
|
||||
@@ -47,7 +46,7 @@ class WasteWindow(ScrolledWindow):
|
||||
self.path = path
|
||||
self.name = name
|
||||
r = windowbounds(400, 400)
|
||||
w = Win.NewWindow(r, name, 1, 0, -1, 1, 0x55555555)
|
||||
w = Win.NewWindow(r, name, 1, 0, -1, 1, 0)
|
||||
self.wid = w
|
||||
vr = LEFTMARGIN, 0, r[2]-r[0]-15, r[3]-r[1]-15
|
||||
dr = (0, 0, vr[2], 0)
|
||||
@@ -445,7 +444,7 @@ class WasteWindow(ScrolledWindow):
|
||||
self.ted.WEInsert(data, None, None)
|
||||
|
||||
def send_literal_data(self, data):
|
||||
data = regsub.gsub('\n', '\r', data)
|
||||
data = string.replace(data, '\n', '\r')
|
||||
data = string.expandtabs(data)
|
||||
self.ted.WEInsert(data, None, None)
|
||||
|
||||
@@ -775,6 +774,8 @@ class Wed(Application):
|
||||
def idle(self, event):
|
||||
if self.active:
|
||||
self.active.do_idle(event)
|
||||
else:
|
||||
Qd.SetCursor(Qd.qd.arrow)
|
||||
|
||||
def newRuler(self, obj):
|
||||
"""Insert a new ruler. Make it as wide as the window minus 2 pxls"""
|
||||
|
||||
@@ -34,7 +34,7 @@ class WasteWindow(ScrolledWindow):
|
||||
self.path = path
|
||||
self.name = name
|
||||
r = windowbounds(400, 400)
|
||||
w = Win.NewWindow(r, name, 1, 0, -1, 1, 0x55555555)
|
||||
w = Win.NewWindow(r, name, 1, 0, -1, 1, 0)
|
||||
self.wid = w
|
||||
vr = 0, 0, r[2]-r[0]-15, r[3]-r[1]-15
|
||||
dr = (0, 0, 10240, 0)
|
||||
@@ -603,6 +603,8 @@ class Wed(Application):
|
||||
def idle(self, event):
|
||||
if self.active:
|
||||
self.active.do_idle(event)
|
||||
else:
|
||||
Qd.SetCursor(Qd.qd.arrow)
|
||||
|
||||
def getfontnames():
|
||||
names = []
|
||||
|
||||
@@ -25,7 +25,7 @@ class WasteWindow(ScrolledWindow):
|
||||
self.path = path
|
||||
self.name = name
|
||||
r = windowbounds(400, 400)
|
||||
w = Win.NewWindow(r, name, 1, 0, -1, 1, 0x55555555)
|
||||
w = Win.NewWindow(r, name, 1, 0, -1, 1, 0)
|
||||
self.wid = w
|
||||
vr = 0, 0, r[2]-r[0]-15, r[3]-r[1]-15
|
||||
dr = (0, 0, 10240, 0)
|
||||
@@ -411,6 +411,8 @@ class Wed(Application):
|
||||
def idle(self, event):
|
||||
if self.active:
|
||||
self.active.do_idle(event)
|
||||
else:
|
||||
Qd.SetCursor(Qd.qd.arrow)
|
||||
|
||||
def main():
|
||||
App = Wed()
|
||||
|
||||
Binary file not shown.
@@ -105,6 +105,10 @@
|
||||
(':Mac:Build', None)
|
||||
(':Mac:Compat:Icon', None)
|
||||
(':Mac:Contrib:AECaptureParser', '')
|
||||
(':Mac:Contrib:BBPy.lm:BBpy.r', None)
|
||||
(':Mac:Contrib:BBPy.lm:Python', '')
|
||||
(':Mac:Contrib:BBPy.lm:Python Keywords.rsrc', None)
|
||||
(':Mac:Contrib:BBPy.lm:PythonBBLM.txt', '')
|
||||
(':Mac:Contrib:BBPy:PythonSlave.py', '')
|
||||
(':Mac:Contrib:BBPy:README', '')
|
||||
(':Mac:Contrib:BBPy:Run as Python', '')
|
||||
@@ -208,7 +212,7 @@
|
||||
(':pystone.py', None)
|
||||
(':setup.py', None)
|
||||
(':site-packages', None)
|
||||
(':Mac:Contrib:BBPy.lm:Python', '')
|
||||
(':Mac:Contrib:BBPy.lm:PythonBBLM.txt', '')
|
||||
(':Mac:Contrib:BBPy.lm:BBpy.r', None)
|
||||
(':Mac:Contrib:BBPy.lm:Python Keywords.rsrc', None)
|
||||
(':Extensions:example3:README', None)
|
||||
(':Extensions:example2:README', None)
|
||||
(':Extensions:example:README', None)
|
||||
(':Mac:Contrib:osam:OSAm.carbon.slb', '')
|
||||
|
||||
@@ -116,6 +116,9 @@
|
||||
(':Mac:Build:TE.mcp.exp', None)
|
||||
(':Mac:Build:TE.mcp.xml', None)
|
||||
(':Mac:Build:TE.mcp.xml.out', None)
|
||||
(':Mac:Build:_dummy_tkinter.mcp', None)
|
||||
(':Mac:Build:_dummy_tkinter.mcp.exp', None)
|
||||
(':Mac:Build:_dummy_tkinter.old.mcp', None)
|
||||
(':Mac:Build:_symtable.carbon.mcp', None)
|
||||
(':Mac:Build:_symtable.carbon.mcp.exp', None)
|
||||
(':Mac:Build:_symtable.carbon.mcp.xml', None)
|
||||
@@ -452,6 +455,16 @@
|
||||
(':readmefiles', None)
|
||||
(':setup.py', None)
|
||||
(':site-packages', None)
|
||||
(':Mac:Build:_dummy_tkinter.old.mcp', None)
|
||||
(':Mac:Build:_dummy_tkinter.mcp.exp', None)
|
||||
(':Mac:Build:_dummy_tkinter.mcp', None)
|
||||
(':Extensions:example', None)
|
||||
(':Extensions:example2', None)
|
||||
(':Extensions:example3', None)
|
||||
(':Mac:Demo:mlte:mlted.py', None)
|
||||
(':Mac:Build:Mlte.mcp.xml', None)
|
||||
(':Mac:Build:Mlte.mcp.exp', None)
|
||||
(':Mac:Build:Mlte.mcp', None)
|
||||
(':Mac:Build:Mlte.carbon.mcp.xml', None)
|
||||
(':Mac:Build:Mlte.carbon.mcp.exp', None)
|
||||
(':Mac:Build:Mlte.carbon.mcp', None)
|
||||
(':Mac:Build:CF.carbon.mcp.xml', None)
|
||||
(':Mac:Build:CF.carbon.mcp.exp', None)
|
||||
(':Mac:Build:CF.carbon.mcp', None)
|
||||
|
||||
@@ -1 +1 @@
|
||||
#define BUILD 92
|
||||
#define BUILD 97
|
||||
|
||||
@@ -95,6 +95,9 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
/* No preferences file name resource */
|
||||
#define NOPREFNAME_ID BASE_ID+9
|
||||
|
||||
/* Not a script */
|
||||
#define NOTASCRIPT_ID BASE_ID+10
|
||||
|
||||
/* EditPythonPrefs range. Needed here to forestall conflicts with applets */
|
||||
#define EDITPYTHONPREFS_MIN 508
|
||||
#define EDITPYTHONPREFS_MAX 511
|
||||
|
||||
@@ -1010,6 +1010,10 @@ class DialogWindow(Window):
|
||||
def close(self):
|
||||
self.do_postclose()
|
||||
|
||||
def do_postclose(self):
|
||||
self.dlg = None
|
||||
Window.do_postclose(self)
|
||||
|
||||
def do_itemhit(self, item, event):
|
||||
print 'Dialog %s, item %d hit'%(self.dlg, item)
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
import sys
|
||||
import os
|
||||
import string
|
||||
import regsub
|
||||
import MacOS
|
||||
|
||||
BGENDIR=os.path.join(sys.prefix, ':Tools:bgen:bgen')
|
||||
|
||||
@@ -367,6 +367,7 @@ _mfs_GetFSSpecFromFSSpec(PyObject *self, FSSpec *fssp)
|
||||
static int
|
||||
_mfs_GetFSSpecFromFSRef(PyObject *self, FSSpec *fssp)
|
||||
{
|
||||
#if !TARGET_API_MAC_OS8
|
||||
static FSRef *fsrp;
|
||||
|
||||
if ( is_mfsrobject(self) ) {
|
||||
@@ -374,6 +375,7 @@ _mfs_GetFSSpecFromFSRef(PyObject *self, FSSpec *fssp)
|
||||
if ( FSGetCatalogInfo(&((mfsrobject *)self)->fsref, kFSCatInfoNone, NULL, NULL, fssp, NULL) == noErr )
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -381,10 +383,12 @@ _mfs_GetFSSpecFromFSRef(PyObject *self, FSSpec *fssp)
|
||||
static int
|
||||
_mfs_GetFSRefFromFSRef(PyObject *self, FSRef *fsrp)
|
||||
{
|
||||
#if !TARGET_API_MAC_OS8
|
||||
if ( is_mfsrobject(self) ) {
|
||||
*fsrp = ((mfsrobject *)self)->fsref;
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -392,10 +396,12 @@ _mfs_GetFSRefFromFSRef(PyObject *self, FSRef *fsrp)
|
||||
static int
|
||||
_mfs_GetFSRefFromFSSpec(PyObject *self, FSRef *fsrp)
|
||||
{
|
||||
#if !TARGET_API_MAC_OS8
|
||||
if ( is_mfssobject(self) ) {
|
||||
if ( FSpMakeFSRef(&((mfssobject *)self)->fsspec, fsrp) == noErr )
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -524,6 +530,10 @@ mfss_FSpMakeFSRef(self, args)
|
||||
mfssobject *self;
|
||||
PyObject *args;
|
||||
{
|
||||
#if TARGET_API_MAC_OS8
|
||||
PyErr_SetString(PyExc_NotImplementedError, "FSRef objects not supported on this platform");
|
||||
return 0;
|
||||
#else
|
||||
OSErr err;
|
||||
FSRef fsref;
|
||||
|
||||
@@ -535,6 +545,7 @@ mfss_FSpMakeFSRef(self, args)
|
||||
return NULL;
|
||||
}
|
||||
return (PyObject *)newmfsrobject(&fsref);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* XXXX These routines should be replaced by a wrapper to the *FInfo routines */
|
||||
@@ -766,7 +777,7 @@ statichere PyTypeObject Mfsstype = {
|
||||
|
||||
/* End of code for FSSpec objects */
|
||||
/* -------------------------------------------------------- */
|
||||
|
||||
#if !TARGET_API_MAC_OS8
|
||||
static PyObject *
|
||||
mfsr_as_fsspec(self, args)
|
||||
mfsrobject *self;
|
||||
@@ -871,6 +882,7 @@ statichere PyTypeObject Mfsrtype = {
|
||||
};
|
||||
|
||||
/* End of code for FSRef objects */
|
||||
#endif /* !TARGET_API_MAC_OS8 */
|
||||
/* -------------------------------------------------------- */
|
||||
|
||||
static PyObject *
|
||||
@@ -1002,11 +1014,16 @@ mfs_FSRef(self, args)
|
||||
PyObject *self; /* Not used */
|
||||
PyObject *args;
|
||||
{
|
||||
#if TARGET_API_MAC_OS8
|
||||
PyErr_SetString(PyExc_NotImplementedError, "FSRef objects not supported on this platform");
|
||||
return 0;
|
||||
#else
|
||||
FSRef fsr;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "O&", PyMac_GetFSRef, &fsr))
|
||||
return NULL;
|
||||
return (PyObject *)newmfsrobject(&fsr);
|
||||
#endif
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
@@ -1172,6 +1189,9 @@ static struct PyMethodDef mfs_methods[] = {
|
||||
int
|
||||
PyMac_GetFSRef(PyObject *v, FSRef *fsr)
|
||||
{
|
||||
#if TARGET_API_MAC_OS8
|
||||
return 0;
|
||||
#else
|
||||
OSErr err;
|
||||
|
||||
/* If it's an FSRef we're also okay. */
|
||||
@@ -1186,12 +1206,17 @@ PyMac_GetFSRef(PyObject *v, FSRef *fsr)
|
||||
}
|
||||
PyErr_SetString(PyExc_TypeError, "FSRef argument should be existing FSRef, FSSpec or (OSX only) pathname");
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Convert FSSpec to PyObject */
|
||||
PyObject *PyMac_BuildFSRef(FSRef *v)
|
||||
{
|
||||
#if TARGET_API_MAC_OS8
|
||||
return NULL;
|
||||
#else
|
||||
return (PyObject *)newmfsrobject(v);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
import sys
|
||||
import os
|
||||
import string
|
||||
import regsub
|
||||
import MacOS
|
||||
|
||||
BGENDIR=os.path.join(sys.prefix, ':Tools:bgen:bgen')
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user