2009-10-14 05:48:24 +02:00
|
|
|
/*
|
|
|
|
|
QueryFocus - management of current scope within the Session
|
|
|
|
|
|
|
|
|
|
Copyright (C) Lumiera.org
|
|
|
|
|
2009, Hermann Vosseler <Ichthyostega@web.de>
|
|
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
|
modify it under the terms of the GNU General Public License as
|
|
|
|
|
published by the Free Software Foundation; either version 2 of the
|
|
|
|
|
License, or (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
|
|
* *****************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "proc/mobject/session/query-focus.hpp"
|
|
|
|
|
//#include "proc/mobject/session/track.hpp"
|
|
|
|
|
//#include "proc/mobject/placement.hpp"
|
|
|
|
|
//#include "proc/mobject/session/mobjectfactory.hpp"
|
|
|
|
|
//#include "proc/asset/track.hpp"
|
|
|
|
|
|
|
|
|
|
namespace mobject {
|
|
|
|
|
namespace session {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** TODO??? */
|
|
|
|
|
QueryFocus::QueryFocus()
|
|
|
|
|
{ }
|
|
|
|
|
|
|
|
|
|
|
2009-11-20 22:00:15 +01:00
|
|
|
/** */
|
|
|
|
|
ScopePath&
|
|
|
|
|
QueryFocus::currPath()
|
|
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED ("dereference and access the current scope path");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ScopePath const&
|
|
|
|
|
QueryFocus::currPath() const
|
|
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED ("dereference and access the current scope path");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2009-10-20 05:34:58 +02:00
|
|
|
/** discard any state and clear
|
|
|
|
|
the current focus path */
|
|
|
|
|
QueryFocus&
|
|
|
|
|
QueryFocus::reset ()
|
|
|
|
|
{
|
|
|
|
|
scopes_.clear();
|
|
|
|
|
return *this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2009-10-20 04:31:50 +02:00
|
|
|
/** attach this QueryFocus to a container-like scope,
|
|
|
|
|
causing it to \em navigate, changing the
|
|
|
|
|
current ScopePath as a side-effect
|
|
|
|
|
*/
|
|
|
|
|
QueryFocus&
|
|
|
|
|
QueryFocus::attach (Scope const& container)
|
|
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED ("navigate this focus to attach to the given container scop");
|
|
|
|
|
return *this;
|
|
|
|
|
}
|
2009-10-14 05:48:24 +02:00
|
|
|
|
|
|
|
|
|
2009-10-20 04:31:50 +02:00
|
|
|
/** push the "current QueryFocus" aside and open a new focus frame.
|
|
|
|
|
This new QueryFocus will act as "current" until going out of scope
|
|
|
|
|
*/
|
|
|
|
|
QueryFocus
|
|
|
|
|
QueryFocus::push (Scope const& otherContainer)
|
|
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED ("push current, open a new QueryFocus frame");
|
|
|
|
|
QueryFocus newFocus; // = do push and open new frame
|
|
|
|
|
newFocus.attach (otherContainer);
|
|
|
|
|
return newFocus;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** cease to use \em this specific reference to the current frame.
|
2009-11-20 22:00:15 +01:00
|
|
|
This operation immediately tries to re-attach to what is "current"
|
|
|
|
|
and readjusts the internal handle. But when the previously released
|
|
|
|
|
reference was the last one, releasing it will cause the QueryFocusStack
|
|
|
|
|
to pop, in which case we'll re-attach to the now uncovered previous stack top.
|
2009-10-20 04:31:50 +02:00
|
|
|
*/
|
2009-11-20 22:00:15 +01:00
|
|
|
QueryFocus&
|
2009-10-20 04:31:50 +02:00
|
|
|
QueryFocus::pop()
|
|
|
|
|
{
|
2009-11-20 22:00:15 +01:00
|
|
|
UNIMPLEMENTED ("pop, give up one reference, maybe drop stack top");
|
|
|
|
|
return *this;
|
2009-10-20 04:31:50 +02:00
|
|
|
}
|
|
|
|
|
|
2009-10-14 05:48:24 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
}} // namespace mobject::session
|