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