summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Valavanis <valavanisalex@gmail.com>2013-07-06 10:19:17 +0000
committerAlex Valavanis <valavanisalex@gmail.com>2013-07-06 10:19:17 +0000
commit2a5484afeb64207849e1dcdd9336fd4b0aaab06b (patch)
tree86b947f819c7a8723987c057700f0ace2d9da7ba
parentFix verbs that were out by 5 because of missing script verbs (broken between ... (diff)
downloadinkscape-2a5484afeb64207849e1dcdd9336fd4b0aaab06b.tar.gz
inkscape-2a5484afeb64207849e1dcdd9336fd4b0aaab06b.zip
Fix build failure with GDL >= 3.6
Fixed bugs: - https://launchpad.net/bugs/1196070 (bzr r12407)
-rw-r--r--configure.ac10
-rw-r--r--src/ui/widget/dock.cpp20
-rw-r--r--src/ui/widget/dock.h10
3 files changed, 31 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index 0e5c15382..b2b794617 100644
--- a/configure.ac
+++ b/configure.ac
@@ -674,6 +674,16 @@ if test "x$enable_gtk3" = "xyes"; then
AC_MSG_ERROR([Some dependencies were not fulfilled for the experimental GTK+ 3 build. One possible cause for this is a new dependency on the gdl-3.0 development package.])
fi
+ # Check whether we are using Gdl >= 3.6. This version introduced an API/ABI change.
+ # TODO: We should drop support for older versions of Gdl once all supported distros
+ # provide Gdl 3.6 or higher
+ PKG_CHECK_MODULES(GDL_3_6, gdl-3.0 >= 3.6, with_gdl_3_6=yes, with_gdl_3_6=no)
+
+ if test "x$with_gdl_3_6" = "xyes"; then
+ AC_MSG_RESULT([Using Gdl 3.6 or higher])
+ AC_DEFINE(WITH_GDL_3_6,1,[Build with Gdl 3.6 or higher])
+ fi
+
dnl The following test is only defined if Gtk+ 3 development libraries
dnl are installed on the system. Therefore, it is guarded by an
dnl m4_ifdef statement. The ifdef can be probably be removed once we
diff --git a/src/ui/widget/dock.cpp b/src/ui/widget/dock.cpp
index 2bfc7e0df..52e9ea605 100644
--- a/src/ui/widget/dock.cpp
+++ b/src/ui/widget/dock.cpp
@@ -48,11 +48,21 @@ 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) {
@@ -127,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.
diff --git a/src/ui/widget/dock.h b/src/ui/widget/dock.h
index 611c10f46..33e60b836 100644
--- a/src/ui/widget/dock.h
+++ b/src/ui/widget/dock.h
@@ -74,11 +74,11 @@ protected:
/** Interface widgets, will be packed like
* _scrolled_window -> (_dock_box -> (_paned -> (_dock -> _filler) | _dock_bar))
*/
- Gtk::Box *_dock_box;
- Gtk::Paned* _paned;
- GdlDock *_gdl_dock;
- GdlDockBar *_gdl_dock_bar;
- Gtk::VBox _filler;
+ Gtk::Box *_dock_box;
+ Gtk::Paned *_paned;
+ GtkWidget *_gdl_dock;
+ GdlDockBar *_gdl_dock_bar;
+ Gtk::VBox _filler;
Gtk::ScrolledWindow *_scrolled_window;
/** Internal signal handlers */