iacrect.c

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

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