Programming with Quartz: 2D and PDF Graphics in Mac OS X

The header files relevant to creating and drawing patterns are
CGPattern.h, which contains the definitions and prototypes needed for creating CGPattern objects.
CGColor.h, which contains the functions to create the pattern color space and CGColor objects from patterns.
CGContext.h, which contains the functions to set a pattern as the stroke or fill color and for setting the pattern phase.
The header files relevant to creating and drawing shadings are
CGFunction.h, which contains the definitions and prototypes needed for creating CGFunction objects.
CGShading.h, which contains the definitions and prototypes needed for creating CGShading objects.
CGContext.h, which contains the functions to draw a shading to a context.
The header file relevant to setting the context shadow parameter and for beginning and ending a transparency layer is
CGContext.h
The relevant reference information from the ADC Reference Library is
CGPattern Reference
CGColor Reference
CGContext Reference
CGFunction Reference
CGShading Reference