In a message dated 11/2/00 5:17:50 AM, [EMAIL PROTECTED] writes:

>Is this API documented publicly someplace?  It would be good to be
>able to have this group be able to look it over with an eye to
>providing compatibility wherever possible...

If the truth be told, I dunno (not my dept.). I know it was implemented to 
support Marionet so it's been around for at least five years or so. Basically 
the way it works is you pass a previously-declared-or-instantiated variable 
with an '@' char in front of it. When a variable is passed this way, the 
handle in the param block is the actual variable data handle, so anything you 
do with it (short of disposing it, which is Not Good) is preserved. Again 
without the issue of null-termination (thanks to the much-maligned Mac 
handle-based memory management) this mechanism permits binary data to go 
either way through the pipe. No rocket science there...


>I assume you mean via GetHandleSize().  This is a non-starter in a
> cross-platform API. 

I understand. I trust you won't blame us for trying to make the best of it 
though?

>A list of these would be useful to have.  My hunch would be that most
>of these are MacOS specific (e.g., access to a field's TextEdit
>resource, or pointers to windows/pixmaps/resources, etc.) and so would
>be of limited use in a cross-platform API.

Again, I agree many (perhaps most) would be irrelevant on other platforms. 
Anyway here's the list (please excuse the length):

SCErr AddProjStar               (XCmdPtr par, StringPtr descriptString, 
Handle theData, StringPtr theName, ResType theType, Boolean replace, long 
*newID);
SCErr AddSFStar                 (XCmdPtr par, Handle theData, StringPtr 
theName, ResType theType, Boolean replace, long *newID);
SCErr Answer                    (XCmdPtr par, unsigned char *prompt, unsigned 
char *p1, unsigned char *p2, unsigned char *p3, short *answer);
SCErr AnswerFile                (XCmdPtr par, unsigned char *prompt, unsigned 
char *type1, unsigned char *type2, unsigned char *type3, unsigned char 
*result, short *vRefNum);
SCErr AnswerFolder              (XCmdPtr par, unsigned char *prompt, unsigned 
char *result, short *vRefNum);
SCErr AnswerProgram             (XCmdPtr par, unsigned char *prompt, unsigned 
char *type, unsigned char *result);
SCErr Ask                       (XCmdPtr par, unsigned char *prompt, unsigned 
char *defaultstr, unsigned char *enterdata, short passwd, short *answer);
SCErr AskFile                   (XCmdPtr par, unsigned char *prompt, unsigned 
char *defaultstr, unsigned char *enterdata, short *vRefNum);
SCErr AskList                   (XCmdPtr par, asklistparmsptr lp, Handle 
*result, short *answer);
SCErr CountMovies               (XCmdPtr par, long *numMovies);
SCErr CountObjects              (XCmdPtr par, StringPtr descriptString, short 
*numObjects);
SCErr CountProjStars            (XCmdPtr par, StringPtr descriptString, long 
*numStars);
SCErr CountSFStars              (XCmdPtr par, long *numStars);
SCErr CreateDrawReg             (XCmdPtr par, StringPtr descriptString, short 
theType, Rect *theRect, Point point1, Point point2, Handle theData);
SCErr CreateObject              (XCmdPtr par, StringPtr descriptString, short 
theKind, short theType, Rect *theRect, Point point1, Point point2, Handle 
theData);
SCErr DelProjStarByID           (XCmdPtr par, StringPtr descriptString, long 
theID, ResType theType);
SCErr DelProjStarByName         (XCmdPtr par, StringPtr descriptString, 
StringPtr theName, ResType theType);
SCErr DelSFStarByID             (XCmdPtr par, long theID, ResType theType);
SCErr DelSFStarByName           (XCmdPtr par, StringPtr theName, ResType 
theType);
SCErr DrawCard                  (XCmdPtr par, StringPtr descriptString);
SCErr DrawObject                (XCmdPtr par, StringPtr descriptString);
SCErr DrawObjectByIndex         (XCmdPtr par, StringPtr descriptString, short 
index);
SCErr DrawObjects               (XCmdPtr par, StringPtr descriptString);
SCErr GetApplResRef             (XCmdPtr par, short *resRef);
SCErr GetApplVolRef             (XCmdPtr par, short *volRef);
SCErr GetBackClut               (XCmdPtr par, StringPtr descriptString, 
CTabHandle *theClut);
SCErr GetBackTolerance          (XCmdPtr par, StringPtr descriptString, short 
*tolerance);
SCErr GetBits                   (XCmdPtr par, StringPtr descriptString, 
PixInfoPtr theInfo);
SCErr GetBrushes                (XCmdPtr par, StringPtr descriptString, 
BrushesHandle *theBrushes);
SCErr GetCardClut               (XCmdPtr par, StringPtr descriptString, 
CTabHandle *theClut);
SCErr GetCardTolerance          (XCmdPtr par, StringPtr descriptString, short 
*tolerance);
SCErr GetContextInfo            (XCmdPtr par, StringPtr descrip, 
ContextInfoHandle *infohand);
SCErr GetCurCTabHandle          (XCmdPtr par, CTabHandle *theClut);
SCErr GetCurEventRec            (XCmdPtr par, EventRecord *eventRec);
SCErr GetCurPrintRec            (XCmdPtr par, THPrint *printRec);
SCErr GetCurTEHandle            (XCmdPtr par, TEHandle *editHand, short 
*type);
SCErr GetFindRect               (XCmdPtr par, Rect *theRect);
SCErr GetIndMovieInfo           (XCmdPtr par, long index, MovieInfo 
*theMovie);
SCErr GetLinePoints             (XCmdPtr par, StringPtr descriptString, Point 
*startPoint, Point *endPoint);
SCErr GetListHandle             (XCmdPtr par, StringPtr descriptString, 
ListHandle *theList);
SCErr GetMsgHandle              (XCmdPtr par, Handle *texthand);
SCErr GetMsgResultStr           (XCmdPtr par, StringPtr theString);
SCErr GetMsgTEHandle            (XCmdPtr par, TEHandle *editHand);
SCErr GetMsgWindowPtr           (XCmdPtr par, WindowPtr *theWindow);
SCErr GetObjectData             (XCmdPtr par, StringPtr descriptString, 
Handle *dataHand);
SCErr GetObjectInfo             (XCmdPtr par, StringPtr descriptString, 
ObjectInfoHandle *infoHand);
SCErr GetObjectInfoByIndex      (XCmdPtr par, StringPtr descrip, short index, 
ObjectInfoHandle *infohand);
SCErr GetObjectScript           (XCmdPtr par, StringPtr descriptString, 
Handle *scriptHand);
SCErr GetPaintInfo              (XCmdPtr par, StringPtr descrip, PixInfoPtr 
theInfo);
SCErr GetPaintPixel             (XCmdPtr par, StringPtr descriptString, Point 
pt, short *color);
SCErr GetPatterns               (XCmdPtr par, StringPtr descriptString, 
PatternsHandle *thePatterns);
SCErr GetPictureData            (XCmdPtr par, StringPtr descriptString, 
PicHandle *thePicture);
SCErr GetPictureInfo            (XCmdPtr par, StringPtr descriptString, 
PDInfoHandle *infoHand);
SCErr GetPictureMode            (XCmdPtr par, StringPtr descriptString, long 
*mode);
SCErr GetPicturePath            (XCmdPtr par, StringPtr descriptString, 
StringPtr path);
SCErr GetPolyHandle             (XCmdPtr par, StringPtr descriptString, 
PolyHandle *thePoly);
SCErr GetPouchVolRef            (XCmdPtr par, short *volRef);
SCErr GetPrivateNum             (XCmdPtr par, StringPtr descriptString, long 
*theNum);
SCErr GetProjAlias              (XCmdPtr par, StringPtr descriptString, 
AliasHandle *theAlias);
SCErr GetProjFSSpec             (XCmdPtr par, StringPtr descriptString, 
FSSpec *theSpec);
SCErr GetProjResRef             (XCmdPtr par, StringPtr descriptString, short 
*resRef);
SCErr GetProjStarByID           (XCmdPtr par, StringPtr descriptString, long 
theID, ResType theType, Handle *dataHand);
SCErr GetProjStarByName         (XCmdPtr par, StringPtr descriptString, 
StringPtr theName, ResType theType, Handle *dataHand);
SCErr GetProjStarInfoByID       (XCmdPtr par, StringPtr descriptString, long 
theID, ResType theType, StarInfo *theInfo);
SCErr GetProjStarInfoByName     (XCmdPtr par, StringPtr descriptString, 
StringPtr theName, ResType theType, StarInfo *theInfo);
SCErr GetProjStarInfoByNum      (XCmdPtr par, StringPtr descriptString, long 
thenum, StarInfo *theinfo);
SCErr GetProjVolRef             (XCmdPtr par, StringPtr descriptString, short 
*volRef);
SCErr GetScriptAttrs            (XCmdPtr par, StringPtr descriptString, 
ScriptInfo *theInfo);
SCErr GetSFResRef               (XCmdPtr par, short *resRef);
SCErr GetSFStarByID             (XCmdPtr par, long theID, ResType theType, 
Handle *dataHand);
SCErr GetSFStarByName           (XCmdPtr par, StringPtr theName, ResType 
theType, Handle *dataHand);
SCErr GetSFStarInfoByID         (XCmdPtr par, long theid, ResType thetype, 
StarInfo *theinfo);
SCErr GetSFStarInfoByName       (XCmdPtr par, StringPtr theName, ResType 
thetype, StarInfo *theinfo);
SCErr GetSFStarInfoByNum        (XCmdPtr par, long thenum, StarInfo *theinfo);
SCErr GetStdLibProcPtr          (XCmdPtr par, long procid, ProcPtr *theproc);
SCErr GetTEHandle               (XCmdPtr par, StringPtr descriptString, 
TEHandle *editHand);
SCErr GetWEHandle               (XCmdPtr par, StringPtr descriptString, 
WEHandle *editHand);
SCErr GetWindowID               (XCmdPtr par, WindowPtr thewindow, StringPtr 
descrip);
SCErr GetWindowPtr              (XCmdPtr par, StringPtr descriptString, 
WindowPtr *theWindow);
SCErr ImageCurCard              (XCmdPtr par, GWorldPtr *theworld, RgnHandle 
*theVisRgn);
SCErr IndentScript              (XCmdPtr par, Handle *theScript, short 
*startSel, short *endSel, short tabWidth);
SCErr IndexToObject             (XCmdPtr par, StringPtr descriptString, short 
index, StringPtr objectStr);
SCErr IndexToObjectID           (XCmdPtr par, StringPtr descrip, short index, 
StringPtr objectstring);
SCErr InStandalone              (XCmdPtr par, Boolean *isStand);
SCErr IsOpenField               (XCmdPtr par, StringPtr descriptString, 
Boolean *isOpen);
SCErr IsStandalone              (XCmdPtr par, StringPtr descriptString, 
Boolean *isStand);
SCErr MakeMenuHandle            (XCmdPtr par, StringPtr descriptString, 
MenuHandle *theMenu, short theID);
SCErr MakeThumbnail             (XCmdPtr par, StringPtr descriptString, 
Boolean contentOnly, Boolean ignoreBars, long scale, PicHandle *thePict);
SCErr NoMemory                  (XCmdPtr par, long needed, Boolean *result);
SCErr ObjectToIndex             (XCmdPtr par, StringPtr descriptString, short 
*index);
void  packreserve               (RGBColor *thecolor, long *thelong);
SCErr PackText                  (XCmdPtr par, Handle *textHand, TEHandle 
editHand);
SCErr PtInObject                (XCmdPtr par, StringPtr descriptString, Point 
thePoint, Boolean *result);
SCErr SetBackTolerance          (XCmdPtr par, StringPtr descriptString, short 
tolerance);
SCErr SetBits                   (XCmdPtr par, StringPtr descriptString, 
PixInfoPtr theInfo);
SCErr SetBrushes                (XCmdPtr par, StringPtr descriptString, 
BrushesHandle theBrushes);
SCErr SetCardTolerance          (XCmdPtr par, StringPtr descriptString, short 
tolerance);
SCErr SetLinePoints             (XCmdPtr par, StringPtr descrip, Point 
startpt, Point endpt);
SCErr SetMsgResultStr           (XCmdPtr par, StringPtr theString);
SCErr SetObjectData             (XCmdPtr par, StringPtr descriptString, 
Handle dataHand);
SCErr SetObjectInfo             (XCmdPtr par, StringPtr descriptString, 
ObjectInfoHandle infoHand);
SCErr SetObjectInfoByIndex      (XCmdPtr par, StringPtr descrip, short index, 
ObjectInfoHandle infohand);
SCErr SetObjectScript           (XCmdPtr par, StringPtr descriptString, 
Handle scriptHand);
SCErr SetPaintPixel             (XCmdPtr par, StringPtr descriptString, Point 
pt, short color);
SCErr SetPatterns               (XCmdPtr par, StringPtr descriptString, 
PatternsHandle thePatterns);
SCErr SetPictureData            (XCmdPtr par, StringPtr descrip, Handle 
theData, Boolean embedded);
SCErr SetPictureInfo            (XCmdPtr par, StringPtr descrip, PDInfoHandle 
infoHand);
SCErr SetPolyHandle             (XCmdPtr par, StringPtr descriptString, 
PolyHandle thePoly);
SCErr SetPrivateNum             (XCmdPtr par, StringPtr descriptString, long 
theNum);
SCErr SetProjStarID             (XCmdPtr par, StringPtr descriptString, long 
theID, ResType theType, long newID, Boolean replace);
SCErr SetScriptAttrs            (XCmdPtr par, StringPtr descriptString, 
ScriptInfo *theInfo);
SCErr SetSFStarID               (XCmdPtr par, long theID, ResType theType, 
long newID, Boolean replace);
SCErr SetSuppressionFlag        (XCmdPtr par, Boolean suppress);
SCErr SetTEHandle               (XCmdPtr par, StringPtr descriptString, 
TEHandle editHand);
SCErr SetWEHandle               (XCmdPtr par, StringPtr descriptString, 
WEHandle editHand);
SCErr TouchCurTEHandle          (XCmdPtr par);
void  unpackreserve             (long *thelong, RGBColor *thecolor);
SCErr UnPackText                (XCmdPtr par, Handle textHand, TEHandle 
*editHand, Rect *dest, Rect *view, long dontWrap);
SCErr UpdateWindow              (XCmdPtr par, StringPtr descrip, Rect *area);

There's also a bunch of others which parallel the public WASTE API but allow 
access to the modified version of the library in SC, and a couple of others 
which are defined in the IT source package (which requires an NDA) that give 
access to the object loader, main globals block (i.e., SC's internal state 
info), and internal proctables.

>I agree that adding support for patching the main event loop would be
>useful.  But what are "internal events"?

Oh, things like cut, copy, paste, clear, undo, redo, XRTN load/unload, 
buildMenuBar, drawMenuBar, popupMenu, menuHit. For these there is at best a 
tenuous connection to actual OS-level events.

>This is certainly a related problem, but a little stickier one.  While
>support for Cocoa objects would be nice, my personal opinion is that a
>platform specific API that requires features of a relatively obscure
>language isn't going to have much appeal outside a very small group of
>developers (and most of those are probably former NeXTStep
>developers).  Bring back OpenDoc!

No I don't expect non-Mac developers to care about Cocoa objects (not while 
OSX remains a Mac-only OS anyway) which is why I mentioned it. I was just 
pointing out that I'm currently interested in extensibility options that 
others probably couldn't care less about. To me though they represent a kind 
of 'Holy Grail' of extensibility, allowing add-ons to do lots of neat stuff I 
wouldn't even want to try to implement in another context, and if I ever get 
SC running as a native Cocoa app I frankly doubt I'll be able to resist 
trying to put together an extensibility API using them. Because of Objective 
C's later binding (vs. say C++) and protocols it should be possible to offer 
much broader capabilities to plugins without me having to do all the work (or 
even most of it). I'd like to be able to offer true plugin objects which can 
define not only their appearance and behavior but even their own related 
syntax. Speaking as someone who has written many hundreds of externals over 
the years, I would just be in hog heaven if I could do that. Speaking as the 
fool who would have to devise such an API, I'm only mad enough to try because 
the Objective C language and Cocoa frameworks take care of (or eliminate 
altogether) most of the grunt work.

As you probably know I came to the SC development team after nearly a decade 
as a fulltime SuperCard user, and over that period I can count on the fingers 
of one hand the number of projects I wrote which didn't use custom externals 
of some sort, so to me extensibility is meat, not gravy. It is an integral 
part of practically everything I do with SC, and I want to make it as 
powerful as it can be. I don't see it being worth the hassle for a 
cross-platform tool like MC to try to present such a low-level extensibility 
API, but again I trust you understand my desire to take what can be done in a 
Mac-only tool right to the limit...

>Bring back OpenDoc!

Word up, y'all! ;-)

-Mark

Reply via email to