gfx/thebes/gfxTypes.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/thebes/gfxTypes.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,108 @@
     1.4 +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
     1.5 + * This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#ifndef GFX_TYPES_H
    1.10 +#define GFX_TYPES_H
    1.11 +
    1.12 +#include <stdint.h>
    1.13 +#include "mozilla/TypedEnum.h"
    1.14 +
    1.15 +typedef struct _cairo_surface cairo_surface_t;
    1.16 +typedef struct _cairo_user_data_key cairo_user_data_key_t;
    1.17 +
    1.18 +typedef void (*thebes_destroy_func_t) (void *data);
    1.19 +
    1.20 +/**
    1.21 + * Currently needs to be 'double' for Cairo compatibility. Could
    1.22 + * become 'float', perhaps, in some configurations.
    1.23 + */
    1.24 +typedef double gfxFloat;
    1.25 +
    1.26 +/**
    1.27 + * Priority of a line break opportunity.
    1.28 + *
    1.29 + * eNoBreak       The line has no break opportunities
    1.30 + * eWordWrapBreak The line has a break opportunity only within a word. With
    1.31 + *                word-wrap: break-word we will break at this point only if
    1.32 + *                there are no other break opportunities in the line.
    1.33 + * eNormalBreak   The line has a break opportunity determined by the standard
    1.34 + *                line-breaking algorithm.
    1.35 + *
    1.36 + * Future expansion: split eNormalBreak into multiple priorities, e.g.
    1.37 + *                    punctuation break and whitespace break (bug 389710).
    1.38 + *                   As and when we implement it, text-wrap: unrestricted will
    1.39 + *                    mean that priorities are ignored and all line-break
    1.40 + *                    opportunities are equal.
    1.41 + *
    1.42 + * @see gfxTextRun::BreakAndMeasureText
    1.43 + * @see nsLineLayout::NotifyOptionalBreakPosition
    1.44 + */
    1.45 +MOZ_BEGIN_ENUM_CLASS(gfxBreakPriority)
    1.46 +  eNoBreak       = 0,
    1.47 +  eWordWrapBreak,
    1.48 +  eNormalBreak
    1.49 +MOZ_END_ENUM_CLASS(gfxBreakPriority)
    1.50 +
    1.51 +/**
    1.52 +  * The format for an image surface. For all formats with alpha data, 0
    1.53 +  * means transparent, 1 or 255 means fully opaque.
    1.54 +  */
    1.55 +MOZ_BEGIN_ENUM_CLASS(gfxImageFormat)
    1.56 +  ARGB32, ///< ARGB data in native endianness, using premultiplied alpha
    1.57 +  RGB24,  ///< xRGB data in native endianness
    1.58 +  A8,     ///< Only an alpha channel
    1.59 +  A1,     ///< Packed transparency information (one byte refers to 8 pixels)
    1.60 +  RGB16_565,  ///< RGB_565 data in native endianness
    1.61 +  Unknown
    1.62 +MOZ_END_ENUM_CLASS(gfxImageFormat)
    1.63 +
    1.64 +MOZ_BEGIN_ENUM_CLASS(gfxSurfaceType)
    1.65 +  Image,
    1.66 +  PDF,
    1.67 +  PS,
    1.68 +  Xlib,
    1.69 +  Xcb,
    1.70 +  Glitz,           // unused, but needed for cairo parity
    1.71 +  Quartz,
    1.72 +  Win32,
    1.73 +  BeOS,
    1.74 +  DirectFB,        // unused, but needed for cairo parity
    1.75 +  SVG,
    1.76 +  OS2,
    1.77 +  Win32Printing,
    1.78 +  QuartzImage,
    1.79 +  Script,
    1.80 +  QPainter,
    1.81 +  Recording,
    1.82 +  VG,
    1.83 +  GL,
    1.84 +  DRM,
    1.85 +  Tee,
    1.86 +  XML,
    1.87 +  Skia,
    1.88 +  Subsurface,
    1.89 +  D2D,
    1.90 +  Max
    1.91 +MOZ_END_ENUM_CLASS(gfxSurfaceType)
    1.92 +
    1.93 +MOZ_BEGIN_ENUM_CLASS(gfxContentType)
    1.94 +  COLOR       = 0x1000,
    1.95 +  ALPHA       = 0x2000,
    1.96 +  COLOR_ALPHA = 0x3000,
    1.97 +  SENTINEL    = 0xffff
    1.98 +MOZ_END_ENUM_CLASS(gfxContentType)
    1.99 +
   1.100 +/**
   1.101 +  * The memory used by a gfxASurface (as reported by KnownMemoryUsed()) can
   1.102 +  * either live in this process's heap, in this process but outside the
   1.103 +  * heap, or in another process altogether.
   1.104 +  */
   1.105 +MOZ_BEGIN_ENUM_CLASS(gfxMemoryLocation)
   1.106 +  IN_PROCESS_HEAP,
   1.107 +  IN_PROCESS_NONHEAP,
   1.108 +  OUT_OF_PROCESS
   1.109 +MOZ_END_ENUM_CLASS(gfxMemoryLocation)
   1.110 +
   1.111 +#endif /* GFX_TYPES_H */

mercurial