Exemplo n.º 1
0
void
ImportLoader::Updater::UpdateSpanningTree(nsINode* aNode)
{
  if (mLoader->mReady || mLoader->mStopped) {
    // Scripts already executed, nothing to be done here.
    return;
  }

  if (mLoader->mLinks.Length() == 1) {
    // If this is the first referrer, let's mark it.
    mLoader->mMainReferrer = 0;
    return;
  }

  nsTArray<nsINode*> newReferrerChain;
  GetReferrerChain(aNode, newReferrerChain);
  if (ShouldUpdate(newReferrerChain)) {
    UpdateMainReferrer(mLoader->mLinks.Length() - 1);
    UpdateDependants(aNode, newReferrerChain);
  }
}
Exemplo n.º 2
0
		void Rectangle::SetHeight(float height)
		{
			m_dimensions.y = height;
			ShouldUpdate();
		}
Exemplo n.º 3
0
		void Rectangle::SetWidth(float width)
		{
			m_dimensions.x = width;
			ShouldUpdate();
		}
Exemplo n.º 4
0
		void Rectangle::SetDimensions(const glm::vec2& dimensions)
		{
			m_dimensions = dimensions;
			ShouldUpdate();
		}
Exemplo n.º 5
0
void
CMVarNode::Receive
	(
	JBroadcaster*	sender,
	const Message&	message
	)
{
	if (sender == CMGetLink() && ShouldUpdate(message))
		{
		// root node only

		if (itsShouldUpdateFlag)
			{
			UpdateChildren();
			}
		else
			{
			itsNeedsUpdateFlag = kJTrue;
			}
		}

	else if (sender == itsValueCommand &&
			 message.Is(CMVarCommand::kValueUpdated))
		{
		const CMVarCommand::ValueMessage& info =
			dynamic_cast<const CMVarCommand::ValueMessage&>(message);

		SetValid(kJTrue);
		Update(info.GetRootNode());
		}
	else if (sender == itsValueCommand &&
			 message.Is(CMVarCommand::kValueFailed))
		{
		SetValue(itsValueCommand->GetData());
		MakePointer(kJFalse);
		}

	else if (sender == itsContentCommand &&
			 message.Is(CMVarCommand::kValueUpdated))
		{
		const CMVarCommand::ValueMessage& info =
			dynamic_cast<const CMVarCommand::ValueMessage&>(message);

		CMVarNode* root = info.GetRootNode();

		// value or pointer

		if (!root->HasChildren())
			{
			DeleteAllChildren();
			CMVarNode* child = (CMGetLink())->CreateVarNode(this, root->GetName(),
															root->GetFullName(),
															root->GetValue());
			assert( child != NULL );
			child->MakePointer(root->itsIsPointerFlag);
			}

		// struct or static array

		else if (SameElements(root))
			{
			MergeChildren(root);
			}
		else
			{
			StealChildren(root);
			}
		}
	else if (sender == itsContentCommand &&
			 message.Is(CMVarCommand::kValueFailed))
		{
		DeleteAllChildren();
		CMVarNode* child = (CMGetLink())->CreateVarNode(this, "", "", itsContentCommand->GetData());
		assert( child != NULL );
		child->SetValid(kJFalse);
		}

	else
		{
		JNamedTreeNode::Receive(sender, message);
		}
}