Bumping manifests a=b2g-bump
[gecko.git] / gfx / thebes / gfxTypes.h
blobaf3df792db79044f7cacce66a842dae342d93480
1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef GFX_TYPES_H
7 #define GFX_TYPES_H
9 #include <stdint.h>
10 #include "mozilla/TypedEnum.h"
12 typedef struct _cairo_surface cairo_surface_t;
13 typedef struct _cairo_user_data_key cairo_user_data_key_t;
15 typedef void (*thebes_destroy_func_t) (void *data);
17 /**
18 * Currently needs to be 'double' for Cairo compatibility. Could
19 * become 'float', perhaps, in some configurations.
21 typedef double gfxFloat;
23 /**
24 * Priority of a line break opportunity.
26 * eNoBreak The line has no break opportunities
27 * eWordWrapBreak The line has a break opportunity only within a word. With
28 * word-wrap: break-word we will break at this point only if
29 * there are no other break opportunities in the line.
30 * eNormalBreak The line has a break opportunity determined by the standard
31 * line-breaking algorithm.
33 * Future expansion: split eNormalBreak into multiple priorities, e.g.
34 * punctuation break and whitespace break (bug 389710).
35 * As and when we implement it, text-wrap: unrestricted will
36 * mean that priorities are ignored and all line-break
37 * opportunities are equal.
39 * @see gfxTextRun::BreakAndMeasureText
40 * @see nsLineLayout::NotifyOptionalBreakPosition
42 MOZ_BEGIN_ENUM_CLASS(gfxBreakPriority)
43 eNoBreak = 0,
44 eWordWrapBreak,
45 eNormalBreak
46 MOZ_END_ENUM_CLASS(gfxBreakPriority)
48 /**
49 * The format for an image surface. For all formats with alpha data, 0
50 * means transparent, 1 or 255 means fully opaque.
52 MOZ_BEGIN_ENUM_CLASS(gfxImageFormat)
53 ARGB32, ///< ARGB data in native endianness, using premultiplied alpha
54 RGB24, ///< xRGB data in native endianness
55 A8, ///< Only an alpha channel
56 A1, ///< Packed transparency information (one byte refers to 8 pixels)
57 RGB16_565, ///< RGB_565 data in native endianness
58 Unknown
59 MOZ_END_ENUM_CLASS(gfxImageFormat)
61 MOZ_BEGIN_ENUM_CLASS(gfxSurfaceType)
62 Image,
63 PDF,
64 PS,
65 Xlib,
66 Xcb,
67 Glitz, // unused, but needed for cairo parity
68 Quartz,
69 Win32,
70 BeOS,
71 DirectFB, // unused, but needed for cairo parity
72 SVG,
73 OS2,
74 Win32Printing,
75 QuartzImage,
76 Script,
77 QPainter,
78 Recording,
79 VG,
80 GL,
81 DRM,
82 Tee,
83 XML,
84 Skia,
85 Subsurface,
86 D2D,
87 Max
88 MOZ_END_ENUM_CLASS(gfxSurfaceType)
90 MOZ_BEGIN_ENUM_CLASS(gfxContentType)
91 COLOR = 0x1000,
92 ALPHA = 0x2000,
93 COLOR_ALPHA = 0x3000,
94 SENTINEL = 0xffff
95 MOZ_END_ENUM_CLASS(gfxContentType)
97 /**
98 * The memory used by a gfxASurface (as reported by KnownMemoryUsed()) can
99 * either live in this process's heap, in this process but outside the
100 * heap, or in another process altogether.
102 MOZ_BEGIN_ENUM_CLASS(gfxMemoryLocation)
103 IN_PROCESS_HEAP,
104 IN_PROCESS_NONHEAP,
105 OUT_OF_PROCESS
106 MOZ_END_ENUM_CLASS(gfxMemoryLocation)
108 #endif /* GFX_TYPES_H */