Add support for gtkmm-3.0 and prefer it over gtkmm-2.* by default.

Pass --disable-gtk3 to configure to build against gtk2
This commit is contained in:
Marc-Antoine Perennou 2011-03-26 23:29:37 +01:00 committed by Colin Guthrie
parent 26d42651c5
commit 964de9fc7f
2 changed files with 24 additions and 1 deletions

View File

@ -39,7 +39,26 @@ AC_PROG_LN_S
AC_TYPE_SIGNAL
AC_HEADER_STDC
PKG_CHECK_MODULES(GUILIBS, [ gtkmm-2.4 >= 2.16 sigc++-2.0 libcanberra-gtk >= 0.16 ])
AC_ARG_ENABLE(gtk3,
[AS_HELP_STRING([--disable-gtk3],
[Whether to build or not against gtk3 [default=yes]])],
[enable_gtk3=$enableval],
[enable_gtk3="yes"])
if test "x$enable_gtk3" = "xyes"; then
gtkmm_ver="3.0"
gtkmm_min_ver="2.99"
canberra_ver="3"
AC_DEFINE([HAVE_GTK3], [1], [Define if we are building against gtk3])
echo "***"
echo "*** Attempting build in GTK3 mode. Use --disable-gtk3 to build for GTK2"
echo "***"
else
gtkmm_ver="2.4"
gtkmm_min_ver="2.16"
canberra_ver=""
fi
PKG_CHECK_MODULES(GUILIBS, [ gtkmm-$gtkmm_ver >= $gtkmm_min_ver sigc++-2.0 libcanberra-gtk$canberra_ver >= 0.16 ])
AC_SUBST(GUILIBS_CFLAGS)
AC_SUBST(GUILIBS_LIBS)

View File

@ -152,7 +152,11 @@ MainWindow* MainWindow::create() {
void MainWindow::on_realize() {
Gtk::Window::on_realize();
#ifdef HAVE_GTK3
get_window()->set_cursor(Gdk::Cursor::create(Gdk::WATCH));
#else
get_window()->set_cursor(Gdk::Cursor(Gdk::WATCH));
#endif /* HAVE_GTK3 */
}
MainWindow::~MainWindow() {