Пример #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();     
    }
Пример #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());
            }                       
        }
    }
Пример #3
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
}