~ubuntu-branches/ubuntu/quantal/cups-filters/quantal-proposed

« back to all changes in this revision

Viewing changes to filter/pdftopdf/P2POutputStream.h

  • Committer: Package Import Robot
  • Author(s): Till Kamppeter
  • Date: 2012-08-20 14:53:42 UTC
  • mfrom: (2.1.2 experimental)
  • Revision ID: package-import@ubuntu.com-20120820145342-bddzpwqv0klmt84d
Tags: 1.0.22-1
* New upstream release
   - pdftopdf filter replaced by new QPDF-based filter from Tobias
     Hoffmann's Google Summer of Code project. The former Poppler-based
     pdftopdf duplicated a lot of Poppler's code. The old filter is
     still in the package as pdftopdf.old with source code in
     filter/pdftopdf.old. It will be removed in a later release.
   - bannertopdf: Page duplication routine fixed.
   - bannertopdf: Fixed invalid output of a direct stream object.
   - Added most recent contributors to AUTHORS and COPYING files.
* debian/control: Added build dependency on libqpdf-dev.
* debian/copyright: Updated for the addition of the new pdftopdf filter.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 
3
 
Copyright (c) 2006-2007, BBR Inc.  All rights reserved.
4
 
 
5
 
Permission is hereby granted, free of charge, to any person obtaining
6
 
a copy of this software and associated documentation files (the
7
 
"Software"), to deal in the Software without restriction, including
8
 
without limitation the rights to use, copy, modify, merge, publish,
9
 
distribute, sublicense, and/or sell copies of the Software, and to
10
 
permit persons to whom the Software is furnished to do so, subject to
11
 
the following conditions:
12
 
 
13
 
The above copyright notice and this permission notice shall be included
14
 
in all copies or substantial portions of the Software.
15
 
 
16
 
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
 
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
 
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
 
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
 
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
 
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
 
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
 
 
24
 
*/
25
 
/*
26
 
 P2POutputStream.h
27
 
 pdftopdf stream for output
28
 
*/
29
 
#ifndef _P2POUTPUTSTREAM_H_
30
 
#define _P2POUTPUTSTREAM_H_
31
 
 
32
 
#include "goo/gtypes.h"
33
 
 
34
 
#include <config.h>
35
 
#ifndef HAVE_ZLIB_H
36
 
#undef HAVE_LIBZ
37
 
#endif
38
 
#include <stdio.h>
39
 
#ifdef HAVE_LIBZ
40
 
#include <zlib.h>
41
 
#endif
42
 
 
43
 
class P2POutputStream {
44
 
public:
45
 
  P2POutputStream(FILE *fpA);
46
 
  ~P2POutputStream();
47
 
  int write(const void *buf, int n);
48
 
  int printf(const char *format, ...);
49
 
  int putchar(char c);
50
 
  int puts(const char *str);
51
 
  int getPosition() { return position; }
52
 
  GBool canDeflate() {
53
 
#ifdef HAVE_LIBZ
54
 
    return gTrue;
55
 
#else
56
 
    return gFalse;
57
 
#endif
58
 
  }
59
 
  void startDeflate();
60
 
  void endDeflate();
61
 
private:
62
 
  FILE *fp;
63
 
  /* output position */
64
 
  int position;
65
 
#ifdef HAVE_LIBZ
66
 
  z_stream zstream;
67
 
  GBool deflating;
68
 
#endif
69
 
};
70
 
 
71
 
#endif