Lumiera  0.pre.03
»edit your freedom«
workspace-window.cpp
Go to the documentation of this file.
1 /*
2  WorkspaceWindow - the main workspace window of the GUI
3 
4  Copyright (C) Lumiera.org
5  2008, Joel Holdsworth <joel@airwebreathe.org.uk>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 * *****************************************************/
22 
23 
28 #include "stage/gtk-base.hpp"
29 #include "stage/config-keys.hpp"
33 #include "include/logging.h"
34 
35 
36 
37 
38 namespace stage {
39 namespace workspace {
40 
41  using ctrl::UiManager;
42 
43 
44  WorkspaceWindow::WorkspaceWindow (UiManager& uiManager)
45  : panelManager_(*this)
46  {
47  createUI (uiManager);
48  }
49 
50 
51  WorkspaceWindow::~WorkspaceWindow()
52  {
53  INFO (gui_dbg, "Closing workspace window...");
54  }
55 
56 
57 
58  PanelManager&
59  WorkspaceWindow::getPanelManager()
60  {
61  return panelManager_;
62  }
63 
64 
65  void
66  WorkspaceWindow::createUI (UiManager& uiManager)
67  {
68  signal_show ().connect_notify(mem_fun(uiManager, &UiManager::updateWindowFocusRelatedActions));
69  add_accel_group (uiManager.get_accel_group());
70 
71  // RTL Test Code
72  //set_default_direction (TEXT_DIR_RTL);
73 
74  //----- Configure the Window -----//
75  set_title (Config::get (KEY_TITLE));
76  set_default_size (1024, 768);
77 
78  //----- Set up the UI Manager -----//
79  // The UI will be nested within a VBox
80  add (baseContainer_);
81 
82  //----- Set up the Menu Bar -----//
83  Gtk::Widget* menu_bar = uiManager.get_widget ("/MenuBar");
84  REQUIRE (menu_bar != NULL);
85  baseContainer_.pack_start(*menu_bar, Gtk::PACK_SHRINK);
86 
87  //----- Create the Docks -----//
88  panelManager_.setupDock();
89  dockContainer_.pack_start (panelManager_.getDockBar(), false,false,0);
90  dockContainer_.pack_start (panelManager_.getDock(), true,true,0);
91  baseContainer_.pack_start (dockContainer_, Gtk::PACK_EXPAND_WIDGET);
92 
93  //----- Create the status bar -----//
94  //statusBar.set_has_resize_grip();
95  statusBar_.set_resize_mode (Gtk::RESIZE_PARENT);
96  baseContainer_.pack_start (statusBar_, Gtk::PACK_SHRINK);
97 
98  show_all_children();
99  }
100 
101 
102 
103 }}// namespace stage::workspace
Definition of access keys for global UI configuration.
Management of dockable panels.
This header is for including and configuring NoBug.
static string get(lib::Literal key)
Manager for global user interface concerns, framework integration and global state.
Lumiera GTK UI implementation root.
Definition: guifacade.cpp:46
This file contains the definition of the main workspace window parent, which is the toplevel parent o...
A set of basic GTK includes for the UI.