Exemple #1
0
/*
 *   NAME:    GuiWorkAreaReorderChildren
 *   FUNCTION: 
 *   RETURNS:  
 */
void
GuiWorkAreaReorderChildren(
   Widget parent_subnode, 
   WidgetList subnode_list, 
   int n_subnodes, 
   Widget position)
{
   WorkAreaConstraints workArea_const;

   if (GuiIsWorkArea(parent_subnode))
      parent_subnode = ((WorkAreaWidget)parent_subnode)->workArea.workArea_root;
   if (GuiIsWorkArea(XtParent(parent_subnode)))
    {
      workArea_const = WORKAREA_CONSTRAINT(parent_subnode);
      XtFree((char *)workArea_const->workArea.sub_nodes);
      workArea_const->workArea.sub_nodes =
         (WidgetList) XtMalloc(sizeof(Widget) * n_subnodes);
      memcpy(workArea_const->workArea.sub_nodes, subnode_list,
         sizeof(Widget) * n_subnodes);
      workArea_const->workArea.n_sub_nodes = n_subnodes;
      NewLayout((WorkAreaWidget)XtParent(parent_subnode));
      Redisplay((WorkAreaWidget)XtParent(parent_subnode), NULL, NULL);
    }
   else
    {
      XmeWarning(parent_subnode,
         "Cannot ReorderChildren of parent widget of non-subclass of WorkArea");
    }
}
Exemple #2
0
/*
 *   NAME:    GuiWorkAreaEnableRedisplay
 *   FUNCTION: 
 *   RETURNS:  
 */
void
GuiWorkAreaEnableRedisplay(
   Widget w)
{
   WorkAreaWidget workArea = (WorkAreaWidget) w;

   if (GuiIsWorkArea(w))
    {
      workArea->workArea.delay_layout = FALSE;
      NewLayout(workArea);
      Redisplay(workArea, NULL, NULL);
    }
   else
      XmeWarning(w, "Cannot set EnableRedisplay of non-subclass of WorkArea");
}
Exemple #3
0
/* * * * * * * * * 
 *
 * This routine attaches the cell denoted by 'map' into the 
 * library structure.
 * in all cases, the pointers in the map structure
 * will be set the the corresponding lbrary, function, circuit and layout.
 * If the cell (or its library, function, etc.) does not exists it will be created.
 */
void attach_map_to_lib(MAPTABLEPTR  map )

{
LIBRARYPTR
   lib;
register FUNCTIONPTR
   func;
register CIRCUITPTR
   cir;
register LAYOUTPTR
   lay;
/* long
   time(); */

if(Seadif_open == FALSE)
   {
   attach_fish_map_to_lib(map);
   return;
   }

   

/*
 * look for the library
 */
if(existslib(map->library) == FALSE || sdfreadlib(SDFLIBSTAT, map->library) == FALSE)
   { /* does not exist: make it and write.... */ 
   NewLibrary(lib);
   lib->name = canonicstring(map->library);
   lib->technology = Technologystring;
      
   NewStatus(lib->status);
   lib->status->timestamp = time(0);
   lib->status->program = canonicstring(DEFAULT_PROGRAM);
   lib->status->author = Authorstring;
   map->librarystruct = lib;
   
   if(No_sdf_write == FALSE && sdfwritelib(SDFLIBSTAT, lib) == FALSE)
      error(WARNING,"cannot write lib into seadif");
   }
else
   map->librarystruct = thislib;

/*
 * look for this function
 */
if(existsfun(map->function, map->library) == FALSE || 
   sdfreadfun(SDFFUNSTAT, map->function, map->library) == FALSE)
   { /* not found */
   NewFunction(func);
   func->name = canonicstring(map->function);
   func->type = canonicstring(DEFAULT_TYPE);
   /* no circuits yet */
   NewStatus(func->status);
   func->status->timestamp = time(0);
   func->status->program = canonicstring(DEFAULT_PROGRAM);
   func->status->author = Authorstring;

   func->next = map->librarystruct->function;
   map->librarystruct->function = func;
   
   func->library = map->librarystruct;
   map->functionstruct = func;
   
   if(No_sdf_write == FALSE  && sdfwritefun(SDFFUNSTAT, func) == FALSE)
      error(WARNING,"cannot write func into seadif");
   }
else
   map->functionstruct = thisfun;

/*
 * look for this circuit
 */
if(existscir(map->circuit, map->function, map->library) == FALSE || 
   sdfreadcir(SDFCIRSTAT, map->circuit, map->function, map->library) == FALSE)
   { /* empty */
   NewCircuit(cir);
   cir->name = canonicstring(map->circuit);
   /* no lists yet */
   NewStatus(cir->status);
   cir->status->timestamp = time(0);
   cir->status->program = canonicstring(DEFAULT_PROGRAM);
   cir->status->author = Authorstring;
   
   cir->next = map->functionstruct->circuit;
   map->functionstruct->circuit = cir;

   cir->function = map->functionstruct;
   map->circuitstruct = cir;

   if(No_sdf_write == FALSE && sdfwritecir(SDFCIRSTAT, cir) == FALSE)
      error(WARNING,"cannot write cir into seadif");
   }
else
   map->circuitstruct = thiscir;

/*
 * ready if circuit
 */
if(map->view == circuit_str)
   {
   if (map->circuitstruct->status == NIL) NewStatus(map->circuitstruct->status);
   map->circuitstruct->status->author = Authorstring;
   map->circuitstruct->status->program = canonicstring(DEFAULT_PROGRAM);
   return;
   }

 
/*
 * look for layout
 */
if(existslay(map->layout, map->circuit, map->function, map->library) == FALSE ||
   sdfreadlay(SDFLAYSTAT, map->layout, map->circuit, map->function, map->library) == FALSE)
   { 
   NewLayout(lay);
   lay->name = canonicstring(map->layout);
   NewStatus(lay->status);
   lay->status->timestamp = time(0);
   lay->status->program = canonicstring(DEFAULT_PROGRAM);
   lay->status->author = Authorstring;

   lay->next = map->circuitstruct->layout;
   map->circuitstruct->layout = lay; 

   lay->circuit = map->circuitstruct;
   map->layoutstruct = lay;

   if(No_sdf_write == FALSE && sdfwritelay(SDFLAYSTAT, lay) == FALSE)
      error(WARNING,"cannot write lay into seadif");

   }
else
   map->layoutstruct = thislay;

map->layoutstruct->status->author = Authorstring;
map->layoutstruct->status->program = canonicstring(DEFAULT_PROGRAM);
}
Exemple #4
0
/* * * * * * * * * 
 *
 * This routine attaches the cell denoted by 'map' into the 
 * LOCAL library structure (in case fish is not open).
 * in all cases, the pointers in the map structure
 * will be set the the corresponding lbrary, function, circuit and layout.
 * If the cell (or its library, function, etc.) does not exists it will be created.
 */
static void attach_fish_map_to_lib(MAPTABLEPTR  map )

{
LIBRARYPTR
   lib;
register FUNCTIONPTR
   func;
register CIRCUITPTR
   cir;
register LAYOUTPTR
   lay;
/* long
   time(); */
 
/*
 * look for SEADIF struct
 */
if(seadif == NULL)
   { /* make it */
   NewSeadif(seadif);
   NewStatus(seadif->status);
   seadif->status->timestamp = time(0);
   seadif->status->program = canonicstring(DEFAULT_PROGRAM);
   seadif->status->author = canonicstring(DEFAULT_AUTHOR);
   }

/*
 * look for the library
 */
for(lib = seadif->library; lib != NULL && 
                   lib->name != map->library; lib = lib->next)
   /* nothing */;
if(lib == NULL)     
   { /* not found */
   NewLibrary(lib);
   lib->name = canonicstring(map->library);
   lib->technology = Technologystring;
   /* no functions */
   NewStatus(lib->status);
   lib->status->timestamp = time(0);
   lib->status->program = canonicstring(DEFAULT_PROGRAM);
   lib->status->author = canonicstring(DEFAULT_AUTHOR);
   /* link */
   lib->next = seadif->library;
   seadif->library = lib;
   }

map->librarystruct = lib;

/*
 * look for this function
 */
for(func = lib->function; func != NULL && 
                          func->name != map->function; func = func->next)
   /* nothing */;
if(func == NULL)
   { /* not found */
   NewFunction(func);
   func->name = canonicstring(map->function);
   func->type = canonicstring(DEFAULT_TYPE);
   /* no circuits yet */
   NewStatus(func->status);
   func->status->timestamp = time(0);
   func->status->program = canonicstring(DEFAULT_PROGRAM);
   func->status->author = canonicstring(DEFAULT_AUTHOR);
   func->library = lib;
   func->next = lib->function;
   lib->function = func;
   }

map->functionstruct = func;

/*
 * look for this circuit
 */
for(cir = func->circuit; cir != NULL &&
                         cir->name != map->circuit; cir = cir->next)
   /* nothing */;
if(cir == NULL)
   { /* empty */
   NewCircuit(cir);
   cir->name = canonicstring(map->circuit);
   /* no lists yet */
   NewStatus(cir->status);
   cir->status->timestamp = time(0);
   cir->status->program = canonicstring(DEFAULT_PROGRAM);
   cir->status->author = canonicstring(not_in_core_str); /* not in core! */
   cir->function = func;
   cir->next = func->circuit;
   func->circuit = cir;
   }

map->circuitstruct = cir;

/*
 * ready if circuit
 */
if(map->view == circuit_str)
   return;
 
/*
 * look for layout
 */
for(lay = cir->layout; lay != NULL && 
                       lay->name != map->layout; lay = lay->next)
   /* nothing */;
if(lay == NULL)
   {
   NewLayout(lay);
   lay->name = canonicstring(map->layout);
   NewStatus(lay->status);
   lay->status->timestamp = time(0);
   lay->status->program = canonicstring(DEFAULT_PROGRAM);
   lay->status->author = canonicstring(not_in_core_str); /* not in core! */
   lay->circuit = cir;
   lay->next = cir->layout;
   cir->layout = lay;
   }

map->layoutstruct = lay;
}