mod/maxgui.mod/fltkmaxgui.mod/src/Fl_Text_Display.cxx
int Fl_Text_Display::count_lines(int startPos, int endPos,
                                 bool startPosIsLineStart) const {
  IS_UTF8_ALIGNED2(buffer(), startPos)
  IS_UTF8_ALIGNED2(buffer(), endPos)
  
  int retLines, retPos, retLineStart, retLineEnd;
  
#ifdef DEBUG
  printf("Fl_Text_Display::count_lines(startPos=%d, endPos=%d, startPosIsLineStart=%d\n",
         startPos, endPos, startPosIsLineStart);
#endif // DEBUG
  
  /* If we're not wrapping use simple (and more efficient) BufCountLines */
  if (!mContinuousWrap)
    return buffer()->count_lines(startPos, endPos);
  
  wrapped_line_counter(buffer(), startPos, endPos, INT_MAX,
                       startPosIsLineStart, 0, &retPos, &retLines, &retLineStart,
                       &retLineEnd);
  
#ifdef DEBUG
  printf("   # after WLC: retPos=%d, retLines=%d, retLineStart=%d, retLineEnd=%d\n",
         retPos, retLines, retLineStart, retLineEnd);
#endif // DEBUG
  
  return retLines;
}
/**
 \brief Count the number of lines between two positions.
 
 Same as BufCountLines, but takes in to account wrapping if wrapping is
 turned on.  If the caller knows that startPos is at a line start, it
 can pass "startPosIsLineStart" as True to make the call more efficient
 by avoiding the additional step of scanning back to the last newline.
 
 \param startPos index to forst character
 \param endPos index after last character
 \param startPosIsLineStart avoid scanning back to the line start
 \retun number of lines
 */
\brief Count the number of lines between two positions.
Same as BufCountLines, but takes in to account wrapping if wrapping is
turned on.  If the caller knows that startPos is at a line start, it
can pass "startPosIsLineStart" as True to make the call more efficient
by avoiding the additional step of scanning back to the last newline.

\param startPos index to forst character
\param endPos index after last character
\param startPosIsLineStart avoid scanning back to the line start
\retun number of lines
\ brief Count the number of lines between two positions . Same as BufCountLines but takes in to account wrapping if wrapping is turned on . If the caller knows that startPos is at a line start it can pass " startPosIsLineStart " as True to make the call more efficient by avoiding the additional step of scanning back to the last newline . \ param startPos index to forst character \ param endPos index after last character \ param startPosIsLineStart avoid scanning back to the line start \ retun number of lines
int Fl_Text_Display::count_lines(int startPos, int endPos,
                                 bool startPosIsLineStart) const {
  IS_UTF8_ALIGNED2(buffer(), startPos)
  IS_UTF8_ALIGNED2(buffer(), endPos)
  int retLines, retPos, retLineStart, retLineEnd;
#ifdef DEBUG
  printf("Fl_Text_Display::count_lines(startPos=%d, endPos=%d, startPosIsLineStart=%d\n",
         startPos, endPos, startPosIsLineStart);
#endif 
  if (!mContinuousWrap)
    return buffer()->count_lines(startPos, endPos);
  wrapped_line_counter(buffer(), startPos, endPos, INT_MAX,
                       startPosIsLineStart, 0, &retPos, &retLines, &retLineStart,
                       &retLineEnd);
#ifdef DEBUG
  printf("   # after WLC: retPos=%d, retLines=%d, retLineStart=%d, retLineEnd=%d\n",
         retPos, retLines, retLineStart, retLineEnd);
#endif 
  return retLines;
}
int Fl_Text_Display :: count_lines ( int startPos , int endPos , bool startPosIsLineStart ) const { IS_UTF8_ALIGNED2 ( buffer ( ) , startPos ) IS_UTF8_ALIGNED2 ( buffer ( ) , endPos ) int retLines , retPos , retLineStart , retLineEnd ; #ifdef DEBUG printf ( " \n " , startPos , endPos , startPosIsLineStart ) ; #endif if ( ! mContinuousWrap ) return buffer ( ) -> count_lines ( startPos , endPos ) ; wrapped_line_counter ( buffer ( ) , startPos , endPos , INT_MAX , startPosIsLineStart , 0 , & retPos , & retLines , & retLineStart , & retLineEnd ) ; #ifdef DEBUG printf ( " \n " , retPos , retLines , retLineStart , retLineEnd ) ; #endif return retLines ; }
\brief Count the number of lines between two positions.
\ brief Count the number of lines between two positions .
// DEBUG /* If we're not wrapping use simple (and more efficient) BufCountLines */ // DEBUG