Exemplo n.º 1
0
void StateStack::handleEvent(const sf::Event& event) {
	// Iterate until handleEvent() returns a false
	for (auto itr = mStack.rbegin(); itr != mStack.rend(); ++itr) {
		if (!(*itr)->handleEvent(event))
			break;
	}
	applyPendingChanges();
}
Exemplo n.º 2
0
//public
void StateStack::update(float dt)
{
    for (auto i = m_stack.rbegin(); i != m_stack.rend(); ++i)
    {
        if (!(*i)->update(dt)) break;
    }
    applyPendingChanges();
}
Exemplo n.º 3
0
void StateStack::handleEvent(const sf::Event& evt)
{
    for (auto i = m_stack.rbegin(); i != m_stack.rend(); ++i)
    {
        if (!(*i)->handleEvent(evt)) break;
    }
    applyPendingChanges();
}
Exemplo n.º 4
0
		// Update
	void StateStack::update(sf::Time dt)
	{
		for (auto itr = mStack.rbegin(); itr != mStack.rend(); ++itr)
			if (!(*itr)->update(dt))
				break;

		applyPendingChanges();
	}
Exemplo n.º 5
0
	// Public Method(s)
		// Handle Event
	void StateStack::handleEvent(const sf::Event& event)
	{
		for (auto itr = mStack.rbegin(); itr != mStack.rend(); ++itr)
			if (!(*itr)->handleEvent(event))
				break;

		applyPendingChanges();
	}
Exemplo n.º 6
0
void StateStack::update(sf::Time dt) {
	// Iterate until update() returns a false
	for (auto itr = mStack.rbegin(); itr != mStack.rend(); ++itr) {
		if (!(*itr)->update(dt))
			break;
	}
	applyPendingChanges();
}
void S60VideoPlayerSession::windowHandleChanged()
{
    DP0("S60VideoPlayerSession::windowHandleChanged +++");

    m_pendingChanges |= WindowHandle;
    applyPendingChanges();

    DP0("S60VideoPlayerSession::windowHandleChanged ---");
}
void S60VideoPlayerSession::aspectRatioChanged()
{
    DP0("S60VideoPlayerSession::aspectRatioChanged +++");

    m_pendingChanges |= ScaleFactors;
    applyPendingChanges();

    DP0("S60VideoPlayerSession::aspectRatioChanged ---");
}
Exemplo n.º 9
0
 void StateStack::update(float dt)
 {
     for (auto it = mStack.rbegin(); it != mStack.rend(); ++it) {
         if (!it->get()->update(dt)) {
             break;
         }
     }
     applyPendingChanges();
 }
Exemplo n.º 10
0
    void StateStack::processEvent(const cpp3ds::Event &event) {
        // Iterate from top to bottom, stop as soon as handleEvent() returns false
        for (auto itr = m_stack.rbegin(); itr != m_stack.rend(); ++itr) {
            if (!itr->pointer->processEvent(event))
                break;
        }

        applyPendingChanges();
    }
Exemplo n.º 11
0
    void StateStack::update(float delta) {
        // Iterate from top to bottom, stop as soon as update() returns false
        for (auto itr = m_stack.rbegin(); itr != m_stack.rend(); ++itr) {
            if (!itr->pointer->update(delta))
                break;
        }

        applyPendingChanges();
    }
Exemplo n.º 12
0
void StateStack::update(sf::Time dt)
{
    for(auto iter = stack.rbegin(); iter != stack.rend(); ++iter)
    {
        if(!(*iter)->update(dt))
            break;
    }
    applyPendingChanges();
}
void S60VideoPlayerSession::displayRectChanged()
{
    DP0("S60VideoPlayerSession::displayRectChanged +++");

    m_pendingChanges |= DisplayRect;
    applyPendingChanges();

    DP0("S60VideoPlayerSession::displayRectChanged ---");
}
Exemplo n.º 14
0
void StateManager::handleEvent(sf::Event const& event)
{
	for(auto itr = mStates.rbegin(); itr != mStates.rend(); itr++)
	{
		if(!(*itr)->handleEvent(event))
			break;
	}

    applyPendingChanges();
}
Exemplo n.º 15
0
void StateManager::update(sf::Time dt)
{
	for(auto itr = mStates.rbegin(); itr != mStates.rend(); itr++)
	{
		if(!(*itr)->update(dt))
			break;
	}

    applyPendingChanges();
}
Exemplo n.º 16
0
void StateStack::handleEvent(const sf::Event& event)
{
	for (auto it=stack_.rbegin(); it != stack_.rend(); ++it)
	{
		if (!(*it)->handleInput(event))
			break;
	}

	applyPendingChanges();
}
Exemplo n.º 17
0
void StateStack::handleEvent(const sf::Event& event)
{
	// Iterate from top to bottom, stop as soon as handleEvent() returns false
	for (auto itr = stack_.rbegin(); itr != stack_.rend(); ++itr)
	{
		if (!(*itr)->handleEvent(event))
			break;
	}

	applyPendingChanges();
}
Exemplo n.º 18
0
/// Update the state of the ui
void UICanvas::update(float elapsedTime)
{	
	m_surfaceContainerLock++;
	for(std::vector<UIWindow*>::reverse_iterator it = m_surfaces.rbegin(); it != m_surfaces.rend(); it++)
	{
		(*it)->update(elapsedTime);
	}
	m_surfaceContainerLock--;

	applyPendingChanges();
}
Exemplo n.º 19
0
void StateStack::update(sf::Time dt)
{
	// Iterate from top to bottom, stop as soon as update() returns false
	for (auto itr = stack_.rbegin(); itr != stack_.rend(); ++itr)
	{
		if (!(*itr)->update(dt))
			break;
	}

	applyPendingChanges();
}
void S60VideoPlayerSession::MvpuoPrepareComplete(TInt aError)
{
    DP0("S60VideoPlayerSession::MvpuoPrepareComplete +++");

    DP1("S60VideoPlayerSession::MvpuoPrepareComplete - aError:", aError);

    if (KErrNone == aError && m_stream) {
        emit accessPointChanged(m_accessPointId);
    }
    if (KErrCouldNotConnect == aError && !(m_networkAccessControl->isLastAccessPoint())) {
        load(m_UrlPath);
        return;
    }
    TInt error = aError;
    if (KErrNone == error || KErrMMPartialPlayback == error) {
        TSize originalSize;
        TRAP(error, m_player->VideoFrameSizeL(originalSize));
        if (KErrNone == error) {
            m_nativeSize = QSize(originalSize.iWidth, originalSize.iHeight);
            emit nativeSizeChanged(m_nativeSize);
            m_pendingChanges |= ScaleFactors;
#ifdef HAS_AUDIOROUTING_IN_VIDEOPLAYER
            Q_ASSERT(!m_audioOutput);
            TRAP(error, m_audioOutput = CAudioOutput::NewL(*m_player));
            if (KErrNone == error) {
                TRAP(error, m_audioOutput->RegisterObserverL(*this));
                if (KErrNone == error)
                    setActiveEndpoint(m_audioEndpoint);
            }
#endif
        }
        if (KErrNone == error) {
            applyPendingChanges(true); // force apply even though state is not Loaded
            if (KErrNone == this->error()) // applyPendingChanges() can call setError()
                loaded();
        }
    } else {
        setError(error);
    }

    DP0("S60VideoPlayerSession::MvpuoPrepareComplete ---");
}
Exemplo n.º 21
0
void UICanvas::processMouseButtonReleased(int x, int y, Mouse::Button button, UIEventResult& info)
{
	m_surfaceContainerLock++;
	bool canContinue = true;
	for(std::vector<UIWindow*>::reverse_iterator it = m_surfaces.rbegin(); it != m_surfaces.rend(); ++it)
	{
		if(canContinue)
		{
			(*it)->processMouseButtonReleased(x, y, button, info);

			if((*it)->isModal())
			{
				canContinue = false;
			}
		}
	}
	m_surfaceContainerLock --;

	applyPendingChanges();
}
Exemplo n.º 22
0
UIEventResult UICanvas::pushEvent(const Event& event)
{
	Event processedEvent = event;
	
	UIEventResult eventUsage;

	// -- Raw event delivery system
	m_surfaceContainerLock++;
	for(std::vector<UIWindow*>::reverse_iterator it = m_surfaces.rbegin(); it != m_surfaces.rend(); it++)
	{
		if((*it)->getChildCount() > 0)
		{
			// deliver the event
			(*it)->dispatchEvent(processedEvent);

			if((*it)->isModal())
			{
				eventUsage.clickPassedThrough = false;
				break;
			}
		}
	}
	m_surfaceContainerLock--;

	// -- Built-in event handling
	switch(event.type)
	{
		case Event::MouseMoved:
			{
				processMouseMove(processedEvent.mouseMove.x, processedEvent.mouseMove.y);
			}
		break;

		case Event::TouchMoved:
			{
				processTouchMove(processedEvent.touch.x, processedEvent.touch.y);
			}
			break;

		case Event::MouseButtonPressed:
			{
				bool result = processMouseButtonPressed(processedEvent.mouseButton.x, processedEvent.mouseButton.y, processedEvent.mouseButton.button);
				eventUsage.hitControls = false;
			}
		break;

		case Event::TouchPressed:
			{
				bool result = processMouseButtonPressed(processedEvent.touch.x, processedEvent.touch.y, Mouse::Left);
				eventUsage.hitControls = false;
			}
			break;

		case Event::MouseButtonReleased:
			{				
				processMouseButtonReleased(processedEvent.mouseButton.x, processedEvent.mouseButton.y, processedEvent.mouseButton.button, eventUsage);
			}
			break;
		case Event::TouchReleased:
			{				
				processMouseButtonReleased(processedEvent.touch.x, processedEvent.touch.y, Mouse::Left, eventUsage);
			}
			break;

		case Event::TextEntered:
			{
				// Deliver input to the focused control
				if(m_state.m_focusControl)
				{
					UxKeyEvent keyEvent;
					keyEvent.type = UxKeyEvent::KeyPress;
					keyEvent.unicode = processedEvent.text.unicode;
					if (keyEvent.unicode >= 32)
						m_state.m_focusControl->keyPressEvent(&keyEvent);

					//m_state.m_focusControl->onTextEvent(processedEvent.text.unicode);
				}
			}
			break;

		case Event::KeyPressed:
		{
				// Deliver input to the focused control
				if (m_state.m_focusControl)
				{
					   UxKeyEvent keyEvent;
					   keyEvent.type = UxKeyEvent::KeyPress;
					   keyEvent.key = processedEvent.key.code;
					   m_state.m_focusControl->keyPressEvent(&keyEvent);
				}
		}break;
	}

	// now that surfaces were processed, apply changes to surfaces container
	// the updates in the container are only considered in the next event, so it is not wrongly consumed
	applyPendingChanges();

	return eventUsage;
};
void S60VideoPlayerSession::rotationChanged()
{
    m_pendingChanges |= ScaleFactors;
    m_pendingChanges |= Rotation;
    applyPendingChanges();
}