Пример #1
0
static int tm_init( int install )
/*******************************/
{
    const char      *term;

    MouseInstalled = false;
    MouseType = M_NONE;

    if( install == 0 )
        return( false );

    term = GetTermType();
    if( strcmp( term, "xterm" ) == 0 ) {
        DoMouseInit( M_XT, XT_INIT, ANSI_HDR "M" );
        return( true );
    }
    if( strstr( term, "qnx" ) != 0 ) {
        uiwritec( QNX_HDR QW_TEST );
        TrieAdd( EV_MOUSE_PRESS, QNX_HDR QW_TEST_RESPONSE );
        return( true );
    }
    uiwritec( ANSI_HDR QW_TEST );
    TrieAdd( EV_MOUSE_PRESS, ANSI_HDR QW_TEST_RESPONSE );
    return( true );
}
Пример #2
0
static int tm_init( int install )
/*******************************/
{
    char        *term;
    bool        kmous;                          // Does key_mouse exist?

    MouseInstalled      = FALSE;
    MouseType           = M_NONE;
    kmous               = ( key_mouse != NULL );

    if( install == 0 )
        return( FALSE );

    term = GetTermType();
    if( term != NULL && strstr( term, "xterm" ) != NULL ) {
        if( kmous ) {
            TryOne( M_XT, NULL, XT_INIT, key_mouse );
        } else {
            TryOne( M_XT, NULL, XT_INIT, ANSI_HDR "M" );
        }
        return( TRUE );
    }

#ifdef __LINUX__
    return( gpm_tm_init() );
#else
    return( FALSE );
#endif
}
Пример #3
0
void tm_saveevent( void )
/***********************/
{
    int i;
    int c;

    if( new_sample ) {
        tm_error();
        return;
    }
    switch( MouseType ) {
    case M_NONE:
        /* eat the remainder of the version ID response. */
        for( ;; ) {
            c = nextc( 20 );
            if( c == -1 ) return;
            if( c == 't' ) break;
        }
        if( strstr( GetTermType(), "qnx" ) != 0 ) {
            DoMouseInit( M_QW, QNX_HDR QW_INIT, QNX_HDR "3" );
        } else {
            DoMouseInit( M_AW, ANSI_HDR QW_INIT, ANSI_HDR "3" );
        }
        return;
    case M_QW:
    case M_AW:
        for( i = 0; i < MAXBUF; ++i ) {
            c = nextc( 20 );
            if( c == -1 ) {
               tm_error();
               return;
            }
            buf[i] = c;
            if( buf[i] == 't' ) break;
            if( buf[i] == '\x1b' ) {
                tm_error();
                c = nextc( 20 );
                if( c == -1 ) {
                    tm_error();
                    return;
                }
                i = 0;
            }
        }
        break;
    case M_XT:
        for( i = 0; i < 3; ++i ) {
            c = nextc( 10 );
            if( c == -1 ) {
                tm_error();
                return;
            }
            buf[i] = c;
        }
        break;
    }
    if( i == MAXBUF ) tm_error();
    buf[i+1] = '\0';
    new_sample = 1;
}
Пример #4
0
static int tm_init( int install )
/*******************************/
{
    bool        kmous;                          // Does key_mouse exist?

    MouseInstalled  = false;
    MouseType       = M_NONE;
    kmous           = ( key_mouse != NULL );

    if( install == 0 )
        return( false );

    if( strstr( GetTermType(), "xterm" ) != NULL ) {
        if( kmous ) {
            TryOne( M_XT, NULL, XT_INIT, key_mouse );
        } else {
            TryOne( M_XT, NULL, XT_INIT, ANSI_HDR "M" );
        }
        return( true );
    }

#ifdef __LINUX__
    return( gpm_tm_init() );
#else
    return( false );
#endif
}
Пример #5
0
void TLwTermTypeBs::SaveTxt(FILE* fOut){
  fprintf(fOut, "===LwTermTypeBs-Begin================\n");
  for (int TermTypeN=0; TermTypeN<GetTermTypes(); TermTypeN++){
    fprintf(fOut, "N:%d ", TermTypeN);
    GetTermType(GetTermTypeId(TermTypeN))->SaveTxt(fOut);
  }
  fprintf(fOut, "===LwTermTypeBs-End==================\n");
}
Пример #6
0
bool TermCheck( void )
/********************/
{
    if( strstr( GetTermType(), "qnx" ) == 0 )
        return( false );
    UIDisableShiftChanges = true;
    TermIsQNXTerm = true;
    return( true );
}
Пример #7
0
void ScrnSpawnEnd( void )
{
    const char  *curr_term;

    if( InitConsole == -1 ) {
        curr_term = GetTermType();
        if( curr_term != NULL ) {
            setenv( "TERM", TxtBuff, 1 );
        }
    }
}
Пример #8
0
bool TInfCheck( void )
/********************/
{
    // Check to see if the term variable is set
    if( GetTermType()[0] != '\0' ) {
        UIDisableShiftChanges = true;
        TermIsQNXTerm = false;
        return( true );
    }
    return( false );
}
Пример #9
0
bool TInfCheck( void )
/********************/
{
    // Check to see if the term variable is set
    if( GetTermType()[0]!='\0' ){
        UIDisableShiftChanges= TRUE;
        TermIsQNXTerm= FALSE;
        return( TRUE );
    }
    return( FALSE );
}
Пример #10
0
bool TInfCheck( void )
/********************/
{
    extern unsigned     UIDisableShiftChanges;

    // Check to see if the term variable is set
    if( GetTermType()[0]!='\0' ){
        UIDisableShiftChanges= TRUE;
        return( TRUE );
    }
    return( FALSE );
}
Пример #11
0
bool TermCheck( void )
/********************/
{
    char        *term;

    term = GetTermType();
    if( strstr( term, "qnx" ) == 0 ) return( FALSE );
    UIDisableShiftChanges = TRUE;
    TermIsQNXTerm = TRUE;

    return( TRUE );
}
Пример #12
0
static void tix_error( const char *str )
/**************************************/
{
    const char  *term;

    term = GetTermType();
    uiwritec( "\nError in " );
    uiwrite( term );
    uiwritec( ": " );
    uiwrite( str );
    uiwritec( "\n" );
}
Пример #13
0
void ScrnSpawnStart( void )
{
    const char  *term;
    const char  *curr_term;

    if( InitConsole == -1 ) {
        curr_term = GetTermType();
        if( curr_term != NULL ) {
            term = getenv( "TERM" );
            if( term == NULL )
                term = "";
            strcpy( TxtBuff, term );
            setenv( "TERM", curr_term, 1 );
        }
    }
}
Пример #14
0
int intern initbios( void )
{
    PossibleDisplay             *curr;

    if( UIConFile == NULL ) {
        char *tty;

        tty = getenv( "TTY" );
        if( tty == NULL ) {
            tty = "/dev/tty";
        }
        UIConFile = fopen( tty, "w+" );
        if( UIConFile == NULL ) return( FALSE );
        UIConHandle = fileno( UIConFile );
        fcntl( UIConHandle, F_SETFD, 1 );
    }

    setupterm( GetTermType(), UIConHandle, (int *)0);
    /* will report an error message and exit if any
       problem with a terminfo */

    // Check to make sure terminal is suitable
    if( cursor_address == NULL || hard_copy ) {
        del_curterm( cur_term );
        return( FALSE );
    }

    curr = DisplayList;

    for( ;; ) {
        if( curr->check == NULL ) return( FALSE );
        if( curr->check() ) break;
        ++curr;
    }
    UIVirt = curr->virt;
    return( _uibiosinit() );
}
Пример #15
0
bool QnxWCheck( void )
{
    if( !ConsCheck() )
        return( false );
    return( strcmp( GetTermType(), "qnxw" ) == 0 );
}