Ejemplo n.º 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 );
}
Ejemplo n.º 2
0
bool intern initmonitor( void )
/*****************************/
{
    struct _osinfo      info;

    if( UIConCtrl == NULL )
        return( false );

    qnx_osinfo( UIConNid, &info );
    switch( info.primary_monitor ) {
    case _MONITOR_PGS:
    case _MONITOR_CGA:
    case _MONITOR_PS30_COLOR:
        UIData->colour = M_CGA;
        break;
    case _MONITOR_EGA_COLOR:
        UIData->colour = M_EGA;
        break;
    case _MONITOR_VGA_COLOR:
        UIData->colour = M_VGA;
        break;
    case _MONITOR_EGA_MONO:
    case _MONITOR_VGA_MONO:
    case _MONITOR_PS30_MONO:
        UIData->colour = M_BW;
        break;
    default:
        UIData->colour = M_MONO;
        break;
    }

    /* notify if screen size changes */
    signal( SIGDEV, &state_handler );
    console_arm( UIConCtrl, UIConsole, 0,
            _CON_EVENT_SIZE|_CON_EVENT_ACTIVE|_CON_EVENT_SIZE );

    return( true );
}
Ejemplo n.º 3
0
/* This is called to do OS-specific stuff when we switch away from
 * our console.
 */
Bool xf86VTSwitchAway()
{
	int ret;
	unsigned event, bits;

	ErrorF("Called VT switch away!\n");

	/* First check wether we are trying to switch to our console... */
	if (xf86Info.vtRequestsPending == QNX_our_console) {
		xf86Info.vtRequestsPending = FALSE;
		return (FALSE);
		}

	/* Reenable console switching */
	QNX_con_bits &= ~QNX_con_mask;
        bits = console_ctrl(QNX_con_ctrl, -1, QNX_con_bits, QNX_con_mask);
        QNX_con_mask = 0;

	/* And activate the new console. Check if it is valid first... */
	ret = console_active(QNX_con_ctrl, xf86Info.vtRequestsPending);
	ErrorF("xf86VTSwitchAway: Made console %d active, ret %d\n", 
		xf86Info.vtRequestsPending, ret);
	xf86Info.vtRequestsPending = FALSE;

	if (ret == -1) {
	        QNX_con_mask = CONSOLE_INVISIBLE | CONSOLE_NOSWITCH;
	        QNX_con_bits = console_ctrl (QNX_con_ctrl, 
			QNX_our_console, QNX_con_mask, QNX_con_mask);
		return (FALSE);
		}
	/* Arm the console with the proxy so we know when we come back */
      	console_state(QNX_con_ctrl, QNX_our_console, 0L, _CON_EVENT_ACTIVE); 
	event = _CON_EVENT_ACTIVE;
        console_arm (QNX_con_ctrl, QNX_our_console, QNX_console_proxy, event);

        return(TRUE);
}