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/. */ 5 6 #ifndef GFX_TYPES_H 7 #define GFX_TYPES_H 8 9 #include <stdint.h> 10 11 typedef struct _cairo_surface cairo_surface_t; 12 typedef struct _cairo_user_data_key cairo_user_data_key_t; 13 14 typedef void (*thebes_destroy_func_t)(void *data); 15 16 /** 17 * Currently needs to be 'double' for Cairo compatibility. Could 18 * become 'float', perhaps, in some configurations. 19 */ 20 typedef double gfxFloat; 21 22 /** 23 * Priority of a line break opportunity. 24 * 25 * eNoBreak The line has no break opportunities 26 * eWordWrapBreak The line has a break opportunity only within a word. With 27 * overflow-wrap|word-wrap: break-word we will break at this 28 * point only if there are no other break opportunities in the 29 * line. 30 * eNormalBreak The line has a break opportunity determined by the standard 31 * line-breaking algorithm. 32 * 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. 38 * 39 * @see gfxTextRun::BreakAndMeasureText 40 * @see nsLineLayout::NotifyOptionalBreakPosition 41 */ 42 enum class gfxBreakPriority { eNoBreak = 0, eWordWrapBreak, eNormalBreak }; 43 44 enum class gfxSurfaceType { 45 Image, 46 PDF, 47 PS, 48 Xlib, 49 Xcb, 50 Glitz, // unused, but needed for cairo parity 51 Quartz, 52 Win32, 53 BeOS, 54 DirectFB, // unused, but needed for cairo parity 55 SVG, 56 OS2, 57 Win32Printing, 58 QuartzImage, 59 Script, 60 QPainter, 61 Recording, 62 VG, 63 GL, 64 DRM, 65 Tee, 66 XML, 67 Skia, 68 Subsurface, 69 Max 70 }; 71 72 enum class gfxContentType { 73 COLOR = 0x1000, 74 ALPHA = 0x2000, 75 COLOR_ALPHA = 0x3000, 76 SENTINEL = 0xffff 77 }; 78 79 enum class gfxAlphaType { 80 Opaque, 81 Premult, 82 NonPremult, 83 }; 84 85 #endif /* GFX_TYPES_H */ 86