DrawStringFunc=(DrawStringFunc==XDrawString)?DrawReverseString:DrawReverseString16; 
DrawStringFunc=(DrawStringFunc==XDrawString)?(int(*)())DrawReverseString:(int(*)())DrawReverseString16; 
static int RedrawText(Drawable drawable, int x,int y,int width,int height){  int i,yfrom,yto,xfrom,xto;  int drawflag;  xfrom=x/CSIZEX;  xfrom=max(xfrom,0);  xto=(x+width-1)/CSIZEX;  xto=(xto<COLS-1)?xto:COLS-1;  yfrom=y/CSIZEY;  yfrom=max(yfrom,0);  yto=(y+height-1)/CSIZEY;  yto=(yto<LINES-1)?yto:LINES-1;  drawflag=0;  for(i=yfrom;i<=yto;i++){    if(mywin.scrnbuf[i]!=NULL){      long prevattr,curattr;      char line[COLS+1];      int pos,s_x,e_x;      int j,jfrom,jto;      jfrom=xfrom;      jto=xto;      /* Check multibyte boudary */      if(jfrom > 0 && (mywin.scrnbuf[i][jfrom-1].attr&CATTR_LPART))	  jfrom--;      if(jto < COLS-1 && (mywin.scrnbuf[i][jto].attr&CATTR_LPART))	  jto++;      pos=0;      prevattr=CATTR_INVAL;      s_x=e_x=jfrom*CSIZEX;      for(j=jfrom;j<=jto+1;j++){	if(j==jto+1 || mywin.scrnbuf[i][j].c==0) {	  curattr=CATTR_INVAL;	}	else	  curattr=mywin.scrnbuf[i][j].attr;	if((prevattr&~CATTR_LPART)!=(curattr&~CATTR_LPART)){	  XFontStruct *f=NULL;	  int lbearing,ascent;	  int (*DrawStringFunc)();	  DrawStringFunc=XDrawString;	  line[pos]=0;	  if(prevattr<0){	    DrawStringFunc=NULL;	  }else if(prevattr&CATTR_16FONT){	    f=mywin.f16;	    DrawStringFunc=XDrawString16;	    pos/=2;	  }else	    f=mywin.f8;	  if(DrawStringFunc!=NULL){	    XSetFont(mywin.d,mywin.gc,f->fid);	    lbearing=f->min_bounds.lbearing;	    ascent=f->max_bounds.ascent;	    if(prevattr&CATTR_COLORED){	      int tcol;	      tcol=(prevattr&CATTR_TXTCOL_MASK)>>CATTR_TXTCOL_MASK_SHIFT;	      XSetForeground(mywin.d,mywin.gc,			     mywin.txtcolor[tcol].pixel);  	    }else if(prevattr&CATTR_BGCOLORED){  	      int tcol;  	      tcol=(prevattr&CATTR_TXTCOL_MASK)>>CATTR_TXTCOL_MASK_SHIFT;	      DrawStringFunc=(DrawStringFunc==XDrawString)?DrawReverseString:DrawReverseString16;	      XSetForeground(mywin.d,mywin.gc,			     mywin.txtcolor[tcol].pixel);	    }	    (*DrawStringFunc)(mywin.d,drawable,mywin.gc,			      s_x-lbearing,i*CSIZEY+ascent,line,pos);	    drawflag=1;	    if((prevattr&CATTR_COLORED)||(prevattr&CATTR_BGCOLORED))	      XSetForeground(mywin.d,mywin.gc,mywin.txtcolor[COLOR_DEFAULT].pixel);	  }	  prevattr=curattr;	  s_x=e_x;	  pos=0;	}	line[pos++]=mywin.scrnbuf[i][j].c;	e_x+=CSIZEX;      }    }  }  return drawflag;}
4357	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4357/64c3a98e5ef08ab323c2ea983ca497f2df9f9db2/x_wrdwindow.c/clean/interface/x_wrdwindow.c