diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2006-11-25 17:33:57 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2006-11-25 17:33:57 +0000 |
commit | 0abbe9720a43cbe88e1c5d3cf1c3dfd4810cf4be (patch) | |
tree | b92d9556a33e6aa18314f07df482ff8c49271cae /lib/libXprintAppUtil/src | |
parent | 1ea1e9258ed6ab19e08f93337c2b2b152bdf2344 (diff) |
import from X.Org 7.1
Diffstat (limited to 'lib/libXprintAppUtil/src')
-rw-r--r-- | lib/libXprintAppUtil/src/Makefile.am | 17 | ||||
-rw-r--r-- | lib/libXprintAppUtil/src/Makefile.in | 476 | ||||
-rw-r--r-- | lib/libXprintAppUtil/src/xpapputil.c | 550 |
3 files changed, 1043 insertions, 0 deletions
diff --git a/lib/libXprintAppUtil/src/Makefile.am b/lib/libXprintAppUtil/src/Makefile.am new file mode 100644 index 000000000..494ea40ac --- /dev/null +++ b/lib/libXprintAppUtil/src/Makefile.am @@ -0,0 +1,17 @@ +lib_LTLIBRARIES = libXprintAppUtil.la + +libXprintAppUtil_la_SOURCES = \ + xpapputil.c + +INCLUDES = -I$(top_srcdir)/include + + +libXprintAppUtil_la_LIBADD = @XPRINTAPPUTIL_LIBS@ +AM_CFLAGS = @XPRINTAPPUTIL_CFLAGS@ + +libXprintAppUtil_la_LDFLAGS = -version-number 1:0:0 -no-undefined + + +libXprintAppUtilincludedir = $(includedir)/X11/XprintAppUtil +libXprintAppUtilinclude_HEADERS = \ + $(top_srcdir)/include/X11/XprintAppUtil/xpapputil.h diff --git a/lib/libXprintAppUtil/src/Makefile.in b/lib/libXprintAppUtil/src/Makefile.in new file mode 100644 index 000000000..d952cb254 --- /dev/null +++ b/lib/libXprintAppUtil/src/Makefile.in @@ -0,0 +1,476 @@ +# Makefile.in generated by automake 1.7.9 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_triplet = @host@ +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +XPRINTAPPUTIL_CFLAGS = @XPRINTAPPUTIL_CFLAGS@ +XPRINTAPPUTIL_LIBS = @XPRINTAPPUTIL_LIBS@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +lib_LTLIBRARIES = libXprintAppUtil.la + +libXprintAppUtil_la_SOURCES = \ + xpapputil.c + + +INCLUDES = -I$(top_srcdir)/include + +libXprintAppUtil_la_LIBADD = @XPRINTAPPUTIL_LIBS@ +AM_CFLAGS = @XPRINTAPPUTIL_CFLAGS@ + +libXprintAppUtil_la_LDFLAGS = -version-number 1:0:0 -no-undefined + +libXprintAppUtilincludedir = $(includedir)/X11/XprintAppUtil +libXprintAppUtilinclude_HEADERS = \ + $(top_srcdir)/include/X11/XprintAppUtil/xpapputil.h + +subdir = src +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(lib_LTLIBRARIES) + +libXprintAppUtil_la_DEPENDENCIES = +am_libXprintAppUtil_la_OBJECTS = xpapputil.lo +libXprintAppUtil_la_OBJECTS = $(am_libXprintAppUtil_la_OBJECTS) + +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/xpapputil.Plo +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ + $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +DIST_SOURCES = $(libXprintAppUtil_la_SOURCES) +HEADERS = $(libXprintAppUtilinclude_HEADERS) + +DIST_COMMON = $(libXprintAppUtilinclude_HEADERS) $(srcdir)/Makefile.in \ + Makefile.am +SOURCES = $(libXprintAppUtil_la_SOURCES) + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/Makefile +Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) +libLTLIBRARIES_INSTALL = $(INSTALL) +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(libdir) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f"; \ + $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f; \ + else :; fi; \ + done + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \ + $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" = "$$p" && dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libXprintAppUtil.la: $(libXprintAppUtil_la_OBJECTS) $(libXprintAppUtil_la_DEPENDENCIES) + $(LINK) -rpath $(libdir) $(libXprintAppUtil_la_LDFLAGS) $(libXprintAppUtil_la_OBJECTS) $(libXprintAppUtil_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xpapputil.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: +libXprintAppUtilincludeHEADERS_INSTALL = $(INSTALL_HEADER) +install-libXprintAppUtilincludeHEADERS: $(libXprintAppUtilinclude_HEADERS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(libXprintAppUtilincludedir) + @list='$(libXprintAppUtilinclude_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " $(libXprintAppUtilincludeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(libXprintAppUtilincludedir)/$$f"; \ + $(libXprintAppUtilincludeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(libXprintAppUtilincludedir)/$$f; \ + done + +uninstall-libXprintAppUtilincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(libXprintAppUtilinclude_HEADERS)'; for p in $$list; do \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " rm -f $(DESTDIR)$(libXprintAppUtilincludedir)/$$f"; \ + rm -f $(DESTDIR)$(libXprintAppUtilincludedir)/$$f; \ + done + +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + $(mkinstalldirs) $(distdir)/../include/X11/XprintAppUtil + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(HEADERS) + +installdirs: + $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(libXprintAppUtilincludedir) +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: install-libXprintAppUtilincludeHEADERS + +install-exec-am: install-libLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES \ + uninstall-libXprintAppUtilincludeHEADERS + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am info info-am install \ + install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am \ + install-libLTLIBRARIES install-libXprintAppUtilincludeHEADERS \ + install-man install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-info-am uninstall-libLTLIBRARIES \ + uninstall-libXprintAppUtilincludeHEADERS + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/lib/libXprintAppUtil/src/xpapputil.c b/lib/libXprintAppUtil/src/xpapputil.c new file mode 100644 index 000000000..aaf918c4e --- /dev/null +++ b/lib/libXprintAppUtil/src/xpapputil.c @@ -0,0 +1,550 @@ + +/* + * $Xorg:xpapputil.c,v 1.1 2002/06/10 02:54:18 gisburn Exp $ + * + * xpapputil - Application level utility library for Xprint + * + * +Copyright 2002-2004 Roland Mainz <roland.mainz@nrubsig.org> + +All Rights Reserved. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + * + * Author: Roland Mainz <roland.mainz@nrubsig.org> + */ + +#include <stdlib.h> +#include <stdio.h> + +#include <X11/XprintAppUtil/xpapputil.h> + +XpauContext *XpauGetContext( const char *printername ) +{ + Display *pdpy; + XPContext pcontext; + XpauContext *context; + + if( XpuGetPrinter(printername, &pdpy, &pcontext) != 1 ) + return NULL; + + if( (context = (XpauContext *)malloc(sizeof(XpauContext))) ) + { + memset(context, 0, sizeof(XpauContext)); + + context->pdpy = pdpy; + context->pcontext = pcontext; + + if( XpQueryExtension(pdpy, &context->xp_event_base, &context->xp_error_base) == False ) + { + fprintf(stderr, "XpauGetContext: XpQueryExtension() failed.\n"); + XpauReleaseContext(context); + return NULL; + } + + /* It may be better to fetch all this info on demand... */ + context->medium_list = XpuGetMediumSourceSizeList(pdpy, pcontext, &context->medium_num_list_entries); + context->resolution_list = XpuGetResolutionList(pdpy, pcontext, &context->resolution_num_list_entries); + context->orientation_list = XpuGetOrientationList(pdpy, pcontext, &context->orientation_num_list_entries); + context->plex_list = XpuGetPlexList(pdpy, pcontext, &context->plex_num_list_entries); + context->supported_job_attributes = XpuGetSupportedJobAttributes(pdpy, pcontext); + context->supported_doc_attributes = XpuGetSupportedDocAttributes(pdpy, pcontext); + context->supported_page_attributes = XpuGetSupportedPageAttributes(pdpy, pcontext); + + return context; + } + + XpuClosePrinterDisplay(pdpy, pcontext); + + return NULL; +} + +void XpauReleaseContext( XpauContext *context ) +{ + if( context ) + { + if( context->medium_list ) + XpuFreeMediumSourceSizeList(context->medium_list); + + if( context->resolution_list ) + XpuFreeResolutionList(context->resolution_list); + + if( context->orientation_list ) + XpuFreeOrientationList(context->orientation_list); + + if( context->plex_list ) + XpuFreePlexList(context->plex_list); + + XpuClosePrinterDisplay(context->pdpy, context->pcontext); + + free(context); + } +} + +static +XpAuErrorValue XpauParseArg( const char *arg_name, const char *arg_value, XpauContext *context, + XpauFlags *jobvaluemask, XpauJobValues *jobvalues, + XpauFlags *docvaluemask, XpauDocValues *docvalues, + char **jobfilename ) +{ + XPAU_DEBUG(printf("XpauParseArg: name='%s', value='%s'\n", arg_name, arg_value)); + + if( !strcasecmp(arg_name, "file") || + !strcasecmp(arg_name, "tofile") ) + { + if( *jobfilename ) + free((char *)*jobfilename); + + *jobfilename = strdup(arg_value); + if( !*jobfilename ) + return XpAuError_error_no_memory; + + return XpAuError_success; + } + else if( !strcasecmp(arg_name, "medium") || + !strcasecmp(arg_name, "papersize")) + { + if( !(context->medium_list && (context->supported_doc_attributes & XPUATTRIBUTESUPPORTED_DEFAULT_MEDIUM)) ) + return XpAuError_unsupported_medium; + + /* XXX: What about the tray name ? */ + docvalues->medium = XpuFindMediumSourceSizeByName(context->medium_list, + context->medium_num_list_entries, + NULL, arg_value); + + if( !docvalues->medium ) + return XpAuError_unsupported_medium; + + *docvaluemask |= XpauVMedium; + return XpAuError_success; + } + else if( !strcasecmp(arg_name, "resolution") ) + { + if( !(context->resolution_list && (context->supported_doc_attributes & XPUATTRIBUTESUPPORTED_DEFAULT_PRINTER_RESOLUTION)) ) + return XpAuError_unsupported_resolution; + + docvalues->resolution = XpuFindResolutionByName(context->resolution_list, + context->resolution_num_list_entries, + arg_value); + + if( !docvalues->resolution ) + return XpAuError_unsupported_resolution; + + *docvaluemask |= XpauVResolution; + return XpAuError_success; + } + else if( !strcasecmp(arg_name, "orientation") ) + { + if( !(context->orientation_list && (context->supported_doc_attributes & XPUATTRIBUTESUPPORTED_CONTENT_ORIENTATION)) ) + return XpAuError_unsupported_orientation; + + docvalues->orientation = XpuFindOrientationByName(context->orientation_list, + context->orientation_num_list_entries, + arg_value); + + if( !docvalues->orientation ) + return XpAuError_unsupported_orientation; + + *docvaluemask |= XpauVOrientation; + return XpAuError_success; + } + else if( !strcasecmp(arg_name, "plex") ) + { + if( !(context->plex_list && (context->supported_doc_attributes & XPUATTRIBUTESUPPORTED_PLEX)) ) + return XpAuError_unsupported_plex; + + docvalues->plex = XpuFindPlexByName(context->plex_list, + context->plex_num_list_entries, + arg_value); + + if( !docvalues->plex ) + return XpAuError_unsupported_plex; + + *docvaluemask |= XpauVPlex; + return XpAuError_success; + } + else if( !strcasecmp(arg_name, "copies") ) + { + if( !(context->supported_job_attributes & XPUATTRIBUTESUPPORTED_COPY_COUNT) ) + return XpAuError_unsupported_copy_count; + + jobvalues->copies = atoi(arg_value); + if( jobvalues->copies <= 1 ) + return XpAuError_unsupported_copy_count; + + *jobvaluemask |= XpauVCopies; + return XpAuError_success; + } + else if( !strcasecmp(arg_name, "title") ) + { + if( !(context->supported_job_attributes & XPUATTRIBUTESUPPORTED_JOB_NAME) ) + return XpAuError_unsupported_job_name; + + if( jobvalues->title ) + free((char *)jobvalues->title); + + jobvalues->title = strdup(arg_value); + if( !jobvalues->title ) + return XpAuError_error_no_memory; + + *jobvaluemask |= XpauVTitle; + return XpAuError_success; + } + + return XpAuError_unknown_argument; +} + +XpAuErrorValue XpauParseArgs( XpauContext *context, + XpauFlags *jobvaluemask, XpauJobValues *jobvalues, + XpauFlags *docvaluemask, XpauDocValues *docvalues, + char **jobfilename, + const char *argument_string ) +{ + char *args_string, + *arg_name, + *arg_value, + *start, + *s; + int result; + + if( !argument_string ) + return XpAuError_success; + + args_string = strdup(argument_string); /* Create copy of read-only string that we can write into it... */ + if( !args_string ) + return XpAuError_error_no_memory; + + s = args_string; + + while( s != NULL ) + { + /* Fetch argument name */ + start = s; + while( *s != '\0' && *s != '=' ) + s++; + if( *s == '\0' ) + { + free(args_string); + return XpAuError_unexpected_eos; + } + *s++ = '\0'; + arg_name = start; + + /* Fetch argument value */ + start = s; + while( *s != '\0' && *s != ',' ) + s++; + if( *s == '\0' ) + s = NULL; + else + *s++ = '\0'; + arg_value = start; + + result = XpauParseArg(arg_name, arg_value, context, jobvaluemask, jobvalues, docvaluemask, docvalues, jobfilename); + if( result != XpAuError_success ) + { + free(args_string); + return result; + } + } + + free(args_string); + return XpAuError_success; +} + +XpAuErrorValue +XpauSetJobValues( XpauContext *context, XpauFlags valuemask, XpauJobValues *jobvalues ) +{ + /* "Dry-run" tests */ + + /* We can't change job attributes while we are at the "job level" + * (e.g. after |XpStartJob()| and before |XpEndJob()| */ + XPAU_RETURN_IF_FAIL(context->inJob == False, XpAuError_inside_job); + + if( valuemask & XpauVTitle ) + XPAU_RETURN_IF_FAIL(jobvalues->title && (context->supported_job_attributes & XPUATTRIBUTESUPPORTED_JOB_NAME), XpAuError_unsupported_job_name); + + if( valuemask & XpauVCopies ) + XPAU_RETURN_IF_FAIL((jobvalues->copies > 0) && (context->supported_job_attributes & XPUATTRIBUTESUPPORTED_COPY_COUNT), XpAuError_unsupported_copy_count); + + /* Set values */ + + if( valuemask & XpauVTitle ) + XpuSetJobTitle(context->pdpy, context->pcontext, jobvalues->title); + +#ifdef NOTNOW + if( valuemask & XpauVResolution ) + XpuJobDocumentCopies(context->pdpy, context->pcontext, jobvalues->copies); +#endif /* NOTNOW */ + + return XpAuError_success; +} + +XpAuErrorValue +XpauSetDocValues( XpauContext *context, XpauFlags valuemask, XpauDocValues *docvalues ) +{ + /* "Dry-run" tests */ + + /* We can't change document attributes while we are at the "document level" + * (e.g. after |XpStartDoc()| and before |XpEndDoc()| */ + XPAU_RETURN_IF_FAIL(context->inDocument == False, XpAuError_inside_document); + + if( valuemask & XpauVMedium ) + XPAU_RETURN_IF_FAIL(docvalues->medium && (context->supported_doc_attributes & XPUATTRIBUTESUPPORTED_DEFAULT_MEDIUM), XpAuError_unsupported_medium); + + if( valuemask & XpauVOrientation ) + XPAU_RETURN_IF_FAIL(docvalues->orientation && (context->supported_doc_attributes & XPUATTRIBUTESUPPORTED_CONTENT_ORIENTATION), XpAuError_unsupported_orientation); + + if( valuemask & XpauVPlex ) + XPAU_RETURN_IF_FAIL(docvalues->plex && (context->supported_doc_attributes & XPUATTRIBUTESUPPORTED_PLEX), XpAuError_unsupported_plex); + + if( valuemask & XpauVResolution ) + XPAU_RETURN_IF_FAIL(docvalues->resolution && (context->supported_doc_attributes & XPUATTRIBUTESUPPORTED_DEFAULT_PRINTER_RESOLUTION), XpAuError_unsupported_resolution); + + if( valuemask & XpauVCopies ) + XPAU_RETURN_IF_FAIL((docvalues->copies > 0) && (context->supported_doc_attributes & XPUATTRIBUTESUPPORTED_COPY_COUNT), XpAuError_unsupported_copy_count); + + /* Set values */ + + if( valuemask & XpauVMedium ) + XpuSetDocMediumSourceSize(context->pdpy, context->pcontext, docvalues->medium); + + if( valuemask & XpauVOrientation ) + XpuSetDocOrientation(context->pdpy, context->pcontext, docvalues->orientation); + + if( valuemask & XpauVPlex ) + XpuSetDocPlex(context->pdpy, context->pcontext, docvalues->plex); + + if( valuemask & XpauVResolution ) + XpuSetDocResolution(context->pdpy, context->pcontext, docvalues->resolution); + + if( valuemask & XpauVCopies ) + XpuSetDocumentCopies(context->pdpy, context->pcontext, docvalues->copies); + + return XpAuError_success; +} + +XpAuErrorValue +XpauSetPageValues( XpauContext *context, XpauFlags valuemask, XpauPageValues *pagevalues ) +{ + /* "Dry-run" tests */ + + /* We can't change page attributes while we are at the "page level" + * (e.g. after |XpStartPage()| and before |XpEndPage()| */ + XPAU_RETURN_IF_FAIL(context->inPage == False, XpAuError_inside_page); + + if( valuemask & XpauVMedium ) + XPAU_RETURN_IF_FAIL(pagevalues->medium && (context->supported_page_attributes & XPUATTRIBUTESUPPORTED_DEFAULT_MEDIUM), XpAuError_unsupported_medium); + + if( valuemask & XpauVOrientation ) + XPAU_RETURN_IF_FAIL(pagevalues->orientation && (context->supported_page_attributes & XPUATTRIBUTESUPPORTED_CONTENT_ORIENTATION), XpAuError_unsupported_orientation); + + if( valuemask & XpauVPlex ) + XPAU_RETURN_IF_FAIL(pagevalues->plex && (context->supported_page_attributes & XPUATTRIBUTESUPPORTED_PLEX), XpAuError_unsupported_plex); + + if( valuemask & XpauVResolution ) + XPAU_RETURN_IF_FAIL(pagevalues->resolution && (context->supported_page_attributes & XPUATTRIBUTESUPPORTED_DEFAULT_PRINTER_RESOLUTION), XpAuError_unsupported_resolution); + + /* Set values */ + + if( valuemask & XpauVMedium ) + XpuSetPageMediumSourceSize(context->pdpy, context->pcontext, pagevalues->medium); + + if( valuemask & XpauVOrientation ) + XpuSetPageOrientation(context->pdpy, context->pcontext, pagevalues->orientation); + + if( valuemask & XpauVPlex ) + XpuSetPagePlex(context->pdpy, context->pcontext, pagevalues->plex); + + if( valuemask & XpauVResolution ) + XpuSetPageResolution(context->pdpy, context->pcontext, pagevalues->resolution); + + return XpAuError_success; +} + +XpAuErrorValue XpauStartJob( XpauContext *context, const char *printerfile ) +{ + void *handle; + XpAuErrorValue result = XpAuError_unspecified_error; + + XPAU_RETURN_IF_FAIL(context->inJob == False, XpAuError_inside_job); + + /* Set print context + * Note that this modifies the available fonts, including build-in printer prints. + * All XListFonts()/XLoadFont() stuff should be done _after_ setting the print + * context to obtain the proper fonts. + */ + XpSetContext(context->pdpy, context->pcontext); + + if( printerfile ) + { + context->print_to_filehandle = XpuStartJobToFile(context->pdpy, context->pcontext, printerfile); + if( context->print_to_filehandle ) + { + result = XpAuError_success; + } + else + { + result = XpAuError_errno; + } + } + else + { + XpuStartJobToSpooler(context->pdpy); + result = XpAuError_success; + } + + /* Get default printer resolution */ + if( XpuGetResolution(context->pdpy, context->pcontext, &context->document_dpi_x, &context->document_dpi_y) != 1 ) + { + result = XpAuError_no_dpi_set; + } + + if( result == XpAuError_success ) + { + context->inJob = True; + context->pscreen = XpGetScreenOfContext(context->pdpy, context->pcontext); + context->pscreennumber = XScreenNumberOfScreen(context->pscreen); + } + + return result; +} + +XpAuErrorValue XpauEndJob( XpauContext *context ) +{ + XPAU_RETURN_IF_FAIL(context->inJob, XpAuError_not_inside_job); + + /* End the print job - the final results are sent by the X print + * server to the spooler sub system. + */ + XpEndJob(context->pdpy); + + /* Be sure to process the X traffic (remember that we registered a + * "consumer" hook via Xlib internal magic when we print to a + * file) + * FixMe: |XpuWaitForPrintFileChild()| should call XFlush() instead! + */ + XFlush(context->pdpy); + + context->inJob = False; + context->pscreen = NULL; + context->pscreennumber = -1; + context->document_dpi_x = 0L; + context->document_dpi_y = 0L; + + if( context->print_to_filehandle ) + { + if( XpuWaitForPrintFileChild(context->print_to_filehandle) != XPGetDocFinished ) + { + return XpAuError_errno; + } + } + + return XpAuError_success; +} + +XpAuErrorValue XpauStartDocument( XpauContext *context, XPDocumentType type ) +{ + XPAU_RETURN_IF_FAIL(context->inJob == True, XpAuError_not_inside_job); + XPAU_RETURN_IF_FAIL(context->inDocument == False, XpAuError_inside_document); + XPAU_RETURN_IF_FAIL(context->inPage == False, XpAuError_inside_page); + + XpStartDoc(context->pdpy, type); + context->inDocument = True; + + return XpAuError_success; +} + +XpAuErrorValue XpauEndDocument( XpauContext *context ) +{ + XPAU_RETURN_IF_FAIL(context->inDocument, XpAuError_not_inside_document); + + XpEndDoc(context->pdpy); + context->inDocument = False; + + return XpAuError_success; +} + +XpAuErrorValue XpauStartPage( XpauContext *context, Window pwin ) +{ + XPAU_RETURN_IF_FAIL(context->inPage == False, XpAuError_inside_page); + XPAU_RETURN_IF_FAIL(context->inJob == True, XpAuError_not_inside_job); + + XpStartPage(context->pdpy, pwin); + + /* |XpStartPage()| will generate a "synthetic" |XpStartDoc()| + * if it was not called yet */ + if( context->inDocument == False ) + { + context->inDocument = True; + } + + context->inPage = True; + + return XpAuError_success; +} + +XpAuErrorValue XpauEndPage( XpauContext *context ) +{ + XPAU_RETURN_IF_FAIL(context->inPage, XpAuError_not_inside_page); + + XpEndPage(context->pdpy); + context->inPage = False; + + return XpAuError_success; +} + +void XpauWaitForPrintNotify(XpauContext *context, int type) +{ + XpuWaitForPrintNotify(context->pdpy, context->xp_event_base, type); +} + + +const char *XpAuErrorValueToString(XpAuErrorValue value) +{ + char *msg; + + switch(value) + { + case XpAuError_success: msg = "success" ; break; + case XpAuError_errno: msg = strerror(errno) ; break; + case XpAuError_error_no_memory: msg = "out of memory" ; break; + case XpAuError_unexpected_eos: msg = "unexpected end of string" ; break; + case XpAuError_unknown_argument: msg = "unknown argument" ; break; + case XpAuError_unsupported_medium: msg = "unsupported print medium" ; break; + case XpAuError_unsupported_resolution: msg = "unsupported print resolution" ; break; + case XpAuError_unsupported_orientation: msg = "unsupported orientation" ; break; + case XpAuError_unsupported_plex: msg = "unsupported plex" ; break; + case XpAuError_unsupported_copy_count: msg = "unsupported copy count" ; break; + case XpAuError_unsupported_job_name: msg = "unsupported job name" ; break; + case XpAuError_no_dpi_set: msg = "no DPI set (or no default DPI provided by server)" ; break; + case XpAuError_not_inside_job: msg = "state error: not inside job" ; break; + case XpAuError_not_inside_document: msg = "state error: not inside document" ; break; + case XpAuError_not_inside_page: msg = "stage error: not inside page" ; break; + case XpAuError_inside_job: msg = "state error: (already) inside job" ; break; + case XpAuError_inside_document: msg = "state error: (already) inside document" ; break; + case XpAuError_inside_page: msg = "stage error: (already) inside page" ; break; + case XpAuError_unspecified_error: msg = "unspecified error" ; break; + default: + msg = "unknown error" ; + break; + } + + return msg; +} + + + + |