iowacomponent.c

Go to the documentation of this file.
00001 
00002 /*  $Id: iowacomponent.c 355 2005-01-11 22:48:55Z andreradke $    */
00003 
00004 /******************************************************************************
00005 
00006     UserLand Frontier(tm) -- High performance Web content management,
00007     object database, system-level and Internet scripting environment,
00008     including source code editing and debugging.
00009 
00010     Copyright (C) 1992-2004 UserLand Software, Inc.
00011 
00012     This program is free software; you can redistribute it and/or modify
00013     it under the terms of the GNU General Public License as published by
00014     the Free Software Foundation; either version 2 of the License, or
00015     (at your option) any later version.
00016 
00017     This program is distributed in the hope that it will be useful,
00018     but WITHOUT ANY WARRANTY; without even the implied warranty of
00019     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020     GNU General Public License for more details.
00021 
00022     You should have received a copy of the GNU General Public License
00023     along with this program; if not, write to the Free Software
00024     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025 
00026 ******************************************************************************/
00027 
00028 #include "frontier.h"
00029 #include "standard.h"
00030 
00031 #include "shelltypes.h"
00032 #include "iowacore.h"
00033 #ifndef iowaRuntime
00034     #include "iowaobject.h"
00035     #include "iowaicons.h"
00036 #endif
00037 #include <appletfont.h>
00038 #include <appletresource.h>
00039 
00040 
00041 typedef struct tycomponentrecord {
00042     
00043     ComponentInstance component;
00044     
00045     long objectTypeID;
00046     } tycomponentrecord, **hdlcomponentrecord;
00047     
00048     
00049 static tycomponentrecord **componentarray = nil; /*dynamic array of components*/
00050 
00051 
00052 static short countcomponents (void) {
00053     
00054     if (componentarray == nil)
00055         return (0);
00056         
00057     return ((short) (GetHandleSize ((Handle) componentarray) / sizeof (tycomponentrecord)));
00058     } /*countcomponents*/
00059     
00060     
00061 static boolean addcomponent (ComponentInstance component, long objectTypeID) {
00062 
00063     tycomponentrecord rec;
00064     short ct;
00065     
00066     rec.component = component;
00067     
00068     rec.objectTypeID = objectTypeID;
00069     
00070     if (componentarray == nil)
00071         return (newfilledhandle (&rec, sizeof (tycomponentrecord), (Handle *) &componentarray));
00072     
00073     ct = countcomponents ();
00074     
00075     SetHandleSize ((Handle) componentarray, (ct + 1) * sizeof (tycomponentrecord));
00076 
00077     if (MemError () != noErr)
00078         return (false);
00079     
00080     (*componentarray) [ct] = rec;
00081     
00082     return (true);
00083     } /*addcomponent*/
00084     
00085     
00086 static ComponentInstance findcomponent (long objectTypeID) {
00087     
00088     short ct, i;
00089     tycomponentrecord rec;
00090     
00091     ct = countcomponents ();
00092     
00093     for (i = 0; i < ct; i++) {
00094         
00095         rec = (*componentarray) [i];
00096         
00097         if (rec.objectTypeID == objectTypeID)           
00098             return (rec.component);
00099         } /*for*/
00100     
00101     return (0); /*not found*/
00102     } /*findcomponent*/
00103     
00104 //Code change by Timothy Paustian Thursday, June 29, 2000 9:42:56 PM
00105 //Update macro
00106 /* 2004-10-22 aradke: Not sure if this is the right thing to do for the Mach-O build,
00107         but at least it makes the link errors for _drawobjectGlue etc. go away
00108 */
00109 #if TARGET_RT_MAC_CFM || TARGET_RT_MAC_MACHO
00110     enum {
00111         uppCallComponentProcInfo = kPascalStackBased
00112                 | RESULT_SIZE(kFourByteCode)
00113                 | STACK_ROUTINE_PARAMETER(1, kFourByteCode)
00114     };
00115     
00116     #pragma options align=mac68k
00117     
00118     static pascal ComponentResult getconfigGlue (ComponentInstance comp, tyioaconfigrecord *config) {
00119         
00120         #define getconfigGlueParamSize  (sizeof (config))
00121         
00122         struct getconfigGlueGluePB {    /* extension of ComponentParameters system type */
00123             unsigned char componentFlags;
00124             unsigned char componentParamSize;
00125             short componentWhat;
00126             tyioaconfigrecord *config;
00127             ComponentInstance comp;
00128         };
00129         
00130         struct getconfigGlueGluePB pb;
00131         
00132         pb.componentFlags = 0;
00133         pb.componentParamSize = getconfigGlueParamSize;
00134         pb.componentWhat = IOAgetconfigcommand;
00135         pb.config = config;
00136         pb.comp = comp;
00137         
00138         #if TARGET_API_MAC_CARBON == 1
00139         {
00140         return  CallComponentDispatch((ComponentParameters*) &pb);
00141         }
00142         #else   
00143         return CallUniversalProc(CallComponentUPP, uppCallComponentProcInfo, &pb);
00144         #endif
00145         } /*getconfigGlue*/
00146     
00147     
00148     static pascal ComponentResult drawobjectGlue (ComponentInstance comp, hdlobject h) {
00149         
00150         #define drawobjectGlueParamSize (sizeof (h))
00151         
00152         struct drawobjectGlueGluePB {
00153             unsigned char componentFlags;
00154             unsigned char componentParamSize;
00155             short componentWhat;
00156             hdlobject h;
00157             ComponentInstance comp;
00158         };
00159         
00160         struct drawobjectGlueGluePB pb;
00161         
00162         pb.componentFlags = 0;
00163         pb.componentParamSize = drawobjectGlueParamSize;
00164         pb.componentWhat = IOAdrawobjectcommand;
00165         pb.h = h;
00166         pb.comp = comp;
00167         
00168         #if TARGET_API_MAC_CARBON == 1
00169         return  CallComponentDispatch((ComponentParameters*) &pb);
00170         #else   
00171         return CallUniversalProc(CallComponentUPP, uppCallComponentProcInfo, &pb);
00172         #endif
00173         } /*drawobjecttGlue*/
00174     
00175     
00176     static pascal ComponentResult initobjectGlue (ComponentInstance comp, tyobject *obj) {
00177         
00178         #define initobjectGlueParamSize (sizeof (obj))
00179         
00180         struct initobjectGlueGluePB {   /* extension of ComponentParameters system type */
00181             unsigned char componentFlags;
00182             unsigned char componentParamSize;
00183             short componentWhat;
00184             tyobject *obj;
00185             ComponentInstance comp;
00186         };
00187         
00188         struct initobjectGlueGluePB pb;
00189         
00190         pb.componentFlags = 0;
00191         pb.componentParamSize = initobjectGlueParamSize;
00192         pb.componentWhat = IOAinitobjectcommand;
00193         pb.obj = obj;
00194         pb.comp = comp;
00195         
00196         #if TARGET_API_MAC_CARBON == 1
00197         return  CallComponentDispatch((ComponentParameters*) &pb);
00198         #else   
00199         return CallUniversalProc(CallComponentUPP, uppCallComponentProcInfo, &pb);
00200         #endif
00201         } /*initobjectGlue*/
00202     
00203     
00204     static pascal ComponentResult debugGlue (ComponentInstance comp, hdlobject h, ptrstring errorstring) {
00205         
00206         #define debugGlueParamSize  (sizeof (h) + sizeof (errorstring))
00207         
00208         struct debugGlueGluePB {    /* extension of ComponentParameters system type */
00209             unsigned char componentFlags;
00210             unsigned char componentParamSize;
00211             short componentWhat;
00212             ptrstring errorstring;
00213             hdlobject h;
00214             ComponentInstance comp;
00215         };
00216         
00217         struct debugGlueGluePB pb;
00218         
00219         pb.componentFlags = 0;
00220         pb.componentParamSize = debugGlueParamSize;
00221         pb.componentWhat = IOAdebugobjectcommand;
00222         pb.errorstring = errorstring;
00223         pb.h = h;
00224         pb.comp = comp;
00225         
00226         #if TARGET_API_MAC_CARBON == 1
00227         return  CallComponentDispatch((ComponentParameters*) &pb);
00228         #else   
00229         return CallUniversalProc(CallComponentUPP, uppCallComponentProcInfo, &pb);
00230         #endif
00231         } /*debugGlue*/
00232     
00233     
00234     static pascal ComponentResult clickGlue (ComponentInstance comp, hdlobject listhead, hdlobject h, Point pt, boolean flshiftkey, boolean fl2click) {
00235         
00236         #define clickGlueParamSize  (sizeof (listhead) + sizeof (h) + sizeof (pt) + sizeof (short) + sizeof (short))
00237         
00238         struct clickGlueGluePB {    /* extension of ComponentParameters system type */
00239             unsigned char componentFlags;
00240             unsigned char componentParamSize;
00241             short componentWhat;
00242             boolean fl2click;
00243             boolean filler;
00244             boolean flshiftkey;
00245             boolean filler2;
00246             Point pt;
00247             hdlobject h;
00248             hdlobject listhead;
00249             ComponentInstance comp;
00250         };
00251         
00252         struct clickGlueGluePB pb;
00253         
00254         pb.componentFlags = 0;
00255         pb.componentParamSize = clickGlueParamSize;
00256         pb.componentWhat = IOAclickcommand;
00257         pb.fl2click = fl2click;
00258         pb.flshiftkey = flshiftkey;
00259         pb.pt = pt;
00260         pb.h = h;
00261         pb.listhead = listhead;
00262         pb.comp = comp;
00263         
00264         #if TARGET_API_MAC_CARBON == 1
00265         return  CallComponentDispatch((ComponentParameters*) &pb);
00266         #else   
00267         return CallUniversalProc(CallComponentUPP, uppCallComponentProcInfo, &pb);
00268         #endif
00269         } /*clickGlue*/
00270     
00271     
00272     static pascal ComponentResult cleanGlue (ComponentInstance comp, hdlobject h, short height, short width, Rect *r) {
00273         
00274         #define cleanGlueParamSize  (sizeof (h) + sizeof (height) + sizeof (width) + sizeof (r))
00275         
00276         struct cleanGlueGluePB {    /* extension of ComponentParameters system type */
00277             unsigned char componentFlags;
00278             unsigned char componentParamSize;
00279             short componentWhat;
00280             Rect *r;
00281             short width;
00282             short height;
00283             hdlobject h;
00284             ComponentInstance comp;
00285         };
00286         
00287         struct cleanGlueGluePB pb;
00288         
00289         pb.componentFlags = 0;
00290         pb.componentParamSize = cleanGlueParamSize;
00291         pb.componentWhat = IOAcleanupcommand;
00292         pb.r = r;
00293         pb.width = width;
00294         pb.height = height;
00295         pb.h = h;
00296         pb.comp = comp;
00297         
00298         #if TARGET_API_MAC_CARBON == 1
00299         return  CallComponentDispatch((ComponentParameters*) &pb);
00300         #else   
00301         return CallUniversalProc(CallComponentUPP, uppCallComponentProcInfo, &pb);
00302         #endif
00303         } /*cleanGlue*/
00304     
00305     
00306     static pascal ComponentResult recalcGlue (ComponentInstance comp, hdlobject h, boolean flmajorrecalc) {
00307         
00308         #define recalcGlueParamSize (sizeof (h) + sizeof (short))
00309         
00310         struct recalcGlueGluePB {   /* extension of ComponentParameters system type */
00311             unsigned char componentFlags;
00312             unsigned char componentParamSize;
00313             short componentWhat;
00314             boolean flmajorrecalc;
00315             boolean filler;
00316             hdlobject h;
00317             ComponentInstance comp;
00318         };
00319         
00320         struct recalcGlueGluePB pb;
00321         
00322         pb.componentFlags = 0;
00323         pb.componentParamSize = recalcGlueParamSize;
00324         pb.componentWhat = IOArecalccommand;
00325         pb.flmajorrecalc = flmajorrecalc;
00326         pb.h = h;
00327         pb.comp = comp;
00328         
00329         #if TARGET_API_MAC_CARBON == 1
00330         return  CallComponentDispatch((ComponentParameters*) &pb);
00331         #else   
00332         return CallUniversalProc(CallComponentUPP, uppCallComponentProcInfo, &pb);
00333         #endif
00334         } /*recalcGlue*/
00335     
00336     
00337     static pascal ComponentResult editGlue (ComponentInstance comp, hdlobject h, boolean flgoin) {
00338         
00339         #define editGlueParamSize   (sizeof (h) + sizeof (short))
00340         
00341         struct editGlueGluePB { /* extension of ComponentParameters system type */
00342             unsigned char componentFlags;
00343             unsigned char componentParamSize;
00344             short componentWhat;
00345             boolean flgoin;
00346             boolean filler;
00347             hdlobject h;
00348             ComponentInstance comp;
00349         };
00350         
00351         struct editGlueGluePB pb;
00352         
00353         pb.componentFlags = 0;
00354         pb.componentParamSize = editGlueParamSize;
00355         pb.componentWhat = IOAeditobjectcommand;
00356         pb.flgoin = flgoin;
00357         pb.h = h;
00358         pb.comp = comp;
00359         
00360         #if TARGET_API_MAC_CARBON == 1
00361         return  CallComponentDispatch((ComponentParameters*) &pb);
00362         #else   
00363         return CallUniversalProc(CallComponentUPP, uppCallComponentProcInfo, &pb);
00364         #endif
00365         } /*editGlue*/
00366     
00367     
00368     static pascal ComponentResult keyGlue (ComponentInstance comp, hdlobject h, short ch) {
00369         
00370         #define keyGlueParamSize    (sizeof (h) + sizeof (ch))
00371         
00372         struct keyGlueGluePB {  /* extension of ComponentParameters system type */
00373             unsigned char componentFlags;
00374             unsigned char componentParamSize;
00375             short componentWhat;
00376             short ch;
00377             hdlobject h;
00378             ComponentInstance comp;
00379         };
00380         
00381         struct keyGlueGluePB pb;
00382         
00383         pb.componentFlags = 0;
00384         pb.componentParamSize = keyGlueParamSize;
00385         pb.componentWhat = IOAkeystrokecommand;
00386         pb.ch = ch;
00387         pb.h = h;
00388         pb.comp = comp;
00389         
00390         #if TARGET_API_MAC_CARBON == 1
00391         return  CallComponentDispatch((ComponentParameters*) &pb);
00392         #else   
00393         return CallUniversalProc(CallComponentUPP, uppCallComponentProcInfo, &pb);
00394         #endif
00395         } /*keyGlue*/
00396     
00397     
00398     static pascal ComponentResult idleGlue (ComponentInstance comp, hdlobject h) {
00399         
00400         #define idleGlueParamSize   (sizeof (h))
00401         
00402         struct idleGlueGluePB { /* extension of ComponentParameters system type */
00403             unsigned char componentFlags;
00404             unsigned char componentParamSize;
00405             short componentWhat;
00406             hdlobject h;
00407             ComponentInstance comp;
00408         };
00409         
00410         struct idleGlueGluePB pb;
00411         
00412         pb.componentFlags = 0;
00413         pb.componentParamSize = idleGlueParamSize;
00414         pb.componentWhat = IOAidlecommand;
00415         pb.h = h;
00416         pb.comp = comp;
00417         
00418         #if TARGET_API_MAC_CARBON == 1
00419         return  CallComponentDispatch((ComponentParameters*) &pb);
00420         #else   
00421         return CallUniversalProc(CallComponentUPP, uppCallComponentProcInfo, &pb);
00422         #endif
00423         } /*idleGlue*/
00424     
00425     
00426     static pascal ComponentResult getvalueGlue (ComponentInstance comp, hdlobject h, Handle *r) {
00427         
00428         #define getvalueGlueParamSize   (sizeof (h) + sizeof (r))
00429         
00430         struct getvalueGlueGluePB { /* extension of ComponentParameters system type */
00431             unsigned char componentFlags;
00432             unsigned char componentParamSize;
00433             short componentWhat;
00434             Handle *r;
00435             hdlobject h;
00436             ComponentInstance comp;
00437         };
00438         
00439         struct getvalueGlueGluePB pb;
00440         
00441         pb.componentFlags = 0;
00442         pb.componentParamSize = getvalueGlueParamSize;
00443         pb.componentWhat = IOAgetvaluecommand;
00444         pb.r = r;
00445         pb.h = h;
00446         pb.comp = comp;
00447         
00448         #if TARGET_API_MAC_CARBON == 1
00449         return  CallComponentDispatch((ComponentParameters*) &pb);
00450         #else   
00451         return CallUniversalProc(CallComponentUPP, uppCallComponentProcInfo, &pb);
00452         #endif
00453         } /*getvalueGlue*/
00454     
00455     
00456     static pascal ComponentResult setvalueGlue (ComponentInstance comp, hdlobject h, Handle hvalue) {
00457         
00458         #define setvalueGlueParamSize   (sizeof (h) + sizeof (hvalue))
00459         
00460         struct setvalueGlueGluePB { /* extension of ComponentParameters system type */
00461             unsigned char componentFlags;
00462             unsigned char componentParamSize;
00463             short componentWhat;
00464             Handle hvalue;
00465             hdlobject h;
00466             ComponentInstance comp;
00467         };
00468         
00469         struct setvalueGlueGluePB pb;
00470         
00471         pb.componentFlags = 0;
00472         pb.componentParamSize = setvalueGlueParamSize;
00473         pb.componentWhat = IOAsetvaluecommand;
00474         pb.hvalue = hvalue;
00475         pb.h = h;
00476         pb.comp = comp;
00477         
00478         #if TARGET_API_MAC_CARBON == 1
00479         return  CallComponentDispatch((ComponentParameters*) &pb);
00480         #else   
00481         return CallUniversalProc(CallComponentUPP, uppCallComponentProcInfo, &pb);
00482         #endif
00483         } /*setvalueGlue*/
00484     
00485     
00486     static pascal ComponentResult setcursorGlue (ComponentInstance comp, hdlobject h, Point pt) {
00487         
00488         #define setcursorGlueParamSize  (sizeof (h) + sizeof (pt))
00489         
00490         struct setcursorGlueGluePB {    /* extension of ComponentParameters system type */
00491             unsigned char componentFlags;
00492             unsigned char componentParamSize;
00493             short componentWhat;
00494             Point pt;
00495             hdlobject h;
00496             ComponentInstance comp;
00497         };
00498         
00499         struct setcursorGlueGluePB pb;
00500         
00501         pb.componentFlags = 0;
00502         pb.componentParamSize = setcursorGlueParamSize;
00503         pb.componentWhat = IOAsetcursorcommand;
00504         pb.pt = pt;
00505         pb.h = h;
00506         pb.comp = comp;
00507         
00508         #if TARGET_API_MAC_CARBON == 1
00509         return  CallComponentDispatch((ComponentParameters*) &pb);
00510         #else   
00511         return CallUniversalProc(CallComponentUPP, uppCallComponentProcInfo, &pb);
00512         #endif
00513         } /*setcursorGlue*/
00514     
00515     
00516     static pascal ComponentResult unpackdataGlue (ComponentInstance comp, hdlobject h) {
00517         
00518         #define unpackdataGlueParamSize (sizeof (h))
00519         
00520         struct unpackdataGlueGluePB {   /* extension of ComponentParameters system type */
00521             unsigned char componentFlags;
00522             unsigned char componentParamSize;
00523             short componentWhat;
00524             hdlobject h;
00525             ComponentInstance comp;
00526         };
00527         
00528         struct unpackdataGlueGluePB pb;
00529         
00530         pb.componentFlags = 0;
00531         pb.componentParamSize = unpackdataGlueParamSize;
00532         pb.componentWhat = IOAunpackdatacommand;
00533         pb.h = h;
00534         pb.comp = comp;
00535         
00536         #if TARGET_API_MAC_CARBON == 1
00537         return  CallComponentDispatch((ComponentParameters*) &pb);
00538         #else   
00539         return CallUniversalProc(CallComponentUPP, uppCallComponentProcInfo, &pb);
00540         #endif
00541         } /*unpackdataGlue*/
00542     
00543     
00544     static pascal ComponentResult getattributesGlue (ComponentInstance comp, hdlobject h, AppleEvent *event) {
00545         
00546         #define getattributesGlueParamSize  (sizeof (h) + sizeof (event))
00547         
00548         struct getattributesGlueGluePB {    /* extension of ComponentParameters system type */
00549             unsigned char componentFlags;
00550             unsigned char componentParamSize;
00551             short componentWhat;
00552             AppleEvent *event;
00553             hdlobject h;
00554             ComponentInstance comp;
00555         };
00556         
00557         struct getattributesGlueGluePB pb;
00558         
00559         pb.componentFlags = 0;
00560         pb.componentParamSize = getattributesGlueParamSize;
00561         pb.componentWhat = IOAgetattributescommand;
00562         pb.event = event;
00563         pb.h = h;
00564         pb.comp = comp;
00565         
00566         #if TARGET_API_MAC_CARBON == 1
00567         return  CallComponentDispatch((ComponentParameters*) &pb);
00568         #else   
00569         return CallUniversalProc(CallComponentUPP, uppCallComponentProcInfo, &pb);
00570         #endif
00571         } /*getattributesGlue*/
00572     
00573     
00574     static pascal ComponentResult setattributesGlue (ComponentInstance comp, hdlobject h, AppleEvent *event) {
00575         
00576         #define setattributesGlueParamSize  (sizeof (h) + sizeof (event))
00577         
00578         struct setattributesGlueGluePB {    /* extension of ComponentParameters system type */
00579             unsigned char componentFlags;
00580             unsigned char componentParamSize;
00581             short componentWhat;
00582             AppleEvent *event;
00583             hdlobject h;
00584             ComponentInstance comp;
00585         };
00586         
00587         struct setattributesGlueGluePB pb;
00588         
00589         pb.componentFlags = 0;
00590         pb.componentParamSize = setattributesGlueParamSize;
00591         pb.componentWhat = IOAsetattributescommand;
00592         pb.event = event;
00593         pb.h = h;
00594         pb.comp = comp;
00595         
00596         #if TARGET_API_MAC_CARBON == 1
00597         return  CallComponentDispatch((ComponentParameters*) &pb);
00598         #else   
00599         return CallUniversalProc(CallComponentUPP, uppCallComponentProcInfo, &pb);
00600         #endif
00601         } /*setattributesGlue*/
00602     
00603 #ifndef iowaRuntime
00604     
00605     static pascal ComponentResult geticonGlue (ComponentInstance comp, Handle *h) {
00606         
00607         #define geticonGlueParamSize    (sizeof (h))
00608         
00609         struct geticonGlueGluePB {  /* extension of ComponentParameters system type */
00610             unsigned char componentFlags;
00611             unsigned char componentParamSize;
00612             short componentWhat;
00613             Handle *h;
00614             ComponentInstance comp;
00615         };
00616         
00617         struct geticonGlueGluePB pb;
00618         
00619         pb.componentFlags = 0;
00620         pb.componentParamSize = geticonGlueParamSize;
00621         pb.componentWhat = IOAgeticoncommand;
00622         pb.h = h;
00623         pb.comp = comp;
00624         
00625         #if TARGET_API_MAC_CARBON == 1
00626         return  CallComponentDispatch((ComponentParameters*) &pb);
00627         #else   
00628         return CallUniversalProc(CallComponentUPP, uppCallComponentProcInfo, &pb);
00629         #endif
00630         } /*geticonGlue*/
00631 
00632 #endif
00633     
00634     
00635     static pascal ComponentResult getcardGlue (ComponentInstance comp, Handle *hcard) {
00636         
00637         #define getcardGlueParamSize    (sizeof (hcard))
00638         
00639         struct getcardGlueGluePB {  /* extension of ComponentParameters system type */
00640             unsigned char componentFlags;
00641             unsigned char componentParamSize;
00642             short componentWhat;
00643             Handle *hcard;
00644             ComponentInstance comp;
00645         };
00646         
00647         struct getcardGlueGluePB pb;
00648         
00649         pb.componentFlags = 0;
00650         pb.componentParamSize = getcardGlueParamSize;
00651         pb.componentWhat = IOAgetcardcommand;
00652         pb.hcard = hcard;
00653         pb.comp = comp;
00654         
00655         #if TARGET_API_MAC_CARBON == 1
00656         return  CallComponentDispatch((ComponentParameters*) &pb);
00657         #else   
00658         return CallUniversalProc(CallComponentUPP, uppCallComponentProcInfo, &pb);
00659         #endif
00660         } /*getcardGlue*/
00661     
00662     
00663     static pascal ComponentResult packdataGlue (ComponentInstance comp, hdlobject h, Handle *hpackeddata) {
00664         
00665         #define packdataGlueParamSize   (sizeof (h) + sizeof (hpackeddata))
00666         
00667         struct packdataGlueGluePB { /* extension of ComponentParameters system type */
00668             unsigned char componentFlags;
00669             unsigned char componentParamSize;
00670             short componentWhat;
00671             Handle *hpackeddata;
00672             hdlobject h;
00673             ComponentInstance comp;
00674         };
00675         
00676         struct packdataGlueGluePB pb;
00677         
00678         pb.componentFlags = 0;
00679         pb.componentParamSize = packdataGlueParamSize;
00680         pb.componentWhat = IOApackdatacommand;
00681         pb.hpackeddata = hpackeddata;
00682         pb.h = h;
00683         pb.comp = comp;
00684         
00685         #if TARGET_API_MAC_CARBON == 1
00686         return  CallComponentDispatch((ComponentParameters*) &pb);
00687         #else   
00688         return CallUniversalProc(CallComponentUPP, uppCallComponentProcInfo, &pb);
00689         #endif
00690         } /*packdataGlue*/
00691     
00692     
00693     static pascal ComponentResult disposedataGlue (ComponentInstance comp, hdlobject h) {
00694         
00695         #define disposedataGlueParamSize    (sizeof (h))
00696         
00697         struct disposedataGlueGluePB {  /* extension of ComponentParameters system type */
00698             unsigned char componentFlags;
00699             unsigned char componentParamSize;
00700             short componentWhat;
00701             hdlobject h;
00702             ComponentInstance comp;
00703         };
00704         
00705         struct disposedataGlueGluePB pb;
00706         
00707         pb.componentFlags = 0;
00708         pb.componentParamSize = disposedataGlueParamSize;
00709         pb.componentWhat = IOAdisposedatacommand;
00710         pb.h = h;
00711         pb.comp = comp;
00712         
00713         #if TARGET_API_MAC_CARBON == 1
00714         return  CallComponentDispatch((ComponentParameters*) &pb);
00715         #else   
00716         return CallUniversalProc(CallComponentUPP, uppCallComponentProcInfo, &pb);
00717         #endif
00718         } /*disposedataGlue*/
00719     
00720     
00721     static pascal ComponentResult canreplicateGlue (ComponentInstance comp, hdlobject h) {
00722         
00723         #define canreplicateGlueParamSize   (sizeof (h))
00724         
00725         struct canreplicateGlueGluePB { /* extension of ComponentParameters system type */
00726             unsigned char componentFlags;
00727             unsigned char componentParamSize;
00728             short componentWhat;
00729             hdlobject h;
00730             ComponentInstance comp;
00731         };
00732         
00733         struct canreplicateGlueGluePB pb;
00734         
00735         pb.componentFlags = 0;
00736         pb.componentParamSize = canreplicateGlueParamSize;
00737         pb.componentWhat = IOAcanreplicatcommand;
00738         pb.h = h;
00739         pb.comp = comp;
00740         
00741         #if TARGET_API_MAC_CARBON == 1
00742         return  CallComponentDispatch((ComponentParameters*) &pb);
00743         #else   
00744         return CallUniversalProc(CallComponentUPP, uppCallComponentProcInfo, &pb);
00745         #endif
00746         } /*canreplicateGlue*/
00747     
00748     
00749     static pascal ComponentResult catchreturnGlue (ComponentInstance comp, hdlobject h) {
00750         
00751         #define catchreturnGlueParamSize    (sizeof (h))
00752         
00753         struct catchreturnGlueGluePB {  /* extension of ComponentParameters system type */
00754             unsigned char componentFlags;
00755             unsigned char componentParamSize;
00756             short componentWhat;
00757             hdlobject h;
00758             ComponentInstance comp;
00759         };
00760         
00761         struct catchreturnGlueGluePB pb;
00762         
00763         pb.componentFlags = 0;
00764         pb.componentParamSize = catchreturnGlueParamSize;
00765         pb.componentWhat = IOAcatchreturncommand;
00766         pb.h = h;
00767         pb.comp = comp;
00768         
00769         #if TARGET_API_MAC_CARBON == 1
00770         return  CallComponentDispatch((ComponentParameters*) &pb);
00771         #else   
00772         return CallUniversalProc(CallComponentUPP, uppCallComponentProcInfo, &pb);
00773         #endif
00774         } /*catchreturnGlue*/
00775     
00776     
00777     static pascal ComponentResult getinvalrectGlue (ComponentInstance comp, hdlobject h, Rect *r) {
00778         
00779         #define getinvalrectGlueParamSize   (sizeof (h) + sizeof (r))
00780         
00781         struct getinvalrectGlueGluePB { /* extension of ComponentParameters system type */
00782             unsigned char componentFlags;
00783             unsigned char componentParamSize;
00784             short componentWhat;
00785             Rect *r;
00786             hdlobject h;
00787             ComponentInstance comp;
00788         };
00789         
00790         struct getinvalrectGlueGluePB pb;
00791         
00792         pb.componentFlags = 0;
00793         pb.componentParamSize = getinvalrectGlueParamSize;
00794         pb.componentWhat = IOAgetobjectinvalrectcommand;
00795         pb.r = r;
00796         pb.h = h;
00797         pb.comp = comp;
00798         
00799         #if TARGET_API_MAC_CARBON == 1
00800         return  CallComponentDispatch((ComponentParameters*) &pb);
00801         #else   
00802         return CallUniversalProc(CallComponentUPP, uppCallComponentProcInfo, &pb);
00803         #endif
00804         } /*getinvalrectGlue*/
00805     
00806     
00807     static pascal ComponentResult geteditrectGlue (ComponentInstance comp, hdlobject h, Rect *r) {
00808         
00809         #define geteditrectGlueParamSize    (sizeof (h) + sizeof (r))
00810         
00811         struct geteditrectGlueGluePB {  /* extension of ComponentParameters system type */
00812             unsigned char componentFlags;
00813             unsigned char componentParamSize;
00814             short componentWhat;
00815             Rect *r;
00816             hdlobject h;
00817             ComponentInstance comp;
00818         };
00819         
00820         struct geteditrectGlueGluePB pb;
00821         
00822         pb.componentFlags = 0;
00823         pb.componentParamSize = geteditrectGlueParamSize;
00824         pb.componentWhat = IOAgetobjecteditrectcommand;
00825         pb.r = r;
00826         pb.h = h;
00827         pb.comp = comp;
00828         
00829         #if TARGET_API_MAC_CARBON == 1
00830         return  CallComponentDispatch((ComponentParameters*) &pb);
00831         #else   
00832         return CallUniversalProc(CallComponentUPP, uppCallComponentProcInfo, &pb);
00833         #endif
00834         } /*geteditrectGlue*/
00835 
00836     #pragma options align=reset
00837 
00838 #else   // not CFM
00839 
00840     static pascal ComponentResult getconfigGlue (ComponentInstance comp, tyioaconfigrecord *config)
00841         
00842         ComponentCallNow (IOAgetconfigcommand, sizeof (tyioaconfigrecord *)); 
00843         /*getconfigGlue*/
00844     
00845     
00846     static pascal ComponentResult drawobjectGlue (ComponentInstance comp, hdlobject h) 
00847         
00848         ComponentCallNow (IOAdrawobjectcommand, sizeof (hdlobject)); 
00849         /*drawobjecttGlue*/
00850     
00851     
00852     static pascal ComponentResult initobjectGlue (ComponentInstance comp, tyobject *obj) 
00853         
00854         ComponentCallNow (IOAinitobjectcommand, sizeof (tyobject *)); 
00855         /*initobjectGlue*/
00856     
00857     
00858     static pascal ComponentResult debugGlue (ComponentInstance comp, hdlobject h, bigstring errorstring) 
00859         
00860         ComponentCallNow (IOAdebugobjectcommand, sizeof (hdlobject) + sizeof (char *)); 
00861         /*debugGlue*/
00862     
00863     
00864     static pascal ComponentResult clickGlue (ComponentInstance comp, hdlobject listhead, hdlobject h, Point pt, boolean flshiftkey, boolean fl2click) 
00865         
00866         ComponentCallNow (IOAclickcommand, (2 * sizeof (hdlobject)) + sizeof (Point) + sizeof (short) + sizeof (short)); 
00867         /*clickGlue*/
00868     
00869     
00870     static pascal ComponentResult cleanGlue (ComponentInstance comp, hdlobject h, short height, short width, Rect *r) 
00871         
00872         ComponentCallNow (IOAcleanupcommand, sizeof (hdlobject) + sizeof (short) + sizeof (short) + sizeof (Rect *)); 
00873         /*cleanGlue*/
00874     
00875     
00876     static pascal ComponentResult recalcGlue (ComponentInstance comp, hdlobject h, boolean flmajorrecalc) 
00877         
00878         ComponentCallNow (IOArecalccommand, sizeof (hdlobject) + sizeof (short)); 
00879         /*recalcGlue*/
00880     
00881     
00882     static pascal ComponentResult editGlue (ComponentInstance comp, hdlobject h, boolean flgoin) 
00883         
00884         ComponentCallNow (IOAeditobjectcommand, sizeof (hdlobject) + sizeof (short)); 
00885         /*editGlue*/
00886     
00887     
00888     static pascal ComponentResult keyGlue (ComponentInstance comp, hdlobject h, short ch) 
00889         
00890         /*
00891         1/20/93 DW: last param used to be a char, but this was causing the size computed
00892         below to be an odd number. by changing it to a short, we keep things clean and
00893         working.
00894         */
00895         
00896         ComponentCallNow (IOAkeystrokecommand, sizeof (hdlobject) + sizeof (short)); 
00897         /*keyGlue*/
00898     
00899     
00900     static pascal ComponentResult idleGlue (ComponentInstance comp, hdlobject h) 
00901         
00902         ComponentCallNow (IOAidlecommand, sizeof (hdlobject)); 
00903         /*idleGlue*/
00904     
00905     
00906     static pascal ComponentResult getvalueGlue (ComponentInstance comp, hdlobject h, Handle *r) 
00907         
00908         ComponentCallNow (IOAgetvaluecommand, sizeof (hdlobject) + sizeof (Handle *)); 
00909         /*getvalueGlue*/
00910     
00911     
00912     static pascal ComponentResult setvalueGlue (ComponentInstance comp, hdlobject h, Handle hvalue) 
00913         
00914         ComponentCallNow (IOAsetvaluecommand, sizeof (hdlobject) + sizeof (Handle)); 
00915         /*setvalueGlue*/
00916     
00917     
00918     static pascal ComponentResult setcursorGlue (ComponentInstance comp, hdlobject h, Point pt) 
00919         
00920         ComponentCallNow (IOAsetcursorcommand, sizeof (hdlobject) + sizeof (Point)); 
00921         /*setcursorGlue*/
00922     
00923     
00924     static pascal ComponentResult unpackdataGlue (ComponentInstance comp, hdlobject h) 
00925         
00926         ComponentCallNow (IOAunpackdatacommand, sizeof (hdlobject)); 
00927         /*unpackdataGlue*/
00928     
00929     
00930     static pascal ComponentResult getattributesGlue (ComponentInstance comp, hdlobject h, AppleEvent *event) 
00931         
00932         ComponentCallNow (IOAgetattributescommand, sizeof (hdlobject) + sizeof (AppleEvent *)); 
00933         /*getattributesGlue*/
00934     
00935     
00936     static pascal ComponentResult setattributesGlue (ComponentInstance comp, hdlobject h, AppleEvent *event) 
00937         
00938         ComponentCallNow (IOAsetattributescommand, sizeof (hdlobject) + sizeof (AppleEvent *)); 
00939         /*setattributesGlue*/
00940     
00941 
00942 #ifndef iowaRuntime
00943     
00944     static pascal ComponentResult geticonGlue (ComponentInstance comp, Handle *h) 
00945         
00946         ComponentCallNow (IOAgeticoncommand, sizeof (Handle *)); 
00947         /*geticonGlue*/
00948 
00949 #endif
00950     
00951     
00952     static pascal ComponentResult getcardGlue (ComponentInstance comp, Handle *hcard) 
00953         
00954         ComponentCallNow (IOAgetcardcommand, sizeof (Handle *)); 
00955         /*getcardGlue*/
00956     
00957     
00958     static pascal ComponentResult packdataGlue (ComponentInstance comp, hdlobject h, Handle *hpackeddata) 
00959         
00960         ComponentCallNow (IOApackdatacommand, sizeof (hdlobject) + sizeof (Handle *)); 
00961         /*packdataGlue*/
00962     
00963     
00964     static pascal ComponentResult disposedataGlue (ComponentInstance comp, hdlobject h) 
00965         
00966         ComponentCallNow (IOAdisposedatacommand, sizeof (hdlobject)); 
00967         /*disposedataGlue*/
00968     
00969     
00970     static pascal ComponentResult canreplicateGlue (ComponentInstance comp, hdlobject h) 
00971         
00972         ComponentCallNow (IOAcanreplicatcommand, sizeof (hdlobject)); 
00973         /*canreplicateGlue*/
00974     
00975     
00976     static pascal ComponentResult catchreturnGlue (ComponentInstance comp, hdlobject h) 
00977         
00978         ComponentCallNow (IOAcatchreturncommand, sizeof (hdlobject)); 
00979         /*catchreturnGlue*/
00980     
00981     
00982     static pascal ComponentResult getinvalrectGlue (ComponentInstance comp, hdlobject h, Rect *r) 
00983         
00984         ComponentCallNow (IOAgetobjectinvalrectcommand, sizeof (hdlobject) + sizeof (Rect *)); 
00985         /*getinvalrectGlue*/
00986     
00987     
00988     static pascal ComponentResult geteditrectGlue (ComponentInstance comp, hdlobject h, Rect *r) 
00989         
00990         ComponentCallNow (IOAgetobjecteditrectcommand, sizeof (hdlobject) + sizeof (Rect *)); 
00991         /*geteditrectGlue*/
00992 
00993 #endif
00994 
00995 boolean callinitobject (tyobject *obj) {
00996     
00997     (*obj).owningcard = iowadata; /*make card record available to the object handler*/
00998     
00999     (**iowadata).fontinfo = globalfontinfo;
01000     
01001     return (initobjectGlue (findcomponent ((*obj).objecttype), obj));
01002     } /*callinitobject*/
01003     
01004     
01005 static boolean pregluecall (hdlobject h, ComponentInstance *comp) {
01006     
01007     /*
01008     set up the object record so the callback can find information
01009     that many of them need. 
01010     
01011     1/23/93 DW: beef it up to get the component id from the array and
01012     return false if it's 0.
01013     
01014     2/16/93 dmb: check iowadata for nil -- defensive driving
01015     */
01016     
01017     (**h).owningcard = iowadata; /*make card record available to the object handler*/
01018     
01019     if (iowadata == nil)
01020         return (false);
01021     
01022     (**iowadata).fontinfo = globalfontinfo;
01023     
01024     *comp = findcomponent ((**h).objecttype);
01025     
01026     return (*comp != 0);
01027     } /*pregluecall*/
01028     
01029     
01030 boolean calldrawobject (hdlobject h) {
01031     
01032     ComponentInstance comp;
01033     
01034     if (!pregluecall (h, &comp)) {
01035         
01036         Rect r = (**h).objectrect;
01037         
01038         #if TARGET_API_MAC_CARBON == 1
01039         Pattern gray;
01040         GetQDGlobalsGray(&gray);
01041         FillRect (&r, &gray);
01042         #else
01043         
01044         FillRect (&r, (ConstPatternParam) &quickdrawglobal (gray));
01045         #endif
01046         
01047         FrameRect (&r);
01048         
01049         return (false);
01050         }
01051     
01052     return (drawobjectGlue (comp, h));
01053     } /*calldrawobject*/
01054     
01055     
01056 boolean callclick (hdlobject listhead, hdlobject h, Point pt, boolean flshiftkey, boolean fl2click) {
01057     
01058     ComponentInstance comp;
01059     
01060     if (!pregluecall (h, &comp))
01061         return (false);
01062     
01063     return (clickGlue (comp, listhead, h, pt, flshiftkey, fl2click));
01064     } /*callclick*/
01065     
01066     
01067 boolean callcleanobject (hdlobject h, short height, short width, Rect *r) {
01068     
01069     ComponentInstance comp;
01070     
01071     if (!pregluecall (h, &comp))
01072         return (false);
01073     
01074     return (cleanGlue (comp, h, height, width, r));
01075     } /*callcleanobject*/
01076     
01077     
01078 boolean callrecalcobject (hdlobject h, boolean flmajorrecalc) {
01079     
01080     ComponentInstance comp;
01081     
01082     if (!pregluecall (h, &comp))
01083         return (false);
01084     
01085     return (recalcGlue (comp, h, flmajorrecalc));
01086     } /*callrecalcobject*/
01087     
01088     
01089 boolean calleditobject (hdlobject h, boolean flgoin) {
01090     
01091     ComponentInstance comp;
01092     
01093     if (!pregluecall (h, &comp))
01094         return (false);
01095     
01096     return (editGlue (comp, h, flgoin));
01097     } /*calleditobject*/
01098 
01099 
01100 boolean callkeyobject (hdlobject h, char ch) {
01101     
01102     ComponentInstance comp;
01103     
01104     if (h == nil)
01105         return (true);
01106         
01107     if (!pregluecall (h, &comp))
01108         return (true);
01109     
01110     return (keyGlue (comp, h, (short) ch));
01111     } /*callkeyobject*/
01112     
01113     
01114 boolean callidleobject (hdlobject h) {
01115     
01116     ComponentInstance comp;
01117     
01118     if (h == nil)
01119         return (true);
01120         
01121     if (!pregluecall (h, &comp))
01122         return (true);
01123     
01124     return (idleGlue (comp, h));
01125     } /*callidleobject*/
01126     
01127     
01128 boolean callcanreplicate (hdlobject h) {
01129     
01130     ComponentInstance comp;
01131     
01132     if (!pregluecall (h, &comp))
01133         return (false);
01134     
01135     return (canreplicateGlue (comp, h));
01136     } /*callcanreplicate*/
01137     
01138     
01139 boolean callcatchreturn (hdlobject h) {
01140     
01141     ComponentInstance comp;
01142     
01143     if (!pregluecall (h, &comp))
01144         return (false);
01145     
01146     return (catchreturnGlue (comp, h));
01147     } /*callcatchreturn*/
01148     
01149     
01150 boolean callgetinvalrect (hdlobject h, Rect *r) {
01151     
01152     ComponentInstance comp;
01153     
01154     getobjectrect (h, r); /*allow for groups*/
01155     
01156     if (!pregluecall (h, &comp))
01157         return (false);
01158     
01159     return (getinvalrectGlue (comp, h, r));
01160     } /*callinvalobject*/
01161     
01162     
01163 boolean callgeteditrect (hdlobject h, Rect *r) {
01164     
01165     ComponentInstance comp;
01166     
01167     *r = (**h).objectrect; /*geteditrect has special case for groups*/
01168     
01169     if (!pregluecall (h, &comp))
01170         return (false);
01171     
01172     getobjectrect (h, r); 
01173         
01174     return (geteditrectGlue (comp, h, r));
01175     } /*callgeteditrect*/
01176     
01177     
01178 boolean callgetvalue (hdlobject h, Handle *hvalue) {
01179     
01180     ComponentInstance comp;
01181     
01182     *hvalue = nil;
01183     
01184     if (!pregluecall (h, &comp))
01185         return (false);
01186     
01187     return (getvalueGlue (comp, h, hvalue));
01188     } /*callgetvalue*/
01189     
01190     
01191 boolean callsetvalue (hdlobject h, Handle hvalue) {
01192     
01193     ComponentInstance comp;
01194     
01195     if (!pregluecall (h, &comp))
01196         return (false);
01197     
01198     return (setvalueGlue (comp, h, hvalue));
01199     } /*callsetvalue*/
01200     
01201     
01202 boolean callsetcursor (hdlobject h, Point pt) {
01203     
01204     ComponentInstance comp;
01205     
01206     if (!pregluecall (h, &comp))
01207         return (false);
01208     
01209     return (setcursorGlue (comp, h, pt));
01210     } /*callsetcursor*/
01211     
01212     
01213 boolean calldisposedata (hdlobject h) {
01214     
01215     ComponentInstance comp;
01216     
01217     if (!pregluecall (h, &comp))
01218         return (false);
01219     
01220     return (disposedataGlue (comp, h));
01221     } /*calldisposedata*/
01222     
01223 
01224 boolean callgetattributes (hdlobject h, AppleEvent *event) {
01225     
01226     ComponentInstance comp;
01227     
01228     if (!pregluecall (h, &comp))
01229         return (false);
01230     
01231     return (getattributesGlue (comp, h, event));
01232     } /*callgetattributes*/
01233     
01234     
01235 boolean callsetattributes (hdlobject h, AppleEvent *event) {
01236     
01237     ComponentInstance comp;
01238     
01239     if (!pregluecall (h, &comp))
01240         return (false);
01241     
01242     return (setattributesGlue (comp, h, event));
01243     } /*callsetattributes*/
01244     
01245     
01246 boolean callgetcard (hdlobject h, Handle *hcard) {
01247     
01248     ComponentInstance comp;
01249     
01250     if (!pregluecall (h, &comp))
01251         return (false);
01252     
01253     return (getcardGlue (comp, hcard));
01254     } /*callgetcard*/
01255     
01256 
01257 boolean callpackdata (hdlobject h, Handle *hpackeddata) {
01258     
01259     switch ((**h).objecttype) {
01260     
01261         case grouptype: case clonetype:
01262             return (true);
01263             
01264         default: {
01265             ComponentInstance comp;
01266     
01267             if (!pregluecall (h, &comp))
01268                 return (false);
01269     
01270             return (packdataGlue (comp, h, hpackeddata));
01271             }
01272         } /*switch*/
01273     } /*callpackdata*/
01274     
01275     
01276 boolean callunpackdata (hdlobject h) {
01277     
01278     switch ((**h).objecttype) {
01279     
01280         case grouptype: case clonetype:
01281             return (true);
01282             
01283         default: {
01284             ComponentInstance comp;
01285     
01286             if (!pregluecall (h, &comp))
01287                 return (false);
01288             
01289             return (unpackdataGlue (comp, h));
01290             }
01291         } /*switch*/
01292     } /*callunpackdata*/
01293     
01294     
01295 boolean calldebug (hdlobject h, Str255 errorstring) {
01296     
01297     ComponentInstance comp;
01298     
01299     setstringlength (errorstring, 0);
01300     
01301     if (!pregluecall (h, &comp))
01302         return (false);
01303     
01304     return (debugGlue (comp, h, errorstring));
01305     } /*calldebug*/
01306     
01307     
01308 static boolean getconfigrecord (hdlobject h, tyioaconfigrecord *config) {
01309     
01310     ComponentInstance comp;
01311     
01312     clearbytes (config, sizeof (tyioaconfigrecord));
01313     
01314     comp = findcomponent ((**h).objecttype);
01315     
01316     if (comp == 0)
01317         return (false);
01318         
01319     return (getconfigGlue (comp, config));
01320     } /*getconfigrecord*/
01321     
01322     
01323 boolean callgetobjectname (hdlobject h, Str255 objectname) {
01324 
01325     switch ((**h).objecttype) {
01326     
01327         case grouptype:
01328             copystring ("\pGroup", objectname);
01329             
01330             break;
01331             
01332         case clonetype:
01333             copystring ("\pClone", objectname);
01334             
01335             break;
01336             
01337         default: {
01338             tyioaconfigrecord config;
01339             
01340             getconfigrecord (h, &config);
01341             
01342             copystring (config.objectTypeName, objectname);
01343             
01344             break;
01345             }
01346         } /*switch*/
01347     
01348     return (true);
01349     } /*callgetobjectname*/
01350 
01351 
01352 boolean callgetobjectflagname (hdlobject h, Str255 objectflagname) {
01353 
01354     tyioaconfigrecord config;
01355     
01356     getconfigrecord (h, &config);
01357     
01358     copystring (config.objectFlagName, objectflagname);
01359     
01360     return (true);
01361     } /*callgetobjectflagname*/
01362 
01363 
01364 boolean callframewhenediting (hdlobject h) {
01365 
01366     tyioaconfigrecord config;
01367     
01368     getconfigrecord (h, &config);
01369     
01370     return (config.frameWhenEditing);
01371     } /*callframewhenediting*/
01372 
01373 
01374 boolean callcaneditvalue (hdlobject h) {
01375 
01376     tyioaconfigrecord config;
01377     
01378     getconfigrecord (h, &config);
01379     
01380     return (config.canEditValue);
01381     } /*callcaneditvalue*/
01382 
01383 
01384 boolean calltoggleflagwhenhit (hdlobject h) {
01385 
01386     tyioaconfigrecord config;
01387     
01388     getconfigrecord (h, &config);
01389     
01390     return (config.toggleFlagWhenHit);
01391     } /*calltoggleflagwhenhit*/
01392 
01393 
01394 boolean callmutallyexclusive (hdlobject h) {
01395 
01396     tyioaconfigrecord config;
01397     
01398     getconfigrecord (h, &config);
01399     
01400     return (config.mutuallyExclusive);
01401     } /*callmutallyexclusive*/
01402 
01403 
01404 boolean callspeaksforgroup (hdlobject h) {
01405 
01406     tyioaconfigrecord config;
01407     
01408     getconfigrecord (h, &config);
01409     
01410     return (config.speaksForGroup);
01411     } /*callspeaksforgroup*/
01412 
01413 
01414 boolean callhandlesmousetrack (hdlobject h) {
01415 
01416     tyioaconfigrecord config;
01417     
01418     getconfigrecord (h, &config);
01419     
01420     return (config.handlesMouseTrack);
01421     } /*callhandlesmousetrack*/
01422 
01423 
01424 boolean calleditableinrunmode (hdlobject h) {
01425 
01426     tyioaconfigrecord config;
01427     
01428     getconfigrecord (h, &config); 
01429     
01430     return (config.editableInRunMode);
01431     } /*calleditableinrunmode*/
01432 
01433 
01434 boolean callfontaware (hdlobject h) {
01435     
01436     switch ((**h).objecttype) {
01437         
01438         case clonetype:
01439             return (true); /*allow centering using the Justify menu*/
01440     
01441         default: {
01442             tyioaconfigrecord config;
01443     
01444             getconfigrecord (h, &config);
01445     
01446             return (config.isFontAware);
01447             }
01448         } /*switch*/
01449     } /*callfontaware*/
01450 
01451 
01452 boolean callalwaysidle (hdlobject h) {
01453 
01454     tyioaconfigrecord config;
01455     
01456     getconfigrecord (h, &config);
01457     
01458     return (config.alwaysIdle);
01459     } /*callalwaysidle*/
01460     
01461 
01462 boolean callhasspecialcard (hdlobject h) {
01463 
01464     tyioaconfigrecord config;
01465     
01466     getconfigrecord (h, &config);
01467     
01468     return (config.hasSpecialCard);
01469     } /*callhasspecialcard*/
01470     
01471 
01472 boolean callcantdrawinbitmap (hdlobject h) {
01473 
01474     tyioaconfigrecord config;
01475     
01476     getconfigrecord (h, &config);
01477     
01478     return (config.cantDrawInBitmap);
01479     } /*callcantdrawinbitmap*/
01480     
01481 
01482         
01483 boolean initIOAcomponents (Handle *harray) {
01484     
01485     /*
01486     2/27/93 DW: return a handle to the component array so that Iowa Runtime
01487     can save this between calls to run a card.
01488     */
01489     
01490     ComponentDescription desc;
01491     Component comp, prevcomponent;
01492     ComponentInstance instance;
01493     tyioaconfigrecord config;
01494     long ct, i;
01495     
01496     clearbytes (&desc, sizeof (desc));
01497     
01498     desc.componentType = 'IOAb';
01499     
01500     ct = CountComponents (&desc);
01501     
01502     prevcomponent = nil; /*start with the first one*/
01503     
01504     for (i = 0; i < ct; i++) {
01505         
01506         comp = FindNextComponent (prevcomponent, &desc);
01507         
01508         instance = OpenComponent (comp);
01509         
01510         getconfigGlue (instance, &config);
01511         
01512         addcomponent (instance, config.objectTypeID);
01513         
01514         #ifndef iowaRuntime
01515             {
01516             Handle hsmallicon;
01517             
01518             geticonGlue (instance, &hsmallicon);
01519             
01520             addtoiconarray (hsmallicon, config.objectTypeID);
01521             }
01522         #endif
01523         
01524         prevcomponent = comp;
01525         } /*for*/
01526     
01527     #ifndef iowaRuntime
01528     
01529         converticonarray ();
01530     
01531     #endif
01532     
01533     *harray = (Handle) componentarray;
01534     
01535     return (true);
01536     } /*initIOAcomponents*/
01537     
01538 
01539 void restorecomponentarray (Handle harray) {
01540     
01541     componentarray = (hdlcomponentrecord) harray;
01542     } /*restorecomponentarray*/
01543     
01544 
01545 boolean closeIOAcomponents (void) {
01546     
01547     short ct, i;
01548     
01549     ct = countcomponents ();
01550     
01551     for (i = 0; i < ct; i++) 
01552         CloseComponent ((*componentarray) [i].component);
01553         
01554     disposehandle ((Handle) componentarray);
01555     
01556     componentarray = nil;
01557     
01558     return (true);
01559     } /*closeIOAcomponents*/
01560     
01561     

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