Ejemplo n.º 1
0
bool
CanvasTreeStore::find_first_value_node(const synfig::ValueNode::Handle& value_node, Gtk::TreeIter& iter)
{
	// maybe replace the ValueNode_Const or ValueNode_Animated with the contained ValueNode_Bone
	// todo: do we need to do this in find_next_value_node, and find_*_value_desc too?
	synfig::ValueNode::Handle node(expandable_bone_parent(value_node));

	iter=children().begin();
	while(iter && node!=(ValueNode::Handle)(*iter)[model.value_node])
	{
		if(!iter->children().empty())
		{
			Gtk::TreeIter iter2(iter->children().begin());
			//! \todo confirm that the && should be done before the ||
			if((iter2 && node==(ValueNode::Handle)(*iter2)[model.value_node]) || find_next_value_node(node, iter2))
			{
				iter=iter2;
				return true;
			}
		}
		Gtk::TreeIter iter2(++iter);
		if(!iter2)
			iter==iter->parent();
		else
			iter=iter2;
	}
	return (bool)iter && node==(ValueNode::Handle)(*iter)[model.value_node];
}
Ejemplo n.º 2
0
bool
CanvasTreeStore::find_next_value_node(const synfig::ValueNode::Handle& value_node, Gtk::TreeIter& iter)
{
	if(!iter) return find_first_value_node(value_node,iter);

	if(iter) do {
		if(!iter->children().empty())
		{
			Gtk::TreeIter iter2(iter->children().begin());
			//! \todo confirm that the && should be done before the ||
			if((iter2 && value_node==(ValueNode::Handle)(*iter2)[model.value_node]) || find_next_value_node(value_node, iter2))
			{
				iter=iter2;
				return true;
			}
		}
		Gtk::TreeIter iter2(++iter);
		if(!iter2)
		{
			iter==iter->parent();
			if(iter)++iter;
		}
		else
			iter=iter2;
	} while(iter && value_node!=(ValueNode::Handle)(*iter)[model.value_node]);
	return (bool)iter && value_node==(ValueNode::Handle)(*iter)[model.value_node];
}
Ejemplo n.º 3
0
bool
CanvasTreeStore::find_first_value_desc(const synfigapp::ValueDesc& value_desc, Gtk::TreeIter& iter)
{
	iter=children().begin();
	while(iter && value_desc!=(*iter)[model.value_desc])
	{
		if(!iter->children().empty())
		{
			Gtk::TreeIter iter2(iter->children().begin());
			//! \todo confirm that the && should be done before the ||
			if((iter2 && value_desc==(*iter2)[model.value_desc]) || find_next_value_desc(value_desc, iter2))
			{
				iter=iter2;
				return true;
			}
		}
		Gtk::TreeIter iter2(++iter);
		if(!iter2)
			iter==iter->parent();
		else
			iter=iter2;
	}
	return (bool)iter && value_desc==(*iter)[model.value_desc];
}