model_server/style/src/style_hooks.cxx
//
// The following are "hook" functions attached to the ddsty_of_node and
// ddcats_of_node relations.
// Its job is to assign and deassign styles and categories when the relation
// is added and removed. 
//
The following are "hook" functions attached to the ddsty_of_node and
ddcats_of_node relations.
Its job is to assign and deassign styles and categories when the relation
is added and removed.
The following are " hook " functions attached to the ddsty_of_node and ddcats_of_node relations . Its job is to assign and deassign styles and categories when the relation is added and removed .
static void style_hook(int op, Relational *tg, Relational *sc, RelType *)
{
  Initialize(style_hook);
#ifdef DEBUG
  OSapi_printf("style hook: diagnostic mode\n");
  OSapi_printf("Source%s: %s\n", is_rmtNode(sc) ? "[rmt]" : "", sc->get_name());
  OSapi_printf("Target%s: %s\n", is_rmtNode(tg) ? "[rmt]" : "", tg->get_name());
  OSapi_printf("Operation: %s\n", op>0 ? "add" : "remove");
#endif
  char * nm = 0;
  appTreePtr nd = 0;
    if (is_ddElement(tg)){
      nm = tg->get_name();
      nd = checked_cast(appTree,sc);
    }
    if ( is_ddElement(sc) ){
      nm = sc->get_name();
      nd = checked_cast(appTree,tg);
    }
    if ( style_modify(nd, nm, 0, op) )
	msg("Warning: style could not be installed") << eom;
#ifdef DEBUG
      else OSapi_printf("Style hook o'key.\n");
#endif
}
static void style_hook ( int op , Relational * tg , Relational * sc , RelType * ) { Initialize ( style_hook ) ; #ifdef DEBUG OSapi_printf ( " \n " ) ; OSapi_printf ( " \n " , is_rmtNode ( sc ) ? " " : " " , sc -> get_name ( ) ) ; OSapi_printf ( " \n " , is_rmtNode ( tg ) ? " " : " " , tg -> get_name ( ) ) ; OSapi_printf ( " \n " , op > 0 ? " " : " " ) ; #endif char * nm = 0 ; appTreePtr nd = 0 ; if ( is_ddElement ( tg ) ) { nm = tg -> get_name ( ) ; nd = checked_cast ( appTree , sc ) ; } if ( is_ddElement ( sc ) ) { nm = sc -> get_name ( ) ; nd = checked_cast ( appTree , tg ) ; } if ( style_modify ( nd , nm , 0 , op ) ) msg ( " " ) << eom ; #ifdef DEBUG else OSapi_printf ( " \n " ) ; #endif }
The following are "hook" functions attached to the ddsty_of_node and
ddcats_of_node relations.
The following are " hook " functions attached to the ddsty_of_node and ddcats_of_node relations .