From c306b94a4bc68bf61fb5a800d5f0d218a113eacd Mon Sep 17 00:00:00 2001 From: "spadix@users.sf.net" Date: Thu, 24 Jul 2008 22:33:46 +0000 Subject: [PATCH] * release updates (version, NEWS, packaging) * add pkg-config files * update to latest libtool and new autoconf macros * cleanup library symbol exports * remove test programs using internal hooks * improve portability of some format specifiers * fix missing stub for --without-x - thanks to Simon Schmeisser for a patch! * fix --disable-pthread compile errors and warnings * fix XImage size mismatch background artifacts --- ChangeLog | 15 +++- Makefile.am | 15 +++- NEWS | 9 ++ README | 13 +-- TODO | 3 +- configure.ac | 18 ++-- debian/changelog | 20 +++-- debian/compat | 2 +- debian/control | 123 +++++++++++++++++++++---- debian/docs | 6 -- debian/libzebra-dev.install | 20 +++-- debian/libzebra0.install | 1 - debian/libzebra3.install | 1 + debian/libzebragtk-dev.install | 5 ++ debian/libzebragtk0.install | 1 + debian/libzebraqt-dev.install | 5 ++ debian/libzebraqt0.install | 1 + debian/python-zebrapygtk.install | 1 + debian/rules | 63 ++----------- debian/shlibs.local | 1 - debian/zebra-tools.install | 2 + gtk/Makefile.am.inc | 3 +- gtk/zebragtk.c | 5 -- include/zebra.h | 9 +- pygtk/Makefile.am.inc | 4 +- qt/Makefile.am.inc | 8 +- test/Makefile.am.inc | 30 ++----- zebra-gtk.pc.in | 12 +++ zebra-qt.pc.in | 12 +++ zebra.pc.in | 11 +++ zebra.spec.in | 148 +++++++++++++++++++++++++++---- zebra/Makefile.am.inc | 4 +- zebra/convert.c | 8 +- zebra/decoder.c | 8 +- zebra/decoder/code128.c | 2 +- zebra/decoder/code128.h | 2 +- zebra/decoder/code39.c | 2 +- zebra/decoder/code39.h | 2 +- zebra/decoder/ean.c | 2 +- zebra/decoder/ean.h | 2 +- zebra/decoder/i25.c | 2 +- zebra/decoder/i25.h | 2 +- zebra/processor.c | 12 +-- zebra/processor.h | 2 +- zebra/video.c | 18 ++-- zebra/video/v4l1.c | 4 +- zebra/window.c | 6 +- zebra/window/null.c | 5 ++ zebra/window/x.c | 2 +- zebra/window/ximage.c | 34 +++++-- 50 files changed, 474 insertions(+), 212 deletions(-) delete mode 100644 debian/docs delete mode 100644 debian/libzebra0.install create mode 100644 debian/libzebra3.install create mode 100644 debian/libzebragtk-dev.install create mode 100644 debian/libzebragtk0.install create mode 100644 debian/libzebraqt-dev.install create mode 100644 debian/libzebraqt0.install create mode 100644 debian/python-zebrapygtk.install delete mode 100644 debian/shlibs.local create mode 100644 zebra-gtk.pc.in create mode 100644 zebra-qt.pc.in create mode 100644 zebra.pc.in diff --git a/ChangeLog b/ChangeLog index 0648b4ef..e9c4a58b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,16 @@ -current: +version 0.5: + * release updates (version, NEWS, packaging) + * add pkg-config files + * update to latest libtool and new autoconf macros + * cleanup library symbol exports + * remove test programs using internal hooks + * improve portability of some format specifiers + * fix missing stub for --without-x - thanks to Simon Schmeisser for a patch! + * fix --disable-pthread compile errors and warnings + * fix XImage size mismatch background artifacts * fix new generated file distribution errors - * switch Qt headers to old-style names (possible Qt3 support?) - * add independent API versioning for GTK and Qt widget libraries + * switch Qt headers to old-style names (investigate possible Qt3 support?) + * add independent ABI versioning for GTK and Qt widget libraries * reimplement widget internals to support image scanning and improve locking efficiency * add image scanning to widgets. including builtin conversions from diff --git a/Makefile.am b/Makefile.am index d3b9a1f0..de5f499a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,13 +1,18 @@ AM_CPPFLAGS = -I$(srcdir)/include -AM_CFLAGS = -Wall -Werror +AM_CFLAGS = -Wall AM_CXXFLAGS = $(AM_CFLAGS) +ACLOCAL_AMFLAGS = -I config bin_PROGRAMS = check_PROGRAMS = lib_LTLIBRARIES = CLEANFILES = +DISTCLEANFILES = BUILT_SOURCES = EXTRA_DIST = +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = zebra.pc + dist_doc_DATA = COPYING.LIB HACKING INSTALL NEWS README TODO include $(srcdir)/include/Makefile.am.inc @@ -20,12 +25,14 @@ include $(srcdir)/zebracam/Makefile.am.inc endif if HAVE_GTK include $(srcdir)/gtk/Makefile.am.inc +pkgconfig_DATA += zebra-gtk.pc if HAVE_PYTHON include $(srcdir)/pygtk/Makefile.am.inc endif endif if HAVE_QT include $(srcdir)/qt/Makefile.am.inc +pkgconfig_DATA += zebra-qt.pc endif if HAVE_NPAPI include $(srcdir)/plugin/Makefile.am.inc @@ -36,5 +43,7 @@ include $(srcdir)/doc/Makefile.am.inc EXTRA_DIST += examples/upcrpc.pl examples/upcrpc.py \ zebra.spec.in zebra.spec \ debian/changelog debian/compat debian/control debian/copyright \ - debian/docs debian/libzebra0.install debian/libzebra-dev.install \ - debian/rules debian/shlibs.local debian/zebra-tools.install + debian/rules debian/libzebra3.install debian/libzebra-dev.install \ + debian/libzebragtk0.install debian/libzebragtk-dev.install \ + debian/libzebraqt0.install debian/libzebraqt-dev.install \ + debian/python-zebrapygtk.install debian/zebra-tools.install diff --git a/NEWS b/NEWS index a054faa6..90ed27b4 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,14 @@ Zebra Barcode Reader +version 0.5 (2008-07-25): + Introducing zebra widgets! Prioritized by popular demand, this + release includes fully functional barcode scanning widgets for GTK, + PyGTK, and Qt. Application developers may now seamlessly integrate + barcode reader support with their user interface. + + This release also fixes many bugs; existing users are encouraged to + upgrade. + version 0.4 (2008-05-31): new support for EAN-8, Code 39 and Interleaved 2 of 5! this release also introduces the long awaited decoder configuration diff --git a/README b/README index cf030317..05ed69da 100644 --- a/README +++ b/README @@ -1,12 +1,13 @@ ZEBRA BARCODE READER ==================== -Zebra is a layered barcode scanning and decoding library. It supports -EAN, UPC, Code 128, Code 39 and Interleaved 2 of 5. Included with the -library are basic applications for decoding captured barcode images -and using a video device (eg, webcam) as a barcode scanner. The -library eatures a fast streaming interface with minimal memory -footprint. +Zebra is a library for scanning and decoding bar codes from various +sources such as video streams, image files or raw intensity sensors. +It supports EAN, UPC, Code 128, Code 39 and Interleaved 2 of +5. Included with the library are basic applications for decoding +captured bar code images and using a video device (eg, webcam) as a +bar code scanner. The flexible, layered architecture features a fast, +streaming interface with a minimal memory footprint. Check the zebra library home page for the latest release, mailing lists, etc. diff --git a/TODO b/TODO index d3d8c887..cf36e1f0 100644 --- a/TODO +++ b/TODO @@ -8,7 +8,6 @@ general: * example using SANE to scan symbol(s) wrappers: - * zebragtk, QZebra library -version-info * build API docs for zebragtk, zebrapygtk * is zebragtk/QZebra BGR4 alpha swapped? * widget config APIs @@ -29,6 +28,7 @@ decoder: * Code-39/i25 check digit (after implementation) * Code-39 full ASCII (after implementation) * require min/max length (for variable length symbologies) + * standard symbology identifiers (which standard?) * set consistency requirements * set scanner filter params @@ -58,5 +58,4 @@ window: zebracam/zebraimg: * stats/fps at zebracam exit * xml output format - * option to use standard symbology identifiers (which standard?) * decode hook (program/script)? (also zebraimg?) diff --git a/configure.ac b/configure.ac index 20d5b700..cd53e931 100644 --- a/configure.ac +++ b/configure.ac @@ -1,11 +1,13 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ([2.61]) -AC_INIT([zebra], [0.4], [spadix@users.sourceforge.net]) +AC_INIT([zebra], [0.5], [spadix@users.sourceforge.net]) AC_CONFIG_AUX_DIR(config) AC_CONFIG_MACRO_DIR(config) AM_INIT_AUTOMAKE([1.10 -Wall -Werror foreign subdir-objects std-options dist-bzip2]) AC_CONFIG_HEADERS([include/config.h]) AC_CONFIG_SRCDIR(zebra/scanner.c) +LT_PREREQ([2.2]) +LT_INIT([dlopen]) dnl update these just before each release (along w/pacakge version above) dnl LIB_VERSION update instructions copied from libtool docs: @@ -18,8 +20,8 @@ dnl - If any interfaces have been added since the last public release, dnl then increment age. dnl - If any interfaces have been removed since the last public release, dnl then set age to 0. -AC_SUBST([LIB_VERSION], [4:0:1]) -AC_SUBST([RELDATE], [2008-05-31]) +AC_SUBST([LIB_VERSION], [5:0:2]) +AC_SUBST([RELDATE], [2008-07-25]) dnl widget libraries use their own versioning. dnl NB pygtk wrapper is *unversioned* @@ -38,7 +40,6 @@ dnl programs AC_PROG_CC AM_PROG_CC_C_O AC_PROG_CXX -AC_PROG_LIBTOOL PKG_PROG_PKG_CONFIG @@ -312,7 +313,14 @@ AC_CONFIG_COMMANDS([doc/reldate.xml], [RELDATE="$RELDATE"] ) -AC_CONFIG_FILES([Makefile zebra.spec doc/doxygen.conf]) +AC_CONFIG_FILES([ +Makefile +zebra.pc +zebra-gtk.pc +zebra-qt.pc +zebra.spec +doc/doxygen.conf +]) AC_OUTPUT dnl summary log diff --git a/debian/changelog b/debian/changelog index 2261f700..e06447e3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,19 +1,29 @@ -libzebra (0.4-1) unstable; urgency=low +zebra (0.5-1) unstable; urgency=low + + * update to release 0.5 + * change source package name to zebra + * update binary name for new soname + * add binary packages for new widgets + * fixes for multi-package build + * remove autoreconf and documentation rebuild, along w/associated depends + + -- Jeff Brown Fri, 25 July 2008 21:00:00 -0500 + +zebra (0.4-1) unstable; urgency=low * update to release 0.4 - -- Jeff Brown Fri, 30 May 3008 09:00:00 +0500 + -- Jeff Brown Fri, 30 May 2008 09:00:00 -0500 -libzebra (0.2-1) unstable; urgency=low +zebra (0.2-1) unstable; urgency=low * Added libsdl dependency * automake1.10 is now required -- Vít Hrachový Thu, 17 May 2007 9:20:45 +0200 -libzebra (0.1-1) unstable; urgency=low +zebra (0.1-1) unstable; urgency=low * Initial release -- Vít Hrachový Wed, 11 Apr 2007 21:15:45 +0200 - diff --git a/debian/compat b/debian/compat index 7ed6ff82..7f8f011e 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -5 +7 diff --git a/debian/control b/debian/control index 9e60034b..c7e7006f 100644 --- a/debian/control +++ b/debian/control @@ -1,30 +1,121 @@ -Source: libzebra +Source: zebra +Section: libs Priority: optional Maintainer: Vít Hrachový -Build-Depends: debhelper (>= 5), autotools-dev, libmagick++9-dev, autoconf (>= 2.61), automake (>= 1:1.10), libtool (>= 1.5.22), xmlto (>= 0.0.18) -Standards-Version: 3.7.2 +Homepage: http://zebra.sourceforge.net +Build-Depends: debhelper (>= 7), pkg-config, libx11-dev, python-dev (>= 2.3), libgtk2.0-dev, python-gtk2-dev, libqt4-dev, libmagick++9-dev +Standards-Version: 3.8.0 + +Package: libzebra3 Section: libs +Architecture: any +Depends: ${shlibs:Depends} +Description: bar code scanning and decoding library + Zebra is a library for scanning and decoding bar codes from various + sources such as video streams, image files or raw intensity sensors. + It supports EAN, UPC, Code 128, Code 39 and Interleaved 2 of 5. The + flexible, layered architecture features a fast, streaming interface + with a minimal memory footprint. + . + This package contains the shared library. Package: libzebra-dev Section: libdevel Architecture: any -Depends: libzebra (= ${Source-Version}) -Description: Header files for Zebra bar code reading library. - This packages installs files neccessary for development using Zebra barcodes - decoding library. +Depends: libzebra3 (= ${binary:Version}) +Conflicts: libzebra-dev +Description: bar code library extra development files + Zebra is a library for scanning and decoding bar codes from various + sources such as video streams, image files or raw intensity sensors. + It supports EAN, UPC, Code 128, Code 39 and Interleaved 2 of 5. The + flexible, layered architecture features a fast, streaming interface + with a minimal memory footprint. + . + This package contains header files and additional libraries used for + developing applications that read bar codes with this library. -Package: libzebra +Package: libzebragtk0 Section: libs Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Description: Bar codes reading library with small memory footprint - Zebra is a layered barcode (EAN/UPC and Code 128) scanning and decoding - library. Features a fast streaming interface with minimal memory footprint. +Depends: libzebra3 (= ${binary:Version}), libgtk2.0-0 +Description: bar code reader GTK widget + Zebra is a library for scanning and decoding bar codes from various + sources such as video streams, image files or raw intensity sensors. + It supports EAN, UPC, Code 128, Code 39 and Interleaved 2 of 5. The + flexible, layered architecture features a fast, streaming interface + with a minimal memory footprint. + . + This package contains a bar code scanning widget for use with GUI + applications based on GTK+-2.0. + +Package: libzebragtk-dev +Section: libdevel +Architecture: any +Depends: libzebragtk0 (= ${binary:Version}), libgtk2.0-dev +Description: bar code reader GTK widget extra development files + Zebra is a library for scanning and decoding bar codes from various + sources such as video streams, image files or raw intensity sensors. + It supports EAN, UPC, Code 128, Code 39 and Interleaved 2 of 5. The + flexible, layered architecture features a fast, streaming interface + with a minimal memory footprint. + . + This package contains header files and additional libraries used for + developing GUI applications based on GTK+-2.0 that include a bar code + scanning widget. + +Package: python-zebrapygtk +Section: libs +Architecture: any +Depends: libzebra3 (= ${binary:Version}), python (>= 2.3), python-gtk2 +Description: bar code reader PyGTK widget + Zebra is a library for scanning and decoding bar codes from various + sources such as video streams, image files or raw intensity sensors. + It supports EAN, UPC, Code 128, Code 39 and Interleaved 2 of 5. The + flexible, layered architecture features a fast, streaming interface + with a minimal memory footprint. + . + This package contains a bar code scanning widget for use in GUI + applications based on PyGTK. + +Package: libzebraqt0 +Section: libs +Architecture: any +Depends: libzebra3 (= ${binary:Version}), libqt4-0 +Description: bar code reader Qt widget + Zebra is a library for scanning and decoding bar codes from various + sources such as video streams, image files or raw intensity sensors. + It supports EAN, UPC, Code 128, Code 39 and Interleaved 2 of 5. The + flexible, layered architecture features a fast, streaming interface + with a minimal memory footprint. + . + This package contains a bar code scanning widget for use with GUI + applications based on Qt4. + +Package: libzebraqt-dev +Section: libdevel +Architecture: any +Depends: libzebraqt0 (= ${binary:Version}), libqt4-dev +Description: bar code reader Qt widget extra development files + Zebra is a library for scanning and decoding bar codes from various + sources such as video streams, image files or raw intensity sensors. + It supports EAN, UPC, Code 128, Code 39 and Interleaved 2 of 5. The + flexible, layered architecture features a fast, streaming interface + with a minimal memory footprint. + . + This package contains header files and additional libraries used for + developing GUI applications based on Qt4 that include a bar code + scanning widget. Package: zebra-tools Section: graphics Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, libmagick9 -Description: Reading barcodes using web camera or scanned images - This package provides tools for reading barcodes using web camera or using - scanned images. +Depends: libzebra3 (= ${binary:Version}), ${shlibs:Depends}, libmagick9 +Description: utilities for reading bar codes from a webcam or image files + Zebra is a library for scanning and decoding bar codes from various + sources such as video streams, image files or raw intensity sensors. + It supports EAN, UPC, Code 128, Code 39 and Interleaved 2 of 5. The + flexible, layered architecture features a fast, streaming interface + with a minimal memory footprint. + . + This package provides basic applications for reading bar codes from a + video device or from captured images of bar codes. diff --git a/debian/docs b/debian/docs deleted file mode 100644 index d94c285e..00000000 --- a/debian/docs +++ /dev/null @@ -1,6 +0,0 @@ -COPYING.LIB -HACKING -INSTALL -NEWS -README -TODO diff --git a/debian/libzebra-dev.install b/debian/libzebra-dev.install index 3c996c88..0d548f55 100644 --- a/debian/libzebra-dev.install +++ b/debian/libzebra-dev.install @@ -1,6 +1,14 @@ -usr/include/* -usr/lib/lib*.a -usr/lib/lib*.so -usr/lib/pkgconfig/* -usr/lib/*.la -usr/share/pkgconfig/* +usr/include/zebra.h +usr/include/zebra/Exception.h +usr/include/zebra/Symbol.h +usr/include/zebra/Image.h +usr/include/zebra/Decoder.h +usr/include/zebra/Scanner.h +usr/include/zebra/ImageScanner.h +usr/include/zebra/Video.h +usr/include/zebra/Window.h +usr/include/zebra/Processor.h +usr/lib/libzebra.la +usr/lib/libzebra.a +usr/lib/libzebra.so +usr/lib/pkgconfig/zebra.pc diff --git a/debian/libzebra0.install b/debian/libzebra0.install deleted file mode 100644 index d0dbfd18..00000000 --- a/debian/libzebra0.install +++ /dev/null @@ -1 +0,0 @@ -usr/lib/lib*.so.* diff --git a/debian/libzebra3.install b/debian/libzebra3.install new file mode 100644 index 00000000..7e7ade69 --- /dev/null +++ b/debian/libzebra3.install @@ -0,0 +1 @@ +usr/lib/libzebra.so.* diff --git a/debian/libzebragtk-dev.install b/debian/libzebragtk-dev.install new file mode 100644 index 00000000..8080f6f6 --- /dev/null +++ b/debian/libzebragtk-dev.install @@ -0,0 +1,5 @@ +usr/include/zebra/zebragtk.h +usr/lib/libzebragtk.la +usr/lib/libzebragtk.a +usr/lib/libzebragtk.so +usr/lib/pkgconfig/zebra-gtk.pc diff --git a/debian/libzebragtk0.install b/debian/libzebragtk0.install new file mode 100644 index 00000000..160ac44e --- /dev/null +++ b/debian/libzebragtk0.install @@ -0,0 +1 @@ +usr/lib/libzebragtk.so.* diff --git a/debian/libzebraqt-dev.install b/debian/libzebraqt-dev.install new file mode 100644 index 00000000..6d487940 --- /dev/null +++ b/debian/libzebraqt-dev.install @@ -0,0 +1,5 @@ +usr/include/zebra/QZebra*.h +usr/lib/libzebraqt.la +usr/lib/libzebraqt.a +usr/lib/libzebraqt.so +usr/lib/pkgconfig/zebra-qt.pc diff --git a/debian/libzebraqt0.install b/debian/libzebraqt0.install new file mode 100644 index 00000000..77cf98f6 --- /dev/null +++ b/debian/libzebraqt0.install @@ -0,0 +1 @@ +usr/lib/libzebraqt.so.* diff --git a/debian/python-zebrapygtk.install b/debian/python-zebrapygtk.install new file mode 100644 index 00000000..607c0659 --- /dev/null +++ b/debian/python-zebrapygtk.install @@ -0,0 +1 @@ +usr/lib/python* diff --git a/debian/rules b/debian/rules index 20cdce9b..0b16b668 100755 --- a/debian/rules +++ b/debian/rules @@ -10,12 +10,6 @@ # export DH_VERBOSE=1 -# These are used for cross-compiling and for saving the configure script -# from having to guess our platform (since we know it already) -DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) -DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) - - CFLAGS = -Wall -g ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) @@ -24,62 +18,29 @@ else CFLAGS += -O2 endif -# shared library versions, option 1 -version=2.0.5 -major=2 -# option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so -#version=`ls src/.libs/lib*.so.* | \ -# awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'` -#major=`ls src/.libs/lib*.so.* | \ -# awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'` - config.status: configure dh_testdir - # Add here commands to configure the package. - autoreconf --install - ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs" - + dh_auto_configure build: build-stamp build-stamp: config.status dh_testdir - - # Add here commands to compile the package. - $(MAKE) - $(MAKE) docs - + dh_auto_build touch $@ clean: dh_testdir dh_testroot rm -f build-stamp - - # Add here commands to clean up after the build process. - -$(MAKE) distclean -ifneq "$(wildcard /usr/share/misc/config.sub)" "" - cp -f /usr/share/misc/config.sub config.sub -endif -ifneq "$(wildcard /usr/share/misc/config.guess)" "" - cp -f /usr/share/misc/config.guess config.guess -endif - - + dh_auto_clean dh_clean install: build dh_testdir dh_testroot - dh_clean -k + dh_prep dh_installdirs - - # Add here commands to install the package into debian/ - # Add targets install-lib, install-include, install-bin to Makefile - $(MAKE) install-libLTLIBRARIES DESTDIR=$(CURDIR)/debian/libzebra - $(MAKE) install-includeHEADERS install-zincludeHEADERS DESTDIR=$(CURDIR)/debian/libzebra-dev - $(MAKE) install-binPROGRAMS DESTDIR=$(CURDIR)/debian/zebra-tools - rm -rf $(CURDIR)/debian/zebra-tools/usr/lib - + dh_auto_install # Build architecture-independent files here. binary-indep: build install @@ -92,26 +53,16 @@ binary-arch: build install dh_installchangelogs ChangeLog dh_installdocs dh_installexamples -# dh_install dh_installmenu -# dh_installdebconf -# dh_installlogrotate -# dh_installemacsen -# dh_installpam -# dh_installmime -# dh_installinit -# dh_installcron -# dh_installinfo dh_installman + dh_install --fail-missing -Xzebrapygtk.la dh_link dh_strip dh_compress dh_fixperms -# dh_perl -# dh_python dh_makeshlibs dh_installdeb - dh_shlibdeps + dh_shlibdeps -- --ignore-missing-info dh_gencontrol dh_md5sums dh_builddeb diff --git a/debian/shlibs.local b/debian/shlibs.local deleted file mode 100644 index 3422dfb3..00000000 --- a/debian/shlibs.local +++ /dev/null @@ -1 +0,0 @@ -libzebra 0.3 libzebra (>> 0.3-0), libzebra (<< 0.4-99) diff --git a/debian/zebra-tools.install b/debian/zebra-tools.install index 91e6a223..57c574e4 100644 --- a/debian/zebra-tools.install +++ b/debian/zebra-tools.install @@ -1,2 +1,4 @@ usr/bin/zebraimg usr/bin/zebracam +usr/share/man/man1/*.1 +usr/share/doc/zebra/* diff --git a/gtk/Makefile.am.inc b/gtk/Makefile.am.inc index 7911adbe..2bc511e0 100644 --- a/gtk/Makefile.am.inc +++ b/gtk/Makefile.am.inc @@ -1,6 +1,7 @@ lib_LTLIBRARIES += gtk/libzebragtk.la gtk_libzebragtk_la_CPPFLAGS = -Igtk $(GTK_CFLAGS) $(AM_CPPFLAGS) -gtk_libzebragtk_la_LDFLAGS = -version-info $(ZGTK_LIB_VERSION) $(AM_LDFLAGS) +gtk_libzebragtk_la_LDFLAGS = -version-info $(ZGTK_LIB_VERSION) \ + -export-symbols-regex "^zebra_gtk_.*" $(AM_LDFLAGS) gtk_libzebragtk_la_LIBADD = $(GTK_LIBS) zebra/libzebra.la $(AM_LIBADD) gtk_libzebragtk_la_SOURCES = gtk/zebragtk.c gtk/zebragtkprivate.h \ diff --git a/gtk/zebragtk.c b/gtk/zebragtk.c index 5e6bb68d..75418d42 100644 --- a/gtk/zebragtk.c +++ b/gtk/zebragtk.c @@ -40,11 +40,6 @@ ((long)(a) | ((long)(b) << 8) | \ ((long)(c) << 16) | ((long)(d) << 24)) -GQuark zebra_gtk_error_quark () -{ - return(g_quark_from_static_string("zebra_gtk_error")); -} - enum { DECODED, DECODED_TEXT, diff --git a/include/zebra.h b/include/zebra.h index baf06d53..161cd149 100644 --- a/include/zebra.h +++ b/include/zebra.h @@ -291,6 +291,7 @@ extern void zebra_image_destroy(zebra_image_t *image); * image. decrement when the reference is no longer used. do not * refer to the image any longer once the count is decremented. * zebra_image_ref(image, -1) is the same as zebra_image_destroy(image) + * @since 0.5 */ extern void zebra_image_ref(zebra_image_t *image, int refs); @@ -379,11 +380,15 @@ extern void zebra_image_set_data(zebra_image_t *image, */ extern void zebra_image_free_data(zebra_image_t *image); -/** associate user specified data value with an image. */ +/** associate user specified data value with an image. + * @since 0.5 + */ extern void zebra_image_set_userdata(zebra_image_t *image, void *userdata); -/** return user specified data value associated with the image. */ +/** return user specified data value associated with the image. + * @since 0.5 + */ extern void *zebra_image_get_userdata(const zebra_image_t *image); /** dump raw image data to a file for debug. diff --git a/pygtk/Makefile.am.inc b/pygtk/Makefile.am.inc index 02ae0b32..b931e8ba 100644 --- a/pygtk/Makefile.am.inc +++ b/pygtk/Makefile.am.inc @@ -1,8 +1,8 @@ pyexec_LTLIBRARIES = pygtk/zebrapygtk.la pygtk_zebrapygtk_la_CPPFLAGS = \ $(GTK_CFLAGS) $(PYTHON_CFLAGS) $(PYGTK_CFLAGS) $(AM_CPPFLAGS) -pygtk_zebrapygtk_la_LDFLAGS = \ - -module -avoid-version -export-symbols-regex initzebrapygtk +pygtk_zebrapygtk_la_LDFLAGS = -shared -module -avoid-version -export-dynamic \ + -export-symbols-regex initzebrapygtk pygtk_zebrapygtk_la_LIBADD = \ $(PYTHON_LIBS) $(PYGTK_LIBS) gtk/libzebragtk.la $(AM_LIBADD) diff --git a/qt/Makefile.am.inc b/qt/Makefile.am.inc index 227234a9..9999b922 100644 --- a/qt/Makefile.am.inc +++ b/qt/Makefile.am.inc @@ -3,10 +3,10 @@ qt_libzebraqt_la_CPPFLAGS = -Iqt $(QT_CFLAGS) $(AM_CPPFLAGS) qt_libzebraqt_la_LDFLAGS = -version-info $(ZQT_LIB_VERSION) $(AM_LDFLAGS) qt_libzebraqt_la_LIBADD = $(QT_LIBS) zebra/libzebra.la $(AM_LIBADD) -qt_libzebraqt_la_SOURCES = qt/QZebra.cpp qt/moc_QZebra.cpp \ - qt/QZebraThread.h qt/QZebraThread.cpp qt/moc_QZebraThread.cpp - -BUILT_SOURCES += qt/moc_QZebra.cpp qt/moc_QZebraThread.cpp +qt_libzebraqt_la_SOURCES = qt/QZebra.cpp qt/QZebraThread.h qt/QZebraThread.cpp +nodist_qt_libzebraqt_la_SOURCES = qt/moc_QZebra.cpp qt/moc_QZebraThread.cpp +BUILT_SOURCES += $(nodist_qt_libzebraqt_la_SOURCES) +DISTCLEANFILES += $(nodist_qt_libzebraqt_la_SOURCES) qt/moc_%.cpp: qt/%.h $(MOC) $(qt_libzebraqt_la_CPPFLAGS) $< -o $@ diff --git a/test/Makefile.am.inc b/test/Makefile.am.inc index 2e6573d4..0d44b00d 100644 --- a/test/Makefile.am.inc +++ b/test/Makefile.am.inc @@ -2,36 +2,20 @@ check_PROGRAMS += test/test_decode test_test_decode_CFLAGS = -Wno-unused $(AM_CFLAGS) test_test_decode_LDADD = zebra/libzebra.la $(AM_LDADD) +TEST_IMAGE_SOURCES = test/test_images.c test/test_images.h + check_PROGRAMS += test/test_proc -test_test_proc_SOURCES = test/test_proc.c \ - test/test_images.c test/test_images.h +test_test_proc_SOURCES = test/test_proc.c $(TEST_IMAGE_SOURCES) test_test_proc_LDADD = zebra/libzebra.la $(AM_LDADD) check_PROGRAMS += test/test_convert -test_test_convert_SOURCES = test/test_convert.c \ - test/test_images.c test/test_images.h +test_test_convert_SOURCES = test/test_convert.c $(TEST_IMAGE_SOURCES) test_test_convert_LDADD = zebra/libzebra.la $(AM_LDADD) check_PROGRAMS += test/test_cpp test_test_cpp_SOURCES = test/test_cpp.cpp test_test_cpp_LDADD = zebra/libzebra.la $(AM_LDADD) -TEST_IMAGE_SOURCES = test/test_images.c test/test_images.h - -if HAVE_X -check_PROGRAMS += test/test_window -test_test_window_SOURCES = test/test_window.c $(TEST_IMAGE_SOURCES) -test_test_window_LDADD = zebra/libzebra.la $(AM_LDADD) -test_test_window_CPPFLAGS = -I$(srcdir)/zebra $(AM_CPPFLAGS) -endif - -if HAVE_VIDEO -check_PROGRAMS += test/test_video -test_test_video_SOURCES = test/test_video.c $(TEST_IMAGE_SOURCES) -test_test_video_LDADD = -lrt zebra/libzebra.la $(AM_LDADD) -test_test_video_CPPFLAGS = -I$(srcdir)/zebra $(AM_CPPFLAGS) -endif - if HAVE_MAGICK check_PROGRAMS += test/dbg_scan test_dbg_scan_SOURCES = test/dbg_scan.cpp @@ -48,10 +32,12 @@ endif if HAVE_QT check_PROGRAMS += test/test_qt -test_test_qt_SOURCES = test/test_qt.cpp test/moc_test_qt.h test/scan_video.c +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/libzebraqt.la $(AM_LDADD) -BUILT_SOURCES += test/moc_test_qt.h +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 $@ diff --git a/zebra-gtk.pc.in b/zebra-gtk.pc.in new file mode 100644 index 00000000..b68b7dd1 --- /dev/null +++ b/zebra-gtk.pc.in @@ -0,0 +1,12 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: zebra-gtk +Description: bar code scanning and decoding GTK widget +URL: http://zebra.sourceforge.net +Version: @VERSION@ +Requires: zebra, gtk+-2.0, gthread-2.0 +Libs: -L${libdir} -lzebragtk +Cflags: -I${includedir} diff --git a/zebra-qt.pc.in b/zebra-qt.pc.in new file mode 100644 index 00000000..1bcd5d78 --- /dev/null +++ b/zebra-qt.pc.in @@ -0,0 +1,12 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: zebra-qt +Description: bar code scanning and decoding Qt4 widget +URL: http://zebra.sourceforge.net +Version: @VERSION@ +Requires: zebra, QtCore >= 4, QtGui >= 4 +Libs: -L${libdir} -lzebraqt +Cflags: -I${includedir} diff --git a/zebra.pc.in b/zebra.pc.in new file mode 100644 index 00000000..45449bee --- /dev/null +++ b/zebra.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: zebra +Description: bar code scanning and decoding +URL: http://zebra.sourceforge.net +Version: @VERSION@ +Libs: -L${libdir} -lzebra +Cflags: -I${includedir} diff --git a/zebra.spec.in b/zebra.spec.in index 72fb45fa..fa5d233b 100644 --- a/zebra.spec.in +++ b/zebra.spec.in @@ -1,32 +1,115 @@ Name: zebra -Summary: Scan and decode barcodes using a video device or from image files +Summary: bar code scanning and decoding library Version: @VERSION@ Release: 1 License: LGPL -Group: Applications/Multimedia +Group: Development/Libraries URL: http://zebra.sourceforge.net Packager: Vit Hrachovy Source: zebra-%{version}.tar.gz Requires: ImageMagick-c++ -BuildPreReq: ImageMagick-c++-devel +BuildPreReq: pkgconfig, libX11-devel, python-devel, gtk2-devel, pygtk2-devel, qt-devel >= 4, ImageMagick-c++-devel Prefix: %{_prefix} BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root %description -Zebra is a layered barcode scanning and decoding library. Supports -EAN, UPC, Code 128, Code 39 and Interleaved 2 of 5. Includes -applications for decoding captured barcode images and using a video -device (eg, webcam) as a barcode scanner. Features a fast streaming -interface with minimal memory footprint. +Zebra is a library for scanning and decoding bar codes from various +sources such as video streams, image files or raw intensity sensors. +It supports EAN, UPC, Code 128, Code 39 and Interleaved 2 of 5. The +flexible, layered architecture features a fast, streaming interface +with a minimal memory footprint. %package devel Group: Development/Libraries -Summary: Header files and static libraries for Zebra bar code reading library. +Summary: bar code library extra development files Requires: %{name} = %{version} %description devel -This package installs files neccessary for development of bar code -applications using Zebra barcode reader library. +Zebra is a library for scanning and decoding bar codes from various +sources such as video streams, image files or raw intensity sensors. +It supports EAN, UPC, Code 128, Code 39 and Interleaved 2 of 5. The +flexible, layered architecture features a fast, streaming interface +with a minimal memory footprint. + +This package contains header files and additional libraries used for +developing applications that read bar codes with this library. + +%package gtk +Group: Development/Libraries +Summary: bar code reader GTK widget +Requires: %{name} = %{version}, gtk2 + +%description gtk +Zebra is a library for scanning and decoding bar codes from various +sources such as video streams, image files or raw intensity sensors. +It supports EAN, UPC, Code 128, Code 39 and Interleaved 2 of 5. The +flexible, layered architecture features a fast, streaming interface +with a minimal memory footprint. + +This package contains a bar code scanning widget for use with GUI +applications based on GTK+-2.0. + +%package gtk-devel +Group: Development/Libraries +Summary: bar code reader GTK widget extra development files +Requires: %{name}-gtk = %{version}, %{name}-devel = %{version}, gtk2-devel + +%description gtk-devel +Zebra is a library for scanning and decoding bar codes from various +sources such as video streams, image files or raw intensity sensors. +It supports EAN, UPC, Code 128, Code 39 and Interleaved 2 of 5. The +flexible, layered architecture features a fast, streaming interface +with a minimal memory footprint. + +This package contains header files and additional libraries used for +developing GUI applications based on GTK+-2.0 that include a bar code +scanning widget. + +%package pygtk +Group: Development/Libraries +Summary: bar code reader PyGTK widget +Requires: %{name} = %{version}, pygtk2 + +%description pygtk +Zebra is a library for scanning and decoding bar codes from various +sources such as video streams, image files or raw intensity sensors. +It supports EAN, UPC, Code 128, Code 39 and Interleaved 2 of 5. The +flexible, layered architecture features a fast, streaming interface +with a minimal memory footprint. + +This package contains a bar code scanning widget for use in GUI +applications based on PyGTK. + +%package qt +Group: Development/Libraries +Summary: bar code reader Qt widget +Requires: %{name} = %{version}, qt >= 4 + +%description qt +Zebra is a library for scanning and decoding bar codes from various +sources such as video streams, image files or raw intensity sensors. +It supports EAN, UPC, Code 128, Code 39 and Interleaved 2 of 5. The +flexible, layered architecture features a fast, streaming interface +with a minimal memory footprint. + +This package contains a bar code scanning widget for use with GUI +applications based on Qt4. + +%package qt-devel +Group: Development/Libraries +Summary: bar code reader Qt widget extra development files +Requires: %{name}-qt = %{version}, %{name}-devel = %{version}, qt-devel >= 4 + +%description qt-devel +Zebra is a library for scanning and decoding bar codes from various +sources such as video streams, image files or raw intensity sensors. +It supports EAN, UPC, Code 128, Code 39 and Interleaved 2 of 5. The +flexible, layered architecture features a fast, streaming interface +with a minimal memory footprint. + +This package contains header files and additional libraries used for +developing GUI applications based on Qt4 that include a bar code +scanning widget. %prep %setup -q -n zebra-%{version} @@ -54,23 +137,23 @@ ldconfig %files %defattr(-,root,root) +%{_bindir}/zebraimg +%{_bindir}/zebracam +%{_libdir}/libzebra.so.* +%{_datadir}/man/man1/* %doc %{_docdir}/%{name}-%{version}/COPYING.LIB %doc %{_docdir}/%{name}-%{version}/HACKING %doc %{_docdir}/%{name}-%{version}/INSTALL %doc %{_docdir}/%{name}-%{version}/NEWS %doc %{_docdir}/%{name}-%{version}/README %doc %{_docdir}/%{name}-%{version}/TODO -%{_datadir}/man/man1/* -%{_libdir}/libzebra.so.3.1.0 -%{_libdir}/libzebra.so.3 -%{_libdir}/libzebra.so -%{_bindir}/zebraimg -%{_bindir}/zebracam %files devel %defattr(-,root,root) %{_libdir}/libzebra.la %{_libdir}/libzebra.a +%{_libdir}/libzebra.so +%{_libdir}/pkgconfig/zebra.pc %{_includedir}/zebra.h %{_includedir}/zebra/Exception.h %{_includedir}/zebra/Symbol.h @@ -82,7 +165,38 @@ ldconfig %{_includedir}/zebra/Window.h %{_includedir}/zebra/Processor.h +%files gtk +%defattr(-,root,root) +%{_libdir}/libzebragtk.so.* + +%files gtk-devel +%defattr(-,root,root) +%{_libdir}/libzebragtk.la +%{_libdir}/libzebragtk.a +%{_libdir}/libzebragtk.so +%{_libdir}/pkgconfig/zebra-gtk.pc +%{_includedir}/zebra/zebragtk.h + +%files pygtk +%defattr(-,root,root) +%{_libdir}/python* + +%files qt +%defattr(-,root,root) +%{_libdir}/libzebraqt.so.* + +%files qt-devel +%defattr(-,root,root) +%{_libdir}/libzebraqt.la +%{_libdir}/libzebraqt.a +%{_libdir}/libzebraqt.so +%{_libdir}/pkgconfig/zebra-qt.pc +%{_includedir}/zebra/QZebra*.h + %changelog +* Thu Jul 24 2008 spadix +- version 0.5 updates (new widget packages) + * Sat May 31 2008 spadix - version 0.4 updates (description and library version) diff --git a/zebra/Makefile.am.inc b/zebra/Makefile.am.inc index 443b8640..8f09ccb5 100644 --- a/zebra/Makefile.am.inc +++ b/zebra/Makefile.am.inc @@ -1,6 +1,7 @@ lib_LTLIBRARIES += zebra/libzebra.la zebra_libzebra_la_CPPFLAGS = -I$(srcdir)/zebra $(AM_CPPFLAGS) -zebra_libzebra_la_LDFLAGS = -version-info $(LIB_VERSION) +zebra_libzebra_la_LDFLAGS = -version-info $(LIB_VERSION) \ + -export-symbols-regex "^(zebra|_zebra.*_error)_.*" $(AM_LDFLAGS) zebra_libzebra_la_LIBADD = zebra_libzebra_la_SOURCES = zebra/debug.h zebra/config.c \ @@ -28,6 +29,7 @@ endif if HAVE_X zebra_libzebra_la_SOURCES += zebra/window/x.c zebra/window/ximage.c +zebra_libzebra_la_CPPFLAGS += $(X_CFLAGS) zebra_libzebra_la_LDFLAGS += $(X_LIBS) zebra_libzebra_la_LIBADD += $(X_PRE_LIBS) -lX11 $(X_EXTRA_LIBS) if HAVE_XV diff --git a/zebra/convert.c b/zebra/convert.c index 5f959909..cb70011a 100644 --- a/zebra/convert.c +++ b/zebra/convert.c @@ -983,19 +983,19 @@ int zebra_negotiate_format (zebra_video_t *vdo, return(0); if(win) - window_lock(win); + (void)window_lock(win); errinfo_t *errdst = (vdo) ? &vdo->err : &win->err; if(verify_format_sort()) { if(win) - window_unlock(win); + (void)window_unlock(win); return(err_capture(errdst, SEV_FATAL, ZEBRA_ERR_INTERNAL, __func__, "image format list is not sorted!?")); } if((vdo && !vdo->formats) || (win && !win->formats)) { if(win) - window_unlock(win); + (void)window_unlock(win); return(err_capture(errdst, SEV_ERROR, ZEBRA_ERR_UNSUPPORTED, __func__, "no input or output formats available")); } @@ -1028,7 +1028,7 @@ int zebra_negotiate_format (zebra_video_t *vdo, } } if(win) - window_unlock(win); + (void)window_unlock(win); if(!min_fmt) return(err_capture(errdst, SEV_ERROR, ZEBRA_ERR_UNSUPPORTED, __func__, diff --git a/zebra/decoder.c b/zebra/decoder.c index a3f453e5..c29b55c7 100644 --- a/zebra/decoder.c +++ b/zebra/decoder.c @@ -159,22 +159,22 @@ zebra_symbol_type_t zebra_decode_width (zebra_decoder_t *dcode, #ifdef ENABLE_EAN if((dcode->ean.enable) && - (sym = zebra_decode_ean(dcode))) + (sym = _zebra_decode_ean(dcode))) dcode->type = sym; #endif #ifdef ENABLE_CODE39 if(TEST_CFG(dcode->code39.config, ZEBRA_CFG_ENABLE) && - (sym = zebra_decode_code39(dcode)) > ZEBRA_PARTIAL) + (sym = _zebra_decode_code39(dcode)) > ZEBRA_PARTIAL) dcode->type = sym; #endif #ifdef ENABLE_CODE128 if(TEST_CFG(dcode->code128.config, ZEBRA_CFG_ENABLE) && - (sym = zebra_decode_code128(dcode)) > ZEBRA_PARTIAL) + (sym = _zebra_decode_code128(dcode)) > ZEBRA_PARTIAL) dcode->type = sym; #endif #ifdef ENABLE_I25 if(TEST_CFG(dcode->i25.config, ZEBRA_CFG_ENABLE) && - (sym = zebra_decode_i25(dcode)) > ZEBRA_PARTIAL) + (sym = _zebra_decode_i25(dcode)) > ZEBRA_PARTIAL) dcode->type = sym; #endif diff --git a/zebra/decoder/code128.c b/zebra/decoder/code128.c index dd268d2c..80da4087 100644 --- a/zebra/decoder/code128.c +++ b/zebra/decoder/code128.c @@ -421,7 +421,7 @@ static inline unsigned char postprocess (zebra_decoder_t *dcode) return(0); } -zebra_symbol_type_t zebra_decode_code128 (zebra_decoder_t *dcode) +zebra_symbol_type_t _zebra_decode_code128 (zebra_decoder_t *dcode) { code128_decoder_t *dcode128 = &dcode->code128; diff --git a/zebra/decoder/code128.h b/zebra/decoder/code128.h index b192d093..6f2c3c87 100644 --- a/zebra/decoder/code128.h +++ b/zebra/decoder/code128.h @@ -43,6 +43,6 @@ static inline void code128_reset (code128_decoder_t *dcode128) } /* decode Code 128 symbols */ -zebra_symbol_type_t zebra_decode_code128(zebra_decoder_t *dcode); +zebra_symbol_type_t _zebra_decode_code128(zebra_decoder_t *dcode); #endif diff --git a/zebra/decoder/code39.c b/zebra/decoder/code39.c index 566100df..33dfd358 100644 --- a/zebra/decoder/code39.c +++ b/zebra/decoder/code39.c @@ -236,7 +236,7 @@ static inline void code39_postprocess (zebra_decoder_t *dcode) dcode->buf[i] = '\0'; } -zebra_symbol_type_t zebra_decode_code39 (zebra_decoder_t *dcode) +zebra_symbol_type_t _zebra_decode_code39 (zebra_decoder_t *dcode) { code39_decoder_t *dcode39 = &dcode->code39; diff --git a/zebra/decoder/code39.h b/zebra/decoder/code39.h index ce3856a6..bcfb3005 100644 --- a/zebra/decoder/code39.h +++ b/zebra/decoder/code39.h @@ -44,6 +44,6 @@ static inline void code39_reset (code39_decoder_t *dcode39) } /* decode Code 39 symbols */ -zebra_symbol_type_t zebra_decode_code39(zebra_decoder_t *dcode); +zebra_symbol_type_t _zebra_decode_code39(zebra_decoder_t *dcode); #endif diff --git a/zebra/decoder/ean.c b/zebra/decoder/ean.c index 920eeded..b8e48d6e 100644 --- a/zebra/decoder/ean.c +++ b/zebra/decoder/ean.c @@ -539,7 +539,7 @@ static inline void postprocess (zebra_decoder_t *dcode, dcode->buf[j] = '\0'; } -zebra_symbol_type_t zebra_decode_ean (zebra_decoder_t *dcode) +zebra_symbol_type_t _zebra_decode_ean (zebra_decoder_t *dcode) { /* process upto 4 separate passes */ zebra_symbol_type_t sym = ZEBRA_NONE; diff --git a/zebra/decoder/ean.h b/zebra/decoder/ean.h index 9983794f..cb57f3c7 100644 --- a/zebra/decoder/ean.h +++ b/zebra/decoder/ean.h @@ -79,6 +79,6 @@ static inline unsigned ean_get_config (ean_decoder_t *ean, } /* decode EAN/UPC symbols */ -zebra_symbol_type_t zebra_decode_ean(zebra_decoder_t *dcode); +zebra_symbol_type_t _zebra_decode_ean(zebra_decoder_t *dcode); #endif diff --git a/zebra/decoder/i25.c b/zebra/decoder/i25.c index fb34c1f6..8bdb910c 100644 --- a/zebra/decoder/i25.c +++ b/zebra/decoder/i25.c @@ -153,7 +153,7 @@ static inline signed char i25_decode_end (zebra_decoder_t *dcode) return(ZEBRA_I25); } -zebra_symbol_type_t zebra_decode_i25 (zebra_decoder_t *dcode) +zebra_symbol_type_t _zebra_decode_i25 (zebra_decoder_t *dcode) { i25_decoder_t *dcode25 = &dcode->i25; diff --git a/zebra/decoder/i25.h b/zebra/decoder/i25.h index 85eceb3f..32cdf0f4 100644 --- a/zebra/decoder/i25.h +++ b/zebra/decoder/i25.h @@ -44,6 +44,6 @@ static inline void i25_reset (i25_decoder_t *i25) } /* decode interleaved 2 of 5 symbols */ -zebra_symbol_type_t zebra_decode_i25(zebra_decoder_t *dcode); +zebra_symbol_type_t _zebra_decode_i25(zebra_decoder_t *dcode); #endif diff --git a/zebra/processor.c b/zebra/processor.c index ed1850dd..9bde64fb 100644 --- a/zebra/processor.c +++ b/zebra/processor.c @@ -173,7 +173,7 @@ static inline int proc_poll_inputs (zebra_processor_t *proc, if(rc <= 0) /* FIXME detect and handle fatal errors (somehow) */ return(rc); - proc_lock(proc); + (void)proc_lock(proc); if(p->fds[0].revents && p->fds[0].fd == proc->kick_fds[0]) { unsigned junk[2]; read(proc->kick_fds[0], junk, 2 * sizeof(unsigned)); @@ -288,7 +288,7 @@ static inline int proc_event_wait_unthreaded (zebra_processor_t *proc, sleepns.tv_nsec = (timeout % 1000) * 1000000; while(nanosleep(&sleepns, &remns) && errno == EINTR) sleepns = remns; - proc_lock(proc); + (void)proc_lock(proc); return(0); } } @@ -313,7 +313,7 @@ static inline int proc_event_wait (zebra_processor_t *proc, /* make a thread-local copy of polling data */ static inline void proc_cache_polling (zebra_processor_t *proc) { - proc_lock(proc); + (void)proc_lock(proc); int n = proc->polling.num; zprintf(5, "%d fds\n", n); proc->thr_polling.num = n; @@ -362,7 +362,7 @@ static void *proc_video_thread (void *arg) zebra_processor_t *proc = arg; proc_block_sigs(); - proc_lock(proc); + (void)proc_lock(proc); while(1) { /* wait for active to be set */ assert(!proc->sem); @@ -379,7 +379,7 @@ static void *proc_video_thread (void *arg) zebra_image_t *img = zebra_video_next_image(proc->video); if(!img) return(NULL); - proc_lock(proc); + (void)proc_lock(proc); if(proc->active) process_image(proc, img); zebra_image_destroy(img); @@ -421,7 +421,7 @@ zebra_processor_t *zebra_processor_create (int threaded) void zebra_processor_destroy (zebra_processor_t *proc) { - proc_lock(proc); + (void)proc_lock(proc); proc_destroy_thread(proc->video_thread, &proc->video_started); proc_destroy_thread(proc->input_thread, &proc->input_started); if(proc->window) { diff --git a/zebra/processor.h b/zebra/processor.h index 1fed965d..f8cc4167 100644 --- a/zebra/processor.h +++ b/zebra/processor.h @@ -88,9 +88,9 @@ struct zebra_processor_s { pthread_cond_t event; pthread_t video_thread; /* video input handler */ pthread_t input_thread; /* window event handler */ +#endif unsigned video_started; /* thread active flags */ unsigned input_started; -#endif #ifdef HAVE_X Display *display; /* X display connection */ diff --git a/zebra/video.c b/zebra/video.c index 8d53514c..47ae8d7b 100644 --- a/zebra/video.c +++ b/zebra/video.c @@ -29,13 +29,13 @@ static void _zebra_video_recycle_image (zebra_image_t *img) zebra_video_t *vdo = img->src; assert(vdo); assert(img->srcidx >= 0); - video_lock(vdo); + (void)video_lock(vdo); if(vdo->images[img->srcidx] != img) vdo->images[img->srcidx] = img; if(vdo->active) vdo->nq(vdo, img); else - video_unlock(vdo); + (void)video_unlock(vdo); } static void _zebra_video_recycle_shadow (zebra_image_t *img) @@ -43,10 +43,10 @@ static void _zebra_video_recycle_shadow (zebra_image_t *img) zebra_video_t *vdo = img->src; assert(vdo); assert(img->srcidx == -1); - video_lock(vdo); + (void)video_lock(vdo); img->next = vdo->shadow_image; vdo->shadow_image = img; - video_unlock(vdo); + (void)video_unlock(vdo); } zebra_video_t *zebra_video_create () @@ -234,9 +234,9 @@ zebra_image_t *zebra_video_next_image (zebra_video_t *vdo) if(video_lock(vdo)) return(NULL); if(!vdo->active) { - err_capture(vdo, SEV_ERROR, ZEBRA_ERR_INVALID, __func__, - "video not enabled"); - video_unlock(vdo); + err_capture(vdo, SEV_ERROR, ZEBRA_ERR_INVALID, __func__, + "video not enabled"); + (void)video_unlock(vdo); return(NULL); } zebra_image_t *img = vdo->dq(vdo); @@ -246,10 +246,10 @@ zebra_image_t *zebra_video_next_image (zebra_video_t *vdo) * the driver's buffer to avoid deadlocking the resources */ zebra_image_t *tmp = img; - video_lock(vdo); + (void)video_lock(vdo); img = vdo->shadow_image; vdo->shadow_image = (img) ? img->next : NULL; - video_unlock(vdo); + (void)video_unlock(vdo); if(!img) { img = zebra_image_create(); diff --git a/zebra/video/v4l1.c b/zebra/video/v4l1.c index 0086b2c3..860f3f58 100644 --- a/zebra/video/v4l1.c +++ b/zebra/video/v4l1.c @@ -445,7 +445,7 @@ int _zebra_video_open (zebra_video_t *vdo, { /* close open device */ if(vdo->fd >= 0) { - video_lock(vdo); + (void)video_lock(vdo); if(vdo->active) { vdo->active = 0; vdo->stop(vdo); @@ -456,7 +456,7 @@ int _zebra_video_open (zebra_video_t *vdo, close(vdo->fd); zprintf(1, "closed camera fd=%d\n", vdo->fd); vdo->fd = -1; - video_unlock(vdo); + (void)video_unlock(vdo); } if(!dev) return(0); diff --git a/zebra/window.c b/zebra/window.c index 5bafb322..6a0283f1 100644 --- a/zebra/window.c +++ b/zebra/window.c @@ -95,7 +95,7 @@ inline int zebra_window_redraw (zebra_window_t *w) if(window_lock(w)) return(-1); if(!w->draw_image || !w->logo) { - window_unlock(w); + (void)window_unlock(w); return(_zebra_window_clear(w)); } int rc; @@ -108,7 +108,7 @@ inline int zebra_window_redraw (zebra_window_t *w) } if(!rc) rc = window_draw_overlay(w); - window_unlock(w); + (void)window_unlock(w); return(rc); } @@ -138,7 +138,7 @@ void zebra_window_set_overlay (zebra_window_t *w, return; if(w->overlay != lvl) w->overlay = lvl; - window_unlock(w); + (void)window_unlock(w); } int zebra_window_resize (zebra_window_t *w, diff --git a/zebra/window/null.c b/zebra/window/null.c index c84be9d7..f620682b 100644 --- a/zebra/window/null.c +++ b/zebra/window/null.c @@ -74,6 +74,11 @@ int _zebra_window_clear (zebra_window_t *w) return(null_error(w, __func__)); } +int _zebra_window_invalidate (zebra_window_t *w) +{ + return(0); +} + int _zebra_window_draw_marker(zebra_window_t *w, uint32_t rgb, const point_t *p) diff --git a/zebra/window/x.c b/zebra/window/x.c index 858b655e..88729af8 100644 --- a/zebra/window/x.c +++ b/zebra/window/x.c @@ -304,7 +304,7 @@ int _zebra_window_clear (zebra_window_t *w) if(!w->display) return(0); int screen = DefaultScreen(w->display); - XSetForeground(w->display, w->gc, BlackPixel(w->display, screen)); + XSetForeground(w->display, w->gc, WhitePixel(w->display, screen)); XFillRectangle(w->display, w->xwin, w->gc, 0, 0, w->width, w->height); return(0); } diff --git a/zebra/window/ximage.c b/zebra/window/ximage.c index 6200d7e7..539eb202 100644 --- a/zebra/window/ximage.c +++ b/zebra/window/ximage.c @@ -110,24 +110,40 @@ static int ximage_draw (zebra_window_t *w, } ximg->data = (void*)img->data; + + int screen = DefaultScreen(w->display); + XSetForeground(w->display, w->gc, WhitePixel(w->display, screen)); + /* FIXME implement some basic scaling */ + unsigned height = img->height; + unsigned src_y = 0, dst_y = 0; + if(w->height < img->height) { + height = w->height; + src_y = (img->height - w->height) >> 1; + } + else if(w->height != img->height) { + dst_y = (w->height - img->height) >> 1; + /* fill border */ + XFillRectangle(w->display, w->xwin, w->gc, + 0, 0, w->width, dst_y); + XFillRectangle(w->display, w->xwin, w->gc, + 0, dst_y + img->height, w->width, dst_y); + } + unsigned width = img->width; unsigned src_x = 0, dst_x = 0; if(w->width < img->width) { width = w->width; src_x = (img->width - w->width) >> 1; } - else + else if(w->width != img->width) { dst_x = (w->width - img->width) >> 1; - - unsigned height = img->height; - unsigned src_y = 0, dst_y = 0; - if(w->height < img->height) { - height = w->height; - src_y = (img->height - w->height) >> 1; + /* fill border */ + XFillRectangle(w->display, w->xwin, w->gc, + 0, dst_y, dst_x, img->height); + XFillRectangle(w->display, w->xwin, w->gc, + img->width + dst_x, dst_y, dst_x, img->height); } - else - dst_y = (w->height - img->height) >> 1; XPutImage(w->display, w->xwin, w->gc, ximg, src_x, src_y, dst_x, dst_y, width, height);