mod/maxgui.mod/fltkmaxgui.mod/src/Fl_Text_Display.cxx
int Fl_Text_Display::position_style( int lineStartPos, int lineLen, int lineIndex) const 
{
  IS_UTF8_ALIGNED2(buffer(), lineStartPos)

  Fl_Text_Buffer * buf = mBuffer;
  Fl_Text_Buffer *styleBuf = mStyleBuffer;
  int pos, style = 0;
  
  if ( lineStartPos == -1 || buf == NULL )
    return FILL_MASK;
  
  pos = lineStartPos + min( lineIndex, lineLen );
  
  if ( lineIndex >= lineLen )
    style = FILL_MASK;
  else if ( styleBuf != NULL ) {
    style = ( unsigned char ) styleBuf->byte_at( pos );
    if (style == mUnfinishedStyle && mUnfinishedHighlightCB) {
      /* encountered "unfinished" style, trigger parsing */
      (mUnfinishedHighlightCB)( pos, mHighlightCBArg);
      style = (unsigned char) styleBuf->byte_at( pos);
    }
  }
  if (buf->primary_selection()->includes(pos))
    style |= PRIMARY_MASK;
  if (buf->highlight_selection()->includes(pos))
    style |= HIGHLIGHT_MASK;
  if (buf->secondary_selection()->includes(pos))
    style |= SECONDARY_MASK;
  return style;
}
/**
 \brief Find the correct style for a character.,
 
 Determine the drawing method to use to draw a specific character from "buf".
 "lineStartPos" gives the character index where the line begins, "lineIndex",
 the number of characters past the beginning of the line, and "dispIndex",
 the number of displayed characters past the beginning of the line.  Passing
 lineStartPos of -1 returns the drawing style for "no text".

 Why not just: position_style(pos)?  Because style applies to blank areas
 of the window beyond the text boundaries, and because this routine must also
 decide whether a position is inside of a rectangular Fl_Text_Selection, and do
 so efficiently, without re-counting character positions from the start of the
 line.

 Note that style is a somewhat incorrect name, drawing method would
 be more appropriate.
 
 \param lineStartPos beginning of this line
 \param lineLen number of bytes in line
 \param lineIndex position of character within line
 \return style for the given character
 */
\brief Find the correct style for a character.,
Determine the drawing method to use to draw a specific character from "buf".



Note that style is a somewhat incorrect name, drawing method would
be more appropriate.

\param lineStartPos beginning of this line
\param lineLen number of bytes in line
\param lineIndex position of character within line
\return style for the given character
\ brief Find the correct style for a character . Determine the drawing method to use to draw a specific character from " buf " . Note that style is a somewhat incorrect name drawing method would be more appropriate . \ param lineStartPos beginning of this line \ param lineLen number of bytes in line \ param lineIndex position of character within line \ return style for the given character
int Fl_Text_Display::position_style( int lineStartPos, int lineLen, int lineIndex) const 
{
  IS_UTF8_ALIGNED2(buffer(), lineStartPos)
  Fl_Text_Buffer * buf = mBuffer;
  Fl_Text_Buffer *styleBuf = mStyleBuffer;
  int pos, style = 0;
  if ( lineStartPos == -1 || buf == NULL )
    return FILL_MASK;
  pos = lineStartPos + min( lineIndex, lineLen );
  if ( lineIndex >= lineLen )
    style = FILL_MASK;
  else if ( styleBuf != NULL ) {
    style = ( unsigned char ) styleBuf->byte_at( pos );
    if (style == mUnfinishedStyle && mUnfinishedHighlightCB) {
      (mUnfinishedHighlightCB)( pos, mHighlightCBArg);
      style = (unsigned char) styleBuf->byte_at( pos);
    }
  }
  if (buf->primary_selection()->includes(pos))
    style |= PRIMARY_MASK;
  if (buf->highlight_selection()->includes(pos))
    style |= HIGHLIGHT_MASK;
  if (buf->secondary_selection()->includes(pos))
    style |= SECONDARY_MASK;
  return style;
}
int Fl_Text_Display :: position_style ( int lineStartPos , int lineLen , int lineIndex ) const { IS_UTF8_ALIGNED2 ( buffer ( ) , lineStartPos ) Fl_Text_Buffer * buf = mBuffer ; Fl_Text_Buffer * styleBuf = mStyleBuffer ; int pos , style = 0 ; if ( lineStartPos == -1 || buf == NULL ) return FILL_MASK ; pos = lineStartPos + min ( lineIndex , lineLen ) ; if ( lineIndex >= lineLen ) style = FILL_MASK ; else if ( styleBuf != NULL ) { style = ( unsigned char ) styleBuf -> byte_at ( pos ) ; if ( style == mUnfinishedStyle && mUnfinishedHighlightCB ) { ( mUnfinishedHighlightCB ) ( pos , mHighlightCBArg ) ; style = ( unsigned char ) styleBuf -> byte_at ( pos ) ; } } if ( buf -> primary_selection ( ) -> includes ( pos ) ) style |= PRIMARY_MASK ; if ( buf -> highlight_selection ( ) -> includes ( pos ) ) style |= HIGHLIGHT_MASK ; if ( buf -> secondary_selection ( ) -> includes ( pos ) ) style |= SECONDARY_MASK ; return style ; }
\brief Find the correct style for a character.,
Determine the drawing method to use to draw a specific character from "buf".
\ brief Find the correct style for a character . Determine the drawing method to use to draw a specific character from " buf " .
/* encountered "unfinished" style, trigger parsing */