Exemplo n.º 1
0
void CSdlAppUi::ConstructL()    
    {
    BaseConstructL(ENoScreenFurniture | EAppOrientationLandscape);
        
    iSDLWin = new (ELeave) CSDLWin;
    iSDLWin->ConstructL(ApplicationRect());
                
    iSdl = CSDL::NewL(CSDL::EEnableFocusStop);
    iSdlObserver = new (ELeave) CSDLObserver(iSdl);
    
    iSdl->SetContainerWindowL(
                    iSDLWin->GetWindow(), 
                    iEikonEnv->WsSession(),
                    *iEikonEnv->ScreenDevice());    
    iSdl->SetObserver(iSdlObserver);
    iSdl->DisableKeyBlocking(*this);    
    
    iWait = new (ELeave) CExitWait(*this);    
    CDesC8ArrayFlat* args = new (ELeave)CDesC8ArrayFlat(10);
    AddCmdLineParamsL(*args);
    
    iSdl->CallMainL(iWait->iStatus, *args, CSDL::ENoFlags, 81920);
    delete args;
    
    iWait->Start();     
    }
Exemplo n.º 2
0
void CSdlAppUi::HandleResourceChangeL(TInt aType)
    {
    CAknAppUi::HandleResourceChangeL(aType);
    
    if(aType == KEikDynamicLayoutVariantSwitch)
        {
        iSDLWin->SetRect(ApplicationRect());
        if (iSdl)
            {
            iSdl->SetContainerWindowL(
                        iSDLWin->GetWindow(),
                        iEikonEnv->WsSession(),
                        *iEikonEnv->ScreenDevice());
            }                       
        }
    }
Exemplo n.º 3
0
void CSdlAppUi::HandleResourceChangeL(TInt aType)
{

	//User::InfoPrint(_L("rect.Height()"));
	if (aType == KEikDynamicLayoutVariantSwitch)
	{
		// Create SDL resize event
		TRect rect;
		AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EApplicationWindow,
				rect);

		SDL_Event event;
		event.type = SDL_VIDEORESIZE;
		event.resize.w = rect.Width();
		event.resize.h = rect.Height();
		//if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) {
		SDL_PushEvent(&event);

		iSDLWin->SetRect(rect);
		/*
		 iSdl->SetContainerWindowL(
		 iSDLWin->GetWindow(),
		 iEikonEnv->WsSession(),
		 *iEikonEnv->ScreenDevice());
		 */
	}

	CAknAppUi::HandleResourceChangeL(aType);

}
Exemplo n.º 4
0
void CSdlAppUi::ConstructL()
{
	BaseConstructL(CAknAppUi::EAknEnableSkin /* | ENoScreenFurniture*/);

	iSDLWin = new (ELeave) CSDLWin;
	iSDLWin->ConstructL(ApplicationRect());

	iWait = new (ELeave) CExitWait(*this);

	StartTestL(0);
}
Exemplo n.º 5
0
void CSdlAppUi::StartTestL(TInt aCmd)
{

	//TInt flags = CSDL::EDrawModeGdi | CSDL::EEnableFocusStop
	//		| CSDL::EMainThread;// | CSDL::EAutoOrientation;

	TInt flags = 0;

	//flags |= CSDL::EDrawModeDSB | CSDL::EDrawModeDSBDoubleBuffer;
	flags |= CSDL::EDrawModeGdi;
	// Don't draw when in background.
	//flags |= CSDL::EEnableFocusStop;
	flags |= CSDL::EAutoOrientation;
	// This should be on by default anyway
	flags |= CSDL::EMainThread;

	//Create CommandLine Arguments and read it.
	CDesC8ArrayFlat *arr = new (ELeave) CDesC8ArrayFlat(1);
	CleanupStack::PushL(arr);

	CCommandLineArguments* args = CCommandLineArguments::NewLC();
	// The real args we are interested in start at the 2nd arg
	for (TInt i = 1; i < args->Count(); i++)
	{
		TBuf8<256> arg;
		arg.Copy(args->Arg(i));

		arr->AppendL(arg);
		//TPtrC argumentPrt(args->Arg(i));
		//console->Printf(_L("Arg %d == %S\n"), i, &argumentPrt);
	}

	iSdl = CSDL::NewL(flags);

	iSdl->SetContainerWindowL(iSDLWin->GetWindow(), iEikonEnv->WsSession(),
			*iEikonEnv->ScreenDevice());
	iSdl->CallMainL(iWait->iStatus, *arr, flags, 0x14000);
	iWait->Start();

	arr->Reset();
	CleanupStack::PopAndDestroy(2); // command line and arr
}