michael@0: /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef GFX_TYPES_H michael@0: #define GFX_TYPES_H michael@0: michael@0: #include michael@0: #include "mozilla/TypedEnum.h" michael@0: michael@0: typedef struct _cairo_surface cairo_surface_t; michael@0: typedef struct _cairo_user_data_key cairo_user_data_key_t; michael@0: michael@0: typedef void (*thebes_destroy_func_t) (void *data); michael@0: michael@0: /** michael@0: * Currently needs to be 'double' for Cairo compatibility. Could michael@0: * become 'float', perhaps, in some configurations. michael@0: */ michael@0: typedef double gfxFloat; michael@0: michael@0: /** michael@0: * Priority of a line break opportunity. michael@0: * michael@0: * eNoBreak The line has no break opportunities michael@0: * eWordWrapBreak The line has a break opportunity only within a word. With michael@0: * word-wrap: break-word we will break at this point only if michael@0: * there are no other break opportunities in the line. michael@0: * eNormalBreak The line has a break opportunity determined by the standard michael@0: * line-breaking algorithm. michael@0: * michael@0: * Future expansion: split eNormalBreak into multiple priorities, e.g. michael@0: * punctuation break and whitespace break (bug 389710). michael@0: * As and when we implement it, text-wrap: unrestricted will michael@0: * mean that priorities are ignored and all line-break michael@0: * opportunities are equal. michael@0: * michael@0: * @see gfxTextRun::BreakAndMeasureText michael@0: * @see nsLineLayout::NotifyOptionalBreakPosition michael@0: */ michael@0: MOZ_BEGIN_ENUM_CLASS(gfxBreakPriority) michael@0: eNoBreak = 0, michael@0: eWordWrapBreak, michael@0: eNormalBreak michael@0: MOZ_END_ENUM_CLASS(gfxBreakPriority) michael@0: michael@0: /** michael@0: * The format for an image surface. For all formats with alpha data, 0 michael@0: * means transparent, 1 or 255 means fully opaque. michael@0: */ michael@0: MOZ_BEGIN_ENUM_CLASS(gfxImageFormat) michael@0: ARGB32, ///< ARGB data in native endianness, using premultiplied alpha michael@0: RGB24, ///< xRGB data in native endianness michael@0: A8, ///< Only an alpha channel michael@0: A1, ///< Packed transparency information (one byte refers to 8 pixels) michael@0: RGB16_565, ///< RGB_565 data in native endianness michael@0: Unknown michael@0: MOZ_END_ENUM_CLASS(gfxImageFormat) michael@0: michael@0: MOZ_BEGIN_ENUM_CLASS(gfxSurfaceType) michael@0: Image, michael@0: PDF, michael@0: PS, michael@0: Xlib, michael@0: Xcb, michael@0: Glitz, // unused, but needed for cairo parity michael@0: Quartz, michael@0: Win32, michael@0: BeOS, michael@0: DirectFB, // unused, but needed for cairo parity michael@0: SVG, michael@0: OS2, michael@0: Win32Printing, michael@0: QuartzImage, michael@0: Script, michael@0: QPainter, michael@0: Recording, michael@0: VG, michael@0: GL, michael@0: DRM, michael@0: Tee, michael@0: XML, michael@0: Skia, michael@0: Subsurface, michael@0: D2D, michael@0: Max michael@0: MOZ_END_ENUM_CLASS(gfxSurfaceType) michael@0: michael@0: MOZ_BEGIN_ENUM_CLASS(gfxContentType) michael@0: COLOR = 0x1000, michael@0: ALPHA = 0x2000, michael@0: COLOR_ALPHA = 0x3000, michael@0: SENTINEL = 0xffff michael@0: MOZ_END_ENUM_CLASS(gfxContentType) michael@0: michael@0: /** michael@0: * The memory used by a gfxASurface (as reported by KnownMemoryUsed()) can michael@0: * either live in this process's heap, in this process but outside the michael@0: * heap, or in another process altogether. michael@0: */ michael@0: MOZ_BEGIN_ENUM_CLASS(gfxMemoryLocation) michael@0: IN_PROCESS_HEAP, michael@0: IN_PROCESS_NONHEAP, michael@0: OUT_OF_PROCESS michael@0: MOZ_END_ENUM_CLASS(gfxMemoryLocation) michael@0: michael@0: #endif /* GFX_TYPES_H */