34#ifndef STAGE_CTRL_ACTIONS_H
35#define STAGE_CTRL_ACTIONS_H
53 using Gtk::ActionGroup;
54 using Gtk::ToggleAction;
61 namespace Stock = Gtk::Stock;
94 auto menu = [&](
auto id,
auto menuName) {
actionGroup->add (Action::create(
id, menuName)); };
95 auto entry = [&](
auto closure,
auto ...args) {
actionGroup->add (Action::create(args...), closure);};
98 menu(
"FileMenu",
_(
"_File"));
107 menu(
"EditMenu",
_(
"_Edit"));
108 entry ([&]() {
unimplemented (
"Edit/Undo"); } ,
"EditUndo", Stock::UNDO);
109 entry ([&]() {
unimplemented (
"Edit/Redo"); } ,
"EditRedo", Stock::REDO);
110 entry ([&]() {
unimplemented (
"Edit/Cut"); } ,
"EditCut", Stock::CUT);
111 entry ([&]() {
unimplemented (
"Edit/Copy"); } ,
"EditCopy", Stock::COPY);
112 entry ([&]() {
unimplemented (
"Edit/Pasta"); } ,
"EditPaste", Stock::PASTE);
116 menu(
"SequenceMenu",
_(
"_Sequence"));
120 menu(
"TrackMenu",
_(
"_Track"));
124 menu(
"HelpMenu",
_(
"_Help"));
129 menu(
"WindowMenu",
_(
"_Window"));
132 actionGroup->add(Action::create(
"WindowShowPanel",
_(
"_Show Panel")));
135 menu(
"ViewMenu",
_(
"_View"));
152 playPanelAction = ToggleAction::create(
"ViewPlay", StockID(
"panel_play"));
161 string ui_info = R
"***(
163 <menubar name='MenuBar'>
164 <menu action='FileMenu'>
165 <menuitem action='FileNewProject'/>
166 <menuitem action='FileSave'/>
167 <menuitem action='FileSaveAs'/>
168 <menuitem action='FileOpen'/>
170 <menuitem action='FileRender'/>
172 <menuitem action='FileQuit'/>
174 <menu action='EditMenu'>
175 <menuitem action='EditUndo'/>
176 <menuitem action='EditRedo'/>
178 <menuitem action='EditCut'/>
179 <menuitem action='EditCopy'/>
180 <menuitem action='EditPaste'/>
182 <menuitem action='EditPreferences'/>
184 <menu action='ViewMenu'>
185 <menuitem action='ViewAssets'/>
186 <menuitem action='ViewInfoBox'/>
187 <menuitem action='ViewTimeline'/>
188 <menuitem action='ViewViewer'/>
189 <menuitem action='ViewPlay'/>
191 <menu action='SequenceMenu'>
192 <menuitem action='SequenceAdd'/>
194 <menu action='TrackMenu'>
195 <menuitem action='TrackAdd'/>
197 <menu action='WindowMenu'>
198 <menuitem action='WindowNewWindow'/>
199 <menuitem action='WindowCloseWindow'/>
200 <menu action='WindowShowPanel'/>
202 <menu action='HelpMenu'>
203 <menuitem action='HelpAbout'/>
204 <menuitem action='HelpTest'/>
207 <toolbar name='ToolBar'>
208 <toolitem action='FileNewProject'/>
209 <toolitem action='FileOpen'/>
210 <toolitem action='FileSave'/>
212 <toolitem action='EditUndo'/>
213 <toolitem action='EditRedo'/>
215 <toolitem action='EditCut'/>
216 <toolitem action='EditCopy'/>
217 <toolitem action='EditPaste'/>
223 uiManager.add_ui_from_string (ui_info);
225 catch(Glib::Error& ex)
227 ERROR (
stage,
"Building menus failed: %s", ex.what().data());
261// is_updating_action_state = false;
284 Glib::RefPtr<Gtk::ActionGroup>
actionGroup = ActionGroup::create();
285 for (
uint i = 0; i < count; i++)
288 cuString panelName = ustring::compose(
"Panel%1", i);
289 actionGroup->add(Action::create(panelName, StockID(stock_id)),
299 for (
uint i = 0; i < count; i++)
301 cuString name = ustring::compose(
"Panel%1", i);
302 uiManager.add_ui (uiManager.new_merge_id(),
303 "/MenuBar/WindowMenu/WindowShowPanel",
366 WARN (
stage,
"%s is not yet implemented. So sorry.", todo);
A helper class which registers global user actions and populates the main menu and toolbar.
Glib::RefPtr< Gtk::ActionGroup > actionGroup
void updateActionState(workspace::WorkspaceWindow ¤tWindow)
Updates the state of the menu/toolbar actions to reflect the current state of the workspace.
void onMenu_view_infobox()
bool is_updating_action_state
void onMenu_view_timeline()
Glib::RefPtr< Gtk::ToggleAction > playPanelAction
Glib::RefPtr< Gtk::ToggleAction > viewerPanelAction
Glib::RefPtr< Gtk::ToggleAction > assetsPanelAction
void onMenu_view_viewer()
void populateShowPanelActions(Gtk::UIManager &uiManager)
Populates the menu entries to show specific panels within the current window.
void populateMainActions(Gtk::UIManager &uiManager)
Populates the uiManager with the main set of global actions.
Glib::RefPtr< Gtk::ToggleAction > timelinePanelAction
Actions(GlobalCtx &globals)
Glib::RefPtr< Gtk::ToggleAction > infoboxPanelAction
void unimplemented(Literal todo)
void onMenu_view_assets()
A global circle of top-level UI management facilities.
InteractionDirector director_
void terminateUI()
Cause the main event loop to terminate, so the application as a whole unwinds.
void closeWindow()
close (and thus destroy) the current active window.
workspace::WorkspaceWindow & findActiveWindow()
find and retrieve a WorkspaceWindow (top-level window) marked as 'active' by GTK.
void newSequence()
Establish a pristine new sequence within the session.
void newTrack()
Establish a empty new track close to the current scope.
void render()
Start a render process.
void saveSnapshot()
Save a snapshot of the current project's contents and the UI state.
void forkProject()
Continue evolution of the currently active project under a new identity.
void editSetup()
Edit global configuration and setup.
void openFile()
Select and open a file to perform a suitable operation.
void newProject()
setup a new editing project, possibly close the current one.
void show_HelpAbout()
show the notorious "about Lumiera" dialog.
void launchTestCtrl()
Launch a non modal child window to trigger self-test actions.
static int getPanelDescriptionCount()
Gets the number of panel descriptions.
static const gchar * getPanelStockID(const int index)
Gets a panel description's stock id.
The main Lumiera workspace window.
Any copy and copy construction prohibited.
A front-end for using printf-style formatting.
Dependency context to hold all the global UI top-level entities.
A set of basic GTK includes for the UI.
LumieraError< LERR_(CONFIG), Invalid > Config
Lumiera GTK UI implementation root.
Mix-Ins to allow or prohibit various degrees of copying and cloning.
Management of dockable panels.
Manager for all top level application windows.
This file contains the definition of the main workspace window parent, which is the toplevel parent o...