Skip to content

Commit 92350c4

Browse files
Add option groups, translation support and frontend/backend debug logging
- Options groups: To allow better structuring of options in print dialogs, common options are categorized in groups, like media, print quality, color, finishing, ... This can be primarily done by the backends but the frontend library can do fallback/default assignments for options not assigned by the backend. - Translation support: Translations of option, choice, and group names are now supported, not only English human-readable strings. And Translations can be provided by the backends (also polling them from the print service) and by the frontend library. - Debug logging: Now backends forward their log messages to the frontend library for easier debugging.
1 parent 1d9e153 commit 92350c4

16 files changed

+887
-391
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ autoscan.log
1111
aclocal.m4
1212
autom4te.cache
1313
build-aux/
14+
m4/*
15+
!m4/cpdb*
16+
po/*
17+
!po/POTFILE.in
18+
!po/Makevars
1419
config.*
1520
configure
1621
libtool

Makefile.am

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
EXTRA_DIST = demo/*.c demo/Makefile README.md LICENSE.md COPYING CHANGES.md autogen.sh
1+
EXTRA_DIST = m4/ChangeLog demo/*.c demo/Makefile README.md LICENSE.md COPYING CHANGES.md autogen.sh
22
AUTOMAKE_OPTIONS = foreign
3-
SUBDIRS = cpdb
4-
#ACLOCAL_AMFLAGS = '-I m4'
3+
ACLOCAL_AMFLAGS = -I m4
4+
SUBDIRS = cpdb po
55

66
pkgconfigdir = $(libdir)/pkgconfig
77
pkgconfig_DATA = cpdb-backend.pc cpdb-frontend.pc cpdb.pc

README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,13 @@ If one opens the print dialog, the dialog will not talk directly to CUPS, a clou
1212

1313
## Dependencies
1414

15-
- GLIB 2.0:
16-
`sudo apt install libglib2.0-dev`
17-
18-
- LIBDBUS:
19-
`sudo apt install libdbus-1-dev`
20-
21-
- LIBTOOL:
22-
`sudo apt install libtool`
15+
- GLIB 2.0
16+
- LIBDBUS
17+
- LIBTOOL
18+
- GETTEXT
19+
20+
On Debian based distros, these can be installed by running: \
21+
`sudo apt install libglib2.0-dev libdbus-1-dev libtool gettext`
2322

2423
## Build and installation
2524

autogen.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
mkdir -p build-aux \
2+
&& gettextize --no-changelog \
23
&& autoreconf -fi

configure.ac

Lines changed: 18 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,29 @@
11
# -*- Autoconf -*-
22
# Process this file with autoconf to produce a configure script.
33

4-
AC_PREREQ([2.69])
4+
AC_PREREQ([2.69])
5+
6+
dnl Package name and version...
57
AC_INIT([cpdb-libs], [2.0b1], [https://github.com/OpenPrinting/cpdb-libs/issues], [cpdb-libs], [https://github.com/OpenPrinting/cpdb-libs])
6-
AC_CONFIG_AUX_DIR([build-aux])
7-
AC_CONFIG_SRCDIR([cpdb/cpdb-frontend.h])
8-
AM_INIT_AUTOMAKE([-Wall foreign])
98

10-
: ${CFLAGS=""}
9+
AC_CONFIG_SRCDIR([cpdb/cpdb-frontend.h])
1110

12-
# Check for a C compiler
13-
AC_PROG_CC
11+
AC_CONFIG_MACRO_DIRS([m4])
12+
AC_CONFIG_AUX_DIR([build-aux])
13+
AM_INIT_AUTOMAKE([-Wall foreign])
1414

15-
#Check for archiver
15+
# Check for archiver
1616
AM_PROG_AR
1717

18-
LT_INIT
18+
# Check for GNU gettext
19+
AM_GNU_GETTEXT([external])
20+
AM_GNU_GETTEXT_VERSION([0.21])
1921

20-
PKG_CHECK_MODULES([GIO],[gio-2.0])
21-
PKG_CHECK_MODULES([GIOUNIX],[gio-unix-2.0])
22-
PKG_CHECK_MODULES([GLIB],[glib-2.0])
23-
24-
# Checks for header files.
25-
AC_CHECK_HEADERS([stdlib.h string.h unistd.h sys/stat.h])
26-
27-
# Checks for typedefs, structures, and compiler characteristics.
28-
AC_TYPE_SIZE_T
29-
30-
# Checks for library functions.
31-
AC_FUNC_MALLOC
32-
AC_CHECK_FUNCS([access getcwd mkdir])
33-
34-
# The info directory which will be read by the frontend
35-
CPDB_BACKEND_INFO_DIR="$datadir/print-backends"
36-
AC_SUBST([CPDB_BACKEND_INFO_DIR])
37-
38-
# The directory for the backend executables
39-
CPDB_BACKEND_EXEC_DIR="$libdir/print-backends"
40-
AC_SUBST([CPDB_BACKEND_EXEC_DIR])
22+
LT_INIT
4123

42-
# The directory for system wide config files
43-
CPDB_SYSCONFDIR="$sysconfdir"
44-
AC_SUBST([CPDB_SYSCONFDIR])
24+
dnl Include configure tests for different areas...
25+
sinclude(m4/cpdb-directories.m4)
26+
sinclude(m4/cpdb-common.m4)
4527

4628
AC_CONFIG_FILES([Makefile
4729
cpdb/Makefile
@@ -50,3 +32,6 @@ AC_CONFIG_FILES([Makefile
5032
cpdb.pc])
5133

5234
AC_OUTPUT
35+
36+
dnl Make sure m4 scripts are executable
37+
chmod +x m4

cpdb/Makefile.am

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ libcpdb_la_CPPFLAGS = $(GLIB_CFLAGS)
1414
libcpdb_la_CPPFLAGS += $(GIO_CFLAGS)
1515
libcpdb_la_CPPFLAGS += $(GIOUNIX_CFLAGS)
1616
libcpdb_la_CPPFLAGS += -I..
17-
libcpdb_la_CPPFLAGS += -DCPDB_SYSCONFDIR=\"@CPDB_SYSCONFDIR@\"
1817

1918
libcpdb_la_LIBADD = $(GLIB_LIBS)
2019
libcpdb_la_LIBADD += $(GIO_LIBS)
@@ -30,7 +29,6 @@ libcpdb_frontend_la_CPPFLAGS = $(GLIB_CFLAGS)
3029
libcpdb_frontend_la_CPPFLAGS += $(GIO_CFLAGS)
3130
libcpdb_frontend_la_CPPFLAGS += $(GIOUNIX_CFLAGS)
3231
libcpdb_frontend_la_CPPFLAGS += -I..
33-
libcpdb_frontend_la_CPPFLAGS += -DCPDB_BACKEND_INFO_DIR=\"@CPDB_BACKEND_INFO_DIR@\"
3432

3533
libcpdb_frontend_la_LIBADD = -lpthread -lm -lcrypt
3634
libcpdb_frontend_la_LIBADD += $(GLIB_LIBS)

0 commit comments

Comments
 (0)