Qt 4.8
Classes | Namespaces | Macros | Enumerations | Functions
qpdf_p.h File Reference
#include "QtGui/qmatrix.h"
#include "QtCore/qstring.h"
#include "QtCore/qvector.h"
#include "private/qstroker_p.h"
#include "private/qfontengine_p.h"
#include "QtGui/qprinter.h"
#include "private/qfontsubset_p.h"
#include "private/qpaintengine_alpha_p.h"
#include "qprintengine.h"
#include "qbuffer.h"

Go to the source code of this file.

Classes

class  QPdf::ByteStream
 
struct  QPdf::PaperSize
 
struct  QPdf::Stroker
 
class  QPdfBaseEngine
 
class  QPdfBaseEnginePrivate
 
class  QPdfPage
 

Namespaces

 QPdf
 

Macros

#define PPK_CupsOptions   QPrintEngine::PrintEnginePropertyKey(0xfe00)
 
#define PPK_CupsPageRect   QPrintEngine::PrintEnginePropertyKey(0xfe01)
 
#define PPK_CupsPaperRect   QPrintEngine::PrintEnginePropertyKey(0xfe02)
 
#define PPK_CupsStringPageSize   QPrintEngine::PrintEnginePropertyKey(0xfe03)
 

Enumerations

enum  QPdf::PathFlags { QPdf::ClipPath, QPdf::FillPath, QPdf::StrokePath, QPdf::FillAndStrokePath }
 

Functions

QByteArray QPdf::ascii85Encode (const QByteArray &input)
 
QByteArray QPdf::generateDashes (const QPen &pen)
 
QByteArray QPdf::generateMatrix (const QTransform &matrix)
 
QByteArray QPdf::generatePath (const QPainterPath &path, const QTransform &matrix, PathFlags flags)
 
PaperSize QPdf::paperSize (QPrinter::PaperSize paperSize)
 
const char * QPdf::paperSizeToString (QPrinter::PaperSize paperSize)
 
QByteArray QPdf::patternForBrush (const QBrush &b)
 
const char * qt_int_to_string (int val, char *buf)
 
const char * qt_real_to_string (qreal val, char *buf)
 
const char * QPdf::toHex (ushort u, char *buffer)
 
const char * QPdf::toHex (uchar u, char *buffer)
 

Macro Definition Documentation

◆ PPK_CupsOptions

#define PPK_CupsOptions   QPrintEngine::PrintEnginePropertyKey(0xfe00)

◆ PPK_CupsPageRect

#define PPK_CupsPageRect   QPrintEngine::PrintEnginePropertyKey(0xfe01)

◆ PPK_CupsPaperRect

#define PPK_CupsPaperRect   QPrintEngine::PrintEnginePropertyKey(0xfe02)

◆ PPK_CupsStringPageSize

#define PPK_CupsStringPageSize   QPrintEngine::PrintEnginePropertyKey(0xfe03)

Function Documentation

◆ qt_int_to_string()

const char* qt_int_to_string ( int  val,
char *  buf 
)

Definition at line 115 of file qpdf.cpp.

Referenced by QPdf::ByteStream::operator<<().

115  {
116  const char *ret = buf;
117  if (val < 0) {
118  *(buf++) = '-';
119  val = -val;
120  }
121  char output[256];
122  int i = 0;
123  while (val) {
124  output[i] = '0' + (val % 10);
125  ++i;
126  val /= 10;
127  }
128  if (i == 0) {
129  *(buf++) = '0';
130  } else {
131  while (i)
132  *(buf++) = output[--i];
133  }
134  *(buf++) = ' ';
135  *buf = 0;
136  return ret;
137 }

◆ qt_real_to_string()

const char* qt_real_to_string ( qreal  val,
char *  buf 
)

Definition at line 63 of file qpdf.cpp.

Referenced by QPdf::ByteStream::operator<<().

63  {
64  const char *ret = buf;
65 
66  if (qIsNaN(val)) {
67  *(buf++) = '0';
68  *(buf++) = ' ';
69  *buf = 0;
70  return ret;
71  }
72 
73  if (val < 0) {
74  *(buf++) = '-';
75  val = -val;
76  }
77  unsigned int ival = (unsigned int) val;
78  qreal frac = val - (qreal)ival;
79 
80  int ifrac = (int)(frac * 1000000000);
81  if (ifrac == 1000000000) {
82  ++ival;
83  ifrac = 0;
84  }
85  char output[256];
86  int i = 0;
87  while (ival) {
88  output[i] = '0' + (ival % 10);
89  ++i;
90  ival /= 10;
91  }
92  int fact = 100000000;
93  if (i == 0) {
94  *(buf++) = '0';
95  } else {
96  while (i) {
97  *(buf++) = output[--i];
98  fact /= 10;
99  ifrac /= 10;
100  }
101  }
102 
103  if (ifrac) {
104  *(buf++) = '.';
105  while (fact) {
106  *(buf++) = '0' + ((ifrac/fact) % 10);
107  fact /= 10;
108  }
109  }
110  *(buf++) = ' ';
111  *buf = 0;
112  return ret;
113 }
double qreal
Definition: qglobal.h:1193
Q_CORE_EXPORT bool qIsNaN(double d)
Returns true if the double {d} is not a number (NaN).
Definition: qnumeric.cpp:55