Exemple #1
0
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 );
    }
}
Exemple #2
0
static bool td_initconsole( void )
/********************************/
{
    if( !ostream_init( UIConHandle ) )
        return( false );

    // Initialize the term as documented in "Terminal Control Under QNX"
    TI_EXEC_PROG( init_prog );

    TI_INIT1_STRING();
    TI_INIT2_STRING();
    TI_CLEAR_MARGINS();
    TI_PUT_FILE( init_file );
    TI_INIT3_STRING();

    // Now we're initialized, so set term to usable mode:
    TI_CA_ENABLE();
    TI_ENABLE_ACS();

    // disable auto-right-margin
    TI_NOWRAP();
    // if we can't then we just won't use the bottom right corner
    TI_ignore_bottom_right = !TCAP_NOSCROLL;
    QNXDebugPrintf1( "IgnoreLowerRight=%d", TI_ignore_bottom_right );

    TI_NOBOLD();
    TI_NOBLINK();

    __flush();

    return( true );
}
Exemple #3
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 ) );
        }
    }
}
Exemple #4
0
static int tm_check( unsigned short *status, unsigned short *row, unsigned short *col, unsigned long *time )
/**********************************************************************************************************/
{
    if( !MouseInstalled ) {
         uisetmouse( *row, *col );
         return( 0 );
    }
    QNXDebugPrintf1("mouse_string = '%s'", buf);
    if( new_sample ) {
        switch( MouseType ) {
        case M_QW:
        case M_AW:
            QW_parse();
            break;
        case M_XT:
            XT_parse();
            break;
        }
        new_sample = 0;
    }
    *row = last_row;
    *col = last_col;
    *status = last_status;
    *time = GET_MSECS;
    uisetmouse( *row, *col );
    return( 0 );
}