gfx/thebes/gfxTypes.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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.
    20  */
    21 typedef double gfxFloat;
    23 /**
    24  * Priority of a line break opportunity.
    25  *
    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.
    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 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.
    51   */
    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.
   101   */
   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 */

mercurial