iactext.c

Go to the documentation of this file.
00001 
00002 /*  $Id: iactext.c 355 2005-01-11 22:48:55Z andreradke $    */
00003 
00004 /* copyright 1991-96 UserLand Software, Inc. All Rights Reserved.*/
00005 
00006 
00007 #include "frontier.h"
00008 #include "standard.h"
00009 
00010 #include "iacinternal.h"
00011 
00012 #if TARGET_API_MAC_CARBON == 1 /*PBS 03/14/02: AE OS X fix.*/
00013     #include "aeutils.h" /*PBS 03/14/02: AE OS X fix.*/
00014 #endif
00015 
00016 Boolean IACpushtextparam (Handle val, OSType keyword) {
00017 
00018     return (IACpushbinaryitem (IACglobals.event, val, typeChar, keyword));
00019     } /*IACpushtextparam*/
00020 
00021 
00022 Boolean IACreturntext (Handle x) {
00023     
00024     return (IACpushbinaryitem (IACglobals.reply, x, typeChar, keyDirectObject));
00025     } /*IACreturntext*/
00026     
00027     
00028 Boolean IACgettextparam (OSType keyword, Handle *htext) {
00029     
00030     if (!IACgettextitem (IACglobals.event, keyword, htext)) {
00031         
00032         IACparamerror (IACglobals.errorcode, "\ptext", keyword);
00033         
00034         return (false);
00035         }
00036     
00037     IACglobals.nextparamoptional = false; /*must be reset for each param*/
00038     
00039     return (true);
00040     } /*IACgettextparam*/
00041     
00042 
00043 Boolean IACgettextitem (AEDescList *list, long n, Handle *val) {
00044     
00045     register OSErr ec;
00046     AEDesc desc;
00047     DescType key;
00048     
00049     if ((*list).descriptorType != typeAEList) {
00050     
00051         ec = AEGetKeyDesc (list, n, typeChar, &desc);
00052         
00053         if (ec != errAEDescNotFound)
00054             goto done;
00055         }
00056 
00057     ec = AEGetNthDesc (list, n, typeChar, &key, &desc);
00058     
00059     done:
00060     
00061     IACglobals.errorcode = ec;
00062     
00063     if (ec == noErr) {
00064     
00065         #if TARGET_API_MAC_CARBON == 1 /*PBS 03/14/02: AE OS X fix.*/
00066 
00067             copydatahandle (&desc, val);
00068             
00069         #else
00070         
00071             *val = desc.dataHandle; 
00072         
00073         #endif
00074         
00075         return (true);
00076         }
00077     else {
00078         *val = NULL;
00079         
00080         return (false);
00081         }
00082     } /*IACgettextitem*/
00083     
00084 
00085 Boolean IACpushtextitem (AEDescList *list, Handle val, long n) {
00086     
00087     return (IACpushbinaryitem (list, val, typeChar, n));
00088     } /*IACpushtextitem*/
00089 
00090 
00091 Boolean IACpushtextitemcopy (AEDescList *list, Handle val, long n) {
00092     
00093     Handle hcopy = val;
00094     
00095     if (hcopy == nil) {
00096         
00097         hcopy = NewHandle (0);
00098         
00099         if (hcopy == nil)
00100             return (false);
00101         }
00102     else {
00103         if (HandToHand (&hcopy) != noErr)
00104             return (false);
00105         }
00106             
00107     return (IACpushbinaryitem (list, hcopy, typeChar, n));
00108     } /*IACpushtextitemcopy*/
00109 
00110 

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