DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦213e29c25⟧ TextFile

    Length: 2228 (0x8b4)
    Types: TextFile
    Notes: R1k Text-file segment

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« 
        └─⟦96d0f8112⟧ 
            └─⟦this⟧ 

TextFile

#include <stdio.h>
#include <Xm/Xm.h>

Widget Z80Widget;

void OpenWindow(int frame,char *field)
{
Widget TopLevel;

    if (!strcmp(field,"Z80"))
    {
      TopLevel = FmInitialize ("Z80", "Z80", NULL, 0, NULL, 0);
      Z80Widget = FmCreateZ80 ("Z80", TopLevel, NULL, 0);
      SetFrameWidget(frame,Z80Widget);
      BreakInit(Z80Widget);  
      return;
    }
    if (!strcmp(field,"MEM"))
    {
      TopLevel = FmCreateMEM ("MEM", Z80Widget, NULL, 0);
      SetFrameWidget(frame,TopLevel);
      return;
    }
    if (!strcmp(field,"ACIA"))
    {
      TopLevel = FmCreateACIA ("ACIA", Z80Widget, NULL, 0);
      SetFrameWidget(frame,TopLevel);
      return;
    }
    if (!strcmp(field,"PPI"))
    {
      TopLevel = FmCreatePPI ("PPI", Z80Widget, NULL, 0);
      SetFrameWidget(frame,TopLevel);
      return;
    }
    if (!strcmp(field,"PTM"))
    {
      TopLevel = FmCreatePTM ("PTM", Z80Widget, NULL, 0);
      SetFrameWidget(frame,TopLevel);
      return;
    }
    printf("*** Unknown Window %s to opened (Action.c)\n",field);
    return;
}

void CloseWindow(int frame)
{
    FmHideWidget(GetFrameWidget(frame));
    FreeFrame(frame); 
}

void PutField(frame,field,value)
{
 Widget field_w;

 field_w=XtNameToWidget(GetFrameWidget(frame),field);
#ifdef DEBUG0
 printf(" -> PUT_FIELD: frame:%d Window widget:%d Field widget:%d\n",
	frame,GetFrameWidget(frame),field_w);
#endif
 
 if (field_w == 0)
   printf("*** Widget of field %s not found (Action.c)\n",field);
 else
 {
   DisableChanged(GetFrameWidget(frame));
   XmTextSetString(field_w,value);
   EnableChanged(GetFrameWidget(frame));
 }
}

void Action(int frame, char *fctn, char *field, char *value)
{
#ifdef DEBUG0
  printf("ACTION: lf:%d,%s  fctn:%s  field:%s  value:\"%s\" \n",
	frame,GetFrameName(frame),fctn,field,value);
#endif

  if (!strcmp(fctn,"OpenWindow"))
    OpenWindow(frame,field);
  else
    if (!strcmp(fctn,"CloseWindow"))
      CloseWindow(frame);
   else 
     if (!strcmp(fctn,"PutField"))
       PutField(frame,field,value);
     else
     {
       printf("*** Unknown action to execute (Action.c)\n");
       printf("    lf:%d,%s  fctn:%s  field:%s value:\"%s\" \n",
    	       frame, GetFrameName(frame),fctn,field,value);
     }
}