iacrgb.c

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

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