/* Generated with C2C (Cedar To C)*/
/* Copyright (C) 1993 by Xerox Corporation.  All rights reserved. */
/* time: June 30, 1993 11:20:38 pm PDT */
/* C2C version: April 20, 1993 (sun4) */
/* ref-counting: off */
/* file: GGValueEventImpl, module: GGValueEventImpl */ 
/* switches: bcfhklnouw */ 
#include <cedar/InstallationSupport.h>
#include <cedar/CedarExtra.h>
static char versionStamp[] = "@(#)mob←version [368803912,3168989644] GGValueEventImpl";
typedef unsigned word, *ptr;
typedef unsigned char byte, *bPt;
typedef unsigned short half, *hPt;
typedef word (*fPt)();
typedef struct {word f0, f1, f2;} W3;
typedef struct {word f0, f1, f2, f3, f4, f5, f6, f7;} W8;
typedef struct {W8 f; word r;} W9;
typedef struct {word f0, f1;} W2;
#define SOURCE(p, l) /* source p, l */
static void NoName←Q480();
static void GGValueEventImpl←P0();
static void GetSelectedSlices←P60();
static void GetAreaColor←P120();
static void GetLineColor←P180();
static void GetColorOfSelectedSlice←P240();
static word UniqueColorOrAbort←P420();
static word ReportSelectionProblems←P300();
static void RegisterEventProcs←P360();
static struct {unsigned f; char r[16];} string1 = {851984, "\257\300\331\034\215\202\300\037\060\307\112\100\164\000\000"};
static struct {unsigned f; char r[4];} string2 = {131074, "\003\004\000"};
static struct {unsigned f; char r[16];} string3 = {917520, "\216\257\300\363\223\326\161\300\017\164\046\072\104\350\000"};
static struct {unsigned f; char r[4];} string4 = {65537, "\001\000\000"};
static struct {unsigned f; char r[4];} string5 = {131076, "\216\251\000"};
static struct {unsigned f; char r[56];} string6 = {3407928, "%g failed: there is more than one value for this key\000\000\000"};
static struct {unsigned f; char r[12];} string7 = {589836, "Complaint\000\000"};
static struct {unsigned f; char r[16];} string8 = {786448, "GetLineColor\000\000\000"};
static struct {unsigned f; char r[36];} string9 = {2228260, "%g failed: no objects are targeted\000"};
static struct {unsigned f; char r[36];} string10 = {2228260, "%g failed: no objects are selected\000"};
static struct {unsigned f; char r[20];} string11 = {1114132, "GetSelectedSlices\000\000"};
static struct {unsigned f; char r[16];} string12 = {786448, "GetAreaColor\000\000\000"};
static struct {unsigned f; char r[16];} string13 = {851984, "\257\300\025\373\200\110\300\274\342\361\314\100\164\000\000"};
static struct {unsigned f; char r[8];} string14 = {393222, "\006\001(\004A\377\000"};
static struct {unsigned f; char r[16];} string15 = {851984, "\257\300\322\334\347\304\300\124\107\000\027\100\150\000\000"};
static struct {unsigned f; char r[16];} string16 = {851984, "\257\300\331\034\215\202\300\037\060\307\112\100\150\000\000"};
static struct {unsigned f; char r[16];} string17 = {851984, "\257\300\347\101\365\007\300\150\102\366\020\100\150\000\000"};
static struct {unsigned f; char r[16];} string18 = {851984, "\257\300\336\025\013\356\300\216\115\352\271\100\150\000\000"};
static struct {unsigned f; char r[16];} string19 = {851984, "\257\300\355\324\264\170\300\276\334\312\210\100\150\000\000"};
static struct {unsigned f; char r[16];} string20 = {851984, "\257\300\207\164\301\163\300\327\135\041\305\100\150\000\000"};
static struct {unsigned f; char r[16];} string21 = {851984, "\257\300\015\277\004\146\300\034\367\146\045\100\164\000\000"};
static struct {
   word f0[19]; word f19; word f20; word f21; 
   word f22; word f23; word f24; word f25; 
   word f26; word f27; word f28; word f29; 
   word f30; word f31; word f32[8]; 
   } globalframe = {
   {0}, (word) RegisterEventProcs←P360, 0, (word) ReportSelectionProblems←P300, 
   0, (word) GetColorOfSelectedSlice←P240, 0, (word) GetLineColor←P180, 
   0, (word) GetAreaColor←P120, 0, (word) GetSelectedSlices←P60, 
   0, (word) GGValueEventImpl←P0, {0}
   };

static void NoName←Q480()
   {
   register ptr gf←c071 =  (ptr) &globalframe;
   word var←c12772;
   (* (( (ptr) gf←c071)+4) ) = (word) XR←GetTypeIndex((word) &string1, 0, (word) &string2);
   (* (( (ptr) gf←c071)+6) ) = (word) XR←GetTypeIndex((word) &string3, 0, (word) &string4);
   (* (( (ptr) gf←c071)+9) ) = (word) XR←GetTypeIndex((word) &string5, 0, (word) &string4);
   (*  (ptr) (( (bPt) gf←c071)+40) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c071)+6) ), (word) &string6);
   (*  (ptr) (( (bPt) gf←c071)+44) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c071)+9) ), (word) &string7);
   (*  (ptr) (( (bPt) gf←c071)+48) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c071)+6) ), (word) &string8);
   (*  (ptr) (( (bPt) gf←c071)+52) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c071)+6) ), (word) &string9);
   (*  (ptr) (( (bPt) gf←c071)+56) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c071)+6) ), (word) &string10);
   (*  (ptr) (( (bPt) gf←c071)+60) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c071)+9) ), (word) &string11);
   (*  (ptr) (( (bPt) gf←c071)+64) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c071)+9) ), (word) &string12);
   (*  (ptr) (( (bPt) gf←c071)+68) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c071)+9) ), (word) &string8);
   (*  (ptr) (( (bPt) gf←c071)+72) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c071)+6) ), (word) &string12);
   (void) XR←DeclareGlobalFrame((word) "GGValueEventImpl", &globalframe, (word) XR←GetTypeIndex((word) &string13, 0, (word) &string14)
      , (word) (( (bPt) gf←c071)+124)/* var←c12164 */ );
   var←c12772 = (word) XR←ImportInterface((word) "Feedback", (word) XR←GetTypeIndexS((word) (&string15)), 25);
   (* (( (ptr) gf←c071)+38)/* var←c12644 */  ) = var←c12772;
   (void) XR←ImportProcS(var←c12772, 1575429);
   var←c12772 = (word) XR←ImportInterface((word) "FutureValues", (word) XR←GetTypeIndexS((word) (&string16)), 3);
   (* (( (ptr) gf←c071)+34)/* var←c12228 */  ) = var←c12772;
   (void) XR←ImportProcS(var←c12772, 262657);
   var←c12772 = (word) XR←ImportInterface((word) "GGScene", (word) XR←GetTypeIndexS((word) (&string17)), 50);
   (* (( (ptr) gf←c071)+33)/* var←c12196 */  ) = var←c12772;
   (void) XR←ImportProcS(var←c12772, 68426757);
   (void) XR←ImportProcS(var←c12772, 68165124);
   var←c12772 = (word) XR←ImportInterface((word) "GGSliceOps", (word) XR←GetTypeIndexS((word) (&string18)), 73);
   (* (( (ptr) gf←c071)+35)/* var←c12356 */  ) = var←c12772;
   (void) XR←ImportProcS(var←c12772, 134756354);
   (void) XR←ImportProcS(var←c12772, 134756866);
   var←c12772 = (word) XR←ImportInterface((word) "GGUserInput", (word) XR←GetTypeIndexS((word) (&string19)), 13);
   (* (( (ptr) gf←c071)+39)/* var←c12740 */  ) = var←c12772;
   (void) XR←ImportProcS(var←c12772, 1312261);
   var←c12772 = (word) XR←ImportInterface((word) "ImagerColorPrivate", (word) XR←GetTypeIndexS((word) (&string20)), 48);
   (* (( (ptr) gf←c071)+36)/* var←c12516 */  ) = var←c12772;
   (void) XR←ImportProcS(var←c12772, 67637250);
   var←c12772 = (word) XR←ImportInterface((word) "IO", (word) XR←GetTypeIndexS((word) (&string21)), 103);
   (* (( (ptr) gf←c071)+37)/* var←c12580 */  ) = var←c12772;
   (void) XR←ImportProcS(var←c12772, 67910402);
   }

static void GGValueEventImpl←P0(formal←c019, formal←c018)
   word formal←c019;
   word formal←c018;
   {
   /* GGValueEventImpl: */ 
SOURCE(139, 3014)
SOURCE(3133, 20)
   (void) RegisterEventProcs←P360();
   }

static void GetSelectedSlices←P60(ggData←v5548, event←v5576)
   word ggData←v5548;
   word event←v5576;
   {
   register ptr gf←c12804 =  (ptr) &globalframe;
   word fv←v3692;
   word slices←v3720;
   /* GetSelectedSlices: */ 
SOURCE(545, 220)
SOURCE(582, 42)
   fv←v3692 = XR←Narrow((*  (ptr) (* (( (ptr) event←v5576)+1) ) ), (* (( (ptr) gf←c12804)+4) ));
SOURCE(626, 8)
   {
      word pd22;
      pd22 = (* (( (ptr) (* (( (ptr) gf←c12804)+33)/* var←c12196 */  ))+34) );
      slices←v3720 = (word) ( *( (fPt) ((*  (ptr) pd22 ))))((* (( (ptr) ggData←v5548)+11) ), 0, 0, 0, pd22);
      };
SOURCE(717, 17)
   (* (( (ptr) fv←v3692)+4) ) = slices←v3720;
SOURCE(736, 29)
   {
      word pd23;
      pd23 = (* (( (ptr) (* (( (ptr) gf←c12804)+34)/* var←c12228 */  ))+6) );
      (void) ( *( (fPt) ((*  (ptr) pd23 ))))(fv←v3692, pd23);
      };
   }

static void GetAreaColor←P120(ggData←v5636, event←v5664)
   word ggData←v5636;
   word event←v5664;
   {
   register ptr gf←c12836 =  (ptr) &globalframe;
   word fv←v3848;
   word errorRope←v3876 = 0;
   word color←v3904 = 0;
   word success←v3932 = 1;
   /* GetAreaColor: */ 
SOURCE(771, 262)
SOURCE(803, 42)
   fv←v3848 = XR←Narrow((*  (ptr) (* (( (ptr) event←v5664)+1) ) ), (* (( (ptr) gf←c12836)+4) ));
SOURCE(901, 83)
   {
      W3 var←c12260;
      (void) GetColorOfSelectedSlice←P240((word) &var←c12260, 1, ggData←v5636, (* (( (ptr) gf←c12836)+18) ));
      errorRope←v3876 = var←c12260.f2;
      success←v3932 = var←c12260.f1;
      color←v3904 = var←c12260.f0;
      };
SOURCE(986, 16)
   (* (( (ptr) fv←v3848)+4) ) = color←v3904;
SOURCE(1004, 29)
   {
      word pd24;
      pd24 = (* (( (ptr) (* (( (ptr) gf←c12836)+34)/* var←c12228 */  ))+6) );
      (void) ( *( (fPt) ((*  (ptr) pd24 ))))(fv←v3848, pd24);
      };
   }

static void GetLineColor←P180(ggData←v5724, event←v5752)
   word ggData←v5724;
   word event←v5752;
   {
   register ptr gf←c12868 =  (ptr) &globalframe;
   word fv←v3976;
   word errorRope←v4004 = 0;
   word color←v4032 = 0;
   word success←v4060 = 1;
   /* GetLineColor: */ 
SOURCE(1039, 263)
SOURCE(1071, 42)
   fv←v3976 = XR←Narrow((*  (ptr) (* (( (ptr) event←v5752)+1) ) ), (* (( (ptr) gf←c12868)+4) ));
SOURCE(1169, 84)
   {
      W3 var←c12292;
      (void) GetColorOfSelectedSlice←P240((word) &var←c12292, 0, ggData←v5724, (* (( (ptr) gf←c12868)+12) ));
      errorRope←v4004 = var←c12292.f2;
      success←v4060 = var←c12292.f1;
      color←v4032 = var←c12292.f0;
      };
SOURCE(1255, 16)
   (* (( (ptr) fv←v3976)+4) ) = color←v4032;
SOURCE(1273, 29)
   {
      word pd25;
      pd25 = (* (( (ptr) (* (( (ptr) gf←c12868)+34)/* var←c12228 */  ))+6) );
      (void) ( *( (fPt) ((*  (ptr) pd25 ))))(fv←v3976, pd25);
      };
   }

static void GetColorOfSelectedSlice←P240(formal←c049, formal←c082, ggData←v3332, opName←v3360)
   word formal←c049;
   word formal←c082;
   word ggData←v3332;
   word opName←v3360;
   {
   W9 var←c12900;
   /* declaration of fill←v3304 skipped */ 
   register ptr gf←c12932 =  (ptr) &globalframe;
   /* declaration of color←v3404 skipped */ 
   word success←v3432;
   word error←v3460;
   /* declaration of var←c12324 skipped */ 
   word aborted←v4104 = 0;
   /* declaration of sliceD←v4132 skipped */ 
   (* (( (ptr) &var←c12900)+4)/* fill←v3304 */  ) = formal←c082;
   /* GetColorOfSelectedSlice: */ 
SOURCE(1308, 1000)
   {
      word tmpAddr26;
      tmpAddr26 = (word) (( (ptr) &var←c12900)+6)/* var←c12324 */ ;
      (*  (ptr) tmpAddr26 ) = ( ((word)  (fPt) UniqueColorOrAbort←P420) );
      (* (( (ptr) tmpAddr26) + 1) ) = 1;
      };
SOURCE(1308, 1000)
   (* (( (ptr) &var←c12900)+5)/* color←v3404 */  ) = 0;
SOURCE(1308, 1000)
   success←v3432 = 1;
SOURCE(1308, 1000)
   error←v3460 = 0;
SOURCE(1472, 23)
   (* (( (ptr) &var←c12900)+8)/* sliceD←v4132 */  ) = 0;
SOURCE(2106, 85)
   {
      word pd27;
      pd27 = (* (( (ptr) (* (( (ptr) gf←c12932)+33)/* var←c12196 */  ))+32) );
      aborted←v4104 = (word) ( *( (fPt) ((*  (ptr) pd27 ))))((* (( (ptr) ggData←v3332)+11) ), 0, (word) (( (bPt) &var←c12900)+24)
         /* var←c12324 */ , 0, 0, pd27);
      };
SOURCE(2193, 115)
   if ((0 != aborted←v4104) || ((* (( (ptr) &var←c12900)+8)/* sliceD←v4132 */  ) == 0)) {
SOURCE(2227, 64)
      error←v3460 = (word) ReportSelectionProblems←P300(aborted←v4104, (* (( (ptr) &var←c12900)+8)/* sliceD←v4132 */  ), opName←v3360, ggData←v3332)
      ;
SOURCE(2293, 15)
      success←v3432 = 0;
      };
   /* removed tail goto */ 
   (*  (ptr) formal←c049 ) = (* (( (ptr) &var←c12900)+5)/* color←v3404 */  );
   (* (( (ptr) formal←c049)+1) ) = success←v3432;
   (* (( (ptr) formal←c049)+2) ) = error←v3460;
   return;
   }

static word UniqueColorOrAbort←P420(thisD←v4236, formal←c12996)
   word thisD←v4236;
   word formal←c12996;
   {
   register ptr gf←c12964 =  (ptr) &globalframe;
   word done←v4280;
   word thisColor←v4308 = 0;
   word isUnique←v4336 = 1;
   formal←c12996 = (formal←c12996 - 24);
   /* UniqueColorOrAbort: */ 
SOURCE(1497, 603)
SOURCE(1497, 603)
   done←v4280 = 0;
SOURCE(1621, 479)
   if (((* (( (ptr) formal←c12996)+8) ) == 0)) {
SOURCE(1644, 14)
      (* (( (ptr) formal←c12996)+8) ) = thisD←v4236;
SOURCE(1660, 159)
      if ((0 != (* (( (ptr) formal←c12996)+4) ))) {
SOURCE(1673, 75)
         {
            W2 var←c12388;
            {
               word pd28;
               pd28 = (* (( (ptr) (* (( (ptr) gf←c12964)+35)/* var←c12356 */  ))+62) );
               (void) ( *( (fPt) ((*  (ptr) pd28 ))))((word) &var←c12388, (*  (ptr) thisD←v4236 ), (* (( (ptr) thisD←v4236)+1) ), pd28);
               };
            isUnique←v4336 = var←c12388.f1;
            (* (( (ptr) formal←c12996)+5) ) = var←c12388.f0;
            };
         }
      else {
SOURCE(1748, 71)
         {
            W2 var←c12420;
            {
               word pd29;
               pd29 = (* (( (ptr) (* (( (ptr) gf←c12964)+35)/* var←c12356 */  ))+60) );
               (void) ( *( (fPt) ((*  (ptr) pd29 ))))((word) &var←c12420, (*  (ptr) thisD←v4236 ), (* (( (ptr) thisD←v4236)+1) ), pd29);
               };
            isUnique←v4336 = var←c12420.f1;
            (* (( (ptr) formal←c12996)+5) ) = var←c12420.f0;
            };
         };
SOURCE(1821, 19)
      done←v4280 =  (unsigned) (0 == isUnique←v4336);
      }
   else {
SOURCE(1851, 159)
      if ((0 != (* (( (ptr) formal←c12996)+4) ))) {
SOURCE(1864, 75)
         {
            W2 var←c12452;
            {
               word pd30;
               pd30 = (* (( (ptr) (* (( (ptr) gf←c12964)+35)/* var←c12356 */  ))+62) );
               (void) ( *( (fPt) ((*  (ptr) pd30 ))))((word) &var←c12452, (*  (ptr) thisD←v4236 ), (* (( (ptr) thisD←v4236)+1) ), pd30);
               };
            isUnique←v4336 = var←c12452.f1;
            (* (( (ptr) formal←c12996)+5) ) = var←c12452.f0;
            };
         }
      else {
SOURCE(1939, 71)
         {
            W2 var←c12484;
            {
               word pd31;
               pd31 = (* (( (ptr) (* (( (ptr) gf←c12964)+35)/* var←c12356 */  ))+60) );
               (void) ( *( (fPt) ((*  (ptr) pd31 ))))((word) &var←c12484, (*  (ptr) thisD←v4236 ), (* (( (ptr) thisD←v4236)+1) ), pd31);
               };
            isUnique←v4336 = var←c12484.f1;
            (* (( (ptr) formal←c12996)+5) ) = var←c12484.f0;
            };
         };
SOURCE(2012, 88)
      {
         word pd33;
         if ((0 == isUnique←v4336)) { goto then032;};
         pd33 = (* (( (ptr) (* (( (ptr) gf←c12964)+36)/* var←c12516 */  ))+20) );
         if ((0 == (word) ( *( (fPt) ((*  (ptr) pd33 ))))(thisColor←v4308, (* (( (ptr) formal←c12996)+5) ), pd33))) {
            then032: ;
SOURCE(2088, 12)
            done←v4280 = 1;
            };
         };
      };
SOURCE(1497, 603)
   return(done←v4280);
   }

static word ReportSelectionProblems←P300(aborted←v3520, sliceD←v3548, opName←v3576, ggData←v3604)
   word aborted←v3520;
   word sliceD←v3548;
   word opName←v3576;
   word ggData←v3604;
   {
   register ptr gf←c13028 =  (ptr) &globalframe;
   word error←v3648;
   /* ReportSelectionProblems: */ 
SOURCE(2317, 571)
SOURCE(2317, 571)
   error←v3648 = 0;
SOURCE(2444, 444)
   if ((0 != aborted←v3520)) {
SOURCE(2462, 90)
      {
         W2 var←c12548;
         var←c12548.f0 = 11;
         var←c12548.f1 = opName←v3576;
         {
            word pd34;
            pd34 = (* (( (ptr) (* (( (ptr) gf←c13028)+37)/* var←c12580 */  ))+63) );
            error←v3648 = (word) ( *( (fPt) ((*  (ptr) pd34 ))))((* (( (ptr) gf←c13028)+10) ), var←c12548, pd34);
            };
         };
SOURCE(2554, 123)
      {
         W2 var←c12612;
         var←c12612.f0 = 11;
         var←c12612.f1 = opName←v3576;
         {
            word pd35;
            pd35 = (* (( (ptr) (* (( (ptr) gf←c13028)+38)/* var←c12644 */  ))+14) );
            (void) ( *( (fPt) ((*  (ptr) pd35 ))))((* (( (ptr) ggData←v3604)+3) ), 0, (* (( (ptr) gf←c13028)+11) ), (* (( (ptr) gf←c13028)+10)
                ), var←c12612, pd35);
            };
         };
      }
   else {
SOURCE(2686, 202)
      if ((sliceD←v3548 == 0)) {
SOURCE(2709, 72)
         {
            W2 var←c12676;
            var←c12676.f0 = 11;
            var←c12676.f1 = opName←v3576;
            {
               word pd36;
               pd36 = (* (( (ptr) (* (( (ptr) gf←c13028)+37)/* var←c12580 */  ))+63) );
               error←v3648 = (word) ( *( (fPt) ((*  (ptr) pd36 ))))((* (( (ptr) gf←c13028)+13) ), var←c12676, pd36);
               };
            };
SOURCE(2783, 105)
         {
            W2 var←c12708;
            var←c12708.f0 = 11;
            var←c12708.f1 = opName←v3576;
            {
               word pd37;
               pd37 = (* (( (ptr) (* (( (ptr) gf←c13028)+38)/* var←c12644 */  ))+14) );
               (void) ( *( (fPt) ((*  (ptr) pd37 ))))((* (( (ptr) ggData←v3604)+3) ), 0, (* (( (ptr) gf←c13028)+11) ), (* (( (ptr) gf←c13028)+14)
                   ), var←c12708, pd37);
               };
            };
         };
      };
SOURCE(2317, 571)
   return(error←v3648);
   }

static void RegisterEventProcs←P360()
   {
   register ptr gf←c13060 =  (ptr) &globalframe;
   /* RegisterEventProcs: */ 
SOURCE(2897, 230)
SOURCE(2945, 66)
   {
      word pd38;
      pd38 = (* (( (ptr) (* (( (ptr) gf←c13060)+39)/* var←c12740 */  ))+10) );
      (void) ( *( (fPt) ((*  (ptr) pd38 ))))((* (( (ptr) gf←c13060)+15) ), (word) (( (bPt) gf←c13060)+116)/* var←c12132 */ , 0, 0, 0, pd38)
      ;
      };
SOURCE(3013, 56)
   {
      word pd39;
      pd39 = (* (( (ptr) (* (( (ptr) gf←c13060)+39)/* var←c12740 */  ))+10) );
      (void) ( *( (fPt) ((*  (ptr) pd39 ))))((* (( (ptr) gf←c13060)+16) ), (word) (( (bPt) gf←c13060)+108)/* var←c12100 */ , 0, 0, 0, pd39)
      ;
      };
SOURCE(3071, 56)
   {
      word pd40;
      pd40 = (* (( (ptr) (* (( (ptr) gf←c13060)+39)/* var←c12740 */  ))+10) );
      (void) ( *( (fPt) ((*  (ptr) pd40 ))))((* (( (ptr) gf←c13060)+17) ), (word) (( (bPt) gf←c13060)+100)/* var←c12068 */ , 0, 0, 0, pd40)
      ;
      };
   }

/* file: GGValueEventImpl, module: GGValueEventImpl, compiled at: June 30, 1993 11:20:38 pm PDT */ 
extern void XR←install←GGValueEventImpl() {
   NoName←Q480();
   }
extern void XR←run←GGValueEventImpl() { XR←Start(&globalframe); }