[libpeas] Drop support for GTK+ 2



commit 6343d82566d84ef529d77b0489588fdce83ffcf4
Author: Steve Frécinaux <code istique net>
Date:   Wed Apr 13 10:43:09 2011 +0200

    Drop support for GTK+ 2

 configure.ac                                  |   28 ++++++++-----------------
 data/libpeas-gtk-1.0.pc.in                    |    2 +-
 libpeas-gtk/Makefile.am                       |    2 +-
 libpeas-gtk/peas-gtk-disable-plugins-dialog.c |    4 ---
 libpeas-gtk/peas-gtk-plugin-manager-view.c    |    8 -------
 libpeas-gtk/peas-gtk-plugin-manager.c         |   23 --------------------
 peas-demo/peas-demo.c                         |    2 -
 tests/libpeas-gtk/testing/testing.c           |    2 -
 8 files changed, 11 insertions(+), 60 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 7a35cf0..1ef2399 100644
--- a/configure.ac
+++ b/configure.ac
@@ -90,33 +90,23 @@ dnl ================================================================
 dnl Build libpeas-gtk
 dnl ================================================================
 
+GTK_REQUIRED=2.91.1
+
 AC_ARG_ENABLE(gtk,
 	      AS_HELP_STRING([--enable-gtk],[Build libpeas-gtk for Gtk widgetry]),
 	      [enable_gtk=$enableval],
 	      [enable_gtk=yes])
 
-dnl We currently allow building libpeas with Gtk+ 2.0 for testing purposes and
-dnl technology preview. but do *not* distribute such a version!
-AC_ARG_ENABLE(gtk2-test-build,
-	      AS_HELP_STRING([--enable-gtk2-test-build],[Link against gtk+ 2.0, for testing purpose]),
-	      [use_gtk2=$enableval],
-	      [use_gtk2=no])
-
 if test "$enable_gtk" = "yes"; then
-	if test "$use_gtk2" != "yes"; then
-		GTK_TYPELIB=Gtk-3.0
-		GTK_PKG_REQUIREMENT="gtk+-3.0 >= 2.90"
-		GDK_REQUIRED=gdk-3.0
-	else
-		GTK_TYPELIB=Gtk-2.0
-		GTK_PKG_REQUIREMENT="gtk+-2.0 >= 2.16"
-		GDK_REQUIRED=gdk-2.0
-	fi
-	PKG_CHECK_MODULES(PEAS_GTK, [$GTK_PKG_REQUIREMENT])
+	GTK_TYPELIB=Gtk-3.0
+	PKG_CHECK_MODULES(PEAS_GTK, [
+		gtk+-3.0 >= $GTK_REQUIRED
+	])
 	AC_SUBST(GTK_TYPELIB)
-	AC_SUBST(GTK_PKG_REQUIREMENT)
 fi
 
+AC_SUBST(GTK_REQUIRED)
+
 AM_CONDITIONAL([ENABLE_GTK],[test "x$enable_gtk" = "xyes"])
 
 dnl ================================================================
@@ -125,7 +115,7 @@ dnl ================================================================
 AC_MSG_CHECKING([for native Mac OS X])
 
 
-gdk_windowing=`$PKG_CONFIG --variable=target $GDK_REQUIRED`
+gdk_windowing=`$PKG_CONFIG --variable=target gdk-3.0`
 
 if test "$gdk_windowing" = "quartz"; then
 	os_osx=yes
diff --git a/data/libpeas-gtk-1.0.pc.in b/data/libpeas-gtk-1.0.pc.in
index 61d2ac8..e305e09 100644
--- a/data/libpeas-gtk-1.0.pc.in
+++ b/data/libpeas-gtk-1.0.pc.in
@@ -5,7 +5,7 @@ includedir= includedir@
 
 Name: libpeas-gtk
 Description: libpeas-gtk, a GObject plugins library (Gtk widgets)
-Requires: glib-2.0 >= @GLIB_REQUIRED@, @GTK_PKG_REQUIREMENT@, libpeas-1.0 >= @VERSION@
+Requires: glib-2.0 >= @GLIB_REQUIRED@, gtk+-3.0 >= @GTK_REQUIRED@, libpeas-1.0 >= @VERSION@
 Version: @VERSION@
 Cflags: -I${includedir}/libpeas-1.0
 Libs: -L${libdir} -lpeas-gtk-1.0
diff --git a/libpeas-gtk/Makefile.am b/libpeas-gtk/Makefile.am
index b6e1892..aeef828 100644
--- a/libpeas-gtk/Makefile.am
+++ b/libpeas-gtk/Makefile.am
@@ -58,7 +58,7 @@ if HAVE_INTROSPECTION
   introspection_sources = $(INST_H_FILES) $(C_FILES)
 
   PeasGtk-1.0.gir: libpeas-gtk-1.0.la
-  PeasGtk_1_0_gir_INCLUDES = GObject-2.0 $(GTK_TYPELIB)
+  PeasGtk_1_0_gir_INCLUDES = GObject-2.0 Gtk-3.0
   PeasGtk_1_0_gir_CFLAGS = $(PEAS_CFLAGS) $(PEAS_GTK_CFLAGS) -I$(top_srcdir)
   PeasGtk_1_0_gir_LIBS = libpeas-gtk-1.0.la
   PeasGtk_1_0_gir_FILES = $(addprefix $(srcdir)/,$(introspection_sources))
diff --git a/libpeas-gtk/peas-gtk-disable-plugins-dialog.c b/libpeas-gtk/peas-gtk-disable-plugins-dialog.c
index 3958a7f..7d2d1cc 100644
--- a/libpeas-gtk/peas-gtk-disable-plugins-dialog.c
+++ b/libpeas-gtk/peas-gtk-disable-plugins-dialog.c
@@ -174,10 +174,6 @@ peas_gtk_disable_plugins_dialog_init (PeasGtkDisablePluginsDialog *dialog)
 
   gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
 
-#if !GTK_CHECK_VERSION(2,90,7)
-  g_object_set (dialog, "has-separator", FALSE, NULL);
-#endif
-
   gtk_dialog_add_button (GTK_DIALOG (dialog),
                          GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
   gtk_dialog_add_button (GTK_DIALOG (dialog),
diff --git a/libpeas-gtk/peas-gtk-plugin-manager-view.c b/libpeas-gtk/peas-gtk-plugin-manager-view.c
index 009fcca..32f9bb3 100644
--- a/libpeas-gtk/peas-gtk-plugin-manager-view.c
+++ b/libpeas-gtk/peas-gtk-plugin-manager-view.c
@@ -397,12 +397,8 @@ menu_position_under_tree_view (GtkMenu     *menu,
       if (gtk_widget_get_direction (GTK_WIDGET (tree_view)) == GTK_TEXT_DIR_RTL)
         {
           GtkRequisition requisition;
-#if !GTK_CHECK_VERSION(2,90,7)
-          gtk_widget_size_request (GTK_WIDGET (menu), &requisition);
-#else
           gtk_widget_get_preferred_size (GTK_WIDGET (menu), &requisition,
                                          NULL);
-#endif
           *x += rect.width - requisition.width;
         }
     }
@@ -419,12 +415,8 @@ menu_position_under_tree_view (GtkMenu     *menu,
         {
           GtkRequisition requisition;
 
-#if !GTK_CHECK_VERSION(2,90,7)
-          gtk_widget_size_request (GTK_WIDGET (menu), &requisition);
-#else
           gtk_widget_get_preferred_size (GTK_WIDGET (menu), &requisition,
                                          NULL);
-#endif
 
           *x += allocation.width - requisition.width;
         }
diff --git a/libpeas-gtk/peas-gtk-plugin-manager.c b/libpeas-gtk/peas-gtk-plugin-manager.c
index 237c373..3ec4922 100644
--- a/libpeas-gtk/peas-gtk-plugin-manager.c
+++ b/libpeas-gtk/peas-gtk-plugin-manager.c
@@ -141,25 +141,6 @@ show_about_cb (GtkWidget            *widget,
   gtk_widget_show (pm->priv->about);
 }
 
-#if !GTK_CHECK_VERSION(2,22,0)
-static gboolean
-gtk_window_has_group (GtkWindow *window)
-{
-  GtkWindowGroup *wg;
-  static GtkWindowGroup *default_wg = NULL;
-
-  if (!default_wg)
-    {
-      GtkWidget *temp_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-      default_wg = gtk_window_get_group (GTK_WINDOW (temp_window));
-      gtk_widget_destroy (temp_window);
-    }
-
-  wg = gtk_window_get_group (window);
-  return wg != NULL && wg != default_wg;
-}
-#endif
-
 static void
 help_button_cb (GtkWidget      *button,
                 PeasPluginInfo *info)
@@ -252,11 +233,7 @@ show_configure_cb (GtkWidget            *widget,
 
   conf_dlg = gtk_dialog_new_with_buttons (peas_plugin_info_get_name (info),
                                           toplevel,
-#if !GTK_CHECK_VERSION(2,90,7)
-                                          GTK_DIALOG_NO_SEPARATOR,
-#else
                                           0,
-#endif
                                           GTK_STOCK_CLOSE,
                                           GTK_RESPONSE_CLOSE,
                                           NULL);
diff --git a/peas-demo/peas-demo.c b/peas-demo/peas-demo.c
index debe8a9..78d5644 100644
--- a/peas-demo/peas-demo.c
+++ b/peas-demo/peas-demo.c
@@ -63,9 +63,7 @@ create_main_window (void)
   gtk_container_set_border_width (GTK_CONTAINER (window), 6);
   gtk_window_set_title (GTK_WINDOW (window), "Peas Demo");
 
-#if GTK_CHECK_VERSION(2,91,1)
   gtk_window_set_has_resize_grip (GTK_WINDOW (window), FALSE);
-#endif
 
   box = gtk_vbox_new (FALSE, 6);
   gtk_container_add (GTK_CONTAINER (window), box);
diff --git a/tests/libpeas-gtk/testing/testing.c b/tests/libpeas-gtk/testing/testing.c
index f102334..5efaf32 100644
--- a/tests/libpeas-gtk/testing/testing.c
+++ b/tests/libpeas-gtk/testing/testing.c
@@ -151,9 +151,7 @@ testing_show_widget (gpointer widget)
 
   gtk_window_set_default_size (GTK_WINDOW (window), 200, 100);
 
-#if GTK_CHECK_VERSION(2,91,1)
   gtk_window_set_has_resize_grip (GTK_WINDOW (window), FALSE);
-#endif
 
   gtk_widget_show_all (window);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]