Bug 460926 A11y hierachy is broken on Ubuntu 8.10 (GNOME 2.24), r=Evan.Yan sr=roc
[wine-gecko.git] / gfx / thebes / public / gfxTypes.h
blob34bc9357614bd250cc88d8ce01f86b075d058947
1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 * ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
15 * The Original Code is Oracle Corporation code.
17 * The Initial Developer of the Original Code is Oracle Corporation.
18 * Portions created by the Initial Developer are Copyright (C) 2005
19 * the Initial Developer. All Rights Reserved.
21 * Contributor(s):
22 * Stuart Parmenter <pavlov@pavlov.net>
24 * Alternatively, the contents of this file may be used under the terms of
25 * either the GNU General Public License Version 2 or later (the "GPL"), or
26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
38 #ifndef GFX_TYPES_H
39 #define GFX_TYPES_H
41 #include "prtypes.h"
43 /**
44 * Currently needs to be 'double' for Cairo compatibility. Could
45 * become 'float', perhaps, in some configurations.
47 typedef double gfxFloat;
49 #if defined(MOZ_STATIC_BUILD)
50 # define THEBES_API
51 #elif defined(IMPL_THEBES)
52 # define THEBES_API NS_EXPORT
53 #else
54 # define THEBES_API NS_IMPORT
55 #endif
57 /**
58 * Priority of a line break opportunity.
60 * eNoBreak The line has no break opportunities
61 * eWordWrapBreak The line has a break opportunity only within a word. With
62 * word-wrap: break-word we will break at this point only if
63 * there are no other break opportunities in the line.
64 * eNormalBreak The line has a break opportunity determined by the standard
65 * line-breaking algorithm.
67 * Future expansion: split eNormalBreak into multiple priorities, e.g.
68 * punctuation break and whitespace break (bug 389710).
69 * As and when we implement it, text-wrap: unrestricted will
70 * mean that priorities are ignored and all line-break
71 * opportunities are equal.
73 * @see gfxTextRun::BreakAndMeasureText
74 * @see nsLineLayout::NotifyOptionalBreakPosition
76 enum gfxBreakPriority {
77 eNoBreak = 0,
78 eWordWrapBreak,
79 eNormalBreak
82 /**
83 * Define refcounting for Thebes. For now use the stuff from nsISupportsImpl
84 * even though it forces the functions to be virtual...
86 #include "nsISupportsImpl.h"
87 #include "nsAutoPtr.h"
89 #define THEBES_INLINE_DECL_REFCOUNTING(_class) \
90 public: \
91 nsrefcnt AddRef(void) { \
92 NS_PRECONDITION(PRInt32(mRefCnt) >= 0, "illegal refcnt"); \
93 ++mRefCnt; \
94 NS_LOG_ADDREF(this, mRefCnt, #_class, sizeof(*this)); \
95 return mRefCnt; \
96 } \
97 nsrefcnt Release(void) { \
98 NS_PRECONDITION(0 != mRefCnt, "dup release"); \
99 --mRefCnt; \
100 NS_LOG_RELEASE(this, mRefCnt, #_class); \
101 if (mRefCnt == 0) { \
102 mRefCnt = 1; /* stabilize */ \
103 NS_DELETEXPCOM(this); \
104 return 0; \
106 return mRefCnt; \
108 protected: \
109 nsAutoRefCnt mRefCnt; \
110 public:
112 #endif /* GFX_TYPES_H */