Project: join GTK-3 and GDLmm port
This commit is contained in:
commit
ac3ef9f469
14 changed files with 131 additions and 165 deletions
|
|
@ -120,12 +120,17 @@ def configure(env):
|
||||||
if not conf.CheckPkgConfig('cairomm-1.0', 0.6):
|
if not conf.CheckPkgConfig('cairomm-1.0', 0.6):
|
||||||
problems.append('Unable to configure Cairo--')
|
problems.append('Unable to configure Cairo--')
|
||||||
|
|
||||||
verGDL = '3.0.0'
|
verGDL = '3.12'
|
||||||
if not conf.CheckPkgConfig('gdl-3.0', verGDL, alias='gdl'):
|
verGDLmm = '3.7.3'
|
||||||
print 'No sufficiently recent (>=%s) version of GDL found. Maybe use custom package gdl-lum?' % verGDL
|
urlGDLmm = 'http://ftp.gnome.org/pub/GNOME/sources/gdlmm/'
|
||||||
if not conf.CheckPkgConfig('gdl-lum', verGDL, alias='gdl'):
|
urlGDLmmDEB = 'http://lumiera.org/debian/'
|
||||||
problems.append('GNOME Docking Library not found. We either need a sufficiently recent GDL '
|
if not conf.CheckPkgConfig('gdl-3.0', verGDL):
|
||||||
'version (>=%s), or the custom package "gdl-lum" from Lumiera.org.' % verGDL)
|
problems.append('GNOME Docking Library not found. We need at least GDL %s '
|
||||||
|
'and suitable C++ ("mm")-bindings (GDLmm >=%s)' % (verGDL, verGDLmm))
|
||||||
|
if not conf.CheckPkgConfig('gdlmm-3.0', verGDLmm, alias='gdl'):
|
||||||
|
problems.append('We need the C++ bindings for GDL by Fabien Parent: GDLmm >=%s '
|
||||||
|
'(either from GNOME %s or use the debian package from %s)' %
|
||||||
|
(verGDLmm, urlGDLmm, urlGDLmmDEB))
|
||||||
|
|
||||||
if not conf.CheckPkgConfig('librsvg-2.0', '2.18.1'):
|
if not conf.CheckPkgConfig('librsvg-2.0', '2.18.1'):
|
||||||
problems.append('Need rsvg Library for rendering icons.')
|
problems.append('Need rsvg Library for rendering icons.')
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ void
|
||||||
GtkLumiera::main (int argc, char *argv[])
|
GtkLumiera::main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
Glib::thread_init();
|
Glib::thread_init();
|
||||||
|
Gdl::init();
|
||||||
Main kit(argc, argv);
|
Main kit(argc, argv);
|
||||||
|
|
||||||
Glib::set_application_name (getAppTitle());
|
Glib::set_application_name (getAppTitle());
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ namespace gui {
|
||||||
namespace panels {
|
namespace panels {
|
||||||
|
|
||||||
AssetsPanel::AssetsPanel(workspace::PanelManager &panel_manager,
|
AssetsPanel::AssetsPanel(workspace::PanelManager &panel_manager,
|
||||||
GdlDockItem *dock_item) :
|
Gdl::DockItem &dock_item) :
|
||||||
Panel(panel_manager, dock_item, get_title(), get_stock_id())
|
Panel(panel_manager, dock_item, get_title(), get_stock_id())
|
||||||
{
|
{
|
||||||
notebook.append_page(media, _("Media"));
|
notebook.append_page(media, _("Media"));
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ public:
|
||||||
* @param dock_item The GdlDockItem that will host this panel.
|
* @param dock_item The GdlDockItem that will host this panel.
|
||||||
*/
|
*/
|
||||||
AssetsPanel(workspace::PanelManager &panel_manager,
|
AssetsPanel(workspace::PanelManager &panel_manager,
|
||||||
GdlDockItem *dock_item);
|
Gdl::DockItem &dock_item);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the title of the panel.
|
* Get the title of the panel.
|
||||||
|
|
|
||||||
|
|
@ -34,60 +34,50 @@ namespace gui {
|
||||||
namespace panels {
|
namespace panels {
|
||||||
|
|
||||||
Panel::Panel(workspace::PanelManager &panel_manager,
|
Panel::Panel(workspace::PanelManager &panel_manager,
|
||||||
GdlDockItem *dock_item, const gchar* long_name,
|
Gdl::DockItem &dock_item, const gchar* long_name,
|
||||||
const gchar *stock_id) :
|
const gchar *stock_id) :
|
||||||
panelManager(panel_manager),
|
panelManager(panel_manager),
|
||||||
dockItem(dock_item),
|
dockItem(dock_item),
|
||||||
hide_panel_handler_id(0),
|
|
||||||
panelBar(*this, stock_id)
|
panelBar(*this, stock_id)
|
||||||
{
|
{
|
||||||
REQUIRE(dockItem);
|
// Set dockItems long-name property
|
||||||
g_object_ref(dockItem);
|
|
||||||
|
|
||||||
Glib::Value<std::string> val;
|
Glib::Value<std::string> val;
|
||||||
val.init(val.value_type());
|
val.init(val.value_type());
|
||||||
val.set(long_name);
|
val.set(long_name);
|
||||||
g_object_set_property (G_OBJECT (dockItem), "long-name", val.gobj());
|
g_object_set_property (G_OBJECT (dockItem.gobj()), "long-name", val.gobj());
|
||||||
|
|
||||||
// Set the grip handle
|
/* Set the grip handle */
|
||||||
GdlDockItemGrip *grip = GDL_DOCK_ITEM_GRIP(
|
GdlDockItemGrip *grip = GDL_DOCK_ITEM_GRIP(
|
||||||
gdl_dock_item_get_grip(dockItem));
|
gdl_dock_item_get_grip(dockItem.gobj()));
|
||||||
gdl_dock_item_grip_show_handle(grip);
|
gdl_dock_item_grip_show_handle(grip);
|
||||||
gdl_dock_item_grip_set_label(grip, ((Widget&)panelBar).gobj());
|
gdl_dock_item_grip_set_label(grip, ((Widget&)panelBar).gobj());
|
||||||
|
//gdl_dock_item_grip_set_cursor_type(grip, GDK_LEFT_PTR);
|
||||||
// Set up the panel body
|
|
||||||
gtk_container_add (GTK_CONTAINER(dockItem), GTK_WIDGET(gobj()));
|
/* Set up the panel body */
|
||||||
|
// Add this panel's container to the DockItem
|
||||||
gtk_widget_show (GTK_WIDGET(dockItem));
|
dockItem.add((Gtk::Widget&)*this);
|
||||||
|
|
||||||
// Connect the signals
|
/* Connect the signals */
|
||||||
hide_panel_handler_id = g_signal_connect (GTK_WIDGET(dockItem),
|
dockItem.signal_hide().connect(
|
||||||
"hide", G_CALLBACK(on_item_hidden), this);
|
sigc::mem_fun(*this, &Panel::on_item_hidden));
|
||||||
|
|
||||||
|
dockItem.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
Panel::~Panel()
|
Panel::~Panel()
|
||||||
{
|
{
|
||||||
REQUIRE(dockItem != NULL);
|
/* Detach the panel bar */
|
||||||
|
|
||||||
// Detach the panel bar
|
|
||||||
GdlDockItemGrip *grip = GDL_DOCK_ITEM_GRIP(
|
GdlDockItemGrip *grip = GDL_DOCK_ITEM_GRIP(
|
||||||
gdl_dock_item_get_grip(dockItem));
|
gdl_dock_item_get_grip(dockItem.gobj()));
|
||||||
gtk_container_remove (GTK_CONTAINER(grip),
|
gtk_container_remove (GTK_CONTAINER(grip),
|
||||||
((Widget&)panelBar).gobj());
|
((Widget&)panelBar).gobj());
|
||||||
|
|
||||||
gtk_container_remove (GTK_CONTAINER(dockItem), GTK_WIDGET(gobj()));
|
|
||||||
|
|
||||||
// Detach the signals
|
|
||||||
g_signal_handler_disconnect(
|
|
||||||
GTK_WIDGET(dockItem), hide_panel_handler_id);
|
|
||||||
|
|
||||||
// Unref the dock item
|
/* Remove this panel's container from the DockItem */
|
||||||
g_object_unref(dockItem);
|
dockItem.remove((Gtk::Widget&)*this);
|
||||||
dockItem = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GdlDockItem*
|
Gdl::DockItem&
|
||||||
Panel::get_dock_item() const
|
Panel::get_dock_item()
|
||||||
{
|
{
|
||||||
return dockItem;
|
return dockItem;
|
||||||
}
|
}
|
||||||
|
|
@ -95,45 +85,48 @@ Panel::get_dock_item() const
|
||||||
void
|
void
|
||||||
Panel::show(bool show)
|
Panel::show(bool show)
|
||||||
{
|
{
|
||||||
REQUIRE(dockItem != NULL);
|
//REQUIRE(dockItem != NULL);
|
||||||
if(show) gdl_dock_item_show_item (dockItem);
|
if(show) dockItem.show_item();
|
||||||
else gdl_dock_item_hide_item (dockItem);
|
else dockItem.hide_item();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Panel::is_shown() const
|
Panel::is_shown() const
|
||||||
{
|
{
|
||||||
REQUIRE(dockItem != NULL);
|
//REQUIRE(dockItem != NULL);
|
||||||
return gtk_widget_get_visible((GtkWidget*)dockItem);
|
return dockItem.is_visible();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Panel::iconify()
|
Panel::iconify()
|
||||||
{
|
{
|
||||||
REQUIRE(dockItem != NULL);
|
dockItem.iconify_item();
|
||||||
gdl_dock_item_iconify_item(dockItem);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Panel::is_iconified() const
|
Panel::is_iconified() const
|
||||||
{
|
{
|
||||||
REQUIRE(dockItem != NULL);
|
/** Gdlmm as of v1.30.0 does not have
|
||||||
return GDL_DOCK_ITEM_ICONIFIED(dockItem);
|
* a facility for checking the whether
|
||||||
|
* a dock item is iconified or not
|
||||||
|
*/
|
||||||
|
GdlDockItem *item = dockItem.gobj();
|
||||||
|
REQUIRE(item != NULL);
|
||||||
|
return GDL_DOCK_ITEM_ICONIFIED (item);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Panel::lock(bool lock)
|
Panel::lock(bool lock)
|
||||||
{
|
{
|
||||||
REQUIRE(dockItem != NULL);
|
if(lock) dockItem.lock();
|
||||||
if(lock) gdl_dock_item_lock (dockItem);
|
else dockItem.unlock();
|
||||||
else gdl_dock_item_unlock (dockItem);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Panel::is_locked() const
|
Panel::is_locked() const
|
||||||
{
|
{
|
||||||
REQUIRE(dockItem != NULL);
|
REQUIRE(dockItem.gobj() != NULL);
|
||||||
return !GDL_DOCK_ITEM_NOT_LOCKED(dockItem);
|
return !GDL_DOCK_ITEM_NOT_LOCKED(dockItem.gobj());
|
||||||
}
|
}
|
||||||
|
|
||||||
workspace::PanelManager&
|
workspace::PanelManager&
|
||||||
|
|
@ -167,10 +160,9 @@ Panel::signal_hide_panel()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Panel::on_item_hidden(GdlDockItem*, Panel *panel)
|
Panel::on_item_hidden()
|
||||||
{
|
{
|
||||||
REQUIRE(panel);
|
hidePanelSignal.emit();
|
||||||
panel->hidePanelSignal();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace panels
|
} // namespace panels
|
||||||
|
|
|
||||||
|
|
@ -27,11 +27,10 @@
|
||||||
#ifndef PANEL_HPP
|
#ifndef PANEL_HPP
|
||||||
#define PANEL_HPP
|
#define PANEL_HPP
|
||||||
|
|
||||||
|
|
||||||
#include "gui/gtk-lumiera.hpp"
|
#include "gui/gtk-lumiera.hpp"
|
||||||
#include "gui/widgets/panel-bar.hpp"
|
#include "gui/widgets/panel-bar.hpp"
|
||||||
|
|
||||||
#include <gdl/gdl-dock-item.h>
|
#include <gdlmm.h>
|
||||||
|
|
||||||
namespace gui {
|
namespace gui {
|
||||||
|
|
||||||
|
|
@ -56,7 +55,7 @@ protected:
|
||||||
* @param stock_id The stock_id of this panel.
|
* @param stock_id The stock_id of this panel.
|
||||||
*/
|
*/
|
||||||
Panel(workspace::PanelManager &panel_manager,
|
Panel(workspace::PanelManager &panel_manager,
|
||||||
GdlDockItem *dock_item, const gchar* long_name,
|
Gdl::DockItem &dock_item, const gchar* long_name,
|
||||||
const gchar *stock_id);
|
const gchar *stock_id);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
@ -65,7 +64,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Returns a pointer to the underlying GdlDockItem structure
|
* Returns a pointer to the underlying GdlDockItem structure
|
||||||
*/
|
*/
|
||||||
GdlDockItem* get_dock_item() const;
|
Gdl::DockItem& get_dock_item();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shows or hides the panel.
|
* Shows or hides the panel.
|
||||||
|
|
@ -134,9 +133,8 @@ private:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An event handler for when dockItem is hidden.
|
* An event handler for when dockItem is hidden.
|
||||||
* @param func_data A pointer to the panel that owns dock_item
|
|
||||||
*/
|
*/
|
||||||
static void on_item_hidden(GdlDockItem*, Panel *panel);
|
void on_item_hidden();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|
@ -149,17 +147,12 @@ protected:
|
||||||
* The owner dock item widget that will host the widgets in this
|
* The owner dock item widget that will host the widgets in this
|
||||||
* panel.
|
* panel.
|
||||||
*/
|
*/
|
||||||
GdlDockItem* dockItem;
|
Gdl::DockItem &dockItem;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A signal that fires when the dock item is hidden.
|
* A signal that fires when the dock item is hidden.
|
||||||
*/
|
*/
|
||||||
sigc::signal<void> hidePanelSignal;
|
sigc::signal<void> hidePanelSignal;
|
||||||
|
|
||||||
/**
|
|
||||||
* The id of the hide panel handler.
|
|
||||||
*/
|
|
||||||
gulong hide_panel_handler_id;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The panel bar to attach to the panel grip.
|
* The panel bar to attach to the panel grip.
|
||||||
|
|
|
||||||
|
|
@ -48,9 +48,8 @@ namespace panels {
|
||||||
|
|
||||||
const int TimelinePanel::ZoomToolSteps = 2; // 2 seems comfortable
|
const int TimelinePanel::ZoomToolSteps = 2; // 2 seems comfortable
|
||||||
|
|
||||||
|
|
||||||
TimelinePanel::TimelinePanel (workspace::PanelManager &panel_manager,
|
TimelinePanel::TimelinePanel (workspace::PanelManager &panel_manager,
|
||||||
GdlDockItem *dock_item)
|
Gdl::DockItem &dock_item)
|
||||||
: Panel(panel_manager, dock_item, get_title(), get_stock_id())
|
: Panel(panel_manager, dock_item, get_title(), get_stock_id())
|
||||||
, timeCode("sequence_clock", "timecode_widget", true)
|
, timeCode("sequence_clock", "timecode_widget", true)
|
||||||
, previousButton(Stock::MEDIA_PREVIOUS)
|
, previousButton(Stock::MEDIA_PREVIOUS)
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ public:
|
||||||
* @param dock_item The GdlDockItem that will host this panel.
|
* @param dock_item The GdlDockItem that will host this panel.
|
||||||
*/
|
*/
|
||||||
TimelinePanel(workspace::PanelManager &panel_manager,
|
TimelinePanel(workspace::PanelManager &panel_manager,
|
||||||
GdlDockItem *dock_item);
|
Gdl::DockItem &dock_item);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ namespace gui {
|
||||||
namespace panels {
|
namespace panels {
|
||||||
|
|
||||||
ViewerPanel::ViewerPanel(workspace::PanelManager &panel_manager,
|
ViewerPanel::ViewerPanel(workspace::PanelManager &panel_manager,
|
||||||
GdlDockItem *dock_item) :
|
Gdl::DockItem &dock_item) :
|
||||||
Panel(panel_manager, dock_item, get_title(), get_stock_id())
|
Panel(panel_manager, dock_item, get_title(), get_stock_id())
|
||||||
{
|
{
|
||||||
//----- Pack in the Widgets -----//
|
//----- Pack in the Widgets -----//
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ public:
|
||||||
* @param dock_item The GdlDockItem that will host this panel.
|
* @param dock_item The GdlDockItem that will host this panel.
|
||||||
*/
|
*/
|
||||||
ViewerPanel(workspace::PanelManager &panel_manager,
|
ViewerPanel(workspace::PanelManager &panel_manager,
|
||||||
GdlDockItem *dock_item);
|
Gdl::DockItem &dock_item);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the title of the panel.
|
* Get the title of the panel.
|
||||||
|
|
|
||||||
|
|
@ -83,18 +83,25 @@ PanelBar::setup_panel_button()
|
||||||
**/
|
**/
|
||||||
}
|
}
|
||||||
|
|
||||||
panelButton.appendSeparator();
|
FIXME("Update for gtk3");
|
||||||
|
#if 0
|
||||||
|
list.push_back( Menu_Helpers::SeparatorElem() );
|
||||||
|
#endif
|
||||||
|
|
||||||
// Add extra commands
|
// Add extra commands
|
||||||
slot<void> hide = mem_fun(*this, &PanelBar::on_hide);
|
slot<void> hide = mem_fun(*this, &PanelBar::on_hide);
|
||||||
panelButton.append("Hide","_Hide", hide);
|
panelButton.append("Hide","_Hide", hide);
|
||||||
|
|
||||||
slot<void> lock = mem_fun(*this, &PanelBar::on_lock);
|
slot<void> lock = mem_fun(*this, &PanelBar::on_lock);
|
||||||
panelButton.append("Lock", "_Lock", lock, true);
|
panelButton.append("Lock", "_Lock", lock);
|
||||||
|
|
||||||
lockItem = dynamic_cast<CheckMenuItem*>(panelButton.get("Lock"));
|
FIXME("Update for gtk3");
|
||||||
|
#if 0
|
||||||
|
lockItem = dynamic_cast<CheckMenuItem*>(&list.back());
|
||||||
ENSURE(lockItem);
|
ENSURE(lockItem);
|
||||||
lockItem->set_active(panel.is_locked());
|
lockItem->set_active(panel.is_locked());
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
slot<void> hfunc =
|
slot<void> hfunc =
|
||||||
bind(mem_fun(*this, &PanelBar::on_split_panel),
|
bind(mem_fun(*this, &PanelBar::on_split_panel),
|
||||||
|
|
|
||||||
|
|
@ -46,23 +46,22 @@ unsigned short PanelManager::panelID = 0;
|
||||||
|
|
||||||
PanelManager::PanelManager(WorkspaceWindow &workspace_window) :
|
PanelManager::PanelManager(WorkspaceWindow &workspace_window) :
|
||||||
workspaceWindow(workspace_window),
|
workspaceWindow(workspace_window),
|
||||||
dock(NULL),
|
dock(),
|
||||||
dockBar(NULL),
|
dockBar(dock),
|
||||||
dockLayout(NULL)
|
dockLayout()
|
||||||
{
|
{
|
||||||
|
/* Create the DockLayout */
|
||||||
|
dockLayout = Gdl::DockLayout::create(dock);
|
||||||
|
|
||||||
|
/* Setup the Switcher Style */
|
||||||
|
Glib::RefPtr<Gdl::DockMaster> dock_master = dock.property_master();
|
||||||
|
dock_master->property_switcher_style() = Gdl::SWITCHER_STYLE_ICON;
|
||||||
|
|
||||||
memset(&dockPlaceholders, 0, sizeof(dockPlaceholders));
|
memset(&dockPlaceholders, 0, sizeof(dockPlaceholders));
|
||||||
}
|
}
|
||||||
|
|
||||||
PanelManager::~PanelManager()
|
PanelManager::~PanelManager()
|
||||||
{
|
{
|
||||||
if(dock)
|
|
||||||
g_object_unref(dock);
|
|
||||||
|
|
||||||
if(dockBar)
|
|
||||||
g_object_unref(dockBar);
|
|
||||||
|
|
||||||
if(dockLayout)
|
|
||||||
g_object_unref(dockLayout);
|
|
||||||
|
|
||||||
for(int i = 0; i < 4; i++)
|
for(int i = 0; i < 4; i++)
|
||||||
if(dockPlaceholders[i])
|
if(dockPlaceholders[i])
|
||||||
|
|
@ -74,45 +73,31 @@ PanelManager::~PanelManager()
|
||||||
void
|
void
|
||||||
PanelManager::setup_dock()
|
PanelManager::setup_dock()
|
||||||
{
|
{
|
||||||
REQUIRE(dock == NULL);
|
|
||||||
dock = GDL_DOCK(gdl_dock_new());
|
|
||||||
ENSURE(dock);
|
|
||||||
|
|
||||||
REQUIRE(dockBar == NULL);
|
|
||||||
dockBar = GDL_DOCK_BAR(gdl_dock_bar_new(dock));
|
|
||||||
ENSURE(dockBar);
|
|
||||||
|
|
||||||
REQUIRE(dockLayout == NULL);
|
|
||||||
dockLayout = GDL_DOCK_LAYOUT(gdl_dock_layout_new(dock));
|
|
||||||
ENSURE(dockLayout);
|
|
||||||
|
|
||||||
REQUIRE(dockPlaceholders[0] == NULL && dockPlaceholders[1] == NULL &&
|
REQUIRE(dockPlaceholders[0] == NULL && dockPlaceholders[1] == NULL &&
|
||||||
dockPlaceholders[2] == NULL && dockPlaceholders[3] == NULL);
|
dockPlaceholders[2] == NULL && dockPlaceholders[3] == NULL);
|
||||||
dockPlaceholders[0] = GDL_DOCK_PLACEHOLDER(gdl_dock_placeholder_new(
|
dockPlaceholders[0] = GDL_DOCK_PLACEHOLDER(gdl_dock_placeholder_new(
|
||||||
"ph1", GDL_DOCK_OBJECT(dock), GDL_DOCK_TOP, FALSE));
|
"ph1", GDL_DOCK_OBJECT(dock.gobj()), GDL_DOCK_TOP, FALSE));
|
||||||
dockPlaceholders[1] = GDL_DOCK_PLACEHOLDER(gdl_dock_placeholder_new(
|
dockPlaceholders[1] = GDL_DOCK_PLACEHOLDER(gdl_dock_placeholder_new(
|
||||||
"ph2", GDL_DOCK_OBJECT(dock), GDL_DOCK_BOTTOM, FALSE));
|
"ph2", GDL_DOCK_OBJECT(dock.gobj()), GDL_DOCK_BOTTOM, FALSE));
|
||||||
dockPlaceholders[2] = GDL_DOCK_PLACEHOLDER(gdl_dock_placeholder_new(
|
dockPlaceholders[2] = GDL_DOCK_PLACEHOLDER(gdl_dock_placeholder_new(
|
||||||
"ph3", GDL_DOCK_OBJECT(dock), GDL_DOCK_LEFT, FALSE));
|
"ph3", GDL_DOCK_OBJECT(dock.gobj()), GDL_DOCK_LEFT, FALSE));
|
||||||
dockPlaceholders[3] = GDL_DOCK_PLACEHOLDER(gdl_dock_placeholder_new(
|
dockPlaceholders[3] = GDL_DOCK_PLACEHOLDER(gdl_dock_placeholder_new(
|
||||||
"ph4", GDL_DOCK_OBJECT(dock), GDL_DOCK_RIGHT, FALSE));
|
"ph4", GDL_DOCK_OBJECT(dock.gobj()), GDL_DOCK_RIGHT, FALSE));
|
||||||
ENSURE(dockPlaceholders[0] && dockPlaceholders[1] &&
|
ENSURE(dockPlaceholders[0] && dockPlaceholders[1] &&
|
||||||
dockPlaceholders[2] && dockPlaceholders[3]);
|
dockPlaceholders[2] && dockPlaceholders[3]);
|
||||||
|
|
||||||
create_panels();
|
create_panels();
|
||||||
}
|
}
|
||||||
|
|
||||||
GdlDock*
|
Gdl::Dock&
|
||||||
PanelManager::get_dock() const
|
PanelManager::get_dock()
|
||||||
{
|
{
|
||||||
ENSURE(dock);
|
|
||||||
return dock;
|
return dock;
|
||||||
}
|
}
|
||||||
|
|
||||||
GdlDockBar*
|
Gdl::DockBar&
|
||||||
PanelManager::get_dock_bar() const
|
PanelManager::get_dock_bar()
|
||||||
{
|
{
|
||||||
ENSURE(dockBar);
|
|
||||||
return dockBar;
|
return dockBar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -135,9 +120,9 @@ PanelManager::show_panel(const int description_index)
|
||||||
if(!panel->is_shown())
|
if(!panel->is_shown())
|
||||||
panel->show();
|
panel->show();
|
||||||
|
|
||||||
GdlDockItem *dock_item = panel->get_dock_item();
|
Gdl::DockItem &dock_item = panel->get_dock_item();
|
||||||
ENSURE(dock_item);
|
// ENSURE(dock_item);
|
||||||
gdl_dock_object_present(GDL_DOCK_OBJECT(dock_item), NULL);
|
dock_item.present(dock);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -146,8 +131,7 @@ PanelManager::show_panel(const int description_index)
|
||||||
panels::Panel *new_panel = create_panel_by_index(description_index);
|
panels::Panel *new_panel = create_panel_by_index(description_index);
|
||||||
|
|
||||||
// Dock the item
|
// Dock the item
|
||||||
gdl_dock_add_item(dock, new_panel->get_dock_item(),
|
dock.add_item(new_panel->get_dock_item(), Gdl::DOCK_FLOATING);
|
||||||
GDL_DOCK_FLOATING);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PanelManager::switch_panel(panels::Panel &old_panel,
|
void PanelManager::switch_panel(panels::Panel &old_panel,
|
||||||
|
|
@ -157,43 +141,43 @@ void PanelManager::switch_panel(panels::Panel &old_panel,
|
||||||
description_index < get_panel_description_count());
|
description_index < get_panel_description_count());
|
||||||
|
|
||||||
// Get the dock item
|
// Get the dock item
|
||||||
GdlDockItem *dock_item = old_panel.get_dock_item();
|
Gdl::DockItem &dock_item = old_panel.get_dock_item();
|
||||||
g_object_ref(dock_item);
|
|
||||||
|
|
||||||
// Release the old panel
|
// Release the old panel
|
||||||
remove_panel(&old_panel);
|
remove_panel(&old_panel);
|
||||||
|
|
||||||
// Create the new panel
|
// Create the new panel
|
||||||
create_panel_by_index(description_index, dock_item);
|
create_panel_by_index(description_index, dock_item);
|
||||||
g_object_unref(dock_item);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
PanelManager::split_panel(panels::Panel &panel,
|
PanelManager::split_panel(panels::Panel &panel,
|
||||||
Gtk::Orientation split_direction)
|
Gtk::Orientation split_direction)
|
||||||
{
|
{
|
||||||
|
|
||||||
// Create the new panel
|
// Create the new panel
|
||||||
const int index = get_panel_type(&panel);
|
const int index = get_panel_type(&panel);
|
||||||
panels::Panel *new_panel = create_panel_by_index(index);
|
panels::Panel *new_panel = create_panel_by_index(index);
|
||||||
|
|
||||||
// Dock the panel
|
// Dock the panel
|
||||||
GdlDockPlacement placement = GDL_DOCK_NONE;
|
Gdl::DockPlacement placement = Gdl::DOCK_NONE;
|
||||||
switch(split_direction)
|
switch(split_direction)
|
||||||
{
|
{
|
||||||
case ORIENTATION_HORIZONTAL:
|
case ORIENTATION_HORIZONTAL:
|
||||||
placement = GDL_DOCK_RIGHT;
|
placement = Gdl::DOCK_RIGHT;
|
||||||
break;
|
break;
|
||||||
case ORIENTATION_VERTICAL:
|
case ORIENTATION_VERTICAL:
|
||||||
placement = GDL_DOCK_BOTTOM;
|
placement = Gdl::DOCK_BOTTOM;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ERROR(gui, "Unrecognisized split_direction: %d", split_direction);
|
ERROR(gui, "Unrecognisized split_direction: %d",
|
||||||
|
split_direction);
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
gdl_dock_object_dock(GDL_DOCK_OBJECT(panel.get_dock_item()),
|
panel.get_dock_item().dock(
|
||||||
GDL_DOCK_OBJECT(new_panel->get_dock_item()), placement, NULL);
|
new_panel->get_dock_item(),placement);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
@ -225,13 +209,11 @@ PanelManager::create_panels()
|
||||||
create_panel_by_name("ViewerPanel");
|
create_panel_by_name("ViewerPanel");
|
||||||
panels::Panel* timelinePanel =
|
panels::Panel* timelinePanel =
|
||||||
create_panel_by_name("TimelinePanel");
|
create_panel_by_name("TimelinePanel");
|
||||||
|
|
||||||
gdl_dock_add_item(dock,
|
dock.add_item(assetsPanel->get_dock_item(),Gdl::DOCK_LEFT);
|
||||||
assetsPanel->get_dock_item(), GDL_DOCK_LEFT);
|
dock.add_item(timelinePanel->get_dock_item(),Gdl::DOCK_BOTTOM);
|
||||||
gdl_dock_add_item(dock,
|
dock.add_item(viewerPanel->get_dock_item(),Gdl::DOCK_RIGHT);
|
||||||
timelinePanel->get_dock_item(), GDL_DOCK_BOTTOM);
|
|
||||||
gdl_dock_add_item(dock,
|
|
||||||
viewerPanel->get_dock_item(), GDL_DOCK_RIGHT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
@ -261,15 +243,12 @@ PanelManager::create_panel_by_index(const int index)
|
||||||
snprintf(name, sizeof(name), "%X", panelID++);
|
snprintf(name, sizeof(name), "%X", panelID++);
|
||||||
|
|
||||||
// Create a dock item
|
// Create a dock item
|
||||||
GdlDockItem *dock_item = GDL_DOCK_ITEM(
|
return create_panel_by_index(index, *new Gdl::DockItem(name,"",Gdl::DOCK_ITEM_BEH_NORMAL));
|
||||||
gdl_dock_item_new(name, "", GDL_DOCK_ITEM_BEH_NORMAL));
|
|
||||||
|
|
||||||
return create_panel_by_index(index, dock_item);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
panels::Panel*
|
panels::Panel*
|
||||||
PanelManager::create_panel_by_index(
|
PanelManager::create_panel_by_index(
|
||||||
const int index, GdlDockItem *dock_item)
|
const int index, Gdl::DockItem &dock_item)
|
||||||
{
|
{
|
||||||
// Create the panel object
|
// Create the panel object
|
||||||
panels::Panel *panel =
|
panels::Panel *panel =
|
||||||
|
|
@ -278,8 +257,8 @@ PanelManager::create_panel_by_index(
|
||||||
panel->show_all();
|
panel->show_all();
|
||||||
|
|
||||||
// Connect event handlers
|
// Connect event handlers
|
||||||
panel->signal_hide_panel().connect(bind(
|
panel->signal_hide_panel().connect(sigc::bind(
|
||||||
mem_fun(*this, &PanelManager::on_panel_shown), panel));
|
sigc::mem_fun(*this, &PanelManager::on_panel_shown), panel));
|
||||||
|
|
||||||
// Add the panel to the list
|
// Add the panel to the list
|
||||||
panels.push_back(panel);
|
panels.push_back(panel);
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
#include "gui/panels/panel.hpp"
|
#include "gui/panels/panel.hpp"
|
||||||
|
|
||||||
#include <gdl/gdl.h>
|
#include <gdlmm.h>
|
||||||
#include <typeinfo>
|
#include <typeinfo>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -70,13 +70,13 @@ public:
|
||||||
* Gets a pointer to the dock object.
|
* Gets a pointer to the dock object.
|
||||||
* @remarks Note that this must not be called before setup_dock.
|
* @remarks Note that this must not be called before setup_dock.
|
||||||
*/
|
*/
|
||||||
GdlDock* get_dock() const;
|
Gdl::Dock& get_dock();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a pointer to the dock bar.
|
* Gets a pointer to the dock bar.
|
||||||
* @remarks Note that this must not be called before setup_dock.
|
* @remarks Note that this must not be called before setup_dock.
|
||||||
*/
|
*/
|
||||||
GdlDockBar* get_dock_bar() const;
|
Gdl::DockBar& get_dock_bar();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a reference to the owner workspace window.
|
* Returns a reference to the owner workspace window.
|
||||||
|
|
@ -157,7 +157,7 @@ private:
|
||||||
* @return Returns a pointer to the new instantiated panel object.
|
* @return Returns a pointer to the new instantiated panel object.
|
||||||
*/
|
*/
|
||||||
panels::Panel* create_panel_by_index(
|
panels::Panel* create_panel_by_index(
|
||||||
const int index, GdlDockItem *dock_item);
|
const int index, Gdl::DockItem &dock_item);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a panel by class name.
|
* Creates a panel by class name.
|
||||||
|
|
@ -204,19 +204,19 @@ private:
|
||||||
* The pointer to GDL dock widget.
|
* The pointer to GDL dock widget.
|
||||||
* @remarks This value is NULL until setup_dock has been called.
|
* @remarks This value is NULL until setup_dock has been called.
|
||||||
*/
|
*/
|
||||||
GdlDock *dock;
|
Gdl::Dock dock;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The pointer to GDL dock bar widget.
|
* The pointer to GDL dock bar widget.
|
||||||
* @remarks This value is NULL until setup_dock has been called.
|
* @remarks This value is NULL until setup_dock has been called.
|
||||||
*/
|
*/
|
||||||
GdlDockBar *dockBar;
|
Gdl::DockBar dockBar;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The pointer to GDL dock layout object.
|
* The pointer to GDL dock layout object.
|
||||||
* @remarks This value is NULL until setup_dock has been called.
|
* @remarks This value is NULL until setup_dock has been called.
|
||||||
*/
|
*/
|
||||||
GdlDockLayout *dockLayout;
|
Glib::RefPtr<Gdl::DockLayout> dockLayout;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pointers to the 4 root place holders.
|
* Pointers to the 4 root place holders.
|
||||||
|
|
@ -244,7 +244,7 @@ private:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
typedef panels::Panel* (*const CreatePanelProc)(
|
typedef panels::Panel* (*const CreatePanelProc)(
|
||||||
PanelManager&, GdlDockItem*);
|
PanelManager&, Gdl::DockItem&);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
|
|
@ -309,7 +309,7 @@ private:
|
||||||
* @return Returns a pointer to the panel object.
|
* @return Returns a pointer to the panel object.
|
||||||
*/
|
*/
|
||||||
panels::Panel* create(
|
panels::Panel* create(
|
||||||
PanelManager &panel_manager, GdlDockItem* dock_item) const
|
PanelManager &panel_manager, Gdl::DockItem &dock_item) const
|
||||||
{
|
{
|
||||||
REQUIRE(createPanelProc);
|
REQUIRE(createPanelProc);
|
||||||
return createPanelProc(panel_manager, dock_item);
|
return createPanelProc(panel_manager, dock_item);
|
||||||
|
|
@ -357,11 +357,11 @@ private:
|
||||||
/**
|
/**
|
||||||
* A helper function that will create a panel of type P
|
* A helper function that will create a panel of type P
|
||||||
* @param panel_manager The owner panel manager.
|
* @param panel_manager The owner panel manager.
|
||||||
* @param dock_item The GdlDockItem that will host this panel.
|
* @param dock_item The Gdl::DockItem that will host this panel.
|
||||||
* @return Returns a pointer to the panel object.
|
* @return Returns a pointer to the panel object.
|
||||||
*/
|
*/
|
||||||
static panels::Panel* create_panel(
|
static panels::Panel* create_panel(
|
||||||
PanelManager &panel_manager, GdlDockItem* dock_item)
|
PanelManager &panel_manager, Gdl::DockItem &dock_item)
|
||||||
{
|
{
|
||||||
return new P(panel_manager, dock_item);
|
return new P(panel_manager, dock_item);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,11 +30,6 @@
|
||||||
# include <libintl.h>
|
# include <libintl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//#include <gdl/gdl-tools.h>
|
|
||||||
#include <gdl/gdl-dock.h>
|
|
||||||
#include <gdl/gdl-dock-bar.h>
|
|
||||||
#include <gdl/gdl-dock-item.h>
|
|
||||||
#include <gdl/gdl-dock-placeholder.h>
|
|
||||||
|
|
||||||
|
|
||||||
using namespace Gtk;
|
using namespace Gtk;
|
||||||
|
|
@ -57,7 +52,7 @@ WorkspaceWindow::WorkspaceWindow(Project &source_project,
|
||||||
|
|
||||||
WorkspaceWindow::~WorkspaceWindow()
|
WorkspaceWindow::~WorkspaceWindow()
|
||||||
{
|
{
|
||||||
INFO (gui_dbg, "closing workspace window...");
|
INFO (gui_dbg, "Closing workspace window...");
|
||||||
}
|
}
|
||||||
|
|
||||||
Project&
|
Project&
|
||||||
|
|
@ -103,13 +98,8 @@ WorkspaceWindow::create_ui()
|
||||||
|
|
||||||
//----- Create the Docks -----//
|
//----- Create the Docks -----//
|
||||||
panelManager.setup_dock();
|
panelManager.setup_dock();
|
||||||
|
dockContainer.pack_start(panelManager.get_dock_bar(),false,false,0);
|
||||||
GdlDock const *dock = panelManager.get_dock();
|
dockContainer.pack_start(panelManager.get_dock(),true,true,0);
|
||||||
|
|
||||||
gtk_box_pack_start(GTK_BOX(dockContainer.gobj()),
|
|
||||||
GTK_WIDGET(panelManager.get_dock_bar()), FALSE, FALSE, 0);
|
|
||||||
gtk_box_pack_start(GTK_BOX(dockContainer.gobj()),
|
|
||||||
GTK_WIDGET(dock), TRUE, TRUE, 0);
|
|
||||||
baseContainer.pack_start(dockContainer, PACK_EXPAND_WIDGET);
|
baseContainer.pack_start(dockContainer, PACK_EXPAND_WIDGET);
|
||||||
|
|
||||||
//----- Create the status bar -----//
|
//----- Create the status bar -----//
|
||||||
|
|
@ -129,3 +119,4 @@ WorkspaceWindow::set_close_window_sensitive(bool enable)
|
||||||
|
|
||||||
} // namespace workspace
|
} // namespace workspace
|
||||||
} // namespace gui
|
} // namespace gui
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue