Logo Search packages:      
Sourcecode: iterm version File versions  Download package

int VTScreenBuffer_set_selection ( VTScreenBuffer buf,
int  scol,
int  srow,
int  ecol,
int  erow,
int  selected 
)

Set specified range as (un)selected

Parameters:
*buf reference to Buffer object to destruct
scol start column
srow start row
ecol end column exclusive
erow end row exclusive
Returns:
0 if succeed, else 1

Definition at line 392 of file screen_buffer.c.

References _VTScreenBuf::num_cols, _VTScreenBuf::num_rows, and _VTScreenBuf::rows.

{
  int r;

  r = srow;

  if(scol < 0 || srow < 0 ||
     buf->num_rows <= erow || buf->num_cols <= ecol)
     return 1;
     
  
  if(srow == erow)
  {
    Row_set_selection(buf->rows[r],scol,ecol,selected);
  }
  else
  {
    Row_set_selection(buf->rows[r],scol,buf->num_cols,selected);
    for(r=r+1;r<erow;r++)
    {
      Row_set_selection(buf->rows[r],0,buf->num_cols,selected);
    }
    Row_set_selection(buf->rows[erow],0,ecol,selected);
  }
  return 0;
}


Generated by  Doxygen 1.6.0   Back to index