Pajdeg  0.2.2
Pajdeg
Data Structures | Macros | Typedefs
Core types

Internal type definitions. More...

Data Structures

struct  PDPoint
 
struct  PDRect
 

Macros

#define PDIntegerFromString   atol
 
#define PDRealFromString   atof
 
#define PDSizeFromString   atol
 
#define PDOffsetFromString   atoll
 
#define PDRectFromOSRect(osr)   (PDRect) {{osr.origin.x, osr.origin.y}, {osr.origin.x+osr.size.width, osr.origin.y+osr.size.height}}
 
#define PDRectToOSRect(rect)   {{rect.a.x, rect.a.y}, {rect.b.x-rect.a.x, rect.b.y-rect.a.y}}
 

Typedefs

typedef long PDInteger
 
typedef float PDReal
 
typedef unsigned char PDBool
 
typedef size_t PDSize
 
typedef long long PDOffset
 
typedef struct PDPoint PDPoint
 
typedef struct PDRect PDRect
 
typedef const char ** PDID
 

Detailed Description

Internal type definitions.

These have been matched up with the Core Graphics CGPDF* type definitions in most cases, except where this resulted in performance or other issues.


Data Structure Documentation

struct PDPoint

Data Fields

PDReal x
 
PDReal y
 
struct PDRect

Data Fields

PDPoint a
 
PDPoint b
 

Macro Definition Documentation

#define PDIntegerFromString   atol

C atoXX function matching PDInteger size

#define PDOffsetFromString   atoll

C atoXX function matching PDOffset

#define PDRealFromString   atof

C atoXX function matching PDReal

#define PDRectFromOSRect (   osr)    (PDRect) {{osr.origin.x, osr.origin.y}, {osr.origin.x+osr.size.width, osr.origin.y+osr.size.height}}

Convert from an origin-size rect (e.g. CGRect) to a tl-br rect (PDRect).

Parameters
osrThe rect structured as { {origin x, origin y}, {width, height} }.
Returns
PDRect version.
#define PDRectToOSRect (   rect)    {{rect.a.x, rect.a.y}, {rect.b.x-rect.a.x, rect.b.y-rect.a.y}}

Convert to an origin-size rect (e.g. CGRect) from a tl-br rect (PDRect).

Parameters
rectPDRect version.
Returns
The rect structured as { {origin x, origin y}, {width, height} }.
#define PDSizeFromString   atol

C atoXX function matching PDSize

Typedef Documentation

typedef unsigned char PDBool

PDF boolean identifier.

typedef const char** PDID

Convert an array string [a b c d] into a PDRect. Convert a PDRect into an [a b c d] array string. Identifier type.

The PDID type in Pajdeg has two purposes: it works like a container for generic data of unknown origin, and it is a numeric pointer to a string identifier.

Wherever used, the PDID implies that its content is "protected" and should never be modified, such as freed.

The pd_stack implementation adheres this convention in most cases, but some debug related functions, such as pd_stack_print, will assume that a PDID is of the latter type, and will attempt to print out the string pointed to in parentheses.

PDIDs are used extensively in the PDF specification implementation definitions located in pd_pdf_implementation.h

typedef long PDInteger

PDF integer type in Pajdeg.

typedef long long PDOffset

Offset type (signed).

typedef struct PDPoint PDPoint

A point with x and y coordinates.

typedef float PDReal

PDF real type in Pajdeg.

typedef struct PDRect PDRect

A rectangle made up of two PDPoint structures.

typedef size_t PDSize

Size type (unsigned).