diff options
author | marha <marha@users.sourceforge.net> | 2011-03-25 15:37:13 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-03-25 15:37:13 +0000 |
commit | 41a502478a2972358dec934d82ee401c61a5cd36 (patch) | |
tree | 3fda8100e6da9b4a2863789e393016a750502067 /libXpm/sxpm | |
parent | 81aeaf653a832c4054d9a40b1cc796911521a739 (diff) | |
parent | 272e57235cd60a2e65ac8258d96a02eb3939b687 (diff) | |
download | vcxsrv-41a502478a2972358dec934d82ee401c61a5cd36.tar.gz vcxsrv-41a502478a2972358dec934d82ee401c61a5cd36.tar.bz2 vcxsrv-41a502478a2972358dec934d82ee401c61a5cd36.zip |
svn merge ^/branches/released .
Diffstat (limited to 'libXpm/sxpm')
-rw-r--r-- | libXpm/sxpm/Makefile.am | 97 | ||||
-rw-r--r-- | libXpm/sxpm/Makefile.in | 633 | ||||
-rw-r--r-- | libXpm/sxpm/sxpm.c | 1501 | ||||
-rw-r--r-- | libXpm/sxpm/sxpm.man | 263 |
4 files changed, 921 insertions, 1573 deletions
diff --git a/libXpm/sxpm/Makefile.am b/libXpm/sxpm/Makefile.am index faa192c37..706ebd963 100644 --- a/libXpm/sxpm/Makefile.am +++ b/libXpm/sxpm/Makefile.am @@ -1,57 +1,40 @@ -if BUILD_SXPM - -bin_PROGRAMS = sxpm - -AM_CFLAGS = $(CWARNFLAGS) $(SXPM_CFLAGS) - -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include - -sxpm_SOURCES = sxpm.c - -sxpm_LDADD = $(XPM_LIBS) $(SXPM_LIBS) $(top_builddir)/src/libXpm.la - -# Man page -appmandir = $(APP_MAN_DIR) - -appman_PRE = sxpm.man -appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@) - -CLEANFILES = $(appman_DATA) - -# Strings to replace in man pages -XORGRELSTRING = @PACKAGE_STRING@ - XORGMANNAME = X Version 11 - -MAN_SUBSTS = \ - -e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ - -e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ - -e 's|__xservername__|Xorg|g' \ - -e 's|__xconfigfile__|xorg.conf|g' \ - -e 's|__projectroot__|$(prefix)|g' \ - -e 's|__apploaddir__|$(appdefaultdir)|' \ - -e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \ - -e 's|__libmansuffix__|$(LIB_MAN_SUFFIX)|g' \ - -e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \ - -e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \ - -e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g' - -SUFFIXES = .$(APP_MAN_SUFFIX) .man - -.man.$(APP_MAN_SUFFIX): - $(AM_V_GEN)sed $(MAN_SUBSTS) < $< > $@ - -if USE_GETTEXT -noinst_DATA = sxpm.po - -sxpm.po: $(sxpm_SOURCES:%=$(srcdir)/%) - $(AM_V_GEN)xgettext -c"L10N_Comments" -d sxpm -n $(sxpm_SOURCES:%=$(srcdir)/%) - -CLEANFILES += sxpm.po -endif -endif - -EXTRA_DIST = \ - plaid_ext.xpm \ - plaid_mask.xpm \ - plaid.xpm \ - sxpm.man +if BUILD_SXPM
+
+bin_PROGRAMS = sxpm
+
+AM_CPPFLAGS = -I$(top_srcdir)/include
+AM_CFLAGS = $(CWARNFLAGS) $(SXPM_CFLAGS)
+
+sxpm_SOURCES = sxpm.c
+
+LDADD = $(SXPM_LIBS) $(top_builddir)/src/libXpm.la
+
+# Man page
+appmandir = $(APP_MAN_DIR)
+
+appman_PRE = sxpm.man
+appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
+
+CLEANFILES = $(appman_DATA)
+
+SUFFIXES = .$(APP_MAN_SUFFIX) .man
+
+# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
+.man.$(APP_MAN_SUFFIX):
+ $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
+
+if USE_GETTEXT
+noinst_DATA = sxpm.po
+
+sxpm.po: $(sxpm_SOURCES:%=$(srcdir)/%)
+ $(AM_V_GEN)xgettext -c"L10N_Comments" -d sxpm -n $(sxpm_SOURCES:%=$(srcdir)/%)
+
+CLEANFILES += sxpm.po
+endif
+endif
+
+EXTRA_DIST = \
+ plaid_ext.xpm \
+ plaid_mask.xpm \
+ plaid.xpm \
+ sxpm.man
diff --git a/libXpm/sxpm/Makefile.in b/libXpm/sxpm/Makefile.in deleted file mode 100644 index a70f88ac0..000000000 --- a/libXpm/sxpm/Makefile.in +++ /dev/null @@ -1,633 +0,0 @@ -# Makefile.in generated by automake 1.11 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ - - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -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 = : -build_triplet = @build@ -host_triplet = @host@ -@BUILD_SXPM_TRUE@bin_PROGRAMS = sxpm$(EXEEXT) -@BUILD_SXPM_TRUE@@USE_GETTEXT_TRUE@am__append_1 = sxpm.po -subdir = sxpm -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appmandir)" -PROGRAMS = $(bin_PROGRAMS) -am__sxpm_SOURCES_DIST = sxpm.c -@BUILD_SXPM_TRUE@am_sxpm_OBJECTS = sxpm.$(OBJEXT) -sxpm_OBJECTS = $(am_sxpm_OBJECTS) -am__DEPENDENCIES_1 = -@BUILD_SXPM_TRUE@sxpm_DEPENDENCIES = $(am__DEPENDENCIES_1) \ -@BUILD_SXPM_TRUE@ $(am__DEPENDENCIES_1) \ -@BUILD_SXPM_TRUE@ $(top_builddir)/src/libXpm.la -AM_V_lt = $(am__v_lt_$(V)) -am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) -am__v_lt_0 = --silent -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_$(V)) -am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_$(V)) -am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) -am__v_at_0 = @ -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_$(V)) -am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_$(V)) -am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) -am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(sxpm_SOURCES) -DIST_SOURCES = $(am__sxpm_SOURCES_DIST) -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -DATA = $(appman_DATA) $(noinst_DATA) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ -ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -APP_MAN_DIR = @APP_MAN_DIR@ -APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CHANGELOG_CMD = @CHANGELOG_CMD@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CWARNFLAGS = @CWARNFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ -DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DSYMUTIL = @DSYMUTIL@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FILE_MAN_DIR = @FILE_MAN_DIR@ -FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ -GREP = @GREP@ -INSTALL = @INSTALL@ -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@ -LIB_MAN_DIR = @LIB_MAN_DIR@ -LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ -LN_S = @LN_S@ -LOCALEDIR = @LOCALEDIR@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -MISC_MAN_DIR = @MISC_MAN_DIR@ -MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ -MKDIR_P = @MKDIR_P@ -NMEDIT = @NMEDIT@ -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@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -SXPM_CFLAGS = @SXPM_CFLAGS@ -SXPM_LIBS = @SXPM_LIBS@ -VERSION = @VERSION@ -XPM_CFLAGS = @XPM_CFLAGS@ -XPM_LIBS = @XPM_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -distcleancheck_listfiles = @distcleancheck_listfiles@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -@BUILD_SXPM_TRUE@AM_CFLAGS = $(CWARNFLAGS) $(SXPM_CFLAGS) -@BUILD_SXPM_TRUE@AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -@BUILD_SXPM_TRUE@sxpm_SOURCES = sxpm.c -@BUILD_SXPM_TRUE@sxpm_LDADD = $(XPM_LIBS) $(SXPM_LIBS) $(top_builddir)/src/libXpm.la - -# Man page -@BUILD_SXPM_TRUE@appmandir = $(APP_MAN_DIR) -@BUILD_SXPM_TRUE@appman_PRE = sxpm.man -@BUILD_SXPM_TRUE@appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@) -@BUILD_SXPM_TRUE@CLEANFILES = $(appman_DATA) $(am__append_1) - -# Strings to replace in man pages -@BUILD_SXPM_TRUE@XORGRELSTRING = @PACKAGE_STRING@ -@BUILD_SXPM_TRUE@XORGMANNAME = X Version 11 -@BUILD_SXPM_TRUE@MAN_SUBSTS = \ -@BUILD_SXPM_TRUE@ -e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ -@BUILD_SXPM_TRUE@ -e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ -@BUILD_SXPM_TRUE@ -e 's|__xservername__|Xorg|g' \ -@BUILD_SXPM_TRUE@ -e 's|__xconfigfile__|xorg.conf|g' \ -@BUILD_SXPM_TRUE@ -e 's|__projectroot__|$(prefix)|g' \ -@BUILD_SXPM_TRUE@ -e 's|__apploaddir__|$(appdefaultdir)|' \ -@BUILD_SXPM_TRUE@ -e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \ -@BUILD_SXPM_TRUE@ -e 's|__libmansuffix__|$(LIB_MAN_SUFFIX)|g' \ -@BUILD_SXPM_TRUE@ -e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \ -@BUILD_SXPM_TRUE@ -e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \ -@BUILD_SXPM_TRUE@ -e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g' - -@BUILD_SXPM_TRUE@SUFFIXES = .$(APP_MAN_SUFFIX) .man -@BUILD_SXPM_TRUE@@USE_GETTEXT_TRUE@noinst_DATA = sxpm.po -EXTRA_DIST = \ - plaid_ext.xpm \ - plaid_mask.xpm \ - plaid.xpm \ - sxpm.man - -all: all-am - -.SUFFIXES: -.SUFFIXES: .$(APP_MAN_SUFFIX) .man .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu sxpm/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu sxpm/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - for p in $$list; do echo "$$p $$p"; done | \ - sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p || test -f $$p1; \ - then echo "$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ - -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ - sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) files[d] = files[d] " " $$1; \ - else { print "f", $$3 "/" $$4, $$1; } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' `; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files - -clean-binPROGRAMS: - @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list -sxpm$(EXEEXT): $(sxpm_OBJECTS) $(sxpm_DEPENDENCIES) - @rm -f sxpm$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(sxpm_OBJECTS) $(sxpm_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sxpm.Po@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -install-appmanDATA: $(appman_DATA) - @$(NORMAL_INSTALL) - test -z "$(appmandir)" || $(MKDIR_P) "$(DESTDIR)$(appmandir)" - @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(appmandir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(appmandir)" || exit $$?; \ - done - -uninstall-appmanDATA: - @$(NORMAL_UNINSTALL) - @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(appmandir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(appmandir)" && rm -f $$files - -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; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - 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; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - 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; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$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 $(PROGRAMS) $(DATA) -installdirs: - for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appmandir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -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: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-binPROGRAMS clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: install-appmanDATA - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-binPROGRAMS - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -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-appmanDATA uninstall-binPROGRAMS - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ - clean-generic clean-libtool ctags distclean distclean-compile \ - distclean-generic distclean-libtool distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-appmanDATA install-binPROGRAMS install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am 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-appmanDATA \ - uninstall-binPROGRAMS - - -@BUILD_SXPM_TRUE@.man.$(APP_MAN_SUFFIX): -@BUILD_SXPM_TRUE@ $(AM_V_GEN)sed $(MAN_SUBSTS) < $< > $@ - -@BUILD_SXPM_TRUE@@USE_GETTEXT_TRUE@sxpm.po: $(sxpm_SOURCES:%=$(srcdir)/%) -@BUILD_SXPM_TRUE@@USE_GETTEXT_TRUE@ $(AM_V_GEN)xgettext -c"L10N_Comments" -d sxpm -n $(sxpm_SOURCES:%=$(srcdir)/%) - -# 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/libXpm/sxpm/sxpm.c b/libXpm/sxpm/sxpm.c index 1b80d5385..86e71443b 100644 --- a/libXpm/sxpm/sxpm.c +++ b/libXpm/sxpm/sxpm.c @@ -1,751 +1,750 @@ -/* - * Copyright (C) 1989-95 GROUPE BULL - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * 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 - * GROUPE BULL 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 GROUPE BULL shall not be - * used in advertising or otherwise to promote the sale, use or other dealings - * in this Software without prior written authorization from GROUPE BULL. - */ -/* $XFree86: xc/extras/Xpm/sxpm/sxpm.c,v 1.2 2001/08/01 00:44:34 tsi Exp $ */ - -/*****************************************************************************\ -* sxpm.c: * -* * -* Show XPM File program * -* * -* Developed by Arnaud Le Hors * -\*****************************************************************************/ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <stdio.h> -#include <stdlib.h> -#include <X11/StringDefs.h> -#include <X11/Intrinsic.h> -#include <X11/IntrinsicP.h> -#include <X11/Shell.h> - -#ifdef VMS -#include <X11/shape.h> -#else -#include <X11/extensions/shape.h> -#endif - -#include <X11/xpm.h> - -#ifdef USE_GETTEXT -#include <locale.h> -#include <libintl.h> -#else -#define gettext(a) (a) -#endif - -/* XPM */ -/* plaid pixmap */ -static char *plaid[] = { - /* width height ncolors chars_per_pixel */ - "22 22 4 2 XPMEXT", - /* colors */ - " c red m white s light_color", - "Y c green m black s lines_in_mix", - "+ c yellow m white s lines_in_dark", - "x m black s dark_color", - /* pixels */ - "x x x x x x x x x x x x + x x x x x ", - " x x x x x x x x x x x x x x x x ", - "x x x x x x x x x x x x + x x x x x ", - " x x x x x x x x x x x x x x x x ", - "x x x x x x x x x x x x + x x x x x ", - "Y Y Y Y Y x Y Y Y Y Y + x + x + x + x + x + ", - "x x x x x x x x x x x x + x x x x x ", - " x x x x x x x x x x x x x x x x ", - "x x x x x x x x x x x x + x x x x x ", - " x x x x x x x x x x x x x x x x ", - "x x x x x x x x x x x x + x x x x x ", - " x x x x Y x x x ", - " x x x Y x x ", - " x x x x Y x x x ", - " x x x Y x x ", - " x x x x Y x x x ", - "x x x x x x x x x x x x x x x x x x x x x x ", - " x x x x Y x x x ", - " x x x Y x x ", - " x x x x Y x x x ", - " x x x Y x x ", - " x x x x Y x x x ", - "bullshit", - "XPMEXT ext1 data1", - "XPMEXT ext2", - "data2_1", - "data2_2", - "XPMEXT", - "foo", - "", - "XPMEXT ext3", - "data3", - "XPMENDEXT" -}; - -#define win XtWindow(topw) -#define dpy XtDisplay(topw) -#define root XRootWindowOfScreen(XtScreen(topw)) -#define xrdb XtDatabase(dpy) -static Colormap colormap; - -void Usage(void); -void ErrorMessage(int ErrorStatus, char *tag); -void Punt(int i); -void VersionInfo(void); -void kinput(Widget widget, char *tag, XEvent *xe, Boolean *b); -void GetNumbers(int num, int *format_return, - int *libmajor_return, - char *libminor_return); - -#define IWIDTH 50 -#define IHEIGHT 50 - -typedef struct _XpmIcon { - Pixmap pixmap; - Pixmap mask; - XpmAttributes attributes; -} XpmIcon; - -static char **command; -static Widget topw; -static XpmIcon view, icon; -static XrmOptionDescRec options[] = { - {"-hints", ".hints", XrmoptionNoArg, (XtPointer) "True"}, - {"-icon", ".icon", XrmoptionSepArg, (XtPointer) NULL}, -}; - -int -main( - int argc, - char **argv) -{ - int ErrorStatus; - unsigned int verbose = 0; /* performs verbose output */ - unsigned int stdinf = 1; /* read from stdin */ - unsigned int stdoutf = 0; /* write to stdout */ - unsigned int nod = 0; /* no display */ - unsigned int nom = 0; /* no mask display */ - unsigned int incResize = 0; - unsigned int resize = 0; - unsigned int w_rtn; - unsigned int h_rtn; - char *input = NULL; - char *output = NULL; - char *iconFile = NULL; - unsigned int numsymbols = 0; - XpmColorSymbol symbols[10]; - char *stype; - XrmValue val; - unsigned long valuemask = 0; - int n; - Arg args[4]; - -#ifdef Debug - char **data; - char *buffer; -#endif - -#ifdef USE_GETTEXT - XtSetLanguageProc(NULL,NULL,NULL); - bindtextdomain("sxpm",LOCALEDIR); - textdomain("sxpm"); -#endif - - topw = XtInitialize(argv[0], "Sxpm", - options, XtNumber(options), &argc, argv); - - if (!topw) { - /* L10N_Comments : Error if no $DISPLAY or $DISPLAY can't be opened. - Not normally reached as Xt exits before we get here. */ - fprintf(stderr, gettext("Sxpm Error... [ Undefined DISPLAY ]\n")); - exit(1); - } - colormap = XDefaultColormapOfScreen(XtScreen(topw)); - - /* - * geometry management - */ - - if (XrmGetResource(xrdb, NULL, "sxpm.geometry", &stype, &val) - || XrmGetResource(xrdb, NULL, "Sxpm.geometry", &stype, &val)) { - - int flags; - int x_rtn; - int y_rtn; - char *geo = NULL; - - geo = (char *) val.addr; - flags = XParseGeometry(geo, &x_rtn, &y_rtn, - (unsigned int *) &w_rtn, - (unsigned int *) &h_rtn); - - if (!((WidthValue & flags) && (HeightValue & flags))) - resize = 1; - - } else - resize = 1; - - n = 0; - if (resize) { - w_rtn = 0; - h_rtn = 0; - XtSetArg(args[n], XtNwidth, 1); - n++; - XtSetArg(args[n], XtNheight, 1); - n++; - } - XtSetArg(args[n], XtNmappedWhenManaged, False); - n++; - XtSetArg(args[n], XtNinput, True); - n++; - XtSetValues(topw, args, n); - - if ((XrmGetResource(xrdb, "sxpm.hints", "", &stype, &val) - || XrmGetResource(xrdb, "Sxpm.hints", "", &stype, &val)) - && !strcmp((char *) val.addr, "True")) { - /* gotcha */ - incResize = 1; - resize = 1; - } - - /* - * icon management - */ - - if (XrmGetResource(xrdb, "sxpm.icon", "", &stype, &val) - || XrmGetResource(xrdb, "Sxpm.icon", "", &stype, &val)) { - iconFile = (char *) val.addr; - } - if (iconFile) { - - XColor color, junk; - Pixel bpix; - Window iconW; - - if (XAllocNamedColor(dpy, colormap, "black", &color, &junk)) - bpix = color.pixel; - else - bpix = XBlackPixelOfScreen(XtScreen(topw)); - - iconW = XCreateSimpleWindow(dpy, root, 0, 0, - IWIDTH, IHEIGHT, 1, bpix, bpix); - - icon.attributes.valuemask = XpmReturnAllocPixels; - ErrorStatus = XpmReadFileToPixmap(dpy, root, iconFile, &icon.pixmap, - &icon.mask, &icon.attributes); - ErrorMessage(ErrorStatus, "Icon"); - - XSetWindowBackgroundPixmap(dpy, iconW, icon.pixmap); - - n = 0; - XtSetArg(args[n], XtNbackground, bpix); - n++; - XtSetArg(args[n], XtNiconWindow, iconW); - n++; - XtSetValues(topw, args, n); - } - - /* - * arguments parsing - */ - - command = argv; - for (n = 1; n < argc; n++) { - if (strcmp(argv[n], "-plaid") == 0) { - stdinf = 0; - continue; - } - if (argv[n][0] != '-') { - stdinf = 0; - input = argv[n]; - continue; - } - if ((strlen(argv[n]) == 1) && (argv[n][0] == '-')) - /* stdin */ - continue; - if (strcmp(argv[n], "-o") == 0) { - if (n < argc - 1) { - if ((strlen(argv[n + 1]) == 1) && (argv[n + 1][0] == '-')) - stdoutf = 1; - else - output = argv[n + 1]; - n++; - continue; - } else - Usage(); - } - if (strcmp(argv[n], "-nod") == 0) { - nod = 1; - continue; - } - if (strcmp(argv[n], "-nom") == 0) { - nom = 1; - continue; - } - if (strcmp(argv[n], "-sc") == 0) { - if (n < argc - 2) { - valuemask |= XpmColorSymbols; - symbols[numsymbols].name = argv[++n]; - symbols[numsymbols++].value = argv[++n]; - continue; - } else - Usage(); - } - if (strcmp(argv[n], "-sp") == 0) { - if (n < argc - 2) { - valuemask |= XpmColorSymbols; - symbols[numsymbols].name = argv[++n]; - symbols[numsymbols].value = NULL; - symbols[numsymbols++].pixel = atol(argv[++n]); - continue; - } - } - if (strcmp(argv[n], "-cp") == 0) { - if (n < argc - 2) { - valuemask |= XpmColorSymbols; - symbols[numsymbols].name = NULL; - symbols[numsymbols].value = argv[++n]; - symbols[numsymbols++].pixel = atol(argv[++n]); - continue; - } - } - if (strcmp(argv[n], "-mono") == 0) { - valuemask |= XpmColorKey; - view.attributes.color_key = XPM_MONO; - continue; - } - if (strcmp(argv[n], "-gray4") == 0 || strcmp(argv[n], "-grey4") == 0) { - valuemask |= XpmColorKey; - view.attributes.color_key = XPM_GRAY4; - continue; - } - if (strcmp(argv[n], "-gray") == 0 || strcmp(argv[n], "-grey") == 0) { - valuemask |= XpmColorKey; - view.attributes.color_key = XPM_GRAY; - continue; - } - if (strcmp(argv[n], "-color") == 0) { - valuemask |= XpmColorKey; - view.attributes.color_key = XPM_COLOR; - continue; - } - if (strncmp(argv[n], "-closecolors", 6) == 0) { - valuemask |= XpmCloseness; - view.attributes.closeness = 40000; - continue; - } - if (strcmp(argv[n], "-rgb") == 0) { - if (n < argc - 1) { - valuemask |= XpmRgbFilename; - view.attributes.rgb_fname = argv[++n]; - continue; - } else - Usage(); - - } - if (strncmp(argv[n], "-version", 4) == 0) { - VersionInfo(); - exit(0); - } - if (strcmp(argv[n], "-v") == 0) { - verbose = 1; - continue; - } - if (strcmp(argv[n], "-pcmap") == 0) { - valuemask |= XpmColormap; - continue; - } - Usage(); - } - - XtRealizeWidget(topw); - if (valuemask & XpmColormap) { - colormap = XCreateColormap(dpy, win, - DefaultVisual(dpy, DefaultScreen(dpy)), - AllocNone); - view.attributes.colormap = colormap; - XSetWindowColormap(dpy, win, colormap); - } - view.attributes.colorsymbols = symbols; - view.attributes.numsymbols = numsymbols; - view.attributes.valuemask = valuemask; - -#ifdef Debug - /* this is just to test the XpmCreateDataFromPixmap function */ - - view.attributes.valuemask |= XpmReturnAllocPixels; - view.attributes.valuemask |= XpmReturnExtensions; - ErrorStatus = XpmCreatePixmapFromData(dpy, win, plaid, - &view.pixmap, &view.mask, - &view.attributes); - ErrorMessage(ErrorStatus, "Plaid"); - - ErrorStatus = XpmCreateDataFromPixmap(dpy, &data, view.pixmap, view.mask, - &view.attributes); - ErrorMessage(ErrorStatus, "Data"); - if (verbose && view.attributes.nextensions) { - unsigned int i, j; - - for (i = 0; i < view.attributes.nextensions; i++) { - fprintf(stderr, "Xpm extension : %s\n", - view.attributes.extensions[i].name); - for (j = 0; j < view.attributes.extensions[i].nlines; j++) - fprintf(stderr, "\t\t%s\n", - view.attributes.extensions[i].lines[j]); - } - } - XFreePixmap(dpy, view.pixmap); - if (view.mask) - XFreePixmap(dpy, view.mask); - - XFreeColors(dpy, colormap, - view.attributes.alloc_pixels, - view.attributes.nalloc_pixels, 0); - - XpmFreeAttributes(&view.attributes); - view.attributes.valuemask = valuemask; -#endif - - if (input || stdinf) { - view.attributes.valuemask |= XpmReturnInfos; - view.attributes.valuemask |= XpmReturnAllocPixels; - view.attributes.valuemask |= XpmReturnExtensions; - -#ifdef Debug - XpmFree(data); - - /* - * this is just to test the XpmCreatePixmapFromBuffer and - * XpmCreateBufferFromPixmap functions - */ - ErrorStatus = XpmReadFileToBuffer(input, &buffer); - ErrorMessage(ErrorStatus, "CreateBufferFromFile"); - - ErrorStatus = XpmCreatePixmapFromBuffer(dpy, win, buffer, - &view.pixmap, &view.mask, - &view.attributes); - ErrorMessage(ErrorStatus, "CreatePixmapFromBuffer"); - XpmFree(buffer); - ErrorStatus = XpmCreateBufferFromPixmap(dpy, &buffer, - view.pixmap, view.mask, - &view.attributes); - ErrorMessage(ErrorStatus, "CreateBufferFromPixmap"); - ErrorStatus = XpmWriteFileFromBuffer("buffer_output", buffer); - ErrorMessage(ErrorStatus, "WriteFileFromBuffer"); - XpmFree(buffer); - if (view.pixmap) { - XFreePixmap(dpy, view.pixmap); - if (view.mask) - XFreePixmap(dpy, view.mask); - - XFreeColors(dpy, colormap, view.attributes.alloc_pixels, - view.attributes.nalloc_pixels, 0); - - XpmFreeAttributes(&view.attributes); - } - ErrorStatus = XpmReadFileToData(input, &data); - ErrorMessage(ErrorStatus, "ReadFileToData"); - ErrorStatus = XpmCreatePixmapFromData(dpy, win, data, - &view.pixmap, &view.mask, - &view.attributes); - ErrorMessage(ErrorStatus, "CreatePixmapFromData"); - ErrorStatus = XpmWriteFileFromData("sxpmout.xpm", data); - ErrorMessage(ErrorStatus, "WriteFileFromData"); - XpmFree(data); - XpmFreeAttributes(&view.attributes); -#endif - ErrorStatus = XpmReadFileToPixmap(dpy, win, input, - &view.pixmap, &view.mask, - &view.attributes); - ErrorMessage(ErrorStatus, "Read"); - if (verbose && view.attributes.nextensions) { - unsigned int i, j; - - for (i = 0; i < view.attributes.nextensions; i++) { - /* L10N_Comments : Output when -v & file has extensions - %s is replaced by extension name */ - fprintf(stderr, gettext("Xpm extension : %s\n"), - view.attributes.extensions[i].name); - for (j = 0; j < view.attributes.extensions[i].nlines; j++) - fprintf(stderr, "\t\t%s\n", - view.attributes.extensions[i].lines[j]); - } - } - } else { -#ifdef Debug - ErrorStatus = XpmCreatePixmapFromData(dpy, win, data, - &view.pixmap, &view.mask, - &view.attributes); - XpmFree(data); -#else - ErrorStatus = XpmCreatePixmapFromData(dpy, win, plaid, - &view.pixmap, &view.mask, - &view.attributes); -#endif - ErrorMessage(ErrorStatus, "Plaid"); - } - if (output || stdoutf) { - ErrorStatus = XpmWriteFileFromPixmap(dpy, output, view.pixmap, - view.mask, &view.attributes); - ErrorMessage(ErrorStatus, "Write"); - } - if (!nod) { - - /* - * manage display if requested - */ - - XSizeHints size_hints; - char *xString = NULL; - - if (w_rtn && h_rtn - && ((w_rtn < view.attributes.width) - || h_rtn < view.attributes.height)) { - resize = 1; - } - if (resize) { - XtResizeWidget(topw, - view.attributes.width, view.attributes.height, 1); - } - if (incResize) { - size_hints.flags = USSize | PMinSize | PResizeInc; - size_hints.height = view.attributes.height; - size_hints.width = view.attributes.width; - size_hints.height_inc = view.attributes.height; - size_hints.width_inc = view.attributes.width; - } else - size_hints.flags = PMinSize; - - size_hints.min_height = view.attributes.height; - size_hints.min_width = view.attributes.width; - XSetWMNormalHints(dpy, win, &size_hints); - - if (input) { - xString = (char *) XtMalloc((sizeof(char) * strlen(input)) + 20); - sprintf(xString, "Sxpm: %s", input); - XStoreName(dpy, win, xString); - XSetIconName(dpy, win, xString); - } else if (stdinf) { - XStoreName(dpy, win, "Sxpm: stdin"); - XSetIconName(dpy, win, "Sxpm: stdin"); - } else { - XStoreName(dpy, win, "Sxpm"); - XSetIconName(dpy, win, "Sxpm"); - } - - XtAddEventHandler(topw, KeyPressMask, False, - (XtEventHandler) kinput, NULL); - XSetWindowBackgroundPixmap(dpy, win, view.pixmap); - - if (view.mask && !nom) - XShapeCombineMask(dpy, win, ShapeBounding, 0, 0, - view.mask, ShapeSet); - - XClearWindow(dpy, win); - XtMapWidget(topw); - if (xString) - XtFree(xString); - XtMainLoop(); - } - Punt(0); - - /* Muffle gcc */ - return 0; -} - -void -Usage(void) -{ - /* L10N_Comments : Usage message (sxpm -h) in two parts. - In the first part %s is replaced by the command name. */ - fprintf(stderr, gettext("\nUsage: %s [options...]\n"), command[0]); - fprintf(stderr, gettext("Where options are:\n\ -\n\ -[-d host:display] Display to connect to.\n\ -[-g geom] Geometry of window.\n\ -[-hints] Set ResizeInc for window.\n\ -[-icon filename] Set pixmap for iconWindow.\n\ -[-plaid] Read the included plaid pixmap.\n\ -[filename] Read from file 'filename', and from standard\n\ - input if 'filename' is '-'.\n\ -[-o filename] Write to file 'filename', and to standard\n\ - output if 'filename' is '-'.\n\ -[-pcmap] Use a private colormap.\n\ -[-closecolors] Try to use `close' colors.\n\ -[-nod] Don't display in window.\n\ -[-nom] Don't use clip mask if any.\n\ -[-mono] Use the colors specified for a monochrome visual.\n\ -[-grey4] Use the colors specified for a 4 greyscale visual.\n\ -[-grey] Use the colors specified for a greyscale visual.\n\ -[-color] Use the colors specified for a color visual.\n\ -[-sc symbol color] Override color defaults.\n\ -[-sp symbol pixel] Override color defaults.\n\ -[-cp color pixel] Override color defaults.\n\ -[-rgb filename] Search color names in the rgb text file 'filename'.\n\ -[-v] Verbose - print out extensions.\n\ -[-version] Print out program's version number\n\ - and library's version number if different.\n\ -if no input is specified sxpm reads from standard input.\n\ -\n")); - exit(0); -} - - -void -ErrorMessage( - int ErrorStatus, - char *tag) -{ - char *error = NULL; - char *warning = NULL; - - switch (ErrorStatus) { - case XpmSuccess: - return; - case XpmColorError: -/* L10N_Comments : The following set of messages are classified as - either errors or warnings. Based on the class of message, different - wrappers are selected at the end to state the message source & class. - - L10N_Comments : WARNING produced when filename can be read, but - contains an invalid color specification (need to create test case)*/ - warning = gettext("Could not parse or alloc requested color"); - break; - case XpmOpenFailed: - /* L10N_Comments : ERROR produced when filename does not exist - or insufficient permissions to open (i.e. sxpm /no/such/file ) */ - error = gettext("Cannot open file"); - break; - case XpmFileInvalid: - /* L10N_Comments : ERROR produced when filename can be read, but - is not an XPM file (i.e. sxpm /dev/null ) */ - error = gettext("Invalid XPM file"); - break; - case XpmNoMemory: - /* L10N_Comments : ERROR produced when filename can be read, but - is too big for memory - (i.e. limit datasize 32 ; sxpm /usr/dt/backdrops/Crochet.pm ) */ - error = gettext("Not enough memory"); - break; - case XpmColorFailed: - /* L10N_Comments : ERROR produced when filename can be read, but - contains an invalid color specification (need to create test case)*/ - error = gettext("Failed to parse or alloc some color"); - break; - } - - if (warning) - /* L10N_Comments : Wrapper around above WARNING messages. - First %s is the tag for the operation that produced the warning. - Second %s is the message selected from the above set. */ - fprintf(stderr, gettext("%s Xpm Warning: %s.\n"), tag, warning); - - if (error) { - /* L10N_Comments : Wrapper around above ERROR messages. - First %s is the tag for the operation that produced the error. - Second %s is the message selected from the above set */ - fprintf(stderr, gettext("%s Xpm Error: %s.\n"), tag, error); - Punt(1); - } -} - -void -Punt(int i) -{ - if (icon.pixmap) { - XFreePixmap(dpy, icon.pixmap); - if (icon.mask) - XFreePixmap(dpy, icon.mask); - - XFreeColors(dpy, colormap, - icon.attributes.alloc_pixels, - icon.attributes.nalloc_pixels, 0); - - XpmFreeAttributes(&icon.attributes); - } - if (view.pixmap) { - XFreePixmap(dpy, view.pixmap); - if (view.mask) - XFreePixmap(dpy, view.mask); - - XFreeColors(dpy, colormap, - view.attributes.alloc_pixels, - view.attributes.nalloc_pixels, 0); - - XpmFreeAttributes(&view.attributes); - } - exit(i); -} - -void -kinput( - Widget widget, - char *tag, - XEvent *xe, - Boolean *b) -{ - char c = '\0'; - - XLookupString(&(xe->xkey), &c, 1, NULL, NULL); - if (c == 'q' || c == 'Q') - Punt(0); -} - -/* - * small function to extract various version numbers from the given global - * number (following the rule described in xpm.h). - */ -void -GetNumbers( - int num, - int *format_return, - int *libmajor_return, - char *libminor_return) -{ - *format_return = num / 10000; - *libmajor_return = (num % 10000) / 100; - *libminor_return = 'a' + (num % 10000) % 100 - 1; -} - -void -VersionInfo(void) -{ - int format, libmajor; - char libminor; - - GetNumbers(XpmIncludeVersion, &format, &libmajor, &libminor); - /* L10N_Comments : sxpm -version output */ - fprintf(stderr, gettext("sxpm version: %d.%d%c\n"), - format, libmajor, libminor); - /* L10N_Comments : - * if we are linked to an XPM library different from the one we've been - * compiled with, print its own number too when sxpm -version is called. - */ - if (XpmIncludeVersion != XpmLibraryVersion()) { - GetNumbers(XpmLibraryVersion(), &format, &libmajor, &libminor); - fprintf(stderr, gettext("using the XPM library version: %d.%d%c\n"), - format, libmajor, libminor); - } -} +/*
+ * Copyright (C) 1989-95 GROUPE BULL
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * 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
+ * GROUPE BULL 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 GROUPE BULL shall not be
+ * used in advertising or otherwise to promote the sale, use or other dealings
+ * in this Software without prior written authorization from GROUPE BULL.
+ */
+
+/*****************************************************************************\
+* sxpm.c: *
+* *
+* Show XPM File program *
+* *
+* Developed by Arnaud Le Hors *
+\*****************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <X11/StringDefs.h>
+#include <X11/Intrinsic.h>
+#include <X11/IntrinsicP.h>
+#include <X11/Shell.h>
+
+#ifdef VMS
+#include <X11/shape.h>
+#else
+#include <X11/extensions/shape.h>
+#endif
+
+#include <X11/xpm.h>
+
+#ifdef USE_GETTEXT
+#include <locale.h>
+#include <libintl.h>
+#else
+#define gettext(a) (a)
+#endif
+
+/* XPM */
+/* plaid pixmap */
+static char *plaid[] = {
+ /* width height ncolors chars_per_pixel */
+ "22 22 4 2 XPMEXT",
+ /* colors */
+ " c red m white s light_color",
+ "Y c green m black s lines_in_mix",
+ "+ c yellow m white s lines_in_dark",
+ "x m black s dark_color",
+ /* pixels */
+ "x x x x x x x x x x x x + x x x x x ",
+ " x x x x x x x x x x x x x x x x ",
+ "x x x x x x x x x x x x + x x x x x ",
+ " x x x x x x x x x x x x x x x x ",
+ "x x x x x x x x x x x x + x x x x x ",
+ "Y Y Y Y Y x Y Y Y Y Y + x + x + x + x + x + ",
+ "x x x x x x x x x x x x + x x x x x ",
+ " x x x x x x x x x x x x x x x x ",
+ "x x x x x x x x x x x x + x x x x x ",
+ " x x x x x x x x x x x x x x x x ",
+ "x x x x x x x x x x x x + x x x x x ",
+ " x x x x Y x x x ",
+ " x x x Y x x ",
+ " x x x x Y x x x ",
+ " x x x Y x x ",
+ " x x x x Y x x x ",
+ "x x x x x x x x x x x x x x x x x x x x x x ",
+ " x x x x Y x x x ",
+ " x x x Y x x ",
+ " x x x x Y x x x ",
+ " x x x Y x x ",
+ " x x x x Y x x x ",
+ "bullshit",
+ "XPMEXT ext1 data1",
+ "XPMEXT ext2",
+ "data2_1",
+ "data2_2",
+ "XPMEXT",
+ "foo",
+ "",
+ "XPMEXT ext3",
+ "data3",
+ "XPMENDEXT"
+};
+
+#define win XtWindow(topw)
+#define dpy XtDisplay(topw)
+#define root XRootWindowOfScreen(XtScreen(topw))
+#define xrdb XtDatabase(dpy)
+static Colormap colormap;
+
+void Usage(void);
+void ErrorMessage(int ErrorStatus, char *tag);
+void Punt(int i);
+void VersionInfo(void);
+void kinput(Widget widget, char *tag, XEvent *xe, Boolean *b);
+void GetNumbers(int num, int *format_return,
+ int *libmajor_return,
+ char *libminor_return);
+
+#define IWIDTH 50
+#define IHEIGHT 50
+
+typedef struct _XpmIcon {
+ Pixmap pixmap;
+ Pixmap mask;
+ XpmAttributes attributes;
+} XpmIcon;
+
+static char **command;
+static Widget topw;
+static XpmIcon view, icon;
+static XrmOptionDescRec options[] = {
+ {"-hints", ".hints", XrmoptionNoArg, (XtPointer) "True"},
+ {"-icon", ".icon", XrmoptionSepArg, (XtPointer) NULL},
+};
+
+int
+main(
+ int argc,
+ char **argv)
+{
+ int ErrorStatus;
+ unsigned int verbose = 0; /* performs verbose output */
+ unsigned int stdinf = 1; /* read from stdin */
+ unsigned int stdoutf = 0; /* write to stdout */
+ unsigned int nod = 0; /* no display */
+ unsigned int nom = 0; /* no mask display */
+ unsigned int incResize = 0;
+ unsigned int resize = 0;
+ unsigned int w_rtn;
+ unsigned int h_rtn;
+ char *input = NULL;
+ char *output = NULL;
+ char *iconFile = NULL;
+ unsigned int numsymbols = 0;
+ XpmColorSymbol symbols[10];
+ char *stype;
+ XrmValue val;
+ unsigned long valuemask = 0;
+ int n;
+ Arg args[4];
+
+#ifdef Debug
+ char **data;
+ char *buffer;
+#endif
+
+#ifdef USE_GETTEXT
+ XtSetLanguageProc(NULL,NULL,NULL);
+ bindtextdomain("sxpm",LOCALEDIR);
+ textdomain("sxpm");
+#endif
+
+ topw = XtInitialize(argv[0], "Sxpm",
+ options, XtNumber(options), &argc, argv);
+
+ if (!topw) {
+ /* L10N_Comments : Error if no $DISPLAY or $DISPLAY can't be opened.
+ Not normally reached as Xt exits before we get here. */
+ fprintf(stderr, gettext("Sxpm Error... [ Undefined DISPLAY ]\n"));
+ exit(1);
+ }
+ colormap = XDefaultColormapOfScreen(XtScreen(topw));
+
+ /*
+ * geometry management
+ */
+
+ if (XrmGetResource(xrdb, NULL, "sxpm.geometry", &stype, &val)
+ || XrmGetResource(xrdb, NULL, "Sxpm.geometry", &stype, &val)) {
+
+ int flags;
+ int x_rtn;
+ int y_rtn;
+ char *geo = NULL;
+
+ geo = (char *) val.addr;
+ flags = XParseGeometry(geo, &x_rtn, &y_rtn,
+ (unsigned int *) &w_rtn,
+ (unsigned int *) &h_rtn);
+
+ if (!((WidthValue & flags) && (HeightValue & flags)))
+ resize = 1;
+
+ } else
+ resize = 1;
+
+ n = 0;
+ if (resize) {
+ w_rtn = 0;
+ h_rtn = 0;
+ XtSetArg(args[n], XtNwidth, 1);
+ n++;
+ XtSetArg(args[n], XtNheight, 1);
+ n++;
+ }
+ XtSetArg(args[n], XtNmappedWhenManaged, False);
+ n++;
+ XtSetArg(args[n], XtNinput, True);
+ n++;
+ XtSetValues(topw, args, n);
+
+ if ((XrmGetResource(xrdb, "sxpm.hints", "", &stype, &val)
+ || XrmGetResource(xrdb, "Sxpm.hints", "", &stype, &val))
+ && !strcmp((char *) val.addr, "True")) {
+ /* gotcha */
+ incResize = 1;
+ resize = 1;
+ }
+
+ /*
+ * icon management
+ */
+
+ if (XrmGetResource(xrdb, "sxpm.icon", "", &stype, &val)
+ || XrmGetResource(xrdb, "Sxpm.icon", "", &stype, &val)) {
+ iconFile = (char *) val.addr;
+ }
+ if (iconFile) {
+
+ XColor color, junk;
+ Pixel bpix;
+ Window iconW;
+
+ if (XAllocNamedColor(dpy, colormap, "black", &color, &junk))
+ bpix = color.pixel;
+ else
+ bpix = XBlackPixelOfScreen(XtScreen(topw));
+
+ iconW = XCreateSimpleWindow(dpy, root, 0, 0,
+ IWIDTH, IHEIGHT, 1, bpix, bpix);
+
+ icon.attributes.valuemask = XpmReturnAllocPixels;
+ ErrorStatus = XpmReadFileToPixmap(dpy, root, iconFile, &icon.pixmap,
+ &icon.mask, &icon.attributes);
+ ErrorMessage(ErrorStatus, "Icon");
+
+ XSetWindowBackgroundPixmap(dpy, iconW, icon.pixmap);
+
+ n = 0;
+ XtSetArg(args[n], XtNbackground, bpix);
+ n++;
+ XtSetArg(args[n], XtNiconWindow, iconW);
+ n++;
+ XtSetValues(topw, args, n);
+ }
+
+ /*
+ * arguments parsing
+ */
+
+ command = argv;
+ for (n = 1; n < argc; n++) {
+ if (strcmp(argv[n], "-plaid") == 0) {
+ stdinf = 0;
+ continue;
+ }
+ if (argv[n][0] != '-') {
+ stdinf = 0;
+ input = argv[n];
+ continue;
+ }
+ if ((strlen(argv[n]) == 1) && (argv[n][0] == '-'))
+ /* stdin */
+ continue;
+ if (strcmp(argv[n], "-o") == 0) {
+ if (n < argc - 1) {
+ if ((strlen(argv[n + 1]) == 1) && (argv[n + 1][0] == '-'))
+ stdoutf = 1;
+ else
+ output = argv[n + 1];
+ n++;
+ continue;
+ } else
+ Usage();
+ }
+ if (strcmp(argv[n], "-nod") == 0) {
+ nod = 1;
+ continue;
+ }
+ if (strcmp(argv[n], "-nom") == 0) {
+ nom = 1;
+ continue;
+ }
+ if (strcmp(argv[n], "-sc") == 0) {
+ if (n < argc - 2) {
+ valuemask |= XpmColorSymbols;
+ symbols[numsymbols].name = argv[++n];
+ symbols[numsymbols++].value = argv[++n];
+ continue;
+ } else
+ Usage();
+ }
+ if (strcmp(argv[n], "-sp") == 0) {
+ if (n < argc - 2) {
+ valuemask |= XpmColorSymbols;
+ symbols[numsymbols].name = argv[++n];
+ symbols[numsymbols].value = NULL;
+ symbols[numsymbols++].pixel = atol(argv[++n]);
+ continue;
+ }
+ }
+ if (strcmp(argv[n], "-cp") == 0) {
+ if (n < argc - 2) {
+ valuemask |= XpmColorSymbols;
+ symbols[numsymbols].name = NULL;
+ symbols[numsymbols].value = argv[++n];
+ symbols[numsymbols++].pixel = atol(argv[++n]);
+ continue;
+ }
+ }
+ if (strcmp(argv[n], "-mono") == 0) {
+ valuemask |= XpmColorKey;
+ view.attributes.color_key = XPM_MONO;
+ continue;
+ }
+ if (strcmp(argv[n], "-gray4") == 0 || strcmp(argv[n], "-grey4") == 0) {
+ valuemask |= XpmColorKey;
+ view.attributes.color_key = XPM_GRAY4;
+ continue;
+ }
+ if (strcmp(argv[n], "-gray") == 0 || strcmp(argv[n], "-grey") == 0) {
+ valuemask |= XpmColorKey;
+ view.attributes.color_key = XPM_GRAY;
+ continue;
+ }
+ if (strcmp(argv[n], "-color") == 0) {
+ valuemask |= XpmColorKey;
+ view.attributes.color_key = XPM_COLOR;
+ continue;
+ }
+ if (strncmp(argv[n], "-closecolors", 6) == 0) {
+ valuemask |= XpmCloseness;
+ view.attributes.closeness = 40000;
+ continue;
+ }
+ if (strcmp(argv[n], "-rgb") == 0) {
+ if (n < argc - 1) {
+ valuemask |= XpmRgbFilename;
+ view.attributes.rgb_fname = argv[++n];
+ continue;
+ } else
+ Usage();
+
+ }
+ if (strncmp(argv[n], "-version", 4) == 0) {
+ VersionInfo();
+ exit(0);
+ }
+ if (strcmp(argv[n], "-v") == 0) {
+ verbose = 1;
+ continue;
+ }
+ if (strcmp(argv[n], "-pcmap") == 0) {
+ valuemask |= XpmColormap;
+ continue;
+ }
+ Usage();
+ }
+
+ XtRealizeWidget(topw);
+ if (valuemask & XpmColormap) {
+ colormap = XCreateColormap(dpy, win,
+ DefaultVisual(dpy, DefaultScreen(dpy)),
+ AllocNone);
+ view.attributes.colormap = colormap;
+ XSetWindowColormap(dpy, win, colormap);
+ }
+ view.attributes.colorsymbols = symbols;
+ view.attributes.numsymbols = numsymbols;
+ view.attributes.valuemask = valuemask;
+
+#ifdef Debug
+ /* this is just to test the XpmCreateDataFromPixmap function */
+
+ view.attributes.valuemask |= XpmReturnAllocPixels;
+ view.attributes.valuemask |= XpmReturnExtensions;
+ ErrorStatus = XpmCreatePixmapFromData(dpy, win, plaid,
+ &view.pixmap, &view.mask,
+ &view.attributes);
+ ErrorMessage(ErrorStatus, "Plaid");
+
+ ErrorStatus = XpmCreateDataFromPixmap(dpy, &data, view.pixmap, view.mask,
+ &view.attributes);
+ ErrorMessage(ErrorStatus, "Data");
+ if (verbose && view.attributes.nextensions) {
+ unsigned int i, j;
+
+ for (i = 0; i < view.attributes.nextensions; i++) {
+ fprintf(stderr, "Xpm extension : %s\n",
+ view.attributes.extensions[i].name);
+ for (j = 0; j < view.attributes.extensions[i].nlines; j++)
+ fprintf(stderr, "\t\t%s\n",
+ view.attributes.extensions[i].lines[j]);
+ }
+ }
+ XFreePixmap(dpy, view.pixmap);
+ if (view.mask)
+ XFreePixmap(dpy, view.mask);
+
+ XFreeColors(dpy, colormap,
+ view.attributes.alloc_pixels,
+ view.attributes.nalloc_pixels, 0);
+
+ XpmFreeAttributes(&view.attributes);
+ view.attributes.valuemask = valuemask;
+#endif
+
+ if (input || stdinf) {
+ view.attributes.valuemask |= XpmReturnInfos;
+ view.attributes.valuemask |= XpmReturnAllocPixels;
+ view.attributes.valuemask |= XpmReturnExtensions;
+
+#ifdef Debug
+ XpmFree(data);
+
+ /*
+ * this is just to test the XpmCreatePixmapFromBuffer and
+ * XpmCreateBufferFromPixmap functions
+ */
+ ErrorStatus = XpmReadFileToBuffer(input, &buffer);
+ ErrorMessage(ErrorStatus, "CreateBufferFromFile");
+
+ ErrorStatus = XpmCreatePixmapFromBuffer(dpy, win, buffer,
+ &view.pixmap, &view.mask,
+ &view.attributes);
+ ErrorMessage(ErrorStatus, "CreatePixmapFromBuffer");
+ XpmFree(buffer);
+ ErrorStatus = XpmCreateBufferFromPixmap(dpy, &buffer,
+ view.pixmap, view.mask,
+ &view.attributes);
+ ErrorMessage(ErrorStatus, "CreateBufferFromPixmap");
+ ErrorStatus = XpmWriteFileFromBuffer("buffer_output", buffer);
+ ErrorMessage(ErrorStatus, "WriteFileFromBuffer");
+ XpmFree(buffer);
+ if (view.pixmap) {
+ XFreePixmap(dpy, view.pixmap);
+ if (view.mask)
+ XFreePixmap(dpy, view.mask);
+
+ XFreeColors(dpy, colormap, view.attributes.alloc_pixels,
+ view.attributes.nalloc_pixels, 0);
+
+ XpmFreeAttributes(&view.attributes);
+ }
+ ErrorStatus = XpmReadFileToData(input, &data);
+ ErrorMessage(ErrorStatus, "ReadFileToData");
+ ErrorStatus = XpmCreatePixmapFromData(dpy, win, data,
+ &view.pixmap, &view.mask,
+ &view.attributes);
+ ErrorMessage(ErrorStatus, "CreatePixmapFromData");
+ ErrorStatus = XpmWriteFileFromData("sxpmout.xpm", data);
+ ErrorMessage(ErrorStatus, "WriteFileFromData");
+ XpmFree(data);
+ XpmFreeAttributes(&view.attributes);
+#endif
+ ErrorStatus = XpmReadFileToPixmap(dpy, win, input,
+ &view.pixmap, &view.mask,
+ &view.attributes);
+ ErrorMessage(ErrorStatus, "Read");
+ if (verbose && view.attributes.nextensions) {
+ unsigned int i, j;
+
+ for (i = 0; i < view.attributes.nextensions; i++) {
+ /* L10N_Comments : Output when -v & file has extensions
+ %s is replaced by extension name */
+ fprintf(stderr, gettext("Xpm extension : %s\n"),
+ view.attributes.extensions[i].name);
+ for (j = 0; j < view.attributes.extensions[i].nlines; j++)
+ fprintf(stderr, "\t\t%s\n",
+ view.attributes.extensions[i].lines[j]);
+ }
+ }
+ } else {
+#ifdef Debug
+ ErrorStatus = XpmCreatePixmapFromData(dpy, win, data,
+ &view.pixmap, &view.mask,
+ &view.attributes);
+ XpmFree(data);
+#else
+ ErrorStatus = XpmCreatePixmapFromData(dpy, win, plaid,
+ &view.pixmap, &view.mask,
+ &view.attributes);
+#endif
+ ErrorMessage(ErrorStatus, "Plaid");
+ }
+ if (output || stdoutf) {
+ ErrorStatus = XpmWriteFileFromPixmap(dpy, output, view.pixmap,
+ view.mask, &view.attributes);
+ ErrorMessage(ErrorStatus, "Write");
+ }
+ if (!nod) {
+
+ /*
+ * manage display if requested
+ */
+
+ XSizeHints size_hints;
+ char *xString = NULL;
+
+ if (w_rtn && h_rtn
+ && ((w_rtn < view.attributes.width)
+ || h_rtn < view.attributes.height)) {
+ resize = 1;
+ }
+ if (resize) {
+ XtResizeWidget(topw,
+ view.attributes.width, view.attributes.height, 1);
+ }
+ if (incResize) {
+ size_hints.flags = USSize | PMinSize | PResizeInc;
+ size_hints.height = view.attributes.height;
+ size_hints.width = view.attributes.width;
+ size_hints.height_inc = view.attributes.height;
+ size_hints.width_inc = view.attributes.width;
+ } else
+ size_hints.flags = PMinSize;
+
+ size_hints.min_height = view.attributes.height;
+ size_hints.min_width = view.attributes.width;
+ XSetWMNormalHints(dpy, win, &size_hints);
+
+ if (input) {
+ xString = (char *) XtMalloc((sizeof(char) * strlen(input)) + 20);
+ sprintf(xString, "Sxpm: %s", input);
+ XStoreName(dpy, win, xString);
+ XSetIconName(dpy, win, xString);
+ } else if (stdinf) {
+ XStoreName(dpy, win, "Sxpm: stdin");
+ XSetIconName(dpy, win, "Sxpm: stdin");
+ } else {
+ XStoreName(dpy, win, "Sxpm");
+ XSetIconName(dpy, win, "Sxpm");
+ }
+
+ XtAddEventHandler(topw, KeyPressMask, False,
+ (XtEventHandler) kinput, NULL);
+ XSetWindowBackgroundPixmap(dpy, win, view.pixmap);
+
+ if (view.mask && !nom)
+ XShapeCombineMask(dpy, win, ShapeBounding, 0, 0,
+ view.mask, ShapeSet);
+
+ XClearWindow(dpy, win);
+ XtMapWidget(topw);
+ if (xString)
+ XtFree(xString);
+ XtMainLoop();
+ }
+ Punt(0);
+
+ /* Muffle gcc */
+ return 0;
+}
+
+void
+Usage(void)
+{
+ /* L10N_Comments : Usage message (sxpm -h) in two parts.
+ In the first part %s is replaced by the command name. */
+ fprintf(stderr, gettext("\nUsage: %s [options...]\n"), command[0]);
+ fprintf(stderr, gettext("Where options are:\n\
+\n\
+[-d host:display] Display to connect to.\n\
+[-g geom] Geometry of window.\n\
+[-hints] Set ResizeInc for window.\n\
+[-icon filename] Set pixmap for iconWindow.\n\
+[-plaid] Read the included plaid pixmap.\n\
+[filename] Read from file 'filename', and from standard\n\
+ input if 'filename' is '-'.\n\
+[-o filename] Write to file 'filename', and to standard\n\
+ output if 'filename' is '-'.\n\
+[-pcmap] Use a private colormap.\n\
+[-closecolors] Try to use `close' colors.\n\
+[-nod] Don't display in window.\n\
+[-nom] Don't use clip mask if any.\n\
+[-mono] Use the colors specified for a monochrome visual.\n\
+[-grey4] Use the colors specified for a 4 greyscale visual.\n\
+[-grey] Use the colors specified for a greyscale visual.\n\
+[-color] Use the colors specified for a color visual.\n\
+[-sc symbol color] Override color defaults.\n\
+[-sp symbol pixel] Override color defaults.\n\
+[-cp color pixel] Override color defaults.\n\
+[-rgb filename] Search color names in the rgb text file 'filename'.\n\
+[-v] Verbose - print out extensions.\n\
+[-version] Print out program's version number\n\
+ and library's version number if different.\n\
+if no input is specified sxpm reads from standard input.\n\
+\n"));
+ exit(0);
+}
+
+
+void
+ErrorMessage(
+ int ErrorStatus,
+ char *tag)
+{
+ char *error = NULL;
+ char *warning = NULL;
+
+ switch (ErrorStatus) {
+ case XpmSuccess:
+ return;
+ case XpmColorError:
+/* L10N_Comments : The following set of messages are classified as
+ either errors or warnings. Based on the class of message, different
+ wrappers are selected at the end to state the message source & class.
+
+ L10N_Comments : WARNING produced when filename can be read, but
+ contains an invalid color specification (need to create test case)*/
+ warning = gettext("Could not parse or alloc requested color");
+ break;
+ case XpmOpenFailed:
+ /* L10N_Comments : ERROR produced when filename does not exist
+ or insufficient permissions to open (i.e. sxpm /no/such/file ) */
+ error = gettext("Cannot open file");
+ break;
+ case XpmFileInvalid:
+ /* L10N_Comments : ERROR produced when filename can be read, but
+ is not an XPM file (i.e. sxpm /dev/null ) */
+ error = gettext("Invalid XPM file");
+ break;
+ case XpmNoMemory:
+ /* L10N_Comments : ERROR produced when filename can be read, but
+ is too big for memory
+ (i.e. limit datasize 32 ; sxpm /usr/dt/backdrops/Crochet.pm ) */
+ error = gettext("Not enough memory");
+ break;
+ case XpmColorFailed:
+ /* L10N_Comments : ERROR produced when filename can be read, but
+ contains an invalid color specification (need to create test case)*/
+ error = gettext("Failed to parse or alloc some color");
+ break;
+ }
+
+ if (warning)
+ /* L10N_Comments : Wrapper around above WARNING messages.
+ First %s is the tag for the operation that produced the warning.
+ Second %s is the message selected from the above set. */
+ fprintf(stderr, gettext("%s Xpm Warning: %s.\n"), tag, warning);
+
+ if (error) {
+ /* L10N_Comments : Wrapper around above ERROR messages.
+ First %s is the tag for the operation that produced the error.
+ Second %s is the message selected from the above set */
+ fprintf(stderr, gettext("%s Xpm Error: %s.\n"), tag, error);
+ Punt(1);
+ }
+}
+
+void
+Punt(int i)
+{
+ if (icon.pixmap) {
+ XFreePixmap(dpy, icon.pixmap);
+ if (icon.mask)
+ XFreePixmap(dpy, icon.mask);
+
+ XFreeColors(dpy, colormap,
+ icon.attributes.alloc_pixels,
+ icon.attributes.nalloc_pixels, 0);
+
+ XpmFreeAttributes(&icon.attributes);
+ }
+ if (view.pixmap) {
+ XFreePixmap(dpy, view.pixmap);
+ if (view.mask)
+ XFreePixmap(dpy, view.mask);
+
+ XFreeColors(dpy, colormap,
+ view.attributes.alloc_pixels,
+ view.attributes.nalloc_pixels, 0);
+
+ XpmFreeAttributes(&view.attributes);
+ }
+ exit(i);
+}
+
+void
+kinput(
+ Widget widget,
+ char *tag,
+ XEvent *xe,
+ Boolean *b)
+{
+ char c = '\0';
+
+ XLookupString(&(xe->xkey), &c, 1, NULL, NULL);
+ if (c == 'q' || c == 'Q')
+ Punt(0);
+}
+
+/*
+ * small function to extract various version numbers from the given global
+ * number (following the rule described in xpm.h).
+ */
+void
+GetNumbers(
+ int num,
+ int *format_return,
+ int *libmajor_return,
+ char *libminor_return)
+{
+ *format_return = num / 10000;
+ *libmajor_return = (num % 10000) / 100;
+ *libminor_return = 'a' + (num % 10000) % 100 - 1;
+}
+
+void
+VersionInfo(void)
+{
+ int format, libmajor;
+ char libminor;
+
+ GetNumbers(XpmIncludeVersion, &format, &libmajor, &libminor);
+ /* L10N_Comments : sxpm -version output */
+ fprintf(stderr, gettext("sxpm version: %d.%d%c\n"),
+ format, libmajor, libminor);
+ /* L10N_Comments :
+ * if we are linked to an XPM library different from the one we've been
+ * compiled with, print its own number too when sxpm -version is called.
+ */
+ if (XpmIncludeVersion != XpmLibraryVersion()) {
+ GetNumbers(XpmLibraryVersion(), &format, &libmajor, &libminor);
+ fprintf(stderr, gettext("using the XPM library version: %d.%d%c\n"),
+ format, libmajor, libminor);
+ }
+}
diff --git a/libXpm/sxpm/sxpm.man b/libXpm/sxpm/sxpm.man index 9d727fa32..0f539e772 100644 --- a/libXpm/sxpm/sxpm.man +++ b/libXpm/sxpm/sxpm.man @@ -1,132 +1,131 @@ -.\"Copyright (C) 1989-95 GROUPE BULL -.\" -.\"Permission is hereby granted, free of charge, to any person obtaining a copy -.\"of this software and associated documentation files (the "Software"), to -.\"deal in the Software without restriction, including without limitation the -.\"rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -.\"sell copies of the Software, and to permit persons to whom the Software is -.\"furnished to do so, subject to the following conditions: -.\" -.\"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 -.\"GROUPE BULL 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 GROUPE BULL shall not be -.\"used in advertising or otherwise to promote the sale, use or other dealings -.\"in this Software without prior written authorization from GROUPE BULL. -.\" -.\" $XFree86$ -.nr )S 12 -.TH SXPM 1 -.PD -.ad b -.SH NAME -sxpm \- Show an XPM (X PixMap) file and/or convert XPM 1 or 2 files to XPM 3. -.SH SYNOPSIS -\fBsxpm\fR -[\|\fB-d\fR displayname\|] -[\|\fB-g\fR geometry\|] -[\|\fB-hints\fR\|] -[\|\fB-icon\fR filename\|] -[\|\fB-plaid\| | \|\fRfilename\| | \|-\|] -[\|\fB-o\fR filename\| | \|\fB-o\fR -\|] -[\|\fB-pcmap\fR\|] -[\|\fB-closecolors\fR\|] -[\|\fB-nod\fR\|] -[\|\fB-nom\fR\|] -[\|\fB-mono | -grey4 | -grey | -color\fR\|] -[\|\fB-sc\fR symbol color\|] -[\|\fB-sp\fR symbol pixel\|] -[\|\fB-cp\fR color pixel\|] -[\|\fB-rgb\fR filename\|] -[\|\fB-v\fR\|] -.SH DESCRIPTION -.PP -The \fIsxpm\fP program can be used to view any XPM (version 1, 2, or 3) file -and/or to convert a file from XPM1 or XPM2 to XPM version 3. If \fIsxpm\fP is -run with any dummy option specified, the usage is displayed. If no geometry is -specified, the show window will have the size of the read pixmap. Pressing the -key Q in the window will quit the program. -.SH OPTIONS -.TP 8 -.B \-d \fIdisplay\fP -Specifies the display to connect to. -.TP 8 -.B \-g \fIgeom\fP -Window geometry (default is pixmap's size). -.TP 8 -.B \-hints -Set ResizeInc for window. -.TP 8 -.B \-icon \fIfilename\fP -Set icon to pixmap created from the file \fIfilename\fP. -.TP 8 -.B \-plaid -Show the plaid pixmap which is stored as data\fP. -.TP 8 -.B \fIfilename\fP -Read from the file \fIfilename\fP and from standard input if \fIfilename\fP is '-'. -If no input is specified sxpm reads from standard input. -.TP 8 -.B \-o \fIfilename\fP -Write to the file \fIfilename\fP (overwrite if it already exists) and to -standard output if \fIfilename\fP is '-'. -.TP 8 -.B \-mono -Use the colors specified for a monochrome visual. -.TP 8 -.B \-grey4 -Use the colors specified for a 4 color greyscale visual. -.TP 8 -.B \-grey -Use the colors specified for a greyscale visual. -.TP 8 -.B \-color -Use the colors specified for a color visual. -.TP 8 -.B \-pcmap -Use a private colormap. -.TP 8 -.B \-closecolors -Try to use "close colors" before reverting to other visuals. -.TP 8 -.B \-nod -Do not display the pixmap in a window. (Useful when using as converter) -.TP 8 -.B \-nom -Do not use the clipmask if there is any. -.TP 8 -.B \-sc \fIsymbol colorname\fP -Override default color to \fIsymbol\fP to \fIcolorname\fP. -.TP 8 -.B \-sp \fIsymbol pixelvalue\fP -Override default color to \fIsymbol\fP to \fIpixelvalue\fP. -.TP 8 -.B \-cp \fIcolorname pixelvalue\fP -Override default color to \fIcolorname\fP to \fIpixelvalue\fP. -.TP 8 -.B \-rgb \fIfilename\fP -Search color names in the file \fIfilename\fP and write them out instead of -the rgb values. -.TP 8 -.B \-v -Verbose - to print out extensions (stderr). - - -.SH KNOWN BUGS -Some window managers may not accept a pixmap which is not a bitmap as icon -because this does not respect ICCCM, many of the well known ones will accept -it though. - -.SH AUTHOR -Arnaud Le Hors (lehors@sophia.inria.fr) -.br -Bull Research France -.br -Copyright (C) 1989-95 by Groupe Bull. +.\"Copyright (C) 1989-95 GROUPE BULL
+.\"
+.\"Permission is hereby granted, free of charge, to any person obtaining a copy
+.\"of this software and associated documentation files (the "Software"), to
+.\"deal in the Software without restriction, including without limitation the
+.\"rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+.\"sell copies of the Software, and to permit persons to whom the Software is
+.\"furnished to do so, subject to the following conditions:
+.\"
+.\"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
+.\"GROUPE BULL 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 GROUPE BULL shall not be
+.\"used in advertising or otherwise to promote the sale, use or other dealings
+.\"in this Software without prior written authorization from GROUPE BULL.
+.\"
+.nr )S 12
+.TH SXPM 1
+.PD
+.ad b
+.SH NAME
+sxpm \- Show an XPM (X PixMap) file and/or convert XPM 1 or 2 files to XPM 3.
+.SH SYNOPSIS
+\fBsxpm\fR
+[\|\fB-d\fR displayname\|]
+[\|\fB-g\fR geometry\|]
+[\|\fB-hints\fR\|]
+[\|\fB-icon\fR filename\|]
+[\|\fB-plaid\| | \|\fRfilename\| | \|-\|]
+[\|\fB-o\fR filename\| | \|\fB-o\fR -\|]
+[\|\fB-pcmap\fR\|]
+[\|\fB-closecolors\fR\|]
+[\|\fB-nod\fR\|]
+[\|\fB-nom\fR\|]
+[\|\fB-mono | -grey4 | -grey | -color\fR\|]
+[\|\fB-sc\fR symbol color\|]
+[\|\fB-sp\fR symbol pixel\|]
+[\|\fB-cp\fR color pixel\|]
+[\|\fB-rgb\fR filename\|]
+[\|\fB-v\fR\|]
+.SH DESCRIPTION
+.PP
+The \fIsxpm\fP program can be used to view any XPM (version 1, 2, or 3) file
+and/or to convert a file from XPM1 or XPM2 to XPM version 3. If \fIsxpm\fP is
+run with any dummy option specified, the usage is displayed. If no geometry is
+specified, the show window will have the size of the read pixmap. Pressing the
+key Q in the window will quit the program.
+.SH OPTIONS
+.TP 8
+.B \-d \fIdisplay\fP
+Specifies the display to connect to.
+.TP 8
+.B \-g \fIgeom\fP
+Window geometry (default is pixmap's size).
+.TP 8
+.B \-hints
+Set ResizeInc for window.
+.TP 8
+.B \-icon \fIfilename\fP
+Set icon to pixmap created from the file \fIfilename\fP.
+.TP 8
+.B \-plaid
+Show the plaid pixmap which is stored as data\fP.
+.TP 8
+.B \fIfilename\fP
+Read from the file \fIfilename\fP and from standard input if \fIfilename\fP is '-'.
+If no input is specified sxpm reads from standard input.
+.TP 8
+.B \-o \fIfilename\fP
+Write to the file \fIfilename\fP (overwrite if it already exists) and to
+standard output if \fIfilename\fP is '-'.
+.TP 8
+.B \-mono
+Use the colors specified for a monochrome visual.
+.TP 8
+.B \-grey4
+Use the colors specified for a 4 color greyscale visual.
+.TP 8
+.B \-grey
+Use the colors specified for a greyscale visual.
+.TP 8
+.B \-color
+Use the colors specified for a color visual.
+.TP 8
+.B \-pcmap
+Use a private colormap.
+.TP 8
+.B \-closecolors
+Try to use "close colors" before reverting to other visuals.
+.TP 8
+.B \-nod
+Do not display the pixmap in a window. (Useful when using as converter)
+.TP 8
+.B \-nom
+Do not use the clipmask if there is any.
+.TP 8
+.B \-sc \fIsymbol colorname\fP
+Override default color to \fIsymbol\fP to \fIcolorname\fP.
+.TP 8
+.B \-sp \fIsymbol pixelvalue\fP
+Override default color to \fIsymbol\fP to \fIpixelvalue\fP.
+.TP 8
+.B \-cp \fIcolorname pixelvalue\fP
+Override default color to \fIcolorname\fP to \fIpixelvalue\fP.
+.TP 8
+.B \-rgb \fIfilename\fP
+Search color names in the file \fIfilename\fP and write them out instead of
+the rgb values.
+.TP 8
+.B \-v
+Verbose - to print out extensions (stderr).
+
+
+.SH KNOWN BUGS
+Some window managers may not accept a pixmap which is not a bitmap as icon
+because this does not respect ICCCM, many of the well known ones will accept
+it though.
+
+.SH AUTHOR
+Arnaud Le Hors (lehors@sophia.inria.fr)
+.br
+Bull Research France
+.br
+Copyright (C) 1989-95 by Groupe Bull.
|