示例#1
0
static EVENT cd_sizeevent( void )
/*******************************/
{
    SAREA       area;
    unsigned    state;
    unsigned    arm;

    if( !StatePending )
        return( EV_NO_EVENT );
    StatePending = 0;
    state = console_state( UIConCtrl, UIConsole, 0,
                (_CON_EVENT_ACTIVE|_CON_EVENT_INACTIVE|_CON_EVENT_SIZE) );
    arm = 0;
    if( state & _CON_EVENT_INACTIVE ) {
        clear_shift();
        arm = _CON_EVENT_ACTIVE;
    } else if( state & _CON_EVENT_ACTIVE ) {
        arm = _CON_EVENT_INACTIVE;
    }
    console_arm( UIConCtrl, UIConsole, 0, arm | _CON_EVENT_SIZE );
    if( !(state & _CON_EVENT_SIZE) )
        return( EV_NO_EVENT );
    if( !uiinlists( EV_BACKGROUND_RESIZE ) )
        return( EV_NO_EVENT );
    if( !setupscrnbuff() )
        return( EV_NO_EVENT );
    closebackground();
    openbackground();
    area.row = 0;
    area.col = 0;
    area.height = UIData->height;
    area.width = UIData->width;
    uidirty( area );
    return( EV_BACKGROUND_RESIZE );
}
示例#2
0
static int td_init( void )
/************************/
{
    int         rows, cols;
    const char  *tmp;

    if( UIData == NULL ) {
        UIData = &ui_data;
    }

    if( !td_initconsole() )
        return( FALSE );

    if( !initmonitor() )
        return( FALSE );

    if( TCAP_MONOCHROME ) {
        UIData->colour = M_TERMINFO_MONO;
    }

    UIData->no_blowup = TRUE;

    tmp = getenv( "TIOPTIMIZE" );
    if( tmp != NULL )
        OptimizeTerminfo = ( stricmp( tmp, "no" ) != 0 );

    // Figure out the number of columns to use
    cols = 0;
    tmp = getenv( "COLUMNS" );
    if( tmp != NULL )
        cols = strtoul( tmp, NULL, 0 );

    // Figure out the number of rows to use
    rows = 0;
    tmp = getenv( "LINES" );
    if( tmp != NULL )
        rows = strtoul( tmp, NULL, 0 );

    // Set up screen buffer
    if( !setupscrnbuff( rows, cols ) )
        return( FALSE );

    uiinitcursor();
    if( !initkeyboard() )
        return( FALSE );

    UIData->mouse_acc_delay = 277;
    UIData->mouse_rpt_delay = 100;
    UIData->mouse_clk_delay = 277;
    UIData->tick_delay      = 500;
    UIData->f10menus        = true;

    //find point at which repeat chars code becomes efficient
    ti_find_cutoff();

    ti_refresh( 1 );
    return( TRUE );
}
示例#3
0
static EVENT td_sizeevent( void )
/*******************************/
{
    SAREA           area;

    if( !SizePending ) return (EV_NO_EVENT);
    if( !uiinlist(EV_BACKGROUND_RESIZE) ) return (EV_NO_EVENT);
    if( !setupscrnbuff(UIData->height,UIData->width) ) return (EV_NO_EVENT);
    SizePending = 0;
    area.row = 0;
    area.col = 0;
    area.height = UIData->height;
    area.width = UIData->width;
    uidirty(area);
    return (EV_BACKGROUND_RESIZE);
}
示例#4
0
static int td_init( void )
/************************/
{
    if (UIData == NULL) {
        UIData = &ui_data;
    }
    if( !td_initconsole() ) return( FALSE );

    if (!initmonitor()) return (FALSE);
    if (!setupscrnbuff(0,0)) return (FALSE);

    uiinitcursor();
    initkeyboard();
    UIData->mouse_acc_delay = 277;
    UIData->mouse_rpt_delay = 55;
    UIData->mouse_clk_delay = 277;
    UIData->tick_delay = 500;
    UIData->f10menus = TRUE;
    td_refresh(1);
    return (TRUE);
}
示例#5
0
static int cd_init( void )
/************************/
{
    int                 initialized;

    initialized = false;
    if( UIData == NULL ) {
        UIData = &ui_data;
    }
    if( !initmonitor() )
        return( false );
    if( !setupscrnbuff() )
        return( false );

    uiinitcursor();
    initkeyboard();
    UIData->mouse_acc_delay = 277;
    UIData->mouse_rpt_delay = 100;
    UIData->mouse_clk_delay = 277;
    UIData->tick_delay      = 500;
    UIData->f10menus        = true;
    return( true );
}