Пример #1
0
// restore to whatever the rotation was when we started
void RotateHelper::restore()
{
	if(initial_rotation != -1){
                rotate(initial_rotation);
		emit rotated(IS_LANDSCAPE(initial_rotation));
	}
}
Пример #2
0
static bool broadsheet_set_display_orientation(orientation_t orientation)
{
    bool rotate = false;
    
    // If Broadsheet isn't still in its ready state when we're attempting
    // a rotation, tell the eInk HAL that we're in real trouble.
    //
    if ( !BS_STILL_READY() )
        EINKFB_NEEDS_RESET();
    else
    {
        switch ( orientation )
        {
            case orientation_portrait:
                if ( !IS_PORTRAIT() )
                {
                    bs_orientation = EINK_ORIENT_PORTRAIT;
                    bs_upside_down = false;
                    rotate = true;
                }
            break;
            
            case orientation_portrait_upside_down:
                if ( !IS_PORTRAIT_UPSIDE_DOWN() )
                {
                    bs_orientation = EINK_ORIENT_PORTRAIT;
                    bs_upside_down = true;
                    rotate = true;
                }
            break;
            
            case orientation_landscape:
                if ( !IS_LANDSCAPE() )
                {
                    bs_orientation = EINK_ORIENT_LANDSCAPE;
                    bs_upside_down = false;
                    rotate = true;
                }
            break;
            
            case orientation_landscape_upside_down:
                if ( !IS_LANDSCAPE_UPSIDE_DOWN() )
                {
                    bs_orientation = EINK_ORIENT_LANDSCAPE;
                    bs_upside_down = true;
                    rotate = true;
                }
            break;
        }
        
        if ( rotate )
            bs_sw_init_panel(DONT_BRINGUP_PANEL);
    }

    return ( rotate );
}
Пример #3
0
// return true if currently in landscape orientation
bool RotateHelper::isLandscape()
{
	QValueSpaceItem vsiRot("/UI/Rotation/Current");
    int currot= vsiRot.value().toUInt();
	return IS_LANDSCAPE(currot);
}
Пример #4
0
void RotateHelper::maybe_rotate(int deg)
{
    rotate(deg);
    emit rotated(IS_LANDSCAPE(deg));
}