コード例 #1
0
static void TI_SETCOLOUR( int f, int b )
{
    // an array of colour brightnesses
    static char colorpri[] = { 0, 1, 4, 2, 6, 5, 3, 7 };

    if( TCAP_MONOCHROME ) {
        // simulate colour using reverse (this assumes background is
        // darker than foreground).
        if( colorpri[f % 8] < colorpri[b % 8] ) {
            QNXDebugPrintf0( "[<enter_reverse_mode-vvvvvvvvvvvv>]" );
            QNXDebugPrintf1( "\n%s\n", enter_reverse_mode );
            QNXDebugPrintf0( "[<enter_reverse_mode-^^^^^^^^^^^^>]" );
            TIARev = 1;
            TI_FillColourSet = false;
        } else {
            TIARev = 0;
            TI_FillColourSet = true;
        }
        TI_SETATTR();
    } else {
        TI_SETATTR();
        TI_FillColourSet = ( b == 0 ) || back_color_erase;
        // If we can set a colour pair then do so
        if( set_color_pair[0] != '\0' ) {
            putp( tparm( set_color_pair, f * 10 + b ) );
        } else {
            // else try to set colors individually
            putp( tparm( set_background, b ) );
            putp( tparm( set_foreground, f ) );
        }
    }
}
コード例 #2
0
ファイル: tdisp.c プロジェクト: Ukusbobra/open-watcom-v2
static void TI_SETATTR( void )
{
    // we have to reset attributes as some terminals can't turn off
    // attributes with "set_attribues"
    putp( exit_attribute_mode );

    if( set_attributes[0]!='\0' ){
        char    *x;

        putp( x=tparm( set_attributes,
                0,              // standout
                TIAULine,       // underline
                TIARev,         // reverse
                TIABlink,       // blink
                0,              // half intensity
                TIABold,        // bold
                0,              // invisible
                0,              // protected
                TIAACS ) );     // alt. char set
QNXDebugPrintf0("\n[******]");
QNXDebugPrintf1("%s", set_attributes);
QNXDebugPrintf1("%s",x);
QNXDebugPrintf0("[~~~~~~]\n");
    } else {
        // Believe it or not, some terminals don't have the set_attributes
        // code in the database, so we have to simulate it occasionally
        if( TIAULine )  putp( enter_underline_mode );
        if( TIARev )    putp( enter_reverse_mode );
        if( TIABlink )  putp( enter_blink_mode );
        if( TIABold )   putp( enter_bold_mode );
        if( TIAACS )    putp( enter_alt_charset_mode );
    }
}
コード例 #3
0
static int td_update( SAREA *area )
{
    if( !area ) {
QNXDebugPrintf0("td_update: no arg");
        dirty_area.row0 = 0;
        dirty_area.col0 = 0;
        dirty_area.row1 = UIData->height;
        dirty_area.col1 = UIData->width;
        return( 0 );
    }
QNXDebugPrintf4("td_update(%d,%d,%d,%d)", area->row, area->col, area->height,
                                        area->width);
    if( area->row < dirty_area.row0 ) {
        dirty_area.row0 = area->row;
    }
    if( area->col < dirty_area.col0 ) {
        dirty_area.col0 = area->col;
    }
    if( area->row + area->height > dirty_area.row1 ) {
        dirty_area.row1 = area->row + area->height;
    }
    if( area->col + area->width > dirty_area.col1 ) {
        dirty_area.col1 = area->col + area->width;
    }
    return( 0 );
}