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

bool YView::drawNextLine (  ) 

go to next line

Definition at line 1087 of file view.cpp.

References adjust, areaModTab, YLine::attributes(), YViewCursor::bLineIncrement, YViewCursor::bufferX(), YViewCursor::bufferY(), YLine::data(), drawMode, YBuffer::highlight(), YZFoldPool::isHead(), YLine::length(), YZFoldPool::lineAfterFold(), YBuffer::lineCount(), YViewCursor::lineHeight, mBuffer, mLinesVis, opt_schema, rCurrentLeft, rCurrentTop, YViewCursor::screenX(), YViewCursor::screenY(), sCurLine, sCurLineLength, sCurrentLeft, YViewCursor::setBufferX(), YViewCursor::setBufferY(), YViewCursor::setScreenX(), YViewCursor::setScreenY(), YViewCursor::sLineIncrement, YViewCursor::spaceFill, tablength, YBuffer::textline(), workCursor, YViewCursor::wrapNextLine, YViewCursor::wrapTab, and YBuffer::yzline().

Referenced by gotody(), and guiPaintEvent().

{
    if ( ! workCursor.wrapNextLine ) {
        workCursor.setBufferX( sCurrentLeft );
        workCursor.setBufferY( mFoldPool->lineAfterFold( workCursor.bufferY() + workCursor.bLineIncrement ) );
        workCursor.setScreenX( rCurrentLeft );
        if ( workCursor.sLineIncrement == 0 && workCursor.bLineIncrement > 0 ) {
            // this is need when drawNextCol is called before drawNextLine ( when scrolling )
            workCursor.sLineIncrement = 1;
        }
        workCursor.spaceFill = 0;
        workCursor.bLineIncrement = 1;
        workCursor.lineHeight = 1;
    } else {
        if ( workCursor.wrapTab ) workCursor.setBufferX( workCursor.bufferX() - 1 );
        workCursor.setScreenX( 0 );
        workCursor.spaceFill = ( workCursor.spaceFill + areaModTab ) % tablength;
        ++workCursor.lineHeight;
        if ( workCursor.sLineIncrement == 0 ) {
            workCursor.sLineIncrement = 1;
        }
    }
    workCursor.setScreenY( workCursor.screenY() + workCursor.sLineIncrement );
    workCursor.sLineIncrement = 1;

    if ( workCursor.bufferY() < mBuffer->lineCount() ) {
        YLine* yl = drawMode ? mBuffer->yzline( workCursor.bufferY(), false ) : NULL;
        if ( ! workCursor.wrapNextLine ) {
            sCurLine = drawMode ? yl->data() : mBuffer->textline( workCursor.bufferY() );
            updateCurLine( );
        }
        if ( rCurrentLeft > 0 && ! workCursor.wrapNextLine ) {
            workCursor.setBufferX( 0 );
            workCursor.setScreenX( 0 );
            adjust = true;
            gotodx( rCurrentLeft );
            adjust = false;
            if ( drawMode ) {
                if ( scrollCursor.bufferX() > 0 )
                    workCursor.spaceFill = ( tablength - scrollCursor.bufferX() % tablength ) % tablength;
                if ( workCursor.screenX() > rCurrentLeft ) {
                    workCursor.setBufferX( workCursor.bufferX() - 1 );
                    workCursor.setScreenX( rCurrentLeft );
                }
            }
        }
        if ( drawMode && ( workCursor.screenY() - rCurrentTop ) < mLinesVis ) {
            m_lineFiller = ' ';
            m_lineMarker = ' ';
            if ( mFoldPool->isHead( workCursor.bufferY() ) ) {
                m_lineFiller = '-';
                m_lineMarker = '+';
            }
            rHLa = NULL;
            if ( yl->length() != 0 )
                rHLa = yl->attributes();
            rHLnoAttribs = !rHLa;
            rHLa = rHLa + workCursor.bufferX() - 1;
            rHLAttributes = 0L;
            YzisHighlighting * highlight = mBuffer->highlight();
            if ( highlight )
                rHLAttributes = highlight->attributes( opt_schema )->data( );
            rHLAttributesLen = rHLAttributes ? highlight->attributes( opt_schema )->size() : 0;
            return true;
        }
    } else {
        sCurLine = "";
        sCurLineLength = sCurLine.length();
    }
    workCursor.wrapNextLine = false;
    return false;
}


Generated by  Doxygen 1.6.0   Back to index