// Initialize an EGL context for the current display.
int Engine::InitDisplay(const int32_t cmd) {
  if (!initialized_resources_) {
    gl_context_->Init(app_->window);
    InitUI();
    gl_context_->SetSwapInterval(0);  // Set interval of 0 for a benchmark
    LoadResources();
    initialized_resources_ = true;
  } else {
    // initialize OpenGL ES and EGL
    if (EGL_SUCCESS != gl_context_->Resume(app_->window)) {
      UnloadResources();
      LoadResources();
    }
    jui_helper::JUIWindow::GetInstance()->Resume(app_->activity, cmd);
  }

  ShowUI();

  // Initialize GL state.
  glEnable(GL_CULL_FACE);
  glEnable(GL_DEPTH_TEST);
  glDepthFunc(GL_LEQUAL);

  // Note that screen size might have been changed
  glViewport(0, 0, gl_context_->GetScreenWidth(),
             gl_context_->GetScreenHeight());
  renderer_.UpdateViewport();

  tap_camera_.SetFlip(1.f, -1.f, -1.f);
  tap_camera_.SetPinchTransformFactor(2.f, 2.f, 8.f);

  return 0;
}
/**
 * Initialize an EGL context for the current display.
 */
int Engine::InitDisplay()
{
    if( !initialized_resources_ )
    {
        gl_context_->Init( app_->window );
        LoadResources();
        initialized_resources_ = true;
    }
    else
    {
        // initialize OpenGL ES and EGL
        if( EGL_SUCCESS != gl_context_->Resume( app_->window ) )
        {
            UnloadResources();
            LoadResources();
        }
    }

    ShowUI();

    // Initialize GL state.
    glEnable( GL_CULL_FACE );
    glEnable( GL_DEPTH_TEST );
    glDepthFunc( GL_LEQUAL );

    //Note that screen size might have been changed
    glViewport( 0, 0, gl_context_->GetScreenWidth(), gl_context_->GetScreenHeight() );
    renderer_.UpdateViewport();

    tap_camera_.SetFlip( 1.f, -1.f, -1.f );
    tap_camera_.SetPinchTransformFactor( 10.f, 10.f, 8.f );

    return 0;
}
Exemple #3
0
void luksaddkey::pbOpenPartition( void )
{
	openvolume * op = new openvolume( this ) ;
	op->showLuksOnly() ;
	connect( op,SIGNAL( clickedPartition( QString ) ),this,SLOT( ShowUI( QString ) ) ) ;
	connect( op,SIGNAL( HideUISignal() ),op,SLOT( deleteLater() ) ) ;
	connect( op,SIGNAL( HideUISignal() ),this,SLOT( setFieldFocus() ) ) ;
	op->ShowAllPartitions() ;
}
Exemple #4
0
void MainWindow::mount( const volumeEntryProperties& entry )
{
	this->disableAll() ;

	if( entry.encryptedVolume() ){

		auto kd = new keyDialog( this,m_ui->tableWidget,entry ) ;

		connect( kd,SIGNAL( cancel() ),this,SLOT( enableAll() ) ) ;
		connect( kd,SIGNAL( openMountPoint( QString ) ),this,SLOT( openMountPointPath( QString ) ) ) ;

		kd->ShowUI() ;
	}else{
		auto mp = new mountPartition( this,m_ui->tableWidget ) ;

		connect( mp,SIGNAL( cancel() ),this,SLOT( enableAll() ) ) ;
		connect( mp,SIGNAL( openMountPoint( QString ) ),this,SLOT( openMountPointPath( QString ) ) ) ;

		mp->ShowUI( entry ) ;
	}
}
dword Tapplication::OnKeyWhenHidden( dword key, dword extKey )
{
	(extKey);

	if ((key == m_reshowUIKey) && IsNormalState())
	{
		BeforeExitNormal();
		TAP_ExitNormal();
		BlankScreen();
		ShowUI();
		m_reshowUIKey = 0;
		return 0;
	}
	return key;
}
/**
 * Initialize an EGL context for the current display.
 */
int Engine::InitDisplay(android_app* app) {
  if (!initialized_resources_) {
    gl_context_->Init(app_->window);
    LoadResources();
    initialized_resources_ = true;
  } else if(app->window != gl_context_->GetANativeWindow()) {
    // Re-initialize ANativeWindow.
    // On some devices, ANativeWindow is re-created when the app is resumed
    assert(gl_context_->GetANativeWindow());
    UnloadResources();
    gl_context_->Invalidate();
    app_ = app;
    gl_context_->Init(app->window);
    LoadResources();
    initialized_resources_ = true;
  } else {
    // initialize OpenGL ES and EGL
    if (EGL_SUCCESS == gl_context_->Resume(app_->window)) {
      UnloadResources();
      LoadResources();
    } else {
        assert(0);
    }
  }

  ShowUI();

  // Initialize GL state.
  glEnable(GL_CULL_FACE);
  glEnable(GL_DEPTH_TEST);
  glDepthFunc(GL_LEQUAL);

  // Note that screen size might have been changed
  glViewport(0, 0, gl_context_->GetScreenWidth(),
             gl_context_->GetScreenHeight());
  renderer_.UpdateViewport();

  tap_camera_.SetFlip(1.f, -1.f, -1.f);
  tap_camera_.SetPinchTransformFactor(2.f, 2.f, 8.f);

  return 0;
}
void MoviePlayerView::CheckInput( const VrFrame & vrFrame )
{
	if ( !uiActive && !RepositionScreen )
	{
		if ( ( vrFrame.Input.buttonPressed & BUTTON_A ) || ( ( vrFrame.Input.buttonReleased & BUTTON_TOUCH ) && !( vrFrame.Input.buttonState & BUTTON_TOUCH_WAS_SWIPE ) ) )
		{
			// open ui if it's not visible
			Cinema.app->PlaySound( "touch_up" );
			ShowUI();

			// ignore button A or touchpad until release so we don't close the UI immediately after opening it
			UIOpened = true;
		}
	}

	if ( vrFrame.Input.buttonPressed & ( BUTTON_DPAD_LEFT | BUTTON_SWIPE_BACK ) )
	{
		if ( ( vrFrame.Input.buttonPressed & BUTTON_DPAD_LEFT ) || !GazeTimer.IsFocused() )
		{
			ShowUI();
			if ( SeekSpeed == 0 )
			{
				PauseMovie();
			}

			SeekSpeed--;
			if ( ( SeekSpeed == 0 ) || ( SeekSpeed < -MaxSeekSpeed ) )
			{
				SeekSpeed = 0;
				PlayMovie();
			}
			SetSeekIcon( SeekSpeed );

			Cinema.app->PlaySound( "touch_up" );
		}
	}

	if ( vrFrame.Input.buttonPressed & ( BUTTON_DPAD_RIGHT | BUTTON_SWIPE_FORWARD ) )
	{
		if ( ( vrFrame.Input.buttonPressed & BUTTON_DPAD_RIGHT ) || !GazeTimer.IsFocused() )
		{
			ShowUI();
			if ( SeekSpeed == 0 )
			{
				PauseMovie();
			}

			SeekSpeed++;
			if ( ( SeekSpeed == 0 ) || ( SeekSpeed > MaxSeekSpeed ) )
			{
				SeekSpeed = 0;
				PlayMovie();
			}
			SetSeekIcon( SeekSpeed );

			Cinema.app->PlaySound( "touch_up" );
		}
	}

	if ( Cinema.SceneMgr.FreeScreenActive )
	{
		const Vector2f screenCursor = GazeCoordinatesOnScreen( Cinema.SceneMgr.Scene.CenterViewMatrix(), Cinema.SceneMgr.ScreenMatrix() );
		bool onscreen = false;
		if ( InsideUnit( screenCursor ) )
		{
			onscreen = true;
		}
		else if ( uiActive )
		{
			onscreen = GazeTimer.IsFocused();
		}

		if ( !onscreen )
		{
			// outside of screen, so show reposition message
			const double now = ovr_GetTimeInSeconds();
			float alpha = MoveScreenAlpha.Value( now );
			if ( alpha > 0.0f )
			{
				MoveScreenLabel.SetVisible( true );
				MoveScreenLabel.SetTextColor( Vector4f( alpha ) );
			}

			if ( vrFrame.Input.buttonPressed & ( BUTTON_A | BUTTON_TOUCH ) )
			{
				RepositionScreen = true;
			}
		}
		else
		{
			// onscreen, so hide message
			const double now = ovr_GetTimeInSeconds();
			MoveScreenAlpha.Set( now, -1.0f, now + 1.0f, 1.0f );
			MoveScreenLabel.SetVisible( false );
		}
	}

	// while we're holding down the button or touchpad, reposition screen
	if ( RepositionScreen )
	{
		if ( vrFrame.Input.buttonState & ( BUTTON_A | BUTTON_TOUCH ) )
		{
			Cinema.SceneMgr.PutScreenInFront();
		}
		else
		{
			RepositionScreen = false;
		}
	}

	if ( vrFrame.Input.buttonPressed & BUTTON_START )
	{
		TogglePlayback();
	}

	if ( vrFrame.Input.buttonPressed & BUTTON_SELECT )
	{
		// movie select
		Cinema.app->PlaySound( "touch_up" );
		Cinema.MovieSelection( false );
	}

	if ( vrFrame.Input.buttonPressed & BUTTON_B )
	{
		if ( !uiActive )
		{
			BackPressed();
		}
		else
		{
			LOG( "User pressed button 2" );
			Cinema.app->PlaySound( "touch_up" );
			HideUI();
			PlayMovie();
		}
	}
}
Exemple #8
0
void Application::start()
{
    qmlRegisterUncreatableType<SailreadsManager>("harbour.sailreads", 1, 0, "SailreadsManager",
            "SailreadsManager static uncreatable type");
    qmlRegisterUncreatableType<Author>("harbour.sailreads", 1, 0, "Author",
            "Author provides attached properties and can't be instantiated");
    qmlRegisterUncreatableType<Book>("harbour.sailreads", 1, 0, "Book",
            "Book provides attached properties and can't be instantiated");
    qmlRegisterUncreatableType<Group>("harbour.sailreads", 1, 0, "Group",
            "Group provides attached properties and can't be instantiated");
    qmlRegisterUncreatableType<Review>("harbour.sailreads", 1, 0, "Review",
            "Review provides attached properties and can't be instantiated");
    qmlRegisterUncreatableType<Series>("harbour.sailreads", 1, 0, "Series",
            "Series provides attached properties and can't be instantiated");
    qmlRegisterUncreatableType<SeriesWork>("harbour.sailreads", 1, 0, "SeriesWork",
            "SeriesWork provides attached properties and can't be instantiated");
    qmlRegisterUncreatableType<Topic>("harbour.sailreads", 1, 0, "Topic",
            "Topic provids attached properties and can't be instantiated");
    qmlRegisterUncreatableType<User>("harbour.sailreads", 1, 0, "User",
            "User provids attached properties and can't be instantiated");
    qmlRegisterUncreatableType<Work>("harbour.sailreads", 1, 0, "Work",
            "Work provides attached properties and can't be instantiated");
    qmlRegisterUncreatableType<Update>("harbour.sailreads", 1, 0, "Update",
            "Update provides attached properties and can't be instantiated");
    qmlRegisterUncreatableType<ReadStatus>("harbour.sailreads", 1, 0, "ReadStatus",
            "Update provides attached properties and can't be instantiated");
    qmlRegisterUncreatableType<UserStatus>("harbour.sailreads", 1, 0, "ReadStatus",
            "Update provides attached properties and can't be instantiated");

    qRegisterMetaType<QObjectList>("QObjectList");
    qRegisterMetaType<Author*>("Author*");
    qRegisterMetaType<Book*>("Book*");
    qRegisterMetaType<Group*>("Group*");
    qRegisterMetaType<Message*>("Message*");
    qRegisterMetaType<Review*>("Review*");
    qRegisterMetaType<Series*>("Series*");
    qRegisterMetaType<SeriesWork*>("SeriesWork*");
    qRegisterMetaType<Topic*>("Topic*");
    qRegisterMetaType<User*>("User*");
    qRegisterMetaType<Work*>("Work*");
    qRegisterMetaType<GroupFolder>("GroupFolder");
    qRegisterMetaType<ReadStatus*>("ReadStatus*");
    qRegisterMetaType<UserStatus*>("UserStatus*");
    qRegisterMetaType<Recommendation*>("Recommendation*");
    qRegisterMetaType<AuthorBooksModel*>("AuthorBooksModel*");

    qmlRegisterType<AuthorBooksModel>("harbour.sailreads", 1, 0, "AuthorBooksModel");
    qmlRegisterType<AuthorSeriesModel>("harbour.sailreads", 1, 0, "AuthorSeriesModel");
    qmlRegisterType<BaseProxyModel>("harbour.sailreads", 1, 0, "BaseProxyModel");
    qmlRegisterType<BookShelvesModel>("harbour.sailreads", 1, 0, "BookShelvesModel");
    qmlRegisterType<BookEditionsModel>("harbour.sailreads", 1, 0, "BookEditionsModel");
    qmlRegisterType<FriendsModel>("harbour.sailreads", 1, 0, "FriendsModel");
    qmlRegisterType<FollowersModel>("harbour.sailreads", 1, 0, "FollowersModel");
    qmlRegisterType<FollowingsModel>("harbour.sailreads", 1, 0, "FollowingsModel");
    qmlRegisterType<MessagesModel>("harbour.sailreads", 1, 0, "MessagesModel");
    qmlRegisterType<NotificationsModel>("harbour.sailreads", 1, 0, "NotificationsModel");
    qmlRegisterType<UserGroupsModel>("harbour.sailreads", 1, 0, "UserGroupsModel");
    qmlRegisterType<FoundGroupsModel>("harbour.sailreads", 1, 0, "FoundGroupsModel");
    qmlRegisterType<GroupFoldersModel>("harbour.sailreads", 1, 0, "GroupFoldersModel");
    qmlRegisterType<GroupMembersModel>("harbour.sailreads", 1, 0, "GroupMembersModel");
    qmlRegisterType<GroupFolderTopicsModel>("harbour.sailreads", 1, 0, "GroupFolderTopicsModel");
    qmlRegisterType<TopicCommentsModel>("harbour.sailreads", 1, 0, "TopicCommentsModel");
    qmlRegisterType<ReviewCommentsModel>("harbour.sailreads", 1, 0, "ReviewCommentsModel");
    qmlRegisterType<ReviewsModel>("harbour.sailreads", 1, 0, "ReviewsModel");
    qmlRegisterType<SearchReviewsModel>("harbour.sailreads", 1, 0, "SearchReviewsModel");
    qmlRegisterType<UpdatesModel>("harbour.sailreads", 1, 0, "UpdatesModel");
    qmlRegisterType<ProfileUpdatesModel>("harbour.sailreads", 1, 0, "ProfileUpdatesModel");
    qmlRegisterType<CommentsModel>("harbour.sailreads", 1, 0, "CommentsModel");
    qmlRegisterType<ReadStatusCommentsModel>("harbour.sailreads", 1, 0, "ReadStatusCommentsModel");
    qmlRegisterType<UserStatusCommentsModel>("harbour.sailreads", 1, 0, "UserStatusCommentsModel");
    qmlRegisterType<RecommendationCommentsModel>("harbour.sailreads", 1, 0, "RecommendationCommentsModel");
    qmlRegisterType<FriendsRequestsModel>("harbour.sailreads", 1, 0, "FriendsRequestsModel");
    qmlRegisterType<FriendsRecommendationsModel>("harbour.sailreads", 1, 0, "FriendsRecommendationsModel");
    qmlRegisterType<FoundBooksModel>("harbour.sailreads", 1, 0, "FoundBooksModel");
    qmlRegisterType<UserQuotesModel>("harbour.sailreads", 1, 0, "UserQuotesModel");
    qmlRegisterType<BookQuotesModel>("harbour.sailreads", 1, 0, "BookQuotesModel");
    qmlRegisterType<AuthorQuotesModel>("harbour.sailreads", 1, 0, "AuthorQuotesModel");

    qmlRegisterType<UserProfile>("harbour.sailreads", 1, 0, "UserProfile");
    qmlRegisterType<GroupItem>("harbour.sailreads", 1, 0, "GroupItem");
    qmlRegisterType<TopicItem>("harbour.sailreads", 1, 0, "TopicItem");
    qmlRegisterType<BookItem>("harbour.sailreads", 1, 0, "BookItem");
    qmlRegisterType<SeriesItem>("harbour.sailreads", 1, 0, "SeriesItem");
    qmlRegisterType<AuthorProfileItem>("harbour.sailreads", 1, 0, "AuthorProfileItem");
    qmlRegisterType<User>("harbour.sailreads", 1, 0, "User");
    qmlRegisterType<ReviewItem>("harbour.sailreads", 1, 0, "ReviewItem");
    qmlRegisterType<MessageItem>("harbour.sailreads", 1, 0, "MessageItem");
    qmlRegisterType<ReadStatusItem>("harbour.sailreads", 1, 0, "ReadStatusItem");
    qmlRegisterType<UserStatusItem>("harbour.sailreads", 1, 0, "UserStatusItem");
    qmlRegisterType<RecommendationItem>("harbour.sailreads", 1, 0, "RecommendationItem");

    ShowUI();
}
void createvolume::ShowFile( QString volume )
{
	ShowUI( tr( "path to file" ),volume ) ;
}
Exemple #10
0
void createvolume::ShowPartition( QString volume )
{
	ShowUI( tr( "path to device" ),volume ) ;
}
void MoviePlayerView::CheckInput( const VrFrame & vrFrame )
{
	if ( !uiActive && !RepositionScreen )
	{
		if ( ( vrFrame.Input.buttonPressed & BUTTON_A ) || ( ( vrFrame.Input.buttonReleased & BUTTON_TOUCH ) && !( vrFrame.Input.buttonState & BUTTON_TOUCH_WAS_SWIPE ) ) )
		{
			// open ui if it's not visible
			Cinema.app->PlaySound( "touch_up" );
			ShowUI();
		}
	}

	if ( vrFrame.Input.buttonPressed & ( BUTTON_DPAD_LEFT | BUTTON_SWIPE_BACK ) )
	{
		if ( ( vrFrame.Input.buttonPressed & BUTTON_DPAD_LEFT ) || !CursorInsidePlaybackControls() )
		{
			ShowUI();
			if ( SeekSpeed == 0 )
			{
				Native::PauseMovie( Cinema.app );
				PlaybackPos = Native::GetPosition( Cinema.app );
			}

			SeekSpeed--;
			if ( ( SeekSpeed == 0 ) || ( SeekSpeed < -MaxSeekSpeed ) )
			{
				SeekSpeed = 0;
				Native::ResumeMovie( Cinema.app );
			}

			Cinema.app->PlaySound( "touch_up" );
		}
	}

	if ( vrFrame.Input.buttonPressed & ( BUTTON_DPAD_RIGHT | BUTTON_SWIPE_FORWARD ) )
	{
		if ( ( vrFrame.Input.buttonPressed & BUTTON_DPAD_RIGHT ) || !CursorInsidePlaybackControls() )
		{
			ShowUI();
			if ( SeekSpeed == 0 )
			{
				Native::PauseMovie( Cinema.app );
				PlaybackPos = Native::GetPosition( Cinema.app );
			}

			SeekSpeed++;
			if ( ( SeekSpeed == 0 ) || ( SeekSpeed > MaxSeekSpeed ) )
			{
				SeekSpeed = 0;
				Native::ResumeMovie( Cinema.app );
			}

			Cinema.app->PlaySound( "touch_up" );
		}
	}

	if ( Cinema.SceneMgr.FreeScreenActive )
	{
		const Vector2f screenCursor = GazeCoordinatesOnPanel( Cinema.SceneMgr.Scene.CenterViewMatrix(), Cinema.SceneMgr.FreeScreenMatrix(), Cinema.app->GetActivityPanel().AlternateGazeCheck  );
		if ( !InsideUnit( screenCursor ) && !CursorInsidePlaybackControls() )
		{
			// outside of screen, so show reposition message
			const double now = TimeInSeconds();
			float alpha = MoveScreenAlpha.Value( now );
			if ( alpha > 0.0f )
			{
				MoveScreenObj->RemoveFlags( VRMENUOBJECT_DONT_RENDER );
				MoveScreenObj->SetTextColor( Vector4f( alpha ) );
			}

			if ( vrFrame.Input.buttonPressed & ( BUTTON_A | BUTTON_TOUCH ) )
			{
				RepositionScreen = true;
			}
		}
		else
		{
			// onscreen, so hide message
			const double now = TimeInSeconds();
			MoveScreenAlpha.Set( now, -1.0f, now + 1.0f, 1.0f );
			MoveScreenObj->AddFlags( VRMENUOBJECT_DONT_RENDER );
		}
	}

	// while we're holding down the button or touchpad, reposition screen
	if ( RepositionScreen )
	{
		if ( vrFrame.Input.buttonState & ( BUTTON_A | BUTTON_TOUCH ) )
		{
			Cinema.SceneMgr.PutScreenInFront();
		}
		else
		{
			RepositionScreen = false;
		}
	}

	if ( vrFrame.Input.buttonPressed & BUTTON_START )
	{
		Native::TogglePlaying( Cinema.app );
		SeekSpeed = 0;
	}

	if ( vrFrame.Input.buttonPressed & BUTTON_SELECT )
	{
		// movie select
		Cinema.app->PlaySound( "touch_up" );
		Cinema.MovieSelection( false );
	}

	if ( vrFrame.Input.buttonPressed & BUTTON_B )
	{
		if ( !uiActive )
		{
			BackPressed();
		}
		else
		{
			Cinema.app->PlaySound( "touch_up" );
			HideUI();
			Native::ResumeMovie( Cinema.app );
		}
	}
}