summaryrefslogtreecommitdiffstats
path: root/Mac/Contrib
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2003-11-19 14:34:18 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2003-11-19 14:34:18 (GMT)
commit28ecf70db57828db2ca279643bf9aeca7662f35c (patch)
tree09b7767bbc411f85313b58d6fe7e5e67d9392973 /Mac/Contrib
parent6045b9c93511c767f6cfa2d2fa299c76181acd9b (diff)
downloadcpython-28ecf70db57828db2ca279643bf9aeca7662f35c.zip
cpython-28ecf70db57828db2ca279643bf9aeca7662f35c.tar.gz
cpython-28ecf70db57828db2ca279643bf9aeca7662f35c.tar.bz2
Getting rid of support for MacOS9 and earlier. This is the first step,
and the biggest in size, but probably the easiest. Hunting through the source code comes next.
Diffstat (limited to 'Mac/Contrib')
-rw-r--r--Mac/Contrib/AECaptureParser/AECaptureParser.py362
-rw-r--r--Mac/Contrib/AECaptureParser/readme.txt5
-rw-r--r--Mac/Contrib/BBPy.lm/BBPy.c456
-rw-r--r--Mac/Contrib/BBPy.lm/BBPythonLM.mcpbin45208 -> 0 bytes
-rw-r--r--Mac/Contrib/BBPy.lm/BBpy.r35
-rw-r--r--Mac/Contrib/BBPy.lm/Python1
-rw-r--r--Mac/Contrib/BBPy.lm/Python Keywords.rsrc1
-rw-r--r--Mac/Contrib/BBPy.lm/PythonBBLM.txt12
-rw-r--r--Mac/Contrib/BBPy/PythonSlave.py129
-rw-r--r--Mac/Contrib/BBPy/README45
-rw-r--r--Mac/Contrib/BBPy/Run as Python1
-rw-r--r--Mac/Contrib/BBPy/source/BB stuff/ExternalInterface.h716
-rw-r--r--Mac/Contrib/BBPy/source/BB-stuff/ExternalInterface.h716
-rw-r--r--Mac/Contrib/BBPy/source/BBPy.h17
-rw-r--r--Mac/Contrib/BBPy/source/BBPy.rsrc1
-rw-r--r--Mac/Contrib/BBPy/source/BBPy_lauch.c94
-rw-r--r--Mac/Contrib/BBPy/source/BBPy_launch.c94
-rw-r--r--Mac/Contrib/BBPy/source/BBPy_main.c104
-rw-r--r--Mac/Contrib/ImageHelpers/ExtPixMapWrapper.py46
-rw-r--r--Mac/Contrib/ImageHelpers/ImageMac.py277
-rw-r--r--Mac/Contrib/ImageHelpers/MovieUtils.py269
-rw-r--r--Mac/Contrib/ImageHelpers/ReadMe22
-rw-r--r--Mac/Contrib/PythonDetector/OpenPythonLibbin13234 -> 0 bytes
-rw-r--r--Mac/Contrib/PythonDetector/OpenPythonLib with NSbin13853 -> 0 bytes
-rw-r--r--Mac/Contrib/PythonDetector/PythonDetectorbin27559 -> 0 bytes
-rw-r--r--Mac/Contrib/PythonDetector/readme.txt60
-rw-r--r--Mac/Contrib/Sherlock/Python-FAQ.srcbin3342 -> 0 bytes
-rw-r--r--Mac/Contrib/Sherlock/Python-docs.srcbin3344 -> 0 bytes
-rw-r--r--Mac/Contrib/Sherlock/Python.srcbin3438 -> 0 bytes
-rw-r--r--Mac/Contrib/Sherlock/readme.txt14
-rw-r--r--Mac/Contrib/Tabcleaner/Tabcleaner.README41
-rw-r--r--Mac/Contrib/Tabcleaner/Tabcleaner.py160
-rw-r--r--Mac/Contrib/mpwsystem/mpwsystem.py67
-rw-r--r--Mac/Contrib/osam/OSAm.c277
-rw-r--r--Mac/Contrib/osam/OSAm.exp1
-rw-r--r--Mac/Contrib/osam/OSAm.h30
-rw-r--r--Mac/Contrib/osam/OSAm.prjbin71523 -> 0 bytes
-rw-r--r--Mac/Contrib/osam/ScriptRunner.c310
-rw-r--r--Mac/Contrib/osam/ScriptRunner.h30
39 files changed, 0 insertions, 4393 deletions
diff --git a/Mac/Contrib/AECaptureParser/AECaptureParser.py b/Mac/Contrib/AECaptureParser/AECaptureParser.py
deleted file mode 100644
index 3d74f64..0000000
--- a/Mac/Contrib/AECaptureParser/AECaptureParser.py
+++ /dev/null
@@ -1,362 +0,0 @@
-'''
-AECaptureParser makes a brave attempt to convert the text output
-of the very handy Lasso Capture AE control panel
-into close-enough executable python code.
-
-In a roundabout way AECaptureParser offers the way to write lines of AppleScript
-and convert them to python code. Once Pythonised, the code can be made prettier,
-and it can run without Capture or Script Editor being open.
-
-You need Lasso Capture AE from Blueworld:
-ftp://ftp.blueworld.com/Lasso251/LassoCaptureAE.hqx
-
-Lasso Capture AE prints structured ascii representations in a small window.
-As these transcripts can be very complex, cut and paste to AECaptureParser, it parses and writes
-python code that will, when executed, cause the same events to happen.
-It's been tested with some household variety events, I'm sure there will be tons that
-don't work.
-
-All objects are converted to standard aetypes.ObjectSpecifier instances.
-
-How to use:
- 1. Start the Capture window
- 2. Cause the desired appleevent to happen
- - by writing a line of applescript in Script Editor and running it (!)
- - by recording some action in Script Editor and running it
- 3. Find the events in Capture:
- - make sure you get the appropriate events, cull if necessary
- - sometimes Capture barfs, just quit and start Capture again, run events again
- - AECaptureParser can process multiple events - it will just make more code.
- 4. Copy and paste in this script and execute
- 5. It will print python code that, when executed recreates the events.
-
-Example:
- For instance the following line of AppleScript in Script Editor
- tell application "Finder"
- return application processes
- end tell
- will result in the following transcript:
- [event: target="Finder", class=core, id=getd]
- '----':obj {form:indx, want:type(pcap), seld:abso(«616C6C20»), from:'null'()}
- [/event]
- Feed a string with this (and perhaps more) events to AECaptureParser
-
-Some mysteries:
- * what is '&subj' - it is sent in an activate event: &subj:'null'()
- The activate event works when this is left out. A possibility?
- * needs to deal with embedded aliasses
-
-
-'''
-__version__ = '0.002'
-__author__ = 'evb'
-
-
-import string
-
-opentag = '{'
-closetag = '}'
-
-
-
-import aetools
-import aetypes
-
-class eventtalker(aetools.TalkTo):
- pass
-
-def processes():
- '''Helper function to get the list of current processes and their creators
- This code was mostly written by AECaptureParser! It ain't pretty, but that's not python's fault!'''
- talker = eventtalker('MACS')
- _arguments = {}
- _attributes = {}
- p = []
- names = []
- creators = []
- results = []
- # first get the list of process names
- _arguments['----'] = aetypes.ObjectSpecifier(want=aetypes.Type('pcap'),
- form="indx", seld=aetypes.Unknown('abso', "all "), fr=None)
- _reply, _arguments, _attributes = talker.send('core', 'getd', _arguments, _attributes)
- if _arguments.has_key('errn'):
- raise aetools.Error, aetools.decodeerror(_arguments)
- if _arguments.has_key('----'):
- p = _arguments['----']
- for proc in p:
- names.append(proc.seld)
- # then get the list of process creators
- _arguments = {}
- _attributes = {}
- AEobject_00 = aetypes.ObjectSpecifier(want=aetypes.Type('pcap'), form="indx", seld=aetypes.Unknown('abso', "all "), fr=None)
- AEobject_01 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), form="prop", seld=aetypes.Type('fcrt'), fr=AEobject_00)
- _arguments['----'] = AEobject_01
- _reply, _arguments, _attributes = talker.send('core', 'getd', _arguments, _attributes)
- if _arguments.has_key('errn'):
- raise aetools.Error, aetools.decodeerror(_arguments)
- if _arguments.has_key('----'):
- p = _arguments['----']
- for proc in p:
- creators.append(proc.type)
- # then put the lists together
- for i in range(len(names)):
- results.append((names[i], creators[i]))
- return results
-
-
-class AECaptureParser:
- '''convert a captured appleevent-description into executable python code'''
- def __init__(self, aetext):
- self.aetext = aetext
- self.events = []
- self.arguments = {}
- self.objectindex = 0
- self.varindex = 0
- self.currentevent = {'variables':{}, 'arguments':{}, 'objects':{}}
- self.parse()
-
- def parse(self):
- self.lines = string.split(self.aetext, '\n')
- for l in self.lines:
- if l[:7] == '[event:':
- self.eventheader(l)
- elif l[:7] == '[/event':
- if len(self.currentevent)<>0:
- self.events.append(self.currentevent)
- self.currentevent = {'variables':{}, 'arguments':{}, 'objects':{}}
- self.objectindex = 0
- else:
- self.line(l)
-
- def line(self, value):
- '''interpret literals, variables, lists etc.'''
- # stuff in [ ], l ists
- varstart = string.find(value, '[')
- varstop = string.find(value, ']')
- if varstart <> -1 and varstop <> -1 and varstop>varstart:
- variable = value[varstart:varstop+1]
- name = 'aevar_'+string.zfill(self.varindex, 2)
- self.currentevent['variables'][name] = variable
- value = value[:varstart]+name+value[varstop+1:]
- self.varindex = self.varindex + 1
- # stuff in « »
- # these are 'ordinal' descriptors of 4 letter codes, so translate
- varstart = string.find(value, '«')
- varstop = string.find(value, '»')
- if varstart <> -1 and varstop <> -1 and varstop>varstart:
- variable = value[varstart+1:varstop]
- t = ''
- for i in range(0, len(variable), 2):
- c = eval('0x'+variable[i : i+2])
- t = t + chr(c)
-
- name = 'aevar_'+string.zfill(self.varindex, 2)
- self.currentevent['variables'][name] = '"' + t + '"'
- value = value[:varstart]+name+value[varstop+1:]
- self.varindex = self.varindex + 1
- pos = string.find(value, ':')
- if pos==-1:return
- ok = 1
- while ok <> None:
- value, ok = self.parseobject(value)
- self.currentevent['arguments'].update(self.splitparts(value, ':'))
-
- # remove the &subj argument?
- if self.currentevent['arguments'].has_key('&subj'):
- del self.currentevent['arguments']['&subj']
-
- # check for arguments len(a) < 4, and pad with spaces
- for k in self.currentevent['arguments'].keys():
- if len(k)<4:
- newk = k + (4-len(k))*' '
- self.currentevent['arguments'][newk] = self.currentevent['arguments'][k]
- del self.currentevent['arguments'][k]
-
- def parseobject(self, obj):
- a, b = self.findtag(obj)
- stuff = None
- if a<>None and b<>None:
- stuff = obj[a:b]
- name = 'AEobject_'+string.zfill(self.objectindex, 2)
- self.currentevent['objects'][name] = self.splitparts(stuff, ':')
- obj = obj[:a-5] + name + obj[b+1:]
- self.objectindex = self.objectindex +1
- return obj, stuff
-
- def nextopen(self, pos, text):
- return string.find(text, opentag, pos)
-
- def nextclosed(self, pos, text):
- return string.find(text, closetag, pos)
-
- def nexttag(self, pos, text):
- start = self.nextopen(pos, text)
- stop = self.nextclosed(pos, text)
- if start == -1:
- if stop == -1:
- return -1, -1
- return 0, stop
- if start < stop and start<>-1:
- return 1, start
- else:
- return 0, stop
-
- def findtag(self, text):
- p = -1
- last = None,None
- while 1:
- kind, p = self.nexttag(p+1, text)
- if last[0]==1 and kind==0:
- return last[1]+len(opentag), p
- if (kind, p) == (-1, -1):
- break
- last=kind, p
- return None, None
-
- def splitparts(self, txt, splitter):
- res = {}
- parts = string.split(txt, ', ')
- for p in parts:
- pos = string.find(p, splitter)
- key = string.strip(p[:pos])
- value = string.strip(p[pos+1:])
- res[key] = self.map(value)
- return res
-
- def eventheader(self, hdr):
- self.currentevent['event'] = self.splitparts(hdr[7:-1], '=')
-
- def printobject(self, d):
- '''print one object as python code'''
- t = []
- obj = {}
- obj.update(d)
- t.append("aetypes.ObjectSpecifier(")
- if obj.has_key('want'):
- t.append('want=' + self.map(obj['want']))
- del obj['want']
- t.append(', ')
- if obj.has_key('form'):
- t.append('form=' + addquotes(self.map(obj['form'])))
- del obj['form']
- t.append(', ')
- if obj.has_key('seld'):
- t.append('seld=' + self.map(obj['seld']))
- del obj['seld']
- t.append(', ')
- if obj.has_key('from'):
- t.append('fr=' + self.map(obj['from']))
- del obj['from']
- if len(obj.keys()) > 0:
- print '# ', `obj`
- t.append(")")
- return string.join(t, '')
-
- def map(self, t):
- '''map some Capture syntax to python
- matchstring : [(old, new), ... ]
- '''
- m = {
- 'type(': [('type(', "aetypes.Type('"), (')', "')")],
- "'null'()": [("'null'()", "None")],
- 'abso(': [('abso(', "aetypes.Unknown('abso', ")],
- '–': [('–', '"')],
- '”': [('”', '"')],
- '[': [('[', '('), (', ', ',')],
- ']': [(']', ')')],
- '«': [('«', "«")],
- '»': [('»', "»")],
-
- }
- for k in m.keys():
- if string.find(t, k) <> -1:
- for old, new in m[k]:
- p = string.split(t, old)
- t = string.join(p, new)
- return t
-
- def printevent(self, i):
- '''print the entire captured sequence as python'''
- evt = self.events[i]
- code = []
- code.append('\n# start event ' + `i` + ', talking to ' + evt['event']['target'])
- # get the signature for the target application
- code.append('talker = eventtalker("'+self.gettarget(evt['event']['target'])+'")')
- code.append("_arguments = {}")
- code.append("_attributes = {}")
- # write the variables
- for key, value in evt['variables'].items():
- value = evt['variables'][key]
- code.append(key + ' = ' + value)
- # write the object in the right order
- objkeys = evt['objects'].keys()
- objkeys.sort()
- for key in objkeys:
- value = evt['objects'][key]
- code.append(key + ' = ' + self.printobject(value))
- # then write the arguments
- for key, value in evt['arguments'].items():
- code.append("_arguments[" + addquotes(key) + "] = " + value )
- code.append('_reply, _arguments, _attributes = talker.send("'+
- evt['event']['class']+'", "'+evt['event']['id']+'", _arguments, _attributes)')
- code.append("if _arguments.has_key('errn'):")
- code.append('\traise aetools.Error, aetools.decodeerror(_arguments)')
- code.append("if _arguments.has_key('----'):")
- code.append("\tprint _arguments['----']")
- code.append('# end event ' + `i`)
- return string.join(code, '\n')
-
- def gettarget(self, target):
- '''get the signature for the target application'''
- target = target[1:-1]
- if target == 'Finder':
- return "MACS"
- apps = processes()
- for name, creator in apps:
- if name == target:
- return creator
- return '****'
-
- def makecode(self):
- code = []
- code.append("\n\n")
- code.append("# code generated by AECaptureParser v " + __version__)
- code.append("# imports, definitions for all events")
- code.append("import aetools")
- code.append("import aetypes")
- code.append("class eventtalker(aetools.TalkTo):")
- code.append("\tpass")
- code.append("# the events")
- # print the events
- for i in range(len(self.events)):
- code.append(self.printevent(i))
- code.append("# end code")
- return string.join(code, '\n')
-
-def addquotes(txt):
- quotes = ['"', "'"]
- if not txt[0] in quotes and not txt[-1] in quotes:
- return '"'+txt+'"'
- return txt
-
-
-
-
-
-
-# ------------------------------------------
-# the factory
-# ------------------------------------------
-
-# for instance, this event was captured from the Script Editor asking the Finder for a list of active processes.
-
-eventreceptacle = """
-
-[event: target="Finder", class=core, id=setd]
-'----':obj {form:prop, want:type(prop), seld:type(posn), from:obj {form:name, want:type(cfol), seld:–MoPar:Data:DevDev:Python:Python 1.5.2c1:Extensions”, from:'null'()}}, data:[100, 10]
-[/event]
-
-"""
-
-aet = AECaptureParser(eventreceptacle)
-print aet.makecode()
diff --git a/Mac/Contrib/AECaptureParser/readme.txt b/Mac/Contrib/AECaptureParser/readme.txt
deleted file mode 100644
index 1506111..0000000
--- a/Mac/Contrib/AECaptureParser/readme.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-AECaptureParser is a tool by Erik van Blokland, erik@letterror.com, which
-listens for AppleEvents and turns them into the Python code that will generate
-those events when executed.
-
-Lots more information is in the docstring in the code.
diff --git a/Mac/Contrib/BBPy.lm/BBPy.c b/Mac/Contrib/BBPy.lm/BBPy.c
deleted file mode 100644
index bcb8d4e..0000000
--- a/Mac/Contrib/BBPy.lm/BBPy.c
+++ /dev/null
@@ -1,456 +0,0 @@
-#include <AEDataModel.h>
-
-#define DEBUG 0
-
-#define kComponentSignatureString "BBPy.LM"
-#include <Debugging.h>
-
-
-#include <BBLMInterface.h>
-#include <BBXTInterface.h>
-//#include <BBLMTextIterator.h>
-
-#include <ctype.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdarg.h>
-
-#include <Sound.h>
-
-#if DEBUG
-void debugf_(const char* func,const char* fileName,long line, const char*fmt,...)
-{
- va_list arg;
- char msg[256];
- va_start(arg, fmt);
- vsnprintf(msg,256 ,fmt, arg);
- DebugAssert(COMPONENT_SIGNATURE, DEBUG_NO_OPTIONS, kComponentSignatureString ": " , msg, nil, fileName, line, 0 );
-
- //debug_string(msg);
-}
-#define debugf(FMT,...) debugf_( __FUNCTION__,__FILE__, __LINE__,FMT,__VA_ARGS__);
-#else
-#define debugf(FMT,...)
-#endif
-
-typedef const char *Str;
-
-
-enum{
- kPyBBLMStringSubst = kBBLMFirstUserRunKind
-};
-
-#define iswordchar(x) (isalnum(x)||x=='_')
-
-
-struct runloc{
- bool past_gap;
- long pos;
- long last_start;
- unsigned char*p;
-};
-
-char start(struct runloc& r,BBLMParamBlock &pb)
-{
- r.past_gap = false;
- r.last_start = pb.fCalcRunParams.fStartOffset;
- r.pos = pb.fCalcRunParams.fStartOffset;
- r.p = ((unsigned char*)pb.fText) + pb.fCalcRunParams.fStartOffset;
- // Adjust for the gap if weÕre not already past it.
- if ((!r.past_gap) && (r.pos >= pb.fTextGapLocation)){
- r.p += pb.fTextGapLength;
- r.past_gap = true;
- }
- return *r.p;
-
-}
-
-char nextchar(struct runloc&r,BBLMParamBlock &pb)
-{
- if ( r.pos< pb.fTextLength){
- ++r.pos;
- ++r.p;
- if ((!r.past_gap) && (r.pos >= pb.fTextGapLocation)){
- r.p += pb.fTextGapLength;
- r.past_gap = true;
- }
- return *r.p;
- }
- else{
- return 0;
- }
-}
-
-bool addRun(BBLMRunCode kind, int start,int len , const BBLMCallbackBlock& bblm_callbacks)
-{
- if (len > 0){ // Tie off the code run we were in, unless the length is zero.
- debugf("Run %d %d:%d", kind, start, start+len-1 );
- return bblmAddRun( &bblm_callbacks, 'Pyth',
- kind, start, len, false);
-
- }
- else{
- return true;
- }
-}
-
-bool addRunBefore (BBLMRunCode kind,struct runloc& r, const BBLMCallbackBlock& bblm_callbacks)
-{
- bool more_runs = addRun(kind, r.last_start, r.pos - r.last_start, bblm_callbacks);
- r.last_start = r.pos;
- return more_runs;
-}
-
-bool addRunTo (BBLMRunCode kind, struct runloc& r, const BBLMCallbackBlock& bblm_callbacks)
-{
- bool more_runs = addRun(kind, r.last_start, r.pos - r.last_start+1, bblm_callbacks);
- r.last_start = r.pos+1;
- return more_runs;
-}
-
-
-bool colorstr( char delim,
- BBLMParamBlock &pb,
- struct runloc &r,
- const BBLMCallbackBlock &bblm_callbacks)
-{
- bool tripple = false , pers = false, lookup = false, more_runs = true;
- char c = nextchar(r,pb);
-
- if (c == delim){
- c = nextchar(r,pb);
- if (c == delim){
- tripple = true;
- c = nextchar(r,pb);
- }
- else{
- //double
- return addRunBefore(kBBLMRunIsSingleString,r,bblm_callbacks);
- }
- }
- while (c && more_runs){
- if (pers ){
- if (isalpha(c)){
- more_runs = addRunTo(kPyBBLMStringSubst,r,bblm_callbacks);
- }
- else if (c == '('){
- lookup = true;
- }
- }
- pers = false;
- if (c == delim){
- if (tripple){
- if ((c = nextchar(r,pb))== delim && (c = nextchar(r,pb)) == delim){
- break; // end of tripple-quote.
- }
- }
- else{
- break; // end of single-quote.
- }
-
- }
- else if (c== '\\'){
- nextchar(r,pb);
- }
- else if (c=='\r'||c=='\n'){
- if (!tripple){
- break;
- }
- }
- else if (c=='%'){
- more_runs = addRunBefore(kBBLMRunIsSingleString,r,bblm_callbacks);
- pers = true;
- }
- else if (c==')' && lookup){
- more_runs = addRunTo(kPyBBLMStringSubst,r,bblm_callbacks);
- lookup = false;
- }
- c = nextchar(r,pb);
- }
- return more_runs && addRunTo(lookup?kPyBBLMStringSubst:kBBLMRunIsSingleString,r,bblm_callbacks);
-}
-
-bool colorcomment(BBLMParamBlock &pb,
- struct runloc &r,
- const BBLMCallbackBlock &bblm_callbacks)
-{
- while (char c = nextchar(r,pb)){
- if (c=='\r'|| c=='\n'){
- break;
- }
- }
- return addRunTo(kBBLMRunIsLineComment,r,bblm_callbacks);
-}
-
-void CalculateRuns(BBLMParamBlock &pb,
- const BBLMCallbackBlock &bblm_callbacks)
-
-{
- const struct rundesc *state = NULL;
- bool more_runs=true;
-
- struct runloc r;
-
- char c = start(r,pb);
-
- while (c && more_runs){
- loop:
- // Process a char
- if (state==NULL){
- //If we're in the basic 'code' state, check for each interesting char (rundelims[i].start).
- switch (c){
- case '\'':
- case '"':
- more_runs = addRunBefore(kBBLMRunIsCode,r,bblm_callbacks);
- if (more_runs){
- more_runs = colorstr(c,pb,r,bblm_callbacks);
- }
- break;
- case '#' :
- more_runs = addRunBefore(kBBLMRunIsCode,r,bblm_callbacks);
- if (more_runs){
- more_runs = colorcomment(pb,r,bblm_callbacks);
- }
- break;
- default:
- break;
- }
-
- }
- c = nextchar(r,pb);
- }
- if (more_runs){
- addRunBefore(kBBLMRunIsCode,r,bblm_callbacks);
- }
-
-
-}
-static void AdjustRange(BBLMParamBlock &params,
- const BBLMCallbackBlock &callbacks)
-{
- DescType language;
- BBLMRunCode kind;
- SInt32 charPos;
- SInt32 length;
- UInt32 index = params.fAdjustRangeParams.fStartIndex;
-
- while( index > 0 &&
- bblmGetRun(&callbacks, index, language, kind, charPos, length) &&
- (kind==kPyBBLMStringSubst||kind==kBBLMRunIsSingleString)){
- index--;
- };
- params.fAdjustRangeParams.fStartIndex = index;
-}
-
-
-// The next couple funcs process the text of a file assumming it's in 1 piece in memory,
-// so they may not be called from CalculateRuns.
-
-bool matchword(BBLMParamBlock &pb, const char *pat ,unsigned long *pos)
-{
- const char *asciText = (const char *) (pb.fTextIsUnicode?NULL:pb.fText);
-
- int i;
- for (i=0; pat[i]; i++){
- if (*pos+i>=pb.fTextLength){
- return false;
- }
- if (asciText[*pos+i] != pat[i]){
- return false;
- }
- }
- if ((*pos+i<pb.fTextLength)&&iswordchar(asciText[*pos+i])){
- return false;
- }
- *pos+=i;
- return true;
-}
-
-int matchindent(BBLMParamBlock &pb, UInt32 *pos)
-{
- const char *asciText = (const char *) (pb.fTextIsUnicode?NULL:pb.fText);
- int indent=0;
-
- while(*pos<pb.fTextLength){
- switch (/*(char)(pb.fTextIsUnicode?uniText[pos]:*/asciText[*pos]/*)*/){
- case ' ':
- ++*pos;
- indent++;
- break;
- case '\t':
- ++*pos;
- indent+=8;
- break;
- case '#':
- return -1;
- break;
- default:
- return indent;
- break;
- }
- }
-}
-
-
-void eat_line(BBLMParamBlock &pb, unsigned long* pos)
-{
- const char *asciText = (const char *) (pb.fTextIsUnicode?NULL:pb.fText);
- while (asciText[*pos]!='\r' && asciText[*pos]!='\n' && *pos<pb.fTextLength) {++*pos;}
- while ((asciText[*pos]=='\r' || asciText[*pos]=='\n') && *pos<pb.fTextLength) {++*pos;}
-
-}
-
-void addItem(BBLMParamBlock &pb, UInt32 pos, int nest, BBLMFunctionKinds kind,
- const BBLMCallbackBlock *bblm_callbacks)
-{
- UInt32 funcstartpos = pos;
- UInt32 funcnamelen=0;
- UInt32 offset=0;
- const char *asciText = (const char *) pb.fText;
- UInt32 index;
- OSErr err;
-
- while (isspace(asciText[pos]) && pos<pb.fTextLength) {++pos;}
- UInt32 fnamestart = pos;
- while ((isalnum(asciText[pos])||asciText[pos]=='_') && pos<pb.fTextLength) {pos++; funcnamelen++;}
-
- err = bblmAddTokenToBuffer( bblm_callbacks,
- pb.fFcnParams.fTokenBuffer,
- (void*)&asciText[fnamestart],
- funcnamelen,
- pb.fTextIsUnicode,
- &offset);
- BBLMProcInfo procInfo;
- procInfo.fFunctionStart = fnamestart; // char offset in file of first character of function
- procInfo.fFunctionEnd = pos; // char offset of last character of function
-
- procInfo.fSelStart = fnamestart; // first character to select when choosing function
- procInfo.fSelEnd = pos; // last character to select when choosing function
-
- procInfo.fFirstChar = fnamestart; // first character to make visible when choosing function
-
- procInfo.fKind = kind;
-
- procInfo.fIndentLevel = nest; // indentation level of token
- procInfo.fFlags = 0; // token flags (see BBLMFunctionFlags)
- procInfo.fNameStart = offset; // char offset in token buffer of token name
- procInfo.fNameLength = funcnamelen; // length of token name
-
- err = bblmAddFunctionToList(bblm_callbacks,
- pb.fFcnParams.fFcnList,
- procInfo,
- &index);
-}
-
-
-
-enum{
- maxnest=5
-};
-
-void ScanForFunctions(BBLMParamBlock &pb,
- const BBLMCallbackBlock &bblm_callbacks)
-{
-
- const char *asciText = (const char *) (pb.fTextIsUnicode?NULL:pb.fText);
- UniCharPtr uniText = (UniCharPtr) (pb.fTextIsUnicode?pb.fText:NULL);
-
- int indents[maxnest]= {0};
- int nest = 0;
-
- UInt32 pos=0; // current character offset
-
-
- while (pos<pb.fTextLength){
-
- int indent = matchindent(pb, &pos);
-
- if (indent >= 0){
- for (int i=0; i <= nest; i++){
- if (indent<=indents[i]){
- nest = i;
- indents[nest]=indent;
- goto x;
- }
- }
- indents[++nest]=indent;
- x:
-
- if (matchword(pb,"def",&pos)){
- addItem( pb, pos, nest, kBBLMFunctionMark, &bblm_callbacks);
- }
- else if (matchword(pb, "class", &pos)){
- addItem( pb, pos, nest, kBBLMTypedef, &bblm_callbacks);
- }
- }
- eat_line(pb,&pos);
- }
-
-}
-
-OSErr main( BBLMParamBlock &params,
- const BBLMCallbackBlock &bblm_callbacks,
- const BBXTCallbackBlock &bbxt_callbacks)
-{
- OSErr result;
-
- if ((params.fSignature != kBBLMParamBlockSignature) ||
- (params.fLength < sizeof(BBLMParamBlock)))
- {
- return paramErr;
- }
-
- switch (params.fMessage)
- {
- case kBBLMInitMessage:
- case kBBLMDisposeMessage:
- {
- result = noErr; // nothing to do
- break;
- }
-
- case kBBLMCalculateRunsMessage:
- CalculateRuns(params, bblm_callbacks);
- result = noErr;
- break;
-
- case kBBLMScanForFunctionsMessage:
- ScanForFunctions(params, bblm_callbacks);
- result = noErr;
- break;
-
- case kBBLMAdjustRangeMessage:
- AdjustRange(params, bblm_callbacks);
- result = noErr;
- break;
-
- case kBBLMMapRunKindToColorCodeMessage:
- switch (params.fMapRunParams.fRunKind){
- case kPyBBLMStringSubst:
- params.fMapRunParams.fColorCode = kBBLMSGMLAttributeNameColor;
- params.fMapRunParams.fMapped = true;
- break;
- default:
- params.fMapRunParams.fMapped = false;
- }
- result = noErr;
- break;
-
- case kBBLMEscapeStringMessage:
- case kBBLMAdjustEndMessage:
- case kBBLMMapColorCodeToColorMessage:
- case kBBLMSetCategoriesMessage:
- case kBBLMMatchKeywordMessage:
- {
- result = userCanceledErr;
- break;
- }
-
- default:
- {
- result = paramErr;
- break;
- }
- }
- return result;
-} \ No newline at end of file
diff --git a/Mac/Contrib/BBPy.lm/BBPythonLM.mcp b/Mac/Contrib/BBPy.lm/BBPythonLM.mcp
deleted file mode 100644
index 232954b..0000000
--- a/Mac/Contrib/BBPy.lm/BBPythonLM.mcp
+++ /dev/null
Binary files differ
diff --git a/Mac/Contrib/BBPy.lm/BBpy.r b/Mac/Contrib/BBPy.lm/BBpy.r
deleted file mode 100644
index 7d80b4a..0000000
--- a/Mac/Contrib/BBPy.lm/BBpy.r
+++ /dev/null
@@ -1,35 +0,0 @@
-#include "BBLMTypes.r"
-#include "MacTypes.r"
-
-#define kKeyWords 1057
-
-resource 'BBLF' (128, "Python Language Mappings", purgeable)
-{
- kCurrentBBLFVersion,
-
- {
- kLanguagePython,
- (kBBLMScansFunctions|kBBLMColorsSyntax|kBBLMIsCaseSensitive),
- kKeyWords,
- "Python",
- {
- kNeitherSourceNorInclude, ".py",
- }
- }
-};
-
-#define VERSION 0x1, 0x0, final, 0x0
-
-resource 'vers' (1) {
- VERSION,
- verUS,
- "1.1",
- "1.1,"
-};
-
-resource 'vers' (2) {
- VERSION,
- verUS,
- $$Date,
- $$Date
-};
diff --git a/Mac/Contrib/BBPy.lm/Python b/Mac/Contrib/BBPy.lm/Python
deleted file mode 100644
index 67ee70f..0000000
--- a/Mac/Contrib/BBPy.lm/Python
+++ /dev/null
@@ -1 +0,0 @@
-(This file must be converted with BinHex 4.0) :!!"#3Na08LTMD!#3""5,!!!$"mhr5Qpj)A"PCQC`Gh"M!!!!!EE-IXm!N!d$!!) !N!6rN!3!N!B5C!!!%Q3!!"*N!!!!i!!%"!$rN!3!N!B"E!!!!93!!!%l!!!68!) ""!$rN!3!N!pB!!!!J!3%"!#3#!%!!!!8rj!%!*!%rj!%!*!2!3!!!%3!!!"3!!! !8!!!!!%!N!8"!*!&"3#3"%)$J!0'!)!(3!X!N")i!!!!Q!-!!)!%!#D3!!-!#)! %!#D3!!-!")#N!"+!"!!QI!8#&*!!!`!-L!-!!#J!!!"!JJ!XJ+-!")!%!"jm"3" !3B!!()#M!!b!"!!LI!8#&*!!!`!-1!!!!CJ$!!#!B`!-L'-!!%k!!#!!N!8*)%! !N!GS!#)ZFh4KFR4IAdC50R*eEQa[Be)a0%*#6%e3BA*KE8*XEf0VJ+-!")!%!"C m"3"!3)!!@$J&!!'3!!-!")#M!!`i"3!"N!!$!!b)!`!!+!!!!%##!#b!S`!%J!3 !(R`&!%""J!!FJ+-!$)!%!#*m"3)8N!!$!!`i!!!"Q!-!!)"M!!b)B`!!6S!!)$K J!!"1J!!J!*!&#5"!!*!(E!!P,QjPH(4MD'&bAep'8MCbG@jXEf05-64#3Na08'& bB@e#E'pMD`"m#!+QN!!"!!L8)Ir!I'JEH(b!)hKmTbYi,!F!!%#"!#4m`c0i2)" 3H6L%G'Kp"80iI!B$H$N!!!")!!"45!!!#$KJ!!'!!3")1#%!3(`)!kC1J!!J!*! &#5""J!#3"P3!)LjKC'45G@jIAdCcD@P53c%h3N*-680KE'aLB@0V3Qa[BfYm#!+ QN!!"!!L8)Ir!I'NEH(b$)hKmT#YiI-8cH(cQ1hKp"d0iJBN!,%J!%&f!33!89'! '2RaJ!0!`!rrrI!!C%&3$"Mk!!3")1#%!3(`)!kC1J!!J!*!&#5""J!#3"P3!+5j LBQaY3@4N8R9ZAep'8%-a0d*#6%e$B@aXBQ&MDd*XEf0V9@acE'aL!(`)!UD6iIr mN!!"!!L8)Ir!I*mMH(bQ+hL!R`!)J"m!"(bN!&",rrl&J"m!"*!!(`!)J!%!5$J K!%"m#!1QJq(rr%k!!#!!N!8*)%'!!3#3"83!,LjKC'45G@j#C@C[FQ9IAdCc8MC bG@jXEf053c%h3N*-680KE'aLB@0V3Qa[BfYm#!+QNq(rr*!!!3!)P#(r`(bI)hK mTLYiJ*m!#)!I!!4mT!"31+8!!8[rrMf!R`!%1!3!!C!!(`!)J!%!5$JK!%"m#!1 QJq(rr%k!!#!!N!8*)%'!!3#3"8`!+LjKC'45G@j8EepI4R050R*eEQa[Be*$-6G #3Na03f&XE'*KBfY#E'pMDh`)!UDq`IrBN!!"!!L8)Iq3!(af'hKmQL0iI,XVH(c F-hJl)!!!1q!!!$[!!!!lS!!"If2EH(p%dhK,rrd"I(FEH(lJ"h4qf!GdI!$!!%# #!%KrBpYiId66H%[rr1&mB!GdI!$!!%##!"`l)!!"If2EH(p%dhK,rrc&I(FEH%J !!"JiB!!&If6EH(q&ihK,rrjT5!!"Q&Fj"Mjqf!Gd5!!"+&IJ"MiS!!!!3B)!2(l M"h4)!!(G,!-!!%'#!"`iB!%!If6EH(q&ihK,rrkaI(dEH%J!!"4qi!Gd,!!!+%# #!!Jl`!!"1q!!!(lJ"h4m!-!!3))!3#JC!!""JJ$NIf2EH(p%dhK,rr`eI'!(G(` B!!"!JJ#NIf2EH(p%dhK,rr`GI'!(G(`B!!""JJ#d5!!!L#`!!&a!JJ!8If2EH(p %dhK,rr[j5!!!F#`!!!e"JJ!-,!!!#N##!"!S'3!!3B)!J%J!!&3X!!!P3))!)$K J!!9rC0YiIiAMH%[rrAemI4Yi1q!!!8J!!$!X!!!T3))!+&I!"MiS!!!!3B)!($K J!3"rC0YiIiAMH%[rrG&mI4Yi1m!!!(pMfhKr400i5rrlIAah'hKqi!Gd,!!!!%' #!""AS!Bq+!!!!%##rXJl!!!!9k!'2LJ!!!""JJ!m9m!'2LJ!!!""JJ!-1!!"!%J !!!Ji!!!&I!-(0(pNfhKrKH0i5rrpD94J"MiS!!!!3B)!#$X!!!&r!m0iJ!%!H$J K!("m#!1QZX(rf%k!!#!!N!8*)%'!#J#3"!)m!$XZBfpXEh*cG(*IAdCM8M%d3N* -69"KFQ&Y3Qa[BfY50R*eEQa[Be*$-6G#3Na03f&XE'*KBfY#E'pMD`!!!$L#!&4 8B!BqI!3!VP3$"M*1J!!J!*!&#5"!!*!(&!!3,QPcB@a`D'&IAc0cG'4'D3!!I!J #TT2Krrb6`IriNk(rp*!!!3!)P#(rX(ap'hKmRL0iI,mVH%J!!"KmB!Gd,!!!$8' #!#3X!!!+3B)!((r$mhKrT1Yi5rrk-AaJ"h3X!!!!3),rf$KJ!!4ra20iIqAlH%[ rr&@!!3"B1#%!8(`)!kD$iIrmJm(rq)1Krr41J!!J!*!&#5""J!-!N!@!!$iZBfp XEh*MEfeYC@jdAep'8M%d3N*-69"KFQ&Y3Qa[BfY50R*eEQa[Be*$-6G#3Na03f& XE'*KBfY#E'pMDh`)!UD6iIrmNm(rq*1Krr56JIr`N!!"!!L8)IqJI(`EH(bG)hJ li!!"1'%!1(q%ihK,rrMCI(iEH%J!!+ar`!Gd,!!!)d'#!&a!J!!3,!!!)N#!!"4 )!!#!,!!!*d'#!!K)!!"d1'!!!$L"!$KrTHYi5rrkmAar'hKAi!Bq+!!!!%'#!&4 r`r0iIi6MH$LK!$KrTZYi5rrlfAar'hK)!!!i1'!!!$L"!$KrTHYi5rrkYAar'hK Ai!Bq+!!!!%'#!"KrJq0i1)%!1(qPkhK,rrjPI(mEH$KK!$KrK10i5rribAaq'hK r`!Gd,!!!!%'#!""Ai!Bq+!!!!%##rd4Ai!Bq+!!!!%'#!"3iB!!!1)%!1(qPkhK ,rrT0J!%!D$JK!'"m#!1QJq(rr)2"rrL$SIrdJi(rm%k!!#!!N!8*)%'!"!#3"!% i!$FZ3f&XBh9XBA4P8R9ZFepI4P)a0%*#6%e3BA*KE8*XEf0V8N-a0d*#6%e$B@a XBQ&MDd*XEf0V!!!!I!J#TT2Krrb6`IriNk(rp*!!!3!)P#(rS(ap'hKmRL0iJrd !*NJ!!!Jlrrrr+"m!!%'#!%"r`r0iIq6lH$LK!%3i`3"!11%!2$N"!$K)!!#09'! '2LJ!!!""JJ!BU!%!3#`!!3""J[r%,!!!"8'#rlb6r3!QJ!%!D$JK!'"m#!1QJq( rr)2"rrL$SIrd6S!!)!#3"3NJ3B!$!*!&N!!!05j"C'TeFh45B@jRC9pI4P)a0%* #6%e3BA*KE8*XEf0V8N-a0d*#6%e$B@aXBQ&MDd*XEf0V!(`)!UD3!!%!#*3Krm" mD4YiI)-MH(bN+hKma60iI1BlH(d(3hL"L3!N5!!)dB""!"48B!BqI'!!d$!$rrp m!"N39!-'2S!"!%Ji)3"!I!J$TNk!!#!!N!8*)%'!!*!'9!!Y,Q*LE'e(CA45G@j IAdC33c%h3N*-680KE'aLB@0V3Qa[BfYX8P9X8R05E&*X!(`)!UD6iIrmNm(rq*1 Krr53!!%!#*3Krl"m[LYiL!-!'LJ!!!""JJ!-1k!!!%J!!!L$S`!51q!!!%J!!%5 !(J!!I+$k&)!$!"Cm"3"!3B!!$$KJ!!")!!#3!(`G++jm"3GdI-!(G(`&!!""JJ! -1'!!!%J!!(3lr`!"1)3!!BM%!!"m`!Gd,!!!!%##rl5!(J!!I)$k&)!$!"Cm"!" !3)!!1(ap)+jmB`Gd5!!!N5`$!!"!JJ!FJ"i!!(`!qK4m(3#ZI!!(G#`!!&p!JJ! -1'!!!%J!!"5!(J!!I!$k&*!!(J!!1'!!!B!"!&Ji)3"3I!J$TS2Krrb$`IriJk( rp%k!!#!!N!8*)%'!!`#3"!%!!#3ZE@&dBfKhEh*NAep'8M%d3N*-69"KFQ&Y3Qa [BfY33f039@`!!$L#!&48B!BqI!3!VR!$!0"1J!!J!*!&#5"!!*!(&!!3,QPcB@a ZG@eIAc0cG'4'D3!!L!-!'LJ!!!""JJ!-1-!!!%J!!!L!``!511!!!%J!!'Km"LL ZI!!(G#`!!#""JJ!J3)!!%#`!!!P"JJ!S5!!!3#`!!#0"JJ!`5!!!0)#N!!!i"3! "N!!%!!!ij`!"5!!!+)#N!!!i"3!"N!!%!!!ij`!)5!!!&$KJrrp1J!!JI1-lH%k !!##!T!!!J!-!&R`&!%""J2q3!%k!!#!!N!8*)%!!N!HB!#-ZE@&dBfKTEQ4PER4 IAdC5-64#3Na08'&bB@e#E'pMDe"9E!!!!)J$!"SS!!!!3B)!$$M!!!")!!!BJ-- !%NJ!!"#!T!!!1!8!!C!!"!!!J+3!!(`'++jm!!Gd,!!!$8'#!#JX!!!+3B)!))! $!"Cm"3"!3B$rd%J!!"#!T!!!1!8!!C!!"!!!J+3!!(`'++jm!!Gd,!!!$8'#!!` X!!!+6))!))!$!"Cm"3"!3B$rd%k!!#!!N!8*)%!!N!H-!#!ZC@&dAfaTEQ9IAdC 5-64#3Na08'&bB@e#E'pMDe"9E!!!I!J#TVlKrpb3!!%!#*3Krf"mHKYiI*XMH(b m+hKmh60iI2ilH$[J!!!i!!!!N!!"!'L$'J!5IcMD&%J!!!`lH`!"1cN!!BKj!!" mB`Gd5!!#@5`$!!""JJ!3J"S!&R`E!%""J2rFIhIEH%J!!!`lH`!"1rm!!AmifK5 )H3!!I'-(G%[rrENX!`!!3))!&)JC!!"m!!Gd,!!!Ad##!"#!'J!@I"X!3%'!rmK r`r0iJ*S!*RbiZK4rj[YiL"S!'RcJ!0!`"rrrI!!j%&3("Mij!3"S5!!"5C,K!$L 6B3!mNZ%!3*0K!%55i3")9k!'2T!!!3"3Ni%!6$J!!!#3!!%!9)!"!'L3!!%!@*2 K!&ar`r0iJ*S!+MLK!$Ji`3"N5!!!GB!"!+Ji)3#JI!J$TVVKrpa1J!!J!*!&#5" "J!N!N!3"-!"(,Q&NC%PdC@eIAdC5-64#3Na08'&bB@e#E'pMDe9XD6%h3N*-68C eEQ0dD@pZ5fPZC(033c%h3N*-680KE'aLB@0V3Qa[BfX!!!"m#!+QN!!"!!L8)Ir !I'FEH(b$)hKmT#YiI-8cH)'(!"4)!!1jJ%%!&)!"!%Ji)3"!I!J$TNk!!#!!N!8 *)%'!!*!'1!"#,Q*LE'e"C'4'G@jMG'P[EP4[6'PcG&pI4P"$-6G#3Na03f&XE'* KBfY#E'pMDe9X8M%b3N*-69"bEf0*EQC[8&9XI!J#TT!!!3!)P#(r`(aT'hKmJb0 iI+3VH(c&-hKmjMYiI3G$H)'*!"")!!-PJ%%!&)!"!%Ji)3"!I!J$TNk!!#!!N!8 *)%'!!*!'3!!h,Q*LE'e"C'48EfYPEP4[3R9QCQ9bAep'8%-a0d*#6%e$B@aXBQ& MDd*XEf0V9@a3GP9XBP"9E!!!!$L#!&48B!BqI!3!VP3$"ha1J!!J!*!&#5"!!*! (&!!3,QPcFh"KBf9IAc0cG'4'D3!!I!J#TVpKrqb3!!%!#*3Kri"mI4YiI*iMH$[ L!"`iJJ&8J'3!!)!%!!53!'%!6*!!!3"3J'3!#)!%!!b3!'%!9*!!!3"BJ!3!%*! !!3"F1f!!!$J!!!#3!!%!5$Z"!%a)!!$FIk2VH$L"!%K,rrXa,!-!!%'!!,`iS!! !1)%!6$JE!!&m#31Q,"X!!%'!!#b!"!!!I!-!!%'"!"4mZbYi9+!31Ram!5j)!!! F1)3!"$LP!!&#!2rF1hX!!9GJ%$TmI!%ZIk2VH$L#!"!iS3")5rrjA94J"MiS!!! !3B)!)(qMkhL!J3")IfAEH$M!!!"rar0i5rrm18J!!$KrSqYiIq6lH$LK!%K,rrN P9'!'2LJ!!!""JJ!FIk2VH)#"!%KrCGYi1-!!!Ar(mhK,rr`"Ik2VH$L"!%K,rrX eJ'%!5)!G!"Cm!`"!3B$r()!"!)Ji)3#!I!J$TVYKrqa1J!!J!*!&#5""J!8!N!3 "@!!k,P0MB@j'Eh*'G@jMG'P[ER0IAdC5-64#3Na08'&bB@e#E'pMDe*$-6G#3Na 03f&XE'*KBfY#E'pMDh`)!UD3!!%!#*3Krm#!S`!!2!@YeLJ!BfK!JJ!3J!-!##J !!LC!J!!-1'$rcNJ!!*!!L!-!$#J!!!Y"J3#!1+)!*&3!%$TmT3!ZI+N$TNk!"#! iB!!!5!!!D%[rp6NiB!!!5!!!A%[rrINiB!!!5!!!8%[rpU8iB!!!5!!!4+J$!#B X!!%!3B)!#%J!!"Ji!!!)X!-!+$J!!!'B!`!U5!!!$$J!!!#B!`!U1'!!!%J!!"! iB2q!5!!!#$KJrmk!!3")1#%!3(`)!kC1J!!J!*!&#5""J!#3"X`!"5jYB@PZ!)! -!!#3!%%!&(`*!kD!6!!%6S!%)%k!!#!!N!`$)93$)53$)4`#*3&8C'9Q!b)4D!3 PBfaKFh-&)K)JJJ)+%EJ4Z"(-%GJ4`")B%KJ4j")B%KJJJJ%5'!'3#3+3"3'3%J3 )N!m`N!S)N!HJN!D!N"3)N!CJN!C!N"3)N!3"J*!(3*!C#*!(3!L3"S#!#*!13%! )N!S%J*!%3!L3#%#!#*!%3%!)N!@!N!X)J*!%#*!+!836!!!"!!!!!Q3!!!&N!!! !S`#3mai!!3!"8(PdD!!!!"-%)3C3HA4SEfi!!!%!!!-ZF(N!!!!2!3#!!!!!!c% Z-33a,M%X!!!!1!%!J!!!!"KAC@4ZCA0NBANX)%eKFQ0S)$FX)$)`-$%B9f9NEQ9 cC'&j,#"0BA*MD#!h,#!b-$!a!!!!Pf&ZC!N0BA0cCA*d$@*bC@&V$@0XBA0c$@0 [ER4TER9P$@4PCJeNC@`0C@aTCJePE(0P$@9iBf9`G!ePH'9M$@CTEQ&XE(N0CQp b$@CbEfd0Cfa[BQ&X$@PQ$@PYF'pbG!eTEJeTF`eXB@eLC'%0EQpd$@pb$A"KFh- 0F(*TER30FQ&TFf80FQ9dGA*Z$A4bH3ehD'PXC3d!!!"8!*!,!3#3%`&`Gh"M!*! 6!3#3%63'8(PdD'pZ!*!&!3!!!!*N!!!"C!!!!+066e*8!qS!J!!F!(S!!d*#6%B !!!!L9%9B9!!!!#jMCR*R!!!!1RCPFR-!!3"'!)!!!#!!N!F%)3!C!!!!F3#3"[r r!!!"$!BkdC!!!!(rr`!!!#)!N!8#rrm!!!!e!*!%'&"jG'K[EL"-B@jRG@&RC5" 0BA"`D@jRF`p3HA4SEfiJ5f9jGfpbC(26q`: \ No newline at end of file
diff --git a/Mac/Contrib/BBPy.lm/Python Keywords.rsrc b/Mac/Contrib/BBPy.lm/Python Keywords.rsrc
deleted file mode 100644
index f889e90..0000000
--- a/Mac/Contrib/BBPy.lm/Python Keywords.rsrc
+++ /dev/null
@@ -1 +0,0 @@
-(This file must be converted with BinHex 4.0) :!!"58e*$4'peC`#3#!(GM(8!N!3"!!!!!CX!!!#E!!!!3J#3mjGKEQ3*$@&cFf9 bG!eLFQ9KD`eME'&cF`eMEfjdD@jeC3eNC@B0C'9X$@9XD@B0C@acC3ePH'0PF(3 0CAKPB`eQD@jKE'aj$@C[FJeQFQpY$@GXEf*KE!eTCJeTEA"[FR30D@i0DA-0E'& YBQ4K$@j[G!e[FJe`BA0c$A"bD@jd$A*KDA0P$A*PG(9bEJedFRN0GfKTE'80!!! "!!!!!CX!!!#E!!!!3J1S!h`#qJ!!!"`!-J!!9%9B9!!!!!S%)3#3#Jp3HA4SEfi J5f9jGfpbC(0&9`: \ No newline at end of file
diff --git a/Mac/Contrib/BBPy.lm/PythonBBLM.txt b/Mac/Contrib/BBPy.lm/PythonBBLM.txt
deleted file mode 100644
index 540060a..0000000
--- a/Mac/Contrib/BBPy.lm/PythonBBLM.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-This is the Python Language Module for BBEdit.
-
-This software is a plugin to Bare Bones Software's BBEdit 6.0.2 (or more), designed to make editing & browsing Python Language files easer.
-
-It parses any file ending in .py (or extentions of your choice.) providing BBEdit with the information BBEdit needs to provide services for python files similar to those it provides for 'C'. Namely: syntax coloring and populating BBEdit's '€' popup menu with file's functions and classes.
-
-This Plug-in needs to be placed in your :BBEdit 6.0:BBEdit Support:Language Modules: folder.
-
-If you wish, I have no objections to redistributing it in whole or in part, modify it, or beating small fury animals to death with rolled up printouts of the source code.
-
-Christopher Stern
-cistern@earthlink.net \ No newline at end of file
diff --git a/Mac/Contrib/BBPy/PythonSlave.py b/Mac/Contrib/BBPy/PythonSlave.py
deleted file mode 100644
index b60f034..0000000
--- a/Mac/Contrib/BBPy/PythonSlave.py
+++ /dev/null
@@ -1,129 +0,0 @@
-"""PythonSlave.py
-An application that responds to three types of apple event:
- 'pyth'/'EXEC': execute direct parameter as Python
- 'aevt', 'quit': quit
- 'aevt', 'odoc': perform python scripts
-
-Copyright © 1996, Just van Rossum, Letterror
-"""
-
-__version__ = "0.1.3"
-
-import FrameWork
-import sys
-import traceback
-import aetools
-import string
-from Carbon import AE
-import EasyDialogs
-import os
-from Carbon import Qd
-from types import *
-from Carbon.Events import charCodeMask, cmdKey
-import MacOS
-from Carbon import Evt
-
-def dummyfunc(): pass
-
-modulefilename = dummyfunc.func_code.co_filename
-
-def Interact(timeout = 50000000): # timeout after 10 days...
- AE.AEInteractWithUser(timeout)
-
-
-class PythonSlave(FrameWork.Application):
- def __init__(self):
- FrameWork.Application.__init__(self)
- AE.AEInstallEventHandler('pyth', 'EXEC', ExecHandler)
- AE.AEInstallEventHandler('aevt', 'quit', QuitHandler)
- AE.AEInstallEventHandler('aevt', 'odoc', OpenDocumentHandler)
-
- def makeusermenus(self):
- self.filemenu = m = FrameWork.Menu(self.menubar, "File")
- self._quititem = FrameWork.MenuItem(m, "Quit", "Q", self._quit)
-
- def do_kHighLevelEvent(self, event):
- (what, message, when, where, modifiers) = event
- try:
- AE.AEProcessAppleEvent(event)
- except AE.Error, detail:
- print "Apple Event was not handled, error:", detail
-
- def do_key(self, event):
- (what, message, when, where, modifiers) = event
- c = chr(message & charCodeMask)
- if modifiers & cmdKey and c == '.':
- return
- FrameWork.Application.do_key(self, event)
-
- def idle(self, event):
- Qd.InitCursor()
-
- def quit(self, *args):
- raise self
-
- def getabouttext(self):
- return "About PythonSlaveƒ"
-
- def do_about(self, id, item, window, event):
- EasyDialogs.Message("PythonSlave " + __version__ + "\rCopyright © 1996, Letterror, JvR")
-
-
-def ExecHandler(theAppleEvent, theReply):
- parameters, args = aetools.unpackevent(theAppleEvent)
- if parameters.has_key('----'):
- if parameters.has_key('NAME'):
- print '--- executing "' + parameters['NAME'] + '" ---'
- else:
- print '--- executing "<unknown>" ---'
- stuff = parameters['----']
- MyExec(stuff + "\n") # execute input
- print '--- done ---'
- return 0
-
-def MyExec(stuff):
- stuff = string.splitfields(stuff, '\r') # convert return chars
- stuff = string.joinfields(stuff, '\n') # to newline chars
- Interact()
- saveyield = MacOS.EnableAppswitch(1)
- try:
- exec stuff in {}
- except:
- MacOS.EnableAppswitch(saveyield)
- traceback.print_exc()
- MacOS.EnableAppswitch(saveyield)
-
-def OpenDocumentHandler(theAppleEvent, theReply):
- parameters, args = aetools.unpackevent(theAppleEvent)
- docs = parameters['----']
- if type(docs) <> ListType:
- docs = [docs]
- for doc in docs:
- fss, a = doc.Resolve()
- path = fss.as_pathname()
- if path <> modulefilename:
- MyExecFile(path)
- return 0
-
-def MyExecFile(path):
- saveyield = MacOS.EnableAppswitch(1)
- savewd = os.getcwd()
- os.chdir(os.path.split(path)[0])
- print '--- Executing file "' + os.path.split(path)[1] + '"'
- try:
- execfile(path, {"__name__": "__main__"})
- except:
- traceback.print_exc()
- MacOS.EnableAppswitch(saveyield)
- MacOS.EnableAppswitch(saveyield)
- os.chdir(savewd)
- print "--- done ---"
-
-def QuitHandler(theAppleEvent, theReply):
- slave.quit()
- return 0
-
-
-slave = PythonSlave()
-print "PythonSlave", __version__, "ready."
-slave.mainloop()
diff --git a/Mac/Contrib/BBPy/README b/Mac/Contrib/BBPy/README
deleted file mode 100644
index f8c32f7..0000000
--- a/Mac/Contrib/BBPy/README
+++ /dev/null
@@ -1,45 +0,0 @@
-"Run as Python" -- a BBEdit extension to make the Python interpreter execute the
-contents of the current window.
-
-version 0.2.3, 18 september 1996
-
-Note by Jack:
- Also check out the BBPy.lm contributed software, which is a Python language
- module for BBedit, providing syntax coloring and function/class navigation.
-
-contents:
-- "Run as Python" -- the extension
-- PythonSlave.py -- the "slave" script that handles the AppleEvents
-
-- source -- source code & CW9 project for the extension
-
-quickstart:
-- drop "Run as Python" in BBEdit extensions folder
-- double-click PythonSlave.py
-- start BBEdit
-- type some code
-- go to Extensions menu: "Run as Python"
-- be happy
-
-warning:
- since PythonSlave.py runs its own event loop and we have no interface
- to SIOUX you *cannot* copy from the console. Duh.
-
-extra feature:
- while PythonSlave.py is running you can still double-click Python
- documents, they will get executed as if Python was not already running.
-
-bugs:
- perhaps
-
-acknowledgements:
-- Thanks to Joseph Strout for valuable input and beta testing.
-- Thanks to Mark Roseman for providing code that can launch
- PythonSlave.py from BBEdit.
-
-
-Have fun with it!
-Please report bugs, or fix 'em. Suggestions are always welcome.
-
-Just van Rossum, Letterror
-<just@knoware.nl>
diff --git a/Mac/Contrib/BBPy/Run as Python b/Mac/Contrib/BBPy/Run as Python
deleted file mode 100644
index 1ac6887..0000000
--- a/Mac/Contrib/BBPy/Run as Python
+++ /dev/null
@@ -1 +0,0 @@
-(This file must be converted with BinHex 4.0) :!!"#3PK88LTMD!#3#!Np!m`!N!3"!!!!#*N!!!HC!!!!T!#3)!e5G@iJBA-J8(P dD'pZE@9bCf9N@8fe69P0ELj`H@&X!J"849K88(PdD!#3','"lI%!N!B*23#3KB! !!`#3"8!""!"8!93%!ePPF`#3"N!!UJ"8!2S%!Nj[!*!&#!!m!$B"9)JqdP"jG'K [EP0XBACP,R"jdb"TFb"ZEh3JFR9ZEQPZCb`J$AG[G@aN)(P[G5"XD@YP)(4[)'a [Bf&dC5"TG$m!N!8)!!S!+!!US!)!!3!!!!i!+!!S!)`"N!!!J&99-!S!!!!%!!! #33!!!!B"!!"5!*!%"U*J#J!!3N*B9!#!!!")jq$)6VS!mN(krqSJ#+"96VS!N!" -ha-(6[S$)%(krpE4r!!!"T8J#+"96R9)j`B!@8mJE`!3)Qm!&#`[!"JHQ"pB!!% I@!!#(eJ!!bSAG!"J4")B%!%#3!#!C`c5!4!"5)")`05!B#JHJ4pB!!%3!3*!!%" R$$!Aj8ML3%M!e)"J$KpB!!)I@!!$*"IPLZ+#hE%S!&1&5S9ZZ&K260m!B%je51F 3)#4!)#`!"#B+PS"R3%U!CKa#,!!)-$bSRkG',`J`2+'BSdDaheE!4!!C3!!),`- [#Nkkrd3[!%kkrdj2l`!-+8S!"%SX!!KR"(!"SCK-h`3)6R9"q[lkdI`!!!D-)!L J9F'-6R91G5!-5IS!"LK86R8!N!4"q[rk))a1GBG6CA49F%%d!!"19[q1,`-YI&" jG'Mre&92,cacD@GZ5'lre%Ki!!4)E[r`-$`)*DJ@-"mf!%T$C`B`!f!!!F496bm m9%9B9#"Z!"4)D!!"F!!3%#m!5'lri$!m##@S&M!I0J"+3fF'-!0J!!'@98m[2&4 &@&3[,J!-,bi!%%KZrqJ`2!JPU"B`(cB!5N0R"M!$B!!"EP92,ca`HA4S,ca&@%9 $5'lrm$mmrrp#TdKZrrJ`2!X8U"B`(cB!5N0R"M!$B!!"2P925'lrq#mm,C!%5'l rk$!m"K#S&M!I0J"+3fF'-!0J!!%D98p)E[ri,ca138e&5'lri$!m"K#S&M!I0J" +3fF'-!0J!!$f98p)E[ri5'lrf%Ki!!-r2!!"5(MrrN+R3UF`2!dAU"B`(cB!$%2 pRfC)98mr2!#!3UHTK6!I0J!-3`!#CJC`!'!!!,*)E[q16VN!!!1q5J"B6fB'F!" J!!#F5'lrMNkj!!!%G$B!5N0B6fF1-!0J!!#%5N0R"$!$B(T96dKZrr!`2!)%U"B `(cB!5N0R"$!$B'*96dKZrq!`2!)%U"B`(cB!5N0R"$!$B%T96dKZrqJ`2!)%U"B `(cB!5N0R"$!$B$*96dKZrrJ`2!)%U"B`(cB!5N0R"$!$B"T96dKZrpJ`2!)%U"B `(cB!5N0R"$!$B!*`!#BI6Pj1GBa6C@jN9'9iG%&c388!!!"19[m!51FB-#CZ!!` Q,J!)6VVp`#J!,`0)E[m!U4PC6bm$)'X!!Nk3!#"I*%JJ5U!T5'lr!&P2,`T1Z3! !"RiJ(bm!,a)[#dkkrDSf!%T$6qm!%'F)2`-JD`"U6T!!)%UJ+L!%`Ba-h``B6Pi JAe"26Y#%E@&TEJ!!!%j@rjJ[#L4Z!!JYI&4&@&6rQ%(j!!!%-LP)!!![,!!!3QG )E[qB5'lrU$mm!!DTkL"X!!#J(dSZrkKQ"(!!B"JdV[qZ*@lrX!!#3HlrY%2U!!C `3+!ZF!%NAdjH6R@54f9d8(PdD'pZ8faKGQ96F'9M!!!!6PB!!#"Z!!JJ+!!J)LJ !*!b!9%9B9'B1$)&3HA4SCJC#,`!-B!BII!!"!!a1ALkI6R@-69P'58a&4NP-9%9 5!!!!6PErINMR%#!NEJ!),Aa03806rhj96bmmFfPRENKZrhj)H!!%5'lrLM!m##@ S&M!I0J"+3fF'-!0J!!'d98m[2%C14&)[2(0[F'9)E[q+2ccrrd+R5'lrq$!m#a5 S&M!I0J"+3fF'-!0J!!'%98mr%LmU!!*#TdKZrj*`!DT5-"p96d+R5'lrNNKZrr4 `!UJM-"p96d+R,`T)E[r`F!+S)c!I98p#Td+R3LG)E[rS-$`("UJ@-"mf!#"Zrr5 J+992,caKE'Pc)'lrp#m3@8m[,[rd6VN!!!Cq)"m[!%KZrq!`2!JPU"B`(b"Zrr5 J+P925'lrq#mm,C!%5'lri$!m"K#S&M!I0J"Q@P925'lri$!m!J5S&M!I)'lrm+! T98m[2'&XDA-JE[r`,a"C6bmZrr"1Z3!!"RiJ(bm!5'lrf$!m##@S&M!I)'lrm+! T98p)E[rS3UG)E[rB-$`'#DJ@-"mf!&925'lrf$!m!J5S&M!I98p)E[ri,caQFf9 X5'lrk$!m"K#S&M!I0J"96dKZrqJ`2!)%U"B`(e925'lrq%KZri*)H!!43QG)H2r r3UG#Tc!m$4HS&M!I0J"+3fF%-!0J+P925'lrq$!m!J5S&M!I0J"+3fF%-!0J%P9 25'lrJM!m!J5S&M!I0J!`!dcI"!K1ANjeN8aKG@jMD&"jG'K[EP0XBACP!!!LAb" IS#8ZJ'S#3TG1d3#3$!C"3iY!FUP!kp!!!!"(!#-J!!!!"RB`,M)Z-cPf-#ib,M- JU5"+GA0d)(CKEL"5Eh0cG@dJ,b"-CA4dCA*bEh)X)$aUGA0d3'aPG(4PFR*[FLj ZE$i!!!%!!!!)Q3!!"jN!!!#N#2`64#G-!!!!(!#@!!9fCA*c!!!!-N4*9%`!!!! q38a59!!!!%T#3PK'!!!!9N*#@%X!!!"L3N*B9!!!!'i!!Irr!!!(6JMm%5J!J2r r!*!*J2rr!!!!K!#3"B$rr`!!!*B!N!@!rrm!!!#H!*!&J!!!)!!!U!#3"!e5G@i JBA-J8(PdD'pZr0%: \ No newline at end of file
diff --git a/Mac/Contrib/BBPy/source/BB stuff/ExternalInterface.h b/Mac/Contrib/BBPy/source/BB stuff/ExternalInterface.h
deleted file mode 100644
index 51d206d..0000000
--- a/Mac/Contrib/BBPy/source/BB stuff/ExternalInterface.h
+++ /dev/null
@@ -1,716 +0,0 @@
-#pragma once
-
-#include <MixedMode.h>
-#include <Dialogs.h>
-#include <Files.h>
-#include <Windows.h>
-#include <AppleEvents.h>
-#include <StandardFile.h>
-
-#if defined(powerc) || defined (__powerc)
-#pragma options align=mac68k
-#endif
-
-typedef struct
-{
- FSSpec spec; // designates file on disk
- long key; // reserved for future expansion
-
- char tree; // 0 for absolute, 1 for project, 2 for system
- Boolean found; // FALSE if file couldn't be located; if so, all other info is moot
-
- OSType type; // file type of found file
- OSType crtr; // signature of found file's creator
-
- short spare0; // reserved for future expansion
- long spare1;
-} ProjectEntry;
-
-enum
-{
- kNeitherTree,
- kProjectTree,
- kSystemTree
-};
-
-enum
-{
- kTHINKCProject,
- kTHINKPascalProject,
- kCodeWarriorProject
-};
-
-// masks for the "flags" argument to new-convention interfaces
-
-#define xfWindowOpen 0x00000001
-#define xfWindowChangeable 0x00000002
-#define xfHasSelection 0x00000004
-#define xfUseDefaults 0x00000008
-#define xfIsBBEditLite 0x00000040
-#define xfIsBBEditDemo 0x00000080
-
-typedef struct
-{
- FSSpec spec;
- OSType key;
-
- short error_kind;
- long line_number;
-
- Str255 message;
-} ErrorEntry;
-
-typedef enum
-{
- kNote = 0,
- kError,
- kWarning
-} ErrorKind;
-
-#define kCurrentExternalVersion 5 // current version of callbacks
-
-// Universal callback interfaces
-
-#if USESROUTINEDESCRIPTORS
-
-#define ExtensionUPPInfo (kPascalStackBased \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ExternalCallbackBlock *))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(WindowPtr))))
-
-#define NewExtensionUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(OSErr))) \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ExternalCallbackBlock *))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(WindowPtr))) \
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long))) \
- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(AppleEvent *))) \
- | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(AppleEvent *))))
-
-#define GetWindowContentsUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(Handle))) \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(WindowPtr))))
-
-#define GetSelectionUPPInfo (kPascalStackBased \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long *))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long *))) \
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long *))))
-
-#define SetSelectionUPPInfo (kPascalStackBased \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long))) \
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long))))
-
-#define GetDocInfoUPPInfo (kPascalStackBased \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(WindowPtr))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(unsigned char *))) \
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(short *))) \
- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long *))))
-
-#define GetModDateUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(long))) \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(WindowPtr))))
-
-#define CopyUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(Handle))))
-
-#define PasteUPPInfo (kPascalStackBased \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Handle))))
-
-#define GetLastLineUPPInfo (kPascalStackBased | RESULT_SIZE(SIZE_CODE(sizeof(long))))
-
-#define GetLineNumberUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(long))) \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long))))
-
-#define GetLineStartUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(long))) \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long))))
-
-#define GetLineEndUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(long))) \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long))))
-
-#define GetLinePosUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(long))) \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long))))
-
-#define InsertUPPInfo (kPascalStackBased \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(char *))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long))))
-
-#define DeleteUPPInfo (kPascalStackBased)
-
-#define SetWindowContentsUPPInfo (kPascalStackBased \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(WindowPtr))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(Handle))))
-
-#define ContentsChangedUPPInfo (kPascalStackBased \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(WindowPtr))))
-
-#define GetFileTextUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(Handle))) \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(short))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long))) \
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(unsigned char *))) \
- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(Boolean *))))
-
-#define GetFolderUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(Boolean))) \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(unsigned char *))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(short *))) \
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long *))))
-
-#define OpenSeveralUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(Boolean))) \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Boolean))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(short *))) \
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(StandardFileReply ***))))
-
-#define CenterDialogUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(DialogPtr))) \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(short))))
-
-#define StandardFilterUPPInfo uppModalFilterProcInfo
-
-#define FrameDialogItemUPPInfo uppUserItemProcInfo
-
-#define NewDocumentUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(WindowPtr))))
-
-#define OpenDocumentUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(WindowPtr))))
-
-#define AllocateUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(Handle))) \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(Boolean))))
-
-#define FindPatternUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(long))) \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(char *))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long))) \
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long))) \
- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(char *))) \
- | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(long))) \
- | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(Boolean))))
-
-#define ReportOSErrorUPPInfo (kPascalStackBased)
-
-#define GetPreferenceUPPInfo (kPascalStackBased \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ResType))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(short))) \
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *))) \
- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(short *))))
-
-#define SetPreferenceUPPInfo (kPascalStackBased \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ResType))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(short))) \
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *))) \
- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(short *))))
-
-#define StartProgressUPPInfo (kPascalStackBased \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(unsigned char *))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long))) \
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(Boolean))))
-
-#define DoProgressUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(Boolean))) \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long))))
-
-#define DoneProgressUPPInfo (kPascalStackBased)
-
-#define GetProjectListUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(Boolean))) \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(FSSpec *))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(short *))) \
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(short *))) \
- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(ProjectEntry***))))
-
-#define ProjectTextListUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(Boolean))) \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(FSSpec *))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(Handle *))))
-
-#define PresetUndoUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(Boolean))))
-
-#define SetUndoUPPInfo (kPascalStackBased)
-
-#define OpenFileUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(Boolean))) \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(FSSpec *))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(WindowPtr *))))
-
-#define PrepareUndoUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(Boolean))) \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long))) \
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long))) \
- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long))))
-
-#define CommitUndoUPPInfo (kPascalStackBased \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long))))
-
-#define CreateResultsUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(Boolean))) \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(unsigned char *))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(short))) \
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(Handle))) \
- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(WindowPtr *))))
-
-typedef UniversalProcPtr GetWindowContentsProc;
-typedef UniversalProcPtr GetSelectionProc;
-typedef UniversalProcPtr SetSelectionProc;
-typedef UniversalProcPtr GetDocInfoProc;
-typedef UniversalProcPtr GetModDateProc;
-typedef UniversalProcPtr CopyProc;
-typedef UniversalProcPtr PasteProc;
-
-typedef UniversalProcPtr GetLastLineProc;
-typedef UniversalProcPtr GetLineNumberProc;
-typedef UniversalProcPtr GetLineStartProc;
-typedef UniversalProcPtr GetLineEndProc;
-typedef UniversalProcPtr GetLinePosProc;
-
-typedef UniversalProcPtr InsertProc;
-typedef UniversalProcPtr DeleteProc;
-
-typedef UniversalProcPtr SetWindowContentsProc;
-typedef UniversalProcPtr ContentsChangedProc;
-
-typedef UniversalProcPtr GetFileTextProc;
-
-typedef UniversalProcPtr GetFolderProc;
-typedef UniversalProcPtr OpenSeveralProc;
-
-typedef UniversalProcPtr CenterDialogProc;
-typedef UniversalProcPtr StandardFilterProc;
-typedef UniversalProcPtr FrameDialogItemProc;
-
-typedef UniversalProcPtr NewDocumentProc;
-typedef UniversalProcPtr OpenDocumentProc;
-
-typedef UniversalProcPtr AllocateProc;
-typedef UniversalProcPtr FindPatternProc;
-
-typedef UniversalProcPtr ReportOSErrorProc;
-
-typedef UniversalProcPtr GetPreferenceProc;
-typedef UniversalProcPtr SetPreferenceProc;
-
-typedef UniversalProcPtr StartProgressProc;
-typedef UniversalProcPtr DoProgressProc;
-typedef UniversalProcPtr DoneProgressProc;
-
-typedef UniversalProcPtr GetProjectListProc;
-typedef UniversalProcPtr ProjectTextListProc;
-
-typedef UniversalProcPtr PresetUndoProc;
-typedef UniversalProcPtr SetUndoProc;
-
-typedef UniversalProcPtr OpenFileProc;
-
-typedef UniversalProcPtr PrepareUndoProc;
-typedef UniversalProcPtr CommitUndoProc;
-
-typedef UniversalProcPtr CreateResultsProc;
-
-#define CallGetWindowContents(proc, w) \
- (Handle)(CallUniversalProc(proc, GetWindowContentsUPPInfo, (w)))
-
-#define CallGetSelection(proc, selStart, selEnd, firstChar) \
- (CallUniversalProc(proc, GetSelectionUPPInfo, (selStart), (selEnd), (firstChar)))
-
-#define CallSetSelection(proc, selStart, selEnd, firstChar) \
- (CallUniversalProc(proc, SetSelectionUPPInfo, (selStart), (selEnd), (firstChar)))
-
-#define CallGetDocInfo(proc, w, name, vRefNum, dirID) \
- (CallUniversalProc(proc, GetDocInfoUPPInfo, (w), (name), (vRefNum), (dirID)))
-
-#define CallGetModDate(proc, w) \
- (CallUniversalProc(proc, GetModDateUPPInfo, (w)))
-
-#define CallCopy(proc) \
- (Handle)(CallUniversalProc(proc, CopyUPPInfo))
-
-#define CallPaste(proc, h) \
- (CallUniversalProc(proc, PasteUPPInfo, (h)))
-
-#define CallGetLastLine(proc) \
- (CallUniversalProc(proc, GetLastLineUPPInfo))
-
-#define CallGetLineNumber(proc, sel) \
- (CallUniversalProc(proc, GetLineNumberUPPInfo, (sel)))
-
-#define CallGetLineStart(proc, sel) \
- (CallUniversalProc(proc, GetLineStartUPPInfo, (sel)))
-
-#define CallGetLineEnd(proc, sel) \
- (CallUniversalProc(proc, GetLineEndUPPInfo, (sel)))
-
-#define CallGetLinePos(proc, sel) \
- (CallUniversalProc(proc, GetLinePosUPPInfo, (sel)))
-
-#define CallInsert(proc, text, len) \
- (CallUniversalProc(proc, InsertUPPInfo, (text), (len)))
-
-#define CallDelete(proc) \
- (CallUniversalProc(proc, DeleteUPPInfo))
-
-#define CallSetWindowContents(proc, w, h) \
- (CallUniversalProc(proc, SetWindowContentsUPPInfo, (w), (h)))
-
-#define CallContentsChanged(proc, w) \
- (CallUniversalProc(proc, ContentsChangedUPPInfo, (w)))
-
-#define CallGetFileText(proc, vRefNum, dirID, name, canDispose) \
- (Handle)(CallUniversalProc(proc, GetFileTextUPPInfo, (vRefNum), (dirID), (name), (canDispose)))
-
-#define CallGetFolder(proc, prompt, vRefNum, dirID) \
- (Boolean)(CallUniversalProc(proc, GetFolderUPPInfo, (prompt), (vRefNum), (dirID)))
-
-#define CallOpenSeveral(proc, sort, file_count, files) \
- (Boolean)(CallUniversalProc(proc, OpenSeveralUPPInfo, (sort), (file_count), (files)))
-
-#define CallCenterDialog(proc, dialogID) \
- (DialogPtr)(CallUniversalProc(proc, CenterDialogUPPInfo, (dialogID)))
-
-#define CallStandardFilter(proc, d, event, item) \
- CallModalFilterProc(proc, (d), (event), (item))
-
-#define CallFrameDialogItem(proc, d, item) \
- CallUserItemProc(proc, (d), (item))
-
-#define CallNewDocument(proc) \
- (WindowPtr)(CallUniversalProc(proc, NewDocumentUPPInfo))
-
-#define CallOpenDocument(proc) \
- (WindowPtr)(CallUniversalProc(proc, OpenDocumentUPPInfo))
-
-#define CallAllocate(proc, size, clear) \
- (Handle)(CallUniversalProc(proc, AllocateUPPInfo, (size), (clear)))
-
-#define CallFindPattern(proc, text, text_len, text_offset, pat, pat_len, case_sens) \
- (CallUniversalProc(proc, FindPatternUPPInfo, (text), (text_len), (text_offset), \
- (pat), (pat_len), (case_sens)))
-
-#define CallReportOSError(proc, code) \
- (CallUniversalProc(proc, ReportOSErrorUPPInfo, (code)))
-
-#define CallGetPreference(proc, prefType, req_len, buffer, act_len) \
- (CallUniversalProc(proc, GetPreferenceUPPInfo, (prefType), (req_len), (buffer), (act_len)))
-
-#define CallSetPreference(proc, prefType, req_len, buffer, act_len) \
- (CallUniversalProc(proc, SetPreferenceUPPInfo, (prefType), (req_len), (buffer), (act_len)))
-
-#define CallStartProgress(proc, str, total, cancel_allowed) \
- (CallUniversalProc(proc, StartProgressUPPInfo, (str), (total), (cancel_allowed)))
-
-#define CallDoProgress(proc, done) \
- (Boolean)(CallUniversalProc(proc, DoProgressUPPInfo, (done)))
-
-#define CallDoneProgress(proc) \
- (CallUniversalProc(proc, DoneProgressUPPInfo))
-
-#define CallGetProjectList(proc, spec, kind, count, entries) \
- (Boolean)(CallUniversalProc(proc, GetProjectListUPPInfo, (spec), (kind), (count), (entries)))
-
-#define CallProjectTextList(proc, spec, text) \
- (Boolean)(CallUniversalProc(proc, ProjectTextListUPPInfo, (spec), (text)))
-
-#define CallPresetUndo(proc) \
- (Boolean)(CallUniversalProc(proc, PresetUndoUPPInfo))
-
-#define CallSetUndo(proc) \
- (CallUniversalProc(proc, SetUndoUPPInfo))
-
-#define CallOpenFile(proc, spec, w) \
- (Boolean)(CallUniversalProc(proc, OpenFileUPPInfo, (spec), (w)))
-
-#define CallPrepareUndo(proc, undo_start, undo_end, sel_start, sel_end) \
- (Boolean)(CallUniversalProc(proc, PrepareUndoUPPInfo, (undo_start), (undo_end), \
- (sel_start), (sel_end)))
-
-#define CallCommitUndo(proc, new_end) \
- (CallUniversalProc(proc, CommitUndoUPPInfo, (new_end)))
-
-#define CallCreateResults(proc, title, count, results, w) \
- (Boolean)(CallUniversalProc(proc, CreateResultsUPPInfo, (title), (count), (results), (w)))
-
-#else
-
-typedef pascal Handle (*GetWindowContentsProc)(WindowPtr w);
-typedef pascal void (*GetSelectionProc)(long *selStart, long *selEnd, long *firstChar);
-typedef pascal void (*SetSelectionProc)(long selStart, long selEnd, long firstChar);
-typedef pascal void (*GetDocInfoProc)(WindowPtr w, Str255 fName, short *vRefNum, long *dirID);
-typedef pascal long (*GetModDateProc)(WindowPtr w);
-typedef pascal Handle (*CopyProc)(void);
-typedef pascal void (*PasteProc)(Handle pasteText);
-
-typedef pascal long (*GetLastLineProc)(void);
-typedef pascal long (*GetLineNumberProc)(long selection);
-typedef pascal long (*GetLineStartProc)(long selection);
-typedef pascal long (*GetLineEndProc)(long selection);
-typedef pascal long (*GetLinePosProc)(long line);
-
-typedef pascal void (*InsertProc)(char *text, long len);
-typedef pascal void (*DeleteProc)(void);
-
-typedef pascal void (*SetWindowContentsProc)(WindowPtr w, Handle h);
-typedef pascal void (*ContentsChangedProc)(WindowPtr w);
-
-typedef pascal Handle (*GetFileTextProc)(short vRefNum, long dirID, Str255 fName, Boolean *canDispose);
-
-typedef pascal Boolean (*GetFolderProc)(Str255 prompt, short *vRefNum, long *dirID);
-typedef pascal Boolean (*OpenSeveralProc)(Boolean sort, short *file_count, StandardFileReply ***files);
-
-typedef pascal DialogPtr (*CenterDialogProc)(short dialogID);
-typedef pascal Boolean (*StandardFilterProc)(DialogPtr d, EventRecord *event, short *item);
-typedef pascal void (*FrameDialogItemProc)(DialogPtr d, short item);
-
-typedef pascal WindowPtr (*NewDocumentProc)(void);
-typedef pascal WindowPtr (*OpenDocumentProc)(void);
-
-typedef pascal Handle (*AllocateProc)(long size, Boolean clear);
-typedef pascal long (*FindPatternProc)(char *text, long text_len, long text_offset,
- char *pat, long pat_len,
- Boolean case_sensitive);
-
-typedef pascal void (*ReportOSErrorProc)(short code);
-
-typedef pascal void (*GetPreferenceProc)(ResType prefType, short req_len, void *buffer, short *act_len);
-typedef pascal void (*SetPreferenceProc)(ResType prefType, short req_len, void *buffer, short *act_len);
-
-typedef pascal void (*StartProgressProc)(Str255 str, long total, Boolean cancel_allowed);
-typedef pascal Boolean (*DoProgressProc)(long done);
-typedef pascal void (*DoneProgressProc)(void);
-
-typedef pascal Boolean (*GetProjectListProc)(FSSpec *spec, short *kind, short *count, ProjectEntry ***entries);
-typedef pascal Boolean (*ProjectTextListProc)(FSSpec *spec, Handle *text);
-
-typedef pascal Boolean (*PresetUndoProc)(void);
-typedef pascal void (*SetUndoProc)(void);
-
-typedef pascal Boolean (*OpenFileProc)(FSSpec *spec, WindowPtr *w);
-
-typedef pascal Boolean (*PrepareUndoProc)(long undo_start, long undo_end,
- long sel_start, long sel_end);
-typedef pascal void (*CommitUndoProc)(long new_end);
-
-typedef pascal Boolean (*CreateResultsProc)(Str255 title, short count, Handle results, WindowPtr *w);
-
-#define CallGetWindowContents(proc, w) \
- ((proc))((w))
-
-#define CallGetSelection(proc, selStart, selEnd, firstChar) \
- ((proc))((selStart), (selEnd), (firstChar))
-
-#define CallSetSelection(proc, selStart, selEnd, firstChar) \
- ((proc))((selStart), (selEnd), (firstChar))
-
-#define CallGetDocInfo(proc, w, name, vRefNum, dirID) \
- ((proc))((w), (name), (vRefNum), (dirID))
-
-#define CallGetModDate(proc, w) \
- ((proc))((w))
-
-#define CallCopy(proc) \
- ((proc))()
-
-#define CallPaste(proc, h) \
- ((proc))((h))
-
-#define CallGetLastLine(proc) \
- ((proc))()
-
-#define CallGetLineNumber(proc, sel) \
- ((proc))((sel))
-
-#define CallGetLineStart(proc, sel) \
- ((proc))((sel))
-
-#define CallGetLineEnd(proc, sel) \
- ((proc))((sel))
-
-#define CallGetLinePos(proc, sel) \
- ((proc))((sel))
-
-#define CallInsert(proc, text, len) \
- ((proc))((text), (len))
-
-#define CallDelete(proc) \
- ((proc))()
-
-#define CallSetWindowContents(proc, w, h) \
- ((proc))((w), (h))
-
-#define CallContentsChanged(proc, w) \
- ((proc))((w))
-
-#define CallGetFileText(proc, vRefNum, dirID, name, canDispose) \
- ((proc))((vRefNum), (dirID), (name), (canDispose))
-
-#define CallGetFolder(proc, prompt, vRefNum, dirID) \
- ((proc))((prompt), (vRefNum), (dirID))
-
-#define CallOpenSeveral(proc, sort, file_count, files) \
- ((proc))((sort), (file_count), (files))
-
-#define CallCenterDialog(proc, dialogID) \
- ((proc))((dialogID))
-
-#define CallStandardFilter(proc, d, event, item) \
- ((proc))((d), (event), (item))
-
-#define CallFrameDialogItem(proc, d, item) \
- ((proc))((d), (item))
-
-#define CallNewDocument(proc) \
- ((proc))()
-
-#define CallOpenDocument(proc) \
- ((proc))()
-
-#define CallAllocate(proc, size, clear) \
- ((proc))((size), (clear))
-
-#define CallFindPattern(proc, text, text_len, text_offset, pat, pat_len, case_sens) \
- ((proc))((text), (text_len), (text_offset), (pat), (pat_len), (case_sens))
-
-#define CallReportOSError(proc, code) \
- ((proc))((code))
-
-#define CallGetPreference(proc, prefType, req_len, buffer, act_len) \
- ((proc))((prefType), (req_len), (buffer), (act_len))
-
-#define CallSetPreference(proc, prefType, req_len, buffer, act_len) \
- ((proc))((prefType), (req_len), (buffer), (act_len))
-
-#define CallStartProgress(proc, str, total, cancel_allowed) \
- ((proc))((str), (total), (cancel_allowed))
-
-#define CallDoProgress(proc, done) \
- ((proc))((done))
-
-#define CallDoneProgress(proc) \
- ((proc))()
-
-#define CallGetProjectList(proc, spec, kind, count, entries) \
- ((proc))((spec), (kind), (count), (entries))
-
-#define CallProjectTextList(proc, spec, text) \
- ((proc))((spec), (text))
-
-#define CallPresetUndo(proc) \
- ((proc))()
-
-#define CallSetUndo(proc) \
- ((proc))()
-
-#define CallOpenFile(proc, spec, w) \
- ((proc))((spec), (w))
-
-#define CallPrepareUndo(proc, undo_start, undo_end, sel_start, sel_end) \
- ((proc))((undo_start), (undo_end), (sel_start), (sel_end))
-
-#define CallCommitUndo(proc, new_end) \
- ((proc))((new_end))
-
-#define CallCreateResults(proc, title, count, results, w) \
- ((proc))((title), (count), (results), (w))
-
-#endif
-
-
-typedef struct
-{
- short version;
-
- // version 1 callbacks
-
- GetWindowContentsProc GetWindowContents;
- GetSelectionProc GetSelection;
- SetSelectionProc SetSelection;
- GetDocInfoProc GetDocInfo;
- GetModDateProc GetModDate;
- CopyProc Copy;
- PasteProc Paste;
-
- // version 2 callbacks
-
- /* Text-Editing stuff */
- GetLastLineProc GetLastLine;
- GetLineNumberProc GetLineNumber;
- GetLineStartProc GetLineStart;
- GetLineEndProc GetLineEnd;
- GetLinePosProc GetLinePos;
-
- InsertProc Insert;
- DeleteProc Delete;
-
- /* Getting and Setting window text */
- SetWindowContentsProc SetWindowContents;
- ContentsChangedProc ContentsChanged;
-
- /* Reading file text */
- GetFileTextProc GetFileText;
-
- /* Direct user-interface calls */
- GetFolderProc GetFolder;
- OpenSeveralProc OpenSeveral;
-
- CenterDialogProc CenterDialog;
- StandardFilterProc StandardFilter;
- FrameDialogItemProc FrameDialogItem;
-
- NewDocumentProc NewDocument;
- OpenDocumentProc OpenDocument;
-
- /* Utility Routines */
- AllocateProc Allocate;
- FindPatternProc FindPattern;
-
- ReportOSErrorProc ReportOSError;
-
- /* Preference routines */
- GetPreferenceProc GetPreference;
- SetPreferenceProc SetPreference;
-
- /* Progress routines */
- StartProgressProc StartProgress;
- DoProgressProc DoProgress;
- DoneProgressProc DoneProgress;
-
- // Version 3 callbacks
- GetProjectListProc GetProjectList;
- ProjectTextListProc ProjectTextList;
-
- // version 4 callbacks
-
- PresetUndoProc PresetUndo;
- SetUndoProc SetUndo;
-
- OpenFileProc OpenFile;
-
- // version 5 callbacks
-
- PrepareUndoProc PrepareUndo;
- CommitUndoProc CommitUndo;
-
- CreateResultsProc CreateResults;
-
-} ExternalCallbackBlock;
-
-#if defined(powerc) || defined (__powerc)
-#pragma options align=reset
-#endif
-
-/*
- 'main' for a BBXT is declared:
-
-pascal void main(ExternalCallbackBlock *callbacks, WindowPtr w); [C]
-
- The 'new' calling convention, which passes more information
- and allows scriptability, is this:
-
-pascal OSErr main(ExternalCallbackBlock *callbacks, WindowPtr w, long flags, AppleEvent *event, AppleEvent *reply);
-*/
diff --git a/Mac/Contrib/BBPy/source/BB-stuff/ExternalInterface.h b/Mac/Contrib/BBPy/source/BB-stuff/ExternalInterface.h
deleted file mode 100644
index 51d206d..0000000
--- a/Mac/Contrib/BBPy/source/BB-stuff/ExternalInterface.h
+++ /dev/null
@@ -1,716 +0,0 @@
-#pragma once
-
-#include <MixedMode.h>
-#include <Dialogs.h>
-#include <Files.h>
-#include <Windows.h>
-#include <AppleEvents.h>
-#include <StandardFile.h>
-
-#if defined(powerc) || defined (__powerc)
-#pragma options align=mac68k
-#endif
-
-typedef struct
-{
- FSSpec spec; // designates file on disk
- long key; // reserved for future expansion
-
- char tree; // 0 for absolute, 1 for project, 2 for system
- Boolean found; // FALSE if file couldn't be located; if so, all other info is moot
-
- OSType type; // file type of found file
- OSType crtr; // signature of found file's creator
-
- short spare0; // reserved for future expansion
- long spare1;
-} ProjectEntry;
-
-enum
-{
- kNeitherTree,
- kProjectTree,
- kSystemTree
-};
-
-enum
-{
- kTHINKCProject,
- kTHINKPascalProject,
- kCodeWarriorProject
-};
-
-// masks for the "flags" argument to new-convention interfaces
-
-#define xfWindowOpen 0x00000001
-#define xfWindowChangeable 0x00000002
-#define xfHasSelection 0x00000004
-#define xfUseDefaults 0x00000008
-#define xfIsBBEditLite 0x00000040
-#define xfIsBBEditDemo 0x00000080
-
-typedef struct
-{
- FSSpec spec;
- OSType key;
-
- short error_kind;
- long line_number;
-
- Str255 message;
-} ErrorEntry;
-
-typedef enum
-{
- kNote = 0,
- kError,
- kWarning
-} ErrorKind;
-
-#define kCurrentExternalVersion 5 // current version of callbacks
-
-// Universal callback interfaces
-
-#if USESROUTINEDESCRIPTORS
-
-#define ExtensionUPPInfo (kPascalStackBased \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ExternalCallbackBlock *))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(WindowPtr))))
-
-#define NewExtensionUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(OSErr))) \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ExternalCallbackBlock *))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(WindowPtr))) \
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long))) \
- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(AppleEvent *))) \
- | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(AppleEvent *))))
-
-#define GetWindowContentsUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(Handle))) \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(WindowPtr))))
-
-#define GetSelectionUPPInfo (kPascalStackBased \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long *))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long *))) \
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long *))))
-
-#define SetSelectionUPPInfo (kPascalStackBased \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long))) \
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long))))
-
-#define GetDocInfoUPPInfo (kPascalStackBased \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(WindowPtr))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(unsigned char *))) \
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(short *))) \
- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long *))))
-
-#define GetModDateUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(long))) \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(WindowPtr))))
-
-#define CopyUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(Handle))))
-
-#define PasteUPPInfo (kPascalStackBased \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Handle))))
-
-#define GetLastLineUPPInfo (kPascalStackBased | RESULT_SIZE(SIZE_CODE(sizeof(long))))
-
-#define GetLineNumberUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(long))) \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long))))
-
-#define GetLineStartUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(long))) \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long))))
-
-#define GetLineEndUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(long))) \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long))))
-
-#define GetLinePosUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(long))) \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long))))
-
-#define InsertUPPInfo (kPascalStackBased \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(char *))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long))))
-
-#define DeleteUPPInfo (kPascalStackBased)
-
-#define SetWindowContentsUPPInfo (kPascalStackBased \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(WindowPtr))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(Handle))))
-
-#define ContentsChangedUPPInfo (kPascalStackBased \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(WindowPtr))))
-
-#define GetFileTextUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(Handle))) \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(short))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long))) \
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(unsigned char *))) \
- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(Boolean *))))
-
-#define GetFolderUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(Boolean))) \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(unsigned char *))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(short *))) \
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long *))))
-
-#define OpenSeveralUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(Boolean))) \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Boolean))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(short *))) \
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(StandardFileReply ***))))
-
-#define CenterDialogUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(DialogPtr))) \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(short))))
-
-#define StandardFilterUPPInfo uppModalFilterProcInfo
-
-#define FrameDialogItemUPPInfo uppUserItemProcInfo
-
-#define NewDocumentUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(WindowPtr))))
-
-#define OpenDocumentUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(WindowPtr))))
-
-#define AllocateUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(Handle))) \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(Boolean))))
-
-#define FindPatternUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(long))) \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(char *))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long))) \
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long))) \
- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(char *))) \
- | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(long))) \
- | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(Boolean))))
-
-#define ReportOSErrorUPPInfo (kPascalStackBased)
-
-#define GetPreferenceUPPInfo (kPascalStackBased \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ResType))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(short))) \
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *))) \
- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(short *))))
-
-#define SetPreferenceUPPInfo (kPascalStackBased \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ResType))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(short))) \
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *))) \
- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(short *))))
-
-#define StartProgressUPPInfo (kPascalStackBased \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(unsigned char *))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long))) \
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(Boolean))))
-
-#define DoProgressUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(Boolean))) \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long))))
-
-#define DoneProgressUPPInfo (kPascalStackBased)
-
-#define GetProjectListUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(Boolean))) \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(FSSpec *))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(short *))) \
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(short *))) \
- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(ProjectEntry***))))
-
-#define ProjectTextListUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(Boolean))) \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(FSSpec *))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(Handle *))))
-
-#define PresetUndoUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(Boolean))))
-
-#define SetUndoUPPInfo (kPascalStackBased)
-
-#define OpenFileUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(Boolean))) \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(FSSpec *))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(WindowPtr *))))
-
-#define PrepareUndoUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(Boolean))) \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long))) \
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long))) \
- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long))))
-
-#define CommitUndoUPPInfo (kPascalStackBased \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long))))
-
-#define CreateResultsUPPInfo (kPascalStackBased \
- | RESULT_SIZE(SIZE_CODE(sizeof(Boolean))) \
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(unsigned char *))) \
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(short))) \
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(Handle))) \
- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(WindowPtr *))))
-
-typedef UniversalProcPtr GetWindowContentsProc;
-typedef UniversalProcPtr GetSelectionProc;
-typedef UniversalProcPtr SetSelectionProc;
-typedef UniversalProcPtr GetDocInfoProc;
-typedef UniversalProcPtr GetModDateProc;
-typedef UniversalProcPtr CopyProc;
-typedef UniversalProcPtr PasteProc;
-
-typedef UniversalProcPtr GetLastLineProc;
-typedef UniversalProcPtr GetLineNumberProc;
-typedef UniversalProcPtr GetLineStartProc;
-typedef UniversalProcPtr GetLineEndProc;
-typedef UniversalProcPtr GetLinePosProc;
-
-typedef UniversalProcPtr InsertProc;
-typedef UniversalProcPtr DeleteProc;
-
-typedef UniversalProcPtr SetWindowContentsProc;
-typedef UniversalProcPtr ContentsChangedProc;
-
-typedef UniversalProcPtr GetFileTextProc;
-
-typedef UniversalProcPtr GetFolderProc;
-typedef UniversalProcPtr OpenSeveralProc;
-
-typedef UniversalProcPtr CenterDialogProc;
-typedef UniversalProcPtr StandardFilterProc;
-typedef UniversalProcPtr FrameDialogItemProc;
-
-typedef UniversalProcPtr NewDocumentProc;
-typedef UniversalProcPtr OpenDocumentProc;
-
-typedef UniversalProcPtr AllocateProc;
-typedef UniversalProcPtr FindPatternProc;
-
-typedef UniversalProcPtr ReportOSErrorProc;
-
-typedef UniversalProcPtr GetPreferenceProc;
-typedef UniversalProcPtr SetPreferenceProc;
-
-typedef UniversalProcPtr StartProgressProc;
-typedef UniversalProcPtr DoProgressProc;
-typedef UniversalProcPtr DoneProgressProc;
-
-typedef UniversalProcPtr GetProjectListProc;
-typedef UniversalProcPtr ProjectTextListProc;
-
-typedef UniversalProcPtr PresetUndoProc;
-typedef UniversalProcPtr SetUndoProc;
-
-typedef UniversalProcPtr OpenFileProc;
-
-typedef UniversalProcPtr PrepareUndoProc;
-typedef UniversalProcPtr CommitUndoProc;
-
-typedef UniversalProcPtr CreateResultsProc;
-
-#define CallGetWindowContents(proc, w) \
- (Handle)(CallUniversalProc(proc, GetWindowContentsUPPInfo, (w)))
-
-#define CallGetSelection(proc, selStart, selEnd, firstChar) \
- (CallUniversalProc(proc, GetSelectionUPPInfo, (selStart), (selEnd), (firstChar)))
-
-#define CallSetSelection(proc, selStart, selEnd, firstChar) \
- (CallUniversalProc(proc, SetSelectionUPPInfo, (selStart), (selEnd), (firstChar)))
-
-#define CallGetDocInfo(proc, w, name, vRefNum, dirID) \
- (CallUniversalProc(proc, GetDocInfoUPPInfo, (w), (name), (vRefNum), (dirID)))
-
-#define CallGetModDate(proc, w) \
- (CallUniversalProc(proc, GetModDateUPPInfo, (w)))
-
-#define CallCopy(proc) \
- (Handle)(CallUniversalProc(proc, CopyUPPInfo))
-
-#define CallPaste(proc, h) \
- (CallUniversalProc(proc, PasteUPPInfo, (h)))
-
-#define CallGetLastLine(proc) \
- (CallUniversalProc(proc, GetLastLineUPPInfo))
-
-#define CallGetLineNumber(proc, sel) \
- (CallUniversalProc(proc, GetLineNumberUPPInfo, (sel)))
-
-#define CallGetLineStart(proc, sel) \
- (CallUniversalProc(proc, GetLineStartUPPInfo, (sel)))
-
-#define CallGetLineEnd(proc, sel) \
- (CallUniversalProc(proc, GetLineEndUPPInfo, (sel)))
-
-#define CallGetLinePos(proc, sel) \
- (CallUniversalProc(proc, GetLinePosUPPInfo, (sel)))
-
-#define CallInsert(proc, text, len) \
- (CallUniversalProc(proc, InsertUPPInfo, (text), (len)))
-
-#define CallDelete(proc) \
- (CallUniversalProc(proc, DeleteUPPInfo))
-
-#define CallSetWindowContents(proc, w, h) \
- (CallUniversalProc(proc, SetWindowContentsUPPInfo, (w), (h)))
-
-#define CallContentsChanged(proc, w) \
- (CallUniversalProc(proc, ContentsChangedUPPInfo, (w)))
-
-#define CallGetFileText(proc, vRefNum, dirID, name, canDispose) \
- (Handle)(CallUniversalProc(proc, GetFileTextUPPInfo, (vRefNum), (dirID), (name), (canDispose)))
-
-#define CallGetFolder(proc, prompt, vRefNum, dirID) \
- (Boolean)(CallUniversalProc(proc, GetFolderUPPInfo, (prompt), (vRefNum), (dirID)))
-
-#define CallOpenSeveral(proc, sort, file_count, files) \
- (Boolean)(CallUniversalProc(proc, OpenSeveralUPPInfo, (sort), (file_count), (files)))
-
-#define CallCenterDialog(proc, dialogID) \
- (DialogPtr)(CallUniversalProc(proc, CenterDialogUPPInfo, (dialogID)))
-
-#define CallStandardFilter(proc, d, event, item) \
- CallModalFilterProc(proc, (d), (event), (item))
-
-#define CallFrameDialogItem(proc, d, item) \
- CallUserItemProc(proc, (d), (item))
-
-#define CallNewDocument(proc) \
- (WindowPtr)(CallUniversalProc(proc, NewDocumentUPPInfo))
-
-#define CallOpenDocument(proc) \
- (WindowPtr)(CallUniversalProc(proc, OpenDocumentUPPInfo))
-
-#define CallAllocate(proc, size, clear) \
- (Handle)(CallUniversalProc(proc, AllocateUPPInfo, (size), (clear)))
-
-#define CallFindPattern(proc, text, text_len, text_offset, pat, pat_len, case_sens) \
- (CallUniversalProc(proc, FindPatternUPPInfo, (text), (text_len), (text_offset), \
- (pat), (pat_len), (case_sens)))
-
-#define CallReportOSError(proc, code) \
- (CallUniversalProc(proc, ReportOSErrorUPPInfo, (code)))
-
-#define CallGetPreference(proc, prefType, req_len, buffer, act_len) \
- (CallUniversalProc(proc, GetPreferenceUPPInfo, (prefType), (req_len), (buffer), (act_len)))
-
-#define CallSetPreference(proc, prefType, req_len, buffer, act_len) \
- (CallUniversalProc(proc, SetPreferenceUPPInfo, (prefType), (req_len), (buffer), (act_len)))
-
-#define CallStartProgress(proc, str, total, cancel_allowed) \
- (CallUniversalProc(proc, StartProgressUPPInfo, (str), (total), (cancel_allowed)))
-
-#define CallDoProgress(proc, done) \
- (Boolean)(CallUniversalProc(proc, DoProgressUPPInfo, (done)))
-
-#define CallDoneProgress(proc) \
- (CallUniversalProc(proc, DoneProgressUPPInfo))
-
-#define CallGetProjectList(proc, spec, kind, count, entries) \
- (Boolean)(CallUniversalProc(proc, GetProjectListUPPInfo, (spec), (kind), (count), (entries)))
-
-#define CallProjectTextList(proc, spec, text) \
- (Boolean)(CallUniversalProc(proc, ProjectTextListUPPInfo, (spec), (text)))
-
-#define CallPresetUndo(proc) \
- (Boolean)(CallUniversalProc(proc, PresetUndoUPPInfo))
-
-#define CallSetUndo(proc) \
- (CallUniversalProc(proc, SetUndoUPPInfo))
-
-#define CallOpenFile(proc, spec, w) \
- (Boolean)(CallUniversalProc(proc, OpenFileUPPInfo, (spec), (w)))
-
-#define CallPrepareUndo(proc, undo_start, undo_end, sel_start, sel_end) \
- (Boolean)(CallUniversalProc(proc, PrepareUndoUPPInfo, (undo_start), (undo_end), \
- (sel_start), (sel_end)))
-
-#define CallCommitUndo(proc, new_end) \
- (CallUniversalProc(proc, CommitUndoUPPInfo, (new_end)))
-
-#define CallCreateResults(proc, title, count, results, w) \
- (Boolean)(CallUniversalProc(proc, CreateResultsUPPInfo, (title), (count), (results), (w)))
-
-#else
-
-typedef pascal Handle (*GetWindowContentsProc)(WindowPtr w);
-typedef pascal void (*GetSelectionProc)(long *selStart, long *selEnd, long *firstChar);
-typedef pascal void (*SetSelectionProc)(long selStart, long selEnd, long firstChar);
-typedef pascal void (*GetDocInfoProc)(WindowPtr w, Str255 fName, short *vRefNum, long *dirID);
-typedef pascal long (*GetModDateProc)(WindowPtr w);
-typedef pascal Handle (*CopyProc)(void);
-typedef pascal void (*PasteProc)(Handle pasteText);
-
-typedef pascal long (*GetLastLineProc)(void);
-typedef pascal long (*GetLineNumberProc)(long selection);
-typedef pascal long (*GetLineStartProc)(long selection);
-typedef pascal long (*GetLineEndProc)(long selection);
-typedef pascal long (*GetLinePosProc)(long line);
-
-typedef pascal void (*InsertProc)(char *text, long len);
-typedef pascal void (*DeleteProc)(void);
-
-typedef pascal void (*SetWindowContentsProc)(WindowPtr w, Handle h);
-typedef pascal void (*ContentsChangedProc)(WindowPtr w);
-
-typedef pascal Handle (*GetFileTextProc)(short vRefNum, long dirID, Str255 fName, Boolean *canDispose);
-
-typedef pascal Boolean (*GetFolderProc)(Str255 prompt, short *vRefNum, long *dirID);
-typedef pascal Boolean (*OpenSeveralProc)(Boolean sort, short *file_count, StandardFileReply ***files);
-
-typedef pascal DialogPtr (*CenterDialogProc)(short dialogID);
-typedef pascal Boolean (*StandardFilterProc)(DialogPtr d, EventRecord *event, short *item);
-typedef pascal void (*FrameDialogItemProc)(DialogPtr d, short item);
-
-typedef pascal WindowPtr (*NewDocumentProc)(void);
-typedef pascal WindowPtr (*OpenDocumentProc)(void);
-
-typedef pascal Handle (*AllocateProc)(long size, Boolean clear);
-typedef pascal long (*FindPatternProc)(char *text, long text_len, long text_offset,
- char *pat, long pat_len,
- Boolean case_sensitive);
-
-typedef pascal void (*ReportOSErrorProc)(short code);
-
-typedef pascal void (*GetPreferenceProc)(ResType prefType, short req_len, void *buffer, short *act_len);
-typedef pascal void (*SetPreferenceProc)(ResType prefType, short req_len, void *buffer, short *act_len);
-
-typedef pascal void (*StartProgressProc)(Str255 str, long total, Boolean cancel_allowed);
-typedef pascal Boolean (*DoProgressProc)(long done);
-typedef pascal void (*DoneProgressProc)(void);
-
-typedef pascal Boolean (*GetProjectListProc)(FSSpec *spec, short *kind, short *count, ProjectEntry ***entries);
-typedef pascal Boolean (*ProjectTextListProc)(FSSpec *spec, Handle *text);
-
-typedef pascal Boolean (*PresetUndoProc)(void);
-typedef pascal void (*SetUndoProc)(void);
-
-typedef pascal Boolean (*OpenFileProc)(FSSpec *spec, WindowPtr *w);
-
-typedef pascal Boolean (*PrepareUndoProc)(long undo_start, long undo_end,
- long sel_start, long sel_end);
-typedef pascal void (*CommitUndoProc)(long new_end);
-
-typedef pascal Boolean (*CreateResultsProc)(Str255 title, short count, Handle results, WindowPtr *w);
-
-#define CallGetWindowContents(proc, w) \
- ((proc))((w))
-
-#define CallGetSelection(proc, selStart, selEnd, firstChar) \
- ((proc))((selStart), (selEnd), (firstChar))
-
-#define CallSetSelection(proc, selStart, selEnd, firstChar) \
- ((proc))((selStart), (selEnd), (firstChar))
-
-#define CallGetDocInfo(proc, w, name, vRefNum, dirID) \
- ((proc))((w), (name), (vRefNum), (dirID))
-
-#define CallGetModDate(proc, w) \
- ((proc))((w))
-
-#define CallCopy(proc) \
- ((proc))()
-
-#define CallPaste(proc, h) \
- ((proc))((h))
-
-#define CallGetLastLine(proc) \
- ((proc))()
-
-#define CallGetLineNumber(proc, sel) \
- ((proc))((sel))
-
-#define CallGetLineStart(proc, sel) \
- ((proc))((sel))
-
-#define CallGetLineEnd(proc, sel) \
- ((proc))((sel))
-
-#define CallGetLinePos(proc, sel) \
- ((proc))((sel))
-
-#define CallInsert(proc, text, len) \
- ((proc))((text), (len))
-
-#define CallDelete(proc) \
- ((proc))()
-
-#define CallSetWindowContents(proc, w, h) \
- ((proc))((w), (h))
-
-#define CallContentsChanged(proc, w) \
- ((proc))((w))
-
-#define CallGetFileText(proc, vRefNum, dirID, name, canDispose) \
- ((proc))((vRefNum), (dirID), (name), (canDispose))
-
-#define CallGetFolder(proc, prompt, vRefNum, dirID) \
- ((proc))((prompt), (vRefNum), (dirID))
-
-#define CallOpenSeveral(proc, sort, file_count, files) \
- ((proc))((sort), (file_count), (files))
-
-#define CallCenterDialog(proc, dialogID) \
- ((proc))((dialogID))
-
-#define CallStandardFilter(proc, d, event, item) \
- ((proc))((d), (event), (item))
-
-#define CallFrameDialogItem(proc, d, item) \
- ((proc))((d), (item))
-
-#define CallNewDocument(proc) \
- ((proc))()
-
-#define CallOpenDocument(proc) \
- ((proc))()
-
-#define CallAllocate(proc, size, clear) \
- ((proc))((size), (clear))
-
-#define CallFindPattern(proc, text, text_len, text_offset, pat, pat_len, case_sens) \
- ((proc))((text), (text_len), (text_offset), (pat), (pat_len), (case_sens))
-
-#define CallReportOSError(proc, code) \
- ((proc))((code))
-
-#define CallGetPreference(proc, prefType, req_len, buffer, act_len) \
- ((proc))((prefType), (req_len), (buffer), (act_len))
-
-#define CallSetPreference(proc, prefType, req_len, buffer, act_len) \
- ((proc))((prefType), (req_len), (buffer), (act_len))
-
-#define CallStartProgress(proc, str, total, cancel_allowed) \
- ((proc))((str), (total), (cancel_allowed))
-
-#define CallDoProgress(proc, done) \
- ((proc))((done))
-
-#define CallDoneProgress(proc) \
- ((proc))()
-
-#define CallGetProjectList(proc, spec, kind, count, entries) \
- ((proc))((spec), (kind), (count), (entries))
-
-#define CallProjectTextList(proc, spec, text) \
- ((proc))((spec), (text))
-
-#define CallPresetUndo(proc) \
- ((proc))()
-
-#define CallSetUndo(proc) \
- ((proc))()
-
-#define CallOpenFile(proc, spec, w) \
- ((proc))((spec), (w))
-
-#define CallPrepareUndo(proc, undo_start, undo_end, sel_start, sel_end) \
- ((proc))((undo_start), (undo_end), (sel_start), (sel_end))
-
-#define CallCommitUndo(proc, new_end) \
- ((proc))((new_end))
-
-#define CallCreateResults(proc, title, count, results, w) \
- ((proc))((title), (count), (results), (w))
-
-#endif
-
-
-typedef struct
-{
- short version;
-
- // version 1 callbacks
-
- GetWindowContentsProc GetWindowContents;
- GetSelectionProc GetSelection;
- SetSelectionProc SetSelection;
- GetDocInfoProc GetDocInfo;
- GetModDateProc GetModDate;
- CopyProc Copy;
- PasteProc Paste;
-
- // version 2 callbacks
-
- /* Text-Editing stuff */
- GetLastLineProc GetLastLine;
- GetLineNumberProc GetLineNumber;
- GetLineStartProc GetLineStart;
- GetLineEndProc GetLineEnd;
- GetLinePosProc GetLinePos;
-
- InsertProc Insert;
- DeleteProc Delete;
-
- /* Getting and Setting window text */
- SetWindowContentsProc SetWindowContents;
- ContentsChangedProc ContentsChanged;
-
- /* Reading file text */
- GetFileTextProc GetFileText;
-
- /* Direct user-interface calls */
- GetFolderProc GetFolder;
- OpenSeveralProc OpenSeveral;
-
- CenterDialogProc CenterDialog;
- StandardFilterProc StandardFilter;
- FrameDialogItemProc FrameDialogItem;
-
- NewDocumentProc NewDocument;
- OpenDocumentProc OpenDocument;
-
- /* Utility Routines */
- AllocateProc Allocate;
- FindPatternProc FindPattern;
-
- ReportOSErrorProc ReportOSError;
-
- /* Preference routines */
- GetPreferenceProc GetPreference;
- SetPreferenceProc SetPreference;
-
- /* Progress routines */
- StartProgressProc StartProgress;
- DoProgressProc DoProgress;
- DoneProgressProc DoneProgress;
-
- // Version 3 callbacks
- GetProjectListProc GetProjectList;
- ProjectTextListProc ProjectTextList;
-
- // version 4 callbacks
-
- PresetUndoProc PresetUndo;
- SetUndoProc SetUndo;
-
- OpenFileProc OpenFile;
-
- // version 5 callbacks
-
- PrepareUndoProc PrepareUndo;
- CommitUndoProc CommitUndo;
-
- CreateResultsProc CreateResults;
-
-} ExternalCallbackBlock;
-
-#if defined(powerc) || defined (__powerc)
-#pragma options align=reset
-#endif
-
-/*
- 'main' for a BBXT is declared:
-
-pascal void main(ExternalCallbackBlock *callbacks, WindowPtr w); [C]
-
- The 'new' calling convention, which passes more information
- and allows scriptability, is this:
-
-pascal OSErr main(ExternalCallbackBlock *callbacks, WindowPtr w, long flags, AppleEvent *event, AppleEvent *reply);
-*/
diff --git a/Mac/Contrib/BBPy/source/BBPy.h b/Mac/Contrib/BBPy/source/BBPy.h
deleted file mode 100644
index 22974ea..0000000
--- a/Mac/Contrib/BBPy/source/BBPy.h
+++ /dev/null
@@ -1,17 +0,0 @@
-/* BBPython
- A simple menu command to send the contents of a window to the Python interpreter
-
- copyright © 1996 Just van Rossum, Letterror: just@knoware.nl
-
- All Rights Reserved
-*/
-
-#include <MacHeaders68K>
-#include <A4Stuff.h>
-#include <SetUpA4.h> // for global variables, multiple segments, etc.
-#include "ExternalInterface.h"
-#include <Memory.h>
-
-extern OSErr SendTextAsAE(ExternalCallbackBlock *callbacks, Ptr theText, long theSize, Str255 windowTitle);
-extern OSErr LaunchPythonSlave(FSSpec * docSpec);
-extern Boolean GetPythonSlaveSpec(FSSpec * docSpec);
diff --git a/Mac/Contrib/BBPy/source/BBPy.rsrc b/Mac/Contrib/BBPy/source/BBPy.rsrc
deleted file mode 100644
index 12e2d04..0000000
--- a/Mac/Contrib/BBPy/source/BBPy.rsrc
+++ /dev/null
@@ -1 +0,0 @@
-(This file must be converted with BinHex 4.0) :#8*#8(NZFR0bB`"bFh*M8P0&4!%!N!F#GELF!*!%!3!!!!(c!!!!m`!!!))!q`" F!8h!!J!,!*!&T!!d!-3!C!B!N!DN!(`*3N*3H5jbFh*M,R*cFQ0bC@jMCA0ZFfP [ER4PER4cF`!!FR0bBe*6483"!!"!!!%!N"+b&)qr!*!'!R9ZBf9X!*!&13"1!%d !RJ3+4'pZeA3J8f&fC3#3"3`!6J!X!A@)0e0KGQ8JBfKKEQGPFb"dEb"dD'8J6@9 dFQphCA*VFb"%Ef0eE@9ZG#$5AM$6)'*PCQpbC5"H-6m#!*!&$!!A!#`!0k!#!!) !N!b""!!"!!!!$J!S!#J!M!'3!!#!998`#J!!!!3!!!*"!!!!J!!$!*!&3!%%!&3 "9!3$@@9c!*!'3!#U!&3!qJ3#6Qm!N!8)!$`!0J&8L$l58(PdD'pZ8faKGQ8ZF(R 6)'Pc)'j[G#"bG@jZD@jR,#!0GfpeE'3JH@pe)'aTDf8JG'mJE'pMBA4P)'Pd2`# 3"3J!#J!S!#UJ!J!"!!!!"J%!!&)!N!9(!#-J!!!!"RB`,M)Z-cPf-#ib,M-JU5" +GA0d)(CKEL"5Eh0cG@dJ,b"-CA4dCA*bEh)X)$aUGA0d3'aPG(4PFR*[FLjZE$i !!!%!!!!"m`!!!2-!!!###2`64#G-!!!!(!##!!4fCA*c!!!!+N4*9%`!!!!f38a 59!!!!%*#3PK'!!!!6N*#@%X!!!"D!!(rr`!!!+J)r"(m!)$rr`!!!"S!N!@!rrm !N!Q!rrm!!!!5!*!&J2rr!!!!RJ#3"-JY: \ No newline at end of file
diff --git a/Mac/Contrib/BBPy/source/BBPy_lauch.c b/Mac/Contrib/BBPy/source/BBPy_lauch.c
deleted file mode 100644
index f9b964c..0000000
--- a/Mac/Contrib/BBPy/source/BBPy_lauch.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Launch the PythonSlave.py script.
- * This works exactly as if you'd double clicked on the file in the Finder, which
- * not surprisingly is how its implemented (via the AppleEvents route of course).
- *
- * Largely based on code submitted by Mark Roseman <roseman@cpsc.ucalgary.ca>
- * Thanks!
- */
-
-#include "BBPy.h"
-
-pascal Boolean MyFileFilter(CInfoPBPtr PB);
-FileFilterUPP gMyFileFilterUPP = NULL;
-
-Boolean GetPythonSlaveSpec(FSSpec * docSpec) {
- StandardFileReply reply;
- SFTypeList typeList;
-
- typeList[0] = 'TEXT';
-
- //if (!gMyFileFilterUPP)
- gMyFileFilterUPP = NewFileFilterProc( MyFileFilter );
-
- StandardGetFile(gMyFileFilterUPP, 0, typeList, &reply);
-
- DisposePtr((Ptr)gMyFileFilterUPP);
-
- if(!reply.sfGood)
- return 0; /* user cancelled */
-
- docSpec->vRefNum = reply.sfFile.vRefNum;
- docSpec->parID = reply.sfFile.parID;
- BlockMove(reply.sfFile.name, docSpec->name, 64);
- return 1;
-}
-
-pascal Boolean MyFileFilter(CInfoPBPtr PB) {
- OSType fType; /* file type */
- OSType fCreator; /* file creator */
-
- fType =((HParmBlkPtr)PB)->fileParam.ioFlFndrInfo.fdType;
- fCreator = ((HParmBlkPtr)PB)->fileParam.ioFlFndrInfo.fdCreator;
-
- if (fType == 'TEXT' &&
- fCreator == 'Pyth')
- return 0;
- return 1;
-}
-
-OSErr LaunchPythonSlave(FSSpec * docSpec) {
- OSErr err;
- FSSpec dirSpec;
- AEAddressDesc finderAddress;
- AppleEvent theEvent, theReply;
- OSType finderSig = 'MACS';
- AliasHandle DirAlias, FileAlias;
- AEDesc fileList;
- AEDesc aeDirDesc, listElem;
-
- err = AECreateDesc(typeApplSignature, (Ptr)&finderSig, 4, &finderAddress);
- if(err != noErr) return err;
-
- err = AECreateAppleEvent('FNDR', 'sope', &finderAddress,
- kAutoGenerateReturnID, kAnyTransactionID, &theEvent);
- if(err != noErr) return err;
-
- FSMakeFSSpec(docSpec->vRefNum, docSpec->parID, NULL, &dirSpec);
- NewAlias(NULL, &dirSpec, &DirAlias);
- NewAlias(NULL, docSpec, &FileAlias);
- err = AECreateList(NULL, 0, 0, &fileList);
- HLock((Handle)DirAlias);
- AECreateDesc(typeAlias, (Ptr)*DirAlias, GetHandleSize((Handle)DirAlias), &aeDirDesc);
- HUnlock((Handle)DirAlias);
- if ((err = AEPutParamDesc(&theEvent, keyDirectObject, &aeDirDesc)) == noErr) {
- AEDisposeDesc(&aeDirDesc);
- HLock((Handle)FileAlias);
- AECreateDesc(typeAlias, (Ptr)*FileAlias, GetHandleSize((Handle)FileAlias), &listElem);
- HLock((Handle)FileAlias);
- err = AEPutDesc(&fileList, 0, &listElem);
- }
- AEDisposeDesc(&listElem);
- err = AEPutParamDesc(&theEvent, 'fsel', &fileList);
- AEDisposeDesc(&fileList);
-
- err = AESend(&theEvent, &theReply, kAENoReply+kAENeverInteract,
- kAENormalPriority, kAEDefaultTimeout, 0L, 0L);
- if(err != noErr) return err;
-
- err = AEDisposeDesc(&theEvent);
- if(err != noErr) return err;
-
- err = AEDisposeDesc(&theReply);
- return err;
-}
diff --git a/Mac/Contrib/BBPy/source/BBPy_launch.c b/Mac/Contrib/BBPy/source/BBPy_launch.c
deleted file mode 100644
index f9b964c..0000000
--- a/Mac/Contrib/BBPy/source/BBPy_launch.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Launch the PythonSlave.py script.
- * This works exactly as if you'd double clicked on the file in the Finder, which
- * not surprisingly is how its implemented (via the AppleEvents route of course).
- *
- * Largely based on code submitted by Mark Roseman <roseman@cpsc.ucalgary.ca>
- * Thanks!
- */
-
-#include "BBPy.h"
-
-pascal Boolean MyFileFilter(CInfoPBPtr PB);
-FileFilterUPP gMyFileFilterUPP = NULL;
-
-Boolean GetPythonSlaveSpec(FSSpec * docSpec) {
- StandardFileReply reply;
- SFTypeList typeList;
-
- typeList[0] = 'TEXT';
-
- //if (!gMyFileFilterUPP)
- gMyFileFilterUPP = NewFileFilterProc( MyFileFilter );
-
- StandardGetFile(gMyFileFilterUPP, 0, typeList, &reply);
-
- DisposePtr((Ptr)gMyFileFilterUPP);
-
- if(!reply.sfGood)
- return 0; /* user cancelled */
-
- docSpec->vRefNum = reply.sfFile.vRefNum;
- docSpec->parID = reply.sfFile.parID;
- BlockMove(reply.sfFile.name, docSpec->name, 64);
- return 1;
-}
-
-pascal Boolean MyFileFilter(CInfoPBPtr PB) {
- OSType fType; /* file type */
- OSType fCreator; /* file creator */
-
- fType =((HParmBlkPtr)PB)->fileParam.ioFlFndrInfo.fdType;
- fCreator = ((HParmBlkPtr)PB)->fileParam.ioFlFndrInfo.fdCreator;
-
- if (fType == 'TEXT' &&
- fCreator == 'Pyth')
- return 0;
- return 1;
-}
-
-OSErr LaunchPythonSlave(FSSpec * docSpec) {
- OSErr err;
- FSSpec dirSpec;
- AEAddressDesc finderAddress;
- AppleEvent theEvent, theReply;
- OSType finderSig = 'MACS';
- AliasHandle DirAlias, FileAlias;
- AEDesc fileList;
- AEDesc aeDirDesc, listElem;
-
- err = AECreateDesc(typeApplSignature, (Ptr)&finderSig, 4, &finderAddress);
- if(err != noErr) return err;
-
- err = AECreateAppleEvent('FNDR', 'sope', &finderAddress,
- kAutoGenerateReturnID, kAnyTransactionID, &theEvent);
- if(err != noErr) return err;
-
- FSMakeFSSpec(docSpec->vRefNum, docSpec->parID, NULL, &dirSpec);
- NewAlias(NULL, &dirSpec, &DirAlias);
- NewAlias(NULL, docSpec, &FileAlias);
- err = AECreateList(NULL, 0, 0, &fileList);
- HLock((Handle)DirAlias);
- AECreateDesc(typeAlias, (Ptr)*DirAlias, GetHandleSize((Handle)DirAlias), &aeDirDesc);
- HUnlock((Handle)DirAlias);
- if ((err = AEPutParamDesc(&theEvent, keyDirectObject, &aeDirDesc)) == noErr) {
- AEDisposeDesc(&aeDirDesc);
- HLock((Handle)FileAlias);
- AECreateDesc(typeAlias, (Ptr)*FileAlias, GetHandleSize((Handle)FileAlias), &listElem);
- HLock((Handle)FileAlias);
- err = AEPutDesc(&fileList, 0, &listElem);
- }
- AEDisposeDesc(&listElem);
- err = AEPutParamDesc(&theEvent, 'fsel', &fileList);
- AEDisposeDesc(&fileList);
-
- err = AESend(&theEvent, &theReply, kAENoReply+kAENeverInteract,
- kAENormalPriority, kAEDefaultTimeout, 0L, 0L);
- if(err != noErr) return err;
-
- err = AEDisposeDesc(&theEvent);
- if(err != noErr) return err;
-
- err = AEDisposeDesc(&theReply);
- return err;
-}
diff --git a/Mac/Contrib/BBPy/source/BBPy_main.c b/Mac/Contrib/BBPy/source/BBPy_main.c
deleted file mode 100644
index a96b271..0000000
--- a/Mac/Contrib/BBPy/source/BBPy_main.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/* BBPython
- A simple menu command to send the contents of a window to the Python interpreter
-
- copyright © 1996 Just van Rossum, Letterror: just@knoware.nl
-
- All Rights Reserved
-*/
-
-#include "BBPy.h"
-
-OSErr SendTextAsAE(ExternalCallbackBlock *callbacks, Ptr theText, long theSize, Str255 windowTitle)
-{
- OSErr err;
- AEDesc theEvent;
- AEAddressDesc theTarget;
- AppleEvent theReply;
- AEDesc theTextDesc;
- AEDesc theNameDesc;
- OSType pythonSig = 'Pyth';
- FSSpec docSpec;
- short itemHit;
- long time;
- EventRecord theDummyEvent;
-
- /* initialize AE descriptor for python's signature */
- err = AECreateDesc (typeApplSignature, &pythonSig, sizeof(OSType), &theTarget);
- if(err != noErr) return err;
-
- /* initialize AE descriptor for the title of our window */
- err = AECreateDesc (typeChar, &windowTitle[1], windowTitle[0], &theNameDesc);
- if(err != noErr) return err;
-
- /* initialize AE descriptor for the content of our window */
- err = AECreateDesc ('TEXT', theText, theSize, &theTextDesc);
- if(err != noErr) return err;
-
- /* initialize AppleEvent */
- err = AECreateAppleEvent ('pyth', 'EXEC', &theTarget, kAutoGenerateReturnID, kAnyTransactionID, &theEvent);
- if(err != noErr) return err;
-
- /* add the content of our window to the AppleEvent */
- err = AEPutParamDesc (&theEvent, keyDirectObject, &theTextDesc);
- if(err != noErr) return err;
-
- /* add the title of our window to the AppleEvent */
- err = AEPutParamDesc (&theEvent, 'NAME', &theNameDesc);
- if(err != noErr) return err;
-
- /* send the AppleEvent */
- err = AESend (&theEvent, &theReply, kAEWaitReply, kAEHighPriority, kNoTimeOut, NULL, NULL);
- if(err == connectionInvalid) {
- // launch PythonSlave.py
- itemHit = Alert(128, NULL);
- if(itemHit == 2) return noErr; /* user cancelled */
-
- if( ! GetPythonSlaveSpec(&docSpec) )
- return noErr; /* user cancelled */
-
- err = LaunchPythonSlave(&docSpec);
- if(err != noErr) return err;
- } else if(err != noErr)
- return err;
-
- /* clean up */
- err = AEDisposeDesc (&theTarget);
- if(err != noErr) return err;
-
- err = AEDisposeDesc (&theNameDesc);
- if(err != noErr) return err;
-
- err = AEDisposeDesc (&theTextDesc);
- if(err != noErr) return err;
-
- err = AEDisposeDesc (&theEvent);
- if(err != noErr) return err;
-
- err = AEDisposeDesc (&theReply);
- if(err != noErr) return err;
-
- /* everything is cool */
- return noErr;
-}
-
-pascal void main(ExternalCallbackBlock *callbacks, WindowPtr theWindow)
-{
- long oldA4;
- OSErr err;
- Handle windowContents;
- Str255 windowTitle;
-
- //RememberA0(); /* Can't find header file for this. Seems to work anyway. */
-
- oldA4 = SetUpA4();
-
- GetWTitle(theWindow, windowTitle);
- windowContents = callbacks->GetWindowContents(theWindow);
-
- HLock(windowContents);
- err = SendTextAsAE(callbacks, *windowContents, GetHandleSize(windowContents), windowTitle);
- if(err != noErr) callbacks->ReportOSError(err);
- HUnlock(windowContents);
-
- RestoreA4(oldA4);
-}
diff --git a/Mac/Contrib/ImageHelpers/ExtPixMapWrapper.py b/Mac/Contrib/ImageHelpers/ExtPixMapWrapper.py
deleted file mode 100644
index ac261b5..0000000
--- a/Mac/Contrib/ImageHelpers/ExtPixMapWrapper.py
+++ /dev/null
@@ -1,46 +0,0 @@
-'''
-A really quick and dirty hack to extend PixMapWrapper
-They are mere copies of the toImage and fromImage methods.
-Riccardo Trocca (rtrocca@libero.it)
-'''
-from PixMapWrapper import *
-import Numeric
-
-class ExtPixMapWrapper(PixMapWrapper):
-
- def toNumeric(self):
-
- data = self.tostring()[1:] + chr(0)
- bounds = self.bounds
- tmp=Numeric.fromstring(data,Numeric.UnsignedInt8)
- #tmp.shape=(bounds[3]-bounds[1],bounds[2]-bounds[0],4)
- tmp.shape=(bounds[2]-bounds[0],bounds[3]-bounds[1],4)
- return Numeric.transpose(tmp,(1,0,2))
-
- def fromNumeric(self,num):
- s=num.shape
- x=num.shape[1]
- y=num.shape[0]
- #bands=1 Greyscale image
- #bands=3 RGB image
- #bands=4 RGBA image
- if len(s)==2:
- bands=1
- num=Numeric.resize(num,(y,x,1))
- else:
- bands=num.shape[2]
-
- if bands==1:
- num=Numeric.concatenate((num,num,num),2)
- bands=3
- if bands==3:
- alpha=Numeric.ones((y,x))*255
- alpha.shape=(y,x,1)
- num=Numeric.concatenate((num,alpha),2)
-
- data=chr(0)+Numeric.transpose(num,(1,0,2)).astype(Numeric.UnsignedInt8).tostring()
- PixMapWrapper.fromstring(self,data,x,y)
-
-
-
-
diff --git a/Mac/Contrib/ImageHelpers/ImageMac.py b/Mac/Contrib/ImageHelpers/ImageMac.py
deleted file mode 100644
index 44a38c5..0000000
--- a/Mac/Contrib/ImageHelpers/ImageMac.py
+++ /dev/null
@@ -1,277 +0,0 @@
-'''
-ImageMac.py by Trocca Riccardo (rtrocca@libero.it)
-This module provides functions to display images and Numeric arrays
-It provides two classes ImageMacWin e NumericMacWin and two simple methods showImage and
-showNumeric.
-
-They work like this:
-showImage(Image,"optional window title",zoomFactor)
-the same for showNumeric
-zoomfactor (defaults to 1) allows to zoom in the image by a factor of 1x 2x 3x and so on
-I did't try with a 0.5x or similar.
-The windows don't provide a scrollbar or a resize box.
-Probably a better solution (and more similar to the original implementation in PIL and NumPy)
-would be to save a temp file is some suitable format and then make an application (through appleevents) to open it.
-Good guesses should be GraphicConverter or PictureViewer.
-
-However the classes ImageMacWin e NumericMacWin use an extended version of PixMapWrapper in order to
-provide an image buffer and then blit it in the window.
-
-Being one of my first experiences with Python I didn't use Exceptions to signal error conditions, sorry.
-
-'''
-import W
-from Carbon import Qd
-from ExtPixMapWrapper import *
-from Numeric import *
-import Image
-import macfs
-
-class ImageMacWin(W.Window):
-
- def __init__(self,size=(300,300),title="ImageMacWin"):
- self.pm=ExtPixMapWrapper()
- self.empty=1
- self.size=size
- W.Window.__init__(self,size,title)
-
- def Show(self,image,resize=0):
- #print "format: ", image.format," size: ",image.size," mode: ",image.mode
- #print "string len :",len(image.tostring())
- self.pm.fromImage(image)
- self.empty=0
- if resize:
- self.size=(image.size[0]*resize,image.size[1]*resize)
- W.Window.do_resize(self,self.size[0],self.size[1],self.wid)
- self.do_drawing()
-
- def do_drawing(self):
- #print "do_drawing"
- self.SetPort()
- Qd.RGBForeColor( (0,0,0) )
- Qd.RGBBackColor((65535, 65535, 65535))
- Qd.EraseRect((0,0,self.size[0],self.size[1]))
- if not self.empty:
- #print "should blit"
- self.pm.blit(0,0,self.size[0],self.size[1])
-
- def do_update(self,macoswindowid,event):
- #print "update"
- self.do_drawing()
-
-class NumericMacWin(W.Window):
-
- def __init__(self,size=(300,300),title="ImageMacWin"):
- self.pm=ExtPixMapWrapper()
- self.empty=1
- self.size=size
- W.Window.__init__(self,size,title)
-
- def Show(self,num,resize=0):
- #print "shape: ", num.shape
- #print "string len :",len(num.tostring())
- self.pm.fromNumeric(num)
- self.empty=0
- if resize:
- self.size=(num.shape[1]*resize,num.shape[0]*resize)
- W.Window.do_resize(self,self.size[0],self.size[1],self.wid)
- self.do_drawing()
-
- def do_drawing(self):
- #print "do_drawing"
- self.SetPort()
- Qd.RGBForeColor( (0,0,0) )
- Qd.RGBBackColor((65535, 65535, 65535))
- Qd.EraseRect((0,0,self.size[0],self.size[1]))
- if not self.empty:
- #print "should blit"
- self.pm.blit(0,0,self.size[0],self.size[1])
-
- def do_update(self,macoswindowid,event):
- #print "update"
- self.do_drawing()
-
-'''
-Some utilities: convert an Image to a NumPy array and viceversa.
-The Image2Numeric function doesn't make any color space conversion.
-The Numeric2Image function returns an L or RGB or RGBA images depending on the shape of
-the array:
- (x,y) -> 'L'
- (x,y,1) -> 'L'
- (x,y,3) -> 'RGB'
- (x,y,4) -> 'RGBA'
-'''
-def Image2Numeric(im):
- tmp=fromstring(im.tostring(),UnsignedInt8)
-
- if (im.mode=='RGB')|(im.mode=='YCbCr'):
- bands=3
-
- if (im.mode=='RGBA')|(im.mode=='CMYK'):
- bands=4
-
- if (im.mode=='L'):
- bands=1
-
- tmp.shape=(im.size[0],im.size[1],bands)
- return transpose(tmp,(1,0,2))
-
-def Numeric2Image(num):
- #sometimes a monoband image's shape can be (x,y,1), other times just (x,y). Here w deal with both
- if len(num.shape)==3:
- bands=num.shape[2]
- if bands==1:
- mode='L'
- elif bands==3:
- mode='RGB'
- else:
- mode='RGBA'
- return Image.fromstring(mode,(num.shape[1],num.shape[0]),transpose(num,(1,0,2)).astype(UnsignedInt8).tostring())
- else:
- return Image.fromstring('L',(num.shape[1],num.shape[0]),transpose(num).astype(UnsignedInt8).tostring())
-
-def showImage(im,title="ImageWin",zoomFactor=1):
- imw=ImageMacWin((300,200),title)
- imw.open()
- try:
- imw.Show(im,zoomFactor )
- except MemoryError,e:
- imw.close()
- print "ImageMac.showImage: Insufficient Memory"
-
-
-def showNumeric(num,title="NumericWin",zoomFactor=1):
- #im=Numeric2Image(num)
- numw=NumericMacWin((300,200),title)
- numw.open()
- try:
- numw.Show(num,zoomFactor )
- except MemoryError:
- numw.close()
- print "ImageMac.showNumeric Insufficient Memory"
-
-'''
-GimmeImage pops up a file dialog and asks for an image file.
-it returns a PIL image.
-Optional argument: a string to be displayed by the dialog.
-'''
-
-def GimmeImage(prompt="Image File:"):
- import macfs
- fsspec, ok = macfs.PromptGetFile(prompt)
- if ok:
- path = fsspec.as_pathname()
- return Image.open(path)
- return None
-
-'''
-This is just some experimental stuff:
- Filter3x3 a convolution filter (too slow use signal tools instead)
- diffBWImage subtracts 2 images contained in NumPy arrays
- averageN it computes the average of a list incrementally
- BWImage converts an RGB or RGBA image (in a NumPy array) to BW
- SplitBands splits the bands of an Image (inside a NumPy)
- NumHisto and PlotHisto are some experiments to plot an intesity histogram
-'''
-
-def Filter3x3(mul,fi,num):
- (a,b,c,d,e,f,g,h,i)=fi
- print fi
- num.shape=(num.shape[0],num.shape[1])
- res=zeros(num.shape)
- for x in range(1,num.shape[0]-1):
- for y in range(1,num.shape[1]-1):
- xb=x-1
- xa=x+1
- yb=y-1
- ya=y+1
- res[x,y]=int((a*num[xb,yb]+b*num[x,yb]+c*num[xa,yb]+d*num[xb,y]+e*num[x,y]+f*num[xa,y]+g*num[xb,ya]+h*num[x,ya]+i*num[xa,ya])/mul)
- return res
-
-def diffBWImage(num1,num2):
- return 127+(num1-num2)/2
-
-def averageN(N,avrg,new):
- return ((N-1)*avrg+new)/N
-
-def BWImage(num):
- if num.shape[2]==3:
- bw=array(((0.3086,0.6094,0.0820)))
- else:
- bw=array(((0.3086,0.6094,0.0820,0)))
- res=innerproduct(num,bw)
- res.shape=(res.shape[0],res.shape[1])
- return res
-
-def SplitBands(num):
- x=num.shape[0]
- y=num.shape[1]
- if num.shape[2]==3:
- return (reshape(num[:,:,0],(x,y)),reshape(num[:,:,1],(x,y)),reshape(num[:,:,2],(x,y)))
- else:
- return (reshape(num[:,:,0],(x,y)),reshape(num[:,:,1],(x,y)),reshape(num[:,:,2],(x,y)),reshape(num[:,:,3],(x,y)))
-
-def NumHisto(datas):
- #print "type(datas) ",type(datas)
- a=ravel(datas)
- n=searchsorted(sort(a),arange(0,256))
- n=concatenate([n,[len(a)]])
- return n[1:]-n[:-1]
-
-def PlotHisto(datas,ratio=1):
- from graphite import *
- from MLab import max
- h=NumHisto(datas)
- #print "histo: ",h
- #print "histo.shape: ",h.shape
- maxval=max(h)
- #print "maxval ",maxval
- h.shape=(256,1)
- x=arange(0,256)
- x.shape=(256,1)
- datah=concatenate([x,h],1)
- print "data: "
- print datah
- g=Graph()
- g.datasets.append(Dataset(datah))
- f0=PointPlot()
- f0.lineStyle = LineStyle(width=2, color=red, kind=SOLID)
- g.formats = [f0]
- g.axes[X].range = [0,255]
- g.axes[X].tickMarks[0].spacing = 10
- #g.axes[X].tickMarks[0].labels = "%d"
- g.axes[Y].range = [0,maxval/ratio]
- g.bottom = 370
- g.top =10
- g.left=10
- g.right=590
-
- genOutput(g,'QD',size=(600,400))
-
-def test():
- import MacOS
- import Image
- import ImageFilter
- import Numeric
- fsspec, ok = macfs.PromptGetFile("Image File:")
- if ok:
- path = fsspec.as_pathname()
- im=Image.open(path)
- #im2=im.filter(ImageFilter.SMOOTH)
- showImage(im,"normal")
- num=Image2Numeric(im)
- #num=Numeric.transpose(num,(1,0,2))
-
- showNumeric(num,"Numeric")
-
- print "num.shape ",num.shape
- showImage(Numeric2Image(num),"difficile")
- #showImage(im.filter(ImageFilter.SMOOTH),"smooth")
- #showImage(im.filter(ImageFilter.FIND_EDGES).filter(ImageFilter.SHARPEN),"detail")
-
- print "here"
- else:
- print "did not open file"
-
-if __name__ == '__main__':
- test() \ No newline at end of file
diff --git a/Mac/Contrib/ImageHelpers/MovieUtils.py b/Mac/Contrib/ImageHelpers/MovieUtils.py
deleted file mode 100644
index 89762f4..0000000
--- a/Mac/Contrib/ImageHelpers/MovieUtils.py
+++ /dev/null
@@ -1,269 +0,0 @@
-from Carbon import Qt
-from Carbon import QuickTime
-import macfs
-from Carbon import Qd
-from Carbon.QuickDraw import srcCopy
-from ExtPixMapWrapper import ExtPixMapWrapper
-from Carbon.Qdoffs import *
-import ImageMac
-import W
-
-
-
-
-def GetFrames(m):
- frameCount=0
- theTime=0
- type=QuickTime.VideoMediaType
- #type='MPEG'
- flags=QuickTime.nextTimeMediaSample
- flags=flags+QuickTime.nextTimeEdgeOK
-
- while theTime>=0:
- (theTime,duration)=m.GetMovieNextInterestingTime(flags,1,type,theTime,0)
- #print "theTime ",theTime," duration ",duration
- frameCount=frameCount+1
- flags = QuickTime.nextTimeMediaSample
-
-
- return frameCount-1
-
-def GetMovieFromOpenFile():
- fss, ok = macfs.StandardGetFile(QuickTime.MovieFileType)
- mov = None
- if ok:
- movieResRef = Qt.OpenMovieFile(fss, 1)
- mov, d1, d2 = Qt.NewMovieFromFile(movieResRef, 0, QuickTime.newMovieActive)
-
- return mov
-
-
-class ExtMovie:
- def __init__(self,mov):
-
- self.frames=0
- self.frameArray=[]
- self.movie=mov
- self._countFrames()
- r=self.movie.GetMovieBox()
- self.myRect=(0,0,r[2]-r[0],r[3]-r[1])
- self.movie.SetMovieBox(self.myRect)
- self.pm=ExtPixMapWrapper()
- self.pm.left=0
- self.pm.top=0
- self.pm.right=r[2]-r[0]
- self.pm.bottom=r[3]-r[1]
- self.gw=NewGWorld(32,self.myRect,None,None,0)
- self.movie.SetMovieGWorld(self.gw.as_GrafPtr(), self.gw.GetGWorldDevice())
- self.GotoFrame(0)
-
- def _countFrames(self):
- #deve contare il numero di frame, creare un array con i tempi per ogni frame
- theTime=0
- #type=QuickTime.VIDEO_TYPE
- type=QuickTime.VideoMediaType
- flags=QuickTime.nextTimeMediaSample+QuickTime.nextTimeEdgeOK
-
- while theTime>=0:
- (theTime,duration)=self.movie.GetMovieNextInterestingTime(flags,1,type,theTime,0)
- self.frameArray.append((theTime,duration))
- flags = QuickTime.nextTimeMediaSample
- self.frames=self.frames+1
-
-
-
- def GotoFrame(self,n):
- if n<=self.frames:
- self.curFrame=n
- (port,device)=GetGWorld()
- SetGWorld(self.gw.as_GrafPtr(),None)
- (self.now,self.duration)=self.frameArray[n]
- self.movie.SetMovieTimeValue(self.now)
- pixmap=self.gw.GetGWorldPixMap()
-
- if not LockPixels(pixmap):
- print "not locked"
- else:
-
- #Qd.EraseRect(self.myRect)
- #this draws the frame inside the current gworld
- self.movie.MoviesTask(0)
- #this puts it in the buffer pixmap
- self.pm.grab(0,0,self.myRect[2],self.myRect[3])
- UnlockPixels(pixmap)
- #self.im=self.pm.toImage()
- SetGWorld(port,device)
-
- def NextFrame(self):
- self.curFrame=self.curFrame+1
- if self.curFrame>self.frames:
- self.curFrame=0
- self.GotoFrame(self.curFrame)
-
- def isLastFrame():
- return self.curFrame==self.frames
-
-
- def GetImage(self):
- return self.pm.toImage()
-
- def GetImageN(self,n):
- self.GotoFrame(n)
- return self.pm.toImage()
-
- def GetNumeric(self):
- return self.pm.toNumeric()
-
- def GetNumericN(self,n):
- self.GotoFrame(n)
- return self.pm.toNumeric()
-
- def Blit(self,destRect):
- Qd.RGBForeColor( (0,0,0) )
- Qd.RGBBackColor((65535, 65535, 65535))
-
- #Qd.MoveTo(10,10)
- #Qd.LineTo(200,150)
- Qd.CopyBits(self.gw.GetPortBitMapForCopyBits(),Qd.GetPort().GetPortBitMapForCopyBits(),self.myRect,destRect,srcCopy,None)
-
-class MovieWin(W.Window):
-
- def __init__(self,eMovie,title="MovieWin"):
- self.ExtMovie=eMovie
-
-def test():
- import ImageFilter
- from MLab import max
- from MLab import min
- from Numeric import *
- Qt.EnterMovies()
- m=GetMovieFromOpenFile()
- em=ExtMovie(m)
- print "Total frames:",em.frames," Current frame:",em.curFrame
- #ImageMac.showImage(em.GetImage(),"frame 0",1)
- #em.GotoFrame(500)
- #ImageMac.showImage(em.GetImage().filter(ImageFilter.SMOOTH),"frame 500",2)
- #ImageMac.showImage(em.GetImageN(1000),"frame 1000",2)
- #r=array(((1,0,0,0),(0,0,0,0),(0,0,0,0),(0,0,0,0)))
- #g=array(((0,0,0,0),(0,1,0,0),(0,0,0,0),(0,0,0,0)))
- #b=array(((0,0,0,0),(0,0,0,0),(0,0,1,0),(0,0,0,0)))
- #bw=array(((0.3086,0.6094,0.0820,0)))
- #r2=array(((1,0,0,0)))
- #ImageMac.showNumeric(em.GetNumericN(0),"frame 0",1)
- #print em.GetNumericN(500).shape
- #print "original (1,1)",em.GetNumericN(0)[100,100]
- #print "product shape ",innerproduct(em.GetNumericN(0),r).shape
- #print "product (1,1) ",innerproduct(em.GetNumericN(0),r)[100,100]
-
- #ImageMac.showNumeric(ImageMac.BWImage(em.GetNumericN(50)))
- #ImageMac.showNumeric(innerproduct(em.GetNumericN(500),r),"frame 500r",2)
- #ImageMac.showNumeric(innerproduct(em.GetNumericN(500),g),"frame 500g",2)
- #ImageMac.showNumeric(innerproduct(em.GetNumericN(500),b),"frame 500b",2)
-
- #ImageMac.showNumeric(innerproduct(em.GetNumericN(500),r2),"frame 500r2",2)
- #ImageMac.showNumeric(innerproduct(em.GetNumericN(10),bw),"frame 0bw",1)
- #ImageMac.showNumeric(innerproduct(em.GetNumericN(400),bw),"frame 10bw",1)
- #colordif=(em.GetNumericN(100)-em.GetNumericN(10))+(255,255,255,255)
- #colordif=colordif/2
- #ImageMac.showNumeric(colordif,"colordif",1)
- #ImageMac.showNumeric(ImageMac.BWImage(colordif),"bwcolordif",1)
- ilut=arange(0,256)
- #ilut[118]=255
- #ilut[119]=255
- #ilut[120]=255
- ilut[121]=255
- ilut[122]=255
- ilut[123]=255
- ilut[124]=255
- ilut[125]=255
- ilut[126]=255
- ilut[127]=255
- ilut[128]=255
- ilut[129]=255
- #ilut[130]=255
- #ilut[131]=255
- #ilut[132]=255
- mlut=ones(256)
- mlut[118]=0
- mlut[119]=0
- mlut[120]=0
- mlut[121]=0
- mlut[122]=0
- mlut[123]=0
- mlut[124]=0
- mlut[125]=0
- mlut[126]=0
- mlut[127]=0
- mlut[128]=0
- mlut[129]=0
- mlut[130]=0
- mlut[131]=0
- mlut[132]=0
-
- ImageMac.showImage(em.GetImageN(100),"provaImg",2)
- ImageMac.showNumeric(em.GetNumericN(100),"provaNum",2)
- ImageMac.showImage(em.GetImageN(100).filter(ImageFilter.SMOOTH),"frame 500",2)
- #image=ImageMac.BWImage(em.GetNumericN(100))
- #ImageMac.showNumeric(image)
-
-
-
-
-
-
-
-
- #difimage=abs(image-ImageMac.BWImage(em.GetNumericN(10)))
- #ImageMac.PlotHisto(difimage,32)
- #ImageMac.showNumeric(difimage)
- #difimage=127+(image-ImageMac.BWImage(em.GetNumericN(10)))/2
- #ImageMac.PlotHisto(difimage,32)
- #ImageMac.showNumeric(difimage)
- #fimage=ImageMac.Filter3x3(16.0,(1,1,1,1,8,1,1,1,1),difimage)
- #ImageMac.showNumeric(fimage)
- #difimage2=choose(fimage.astype(UnsignedInt8),ilut)
- #ImageMac.showNumeric(difimage2)
-
- #(r,g,b,a)=ImageMac.SplitBands(em.GetNumericN(10))
- #ImageMac.showNumeric(r,"r")
- #ImageMac.showNumeric(g,"g")
- #ImageMac.showNumeric(b,"b")
- #ImageMac.showNumeric(a,"a")
- #bwdif=abs(((innerproduct(em.GetNumericN(400),bw)-innerproduct(em.GetNumericN(10),bw))+255)/2)
- #ImageMac.showNumeric(bwdif,"frame diff/bw",1)
- #ImageMac.PlotHisto(bwdif)
- #ImageMac.showNumeric(choose(bwdif.astype(UnsignedInt8),ilut),"frame diff/bw",1)
- #ImageMac.PlotHisto(choose(bwdif.astype(UnsignedInt8),ilut))
- #bwimage=ImageMac.BWImage(em.GetNumericN(100))
- #ImageMac.showNumeric((ImageMac.BWImage(em.GetNumericN(90))+ImageMac.BWImage(em.GetNumericN(110))+ImageMac.BWImage(em.GetNumericN(130))+ImageMac.BWImage(em.GetNumericN(150))+ImageMac.BWImage(em.GetNumericN(170)))/5)
- #bwdif=abs(((bwimage-ImageMac.BWImage(em.GetNumericN(10)))+255)/2)
- #ImageMac.showNumeric(bwimage,"original frame",1)
- #ImageMac.showNumeric(bwdif,"frame diff/bw",1)
- #ImageMac.PlotHisto(bwdif)
- #ImageMac.showNumeric(choose(bwdif.astype(UnsignedInt8),ilut),"frame diff/bw",1)
- #mmask=choose(bwdif.astype(UnsignedInt8),mlut)
- #ImageMac.showNumeric(255-255*mmask,"frame diff/bw",1)
- #mmask.shape=bwimage.shape
- #ImageMac.showNumeric(mmask*bwimage,"frame diff/bw",1)
-
- #ImageMac.showNumeric((innerproduct(em.GetNumericN(300),bw)-innerproduct(em.GetNumericN(0),bw)),"frame diff/bw",1)
- #ImageMac.showNumeric((innerproduct(em.GetNumericN(400)-em.GetNumericN(10),bw)),"frame diff2/bw",1)
- #cdif=em.GetNumericN(400)-em.GetNumericN(10)
- #ImageMac.showNumeric(,"frame diff2/bw",1)
-
- #ImageMac.showNumeric(innerproduct(cdif,r),"frame 500r",1)
- #ImageMac.showNumeric(innerproduct(cdif,g),"frame 500g",1)
- #ImageMac.showNumeric(innerproduct(cdif,b),"frame 500b",1)
-def test2():
- Qt.EnterMovies()
- m=GetMovieFromOpenFile()
- if m==None:
- print "no movie opened"
- else:
- em=ExtMovie(m)
- print "Total frames: ",em.frames," Current frame:",em.curFrame
- ImageMac.showImage(em.GetImage(),"frame 0",1)
-
-if __name__ == '__main__':
- test2()
- \ No newline at end of file
diff --git a/Mac/Contrib/ImageHelpers/ReadMe b/Mac/Contrib/ImageHelpers/ReadMe
deleted file mode 100644
index b6267f7..0000000
--- a/Mac/Contrib/ImageHelpers/ReadMe
+++ /dev/null
@@ -1,22 +0,0 @@
-ExtPixMapWrapper.py
-ImageMac.py
-Hello these are the classes to deal with Images and NumPy arrays I told
-you about. I left everything unchanged, it is the same copy I use with
-comments added. However I think that in ImageMac the only part worth including
-in MacPython (if you think it is worth), is the first half, until GimmeImage.
-After that it is almost rubbish I used in my CV experiments.
-
-MovieUtils.py
-This is another class I use. IT contais a lot of my experiments (unuseful), but
-the first function GetFrames(). it is almost the translation of a QT sample.
-GetMovieFromOpenFile() it is the usual shortcut to get a movie. (no error tracking
-done).
-The class ExtMovie requires a movie in the constructor and then
-provides a method to take every single frame and convert it to an
-Image or a NUmPy array.
-If you think that it can be included in the qt examples I'll write comments and
-polish it a bit. (exceptions handling)
-
- Riccardo Trocca
-
-P.S. Everything works with 2.0b1
diff --git a/Mac/Contrib/PythonDetector/OpenPythonLib b/Mac/Contrib/PythonDetector/OpenPythonLib
deleted file mode 100644
index 87bc7be..0000000
--- a/Mac/Contrib/PythonDetector/OpenPythonLib
+++ /dev/null
Binary files differ
diff --git a/Mac/Contrib/PythonDetector/OpenPythonLib with NS b/Mac/Contrib/PythonDetector/OpenPythonLib with NS
deleted file mode 100644
index 08cb027..0000000
--- a/Mac/Contrib/PythonDetector/OpenPythonLib with NS
+++ /dev/null
Binary files differ
diff --git a/Mac/Contrib/PythonDetector/PythonDetector b/Mac/Contrib/PythonDetector/PythonDetector
deleted file mode 100644
index 6fc28b8..0000000
--- a/Mac/Contrib/PythonDetector/PythonDetector
+++ /dev/null
Binary files differ
diff --git a/Mac/Contrib/PythonDetector/readme.txt b/Mac/Contrib/PythonDetector/readme.txt
deleted file mode 100644
index e6b61da..0000000
--- a/Mac/Contrib/PythonDetector/readme.txt
+++ /dev/null
@@ -1,60 +0,0 @@
-========================================================================
- Copyright (c) 1999 Bill Bedford
-========================================================================
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that the copyright notice and warranty disclaimer appear in
-supporting documentation.
-
-Bill Bedford disclaims all warranties with regard to this software,
-including all implied warranties of merchantability and fitness. In
-no event shall Bill Bedford be liable for any special, indirect or
-consequential damages or any damages whatsoever resulting from loss of
-use, data or profits, whether in an action of contract, negligence or
-other tortuous action, arising out of or in connection with the use or
-performance of this software.
-========================================================================
-
-
-PythonDetectors is a set of Apple Data Detectors that will open an entry in
-the Python Library from a keyword in contextual menus. It looks up either
-module name and open the relevant page or looks up a built in function and
-opens at the entry in the Builtin functions page.
-
-If anyone would like more functionality please contact me.
-
-To use it you must have Apple Data Detectors 1.0.2 installed This can be
-obtained from http://www.apple.com/applescript/data_detectors/
-
-Two action files are provided "OpenPythonLib" will open the library file
-with whatever application is defined as the Internet Config 'file' helper.
-"OpenPythonLib with NS" opens the library file with Netscape.
-
-Instructions
-============
-
-1/ Open the two apple script files with the Script Editor and change the
-first compiled line to point to the location of your Python Library
-folder.
-
-2/ Open the Apple Data Detectors Control Panel and choose Install Detector
-File... from the File menu.
-
-3/ Pick a Detector file from the dialog.
-
-4/ Let the Data Detectors Control Panel optimize the detector.
-
-5/ Choose Install Action File... from the File menu.
-
-6/ Pick an action file from the dialog.
-
-7/ The Data Detectors Control Panel will automatically place the new action
-with its detector. You can click on the action in the control panel window
-to view information about its use.
-
-
-Gotchas
-=======
-
-Unfortunately ADD only works with the US keyboard installed.
diff --git a/Mac/Contrib/Sherlock/Python-FAQ.src b/Mac/Contrib/Sherlock/Python-FAQ.src
deleted file mode 100644
index c316c33..0000000
--- a/Mac/Contrib/Sherlock/Python-FAQ.src
+++ /dev/null
Binary files differ
diff --git a/Mac/Contrib/Sherlock/Python-docs.src b/Mac/Contrib/Sherlock/Python-docs.src
deleted file mode 100644
index f3423c4..0000000
--- a/Mac/Contrib/Sherlock/Python-docs.src
+++ /dev/null
Binary files differ
diff --git a/Mac/Contrib/Sherlock/Python.src b/Mac/Contrib/Sherlock/Python.src
deleted file mode 100644
index 5759537..0000000
--- a/Mac/Contrib/Sherlock/Python.src
+++ /dev/null
Binary files differ
diff --git a/Mac/Contrib/Sherlock/readme.txt b/Mac/Contrib/Sherlock/readme.txt
deleted file mode 100644
index 2603bfc..0000000
--- a/Mac/Contrib/Sherlock/readme.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-These items are plugins for Sherlock, the MacOS 8.5 all-singing-all-dancing
-"find file" program. Drop them on your closed system folder and they will
-automatically be put in the right location. They will even automatically warn
-you when new versions become available!
-
-The "Python" plugin searches the website, the ftp site and the startship site.
-The "Python-FAQ" plugin searches the FAQ.
-
-In case the file creator/type of these files was damaged in transit: to work they
-need to be creator "fndf", type "issp".
-
- Jack Jansen, CWI, 25-Jan-98
- http://www.cwi.nl/~jack/macpython.html
-
diff --git a/Mac/Contrib/Tabcleaner/Tabcleaner.README b/Mac/Contrib/Tabcleaner/Tabcleaner.README
deleted file mode 100644
index 821f7e1..0000000
--- a/Mac/Contrib/Tabcleaner/Tabcleaner.README
+++ /dev/null
@@ -1,41 +0,0 @@
-Original README for Tabcleaner.py
-
-tabcleaner.py is a utility that reformats leading whitespace in a Python source.
-It uses tokenize.py (from the std distribution) to detect INDENTs and DEDENTs,
-then reformats according to the user's options (tabs-only, spaces-only with
-indent size n, or mixed with tab worth m and indent level of n).
-
-Python does not care about the indent of comments and multi-linestrings.
-tabcleaner places these at what Python considers the current indentlevel. About
-half the time, this is correct; the rest of the time it is probably one indent
-level less than what was desired. It is pretty much guaranteed to be
-syntactically correct, (earlier versions broke on some triple-quoted strings).
-
-With no args, (or "-h") prints usage text.
-
-Contact: gmcm@hypernet.com
-
-Additional comments: I have made a few slight changes. It was written to take
-command line arguments, so that you can set parameters like the size of indents,
-and whether you want the result to be all tabs, or all spaces, or a mixture of
-both (an evil combination, if you ask me). It is set, be default, to change your
-indentation to all tabs.
-
-In the current version of Python, all the code in the standard library is
-indented with only spaces. This is a somewhat awkward standard on the mac, so
-most MacPython code is indented with only tabs. This script can be used to do any
-version, but all tabs is the default, which seems to be the best option for the
-Mac.
-
-How to use it on a Mac:
-
-The script is set up to take filenames (or directory names) on the command line.
-To simulate this behaviour with MacPython, you can build an applet out of it
-(with BuildApplet, which should be in your Python folder). Any files draggged and
-dropped onto the resulting applet will be converted to all tabs, with a backup
-copy havning been saved.
-
-If you want the script to convert to space based indentation, your best bet is
-probably to change the default on line 46 of the file.
-
--Chris Barker cbarker@jps.net
diff --git a/Mac/Contrib/Tabcleaner/Tabcleaner.py b/Mac/Contrib/Tabcleaner/Tabcleaner.py
deleted file mode 100644
index c6d3223..0000000
--- a/Mac/Contrib/Tabcleaner/Tabcleaner.py
+++ /dev/null
@@ -1,160 +0,0 @@
-#!/usr/bin/python
-
-import tokenize
-import string
-
-TABSONLY = 'TABSONLY'
-SPACESONLY = 'SPACESONLY'
-MIXED = 'MIXED'
-
-class PyText:
- def __init__(self, fnm, optdict):
- self.optdict = optdict
- self.fnm = fnm
- self.txt = open(self.fnm, 'r').readlines()
- self.indents = [(0, 0, )]
- self.lnndx = 0
- self.indentndx = 0
- def getline(self):
- if self.lnndx < len(self.txt):
- txt = self.txt[self.lnndx]
- self.lnndx = self.lnndx + 1
- else:
- txt = ''
- return txt
- def tokeneater(self, type, token, start, end, line):
- if type == tokenize.INDENT:
- (lvl, s) = self.indents[-1]
- self.indents[-1] = (lvl, s, start[0]-1)
- self.indents.append((lvl+1, start[0]-1,))
- elif type == tokenize.DEDENT:
- (lvl, s) = self.indents[-1]
- self.indents[-1] = (lvl, s, start[0]-1)
- self.indents.append((lvl-1, start[0]-1,))
- elif type == tokenize.ENDMARKER:
- (lvl, s) = self.indents[-1]
- self.indents[-1] = (lvl, s, len(self.txt))
- def split(self, ln):
- content = string.lstrip(ln)
- if not content:
- return ('', '\n')
- lead = ln[:len(ln) - len(content)]
- lead = string.expandtabs(lead)
- return (lead, content)
-
- def process(self):
- style = self.optdict.get('style', TABSONLY)
- indent = string.atoi(self.optdict.get('indent', '4'))
- tabsz = string.atoi(self.optdict.get('tabs', '8'))
- print 'file %s -> style %s, tabsize %d, indent %d' % (self.fnm, style, tabsz, indent)
- tokenize.tokenize(self.getline, self.tokeneater)
- #import pprint
- #pprint.pprint(self.indents)
- new = []
- for (lvl, s, e) in self.indents:
- if s >= len(self.txt):
- break
- if s == e:
- continue
- oldlead, content = self.split(self.txt[s])
- #print "oldlead", len(oldlead), `oldlead`
- if style == TABSONLY:
- newlead = '\t'*lvl
- elif style == SPACESONLY:
- newlead = ' '*(indent*lvl)
- else:
- sz = indent*lvl
- t,spcs = divmod(sz, tabsz)
- newlead = '\t'*t + ' '*spcs
- new.append(newlead + content)
- for ln in self.txt[s+1:e]:
- lead, content = self.split(ln)
- #print "lead:", len(lead)
- new.append(newlead + lead[len(oldlead):] + content)
- self.save(new)
- #print "---", self.fnm
- #for ln in new:
- # print ln,
- #print
-
- def save(self, txt):
- bakname = os.path.splitext(self.fnm)[0]+'.bak'
- print "backing up", self.fnm, "to", bakname
- #print os.getcwd()
- try:
- os.rename(self.fnm, bakname)
- except os.error:
- os.remove(bakname)
- os.rename(self.fnm, bakname)
- open(self.fnm, 'w').writelines(txt)
-
-def test():
- tc = PyText('test1.py')
- tc.process()
- tc = PyText('test1.py')
- tc.process(style=TABSONLY)
- tc = PyText('test1.py')
- tc.process(style=MIXED, indent=4, tabs=8)
- tc = PyText('test1.py')
- tc.process(style=MIXED, indent=2, tabs=8)
-
-def cleanfile(fnm, d):
- if os.path.isdir(fnm) and not os.path.islink(fnm):
- names = os.listdir(fnm)
- for name in names:
- fullnm = os.path.join(fnm, name)
- if (os.path.isdir(fullnm) and not os.path.islink(fullnm)) or \
- os.path.normcase(fullnm[-3:]) == ".py":
- cleanfile(fullnm, d)
- return
- tc = PyText(fnm, d)
- tc.process()
-
-usage="""\
-%s [options] [path...]
- options
- -T : reformat to TABS ONLY
- -S : reformat to SPACES ONLY ( -i option is important)
- -M : reformat to MIXED SPACES / TABS ( -t and -i options important)
- -t<n> : tab is worth <n> characters
- -i<n> : indents should be <n> characters
- -h : print this text
- path is file or directory
-"""
-if __name__ == '__main__':
- import sys, getopt, os
- opts, args = getopt.getopt(sys.argv[1:], "TSMht:i:")
- d = {}
- print `opts`
- for opt in opts:
- if opt[0] == '-T':
- d['style'] = TABSONLY
- elif opt[0] == '-S':
- d['style'] = SPACESONLY
- elif opt[0] == '-M':
- d['style'] = MIXED
- elif opt[0] == '-t':
- d['tabs'] = opt[1]
- elif opt[0] == '-i':
- d['indent'] = opt[1]
- elif opt[0] == '-h':
- print usage % sys.argv[0]
- sys.exit(0)
- if not args:
- print usage % sys.argv[0]
- for arg in args:
- cleanfile(arg, d)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Mac/Contrib/mpwsystem/mpwsystem.py b/Mac/Contrib/mpwsystem/mpwsystem.py
deleted file mode 100644
index 34646c4..0000000
--- a/Mac/Contrib/mpwsystem/mpwsystem.py
+++ /dev/null
@@ -1,67 +0,0 @@
-
-"""mpwsystem -
-A simple example of how to use Apple Events to implement a "system()"
-call that invokes ToolServer on the command.
-
-Contributed by Daniel Brotsky <dev@brotsky.com>.
-
-(renamed from aesystem to mpwsystem by Jack)
-
-system(cmd, infile = None, outfile = None, errfile = None)
-
-1. Every call to system sets "lastStatus" and "lastOutput" to the
-status and output
-produced by the command when executed in ToolServer. (lastParameters
-and lastAttributes
-are set to the values of the AppleEvent result.)
-
-2. system returns lastStatus unless the command result indicates a MacOS error,
-in which case os.Error is raised with the errnum as associated value.
-
-3. You can specify ToolServer-understandable pathnames for
-redirection of input,
-output, and error streams. By default, input is Dev:Null, output is captured
-and returned to the caller, diagnostics are captured and returned to
-the caller.
-(There's a 64K limit to how much can be captured and returned this way.)"""
-
-import os
-import aetools
-
-try: server
-except NameError: server = aetools.TalkTo("MPSX", 1)
-
-lastStatus = None
-lastOutput = None
-lastErrorOutput = None
-lastScript = None
-lastEvent = None
-lastReply = None
-lastParameters = None
-lastAttributes = None
-
-def system(cmd, infile = None, outfile = None, errfile = None):
- global lastStatus, lastOutput, lastErrorOutput
- global lastScript, lastEvent, lastReply, lastParameters, lastAttributes
- cmdline = cmd
- if infile: cmdline += " <" + infile
- if outfile: cmdline += " >" + outfile
- if errfile: cmdline += " " + str(chr(179)) + errfile
- lastScript = "set Exit 0\r" + cmdline + "\rexit {Status}"
- lastEvent = server.newevent("misc", "dosc", {"----" : lastScript})
- (lastReply, lastParameters, lastAttributes) = server.sendevent(lastEvent)
- if lastParameters.has_key('stat'): lastStatus = lastParameters['stat']
- else: lastStatus = None
- if lastParameters.has_key('----'): lastOutput = lastParameters['----']
- else: lastOutput = None
- if lastParameters.has_key('diag'): lastErrorOutput = lastParameters['diag']
- else: lastErrorOutput = None
- if lastParameters['errn'] != 0:
- raise os.Error, lastParameters['errn']
- return lastStatus
-
-if __name__ == '__main__':
- sts = system('alert "Hello World"')
- print 'system returned', sts
-
-
diff --git a/Mac/Contrib/osam/OSAm.c b/Mac/Contrib/osam/OSAm.c
deleted file mode 100644
index aa9a5da..0000000
--- a/Mac/Contrib/osam/OSAm.c
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
- *
- * This is a simple module to allow the
- * user to compile and execute an applescript
- * which is passed in as a text item.
- *
- * Sean Hummel <seanh@prognet.com>
- * 1/20/98
- * RealNetworks
- *
- * Jay Painter <jpaint@serv.net> <jpaint@gimp.org> <jpaint@real.com>
- *
- *
- */
-#include "OSAm.h"
-#include "ScriptRunner.h"
-#include <AppleEvents.h>
-
-
-
-/*
- * Boiler plate generated from "genmodule.py"
- */
-static PyObject *ErrorObject;
-static char OSAm_DoCommand__doc__[] = "";
-
-
-
-static PyObject *
-OSAm_RunCompiledScript (self, args)
- PyObject *self;
- PyObject *args;
-{
- char *commandStr = NULL;
- char *outpath = NULL;
- OSErr myErr;
- AEDesc temp;
- EventRecord event;
-
- temp.dataHandle = NULL;
-
- if (!PyArg_ParseTuple (args, "s", &commandStr))
- return NULL;
-
- myErr = ExecuteScriptFile (commandStr, NULL, &temp);
-
- if (temp.dataHandle != NULL && temp.descriptorType == 'TEXT')
- {
- char *line;
- DescType typeCode;
- long dataSize = 0;
- OSErr err;
-
- dataSize = AEGetDescDataSize (&temp);
-
- if (dataSize > 0)
- {
- PyObject *result = PyString_FromStringAndSize (NULL,
- dataSize);
-
-
- if (!result)
- {
- printf ("OSAm.error Out of memory.\n");
- Py_INCREF (Py_None);
- AEDisposeDesc (&temp);
- return Py_None;
- }
- if ( (err=AEGetDescData(&temp, PyString_AS_STRING(result), dataSize)) < 0 )
- {
- AEDisposeDesc(&temp);
- return PyMac_Error(err);
- }
-
- AEDisposeDesc(&temp);
- return result;
- }
- }
-
- if (myErr != noErr)
- {
- PyErr_Mac (ErrorObject, myErr);
- return NULL;
- }
-
-
- Py_INCREF (Py_None);
- return Py_None;
-}
-
-
-
-
-static PyObject *
-OSAm_CompileAndSave (self, args)
- PyObject *self;
- PyObject *args;
-{
- char *commandStr = NULL;
- char *outpath = NULL;
- OSErr myErr;
- AEDesc temp;
- EventRecord event;
-
- temp.dataHandle = NULL;
-
- if (!PyArg_ParseTuple (args, "ss", &commandStr, &outpath))
- return NULL;
-
- myErr = CompileAndSave (commandStr, outpath, NULL, &temp);
-
-
- if (temp.dataHandle != NULL && temp.descriptorType == 'TEXT')
- {
- char *line;
- DescType typeCode;
- long dataSize = 0;
- OSErr err;
-
- dataSize = AEGetDescDataSize (&temp);
-
- if (dataSize > 0)
- {
- PyObject *result = PyString_FromStringAndSize (NULL,
- dataSize);
-
-
- if (!result)
- {
- printf ("OSAm.error Out of memory.\n");
- Py_INCREF (Py_None);
- AEDisposeDesc (&temp);
- return Py_None;
- }
- if ( (err=AEGetDescData(&temp, PyString_AS_STRING(result), dataSize)) < 0 )
- {
- AEDisposeDesc(&temp);
- return PyMac_Error(err);
- }
-
- AEDisposeDesc(&temp);
- return result;
- }
- }
-
- if (myErr != noErr)
- {
-
- PyErr_Mac (ErrorObject, myErr);
- return NULL;
- }
-
-
- Py_INCREF (Py_None);
- return Py_None;
-}
-
-
-
-static PyObject *
-OSAm_CompileAndExecute (self, args)
- PyObject *self;
- PyObject *args;
-{
- char *commandStr;
- OSErr myErr;
- AEDesc temp;
- EventRecord event;
-
- temp.dataHandle = NULL;
-
- if (!PyArg_ParseTuple (args, "s", &commandStr))
- return NULL;
-
- myErr = CompileAndExecute (commandStr, &temp, NULL);
-
- if (temp.dataHandle != NULL && temp.descriptorType == 'TEXT')
- {
- char *line;
- DescType typeCode;
- long dataSize = 0;
- OSErr err;
-
- dataSize = AEGetDescDataSize (&temp);
-
- if (dataSize > 0)
- {
- PyObject *result = PyString_FromStringAndSize (NULL,
- dataSize);
-
-
- if (!result)
- {
- printf ("OSAm.error Out of memory.\n");
- Py_INCREF (Py_None);
- AEDisposeDesc (&temp);
- return Py_None;
- }
- if ( (err=AEGetDescData(&temp, PyString_AS_STRING(result), dataSize)) < 0 )
- {
- AEDisposeDesc(&temp);
- return PyMac_Error(err);
- }
-
- AEDisposeDesc(&temp);
- return result;
- }
- }
-
- if (myErr != noErr)
- {
-
- PyErr_Mac (ErrorObject, myErr);
- return NULL;
- }
-
-
- Py_INCREF (Py_None);
- return Py_None;
-}
-
-
-
-/*
- * List of methods defined in the module
- */
-static struct PyMethodDef OSAm_methods[] =
-{
- {"CompileAndExecute",
- (PyCFunction) OSAm_CompileAndExecute,
- METH_VARARGS,
- OSAm_DoCommand__doc__},
-#if 0
- {"CompileAndSave",
- (PyCFunction) OSAm_CompileAndSave,
- METH_VARARGS,
- OSAm_DoCommand__doc__},
-
- {"RunCompiledScript",
- (PyCFunction) OSAm_RunCompiledScript,
- METH_VARARGS,
- OSAm_DoCommand__doc__},
-#endif
-
- {NULL, (PyCFunction) NULL, 0, NULL}
-};
-
-
-
-static char OSAm_module_documentation[] = "";
-
-
-/*
- * PYTHON Module Initalization
- */
-void
-initOSAm ()
-{
- PyObject *m, *d;
-
- /* Create the module and add the functions */
- m = Py_InitModule4 ("OSAm",
- OSAm_methods,
- OSAm_module_documentation,
- (PyObject *) NULL, PYTHON_API_VERSION);
-
-
- /* Add some symbolic constants to the module */
- d = PyModule_GetDict (m);
- ErrorObject = PyString_FromString ("OSAm.error");
- PyDict_SetItemString (d, "error", ErrorObject);
-
-
- /* Check for errors */
- if (PyErr_Occurred ())
- Py_FatalError ("can't initialize module OSAm");
-}
diff --git a/Mac/Contrib/osam/OSAm.exp b/Mac/Contrib/osam/OSAm.exp
deleted file mode 100644
index d567a95..0000000
--- a/Mac/Contrib/osam/OSAm.exp
+++ /dev/null
@@ -1 +0,0 @@
-initOSAm
diff --git a/Mac/Contrib/osam/OSAm.h b/Mac/Contrib/osam/OSAm.h
deleted file mode 100644
index 2fd0469..0000000
--- a/Mac/Contrib/osam/OSAm.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- *
- * This is a simple module to allow the
- * user to compile and execute an applescript
- * which is passed in as a text item.
- *
- * Sean Hummel <seanh@prognet.com>
- * 1/20/98
- * RealNetworks
- *
- * Jay Painter <jpaint@serv.net> <jpaint@gimp.org> <jpaint@real.com>
- *
- *
- */
-
-#pragma once
-
-
-/* Python API */
-#include "Python.h"
-#include "macglue.h"
-
-
-/* Macintosh API */
-#include <Types.h>
-#include <AppleEvents.h>
-#include <Processes.h>
-#include <Files.h>
-#include <Gestalt.h>
-#include <Events.h>
diff --git a/Mac/Contrib/osam/OSAm.prj b/Mac/Contrib/osam/OSAm.prj
deleted file mode 100644
index 527563c..0000000
--- a/Mac/Contrib/osam/OSAm.prj
+++ /dev/null
Binary files differ
diff --git a/Mac/Contrib/osam/ScriptRunner.c b/Mac/Contrib/osam/ScriptRunner.c
deleted file mode 100644
index 6f7d9ce..0000000
--- a/Mac/Contrib/osam/ScriptRunner.c
+++ /dev/null
@@ -1,310 +0,0 @@
-/*
- *
- * This is a simple module to allow the
- * user to compile and execute an applescript
- * which is passed in as a text item.
- *
- * Sean Hummel <seanh@prognet.com>
- * 1/20/98
- * RealNetworks
- *
- * Jay Painter <jpaint@serv.net> <jpaint@gimp.org> <jpaint@real.com>
- *
- *
- */
-
-#include <Resources.h>
-#include <Files.h>
-#include <OSA.h>
-#include <string.h>
-#include "ScriptRunner.h"
-#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);
-
-#if 0
-/*
- * store the script as a compile script so that OSA
- * components may load and execute the script easily
- */
-OSAError
-CompileAndSave (const char *text,
- const char *outfile,
- OSAActiveUPP proc,
- AEDesc * result)
-{
-
- OSAError err2 = 0;
- AEDesc theScript;
- OSAID compiledScriptID = 0;
- ComponentInstance scriptingComponent;
- FSSpec outfilespec;
- AEDesc theCompiledScript;
- OSAID scriptid = kOSANullScript;
- short saveres = 0;
-
-
-
- /* Initialize theScript here because it is a struct */
- theScript.dataHandle = NULL;
- theCompiledScript.dataHandle = NULL;
-
-
- /* open the component manager */
- err2 = LoadScriptingComponent (&scriptingComponent);
- if (err2)
- return err2; /* <<< Fail quietly?? */
-
-
- /* construct the AppleEvent Descriptor to contain the text of script */
- AECreateDesc ('TEXT', text, strlen (text), &theScript);
-
- err2 = OSACompile (scriptingComponent,
- &theScript,
- kOSAModeCompileIntoContext,
- &scriptid);
- if (err2)
- {
- OSAScriptError (scriptingComponent, kOSAErrorMessage, 'TEXT', result);
- goto CleanUp;
- }
-
-
- err2 = OSAStore (scriptingComponent,
- scriptid,
- typeOSAGenericStorage,
- kOSAModeCompileIntoContext,
- &theCompiledScript);
- if (err2)
- {
- OSAScriptError (scriptingComponent, kOSAErrorMessage, 'TEXT', result);
- goto CleanUp;
- }
-
-
- c2pstr (outfile);
- FSMakeFSSpec (0, 0, (StringPtr) outfile, &outfilespec);
- p2cstr ((StringPtr) outfile);
-
- FSpDelete (&outfilespec);
-
- FSpCreateResFile (&outfilespec, 'ToyS', 'osas', smRoman);
-
- saveres = CurResFile ();
-
- if (saveres)
- {
- short myres = 0;
- myres = FSpOpenResFile (&outfilespec, fsWrPerm);
-
- UseResFile (myres);
- AddResource (theCompiledScript.dataHandle, 'scpt', 128, "\p");
- CloseResFile (myres);
- UseResFile (saveres);
- }
-
-
-CleanUp:
-
- if (theScript.dataHandle)
- AEDisposeDesc (&theScript);
-
- if (theCompiledScript.dataHandle)
- AEDisposeDesc (&theCompiledScript);
-
- if (scriptid)
- OSADispose (scriptingComponent, scriptid);
-
- if (scriptingComponent != 0)
- CloseComponent (scriptingComponent);
-
-
- return err2;
-}
-#endif
-
-
-OSAError
-CompileAndExecute (const char *text,
- AEDesc * result,
- OSAActiveUPP proc)
-{
- OSAError err2 = 0;
- AEDesc theScript;
- OSAID compiledScriptID = 0;
- ComponentInstance scriptingComponent;
-
-
- /* initialize theScript here because it is a struct */
- theScript.dataHandle = NULL;
-
- /* Open the component manager */
- err2 = LoadScriptingComponent (&scriptingComponent);
- if (err2)
- return err2; /* <<< Fail quietly?? */
-
-
- /* construct the AppleEvent Descriptor to contain the text of script */
- AECreateDesc ('TEXT', text, strlen (text), &theScript);
-
-
- err2 = OSASetActiveProc (scriptingComponent, proc, NULL);
- if (err2)
- goto CleanUp;
-
-
- err2 = OSADoScript (scriptingComponent, &theScript, kOSANullScript, 'TEXT', 0, result);
- if (err2)
- {
- OSAScriptError (scriptingComponent, kOSAErrorMessage, 'TEXT', result);
- goto CleanUp;
- }
-
-
-CleanUp:
-
- if (theScript.dataHandle)
- AEDisposeDesc (&theScript);
-
- if (scriptingComponent != 0)
- CloseComponent (scriptingComponent);
-
-
- return err2;
-}
-
-#if 0
-/*
- * This routine reads in a saved script file and executes
- * the script contained within (from a 'scpt' resource.)
- */
-OSAError
-ExecuteScriptFile (const char *theFilePath,
- OSAActiveUPP proc,
- AEDesc * result)
-{
- OSAError err2;
- short resRefCon;
- AEDesc theScript;
- OSAID compiledScriptID, scriptResultID;
- ComponentInstance scriptingComponent;
- FSSpec theFile;
-
-
- c2pstr (theFilePath);
- FSMakeFSSpec (0, 0, (StringPtr) theFilePath, &theFile);
- p2cstr ((StringPtr) theFilePath);
-
-
- /* open a connection to the OSA */
- err2 = LoadScriptingComponent (&scriptingComponent);
- if (err2)
- return err2; /* <<< Fail quietly?? */
-
-
- err2 = OSASetActiveProc (scriptingComponent, proc, NULL);
- if (err2)
- goto error;
-
-
- /* now, try and read in the script
- * Open the script file and get the resource
- */
- resRefCon = FSpOpenResFile (&theFile, fsRdPerm);
- if (resRefCon == -1)
- return ResError ();
-
- theScript.dataHandle = Get1IndResource (typeOSAGenericStorage, 1);
-
- if ((err2 = ResError ()) || (err2 = resNotFound, theScript.dataHandle == NULL))
- {
- CloseResFile (resRefCon);
- return err2;
- }
-
- theScript.descriptorType = typeOSAGenericStorage;
- DetachResource (theScript.dataHandle);
- CloseResFile (resRefCon);
- err2 = noErr;
-
-
- /* give a copy of the script to AppleScript */
- err2 = OSALoad (scriptingComponent,
- &theScript,
- 0L,
- &compiledScriptID);
- if (err2)
- goto error;
-
- AEDisposeDesc (&theScript);
- theScript.dataHandle = NULL;
-
-
- err2 = OSAExecute (scriptingComponent,
- compiledScriptID,
- kOSANullScript,
- 0,
- &scriptResultID);
-
- if (compiledScriptID)
- OSAScriptError (scriptingComponent, kOSAErrorMessage, 'TEXT', result);
-
- if (err2)
- goto error;
-
- /* If there was an error, return it. If there was a result, return it. */
- (void) OSADispose (scriptingComponent, compiledScriptID);
-
- if (err2)
- goto error;
- else
- goto done;
-
-error:
- if (theScript.dataHandle)
- AEDisposeDesc (&theScript);
-
-
-done:
-
-
- return err2;
-}
-#endif
-
-
-OSAError
-LoadScriptingComponent (ComponentInstance * scriptingComponent)
-{
- OSAError err2;
-
- /* Open a connection to the Open Scripting Architecture */
- *scriptingComponent = OpenDefaultComponent (kOSAComponentType,
- kOSAGenericScriptingComponentSubtype);
-
- err2 = GetComponentInstanceError (*scriptingComponent);
-
- return err2;
-}
diff --git a/Mac/Contrib/osam/ScriptRunner.h b/Mac/Contrib/osam/ScriptRunner.h
deleted file mode 100644
index dda7bbb..0000000
--- a/Mac/Contrib/osam/ScriptRunner.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- *
- * This is a simple module to allow the
- * user to compile and execute an applescript
- * which is passed in as a text item.
- *
- * Sean Hummel <seanh@prognet.com>
- * 1/20/98
- * RealNetworks
- *
- * Jay Painter <jpaint@serv.net> <jpaint@gimp.org> <jpaint@real.com>
- *
- *
- */
-#pragma once
-
-#include <OSA.h>
-
-OSAError CompileAndExecute (const char *text,
- AEDesc *result,
- OSAActiveUPP proc);
-
-OSAError CompileAndSave (const char *text,
- const char *outfile,
- OSAActiveUPP proc,
- AEDesc *result);
-
-OSAError ExecuteScriptFile (const char *theFile,
- OSAActiveUPP proc,
- AEDesc *result);