appletfrontier.c

Go to the documentation of this file.
00001 
00002 /*  $Id: appletfrontier.c 355 2005-01-11 22:48:55Z andreradke $    */
00003 
00004 /*© copyright 1991-96 UserLand Software, Inc. All Rights Reserved.*/
00005 
00006 #include "frontier.h"
00007 #include "standard.h"
00008 
00009 #include <iac.h>
00010 #include "appletdefs.h"
00011 #include "appletmemory.h"
00012 #include "appletstrings.h"
00013 #include "appletfiles.h"
00014 #include "appletprocess.h"
00015 #include "appletfrontier.h"
00016 
00017 #if TARGET_API_MAC_CARBON == 1 /*PBS 03/14/02: AE OS X fix.*/
00018     #include "aeutils.h" /*PBS 03/14/02: AE OS X fix.*/
00019 #endif
00020 
00021 static OSType idFrontier = 'LAND';
00022 
00023 
00024 typedef struct versionRecord {
00025 
00026     unsigned short majorRev: 8; 
00027     
00028     unsigned short minorRev: 4; 
00029     
00030     unsigned short bugFixRev: 4; 
00031     
00032     unsigned short reserved: 15;
00033     
00034     unsigned short flFrontier: 1; /*true if it's Frontier, false if it's Runtime*/
00035     } versionRecord;
00036 
00037 
00038 tyembeddedinfo embeddedinfo;
00039 
00040 
00041 #define frag1 "\pif not defined ("
00042 
00043 #define frag2 "\p) {speaker.beep (); return;}; Frontier.bringToFront (); edit (@"

#define frag3 "\p)"
00044 
00045 
00046 boolean FrontierOpenObject (bigstring objectaddress) {
00047     
00048     bigstring script, returns;
00049     
00050     setstringlength (script, 0);
00051     
00052     pushstring (frag1, script);
00053     
00054     pushstring (objectaddress, script); 
00055     
00056     pushstring (frag2, script);
00057     
00058     pushstring (objectaddress, script);
00059     
00060     pushstring (frag3, script);
00061     
00062     return (FrontierDoScript (script, returns));
00063     } /*FrontierOpenObject*/
00064     
00065     
00066 boolean FrontierGetObject (Handle hscript, bigstring errorstring, Handle *hreturns, OSType *binarytype) {
00067     
00068     AppleEvent event, reply;
00069     boolean fl = true;
00070     Handle h;   
00071     
00072     setstringlength (errorstring, 0);
00073     
00074     if (!IACnewsystemverb ('fast', 'gobj', &event))
00075         return (false);
00076         
00077     IACglobals.event = &event;
00078     
00079     if (!IACpushtextparam (hscript, '----'))
00080         return (false);
00081         
00082     if (!IACsendverb (&event, &reply))
00083         return (false);
00084     
00085     IACglobals.reply = &reply;
00086     
00087     if (IACiserrorreply (errorstring)) {
00088         
00089         fl = false;
00090         
00091         goto exit;
00092         }
00093         
00094     IACglobals.event = &reply; /*get the string from the reply record*/
00095     
00096     fl = IACgetbinaryparam ('----', &h, binarytype);
00097     
00098     if (fl) { /*1st 4 bytes contain the object type*/
00099         
00100         OSType type;
00101         long headersize;
00102         
00103         moveleft (*h, &type, longsizeof (type));
00104         
00105         headersize = 4;
00106         
00107         switch (type) { /*header info varies according to type*/
00108             
00109             case 'pict':
00110                 headersize = 60;
00111                 
00112                 break;
00113                 
00114             case 'data':
00115                 headersize += 4;
00116                 
00117                 break;
00118                 
00119             } /*switch*/
00120         
00121         lockhandle (h);
00122         
00123         fl = newfilledhandle ((*h) + headersize, GetHandleSize (h) - headersize, hreturns);
00124         
00125         unlockhandle (h);
00126         }
00127     
00128     exit:
00129     
00130     AEDisposeDesc (&event); 
00131     
00132     AEDisposeDesc (&reply);
00133     
00134     return (fl);
00135     } /*FrontierGetObject*/
00136 
00137 
00138 boolean FrontierDoScript (bigstring script, bigstring returns) {
00139     
00140     /*
00141     Send a Do Script message to Frontier. The first parameter contains a short
00142     script to be run. The second parameter is the string that Frontier returned 
00143     as the value generated by running the script. 
00144     
00145     Returns true if we were able to send the message to Frontier, and Frontier
00146     was able to compile and run the script and Frontier replied with a returned
00147     value. FrontierDoScript returns false if Frontier isn't running, or if the
00148     script didn't compile or if there was a communications error.
00149     
00150     Frontier is not limited to running 255-character scripts or returning 
00151     255-character returned values. This routine can easily be enhanced to handle 
00152     larger scripts and returned values. 
00153     
00154     11/6/91 DW: Set return string to "IAC Error" if we failed to create an Apple
00155     event descriptor or if the send failed. We're not suggesting that your
00156     error messages should be so brief, rather they should be custom-fit to the
00157     appropriate audience. Here, we want to show you how to locate errors relating
00158     to the IAC channel -- either you're low on memory, or the Apple Event Manager
00159     isn't present, or Frontier isn't running. Watch for this string in FDS's 
00160     little window...
00161     
00162     11/7/91 DW: This code was cribbed from the Frontier Do-Script program and adapted
00163     to run on top of the IAC Tools library. Use this version of FDS if you're using
00164     the IAC Tools library, use the original version if you're writing code to run
00165     directly on top of the Apple Event Manager.
00166     */
00167 
00168     Boolean flhavereply = false;
00169     AppleEvent event, reply;
00170     
00171     copystring ("\pIAC Error.", returns); /*default return string*/
00172     
00173     if (!IACnewverb (idFrontier, 'misc', 'dosc', &event))
00174         return (false);
00175     
00176     IACglobals.event = &event;
00177     
00178     if (!IACpushstringparam (script, '----'))
00179         return (false);
00180         
00181     if (!IACsendverb (&event, &reply))
00182         goto error;
00183     
00184     flhavereply = true;
00185     
00186     IACglobals.reply = &reply;
00187     
00188     if (IACiserrorreply (returns)) /*syntax error or runtime error*/
00189         goto error;
00190         
00191     IACglobals.event = &reply; /*get the string from the reply record*/
00192         
00193     if (!IACgetstringparam ('----', returns))
00194         goto error;
00195     
00196     AEDisposeDesc (&event); 
00197     
00198     AEDisposeDesc (&reply);
00199     
00200     return (true);
00201     
00202     error:
00203     
00204     AEDisposeDesc (&event); 
00205     
00206     if (flhavereply)
00207         AEDisposeDesc (&reply);
00208     
00209     return (false);
00210     } /*FrontierDoScript*/
00211     
00212     
00213 boolean FrontierDoHandleScript (Handle hscript, boolean flfast, boolean flgetreturn, bigstring errorstring, Handle *hreturns) {
00214     
00215     /*
00216     we run the script thru Frontier's interpreter, registered as a system-level
00217     Apple Event handler at fast.dosc.
00218     
00219     the script handle belongs to us, we dispose of it. the return handle belongs
00220     to you. when you're done with it, you must dispose of it.
00221     
00222     1/13/92 DW: check for a fast.dosc system-level handler, and return false if it
00223     isn't installed. this removes the requirement that Frontier be running while 
00224     Card Editor/Runner is running.
00225     */
00226     
00227     static AEAddressDesc selfAddress; 
00228     static boolean inited = false;
00229     AppleEvent event, reply;
00230     boolean flhavereply = false;
00231     OSErr ec;
00232     
00233     *hreturns = nil;
00234     
00235     setstringlength (errorstring, 0);
00236     
00237     if (flfast) {
00238     
00239         if (!IAChandlerinstalled ('fast', 'dosc', true)) {
00240             
00241             /*copystring ("\pFrontier 2.0 or greater isnŐt running.", errorstring);*/
00242             
00243             return (true);
00244             }
00245         }
00246         
00247     if ((!inited) && flfast) {
00248     
00249         ProcessSerialNumber psn;
00250     
00251         psn.highLongOfPSN = 0;
00252     
00253         psn.lowLongOfPSN = kCurrentProcess;
00254     
00255         ec = AECreateDesc (typeProcessSerialNumber, (Ptr) &psn, sizeof (psn), &selfAddress);
00256         
00257         if (ec != noErr) {
00258         
00259             DebugStr ("\pAECreateDesc failed.");
00260             
00261             return (false);
00262             }
00263         
00264         inited = true;
00265         }
00266     
00267     /*create the Apple Event*/ {
00268         
00269         AEAddressDesc *pdesc;
00270         AEAddressDesc targetappdesc;
00271         
00272         if (flfast)
00273             pdesc = &selfAddress;
00274         else {
00275             ec = AECreateDesc (
00276                 typeApplSignature, (Ptr) &idFrontier, 
00277                 sizeof (idFrontier), &targetappdesc);
00278                 
00279             if (ec != noErr) {
00280             
00281                 DisposeHandle (hscript);
00282             
00283                 return (false);
00284                 }
00285         
00286             pdesc = &targetappdesc;
00287             }
00288             
00289         ec = AECreateAppleEvent (
00290             'fast', 'dosc', pdesc, 
00291             kAutoGenerateReturnID, 
00292             kAnyTransactionID, 
00293             &event);
00294     
00295         if (ec != noErr) {
00296             
00297             DisposeHandle (hscript);
00298             
00299             return (false);
00300             }
00301         }
00302     
00303     /*push the script on the event*/ {
00304     
00305         AEDesc desc;
00306         
00307         desc.descriptorType = typeChar;
00308         
00309         #if TARGET_API_MAC_CARBON == 1 /*PBS 03/14/02: AE OS X fix.*/
00310         
00311             AEReplaceDescData (typeChar, *hscript, gethandlesize (hscript), &desc);
00312             
00313         #else
00314     
00315             desc.dataHandle = hscript;
00316     
00317         #endif
00318         
00319         ec = AEPutParamDesc (&event, keyDirectObject, &desc);
00320     
00321         if (ec != noErr)
00322             goto error;
00323         
00324         DisposeHandle (hscript); 
00325         
00326         hscript = nil; 
00327         }
00328     
00329     /*send the event*/ {
00330     
00331         ec = AESend (
00332             &event, &reply, 
00333             kAEWaitReply + kAENeverInteract, 
00334             kAENormalPriority, kNoTimeOut, 
00335             nil, nil);
00336         
00337         if (ec != noErr)
00338             goto error;
00339             
00340         flhavereply = true;
00341         }
00342         
00343     /*did Frontier report an error?*/ {
00344     
00345         AEDesc numDesc;
00346         
00347         ec = AEGetParamDesc (&reply, keyErrorNumber, typeSMInt, &numDesc);
00348         
00349         if (ec == noErr) { /*the reply is an error*/
00350             
00351             AEDesc strDesc;
00352             
00353             ec = AEGetParamDesc (&reply, keyErrorString, typeChar, &strDesc);
00354             
00355             if (ec == noErr) {
00356 
00357                 #if TARGET_API_MAC_CARBON == 1 /*PBS 03/14/02: AE OS X fix.*/
00358                 
00359                     datahandletostring (&strDesc, errorstring);
00360 
00361                 #else
00362                 
00363                     texthandletostring (strDesc.dataHandle, errorstring);
00364                 
00365                 #endif
00366                 
00367                 AEDisposeDesc (&strDesc);
00368                 }
00369             else 
00370                 copystring ("\pThe script generated an error, but no message was provided.", errorstring);
00371             
00372             AEDisposeDesc (&numDesc);
00373             
00374             goto error;
00375             }
00376         } 
00377     
00378     if (flgetreturn) {
00379         
00380         AEDesc desc;
00381         Handle h;
00382     
00383         ec = AEGetParamDesc (&reply, keyDirectObject, typeChar, &desc);
00384         
00385         if (ec != noErr)
00386             goto error;
00387             
00388         /*
00389         xxx = GetHandleSize (desc.dataHandle);
00390         */
00391         
00392         #if TARGET_API_MAC_CARBON == 1 /*PBS 03/14/02: AE OS X fix.*/
00393         
00394             if (!copydatahandle (&desc, &h))
00395                 goto error;
00396         
00397         #else
00398         
00399             if (!copyhandle (desc.dataHandle, &h))
00400                 goto error;
00401         
00402         #endif
00403         
00404         AEDisposeDesc (&desc);
00405         
00406         *hreturns = h; 
00407         }
00408     
00409     AEDisposeDesc (&event); 
00410     
00411     if (flhavereply)
00412         AEDisposeDesc (&reply);
00413     
00414     return (true);
00415     
00416     error:
00417     
00418     if (hscript != nil)
00419         DisposeHandle (hscript);
00420     
00421     AEDisposeDesc (&event); 
00422     
00423     if (flhavereply)
00424         AEDisposeDesc (&reply);
00425         
00426     if (stringlength (errorstring) == 0) {
00427         
00428         copystring ("\pApple Event Manager error. Its code number is ", errorstring);
00429         
00430         pushlong (ec, errorstring);
00431         
00432         pushstring ("\p.", errorstring);
00433         }
00434     
00435     return (false);
00436     } /*FrontierDoHandleScript*/
00437 
00438 #if 0
00439 
00440 static boolean oldFrontierDoHandleScript (Handle hscript, boolean flfast, boolean flgetreturn, bigstring errorstring, Handle *hreturns) {
00441     
00442     AppleEvent event, reply;
00443     boolean fl = true;
00444     
00445     setstringlength (errorstring, 0);
00446     
00447     if (flfast) {
00448     
00449         if (!IACnewsystemverb ('fast', 'dosc', &event))
00450             return (false);
00451         }
00452     else {
00453     
00454         if (!IACnewverb (idFrontier, 'misc', 'dosc', &event))
00455             return (false);
00456         }
00457     
00458     IACglobals.event = &event;
00459     
00460     if (!IACpushtextparam (hscript, '----'))
00461         return (false);
00462         
00463     if (!IACsendverb (&event, &reply))
00464         return (false);
00465     
00466     IACglobals.reply = &reply;
00467     
00468     if (IACiserrorreply (errorstring)) {
00469         
00470         fl = false;
00471         
00472         goto exit;
00473         }
00474         
00475     if (flgetreturn) {
00476         
00477         Handle htextresult;
00478     
00479         IACglobals.event = &reply; /*get the string from the reply record*/
00480         
00481         fl = IACgettextparam ('----', &htextresult);
00482         
00483         if (fl)
00484             fl = copyhandle (htextresult, hreturns); /*DW 12/26/92 looks like a memory leak*/
00485         }
00486     
00487     exit:
00488     
00489     AEDisposeDesc (&event); 
00490     
00491     AEDisposeDesc (&reply);
00492     
00493     return (fl);
00494     } /*oldFrontierDoHandleScript*/
00495 
00496 #endif
00497 
00498 boolean FrontierFastDoScript (bigstring bsscript, boolean flgetreturn, bigstring errorstring, bigstring bsreply) {
00499     
00500     /*
00501     send a fast system-level script to Frontier and get back a value if flgetreturn is
00502     true. we only send the message the fast way if there is a system handler installed.
00503     
00504     use this for scripts that don't open windows or display things in Frontier. it's
00505     good for setting and getting string values in the object database.
00506     */
00507     
00508     AppleEvent event, reply;
00509     boolean fl = true;
00510     
00511     setstringlength (errorstring, 0);
00512     
00513     if (IAChandlerinstalled ('fast', 'dosc', true)) { 
00514     
00515         if (!IACnewsystemverb ('fast', 'dosc', &event))
00516             return (false);
00517         }
00518     else {
00519     
00520         if (!IACnewverb (idFrontier, 'misc', 'dosc', &event))
00521             return (false);
00522         }
00523     
00524     IACglobals.event = &event;
00525     
00526     if (!IACpushstringparam (bsscript, '----'))
00527         return (false);
00528         
00529     if (!IACsendverb (&event, &reply))
00530         return (false);
00531     
00532     IACglobals.reply = &reply;
00533     
00534     if (IACiserrorreply (errorstring)) {
00535         
00536         fl = false;
00537         
00538         goto exit;
00539         }
00540         
00541     if (flgetreturn) {
00542     
00543         IACglobals.event = &reply; /*get the string from the reply record*/
00544         
00545         fl = IACgetstringparam ('----', bsreply);
00546         }
00547     
00548     exit:
00549     
00550     AEDisposeDesc (&event); 
00551     
00552     AEDisposeDesc (&reply);
00553     
00554     return (fl);
00555     } /*FrontierFastDoScript*/
00556     
00557     
00558 boolean FrontierIsRunning (void) {
00559     
00560     typrocessinfo info;
00561     
00562     return (findrunningapp (idFrontier, &info));
00563     } /*FrontierIsRunning*/
00564     
00565     
00566 boolean getFrontierVersion (short *majorRev, short *minorRev, short *bugFixRev, boolean *flRuntime) {
00567     
00568     /*
00569     if Frontier isn't running, return false.
00570     
00571     if it is, return true with information about the version of Frontier that's running.
00572     
00573     About the Apple Event we send...
00574     
00575     We call a system event handler, so it's very fast. 
00576     
00577     It takes no parameters, and returns a long value. The high word of the long is the version 
00578     number, packed the same way as the system version is packed into the SysEnvirons record. 
00579     (8 bits major version, 4 bits minor version, 4 bits revision. The version 2.1.1 would 
00580     be 0x0211.) The low word contains attributes of the server program. At this point only 
00581     a single bit is defined: the low order bit is set if Frontier is the server; otherwise, 
00582     Runtime is the server.
00583     */
00584     
00585     AppleEvent event, reply;
00586     Boolean flhavereply = false;
00587     versionRecord x;
00588     
00589     long z;
00590     
00591     z = sizeof (x);
00592     
00593     if (!FrontierIsRunning ())
00594         return (false);
00595     
00596     if (!IAChandlerinstalled (idFrontier, 'who?', true)) { /*it's Frontier 1.0, not Runtime*/
00597         
00598         *majorRev = 1;
00599         
00600         *minorRev = 0;
00601         
00602         *bugFixRev = 0;
00603         
00604         *flRuntime = false;
00605         
00606         return (true);
00607         }
00608 
00609     if (!IACnewsystemverb (idFrontier, 'who?', &event))
00610         return (false);
00611     
00612     if (!IACsendverb (&event, &reply))
00613         goto error;
00614     
00615     flhavereply = true;
00616     
00617     IACglobals.reply = &reply;
00618     
00619     IACglobals.event = &reply; /*get the string from the reply record*/
00620         
00621     if (!IACgetlongparam ('----', (long *) &x))
00622         goto error;
00623     
00624     *majorRev = x.majorRev;
00625     
00626     *minorRev = x.minorRev;
00627     
00628     *bugFixRev = x.bugFixRev;
00629     
00630     *flRuntime = !x.flFrontier;
00631     
00632     AEDisposeDesc (&event); 
00633     
00634     AEDisposeDesc (&reply);
00635     
00636     return (true);
00637     
00638     error:
00639     
00640     AEDisposeDesc (&event); 
00641     
00642     if (flhavereply)
00643         AEDisposeDesc (&reply);
00644     
00645     return (false);
00646     } /*getFrontierVersion*/
00647     
00648 
00649 static boolean pushStandardParams (void) {
00650     
00651     if (!IACpushfilespecparam (&embeddedinfo.filespec, 'prm2'))
00652         return (false);
00653         
00654     if (!IACpushlongparam ((long) embeddedinfo.creator, 'prm3'))
00655         return (false);
00656         
00657     if (!IACpushstringparam (embeddedinfo.windowtitle, 'prm4'))
00658         return (false);
00659     
00660     return (true);
00661     } /*pushStandardParams*/
00662     
00663 
00664 tyalertcallback alertcallback;
00665 
00666 
00667 static pascal void asynchReplyHandler (AppleEvent *reply) {
00668     
00669     bigstring bserror;
00670     
00671     IACglobals.reply = reply;
00672     
00673     if (IACiserrorreply (bserror)) { /*syntax error or runtime error*/
00674         
00675         if (alertcallback != nil)
00676             (*alertcallback) (bserror);
00677         }
00678     } /*asynchReplyHandler*/
00679 
00680     
00681 boolean tableVerb (OSType command, tyalertcallback alert, boolean flsynchronous) {
00682     
00683     AppleEvent event;
00684     Handle htable = nil;
00685     
00686     alertcallback = alert;
00687         
00688     if (!copyhandle (embeddedinfo.h, &htable))
00689         return (false);
00690         
00691     if (!IACnewverb (idFrontier, embeddedinfo.creator, command, &event))
00692         goto error;
00693         
00694     IACglobals.event = &event;
00695     
00696     if (!IACpushtableparam (htable, 'prm1'))
00697         goto error;
00698         
00699     htable = nil;
00700     
00701     if (!pushStandardParams ())
00702         goto error;
00703     
00704     if (flsynchronous) {
00705     
00706         AppleEvent reply;
00707         
00708         if (!IACsendverb (&event, &reply))
00709             goto error;
00710         
00711         asynchReplyHandler (&reply);
00712         }
00713     else {
00714         if (!IACsendasynch (&event, &asynchReplyHandler))
00715             goto error;
00716         }
00717     
00718     AEDisposeDesc (&event); 
00719     
00720     return (true);
00721     
00722     error:
00723     
00724     disposehandle (htable);
00725     
00726     AEDisposeDesc (&event); 
00727     
00728     return (false);
00729     } /*tableVerb*/
00730     
00731 
00732 boolean renameEmbeddedTable (bigstring oldname, bigstring newname, tyalertcallback alert) {
00733 
00734     AppleEvent event;
00735     
00736     alertcallback = alert;
00737     
00738     if (!IACnewverb (idFrontier, embeddedinfo.creator, 'rnam', &event))
00739         return (false);
00740     
00741     IACglobals.event = &event;
00742     
00743     if (!IACpushstringparam (oldname, 'prm1'))
00744         goto error;
00745         
00746     if (!IACpushstringparam (newname, 'prm2'))
00747         goto error;
00748         
00749     if (!IACsendasynch (&event, &asynchReplyHandler))
00750         goto error;
00751     
00752     AEDisposeDesc (&event); 
00753     
00754     return (true);
00755     
00756     error:
00757     
00758     AEDisposeDesc (&event); 
00759     
00760     return (false);
00761     } /*renameEmbeddedTable*/
00762     
00763 
00764 boolean getEmbeddedTable (tyalertcallback alert) { 
00765 
00766     Handle htable;
00767     Boolean flhavereply = false;
00768     AppleEvent event, reply;
00769     bigstring bserror;
00770     
00771     if (!IACnewverb (idFrontier, embeddedinfo.creator, 'gett', &event))
00772         return (false);
00773     
00774     IACglobals.event = &event;
00775     
00776     if (!pushStandardParams ())
00777         goto error;
00778     
00779     if (!IACsendverb (&event, &reply))
00780         goto error;
00781     
00782     flhavereply = true;
00783     
00784     IACglobals.reply = &reply;
00785     
00786     if (IACiserrorreply (bserror)) { /*syntax error or runtime error*/
00787     
00788         if (alert != nil)
00789             (*alert) (bserror);
00790         
00791         goto error;
00792         }
00793     
00794     IACglobals.event = &reply; /*get the table from the reply record*/
00795     
00796     if (!IACgettableparam ('----', &htable))
00797         goto error;
00798         
00799     if (!copyhandle (htable, &htable))
00800         goto error;
00801         
00802     embeddedinfo.h = htable;
00803     
00804     AEDisposeDesc (&event); 
00805     
00806     AEDisposeDesc (&reply);
00807     
00808     return (true);
00809     
00810     error:
00811     
00812     AEDisposeDesc (&event); 
00813     
00814     if (flhavereply)
00815         AEDisposeDesc (&reply);
00816     
00817     return (false);
00818     } /*getEmbeddedTable*/
00819     
00820     
00821 boolean runEmbeddedScript (Handle hscript, Handle *hreturns) {
00822     
00823     /*
00824     run the script in the environment of the embedded table.
00825     */
00826     
00827     AppleEvent event, reply;
00828     boolean fl = true;
00829     bigstring errorstring;
00830     
00831     *hreturns = nil;
00832     
00833     if (!IACnewverb (idFrontier, embeddedinfo.creator, 'dosc', &event))
00834         return (false);
00835     
00836     IACglobals.event = &event;
00837     
00838     if (!IACpushtextparam (hscript, '----'))
00839         return (false);
00840         
00841     if (!pushStandardParams ())
00842         return (false);
00843     
00844     if (!IACsendverb (&event, &reply))
00845         return (false);
00846     
00847     IACglobals.reply = &reply;
00848     
00849     if (IACiserrorreply (errorstring)) 
00850         DebugStr (errorstring);
00851     
00852     IACglobals.event = &reply; /*get the string from the reply record*/
00853     
00854     fl = IACgettextparam ('----', hreturns);
00855     
00856     if (fl)
00857         fl = copyhandle (*hreturns, hreturns);
00858 
00859     AEDisposeDesc (&event); 
00860     
00861     AEDisposeDesc (&reply);
00862     
00863     return (fl);
00864     } /*runEmbeddedScript*/
00865     
00866 
00867 #if false
00868     
00869     #ifndef uisinternalinclude
00870     
00871         #include <uisinternal.h>
00872     
00873     #endif
00874 
00875 #endif
00876 
00877 
00878 boolean editFrontierObject (bigstring celladdress) {
00879     
00880     /*
00881     uses a new protocol in Frontier 3.0 to open the window
00882     in the client app's layer.
00883     */
00884     
00885     #if false
00886     
00887         ComponentInstance savedwindowserver = wsGlobals.windowserver;
00888         ComponentDescription desc;
00889         Boolean fl = false;
00890         
00891         wsGlobals.windowserver = OpenDefaultComponent ('SHUI', 'LAND');
00892         
00893         if (wsGlobals.windowserver != 0) {
00894             
00895             Handle h;
00896             
00897             if (newtexthandle (celladdress, &h))
00898                 fl = uisOpenHandle (h, false, 0, 0, nil);
00899             }
00900             
00901         CloseComponent (wsGlobals.windowserver);
00902         
00903         wsGlobals.windowserver = savedwindowserver; 
00904         
00905         return (fl);
00906     
00907     #else
00908         
00909         return (false);
00910     
00911     #endif
00912     } /*editFrontierObject*/
00913     
00914     
00915 
00916 
00917 
00918 

Generated on Wed May 31 18:19:42 2006 for frontierkernel 10.1.10a by  doxygen 1.4.6