Esempio n. 1
0
box_t* box_join(ap_manager_t* man, bool destructive, box_t* a1, box_t* a2)
{
  size_t i;
  size_t nbdims;
  box_t* res;

  man->result.flag_best = true;
  man->result.flag_exact = false;
  res = destructive ? a1 : box_alloc(a1->intdim,a1->realdim);
  if (a1->p==NULL){
    if (a2->p!=NULL){
      man->result.flag_exact = true;
      box_set(res,a2);
    }
    return res;
  }
  else if (a2->p==NULL){
    man->result.flag_exact = true;
    if (!destructive) box_set(res,a1);
    return res;
  }
  man->result.flag_exact = false;
  if (!destructive){
    box_init(res);
  }
  nbdims = a1->intdim + a2->realdim;
  for (i=0; i<nbdims; i++){
    itv_join(res->p[i],a1->p[i],a2->p[i]);
  }
  return res;
}
Esempio n. 2
0
void window_decorate(WINDOW *window,gchar *title,gboolean border)
{
	gint			x,y;
	static gchar	*term=NULL;
	
	getmaxyx(window,y,x);
	
	if(term==NULL) term=getenv("TERM");	
	
	if(border==TRUE)
#ifdef _VIPER_WIDE		
		box_set(window,WACS_VLINE,WACS_HLINE);
#else
		box(window,ACS_VLINE,ACS_HLINE);
#endif
	
	if(title!=NULL)
	{
		x=x/2;
		x=x-(strlen(title)/2);
		mvwprintw(window,0,x,title);
	}
	
	touchwin(window);
}