Author: François Bobot <francois@bobot.eu>
Description: port to lablgtk3 beta6
Upstream-Commit f60a9ce7927a5219c1c58665449d70ba33f06fc6

diff --git a/configure.in b/configure.in
index 9a7012781..b9e432ca3 100644
--- a/configure.in
+++ b/configure.in
@@ -522,11 +522,11 @@ else
       DIR=$(ocamlfind query lablgtk3)
       if test -n "$DIR"; then
          echo "ocamlfind found lablgtk3 in $DIR"
-         LABLGTKINCLUDE="-I $DIR"
+         LABLGTKINCLUDE="-I $DIR -I +threads"
       fi
    fi
    if test -z "$DIR"; then
-      LABLGTKINCLUDE="-I +lablgtk3"
+      LABLGTKINCLUDE="-I +lablgtk3 -I +threads"
       DIR="$OCAMLLIB/lablgtk3"
       AC_CHECK_FILE($DIR/lablgtk.cma,,enable_ide=no)
    fi
@@ -570,12 +570,27 @@ fi
 if test "$enable_ide" = yes ; then
    DIR=
    if test "$USEOCAMLFIND" = yes; then
-      DIR=$(ocamlfind query lablgtk$GTKVERSION.sourceview$GTKVERSION)
-      if test -z "$DIR"; then
-         DIR=$(ocamlfind query lablgtksourceview$GTKVERSION)
-      fi
+      case $GTKVERSION in
+        2)
+           LIB_SOURCEVIEW=lablgtksourceview2
+           PKG_SOURCEVIEW=lablgtk2.sourceview2
+           DIR=$(ocamlfind query $PKG_SOURCEVIEW)
+           if test -z "$DIR"; then
+              PKG_SOURCEVIEW=lablgtksourceview2
+              DIR=$(ocamlfind query $PKG_SOURCEVIEW)
+           fi
+           ;;
+        3)
+           LIB_SOURCEVIEW=lablgtk3_sourceview3
+           PKG_SOURCEVIEW=lablgtk3-sourceview3
+           DIR=$(ocamlfind query $PKG_SOURCEVIEW)
+           ;;
+        *)
+           AC_MSG_ERROR(Unknown gtk version $GTKVERSION)
+           ;;
+      esac
       if test -n "$DIR";then
-         echo "ocamlfind found lablgtksourceview$GTKVERSION in $DIR"
+         echo "ocamlfind found $PKG_SOURCEVIEW in $DIR"
       fi
    fi
    if test -z "$DIR"; then
@@ -586,12 +601,25 @@ if test "$enable_ide" = yes ; then
    if test "$enable_ide" = no; then
       AC_MSG_WARN([Lib lablgtksourceview not found, IDE disabled.])
       reason_ide=" (lablgtksourceview not found)"
+   else
+      LABLGTKINCLUDE="$LABLGTKINCLUDE -I $DIR"
    fi
 fi
 
 if test "$enable_ide" = yes ; then
-   LABLGTKLIB="lablgtk lablgtksourceview$GTKVERSION"
-   LABLGTKPKG="lablgtk$GTKVERSION lablgtk$GTKVERSION.init lablgtk$GTKVERSION.sourceview$GTKVERSION"
+   case $GTKVERSION in
+        2)
+           LABLGTKLIB="lablgtk"
+           ;;
+        3)
+           LABLGTKLIB="threads lablgtk3"
+           ;;
+        *)
+           AC_MSG_ERROR(Unknown gtk version $GTKVERSION)
+           ;;
+      esac
+   LABLGTKLIB="$LABLGTKLIB $LIB_SOURCEVIEW"
+   LABLGTKPKG="lablgtk$GTKVERSION lablgtk$GTKVERSION.init $PKG_SOURCEVIEW"
 else
    LABLGTKLIB=
    LABLGTKPKG=
diff --git a/src/ide/gconfig.ml b/src/ide/gconfig.ml
index 7924eca34..879d4cf30 100644
--- a/src/ide/gconfig.ml
+++ b/src/ide/gconfig.ml
@@ -302,8 +302,8 @@ let get_main () = (get_main (config ()).config)
 let sans_font_family = "Sans"
 let mono_font_family = "Monospace"
 
-let modifiable_sans_font_views = ref []
-let modifiable_mono_font_views = ref []
+let modifiable_sans_font_views : GObj.misc_ops list ref = ref []
+let modifiable_mono_font_views : GObj.misc_ops list ref = ref []
 
 let add_modifiable_sans_font_view v =
   modifiable_sans_font_views := v :: !modifiable_sans_font_views
@@ -317,8 +317,8 @@ let change_font size =
 *)
   let sff = sans_font_family ^ " " ^ string_of_int size in
   let mff = mono_font_family ^ " " ^ string_of_int size in
-  let sf = Pango.Font.from_string sff in
-  let mf = Pango.Font.from_string mff in
+  let sf = Gtkcompat.gpango_font_description_from_string sff in
+  let mf = Gtkcompat.gpango_font_description_from_string mff in
   List.iter (fun v -> v#modify_font sf) !modifiable_sans_font_views;
   List.iter (fun v -> v#modify_font mf) !modifiable_mono_font_views
 
diff --git a/src/ide/gtkcompat2.ml b/src/ide/gtkcompat2.ml
index 9364769d9..f3a584958 100644
--- a/src/ide/gtkcompat2.ml
+++ b/src/ide/gtkcompat2.ml
@@ -11,3 +11,5 @@
 
 #13 "src/ide/gtkcompat2.ml"
 module GSourceView = GSourceView2
+
+let gpango_font_description_from_string = Pango.Font.from_string
diff --git a/src/ide/gtkcompat3.ml b/src/ide/gtkcompat3.ml
index 7ce686ada..8140004c7 100644
--- a/src/ide/gtkcompat3.ml
+++ b/src/ide/gtkcompat3.ml
@@ -11,3 +11,5 @@
 
 #13 "src/ide/gtkcompat3.ml"
 module GSourceView = GSourceView3
+
+let gpango_font_description_from_string = GPango.font_description_from_string
