[aravis] viewer: drop gtk2 support and make libnotify mandatory.



commit 05e65886c42ca6abc40b4f5191e61c94e8bd2084
Author: Emmanuel Pacaud <emmanuel gnome org>
Date:   Tue Feb 4 22:21:43 2014 +0100

    viewer: drop gtk2 support and make libnotify mandatory.

 configure.ac           |   24 +---
 viewer/Makefile.am     |    4 -
 viewer/arv-viewer-2.ui |  365 ------------------------------------------------
 viewer/arvviewer.c     |   14 --
 4 files changed, 1 insertions(+), 406 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index e533e4a..78b1bdc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -39,14 +39,6 @@ AC_ARG_ENABLE(viewer,
              [  --enable-viewer         build viewer],
              [enable_viewer=$enableval],
              [enable_viewer=no])
-AC_ARG_ENABLE(gtk3,
-             [  --enable-gtk3           build viewer with gtk+-3.0],
-             [enable_gtk3=$enableval],
-             [enable_gtk3=no])
-AC_ARG_ENABLE(notify,
-             [  --enable-notify         build viewer with libnotify],
-             [enable_notify=$enableval],
-             [enable_notify=no])
 AC_ARG_ENABLE(cpp_test,
              [  --enable-cpp-test       build c++ test],
              [enable_cpp_test=$enableval],
@@ -56,6 +48,7 @@ PKG_PROG_PKG_CONFIG([0.14])
 
 ARAVIS_REQUIREMENTS="glib-2.0 >= 2.26 gobject-2.0 gio-2.0 libxml-2.0 gthread-2.0 zlib"
 ARAVIS_GSTREAMER_REQUIREMENTS="gstreamer-base-1.0 gstreamer-app-1.0"
+ARAVIS_VIEWER_REQUIREMENTS="$ARAVIS_GSTREAMER_REQUIREMENTS gstreamer-video-1.0 gtk+-3.0 libnotify"
 
 PKG_CHECK_MODULES(ARAVIS, [$ARAVIS_REQUIREMENTS])
 
@@ -67,21 +60,6 @@ AC_SUBST(ARAVIS_LIBS)
 
 AC_SUBST(aravis_datadir, '$(datadir)/aravis-$(ARAVIS_API_VERSION)')
 
-ARAVIS_VIEWER_REQUIREMENTS="$ARAVIS_GSTREAMER_REQUIREMENTS gstreamer-video-1.0"
-if test "x$enable_gtk3" = "xyes"; then
-       ARAVIS_VIEWER_REQUIREMENTS+=" gtk+-3.0"
-else
-       ARAVIS_VIEWER_REQUIREMENTS+=" gtk+-2.0 >= 2.14"
-fi
-AM_CONDITIONAL(ARAVIS_WITH_GTK3, test "x$enable_gtk3" = "xyes")
-
-if test "x$enable_notify" = "xyes"; then
-       PKG_CHECK_MODULES(Notify, "libnotify")
-       ARAVIS_VIEWER_REQUIREMENTS+=" libnotify"
-       AC_DEFINE([ARAVIS_WITH_NOTIFY], 1, [Use libnotify])
-fi
-AM_CONDITIONAL(ARAVIS_WITH_NOTIFY, test "x$enable_notify" = "xyes")
-
 build_viewer=no
 if test "x$enable_viewer" = "xyes"; then
        PKG_CHECK_MODULES([ARAVIS_VIEWER], [$ARAVIS_VIEWER_REQUIREMENTS],
diff --git a/viewer/Makefile.am b/viewer/Makefile.am
index 9bab24b..6867a06 100644
--- a/viewer/Makefile.am
+++ b/viewer/Makefile.am
@@ -18,11 +18,7 @@ arv_viewer_SOURCES = arvviewer.c
 
 arv_viewer_LDADD = $(ARAVIS_VIEWER_LIBS) $(top_builddir)/src/libaravis- ARAVIS_API_VERSION@.la
 arv_viewerdir = $(aravis_datadir)
-if ARAVIS_WITH_GTK3
 arv_viewer_DATA = arv-viewer-3.ui
-else
-arv_viewer_DATA = arv-viewer-2.ui
-endif
 
 EXTRA_DIST += arv-viewer-2.ui arv-viewer-3.ui
 
diff --git a/viewer/arvviewer.c b/viewer/arvviewer.c
index a8abe50..ccce122 100644
--- a/viewer/arvviewer.c
+++ b/viewer/arvviewer.c
@@ -30,9 +30,7 @@
 #include <stdlib.h>
 #include <math.h>
 #include <glib/gi18n-lib.h>
-#ifdef ARAVIS_WITH_NOTIFY
 #include <libnotify/notify.h>
-#endif
 
 static char *arv_viewer_option_debug_domains = NULL;
 static gboolean arv_viewer_option_auto_socket_buffer = FALSE;
@@ -89,9 +87,7 @@ typedef struct {
 
        gulong video_window_xid;
 
-#ifdef ARAVIS_WITH_NOTIFY
        NotifyNotification *notification;
-#endif
 } ArvViewer;
 
 double
@@ -433,7 +429,6 @@ arv_viewer_snapshot_cb (GtkButton *button, ArvViewer *viewer)
                                 "Aravis", filename, NULL);
        g_file_set_contents (path, viewer->last_buffer->data, viewer->last_buffer->size, NULL);
 
-#ifdef ARAVIS_WITH_NOTIFY
        if (viewer->notification) {
                notify_notification_update (viewer->notification,
                                            "Snapshot saved to Image folder",
@@ -441,7 +436,6 @@ arv_viewer_snapshot_cb (GtkButton *button, ArvViewer *viewer)
                                            "gtk-save");
                notify_notification_show (viewer->notification, NULL);
        }
-#endif
 
        g_free (path);
        g_free (filename);
@@ -693,10 +687,8 @@ arv_viewer_free (ArvViewer *viewer)
 {
        g_return_if_fail (viewer != NULL);
 
-#ifdef ARAVIS_WITH_NOTIFY
        if (viewer->notification)
                g_object_unref (viewer->notification);
-#endif
 
        if (viewer->exposure_update_event > 0)
                g_source_remove (viewer->exposure_update_event);
@@ -797,9 +789,7 @@ arv_viewer_new (void)
        viewer->auto_gain_clicked = g_signal_connect (viewer->auto_gain_toggle, "clicked",
                                                      G_CALLBACK (arv_viewer_auto_gain_cb), viewer);
 
-#ifdef ARAVIS_WITH_NOTIFY
        viewer->notification = notify_notification_new (NULL, NULL, NULL);
-#endif
 
        return viewer;
 }
@@ -904,9 +894,7 @@ main (int argc,char *argv[])
 
        arv_enable_interface ("Fake");
 
-#ifdef ARAVIS_WITH_NOTIFY
        notify_init ("Aravis Viewer");
-#endif
 
        viewer = arv_viewer_new ();
 
@@ -915,9 +903,7 @@ main (int argc,char *argv[])
 
        gtk_main ();
 
-#ifdef ARAVIS_WITH_NOTIFY
        notify_uninit ();
-#endif
 
        /* For debug purpose only */
        arv_shutdown ();


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