This manual documents the API used by C and C++ programmers who want to write extension modules that use pycairo.
Example showing how to import the pycairo API:
#include "py3cairo.h"
PyMODINIT_FUNC
PyInit_client(void)
{
PyObject *m;
m = PyModule_Create(&clientmodule);
if (m == NULL)
return NULL;
if (import_cairo() < 0)
return NULL;
/* additional initialization can happen here */
return m;
}
Objects:
PycairoContext
PycairoFontFace
PycairoToyFontFace
PycairoFontOptions
PycairoMatrix
PycairoPath
PycairoPattern
PycairoSolidPattern
PycairoSurfacePattern
PycairoGradient
PycairoLinearGradient
PycairoRadialGradient
PycairoScaledFont
PycairoSurface
PycairoImageSurface
PycairoPDFSurface
PycairoPSSurface
PycairoSVGSurface
PycairoWin32Surface
PycairoXCBSurface
PycairoXlibSurface
Types:
PyTypeObject *Context_Type;
PyTypeObject *FontFace_Type;
PyTypeObject *ToyFontFace_Type;
PyTypeObject *FontOptions_Type;
PyTypeObject *Matrix_Type;
PyTypeObject *Path_Type;
PyTypeObject *Pattern_Type;
PyTypeObject *SolidPattern_Type;
PyTypeObject *SurfacePattern_Type;
PyTypeObject *Gradient_Type;
PyTypeObject *LinearGradient_Type;
PyTypeObject *RadialGradient_Type;
PyTypeObject *ScaledFont_Type;
PyTypeObject *Surface_Type;
PyTypeObject *ImageSurface_Type;
PyTypeObject *PDFSurface_Type;
PyTypeObject *PSSurface_Type;
PyTypeObject *SVGSurface_Type;
PyTypeObject *Win32Surface_Type;
PyTypeObject *XCBSurface_Type;
PyTypeObject *XlibSurface_Type;
get the C cairo_t * object out of the PycairoContext *obj