You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
149 lines
4.8 KiB
149 lines
4.8 KiB
From 76a286fd34d5159b55de4d4f276dcbf69d1b263e Mon Sep 17 00:00:00 2001
|
|
From: Mauro Carvalho Chehab <mchehab@s-opensource.com>
|
|
Date: Sun, 26 Mar 2017 09:43:07 -0300
|
|
Subject: [PATCH] zbarcam: add qt and gtk variants
|
|
|
|
The original zbarcam use standard X11 libraries to display
|
|
video. That provides an ugly interface, and could be
|
|
slow on high resolutions.
|
|
|
|
As Zbar has already test examples for qt and gtk, let's
|
|
promote them to real applications. One advantage is that
|
|
both qt and gtk libraries will be tested when building
|
|
those.
|
|
|
|
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
|
|
|
|
diff --git a/qt/Makefile.am.inc b/qt/Makefile.am.inc
|
|
index dc1525e0d52a..5f860bfa31bc 100644
|
|
--- a/qt/Makefile.am.inc
|
|
+++ b/qt/Makefile.am.inc
|
|
@@ -7,6 +7,7 @@ qt_libzbarqt_la_SOURCES = qt/QZBar.cpp qt/QZBarThread.h qt/QZBarThread.cpp
|
|
nodist_qt_libzbarqt_la_SOURCES = qt/moc_QZBar.cpp qt/moc_QZBarThread.cpp
|
|
BUILT_SOURCES += $(nodist_qt_libzbarqt_la_SOURCES)
|
|
DISTCLEANFILES += $(nodist_qt_libzbarqt_la_SOURCES)
|
|
+CLEANFILES += qt/moc_%.cpp
|
|
|
|
qt/moc_%.cpp: qt/%.h
|
|
$(MOC) $(qt_libzbarqt_la_CPPFLAGS) $< -o $@
|
|
diff --git a/test/Makefile.am.inc b/test/Makefile.am.inc
|
|
index 7340a7f2f61f..8496eb30f3cc 100644
|
|
--- a/test/Makefile.am.inc
|
|
+++ b/test/Makefile.am.inc
|
|
@@ -45,26 +45,6 @@ test_dbg_scan_CPPFLAGS = $(MAGICK_CFLAGS) $(AM_CPPFLAGS)
|
|
test_dbg_scan_LDADD = $(MAGICK_LIBS) -lMagick++ zbar/libzbar.la $(AM_LDADD)
|
|
endif
|
|
|
|
-if HAVE_GTK
|
|
-check_PROGRAMS += test/test_gtk
|
|
-test_test_gtk_SOURCES = test/test_gtk.c test/scan_video.c
|
|
-test_test_gtk_CPPFLAGS = $(GTK_CFLAGS) $(AM_CPPFLAGS)
|
|
-test_test_gtk_LDADD = $(GTK_LIBS) gtk/libzbargtk.la $(AM_LDADD)
|
|
-endif
|
|
-
|
|
-if HAVE_QT
|
|
-check_PROGRAMS += test/test_qt
|
|
-test_test_qt_SOURCES = test/test_qt.cpp test/scan_video.c
|
|
-nodist_test_test_qt_SOURCES = test/moc_test_qt.h
|
|
-test_test_qt_CPPFLAGS = -Itest $(QT_CFLAGS) $(AM_CPPFLAGS)
|
|
-test_test_qt_LDADD = $(QT_LIBS) qt/libzbarqt.la $(AM_LDADD)
|
|
-BUILT_SOURCES += $(nodist_test_test_qt_SOURCES)
|
|
-DISTCLEANFILES += $(nodist_test_test_qt_SOURCES)
|
|
-
|
|
-test/moc_%.h: test/%.cpp
|
|
- $(MOC) -i $(test_test_qt_CPPFLAGS) $< -o $@
|
|
-endif
|
|
-
|
|
EXTRA_DIST += test/test_pygtk.py test/test_perl.pl
|
|
|
|
# automake bug in "monolithic mode"?
|
|
diff --git a/zbarcam/Makefile.am.inc b/zbarcam/Makefile.am.inc
|
|
index ea869bcd2e11..5aa788a23da5 100644
|
|
--- a/zbarcam/Makefile.am.inc
|
|
+++ b/zbarcam/Makefile.am.inc
|
|
@@ -2,7 +2,32 @@ bin_PROGRAMS += zbarcam/zbarcam
|
|
zbarcam_zbarcam_SOURCES = zbarcam/zbarcam.c
|
|
zbarcam_zbarcam_LDADD = zbar/libzbar.la
|
|
# automake bug in "monolithic mode"?
|
|
-CLEANFILES += zbarcam/.libs/zbarcam
|
|
+CLEANFILES += zbarcam/.libs/zbarcam zbarcam/moc_zbarcam_qt.h
|
|
+
|
|
+if HAVE_GTK
|
|
+bin_PROGRAMS += zbarcam/zbarcam-gtk
|
|
+check_PROGRAMS += zbarcam/zbarcam-gtk
|
|
+zbarcam_zbarcam_gtk_SOURCES = zbarcam/zbarcam-gtk.c zbarcam/scan_video.c
|
|
+zbarcam_zbarcam_gtk_CPPFLAGS = $(GTK_CFLAGS) $(AM_CPPFLAGS)
|
|
+zbarcam_zbarcam_gtk_LDADD = $(GTK_LIBS) gtk/libzbargtk.la $(AM_LDADD)
|
|
+endif
|
|
+
|
|
+if HAVE_QT
|
|
+bin_PROGRAMS += zbarcam/zbarcam-qt
|
|
+check_PROGRAMS += zbarcam/zbarcam-qt
|
|
+
|
|
+zbarcam_zbarcam_qt_SOURCES = zbarcam/zbarcam-qt.cpp zbarcam/scan_video.c
|
|
+nodist_zbarcam_zbarcam_qt_SOURCES = zbarcam/moc_zbarcam_qt.h
|
|
+zbarcam_zbarcam_qt_CPPFLAGS = -Izbarcam $(QT_CFLAGS) $(AM_CPPFLAGS)
|
|
+zbarcam_zbarcam_qt_LDADD = $(QT_LIBS) qt/libzbarqt.la $(AM_LDADD)
|
|
+BUILT_SOURCES += $(nodist_zbarcam_zbarcam_qt_SOURCES)
|
|
+DISTCLEANFILES += $(nodist_zbarcam_zbarcam_qt_SOURCES) zbarcam/moc_zbarcam_qt.h
|
|
+
|
|
+
|
|
+zbarcam/moc_zbarcam_qt.h: zbarcam/zbarcam-qt.cpp
|
|
+ $(MOC) -i $(zbarcam_zbarcam_qt_CPPFLAGS) $< -o $@
|
|
+endif
|
|
+
|
|
|
|
if WIN32
|
|
zbarcam_zbarcam_SOURCES += zbarcam/zbarcam.rc
|
|
diff --git a/test/scan_video.c b/zbarcam/scan_video.c
|
|
similarity index 100%
|
|
rename from test/scan_video.c
|
|
rename to zbarcam/scan_video.c
|
|
diff --git a/test/test_gtk.c b/zbarcam/zbarcam-gtk.c
|
|
similarity index 100%
|
|
rename from test/test_gtk.c
|
|
rename to zbarcam/zbarcam-gtk.c
|
|
diff --git a/test/test_qt.cpp b/zbarcam/zbarcam-qt.cpp
|
|
similarity index 97%
|
|
rename from test/test_qt.cpp
|
|
rename to zbarcam/zbarcam-qt.cpp
|
|
index 96d2f9541453..3a39a338b59d 100644
|
|
--- a/test/test_qt.cpp
|
|
+++ b/zbarcam/zbarcam-qt.cpp
|
|
@@ -40,7 +40,7 @@ int scan_video(void *add_device,
|
|
const char *default_device);
|
|
}
|
|
|
|
-class TestQZBar : public QWidget
|
|
+class ZbarcamQZBar : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
@@ -52,7 +52,7 @@ protected:
|
|
}
|
|
|
|
public:
|
|
- TestQZBar (const char *default_device)
|
|
+ ZbarcamQZBar (const char *default_device)
|
|
{
|
|
// drop-down list of video devices
|
|
QComboBox *videoList = new QComboBox;
|
|
@@ -142,7 +142,7 @@ private:
|
|
zbar::QZBar *zbar;
|
|
};
|
|
|
|
-#include "moc_test_qt.h"
|
|
+#include "moc_zbarcam_qt.h"
|
|
|
|
int main (int argc, char *argv[])
|
|
{
|
|
@@ -152,7 +152,7 @@ int main (int argc, char *argv[])
|
|
if(argc > 1)
|
|
dev = argv[1];
|
|
|
|
- TestQZBar window(dev);
|
|
+ ZbarcamQZBar window(dev);
|
|
window.show();
|
|
return(app.exec());
|
|
}
|