summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.in8
-rw-r--r--configure.ac16
-rw-r--r--gpdl/gpdl.mak15
-rw-r--r--pcl/pl/plimpl.c7
-rw-r--r--pcl/pl/plmain.c53
-rw-r--r--pcl/pl/plmain.h6
-rw-r--r--psi/msvc.mak22
-rw-r--r--windows/ghostpdl.vcxproj1
-rw-r--r--windows/ghostpdl.vcxproj.filters3
-rw-r--r--xps/xpstop.c6
10 files changed, 118 insertions, 19 deletions
diff --git a/Makefile.in b/Makefile.in
index cc1a13b32..adfc8bbf9 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -67,6 +67,10 @@ URFSRCDIR=@srcdir@/urf
URFGENDIR=./$(BUILDDIRPREFIX)@OBJDIR_BSDMAKE_WORKAROUND@
URFOBJDIR=./$(BUILDDIRPREFIX)@OBJDIR_BSDMAKE_WORKAROUND@
+SOSRCDIR=@srcdir@/so
+SOGENDIR=./$(BUILDDIRPREFIX)@OBJDIR_BSDMAKE_WORKAROUND@
+SOOBJDIR=./$(BUILDDIRPREFIX)@OBJDIR_BSDMAKE_WORKAROUND@
+
CONTRIBDIR=@srcdir@/contrib
# Do not edit the next group of lines.
@@ -348,6 +352,10 @@ URF_INCLUDE=@URF_INCLUDE@
URF_DEV=@URF_DEV@
SURFX_H=@SURFX_H@
+# Do we have SmartOffice support?
+ENABLE_SO=@ENABLESO@
+GPDL_SO_TOP_OBJ=@GPDL_SO_TOP_OBJ@
+
EXPATSRCDIR=@EXPATDIR@
EXPAT_CFLAGS=@EXPAT_CFLAGS@ @XML_HIDDEN_CFLAGS@
EXPATGENDIR=$(GLGENDIR)
diff --git a/configure.ac b/configure.ac
index bb578250c..33ae7515b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2178,6 +2178,22 @@ AC_SUBST(URF_INCLUDE)
AC_SUBST(URF_DEV)
AC_SUBST(SURFX_H)
+ENABLESO=
+AC_ARG_WITH([so], AS_HELP_STRING([--without-smartoffice],
+ [do not try to include SmartOffice support]))
+
+if test x$with_so != xno; then
+ AC_MSG_CHECKING([for SmartOffice support])
+ if test -d $srcdir/so; then
+ AC_MSG_RESULT([yes])
+ ENABLESO="\$(D_)SO_INCLUDED\$(_D)"
+ GPDL_SO_TOP_OBJ="\$(GPDLOBJ)/\$(GPDL_SO_TOP_OBJ_FILE)"
+fi
+fi
+
+AC_SUBST(ENABLESO)
+AC_SUBST(GPDL_SO_TOP_OBJ)
+
AC_ARG_WITH([cal], AS_HELP_STRING([--without-cal],
[do not try to use the CAL library for acceleration]))
diff --git a/gpdl/gpdl.mak b/gpdl/gpdl.mak
index 0fdebfd60..899716e36 100644
--- a/gpdl/gpdl.mak
+++ b/gpdl/gpdl.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2021 Artifex Software, Inc.
+# Copyright (C) 2001-2022 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
@@ -18,6 +18,7 @@ GPDL_MAK=$(GPDLSRCDIR)$(D)gpdl.mak
GPDLSRC=$(GPDLSRCDIR)$(D)
GPDLPSISRC=$(GPDLSRCDIR)$(D)psi$(D)
GPDLURFSRC=$(URFSRCDIR)$(D)
+GPDLSOSRC=$(SOSRCDIR)$(D)
GPDLOBJ=$(GPDLOBJDIR)$(D)
GPDLGEN=$(GPDLGENDIR)$(D)
@@ -29,6 +30,8 @@ GPDL_PSI_TOP_OBJ=$(GPDLOBJ)$(GPDL_PSI_TOP_OBJ_FILE)
GPDL_URF_TOP_OBJ_FILE=urftop.$(OBJ)
+GPDL_SO_TOP_OBJ_FILE=sotop.$(OBJ)
+
GPDL_JPG_TOP_OBJ_FILE=jpgtop.$(OBJ)
GPDL_JPG_TOP_OBJ=$(GPDLOBJ)$(GPDL_JPG_TOP_OBJ_FILE)
@@ -56,6 +59,7 @@ GPDL_PSI_TOP_OBJS=\
$(GPDL_JPG_TOP_OBJ)\
$(GPDL_URF_TOP_OBJ)\
$(GPDL_PSI_TOP_OBJ)\
+ $(GPDL_SO_TOP_OBJ)\
$(GPDLOBJ)gpdlimpl.$(OBJ)
LANG_CFLAGS=\
@@ -70,6 +74,7 @@ LANG_CFLAGS=\
$(D_)JBIG2_INCLUDED$(_D)\
$(D_)JP2K_INCLUDED$(_D)\
$(D_)PNG_INCLUDED$(_D)\
+ $(ENABLE_SO)\
GPDLCC=$(CC_) $(LANG_CFLAGS) $(I_)$(PSSRCDIR)$(_I) $(I_)$(PLSRCDIR)$(_I) $(I_)$(GLSRCDIR)$(_I) $(I_)$(DEVSRCDIR)$(_I) $(I_)$(GLGENDIR)$(_I) $(C_)
@@ -103,6 +108,14 @@ $(GPDLOBJ)/$(GPDL_URF_TOP_OBJ_FILE): $(GPDLURFSRC)urftop.c $(AK)\
$(gscoord_h) $(pltop_h) $(gsicc_manage_h) $(gspaint_h) $(plmain_h)
$(GPDLCC) $(GPDLURFSRC)urftop.c $(GPDLO_)$(GPDL_URF_TOP_OBJ_FILE)
+# Note that we don't use $(GPDL_SO_TOP_OBJ) as the target of the
+# next make rule, as this expands to "" in builds that don't use
+# SO.
+$(GPDLOBJ)/$(GPDL_SO_TOP_OBJ_FILE): $(GPDLSOSRC)sotop.c $(AK)\
+ $(gxdevice_h) $(gserrors_h) $(gsstate_h) $(strimpl_h)\
+ $(gscoord_h) $(pltop_h) $(gsicc_manage_h) $(gspaint_h) $(plmain_h)
+ $(GPDLCC) $(GPDLSOSRC)sotop.c $(GPDLO_)$(GPDL_SO_TOP_OBJ_FILE)
+
$(GPDL_JPG_TOP_OBJ): $(GPDLSRC)jpgtop.c $(AK)\
$(gxdevice_h) $(gserrors_h) $(gsstate_h) $(strimpl_h) $(gscoord_h)\
$(jpeglib_h) $(setjmp__h) $(sjpeg_h) $(pltop_h) $(gsicc_manage_h)\
diff --git a/pcl/pl/plimpl.c b/pcl/pl/plimpl.c
index 4c88b06e9..80d7e1845 100644
--- a/pcl/pl/plimpl.c
+++ b/pcl/pl/plimpl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -51,6 +51,8 @@ extern pl_interp_implementation_t jp2k_implementation;
extern pl_interp_implementation_t png_implementation;
+extern pl_interp_implementation_t so_implementation;
+
/* Zero-terminated list of pointers to implementations */
pl_interp_implementation_t *pdl_implementations[] = {
&pjl_implementation,
@@ -88,6 +90,9 @@ pl_interp_implementation_t *pdl_implementations[] = {
#ifdef PNG_INCLUDED
&png_implementation,
#endif
+#ifdef SO_INCLUDED
+ &so_implementation,
+#endif
0
};
diff --git a/pcl/pl/plmain.c b/pcl/pl/plmain.c
index de221df4f..04f330909 100644
--- a/pcl/pl/plmain.c
+++ b/pcl/pl/plmain.c
@@ -2993,18 +2993,6 @@ pl_log_string(const gs_memory_t * mem, const char *str, int wait_for_key)
(void)fgetc(mem->gs_lib_ctx->core->fstdin);
}
-pl_interp_implementation_t *
-pl_main_get_pcl_instance(const gs_memory_t *mem)
-{
- return pl_main_get_instance(mem)->implementations[1];
-}
-
-pl_interp_implementation_t *
-pl_main_get_pjl_instance(const gs_memory_t *mem)
-{
- return pl_main_get_instance(mem)->implementations[0];
-}
-
bool pl_main_get_interpolate(const gs_memory_t *mem)
{
return pl_main_get_instance(mem)->interpolate;
@@ -3106,3 +3094,44 @@ pl_finish_page(pl_main_instance_t * pmi, gs_gstate * pgs, int num_copies, int fl
pl_print_usage(pmi, "render done :");
return 0;
}
+
+pl_interp_implementation_t *
+pl_main_get_language_instance(const gs_memory_t *mem, const char *name)
+{
+ pl_main_instance_t *minst = pl_main_get_instance(mem);
+ pl_interp_implementation_t **inst = minst->implementations;
+
+ while (*inst)
+ {
+ const pl_interp_characteristics_t *chars = (*inst)->proc_characteristics(*inst);
+
+ if (strcmp(chars->language, name) == 0)
+ return *inst;
+ inst++;
+ }
+
+ return NULL;
+}
+
+pl_interp_implementation_t *pl_main_get_pdf_instance(const gs_memory_t *mem)
+{
+ return pl_main_get_language_instance(mem, "PDF");
+}
+
+pl_interp_implementation_t *
+pl_main_get_pcl_instance(const gs_memory_t *mem)
+{
+ return pl_main_get_language_instance(mem, "PCLXL");
+}
+
+pl_interp_implementation_t *
+pl_main_get_pjl_instance(const gs_memory_t *mem)
+{
+ return pl_main_get_language_instance(mem, "PJL");
+}
+
+pl_interp_implementation_t *
+pl_main_get_xps_instance(const gs_memory_t *mem)
+{
+ return pl_main_get_language_instance(mem, "XPS");
+}
diff --git a/pcl/pl/plmain.h b/pcl/pl/plmain.h
index d1e8912af..883dfc6e9 100644
--- a/pcl/pl/plmain.h
+++ b/pcl/pl/plmain.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -121,4 +121,8 @@ char *pl_main_get_pcl_personality(const gs_memory_t *mem);
pl_interp_implementation_t *pl_main_get_pcl_instance(const gs_memory_t *mem);
pl_interp_implementation_t *pl_main_get_pjl_instance(const gs_memory_t *mem);
+pl_interp_implementation_t *pl_main_get_pdf_instance(const gs_memory_t *mem);
+pl_interp_implementation_t *pl_main_get_xps_instance(const gs_memory_t *mem);
+pl_interp_implementation_t *pl_main_get_language_instance(const gs_memory_t *mem, const char *name);
+
#endif /* plmain_INCLUDED */
diff --git a/psi/msvc.mak b/psi/msvc.mak
index c8fd659e8..f6f186f2b 100644
--- a/psi/msvc.mak
+++ b/psi/msvc.mak
@@ -689,6 +689,28 @@ WITH_CAL=0
!endif
!endif
+# Should we build using SO...
+SOSRCDIR=so
+!ifdef WITH_SO
+!if "$(WITH_SO)"!="0"
+WITH_SO=1
+!else
+WITH_SO=0
+!endif
+!else
+!if exist ("$(SOSRCDIR)")
+WITH_SO=1
+!else
+WITH_SO=0
+!endif
+!endif
+!if "$(WITH_SO)"=="1"
+ENABLE_SO=$(D_)SO_INCLUDED$(_D)
+GPDL_SO_TOP_OBJ=$(GPDLOBJ)/$(GPDL_SO_TOP_OBJ_FILE)
+SO_INCLUDE=$(I_)$(SOSRCDIR)$(_I)
+!endif
+
+
# We can't build cups libraries in a Metro friendly way,
# so if building for Metro, disable cups regardless of the
# request
diff --git a/windows/ghostpdl.vcxproj b/windows/ghostpdl.vcxproj
index 3ccf4d444..41f825adf 100644
--- a/windows/ghostpdl.vcxproj
+++ b/windows/ghostpdl.vcxproj
@@ -465,6 +465,7 @@
<ClCompile Include="..\gpdl\psitop.c" />
<ClCompile Include="..\gpdl\pwgtop.c" />
<ClCompile Include="..\gpdl\tifftop.c" />
+ <ClCompile Include="..\so\sotop.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
diff --git a/windows/ghostpdl.vcxproj.filters b/windows/ghostpdl.vcxproj.filters
index dc436d952..f385ada3d 100644
--- a/windows/ghostpdl.vcxproj.filters
+++ b/windows/ghostpdl.vcxproj.filters
@@ -27,5 +27,8 @@
<ClCompile Include="..\gpdl\tifftop.c">
<Filter>gpdl</Filter>
</ClCompile>
+ <ClCompile Include="..\so\sotop.c">
+ <Filter>gpdl</Filter>
+ </ClCompile>
</ItemGroup>
</Project> \ No newline at end of file
diff --git a/xps/xpstop.c b/xps/xpstop.c
index bd662bbc2..d09b80392 100644
--- a/xps/xpstop.c
+++ b/xps/xpstop.c
@@ -33,8 +33,6 @@
static int xps_install_halftone(xps_context_t *ctx, gx_device *pdevice);
-#define XPS_PARSER_MIN_INPUT_SIZE (8192 * 4)
-
/*
* The XPS interpeter is identical to pl_interp_t.
* The XPS interpreter instance is derived from pl_interp_implementation_t.
@@ -57,7 +55,7 @@ xps_detect_language(const char *s, int len)
if (len < 2)
return 0;
if (memcmp(s, "PK", 2) == 0)
- return 100;
+ return 80; /* Pretty sure, but not 100, so the SO one can override us. */
return 0;
}
@@ -94,7 +92,7 @@ xps_set_icc_user_params(pl_interp_implementation_t *impl, gs_gstate *pgs)
/* Do per-instance interpreter allocation/init. No device is set yet */
static int
xps_impl_allocate_interp_instance(pl_interp_implementation_t *impl,
- gs_memory_t *pmem)
+ gs_memory_t *pmem)
{
int code = 0;
xps_interp_instance_t *instance;