Skip to content

Commit

Permalink
Reduce the cairo_device_type_t to only hold the used entries.
Browse files Browse the repository at this point in the history
This should help clarify the documentation by not mentioning non-existent
devices and prevent any assumed coupling between surface-type values and
devices.
  • Loading branch information
Chris Wilson committed Sep 6, 2010
1 parent e3afbc1 commit 8258532
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 61 deletions.
49 changes: 8 additions & 41 deletions src/cairo.h
Original file line number Diff line number Diff line change
Expand Up @@ -1941,29 +1941,12 @@ cairo_device_reference (cairo_device_t *device);

/**
* cairo_device_type_t:
* @CAIRO_DEVICE_TYPE_IMAGE: The surface is of type image
* @CAIRO_DEVICE_TYPE_PDF: The surface is of type pdf
* @CAIRO_DEVICE_TYPE_PS: The surface is of type ps
* @CAIRO_DEVICE_TYPE_XLIB: The surface is of type xlib
* @CAIRO_DEVICE_TYPE_XCB: The surface is of type xcb
* @CAIRO_DEVICE_TYPE_GLITZ: The surface is of type glitz
* @CAIRO_DEVICE_TYPE_QUARTZ: The surface is of type quartz
* @CAIRO_DEVICE_TYPE_WIN32: The surface is of type win32
* @CAIRO_DEVICE_TYPE_BEOS: The surface is of type beos
* @CAIRO_DEVICE_TYPE_DIRECTFB: The surface is of type directfb
* @CAIRO_DEVICE_TYPE_SVG: The surface is of type svg
* @CAIRO_DEVICE_TYPE_OS2: The surface is of type os2
* @CAIRO_DEVICE_TYPE_WIN32_PRINTING: The surface is a win32 printing surface
* @CAIRO_DEVICE_TYPE_QUARTZ_IMAGE: The surface is of type quartz_image
* @CAIRO_DEVICE_TYPE_SCRIPT: The surface is of type script
* @CAIRO_DEVICE_TYPE_QT: The surface is of type Qt
* @CAIRO_DEVICE_TYPE_RECORDING: The surface is of type recording
* @CAIRO_DEVICE_TYPE_VG: The surface is a OpenVG surface
* @CAIRO_DEVICE_TYPE_GL: The surface is of type OpenGL
* @CAIRO_DEVICE_TYPE_DRM: The surface is of type Direct Render Manager
* @CAIRO_DEVICE_TYPE_GL: The surface is of type OpenGL
* @CAIRO_DEVICE_TYPE_SCRIPT: The surface is of type script
* @CAIRO_DEVICE_TYPE_XCB: The surface is of type xcb
* @CAIRO_DEVICE_TYPE_XLIB: The surface is of type xlib
* @CAIRO_DEVICE_TYPE_XML: The surface is of type XML
* @CAIRO_DEVICE_TYPE_SKIA: The surface is of type Skia
* @CAIRO_DEVICE_TYPE_SUBSURFACE: The surface is a subsurface created with
* cairo_surface_create_for_rectangle()
*
* #cairo_device_type_t is used to describe the type of a given
Expand All @@ -1985,28 +1968,12 @@ cairo_device_reference (cairo_device_t *device);
* Since: 1.10
**/
typedef enum _cairo_device_type {
CAIRO_DEVICE_TYPE_IMAGE,
CAIRO_DEVICE_TYPE_PDF,
CAIRO_DEVICE_TYPE_PS,
CAIRO_DEVICE_TYPE_XLIB,
CAIRO_DEVICE_TYPE_XCB,
CAIRO_DEVICE_TYPE_GLITZ,
CAIRO_DEVICE_TYPE_QUARTZ,
CAIRO_DEVICE_TYPE_WIN32,
CAIRO_DEVICE_TYPE_BEOS,
CAIRO_DEVICE_TYPE_DIRECTFB,
CAIRO_DEVICE_TYPE_SVG,
CAIRO_DEVICE_TYPE_OS2,
CAIRO_DEVICE_TYPE_WIN32_PRINTING,
CAIRO_DEVICE_TYPE_QUARTZ_IMAGE,
CAIRO_DEVICE_TYPE_SCRIPT,
CAIRO_DEVICE_TYPE_QT,
CAIRO_DEVICE_TYPE_RECORDING,
CAIRO_DEVICE_TYPE_VG,
CAIRO_DEVICE_TYPE_GL,
CAIRO_DEVICE_TYPE_DRM,
CAIRO_DEVICE_TYPE_GL,
CAIRO_DEVICE_TYPE_SCRIPT,
CAIRO_DEVICE_TYPE_XCB,
CAIRO_DEVICE_TYPE_XLIB,
CAIRO_DEVICE_TYPE_XML,
CAIRO_DEVICE_TYPE_SKIA
} cairo_device_type_t;

cairo_public cairo_device_type_t
Expand Down
24 changes: 4 additions & 20 deletions util/cairo-gobject/cairo-gobject-enums.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,28 +347,12 @@ cairo_gobject_device_type_get_type (void)
static volatile gsize type_volatile = 0;
if (g_once_init_enter (&type_volatile)) {
static const GEnumValue values[] = {
{ CAIRO_DEVICE_TYPE_IMAGE, "CAIRO_DEVICE_TYPE_IMAGE", "image" },
{ CAIRO_DEVICE_TYPE_PDF, "CAIRO_DEVICE_TYPE_PDF", "pdf" },
{ CAIRO_DEVICE_TYPE_PS, "CAIRO_DEVICE_TYPE_PS", "ps" },
{ CAIRO_DEVICE_TYPE_XLIB, "CAIRO_DEVICE_TYPE_XLIB", "xlib" },
{ CAIRO_DEVICE_TYPE_XCB, "CAIRO_DEVICE_TYPE_XCB", "xcb" },
{ CAIRO_DEVICE_TYPE_GLITZ, "CAIRO_DEVICE_TYPE_GLITZ", "glitz" },
{ CAIRO_DEVICE_TYPE_QUARTZ, "CAIRO_DEVICE_TYPE_QUARTZ", "quartz" },
{ CAIRO_DEVICE_TYPE_WIN32, "CAIRO_DEVICE_TYPE_WIN32", "win32" },
{ CAIRO_DEVICE_TYPE_BEOS, "CAIRO_DEVICE_TYPE_BEOS", "beos" },
{ CAIRO_DEVICE_TYPE_DIRECTFB, "CAIRO_DEVICE_TYPE_DIRECTFB", "directfb" },
{ CAIRO_DEVICE_TYPE_SVG, "CAIRO_DEVICE_TYPE_SVG", "svg" },
{ CAIRO_DEVICE_TYPE_OS2, "CAIRO_DEVICE_TYPE_OS2", "os2" },
{ CAIRO_DEVICE_TYPE_WIN32_PRINTING, "CAIRO_DEVICE_TYPE_WIN32_PRINTING", "win32-printing" },
{ CAIRO_DEVICE_TYPE_QUARTZ_IMAGE, "CAIRO_DEVICE_TYPE_QUARTZ_IMAGE", "quartz-image" },
{ CAIRO_DEVICE_TYPE_SCRIPT, "CAIRO_DEVICE_TYPE_SCRIPT", "script" },
{ CAIRO_DEVICE_TYPE_QT, "CAIRO_DEVICE_TYPE_QT", "qt" },
{ CAIRO_DEVICE_TYPE_RECORDING, "CAIRO_DEVICE_TYPE_RECORDING", "recording" },
{ CAIRO_DEVICE_TYPE_VG, "CAIRO_DEVICE_TYPE_VG", "vg" },
{ CAIRO_DEVICE_TYPE_GL, "CAIRO_DEVICE_TYPE_GL", "gl" },
{ CAIRO_DEVICE_TYPE_DRM, "CAIRO_DEVICE_TYPE_DRM", "drm" },
{ CAIRO_DEVICE_TYPE_GL, "CAIRO_DEVICE_TYPE_GL", "gl" },
{ CAIRO_DEVICE_TYPE_SCRIPT, "CAIRO_DEVICE_TYPE_SCRIPT", "script" },
{ CAIRO_DEVICE_TYPE_XCB, "CAIRO_DEVICE_TYPE_XCB", "xcb" },
{ CAIRO_DEVICE_TYPE_XLIB, "CAIRO_DEVICE_TYPE_XLIB", "xlib" },
{ CAIRO_DEVICE_TYPE_XML, "CAIRO_DEVICE_TYPE_XML", "xml" },
{ CAIRO_DEVICE_TYPE_SKIA, "CAIRO_DEVICE_TYPE_SKIA", "skia" },
{ 0, NULL, NULL }
};
GType type = g_enum_register_static (g_intern_static_string ("cairo_device_type_t"), values);
Expand Down

0 comments on commit 8258532

Please sign in to comment.