2008-04-11 23:04:39 +02:00
/*
2015-05-29 04:44:58 +02:00
WorkspaceWindow - the main workspace window of the GUI
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 0213 9 , USA .
2010-12-17 23:28:49 +01:00
2008-04-11 23:04:39 +02:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2008-04-11 21:28:15 +02:00
2016-11-03 18:20:10 +01:00
2016-11-03 18:22:31 +01:00
/** @file workspace-window.cpp
2016-11-06 14:38:12 +01:00
* * Implementation of base functionality for workspace windows .
2016-11-03 18:20:10 +01:00
*/
2017-05-03 21:13:17 +02:00
# include "gui/gtk-base.hpp"
2017-02-01 02:21:04 +01:00
# include "gui/config-keys.hpp"
2017-02-17 21:16:42 +01:00
# include "gui/workspace/workspace-window.hpp"
2017-02-02 19:57:01 +01:00
# include "gui/workspace/panel-manager.hpp"
2017-02-17 22:12:14 +01:00
# include "gui/ctrl/ui-manager.hpp"
2014-08-17 07:02:48 +02:00
# include "include/logging.h"
2008-04-11 21:28:15 +02:00
2008-04-12 22:15:07 +02:00
2008-04-11 21:28:15 +02:00
2008-04-12 18:46:32 +02:00
namespace gui {
2008-04-11 23:04:39 +02:00
namespace workspace {
2015-05-29 04:44:58 +02:00
2017-02-17 22:12:14 +01:00
using ctrl : : UiManager ;
2017-01-27 23:29:38 +01:00
WorkspaceWindow : : WorkspaceWindow ( UiManager & uiManager )
: panelManager_ ( * this )
2015-05-29 04:44:58 +02:00
{
2017-01-26 21:51:19 +01:00
createUI ( uiManager ) ;
2015-05-29 04:44:58 +02:00
}
WorkspaceWindow : : ~ WorkspaceWindow ( )
{
INFO ( gui_dbg , " Closing workspace window... " ) ;
}
PanelManager &
WorkspaceWindow : : getPanelManager ( )
{
return panelManager_ ;
}
void
2017-01-26 21:51:19 +01:00
WorkspaceWindow : : createUI ( UiManager & uiManager )
2015-05-29 04:44:58 +02:00
{
2017-02-01 03:55:20 +01:00
signal_show ( ) . connect_notify ( mem_fun ( uiManager , & UiManager : : updateWindowFocusRelatedActions ) ) ; ///////////////TICKET #1076 find out how to handle this properly
add_accel_group ( uiManager . get_accel_group ( ) ) ;
2015-05-29 04:44:58 +02:00
// RTL Test Code
//set_default_direction (TEXT_DIR_RTL);
2008-08-16 21:02:46 +02:00
2015-05-29 04:44:58 +02:00
//----- Configure the Window -----//
2017-02-01 02:21:04 +01:00
set_title ( Config : : get ( KEY_TITLE ) ) ;
2017-01-26 21:51:19 +01:00
set_default_size ( 1024 , 768 ) ;
2015-05-29 04:44:58 +02:00
//----- Set up the UI Manager -----//
// The UI will be nested within a VBox
2017-01-26 21:51:19 +01:00
add ( baseContainer_ ) ;
2017-02-01 03:55:20 +01:00
2015-05-29 04:44:58 +02:00
//----- Set up the Menu Bar -----//
2017-01-26 21:51:19 +01:00
Gtk : : Widget * menu_bar = uiManager . get_widget ( " /MenuBar " ) ;
REQUIRE ( menu_bar ! = NULL ) ;
2015-05-29 04:44:58 +02:00
baseContainer_ . pack_start ( * menu_bar , Gtk : : PACK_SHRINK ) ;
//----- Create the Docks -----//
panelManager_ . setupDock ( ) ;
2017-01-26 21:51:19 +01:00
dockContainer_ . pack_start ( panelManager_ . getDockBar ( ) , false , false , 0 ) ;
dockContainer_ . pack_start ( panelManager_ . getDock ( ) , true , true , 0 ) ;
2017-02-17 22:14:27 +01:00
baseContainer_ . pack_start ( dockContainer_ , Gtk : : PACK_EXPAND_WIDGET ) ;
2015-05-29 04:44:58 +02:00
//----- Create the status bar -----//
//statusBar.set_has_resize_grip();
2017-01-26 21:51:19 +01:00
statusBar_ . set_resize_mode ( Gtk : : RESIZE_PARENT ) ;
2017-02-17 22:14:27 +01:00
baseContainer_ . pack_start ( statusBar_ , Gtk : : PACK_SHRINK ) ;
2015-05-29 04:44:58 +02:00
show_all_children ( ) ;
}
} } // namespace gui::workspace