f325b2
From 98252b0c534e71b65f720af9d97a6a358268076d Mon Sep 17 00:00:00 2001
f325b2
From: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
f325b2
Date: Mon, 12 Oct 2015 22:13:37 +0200
f325b2
Subject: [PATCH 205/398] Bump gtk+ version to 2.18
f325b2
MIME-Version: 1.0
f325b2
Content-Type: text/plain; charset=UTF-8
f325b2
Content-Transfer-Encoding: 8bit
f325b2
f325b2
2.18 is the version available in RHEL 6 released in 2010.
f325b2
f325b2
Change-Id: I4cd4fc89f6b51e6f58ca72b8182f80316b1f4f88
f325b2
Reviewed-on: https://gerrit.libreoffice.org/19330
f325b2
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
f325b2
Tested-by: Caolán McNamara <caolanm@redhat.com>
f325b2
(cherry picked from commit 068c04fb06806a9345c0059545d19a416d7e60b7)
f325b2
---
f325b2
 configure.ac                                       |  4 +--
f325b2
 .../qa/gtktiledviewer/gtktiledviewer.cxx           |  2 --
f325b2
 sfx2/source/appl/shutdowniconunx.cxx               |  6 ++---
f325b2
 vcl/unx/gtk/app/gtkdata.cxx                        |  5 ++--
f325b2
 vcl/unx/gtk/app/gtkinst.cxx                        |  4 +--
f325b2
 vcl/unx/gtk/app/gtksys.cxx                         |  4 ---
f325b2
 vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx           | 31 +++++++++-------------
f325b2
 vcl/unx/gtk/gdi/salprn-gtk.cxx                     | 14 ----------
f325b2
 vcl/unx/gtk/inc/gtkprintwrapper.hxx                |  6 -----
f325b2
 9 files changed, 20 insertions(+), 56 deletions(-)
f325b2
f325b2
diff --git a/configure.ac b/configure.ac
f325b2
index b1ec23a5afa3..12983e074c7d 100644
f325b2
--- a/configure.ac
f325b2
+++ b/configure.ac
f325b2
@@ -10126,7 +10126,7 @@ ENABLE_SYSTRAY_GTK=""
f325b2
 if test  "$test_gtk" = "yes"; then
f325b2
 
f325b2
     if test "$ENABLE_GTK" = "TRUE"; then
f325b2
-        PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.10.0 gdk-pixbuf-2.0 >= 2.2 ,,AC_MSG_ERROR([requirements to build the gtk-plugin not met. Use --disable-gtk or install the missing packages]))
f325b2
+        PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.18.0 gdk-pixbuf-2.0 >= 2.2 ,,AC_MSG_ERROR([requirements to build the gtk-plugin not met. Use --disable-gtk or install the missing packages]))
f325b2
         GTK_CFLAGS=$(printf '%s' "$GTK_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
f325b2
         PKG_CHECK_MODULES(GTHREAD, gthread-2.0,,AC_MSG_ERROR([requirements to build the gtk-plugin not met. Use --disable-gtk or install the missing packages]))
f325b2
         BUILD_TYPE="$BUILD_TYPE GTK"
f325b2
@@ -10185,7 +10185,7 @@ if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_telepathy" = "yes";
f325b2
     ENABLE_TELEPATHY="TRUE"
f325b2
     AC_DEFINE(ENABLE_TELEPATHY)
f325b2
     AC_MSG_RESULT([yes])
f325b2
-    PKG_CHECK_MODULES( TELEPATHY, telepathy-glib >= 0.18.0 glib-2.0 gobject-2.0 gthread-2.0 gio-2.0 gtk+-2.0 >= 2.10 )
f325b2
+    PKG_CHECK_MODULES( TELEPATHY, telepathy-glib >= 0.18.0 glib-2.0 gobject-2.0 gthread-2.0 gio-2.0 gtk+-2.0 >= 2.18.0 )
f325b2
     TELEPATHY_CFLAGS=$(printf '%s' "$TELEPATHY_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
f325b2
 else
f325b2
     AC_MSG_RESULT([no])
f325b2
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
f325b2
index 3b5d456586e6..e7e276dfce17 100644
f325b2
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
f325b2
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
f325b2
@@ -102,7 +102,6 @@ const float fZooms[] = { 0.25, 0.5, 0.75, 1.0, 1.5, 2.0, 3.0, 5.0 };
f325b2
 /// Get the visible area of the scrolled window
f325b2
 static void getVisibleAreaTwips(GtkWidget* pDocView, GdkRectangle* pArea)
f325b2
 {
f325b2
-#if GTK_CHECK_VERSION(2,14,0) // we need gtk_adjustment_get_page_size()
f325b2
     TiledWindow& rWindow = lcl_getTiledWindow(pDocView);
f325b2
 
f325b2
     GtkAdjustment* pHAdjustment = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(rWindow.m_pScrolledWindow));
f325b2
@@ -116,7 +115,6 @@ static void getVisibleAreaTwips(GtkWidget* pDocView, GdkRectangle* pArea)
f325b2
                                                gtk_adjustment_get_page_size(pHAdjustment));
f325b2
     pArea->height = lok_doc_view_pixel_to_twip(LOK_DOC_VIEW(pDocView),
f325b2
                                                gtk_adjustment_get_page_size(pVAdjustment));
f325b2
-#endif
f325b2
 }
f325b2
 
f325b2
 static void changeZoom( GtkWidget* pButton, gpointer /* pItem */ )
f325b2
diff --git a/sfx2/source/appl/shutdowniconunx.cxx b/sfx2/source/appl/shutdowniconunx.cxx
f325b2
index 90349f7261b0..2de5654fe28a 100644
f325b2
--- a/sfx2/source/appl/shutdowniconunx.cxx
f325b2
+++ b/sfx2/source/appl/shutdowniconunx.cxx
f325b2
@@ -370,10 +370,8 @@ void plugin_init_sys_tray()
f325b2
 {
f325b2
     ::SolarMutexGuard aGuard;
f325b2
 
f325b2
-    if( /* need gtk_status to resolve */
f325b2
-        (gtk_check_version( 2, 10, 0 ) != NULL) ||
f325b2
-        /* we need the vcl plugin and mainloop initialized */
f325b2
-        !g_type_from_name( "GdkDisplay" ) )
f325b2
+    /* we need the vcl plugin and mainloop initialized */
f325b2
+    if (!g_type_from_name( "GdkDisplay" ))
f325b2
         return;
f325b2
 
f325b2
     OString aLabel;
f325b2
diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx
f325b2
index 445ae0a61772..ec2886fa4172 100644
f325b2
--- a/vcl/unx/gtk/app/gtkdata.cxx
f325b2
+++ b/vcl/unx/gtk/app/gtkdata.cxx
f325b2
@@ -750,9 +750,8 @@ void GtkData::Init()
f325b2
             pDisplay->monitorsChanged( pScreen );
f325b2
             g_signal_connect( G_OBJECT(pScreen), "size-changed",
f325b2
                               G_CALLBACK(signalScreenSizeChanged), pDisplay );
f325b2
-            if( ! gtk_check_version( 2, 14, 0 ) ) // monitors-changed came in with 2.14, avoid an assertion
f325b2
-                g_signal_connect( G_OBJECT(pScreen), "monitors-changed",
f325b2
-                                  G_CALLBACK(signalMonitorsChanged), GetGtkDisplay() );
f325b2
+            g_signal_connect( G_OBJECT(pScreen), "monitors-changed",
f325b2
+                              G_CALLBACK(signalMonitorsChanged), GetGtkDisplay() );
f325b2
         }
f325b2
     }
f325b2
 }
f325b2
diff --git a/vcl/unx/gtk/app/gtkinst.cxx b/vcl/unx/gtk/app/gtkinst.cxx
f325b2
index 601fd2152d1d..636049702280 100644
f325b2
--- a/vcl/unx/gtk/app/gtkinst.cxx
f325b2
+++ b/vcl/unx/gtk/app/gtkinst.cxx
f325b2
@@ -89,14 +89,12 @@ extern "C"
f325b2
         }
f325b2
 
f325b2
         const gchar* pVersion = gtk_check_version( 3, 2, 0 );
f325b2
-#else
f325b2
-        const gchar* pVersion = gtk_check_version( 2, 2, 0 );
f325b2
-#endif
f325b2
         if( pVersion )
f325b2
         {
f325b2
             SAL_WARN("vcl.gtk", "gtk version conflict: " << pVersion);
f325b2
             return NULL;
f325b2
         }
f325b2
+#endif
f325b2
 
f325b2
         GtkYieldMutex *pYieldMutex;
f325b2
 
f325b2
diff --git a/vcl/unx/gtk/app/gtksys.cxx b/vcl/unx/gtk/app/gtksys.cxx
f325b2
index 7d687b23943f..42d848ceb686 100644
f325b2
--- a/vcl/unx/gtk/app/gtksys.cxx
f325b2
+++ b/vcl/unx/gtk/app/gtksys.cxx
f325b2
@@ -195,7 +195,6 @@ bool GtkSalSystem::IsUnifiedDisplay()
f325b2
 }
f325b2
 
f325b2
 namespace {
f325b2
-#if GTK_CHECK_VERSION(2,14,0)
f325b2
 static int _fallback_get_primary_monitor (GdkScreen *pScreen)
f325b2
 {
f325b2
     // Use monitor name as primacy heuristic
f325b2
@@ -210,7 +209,6 @@ static int _fallback_get_primary_monitor (GdkScreen *pScreen)
f325b2
     }
f325b2
     return 0;
f325b2
 }
f325b2
-#endif
f325b2
 
f325b2
 static int _get_primary_monitor (GdkScreen *pScreen)
f325b2
 {
f325b2
@@ -224,10 +222,8 @@ static int _get_primary_monitor (GdkScreen *pScreen)
f325b2
         get_fn = reinterpret_cast<int(*)(GdkScreen*)>(osl_getAsciiFunctionSymbol(NULL,
f325b2
             "gdk_screen_get_primary_monitor"));
f325b2
     }
f325b2
-#if GTK_CHECK_VERSION(2,14,0)
f325b2
     if (!get_fn)
f325b2
         get_fn = _fallback_get_primary_monitor;
f325b2
-#endif
f325b2
     if (get_fn)
f325b2
         return get_fn (pScreen);
f325b2
     else
f325b2
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
f325b2
index 122059656f89..6512803bfaa0 100644
f325b2
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
f325b2
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
f325b2
@@ -3163,7 +3163,6 @@ bool GtkSalGraphics::NWPaintGTKToolbar(
f325b2
             {
f325b2
                 const double shim = 0.2;
f325b2
 
f325b2
-#if GTK_CHECK_VERSION(2,10,0)
f325b2
                 gint separator_height, separator_width, wide_separators = 0;
f325b2
 
f325b2
                 gtk_widget_style_get (gWidgetData[m_nXScreen].gSeparator,
f325b2
@@ -3188,7 +3187,6 @@ bool GtkSalGraphics::NWPaintGTKToolbar(
f325b2
                                        w * (1 - 2*shim), separator_width);
f325b2
                 }
f325b2
                 else
f325b2
-#endif
f325b2
                 {
f325b2
                     if (nPart == PART_SEPARATOR_VERT)
f325b2
                         gtk_paint_vline (gWidgetData[m_nXScreen].gSeparator->style, gdkDrawable,
f325b2
@@ -4017,23 +4015,20 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
f325b2
     aStyleSet.SetHighlightColor( aHighlightColor );
f325b2
     aStyleSet.SetHighlightTextColor( aHighlightTextColor );
f325b2
 
f325b2
-    if( ! gtk_check_version( 2, 10, 0 ) ) // link colors came in with 2.10, avoid an assertion
f325b2
+    // hyperlink colors
f325b2
+    GdkColor *link_color = NULL;
f325b2
+    gtk_widget_style_get (m_pWindow, "link-color", &link_color, NULL);
f325b2
+    if (link_color)
f325b2
     {
f325b2
-        // hyperlink colors
f325b2
-        GdkColor *link_color = NULL;
f325b2
-        gtk_widget_style_get (m_pWindow, "link-color", &link_color, NULL);
f325b2
-        if (link_color)
f325b2
-        {
f325b2
-            aStyleSet.SetLinkColor(getColor(*link_color));
f325b2
-            gdk_color_free (link_color);
f325b2
-            link_color = NULL;
f325b2
-        }
f325b2
-        gtk_widget_style_get (m_pWindow, "visited-link-color", &link_color, NULL);
f325b2
-        if (link_color)
f325b2
-        {
f325b2
-            aStyleSet.SetVisitedLinkColor(getColor(*link_color));
f325b2
-            gdk_color_free (link_color);
f325b2
-        }
f325b2
+        aStyleSet.SetLinkColor(getColor(*link_color));
f325b2
+        gdk_color_free (link_color);
f325b2
+        link_color = NULL;
f325b2
+    }
f325b2
+    gtk_widget_style_get (m_pWindow, "visited-link-color", &link_color, NULL);
f325b2
+    if (link_color)
f325b2
+    {
f325b2
+        aStyleSet.SetVisitedLinkColor(getColor(*link_color));
f325b2
+        gdk_color_free (link_color);
f325b2
     }
f325b2
 
f325b2
     // Tab colors
f325b2
diff --git a/vcl/unx/gtk/gdi/salprn-gtk.cxx b/vcl/unx/gtk/gdi/salprn-gtk.cxx
f325b2
index 650276c3a1f4..1ae010e886c9 100644
f325b2
--- a/vcl/unx/gtk/gdi/salprn-gtk.cxx
f325b2
+++ b/vcl/unx/gtk/gdi/salprn-gtk.cxx
f325b2
@@ -318,15 +318,9 @@ lcl_setHelpText(
f325b2
         const uno::Sequence<OUString>& i_rHelpTexts,
f325b2
         const sal_Int32 i_nIndex)
f325b2
 {
f325b2
-#if GTK_CHECK_VERSION(2,12,0)
f325b2
     if (i_nIndex >= 0 && i_nIndex < i_rHelpTexts.getLength())
f325b2
         gtk_widget_set_tooltip_text(io_pWidget,
f325b2
             OUStringToOString(i_rHelpTexts.getConstArray()[i_nIndex], RTL_TEXTENCODING_UTF8).getStr());
f325b2
-#else
f325b2
-    (void)io_pWidget;
f325b2
-    (void)i_rHelpTexts;
f325b2
-    (void)i_nIndex;
f325b2
-#endif
f325b2
 }
f325b2
 
f325b2
 static GtkWidget*
f325b2
@@ -429,12 +423,8 @@ GtkPrintDialog::impl_initDialog()
f325b2
             | GTK_PRINT_CAPABILITY_COLLATE
f325b2
             | GTK_PRINT_CAPABILITY_REVERSE
f325b2
             | GTK_PRINT_CAPABILITY_GENERATE_PS
f325b2
-#if GTK_CHECK_VERSION(2,12,0)
f325b2
             | GTK_PRINT_CAPABILITY_NUMBER_UP
f325b2
-#endif
f325b2
-#if GTK_CHECK_VERSION(2,14,0)
f325b2
             | GTK_PRINT_CAPABILITY_NUMBER_UP_LAYOUT
f325b2
-#endif
f325b2
        ));
f325b2
 }
f325b2
 
f325b2
@@ -787,11 +777,9 @@ GtkPrintDialog::impl_initPrintContent(uno::Sequence<sal_Bool> const& i_rDisabled
f325b2
                 ePrintPages = GTK_PRINT_PAGES_RANGES;
f325b2
                 break;
f325b2
             case 2:
f325b2
-#if GTK_CHECK_VERSION(2,14,0)
f325b2
                 if (m_xWrapper->supportsPrintSelection())
f325b2
                     ePrintPages = GTK_PRINT_PAGES_SELECTION;
f325b2
                 else
f325b2
-#endif
f325b2
                     SAL_INFO("vcl.gtk", "the application wants to print a selection, but the present gtk version does not support it");
f325b2
                 break;
f325b2
             default:
f325b2
@@ -999,7 +987,6 @@ void GtkPrintDialog::ExportAsPDF(const OUString &rFileURL, GtkPrintSettings *pSe
f325b2
             }
f325b2
             catch (...) {}
f325b2
         }
f325b2
-#if GTK_CHECK_VERSION(2,17,5)
f325b2
         if (gtk_print_unix_dialog_get_has_selection(GTK_PRINT_UNIX_DIALOG(m_pDialog)))
f325b2
         {
f325b2
             uno::Any aSelection;
f325b2
@@ -1022,7 +1009,6 @@ void GtkPrintDialog::ExportAsPDF(const OUString &rFileURL, GtkPrintSettings *pSe
f325b2
                 aFilterData[aFilterData.getLength()-1].Value <<= aSelection;
f325b2
             }
f325b2
         }
f325b2
-#endif
f325b2
         uno::Sequence<beans::PropertyValue> aArgs(2);
f325b2
         aArgs[0].Name = "FilterData";
f325b2
         aArgs[0].Value <<= aFilterData;
f325b2
diff --git a/vcl/unx/gtk/inc/gtkprintwrapper.hxx b/vcl/unx/gtk/inc/gtkprintwrapper.hxx
f325b2
index 009903254606..99d435cd7f8e 100644
f325b2
--- a/vcl/unx/gtk/inc/gtkprintwrapper.hxx
f325b2
+++ b/vcl/unx/gtk/inc/gtkprintwrapper.hxx
f325b2
@@ -13,13 +13,7 @@
f325b2
 #include <gtk/gtk.h>
f325b2
 
f325b2
 #if defined ENABLE_GTK_PRINT || GTK_CHECK_VERSION(3,0,0)
f325b2
-#if GTK_CHECK_VERSION(2,14,0)
f325b2
 #include <gtk/gtkunixprint.h>
f325b2
-#else
f325b2
-#include <gtk/gtkprintjob.h>
f325b2
-#include <gtk/gtkpagesetupunixdialog.h>
f325b2
-#include <gtk/gtkprintunixdialog.h>
f325b2
-#endif
f325b2
 
f325b2
 #include <osl/module.hxx>
f325b2
 #include <sal/types.h>
f325b2
-- 
f325b2
2.12.0
f325b2