~ubuntu-branches/ubuntu/precise/kompozer/precise

« back to all changes in this revision

Viewing changes to mozilla/gfx/src/x11shared/nsFontDebug.h

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Yarusso
  • Date: 2007-08-27 01:11:03 UTC
  • Revision ID: james.westby@ubuntu.com-20070827011103-2jgf4s6532gqu2ka
Tags: upstream-0.7.10
ImportĀ upstreamĀ versionĀ 0.7.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 
2
/* ex: set tabstop=8 softtabstop=2 shiftwidth=2 expandtab: */
 
3
/* ***** BEGIN LICENSE BLOCK *****
 
4
 * Version: NPL 1.1/GPL 2.0/LGPL 2.1
 
5
 *
 
6
 * The contents of this file are subject to the Netscape Public License
 
7
 * Version 1.1 (the "License"); you may not use this file except in
 
8
 * compliance with the License. You may obtain a copy of the License at
 
9
 * http://www.mozilla.org/NPL/
 
10
 *
 
11
 * Software distributed under the License is distributed on an "AS IS" basis,
 
12
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 
13
 * for the specific language governing rights and limitations under the
 
14
 * License.
 
15
 *
 
16
 * The Original Code is mozilla.org code.
 
17
 *
 
18
 * The Initial Developer of the Original Code is
 
19
 * Netscape Communications Corporation.
 
20
 * Portions created by the Initial Developer are Copyright (C) 1998
 
21
 * the Initial Developer. All Rights Reserved.
 
22
 *
 
23
 * Contributor(s):
 
24
 *   Brian Stell <bstell@netscape.com>
 
25
 *   Louie Zhao  <louie.zhao@sun.com>
 
26
 *
 
27
 * Alternatively, the contents of this file may be used under the terms of
 
28
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 
29
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 
30
 * in which case the provisions of the GPL or the LGPL are applicable instead
 
31
 * of those above. If you wish to allow use of your version of this file only
 
32
 * under the terms of either the GPL or the LGPL, and not to allow others to
 
33
 * use your version of this file under the terms of the NPL, indicate your
 
34
 * decision by deleting the provisions above and replace them with the notice
 
35
 * and other provisions required by the GPL or the LGPL. If you do not delete
 
36
 * the provisions above, a recipient may use your version of this file under
 
37
 * the terms of any one of the NPL, the GPL or the LGPL.
 
38
 *
 
39
 * ***** END LICENSE BLOCK ***** */
 
40
#ifndef nsFontDebug_h__
 
41
#define nsFontDebug_h__
 
42
 
 
43
#define NS_FONT_DEBUG_LOAD_FONT         0x01
 
44
#define NS_FONT_DEBUG_CALL_TRACE        0x02
 
45
#define NS_FONT_DEBUG_FIND_FONT         0x04
 
46
#define NS_FONT_DEBUG_SIZE_FONT         0x08
 
47
#define NS_FONT_DEBUG_SCALED_FONT       0x10
 
48
#define NS_FONT_DEBUG_BANNED_FONT       0x20
 
49
#define NS_FONT_DEBUG_FONT_CATALOG      0x100
 
50
#define NS_FONT_DEBUG_FONT_SCAN         0x200
 
51
#define NS_FONT_DEBUG_FREETYPE_FONT     0x400
 
52
#define NS_FONT_DEBUG_FREETYPE_GRAPHICS 0x800
 
53
 
 
54
#undef NS_FONT_DEBUG
 
55
#define NS_FONT_DEBUG 1
 
56
#ifdef NS_FONT_DEBUG
 
57
 
 
58
# define DEBUG_PRINTF(x) \
 
59
         DEBUG_PRINTF_MACRO(x, 0xFFFF)
 
60
 
 
61
# define DEBUG_PRINTF_MACRO(x, type) \
 
62
            PR_BEGIN_MACRO \
 
63
              if (gFontDebug & (type)) { \
 
64
                printf x ; \
 
65
                printf(", %s %d\n", __FILE__, __LINE__); \
 
66
              } \
 
67
            PR_END_MACRO
 
68
#else
 
69
# define DEBUG_PRINTF_MACRO(x, type) \
 
70
            PR_BEGIN_MACRO \
 
71
            PR_END_MACRO
 
72
#endif
 
73
 
 
74
#define FIND_FONT_PRINTF(x) \
 
75
         DEBUG_PRINTF_MACRO(x, NS_FONT_DEBUG_FIND_FONT)
 
76
 
 
77
#define SIZE_FONT_PRINTF(x) \
 
78
         DEBUG_PRINTF_MACRO(x, NS_FONT_DEBUG_SIZE_FONT)
 
79
 
 
80
#define SCALED_FONT_PRINTF(x) \
 
81
         DEBUG_PRINTF_MACRO(x, NS_FONT_DEBUG_SCALED_FONT)
 
82
 
 
83
#define BANNED_FONT_PRINTF(x) \
 
84
         DEBUG_PRINTF_MACRO(x, NS_FONT_DEBUG_BANNED_FONT)
 
85
 
 
86
#define FONT_CATALOG_PRINTF(x) \
 
87
         DEBUG_PRINTF_MACRO(x, NS_FONT_DEBUG_FONT_CATALOG)
 
88
 
 
89
#define FONT_SCAN_PRINTF(x) \
 
90
            PR_BEGIN_MACRO \
 
91
              if (gFontDebug & NS_FONT_DEBUG_FONT_SCAN) { \
 
92
                printf x ; \
 
93
                fflush(stdout); \
 
94
              } \
 
95
            PR_END_MACRO
 
96
 
 
97
#define FREETYPE_FONT_PRINTF(x) \
 
98
         DEBUG_PRINTF_MACRO(x, NS_FONT_DEBUG_FREETYPE_FONT)
 
99
 
 
100
extern PRUint32 gFontDebug;
 
101
 
 
102
#endif
 
103