2008-04-10 16:36:21 +02:00
|
|
|
/*
|
2011-02-06 21:23:34 +01:00
|
|
|
GTK-LUMIERA.hpp - The Lumiera GUI Application Object
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2008-04-11 23:04:39 +02:00
|
|
|
Copyright (C) Lumiera.org
|
|
|
|
|
2008, Joel Holdsworth <joel@airwebreathe.org.uk>
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2008-04-11 23:04:39 +02:00
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
|
modify it under the terms of the GNU General Public License as
|
2010-12-17 23:28:49 +01:00
|
|
|
published by the Free Software Foundation; either version 2 of
|
|
|
|
|
the License, or (at your option) any later version.
|
|
|
|
|
|
2008-04-11 23:04:39 +02:00
|
|
|
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.
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2008-04-11 23:04:39 +02:00
|
|
|
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.
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2008-04-11 23:04:39 +02:00
|
|
|
*/
|
2011-02-07 00:54:16 +01:00
|
|
|
|
|
|
|
|
|
2008-04-11 23:04:39 +02:00
|
|
|
/** @file gtk-lumiera.hpp
|
2011-02-07 00:54:16 +01:00
|
|
|
** The main application object.
|
|
|
|
|
** Invoking the GtkLumiera::main() function brings up the GUI; this
|
|
|
|
|
** function will block in the GTK event thread until the Application gets
|
|
|
|
|
** closed by user interaction or by triggering a shutdown via the GuiNotificationFacade.
|
|
|
|
|
** GtkLumiera is a singleton and owns the central WindowManager instance used for
|
|
|
|
|
** opening all windows and registering and loading icons and resources.
|
|
|
|
|
**
|
|
|
|
|
** \par configuration and resource search
|
|
|
|
|
** The GUI object retrieves the necessary configuration values from lumiera::Config,
|
|
|
|
|
** the config facade in the application core. Currently as of 2/2011 these values are
|
|
|
|
|
** loaded from setup.ini, because the full-blown config system is not yet implemented.
|
|
|
|
|
** Amongst others, this configuration defines a <i>search path</i> for icons and a
|
|
|
|
|
** separate search path for resources. These path specs may use the token \c $ORIGIN
|
|
|
|
|
** to refer to the installation directory of the currently executing program.
|
|
|
|
|
** This allows for a relocatable Lumiera installation bundle.
|
|
|
|
|
**
|
|
|
|
|
** @see guistart.cpp the plugin to pull up this GUI
|
|
|
|
|
** @see gui::GuiFacade access point for starting the GUI
|
|
|
|
|
** @see gui::GuiNotification interface for communication with the gui from the lower layers
|
|
|
|
|
** @see lumiera::Config
|
|
|
|
|
** @see lumiera::BasicSetup definition of the acceptable configuration values
|
|
|
|
|
** @see lumiera::AppState general Lumiera application main
|
|
|
|
|
**
|
2008-04-10 16:36:21 +02:00
|
|
|
*/
|
2008-04-11 23:04:39 +02:00
|
|
|
|
2011-02-06 21:23:34 +01:00
|
|
|
#ifndef GUI_GTK_LUMIERA_H
|
|
|
|
|
#define GUI_GTK_LUMIERA_H
|
2008-04-12 18:46:32 +02:00
|
|
|
|
2009-01-31 20:30:58 +01:00
|
|
|
|
2011-02-06 21:23:34 +01:00
|
|
|
#include "gui/gtk-base.hpp"
|
Rectify UI top-level -- introduce a global UiManager (#1067)
There seems to be a mismatch in the arrangement of the top-level entities
* we support multiple windows, yet from reading the code, you'd ge the impression we aren't really aware we have multiple top-level windows
* the `WindowManager` is the core UI manager, which feels like a mix-up in concerns
* the `WorkspaceWindow::createUI()` does the global UI initialisation. Again, we have multiple workspace windows.
* `GtkLumiera::main()` creates a `Model` and a `Controller` in local function scope, but stores the `WindowManager` in an object field.
* it seems, for that very reason, `GtlLumiera` needed to be a singleton, to allow by-name access to "the" `WindowManager`
* needless to say, this causes a host of problems when shutting down the UI.
The idea is to introduce a dedicated UiManager, to deal with the central
framework induced concerns solely, and to demote the WindowManager and the
WorkspaceWindows to care only for their local concerns
2017-01-23 00:40:17 +01:00
|
|
|
#include "gui/workspace/ui-manager.hpp"
|
|
|
|
|
#include "gui/workspace/window-manager.hpp"
|
2008-06-19 00:57:47 +02:00
|
|
|
|
2011-02-06 21:23:34 +01:00
|
|
|
#include <boost/noncopyable.hpp>
|
2014-04-03 22:42:48 +02:00
|
|
|
#include <memory>
|
2011-02-06 21:23:34 +01:00
|
|
|
#include <vector>
|
2008-04-16 19:24:11 +02:00
|
|
|
|
2008-04-11 21:28:15 +02:00
|
|
|
|
2015-11-28 05:51:53 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/* ======= Namespace Definitions ======= */
|
|
|
|
|
|
|
|
|
|
/** Lumiera GTK UI implementation root. */
|
2008-04-12 18:46:32 +02:00
|
|
|
namespace gui {
|
2015-05-29 04:44:58 +02:00
|
|
|
|
2015-11-28 05:51:53 +01:00
|
|
|
|
|
|
|
|
/** Backbone of the Lumiera GTK UI.
|
|
|
|
|
* All interface elements and controllers of global relevance
|
|
|
|
|
* are connected to a communication structure known as UI-Bus.
|
|
|
|
|
* This structure allows to address interface elements by ID
|
|
|
|
|
* and to process command invocations with asynchronous feedback
|
|
|
|
|
* in a uniform way.
|
|
|
|
|
*/
|
|
|
|
|
namespace ctrl {}
|
|
|
|
|
|
|
|
|
|
/** UI interaction control.
|
|
|
|
|
* Any overarching concerns of interaction patterns,
|
|
|
|
|
* selecting the subject, forming and binding of commands,
|
|
|
|
|
* management of focus and perspective, keybindings and gestures.
|
|
|
|
|
*/
|
|
|
|
|
namespace interact {}
|
|
|
|
|
|
|
|
|
|
/** The Lumiera GTK-GUI uses a thin proxy layer data model
|
|
|
|
|
* on top of the actual "high-level-model", which lives in the
|
|
|
|
|
* Proc-Layer below. GUI operations interact with these proxy model
|
|
|
|
|
* entities, which in turn forward the calls to the actual objects
|
|
|
|
|
* in the Proc-Layer, through the Command system (which enables UNDO).
|
|
|
|
|
*
|
|
|
|
|
* @todo: as of 1/2011 this connection between the GUI proxy model and
|
|
|
|
|
* the Proc-Layer model needs to be set up. Currently, the GUI model
|
|
|
|
|
* entities are just created standalone and thus dysfunctional.
|
|
|
|
|
* @todo: as of 11/2015 this connection between UI and Proc-Layer is actually
|
|
|
|
|
* in the works, and it is clear by now that we won't use proxy objects,
|
|
|
|
|
* but rather a generic bus-like connection and symbolic IDs to designate
|
|
|
|
|
* the model elements
|
|
|
|
|
*/
|
|
|
|
|
namespace model {}
|
|
|
|
|
|
2016-11-30 23:12:44 +01:00
|
|
|
/** Video output implementation. */
|
2015-11-28 05:51:53 +01:00
|
|
|
namespace output {}
|
|
|
|
|
|
|
|
|
|
/** Dialog box classes. */
|
|
|
|
|
namespace dialog {}
|
|
|
|
|
|
|
|
|
|
/** Docking panel classes. */
|
|
|
|
|
namespace panel {}
|
|
|
|
|
|
|
|
|
|
/** Lumiera custom widgets. */
|
|
|
|
|
namespace widget {}
|
|
|
|
|
|
|
|
|
|
/** The workspace window and it's helper classes. */
|
|
|
|
|
namespace workspace {}
|
|
|
|
|
|
2016-11-30 23:12:44 +01:00
|
|
|
/** The timeline display and editing operations. */
|
|
|
|
|
namespace timeline {}
|
|
|
|
|
|
2015-11-28 05:51:53 +01:00
|
|
|
/** GUI helpers, utility functions and classes. */
|
|
|
|
|
namespace util {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-29 04:44:58 +02:00
|
|
|
using std::shared_ptr;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* ====== The Application Class ====== */
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Top level entry point: The Lumiera GTK UI.
|
2016-12-10 03:10:34 +01:00
|
|
|
* @todo as of 12/2016 this is a singleton, which is sketchy.
|
|
|
|
|
* It should be instantiated in local scope of GuiLifecycle
|
|
|
|
|
* within guistart.cpp and discarded right after shutdown ///////////////TICKET #1048 : rectify lifecycle
|
2015-05-29 04:44:58 +02:00
|
|
|
*/
|
|
|
|
|
class GtkLumiera
|
|
|
|
|
: boost::noncopyable
|
|
|
|
|
{
|
|
|
|
|
/** Central application window manager instance */
|
2017-01-26 21:51:19 +01:00
|
|
|
shared_ptr<workspace::WindowManager> windowManagerInstance_;
|
2015-05-29 04:44:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
/** access the the global application object */
|
2016-12-10 03:10:34 +01:00
|
|
|
static GtkLumiera& application(); ////////////////////////////TICKET #1048 : this loophole needs to be closed
|
2015-05-29 04:44:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** start up the GUI and run the event thread */
|
|
|
|
|
void main(int argc, char *argv[]);
|
|
|
|
|
|
Rectify UI top-level -- introduce a global UiManager (#1067)
There seems to be a mismatch in the arrangement of the top-level entities
* we support multiple windows, yet from reading the code, you'd ge the impression we aren't really aware we have multiple top-level windows
* the `WindowManager` is the core UI manager, which feels like a mix-up in concerns
* the `WorkspaceWindow::createUI()` does the global UI initialisation. Again, we have multiple workspace windows.
* `GtkLumiera::main()` creates a `Model` and a `Controller` in local function scope, but stores the `WindowManager` in an object field.
* it seems, for that very reason, `GtlLumiera` needed to be a singleton, to allow by-name access to "the" `WindowManager`
* needless to say, this causes a host of problems when shutting down the UI.
The idea is to introduce a dedicated UiManager, to deal with the central
framework induced concerns solely, and to demote the WindowManager and the
WorkspaceWindows to care only for their local concerns
2017-01-23 00:40:17 +01:00
|
|
|
workspace::WindowManager& windowManager(); ////////////////////////////TICKET #1048 : this loophole needs to be closed
|
2015-05-29 04:44:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/** the name of the application */
|
|
|
|
|
static cuString getAppTitle();
|
|
|
|
|
|
|
|
|
|
static cuString getAppVersion();
|
|
|
|
|
|
|
|
|
|
static cuString getCopyright();
|
|
|
|
|
|
|
|
|
|
static cuString getLumieraWebsite();
|
|
|
|
|
|
|
|
|
|
/** alphabetical list of the application's authors */
|
|
|
|
|
static const std::vector<uString> getLumieraAuthors();
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
2011-02-06 21:23:34 +01:00
|
|
|
}// namespace gui
|
|
|
|
|
#endif
|