Example #1
0
TInt Cdmatest::CompleteCommandsL( CStifItemParser& /*aItem*/ )
	{
	TRAPD( err, Adapter()->CompleteOutstandingCmdsL() );
	delete iAdapter;
	iAdapter = NULL;
	return err;
	}
Example #2
0
TInt Cdmatest::DeleteObjectL( CStifItemParser& aItem )
{
	TInt ret( KErrNone );
    // Print to UI
    TestModuleIf().Printf( 0, _L("Camtest"), _L("DeleteObjectL") );

    TPtrC8 nodename( GetNextStringLC ( aItem, _L("Nodename") )->Des() ) ;

	SetURIL(nodename) ;

	HBufC8 *luid = GetLuidAllocLC( *iURI );
	Adapter()->DeleteObjectL( *iURI, *luid, 11 ) ;
	if ( iStatus == MSmlDmAdapter::EOk )
		{
		iLog->Log( _L("DeleteNode: DeleteObjectL Successful! %d" ), iStatus );	
		}
	else
		{
		iLog->Log( _L("DeleteNode: DeleteObjectL FetchLeafObjectL Error ! %d" ), iStatus );	
		ret = KErrGeneral ;
		}
	CleanupStack::PopAndDestroy( luid ); // luid
	CleanupStack::PopAndDestroy(); // nodename	
	iLog->Log( _L("ExecuteLeafDataL Test Complete with status %d" ), ret );	

    return ret;	
}
Example #3
0
TInt Cdmatest::AddNodeL( CStifItemParser& aItem )	
	{

    TInt ret( KErrNone );
    // Print to UI
    TestModuleIf().Printf( 0, _L("Cdmatest"), _L("AddNodeL") );

    
    TPtrC8 nodename( GetNextStringLC ( aItem, _L("nodename" ) )->Des() ) ;
    SetURIL( nodename );

	Adapter()->AddNodeObjectL( *iURI, KEmptyType, 8 ) ;
	
	if ( iStatus == MSmlDmAdapter::EOk )
		{
		iLog->Log( _L("AddNodeL: AddNodeObjectL Successful! %d" ), iStatus );	
		}
	else
		{
		iLog->Log( _L("AddNodeL: AddNodeObjectL Error ! %d" ), iStatus );	
		ret = KErrGeneral ;
		}
		
	CleanupStack::PopAndDestroy() ; // nodename
	iLog->Log( _L("AddNodeL Test Complete with status %d" ), ret );	

    return ret;
	}	
Example #4
0
TInt Cdmatest::FetchNodeL( CStifItemParser& aItem )	
	{

    TInt ret( KErrNone );
    // Print to UI
    TestModuleIf().Printf( 0, _L("Cdmatest"), _L("FetchNodeL") );

	iResultsFunction = FetchNodeResultsL;
	
    TPtrC8 nodename( GetNextStringLC( aItem, _L(" nodename" ) )->Des() ) ;
		
	SetURIL(nodename) ;//
	HBufC8 *luid = GetLuidAllocLC( *iURI );

	Adapter()->ChildURIListL( *iURI, *luid, *iEmptyMappingInfoArray, 4, 5) ;

	if ( iStatus == MSmlDmAdapter::EOk )
		{
		}
	else
		{
		iLog->Log( _L("FetchNodeL: ChildUriList Error ! %d" ), iStatus );	
		ret = KErrGeneral ;
		}
	CleanupStack::PopAndDestroy( luid ) ; 
	CleanupStack::PopAndDestroy() ; // nodename
	iLog->Log( _L("FetchNodeL: Test Complete with status %d" ), ret );	

    return ret;
	}
Example #5
0
// -----------------------------------------------------------------------------
// Cdmatest::ConstructL
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void Cdmatest::ConstructL()
    {    
    Adapter();
	iEmptyMappingInfoArray = new ( ELeave ) CArrayFixFlat<TSmlDmMappingInfo>(1);
	
	TRAPD( err, LoadMappingsL() );
	if (err != KErrEof && err != KErrNone && err != KErrNotFound)
		{
		User::Leave( err );
		}
    }
Example #6
0
TInt Cdmatest::FetchLeafL( CStifItemParser& aItem )	
	{

    TInt ret( KErrNone );
    // Print to UI
    TestModuleIf().Printf( 0, _L("Camtest"), _L("FetchLeafL") );

	iResultsFunction = NULL;
	
    TInt i( 0 );
    TPtrC8 nodename ( GetNextStringLC( aItem, _L( "nodename" ) )->Des() ) ;
    
    //TPtrC datafile;
    TPtrC datafile( KNullDesC );
    i = aItem.GetNextString ( datafile ) ;
    if ( i != KErrNone ) 
	    {
	    iLog->Log(_L("FetchLeafL: ERROR Reading outfile argument: 0x%X"), i );
	    //return i;
	    }
	else
		{
		iSaveFileName = datafile;
		iLog->Log( _L( " Save file nameis '%S'" ), &iSaveFileName );
		iResultsFunction = SaveDataL;
		}
    
	SetURIL(nodename) ;
		
		/*
			void FetchLeafObjectL( const TDesC8& aURI, const TDesC8& aLUID,
								   const TDesC8& aType, TInt aResultsRef,
								   TInt aStatusRef );
		*/
    TPtrC8 parentURI(RemoveLastSeg(nodename));
    HBufC8 *luid = GetLuidAllocLC( parentURI );

	Adapter()->FetchLeafObjectL( *iURI, *luid, KEmptyType, 7, 8 ) ;
	if ( iStatus == MSmlDmAdapter::EOk )
		{
		iLog->Log( _L("FetchLeafL: FetchLeafObjectL Successful! %d" ), iStatus );	
		}
	else
		{
		iLog->Log( _L("FetchLeafL: FetchLeafObjectL Error ! %d" ), iStatus );	
		ret = KErrGeneral ;
		}
	CleanupStack::PopAndDestroy( luid );
	CleanupStack::PopAndDestroy(  ); // nodename
	iLog->Log( _L("FetchLeafL Test Complete with status %d" ), ret );	
    return ret;
	}	
Example #7
0
TInt Cdmatest::UpdateLeafDataURLL( CStifItemParser& aItem )	
	{

    TInt ret( KErrNone );
    // Print to UI
    TestModuleIf().Printf( 0, _L("Cdmatest"), _L("UpdateLeafDataL") );

    TPtrC8 nodename( GetNextStringLC ( aItem, _L("Node name") )->Des() ) ;
    TPtrC8 http (GetNextStringLC( aItem, _L("http"))->Des() );
    TPtrC8 url (GetNextStringLC( aItem, _L("rest of url"))->Des() );
	HBufC8 *mime = GetNextStringLC( aItem, _L("mime") ) ;
    SetURIL( nodename );
    
    _LIT8( KTag, "://" );
    
    HBufC8 *fullurl = HBufC8::NewLC( http.Length() + KTag().Length() + url.Length() );
    TPtr8 pfullurl( fullurl->Des() );
    pfullurl.Copy( http ) ;
    pfullurl.Append( KTag );
    pfullurl.Append( url );
    TPtrC8 mimePtr( *mime == KNullDesC8 ? KDefaultType() : mime->Des() );
    
    HBufC8 *luid = GetLuidAllocLC( *iURI );
    /**
    virtual void UpdateLeafObjectL( const TDesC8& aURI, const TDesC8& aLUID,
									const TDesC8& aObject, const TDesC8& aType,
									TInt aStatusRef ) = 0;
    */
	Adapter()->UpdateLeafObjectL( *iURI , *luid, pfullurl, mimePtr, 3);
	if ( iStatus == MSmlDmAdapter::EOk )
		{
		iLog->Log( _L("UpdateLeafDataL: UpdateLeafObjectL Successful! %d" ), iStatus );	
		}
	else
		{
		iLog->Log( _L("UpdateLeafDataL UpdateLeafObjectL Error ! %d" ), iStatus );	
		ret = KErrGeneral ;
		}
	CleanupStack::PopAndDestroy( luid ); // 
	CleanupStack::PopAndDestroy( mime ); // mime
	CleanupStack::PopAndDestroy(); // url
	CleanupStack::PopAndDestroy(); // http
	CleanupStack::PopAndDestroy(); // nodename
	iLog->Log( _L("UpdateLeafDataL Test Complete with status %d" ), ret );	

    return ret;
	}
Example #8
0
TInt Cdmatest::UpdateLeafL( CStifItemParser& aItem )	
	{

    TInt ret( KErrNone );
    // Print to UI
    TestModuleIf().Printf( 0, _L("Cdmatest"), _L("UpdateLeafL") );

    TPtrC8 nodename( GetNextStringLC ( aItem, _L("Node name") )->Des() ) ;
    TPtrC8 data (GetNextStringLC( aItem, _L("datafile"))->Des() );
    
	HBufC8 *mime = GetNextStringLC( aItem, _L("mime") ) ;
    SetURIL( nodename );
    
    TPtrC8 parentURI(RemoveLastSeg(nodename));
    HBufC8 *luid = GetLuidAllocLC( parentURI );
    
    TDataType type; 

	TPtrC8 mimePtr( *mime == KNullDesC8 ? type.Des8() : mime->Des() );

    /**
    virtual void UpdateLeafObjectL( const TDesC8& aURI, const TDesC8& aLUID,
									const TDesC8& aObject, const TDesC8& aType,
									TInt aStatusRef ) = 0;
    */
    
	Adapter()->UpdateLeafObjectL( *iURI , *luid, data, mimePtr, 3);

	if ( iStatus == MSmlDmAdapter::EOk )
	{
		iLog->Log( _L("UpdateLeafL: UpdateLeafObjectL Successful! %d" ), iStatus );	
	}
	else
	{
		iLog->Log( _L("UpdateLeafL UpdateLeafObjectL Error ! %d" ), iStatus );	
		ret = KErrGeneral ;
	}

	CleanupStack::PopAndDestroy(); // loadfile
	CleanupStack::PopAndDestroy(); // luid
	CleanupStack::PopAndDestroy(); // mime
	CleanupStack::PopAndDestroy(); // nodename

	iLog->Log( _L("UpdateLeafL Test Complete with status %d" ), ret );	

    return ret;
	}	
Example #9
0
TInt Cdmatest::ExecuteLeafL( CStifItemParser& aItem )		
	{
	TInt ret( KErrNone );
    // Print to UI
    TestModuleIf().Printf( 0, _L("Camtest"), _L("ExecuteLeafL") );

	iResultsFunction = NULL;
	
    TPtrC8 nodename( GetNextStringLC ( aItem, _L("Nodename") )->Des() ) ;
    TPtrC8 data( GetNextStringLC ( aItem, _L("Input file") )->Des() ) ;
	
	SetURIL(nodename) ;

		/*
			virtual void ExecuteCommandL( const TDesC8& aURI, const TDesC8& aLUID,
							      const TDesC8& aArgument, const TDesC8& aType,
								  TInt aStatusRef ) = 0;
		*/
	TDataType type;
	
    TPtrC8 parentURI(RemoveLastSeg(nodename));
    HBufC8 *luid = GetLuidAllocLC( parentURI );

	Adapter()->ExecuteCommandL( *iURI, *luid, data, KEmptyType, 11 ) ;
	if ( iStatus == MSmlDmAdapter::EOk )
		{
		iLog->Log( _L("ExecuteLeafL: ExecuteCommandL Successful! %d" ), iStatus );	
		}
	else
		{
		iLog->Log( _L("ExecuteLeafL: ExecuteCommandL FetchLeafObjectL Error ! %d" ), iStatus );	
		ret = KErrGeneral ;
		}
	CleanupStack::PopAndDestroy( luid ); // luid
	CleanupStack::PopAndDestroy(); // data
	CleanupStack::PopAndDestroy(); // nodename
	
	iLog->Log( _L("ExecuteLeafL: Test Complete with status %d" ), ret );	

    return ret;
	}
Example #10
0
void Cdmatest::FetchNodeResultsL( TInt /*aResultsRef*/, CBufBase& aObject,
							  const TDesC8& /*aType*/ )
	{
	TPtrC8 ptr( aObject.Ptr( 0 ) );	
	iLog->Log( _L8("FetchNodeResultsL for '%S': '%S'" ), iURI, &ptr );
	
	if ( ptr.Length() > 0 )
		{
		TPtrC8 last( LastURISeg( ptr ) );
		HBufC8 *oldUri = HBufC8::NewL( iURI->Length() );
		(*oldUri) = *iURI; 
		do 
			{
			iLog->Log ( _L8( " Node: '%S' "), &last );
			HBufC8 *nUri = HBufC8::NewLC( oldUri->Length() + 1 + last.Length() );
			nUri->Des().Copy( *oldUri ) ;
			nUri->Des().Append( '/' );
			nUri->Des().Append( last );
			
			SetURIL( nUri );
			//iResultsFunction = FetchNodeResultsL;
			
		    //TPtrC8 parentURI(RemoveLastSeg(*nUri));
		    //HBufC8 *luid = GetLuidAllocLC( parentURI );
		    CleanupStack::Pop( nUri );
			
			HBufC8 *luid = GetLuidAllocLC( *iURI );
			
			Adapter()->ChildURIListL( *nUri, KNullDesC8, *iEmptyMappingInfoArray, 4, 5 );//Dipak
			
			CleanupStack::PopAndDestroy( luid ); 			
			
			ptr.Set( RemoveLastURISeg( ptr ) );
			last.Set( LastURISeg( ptr ) );
			
			}
		while (last != KNullDesC8);	
		}
	
	}
Example #11
0
 static Adapter GetDefaultAdapter( const Allocator& )
 {
     return Adapter();
 }
Example #12
0
 static Adapter GetCopiedAdapter( const Allocator& a )
 {
     // Adapters take the container in the constructor
     return Adapter( Container( a ) );
 }
Example #13
0
void GSSettingsDlg::OnInit()
{
    __super::OnInit();

    CComPtr<IDirect3D9> d3d9;

    d3d9.Attach(Direct3DCreate9(D3D_SDK_VERSION));

    CComPtr<IDXGIFactory1> dxgi_factory;

    if(GSUtil::CheckDXGI())
    {
        CreateDXGIFactory1(__uuidof(IDXGIFactory1), (void**)&dxgi_factory);
    }
    adapters.clear();
    adapters.push_back(Adapter("Default Hardware Device", "default", GSUtil::CheckDirect3D11Level(NULL, D3D_DRIVER_TYPE_HARDWARE)));
    adapters.push_back(Adapter("Reference Device", "ref", GSUtil::CheckDirect3D11Level(NULL, D3D_DRIVER_TYPE_REFERENCE)));

    if(dxgi_factory)
    {
        for(int i = 0;; i++)
        {
            CComPtr<IDXGIAdapter1> adapter;

            if(S_OK != dxgi_factory->EnumAdapters1(i, &adapter))
                break;

            DXGI_ADAPTER_DESC1 desc;

            HRESULT hr = adapter->GetDesc1(&desc);

            if(S_OK == hr)
            {
                D3D_FEATURE_LEVEL level = GSUtil::CheckDirect3D11Level(adapter, D3D_DRIVER_TYPE_UNKNOWN);
                // GSDX isn't unicode!?
#if 1
                int size = WideCharToMultiByte(CP_ACP, 0, desc.Description, sizeof(desc.Description), NULL, 0, NULL, NULL);
                char *buf = new char[size];
                WideCharToMultiByte(CP_ACP, 0, desc.Description, sizeof(desc.Description), buf, size, NULL, NULL);
                adapters.push_back(Adapter(buf, GSAdapter(desc), level));
                delete[] buf;
#else
                adapters.push_back(Adapter(desc.Description, GSAdapter(desc), level));
#endif
            }
        }
    }
    else if(d3d9)
    {
        int n = d3d9->GetAdapterCount();
        for(int i = 0; i < n; i++)
        {
            D3DADAPTER_IDENTIFIER9 desc;

            if(D3D_OK != d3d9->GetAdapterIdentifier(i, 0, &desc))
                break;

            // GSDX isn't unicode!?
#if 0
            wchar_t buf[sizeof desc.Description * sizeof(WCHAR)];
            MultiByteToWideChar(CP_ACP /* I have no idea if this is right */, 0, desc.Description, sizeof(desc.Description), buf, sizeof buf / sizeof *buf);
            adapters.push_back(Adapter(buf, GSAdapter(desc), (D3D_FEATURE_LEVEL)0));
#else
            adapters.push_back(Adapter(desc.Description, GSAdapter(desc), (D3D_FEATURE_LEVEL)0));
#endif
        }
    }

    std::string adapter_setting = theApp.GetConfig("Adapter", "default");
    vector<GSSetting> adapter_settings;
    unsigned int adapter_sel = 0;

    for(unsigned int i = 0; i < adapters.size(); i++)
    {
        if(adapters[i].id == adapter_setting)
        {
            adapter_sel = i;
        }

        adapter_settings.push_back(GSSetting(i, adapters[i].name.c_str(), ""));
    }

    std::string ocldev = theApp.GetConfig("ocldev", "");

    unsigned int ocl_sel = 0;

    for(unsigned int i = 0; i < m_ocl_devs.size(); i++)
    {
        if(ocldev == m_ocl_devs[i].name)
        {
            ocl_sel = i;

            break;
        }
    }

    ComboBoxInit(IDC_ADAPTER, adapter_settings, adapter_sel);
    ComboBoxInit(IDC_OPENCL_DEVICE, m_ocl_devs, ocl_sel);

    UpdateRenderers();

    ComboBoxInit(IDC_INTERLACE, theApp.m_gs_interlace, theApp.GetConfig("Interlace", 7)); // 7 = "auto", detects interlace based on SMODE2 register
    ComboBoxInit(IDC_UPSCALE_MULTIPLIER, theApp.m_gs_upscale_multiplier, theApp.GetConfig("upscale_multiplier", 1));
    ComboBoxInit(IDC_AFCOMBO, theApp.m_gs_max_anisotropy, theApp.GetConfig("MaxAnisotropy", 0));
    ComboBoxInit(IDC_FILTER, theApp.m_gs_filter, theApp.GetConfig("filter", 2));
    ComboBoxInit(IDC_ACCURATE_BLEND_UNIT, theApp.m_gs_acc_blend_level, theApp.GetConfig("accurate_blending_unit", 1));
    ComboBoxInit(IDC_CRC_LEVEL, theApp.m_gs_crc_level, theApp.GetConfig("crc_hack_level", 3));

    CheckDlgButton(m_hWnd, IDC_PALTEX, theApp.GetConfig("paltex", 0));
    CheckDlgButton(m_hWnd, IDC_LOGZ, theApp.GetConfig("logz", 1));
    CheckDlgButton(m_hWnd, IDC_FBA, theApp.GetConfig("fba", 1));
    CheckDlgButton(m_hWnd, IDC_AA1, theApp.GetConfig("aa1", 0));
    CheckDlgButton(m_hWnd, IDC_MIPMAP, theApp.GetConfig("mipmap", 1));
    CheckDlgButton(m_hWnd, IDC_ACCURATE_DATE, theApp.GetConfig("accurate_date", 0));
    CheckDlgButton(m_hWnd, IDC_TC_DEPTH, theApp.GetConfig("texture_cache_depth", 0));

    // Shade Boost
    CheckDlgButton(m_hWnd, IDC_SHADEBOOST, theApp.GetConfig("ShadeBoost", 0));

    // FXAA shader
    CheckDlgButton(m_hWnd, IDC_FXAA, theApp.GetConfig("Fxaa", 0));

    // External FX shader
    CheckDlgButton(m_hWnd, IDC_SHADER_FX, theApp.GetConfig("shaderfx", 0));
    SendMessage(GetDlgItem(m_hWnd, IDC_SHADER_FX_EDIT), WM_SETTEXT, 0, (LPARAM)theApp.GetConfig("shaderfx_glsl", "shaders\\GSdx.fx").c_str());
    SendMessage(GetDlgItem(m_hWnd, IDC_SHADER_FX_CONF_EDIT), WM_SETTEXT, 0, (LPARAM)theApp.GetConfig("shaderfx_conf", "shaders\\GSdx_FX_Settings.ini").c_str());

    // Hacks
    CheckDlgButton(m_hWnd, IDC_HACKS_ENABLED, theApp.GetConfig("UserHacks", 0));

    SendMessage(GetDlgItem(m_hWnd, IDC_RESX), UDM_SETRANGE, 0, MAKELPARAM(8192, 256));
    SendMessage(GetDlgItem(m_hWnd, IDC_RESX), UDM_SETPOS, 0, MAKELPARAM(theApp.GetConfig("resx", 1024), 0));

    SendMessage(GetDlgItem(m_hWnd, IDC_RESY), UDM_SETRANGE, 0, MAKELPARAM(8192, 256));
    SendMessage(GetDlgItem(m_hWnd, IDC_RESY), UDM_SETPOS, 0, MAKELPARAM(theApp.GetConfig("resy", 1024), 0));

    SendMessage(GetDlgItem(m_hWnd, IDC_SWTHREADS), UDM_SETRANGE, 0, MAKELPARAM(16, 0));
    SendMessage(GetDlgItem(m_hWnd, IDC_SWTHREADS), UDM_SETPOS, 0, MAKELPARAM(theApp.GetConfig("extrathreads", 0), 0));

    AddTooltip(IDC_FILTER);
    AddTooltip(IDC_CRC_LEVEL);
    AddTooltip(IDC_PALTEX);
    AddTooltip(IDC_ACCURATE_DATE);
    AddTooltip(IDC_ACCURATE_BLEND_UNIT);
    AddTooltip(IDC_TC_DEPTH);
    AddTooltip(IDC_AFCOMBO);
    AddTooltip(IDC_AA1);
    AddTooltip(IDC_MIPMAP);
    AddTooltip(IDC_SWTHREADS);
    AddTooltip(IDC_SWTHREADS_EDIT);
    AddTooltip(IDC_SHADEBOOST);
    AddTooltip(IDC_SHADER_FX);
    AddTooltip(IDC_FXAA);
    AddTooltip(IDC_FBA);
    AddTooltip(IDC_LOGZ);

    UpdateControls();
}
Example #14
0
TInt Cdmatest::CommitAtomicL( CStifItemParser& /*aItem*/ )	
	{
	TRAPD( err, Adapter()->CommitAtomicL() ) ;
	iLog->Log( _L("RollbackAtomicL: Atomic commited resulting error %d" ), err );	
    return err;
	}
Example #15
0
TInt Cdmatest::StartAtomicL( CStifItemParser& /*aItem*/ )	
	{
	TRAPD( err, Adapter()->StartAtomicL() ) ;
	iLog->Log( _L("StartAtomicL: Atomic started resulting error %d" ), err );	
    return err;
	}
Example #16
0
 transform_iterator(const Adapter &adapter, const Iterator &iter)
   noexcept(noexcept(Iterator(iter))
       && noexcept(Adapter(adapter)))
   : Iterator(iter)
   , Adapter(adapter)
 { }