summaryrefslogtreecommitdiffstats
path: root/src/ui/widget/dock.cpp
diff options
context:
space:
mode:
authorMartin Owens <doctormo@gmail.com>2014-03-27 01:33:44 +0000
committerMartin Owens <doctormo@gmail.com>2014-03-27 01:33:44 +0000
commit5a4fb2325f60d292b47330f540b26a3279341c90 (patch)
treed2aa7967be25450b83e625025366c618101ae49f /src/ui/widget/dock.cpp
parentThe Polar Arrange Tab of the Arrange Dialog now hides the parametric (diff)
parentRemove Snap menu item and improve grid menu item text (diff)
downloadinkscape-5a4fb2325f60d292b47330f540b26a3279341c90.tar.gz
inkscape-5a4fb2325f60d292b47330f540b26a3279341c90.zip
Commit a merge to trunk, with probabal errors
(bzr r11073.1.36)
Diffstat (limited to 'src/ui/widget/dock.cpp')
-rw-r--r--src/ui/widget/dock.cpp50
1 files changed, 40 insertions, 10 deletions
diff --git a/src/ui/widget/dock.cpp b/src/ui/widget/dock.cpp
index ab3a8adca..52e9ea605 100644
--- a/src/ui/widget/dock.cpp
+++ b/src/ui/widget/dock.cpp
@@ -25,7 +25,7 @@ namespace Widget {
namespace {
-void hideCallback(GtkObject */*object*/, gpointer dock_ptr)
+void hideCallback(GObject * /*object*/, gpointer dock_ptr)
{
g_return_if_fail( dock_ptr != NULL );
@@ -33,7 +33,7 @@ void hideCallback(GtkObject */*object*/, gpointer dock_ptr)
dock->hide();
}
-void unhideCallback(GtkObject */*object*/, gpointer dock_ptr)
+void unhideCallback(GObject * /*object*/, gpointer dock_ptr)
{
g_return_if_fail( dock_ptr != NULL );
@@ -48,12 +48,33 @@ const int Dock::_default_dock_bar_width = 36;
Dock::Dock(Gtk::Orientation orientation)
- : _gdl_dock (GDL_DOCK (gdl_dock_new())),
- _gdl_dock_bar (GDL_DOCK_BAR (gdl_dock_bar_new(GDL_DOCK(_gdl_dock)))),
+ : _gdl_dock(gdl_dock_new()),
+#if WITH_GDL_3_6
+ _gdl_dock_bar(GDL_DOCK_BAR(gdl_dock_bar_new(G_OBJECT(_gdl_dock)))),
+#else
+ _gdl_dock_bar(GDL_DOCK_BAR(gdl_dock_bar_new(GDL_DOCK(_gdl_dock)))),
+#endif
_scrolled_window (Gtk::manage(new Gtk::ScrolledWindow))
{
- gdl_dock_bar_set_orientation(_gdl_dock_bar, static_cast<GtkOrientation>(orientation));
-
+#if WITH_GDL_3_6
+ gtk_orientable_set_orientation(GTK_ORIENTABLE(_gdl_dock_bar),
+ static_cast<GtkOrientation>(orientation));
+#else
+ gdl_dock_bar_set_orientation(_gdl_dock_bar,
+ static_cast<GtkOrientation>(orientation));
+#endif
+
+#if WITH_GTKMM_3_0
+ switch(orientation) {
+ case Gtk::ORIENTATION_VERTICAL:
+ _dock_box = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL));
+ break;
+ case Gtk::ORIENTATION_HORIZONTAL:
+ _dock_box = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL));
+ }
+
+ _paned = Gtk::manage(new Gtk::Paned(orientation));
+#else
switch (orientation) {
case Gtk::ORIENTATION_VERTICAL:
_dock_box = Gtk::manage(new Gtk::HBox());
@@ -63,6 +84,7 @@ Dock::Dock(Gtk::Orientation orientation)
_dock_box = Gtk::manage(new Gtk::VBox());
_paned = Gtk::manage(new Gtk::HPaned());
}
+#endif
_scrolled_window->add(*_dock_box);
_scrolled_window->set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
@@ -81,9 +103,15 @@ Dock::Dock(Gtk::Orientation orientation)
static_cast<GdlSwitcherStyle>(prefs->getIntLimited("/options/dock/switcherstyle",
GDL_SWITCHER_STYLE_BOTH, 0, 4));
- g_object_set (GDL_DOCK_OBJECT(_gdl_dock)->master,
- "switcher-style", gdl_switcher_style,
- NULL);
+ GdlDockMaster* master = NULL;
+
+ g_object_get(GDL_DOCK_OBJECT(_gdl_dock),
+ "master", &master,
+ NULL);
+
+ g_object_set(master,
+ "switcher-style", gdl_switcher_style,
+ NULL);
GdlDockBarStyle gdl_dock_bar_style =
static_cast<GdlDockBarStyle>(prefs->getIntLimited("/options/dock/dockbarstyle",
@@ -109,7 +137,9 @@ Dock::~Dock()
void Dock::addItem(DockItem& item, DockItem::Placement placement)
{
_dock_items.push_back(&item);
- gdl_dock_add_item(_gdl_dock, GDL_DOCK_ITEM(item.gobj()), (GdlDockPlacement)placement);
+ gdl_dock_add_item(GDL_DOCK(_gdl_dock),
+ GDL_DOCK_ITEM(item.gobj()),
+ (GdlDockPlacement)placement);
// FIXME: This is a hack to prevent the dock from expanding the main window, this can't be done
// initially as the paned doesn't exist.