Пример #1
0
// ---------------------------------------------------------------------------
// SetTransparencyAlphaChannel
// ---------------------------------------------------------------------------
//
void CAlfWindow::SetTransparencyAlphaChannel(TBool aActive)
    {
    if ( WsInfo().iNodeType != MWsWindowTreeNode::EWinTreeNodeClient )
        {
        return;
        }

    if (!IsInsertedToScene())
        {
        iData->iTransparencyAlphaChannel = aActive;
        return;        
        }
        
    TAlfWServInfo wservInfo = WsInfo();

    TInt offset;
    TAlfWindowAttributes* windowAttributes = CreateWindowAttributes(offset);
    if ( windowAttributes )
        {
        windowAttributes->iActive = aActive; 
        windowAttributes->iScreenNumber = wservInfo.iScreenNumber;
        
        TAlfBridgerData d;
        d.Set(EAlfDSSetTransparencyAlphaChannel, 
            wservInfo.iRefId.iWindowGroupId, 
            wservInfo.iRefId.iWindowIdentifer, 
            (TAny*)offset); 

        if (iData->iWindowManager->PostIt(d))
            {
            iData->iTransparencyAlphaChannel = aActive;
            }
        }
    }
Пример #2
0
// ---------------------------------------------------------------------------
// PostBuffer
// ---------------------------------------------------------------------------
//
void CAlfWindow::PostBuffer( TAny* aPtr, TInt aSize, TInt aNodeFlags )
    {
    TAlfWServInfo wservInfo = WsInfo();
    TInt offset;
    TAlfWindowCommandBufferAttributes* windowCommandBuffer = CreateWindowCommandBufferAttributes(offset);
           
    if (windowCommandBuffer)
        {
        windowCommandBuffer->iBufferLength = aSize;
        windowCommandBuffer->iBuffer = aPtr;
        windowCommandBuffer->iEmptyThisBuffer = ETrue;
        windowCommandBuffer->iPartStatus = TAlfWindowCommandBufferAttributes::EPartComplete;
        windowCommandBuffer->iWindowNodeFlags = aNodeFlags;
        

        TAlfBridgerData d;
        d.Set(EAlfDSPostCanvasBuffer, 
            wservInfo.iRefId.iWindowGroupId, 
            wservInfo.iRefId.iWindowIdentifer, 
            (TAny*)offset); 

        if (iData->iWindowManager->PostIt(d))
            {
            // ???
            }
        }
    }
Пример #3
0
// ---------------------------------------------------------------------------
// IncludeToVisibilityCalculation
// ---------------------------------------------------------------------------
//
void CAlfWindow::IncludeToVisibilityCalculation(TBool aActive)
    {
    if (!IsInsertedToScene())
        {
        iData->iIncludeToVisibilityCalculation = aActive;
        return;
        }

    TAlfWServInfo wservInfo = WsInfo();

    TInt offset;
    TAlfWindowAttributes* windowAttributes = CreateWindowAttributes(offset);
    if ( windowAttributes )
        {
        windowAttributes->iActive = aActive; 
        windowAttributes->iScreenNumber = wservInfo.iScreenNumber;
        windowAttributes->iWindowNodeType = wservInfo.iNodeType; 
        
        TAlfBridgerData d;
        d.Set(EAlfDSIncludeToVisibilityCalculation, 
            wservInfo.iRefId.iWindowGroupId, 
            wservInfo.iRefId.iWindowIdentifer, 
            (TAny*)offset); 

        if (iData->iWindowManager->PostIt(d))
            {
            iData->iIncludeToVisibilityCalculation = aActive;
            }
        }
    }
Пример #4
0
// ---------------------------------------------------------------------------
// SetPos
// ---------------------------------------------------------------------------
//
EXPORT_C void CAlfWindow::SetPos(TPoint aPos, TUint aDuration)
    {
    if (!IsInsertedToScene())
     	{
        iData->iPosition = aPos;
     	return;
     	}

    TAlfWServInfo wservInfo = WsInfo();
    TInt offset;
    TAlfWindowAttributes* windowAttributes = CreateWindowAttributes(offset);
    if (windowAttributes)
        {
        windowAttributes->iPosition = aPos;
        windowAttributes->iTransitionTime = aDuration; 
        windowAttributes->iScreenNumber = wservInfo.iScreenNumber;

        TAlfBridgerData d;
        d.Set(EAlfDSSetWindowPos, 
            wservInfo.iRefId.iWindowGroupId, 
            wservInfo.iRefId.iWindowIdentifer, 
            (TAny*)offset ); 

        if (iData->iWindowManager->PostIt(d))
            {
            iData->iPosition = aPos;
            }
        }
    iData->iPosition = aPos; // TODO: This breaks the animation loop
    }
Пример #5
0
// ---------------------------------------------------------------------------
// SetLayerUsesAplhaFlag
// ---------------------------------------------------------------------------
//
EXPORT_C void CAlfWindow::SetLayerUsesAplhaFlag( TBool aEnabled )
    {
    if (!IsInsertedToScene())
        {
        iData->iLayerUsesAlphaFlagEnabled = aEnabled;
        return;
        }

    TAlfWServInfo wservInfo = WsInfo();

    TInt offset;
    TAlfWindowAttributes* windowAttributes = CreateWindowAttributes(offset);
        
    if (windowAttributes)
        {
        windowAttributes->iLayerUsesAlphaFlagEnabled = aEnabled;
        windowAttributes->iScreenNumber = wservInfo.iScreenNumber;
        
        TAlfBridgerData d;
        d.Set(EAlfDsLayerUsesAlphaFlagChanged, 
            wservInfo.iRefId.iWindowGroupId, 
            wservInfo.iRefId.iWindowIdentifer, 
            (TAny*)offset); 

        if (iData->iWindowManager->PostIt(d))
            {
            iData->iLayerUsesAlphaFlagEnabled = aEnabled;
            }
        }    
    }
Пример #6
0
// ---------------------------------------------------------------------------
// Move
// ---------------------------------------------------------------------------
//
EXPORT_C void CAlfWindow::Move(TUint aIndex)
    {
    if (!IsInsertedToScene())
     	{
     	return;
     	}

    TAlfWServInfo wservInfo = WsInfo();

    TInt offset;
    TAlfWindowAttributes* windowAttributes = CreateWindowAttributes(offset);
    if ( windowAttributes )
        {
        windowAttributes->iOrdinalPosition = aIndex; 
        windowAttributes->iScreenNumber = wservInfo.iScreenNumber;
        
        TAlfBridgerData d;
        d.Set(EAlfDSReorder, 
            wservInfo.iRefId.iWindowGroupId, 
            wservInfo.iRefId.iWindowIdentifer, 
            (TAny*)offset ); 
        
        if (iData->iWindowManager->PostIt(d) == KErrNone)
            {
            iData->iIndex = aIndex; // ToDo: if app gives out of bounds val, it is modified in 
                                    // alf scene and this member is set to wrong value
            }
        }
    }
Пример #7
0
// ---------------------------------------------------------------------------
// SetActive
// ---------------------------------------------------------------------------
//
EXPORT_C void CAlfWindow::SetActive(TBool aVisible)
    {
    if (!IsInsertedToScene())
     	{
     	iData->iIsActive = aVisible;
     	}

    TAlfWServInfo wservInfo = WsInfo();

    TInt offset;
    TAlfWindowAttributes* windowAttributes = CreateWindowAttributes(offset);
    if ( windowAttributes )
        {
        windowAttributes->iActive = aVisible; 
        windowAttributes->iScreenNumber = wservInfo.iScreenNumber;
        
        TAlfBridgerData d;
        d.Set(EAlfDSSetWindowActive, 
            wservInfo.iRefId.iWindowGroupId, 
            wservInfo.iRefId.iWindowIdentifer, 
            (TAny*)offset); 

        if (iData->iWindowManager->PostIt(d))
            {
            iData->iIsActive = aVisible;
            }
        }

    //SetOpacity(aVisible?1.0f:0.0f, 500);
    }
Пример #8
0
// ---------------------------------------------------------------------------
// SetNodeTracking
// ---------------------------------------------------------------------------
//
void CAlfWindow::SetNodeTracking( TInt aValue )
    {
    TAlfBridgerData d;
    TAlfWServInfo wservInfo = WsInfo();
      
    d.Set(EAlfDSSetNodeTracking, 
        wservInfo.iRefId.iWindowIdentifer,
        aValue,
        NULL);
    iData->iWindowManager->PostIt(d);
    }
Пример #9
0
//------------------------------------------------------------------------------
// Init
//
void FunctionGroupWidget::Init(const QStringList& groupShortNames) 
{
  m_model.clear();

  QList<QStandardItem*> items;
  foreach (const QString shortName, groupShortNames)
  {
    QStandardItem* item = new QStandardItem(WsInfo().FullName(shortName));
    item->setData(shortName);
    items << item;
  }
Пример #10
0
// ---------------------------------------------------------------------------
// SetWindowArea
// ---------------------------------------------------------------------------
//
void CAlfWindow::SetWindowArea(const TPoint& aOrigin, const TRegion& aRegion)
    {
    if ( WsInfo().iNodeType != MWsWindowTreeNode::EWinTreeNodeClient )
        {
        return;
        }
        
    if (!IsInsertedToScene())
     	{
     	// Cache data to be able to send once this is inserted to scene
        iData->iWindowAreaOrigin = aOrigin;
        iData->iWindowArea.Copy(aRegion);
        if ( iData->iWindowArea.CheckError() )
            {
            iData->iWindowArea.Clear();
            }
     	return;
     	}

    TAlfWServInfo wservInfo = WsInfo();
    TInt offset = 0;
    TAny* data = NULL;
    
    TRAP_IGNORE(data = CreateSetWindowAreaL( offset, wservInfo.iScreenNumber, aOrigin, aRegion ));  
    
    if (data)
        {
        TAlfBridgerData d;
        d.Set(EAlfDSSetWindowArea, 
            wservInfo.iRefId.iWindowGroupId, 
            wservInfo.iRefId.iWindowIdentifer, 
            (TAny*)offset); 

        iData->iWindowManager->PostIt(d);
        }
    }
Пример #11
0
//------------------------------------------------------------------------------
// OnBrowse
//
void WsdlFileView::OnBrowse()
{
  QString seedFile = QSettings().value(WsInfo().WsdlFileNameKey(m_host), QVariant()).toString();

  // Load file
  QString fileName = QFileDialog::getOpenFileName(this, QString("Select %1 WSDL File").arg(m_host), seedFile, "WSDL (*.wsdl);; All (*.*)");

  if (fileName.isEmpty())
    return;

  ui.WsdlFileNameLabel->setText(QFileInfo(fileName).fileName());
  ui.WsdlFileNameLabel->setToolTip(QDir::toNativeSeparators(fileName));

  if (HeaderContainerWidget* w = qobject_cast<HeaderContainerWidget*>(parent()->parent()))
  {
    w->Header()->SetTitle(QFileInfo(fileName).fileName());
    w->Header()->setToolTip(QDir::toNativeSeparators(fileName));
  }

  QSettings().setValue(WsInfo().WsdlFileNameKey(m_host), fileName);
  WsInfo().SetWsdlFile(m_host, fileName);
  m_wsdlFile = WsInfo().Wsdl(m_host);
  OnUpdate();
}
Пример #12
0
// ---------------------------------------------------------------------------
// SetSize
// ---------------------------------------------------------------------------
//
EXPORT_C void CAlfWindow::SetSize(TSize aSize, TUint aDuration)
    {
    if (!IsInsertedToScene())
    	{
        iData->iSize = aSize;
    	return;
    	}

    if ( aSize != iData->iSize )
    	{
    	// TODO: Only texture size should be changed. not the window size at this point.
    	iData->iSize = aSize;
    	if (iData->iBufferDev)
    		{
    		iData->iBufferDev->Resize( aSize );
    		}
    	}

    TAlfWServInfo wservInfo = WsInfo();
    TInt offset;
    TAlfWindowAttributes* windowAttributes = CreateWindowAttributes(offset);
    
    if (windowAttributes)
        {
        windowAttributes->iSize = aSize;
        windowAttributes->iTransitionTime = aDuration; 
        windowAttributes->iScreenNumber = wservInfo.iScreenNumber;

        TAlfBridgerData d;
        d.Set(EAlfDSSetWindowSize, 
            wservInfo.iRefId.iWindowGroupId, 
            wservInfo.iRefId.iWindowIdentifer, 
            (TAny*)offset); 

        if (iData->iWindowManager->PostIt(d))
            {
            iData->iSize = aSize;
            }
        }
    }
Пример #13
0
// ---------------------------------------------------------------------------
// ClearFlag
// ---------------------------------------------------------------------------
//
void CAlfWindow::ClearFlag( TInt aFlag )
    {
    iData->iFlags &= ~aFlag;
    
    TAlfWServInfo wservInfo = WsInfo();

    TInt offset;
    TAlfWindowAttributes* windowAttributes = CreateWindowAttributes(offset);
    if ( windowAttributes )
        {
        windowAttributes->iActive = aFlag;  // transporting this in iActive field
        windowAttributes->iScreenNumber = wservInfo.iScreenNumber;
        
        TAlfBridgerData d;
        d.Set(EAlfDSClearWindowFlag, 
            wservInfo.iRefId.iWindowGroupId, 
            wservInfo.iRefId.iWindowIdentifer, 
            (TAny*)offset); 

        iData->iWindowManager->PostIt(d);
        }
    }
Пример #14
0
// ---------------------------------------------------------------------------
// PostBuffer
// ---------------------------------------------------------------------------
//
void CAlfWindow::PostPartialBuffer( TAny* aPtr, TInt aSize, TBool aPartial, TBool aLastPart, TBool aEmptyBuffers, TInt aNodeFlags )
    {
    TAlfWServInfo wservInfo = WsInfo();
    TInt offset;
    TAlfWindowCommandBufferAttributes* windowCommandBuffer = CreateWindowCommandBufferAttributes(offset);
    if (windowCommandBuffer)
        {
        windowCommandBuffer->iBufferLength = aSize;
        windowCommandBuffer->iBuffer = aPtr;
        windowCommandBuffer->iEmptyThisBuffer = aEmptyBuffers;
        windowCommandBuffer->iWindowNodeFlags = aNodeFlags;
        windowCommandBuffer->iScreenNumber = wservInfo.iScreenNumber;
        if ( aLastPart && aPartial )
        	{
        	windowCommandBuffer->iPartStatus = TAlfWindowCommandBufferAttributes::ELastPart;
        	}
        else if ( aPartial )
        	{
        	windowCommandBuffer->iPartStatus = TAlfWindowCommandBufferAttributes::ENotComplete;
        	}
        else if (!aPartial)
        	{
        	windowCommandBuffer->iPartStatus = TAlfWindowCommandBufferAttributes::EPartComplete;
        	}
        
        TAlfBridgerData d;
        d.Set(EAlfDSPostCanvasBuffer, 
        		wservInfo.iRefId.iWindowGroupId, 
        		wservInfo.iRefId.iWindowIdentifer, 
        		(TAny*)offset ); 

        if (iData->iWindowManager->PostIt(d))
            {
            // ???
            }
        }
    
    }
Пример #15
0
// ---------------------------------------------------------------------------
// SetSurfaceExtent
// ---------------------------------------------------------------------------
//
EXPORT_C void CAlfWindow::SetSurfaceExtent(const TRect& aRect)
    {
    if (!IsInsertedToScene())
     	{
        iData->iSurfaceExtent = aRect;
     	return;
     	}

    TAlfWServInfo wservInfo = WsInfo();

    TInt offset;
    TAlfWindowAttributes* windowAttributes = CreateWindowAttributes(offset);
        
    if (windowAttributes)
        {
        // Setting the extent rectangle in one command fails in armv5 if the alignment is not
        // divisible by 8 (maybe 4 would be enough).
        // Therefore the corners must be set one by one. That succeeds even if the address
        // is not aligned.
//        windowAttributes->iSurfaceExtent = aRect;
        windowAttributes->iSurfaceExtent.iTl.iX = aRect.iTl.iX;
        windowAttributes->iSurfaceExtent.iTl.iY = aRect.iTl.iY;
        windowAttributes->iSurfaceExtent.iBr.iX = aRect.iBr.iX;
        windowAttributes->iSurfaceExtent.iBr.iY = aRect.iBr.iY;
        windowAttributes->iScreenNumber = wservInfo.iScreenNumber;

        TAlfBridgerData d;
        d.Set(EAlfDSSetSurfaceExtent, 
            wservInfo.iRefId.iWindowGroupId, 
            wservInfo.iRefId.iWindowIdentifer, 
            (TAny*)offset); 

        if (iData->iWindowManager->PostIt(d))
            {
        	iData->iSurfaceExtent = aRect;
            }
        }
    }
Пример #16
0
//------------------------------------------------------------------------------
// WsdlFileView
//
WsdlFileView::WsdlFileView(const QString& host, QWidget* parent)
  : QWidget(parent),
  m_host(host),
  m_wsdlFile(WsInfo().Wsdl(host))
{
  ui.setupUi(this);

  ui.TableView->setModel(&m_model);
  ui.TableView->horizontalHeader()->hide();
  ui.TableView->verticalHeader()->hide();
  ui.TableView->horizontalHeader()->setStretchLastSection(true);
  ui.TableView->setEditTriggers(QAbstractItemView::NoEditTriggers);
  connect(ui.TableView, SIGNAL(doubleClicked(const QModelIndex&)), this, SLOT(OnMethodDoubleClicked(const QModelIndex&)));

  ui.WsdlFileNameLabel->setText(QFileInfo(m_wsdlFile->FileName()).fileName());
  ui.WsdlFileNameLabel->setToolTip(QDir::toNativeSeparators(m_wsdlFile->FileName()));

  connect(ui.BrowseBtn, SIGNAL(clicked()), this, SLOT(OnBrowse()));
  connect(&m_model, SIGNAL(itemChanged(QStandardItem*)), this, SLOT(OnModelChanged(QStandardItem*)));
  connect(m_wsdlFile, SIGNAL(WsdlMethodUpdated()), this, SLOT(OnWsdlMethodUpdated()));

  // force update after the m_wsdlFile has been parsed and instantiated in its constructor
  QTimer::singleShot(0, this, SLOT(OnUpdate()));
}