aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2013-07-10 17:07:40 +0200
committerJay Berkenbilt <ejb@ql.org>2013-07-10 17:30:13 +0200
commitcee2592ed1f1c8ac5ca3048c48ac082e47358a6b (patch)
tree8b11981c79058629f949fc81e5cf273195dfc46c /include
parentf31e526d67aa0399ae8d03ce5a7d5b325fce6f47 (diff)
downloadqpdf-cee2592ed1f1c8ac5ca3048c48ac082e47358a6b.tar.zst
Change API/ABI and withdraw 4.2.0
4.2.0 was binary incompatible in spite of there being no deletions or changes to any public methods. As such, we have to bump the ABI and are fixing some API breakage while we're at it. Previous 4.3.0 target is now 5.1.0.
Diffstat (limited to 'include')
-rw-r--r--include/qpdf/QPDF.hh107
1 files changed, 68 insertions, 39 deletions
diff --git a/include/qpdf/QPDF.hh b/include/qpdf/QPDF.hh
index b90dea3b..e30e467b 100644
--- a/include/qpdf/QPDF.hh
+++ b/include/qpdf/QPDF.hh
@@ -411,45 +411,6 @@ class QPDF
void optimize(std::map<int, int> const& object_stream_data,
bool allow_changes = true);
- // For QPDFWriter:
-
- // Get lists of all objects in order according to the part of a
- // linearized file that they belong to.
- QPDF_DLL
- void getLinearizedParts(
- std::map<int, int> const& object_stream_data,
- std::vector<QPDFObjectHandle>& part4,
- std::vector<QPDFObjectHandle>& part6,
- std::vector<QPDFObjectHandle>& part7,
- std::vector<QPDFObjectHandle>& part8,
- std::vector<QPDFObjectHandle>& part9);
-
- QPDF_DLL
- void generateHintStream(std::map<int, QPDFXRefEntry> const& xref,
- std::map<int, qpdf_offset_t> const& lengths,
- std::map<int, int> const& obj_renumber,
- PointerHolder<Buffer>& hint_stream,
- int& S, int& O);
-
- // Map object to object stream that contains it
- QPDF_DLL
- void getObjectStreamData(std::map<int, int>&);
-
- // Get a list of objects that would be permitted in an object
- // stream.
- QPDF_DLL
- std::vector<QPDFObjGen> getCompressibleObjGens();
-
- // Deprecated: get a list of objects that would be permitted in an
- // object stream. This method is deprecated and will be removed.
- // It's incorrect because it disregards the generations of the
- // compressible objects, which can lead (and has lead) to bugs.
- // This method will throw an exception if any of the objects
- // returned have a generation of other than zero. Use
- // getCompressibleObjGens() instead.
- QPDF_DLL
- std::vector<int> getCompressibleObjects();
-
// Convenience routines for common functions. See also
// QPDFObjectHandle.hh for additional convenience routines.
@@ -504,6 +465,49 @@ class QPDF
QPDF_DLL
void removePage(QPDFObjectHandle page);
+ // Writer class is restricted to QPDFWriter so that only it can
+ // call certain methods.
+ class Writer
+ {
+ friend class QPDFWriter;
+ private:
+
+ static void getLinearizedParts(
+ QPDF& qpdf,
+ std::map<int, int> const& object_stream_data,
+ std::vector<QPDFObjectHandle>& part4,
+ std::vector<QPDFObjectHandle>& part6,
+ std::vector<QPDFObjectHandle>& part7,
+ std::vector<QPDFObjectHandle>& part8,
+ std::vector<QPDFObjectHandle>& part9)
+ {
+ qpdf.getLinearizedParts(object_stream_data,
+ part4, part6, part7, part8, part9);
+ }
+
+ static void generateHintStream(
+ QPDF& qpdf,
+ std::map<int, QPDFXRefEntry> const& xref,
+ std::map<int, qpdf_offset_t> const& lengths,
+ std::map<int, int> const& obj_renumber,
+ PointerHolder<Buffer>& hint_stream,
+ int& S, int& O)
+ {
+ return qpdf.generateHintStream(xref, lengths, obj_renumber,
+ hint_stream, S, O);
+ }
+
+ static void getObjectStreamData(QPDF& qpdf, std::map<int, int>& omap)
+ {
+ qpdf.getObjectStreamData(omap);
+ }
+
+ static std::vector<QPDFObjGen> getCompressibleObjGens(QPDF& qpdf)
+ {
+ return qpdf.getCompressibleObjGens();
+ }
+ };
+
// Resolver class is restricted to QPDFObjectHandle so that only
// it can resolve indirect references.
class Resolver
@@ -635,6 +639,31 @@ class QPDF
QPDFObjectHandle dict,
Pipeline* pipeline);
+ // For QPDFWriter:
+
+ // Get lists of all objects in order according to the part of a
+ // linearized file that they belong to.
+ void getLinearizedParts(
+ std::map<int, int> const& object_stream_data,
+ std::vector<QPDFObjectHandle>& part4,
+ std::vector<QPDFObjectHandle>& part6,
+ std::vector<QPDFObjectHandle>& part7,
+ std::vector<QPDFObjectHandle>& part8,
+ std::vector<QPDFObjectHandle>& part9);
+
+ void generateHintStream(std::map<int, QPDFXRefEntry> const& xref,
+ std::map<int, qpdf_offset_t> const& lengths,
+ std::map<int, int> const& obj_renumber,
+ PointerHolder<Buffer>& hint_stream,
+ int& S, int& O);
+
+ // Map object to object stream that contains it
+ void getObjectStreamData(std::map<int, int>&);
+
+ // Get a list of objects that would be permitted in an object
+ // stream.
+ std::vector<QPDFObjGen> getCompressibleObjGens();
+
// methods to support page handling
void getAllPagesInternal(QPDFObjectHandle cur_pages,