2017-09-03 01:04:00 +02:00
/*
ID - SCHEME . hpp - naming and ID scheme definitions for the GUI
Copyright ( C ) Lumiera . org
2017 , 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 0213 9 , USA .
*/
/** @file id-scheme.hpp
* * Hard wired definitions for the object identification system used within the UI .
* *
* * # Identities and element addressing
* *
* * Within the UI - Layer , all components of global relevance are connected to the [ UI - Bus ] ( \ ref ui - bus . hpp )
* * and can thus be reached just by knowing their ID . This allows to address such UI components as
* * [ generic UI - Element ] ( \ ref model : : Tangible ) , relying on a generic element manipulation protocol .
* * Beyond this rather unspecific manipulation scheme , the UI relies on direct ownership relations .
* * Typically , some element is created as result of another action and managed as child of some
* * maintaining entity ; generally speaking , UI elements live _free floating_ and are mostly
* * interconnected by signals to react on user interaction . There is a rather limited
* * [ global UI - Context ] ( \ ref GlobalCtx ) of directly interconnected backbone services ,
* * which allow to achieve activities cross - cutting the ownership relationship .
* *
* * Element IDs are always formed as EntryID , typed to the corresponding type in the Session model .
* * Thus , starting from a given model element , it is always possible to " cast " some message towards
* * the corresponding UI view element , without actually knowing much about that element ' s implementation .
* *
* * @ note This header provides the basic definitions for easily accessing relevant UI elements .
* *
* * @ see interaction - director . hpp
* * @ see ui - bus . hpp
* * @ see tangible . hpp
* * @ see bus - term . hpp
* * @ see entry - id . hpp
* *
*/
# ifndef GUI_ID_SCHEME_H
# define GUI_ID_SCHEME_H
# include "lib/symbol.hpp"
# include "lib/idi/entry-id.hpp"
2018-01-15 03:56:02 +01:00
# include "gui/interact/view-spec-dsl.hpp"
2017-09-03 01:04:00 +02:00
/* === forward declarations === */
namespace proc {
namespace asset {
class Timeline ;
}
}
namespace gui {
namespace timeline {
class TimelineController ;
}
namespace widget {
class ErrorLogWidget ;
}
namespace idi {
using lib : : Literal ;
using lib : : idi : : EntryID ;
using ID = lib : : idi : : BareEntryID const & ;
/* === primary component view types === */
using TimelineView = timeline : : TimelineController ;
using ErrorLogView = widget : : ErrorLogWidget ;
/** Generic Component View descriptors */
template < class V >
struct Descriptor
{
static_assert ( not sizeof ( V ) , " unknown generic view type " ) ;
} ;
/**
* Descriptor for the Timeline UI
*/
template < >
struct Descriptor < TimelineView >
{
using Model = proc : : asset : : Timeline ;
} ;
/**
* Descriptor for error log display within the UI
*/
template < >
struct Descriptor < ErrorLogView >
{
///////////////////////////////////////////////////////////////////////////////////////////TICKET #1105 : need a model placeholder to represent UI specific global entities
2017-09-08 03:53:52 +02:00
///////////////////////////////////////////////////////////////////////////////////////////TICKET #1105 : consider use of a DSL to configure component view access
//
2018-01-11 02:48:51 +01:00
// alloc = onePerWindow
2017-09-08 03:53:52 +02:00
// locate = within(InfoBoxPanel)
2017-09-03 01:04:00 +02:00
} ;
2017-09-08 18:50:39 +02:00
/*
///////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1105 : DSL design draft...
// Timeline
// add to group of timelines within the timelinePanel
2018-01-11 02:48:51 +01:00
alloc = unlimited
2018-01-15 03:56:02 +01:00
locate = perspective ( edit ) . panel ( timeline )
or panel ( timeline )
2017-09-08 18:50:39 +02:00
// Viewer
// here multiple alternatives are conceivable
// - allow only a single view instance in the whole application
2018-01-11 02:48:51 +01:00
alloc = onlyOne
2017-09-08 18:50:39 +02:00
locate = external ( beamer )
2018-01-15 03:56:02 +01:00
or perspective ( mediaView ) . panel ( viewer )
or panel ( viewer ) . existing ( )
or firstWindow ( ) . panel ( viewer )
2017-09-08 18:50:39 +02:00
// - allow two viewer panels (the standard layout of editing applications)
2018-01-11 02:48:51 +01:00
alloc = limitPerWindow ( 2 )
2018-01-15 03:56:02 +01:00
locate = perspective ( edit ) . panel ( viewer ) . existing ( )
or currentWindow ( ) . panel ( viewer ) . existing ( )
or panel ( viewer ) . existing ( )
or panel ( viewer )
2017-09-08 18:50:39 +02:00
// (Asset)Bin
// within the dedicated asset panel, add to the appropriate group for the kind of asset
2018-01-11 02:48:51 +01:00
alloc = unlimited
2018-01-15 03:56:02 +01:00
locate = currentWindow ( ) . perspective ( edit ) . panel ( asset ) . assetTypeGroup ( ) . existing ( )
or perspective ( asset ) . panel ( asset )
or firstWindow ( ) . panel ( asset )
2017-09-08 18:50:39 +02:00
// Error-Log
// use the current {{{InfoBoxPanel}}} if such exists, fall back to using a single view on the primary window
2018-01-11 02:48:51 +01:00
alloc = limitPerWindow ( 1 )
2018-01-15 03:56:02 +01:00
locate = currentWindow ( ) . panel ( infobox ) . existing ( )
or firstWindow ( ) . panel ( infobox )
2017-09-08 18:50:39 +02:00
*/
2017-09-03 01:04:00 +02:00
} //namespace gui::idi
} // namespace gui
# endif /*GUI_ID_SCHEME_H*/