iacpoint.c

Go to the documentation of this file.
00001 
00002 /*  $Id: iacpoint.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 
00013 #define typePoint 'QDpt'
00014 
00015 
00016 Boolean IACpushpointparam (Point val, OSType keyword) {
00017     
00018     return (IACpushpointitem (IACglobals.event, val, keyword));
00019     } /*IACpushpointparam*/
00020 
00021 
00022 Boolean IACreturnpoint (Point x) {
00023     
00024     return (IACpushpointitem (IACglobals.reply, x, keyDirectObject));
00025     } /*IACreturnpoint*/
00026 
00027 
00028 Boolean IACgetpointparam (OSType keyword, Point *val) {
00029     
00030     if (!IACgetpointitem (IACglobals.event, keyword, val)) {
00031     
00032         IACparamerror (IACglobals.errorcode, "\ppoint", keyword);
00033         
00034         return (false);
00035         }
00036     
00037     IACglobals.nextparamoptional = false; /*must be reset for each param*/
00038     
00039     return (true);
00040     } /*IACgetpointparam*/
00041     
00042     
00043 Boolean IACgetpointitem (AEDescList *list, long n, Point *val) {
00044     
00045     OSErr ec;
00046     DescType key;
00047     DescType typeCode;
00048     Size actualSize;
00049     
00050     if ((*list).descriptorType != typeAEList) {
00051     
00052         ec = AEGetKeyPtr (list, n, typePoint, &typeCode, (Ptr)val,
00053                           sizeof (*val), &actualSize);
00054 
00055         if (ec != errAEDescNotFound)
00056             goto done;
00057         }
00058 
00059     ec = AEGetNthPtr (list, n, typePoint, &key, &typeCode, (Ptr) val, sizeof (*val), &actualSize);
00060     
00061     done:
00062     
00063     IACglobals.errorcode = ec;
00064     
00065     return (ec == noErr);
00066     } /*IACgetpointitem*/
00067 
00068 
00069 Boolean IACpushpointitem (AEDescList *list, Point val, long n) {
00070     
00071     OSErr ec;
00072     
00073     if ((*list).descriptorType != typeAEList)
00074         ec = AEPutKeyPtr (list, n, typePoint, (Ptr)&val, sizeof (val));
00075     else
00076         ec = AEPutPtr (list, n, typePoint, (Ptr)&val, sizeof (val));
00077     
00078     IACglobals.errorcode = ec;
00079     
00080     return (ec == noErr);
00081     } /*IACpushpointitem*/
00082 

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