1 /* This file is part of Shapes.
3 * Shapes is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
8 * Shapes is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with Shapes. If not, see <http://www.gnu.org/licenses/>.
16 * Copyright 2008 Henrik Tidefelt
21 #include "Shapes_Lang_decls.h"
22 #include "Shapes_Kernel_decls.h"
23 #include "Shapes_Computation_decls.h"
24 #include "Shapes_Concrete_decls.h"
25 #include "Shapes_Helpers_decls.h"
26 #include "Shapes_Exceptions_decls.h"
27 #include "SimplePDF_decls.h"
28 #include "FontMetrics_decls.h"
32 #include "elementarylength.h"
33 #include "simplepdfo.h"
34 #include "pdfimport.h"
39 #include FT_FREETYPE_H
42 // The following types do not belong to any particular namespace for some reason, and are therefore declared like this:
52 extern bool debugBacktrace
;
53 extern bool debugSystem
;
54 extern size_t debugStep
;
55 extern const char * displayUnitName
;
56 extern Concrete::Length displayUnit
;
57 extern double displayUnitFactor
;
58 extern bool fontMetricMessages
;
59 extern bool fontMetricDebug
;
60 extern bool characterColumnInBytes
;
61 extern bool pdfLaTeXInteractionTo_stderr
;
62 extern bool logGlobals
;
69 extern Concrete::Length the_arcdelta
;
70 extern double the_dtMin
;
71 extern bool dtMinIsError
;
72 extern Concrete::Length theDistanceTol
;
73 extern Concrete::Length theTrixelizeSplicingTol
;
74 extern Concrete::Length theTrixelizeOverlapTol
;
75 extern RefCountPtr
< const Computation::PaintedPolygon3D
> THE_NULL_POLYGON3D
;
76 extern bool fontMetricGuessIsError
;
77 extern Computation::BasicSimplex theTwoTriangleSimplex
;
83 extern Kernel::PassedEnv theGlobalEnvironment
; // Useful for functions in the core refering to their home environment.
84 extern std::list
< Kernel::Environment
* > theEnvironmentList
;
85 extern Kernel::TeXLabelManager theTeXLabelManager
;
86 extern SimplePDF::PDF_Version the_PDF_version
;
87 extern bool allowTransparency
;
88 extern bool allowSingletonPaths
;
89 extern size_t theIndirectObjectCount
;
90 extern SimplePDF::DocumentInfo theDocInfo
;
91 extern Kernel::Import thePDFImporter
;
92 extern Kernel::DebugLog theDebugLog
;
94 extern RefCountPtr
< const Kernel::GraphicsState
> THE_NO_STATE
;
95 extern RefCountPtr
< const Kernel::GraphicsState
> THE_DEFAULT_STATE
;
97 extern RefCountPtr
< const Lang::Function
> THE_NO_FUNCTION
;
99 extern Arguments EMPTY_ARGLIST
;
100 extern VariableHandle THE_SLOT_VARIABLE
;
101 extern VariableHandle THE_FALSE_VARIABLE
;
102 extern VariableHandle THE_TRUE_VARIABLE
;
103 extern VariableHandle THE_VOID_VARIABLE
;
105 extern StateHandle THE_SLOT_STATE
;
107 extern RefCountPtr
< const Lang::Symbol
> THE_NAVIGATION_SYMBOL
;
108 extern RefCountPtr
< const Lang::Symbol
> THE_ANNOTATION_SYMBOL
;
110 extern PtrOwner_back_Access
< std::list
< Exceptions::Exception
* > > thePostCheckErrorsList
;
113 extern FT_Library theFreeType
;
114 const char * FreeTypeErrorMessage( FT_Error code
);
121 extern RefCountPtr
< const Lang::GroupNull2D
> THE_NULL2D
;
122 extern RefCountPtr
< const Lang::GroupNull3D
> THE_NULL3D
;
123 extern RefCountPtr
< const Lang::DynamicBindings
> THE_NULL_DYNAMIC_BINDINGS
;
124 extern RefCountPtr
< const Lang::LightGroup
> THE_NULL_LIGHTS
;
125 extern RefCountPtr
< const Lang::SingleListNull
> THE_CONS_NULL
;
126 extern RefCountPtr
< const Lang::Structure
> THE_EMPTY_STRUCT
;
127 extern RefCountPtr
< const Lang::SpecularReflectionNull
> THE_SPECULARREFLECTION_NULL
;
128 // extern RefCountPtr< const Lang::PaintedPoltgon2D > THE_NULL_POLYGON2D;
129 extern RefCountPtr
< const Lang::ColorSpace
> THE_INHERITED_COLOR_SPACE
;
130 extern RefCountPtr
< const Lang::ColorSpace
> THE_COLOR_SPACE_DEVICE_GRAY
;
131 extern RefCountPtr
< const Lang::ColorSpace
> THE_COLOR_SPACE_DEVICE_RGB
;
132 extern RefCountPtr
< const Lang::ColorSpace
> THE_COLOR_SPACE_DEVICE_CMYK
;
133 extern RefCountPtr
< const Lang::Drawable2D
> THE_POINTPICTURE
;
134 extern RefCountPtr
< const Lang::Void
> THE_VOID
;
135 extern RefCountPtr
< const Lang::ElementaryPath2D
> THE_EMPTYPATH2D
;
136 extern RefCountPtr
< const Lang::ElementaryPath3D
> THE_EMPTYPATH3D
;
137 extern RefCountPtr
< const Lang::Boolean
> THE_FALSE
;
138 extern RefCountPtr
< const Lang::Boolean
> THE_TRUE
;
139 extern RefCountPtr
< const Lang::Gray
> THE_BLACK
;
140 extern RefCountPtr
< const Lang::Gray
> THE_OCCLUDING_WHITE
;
141 extern RefCountPtr
< const Lang::Alpha
> THE_OPAQUE
;
142 extern RefCountPtr
< const Lang::Class
> THE_OBJECT
;
143 extern RefCountPtr
< const Lang::CoreFunction
> THE_NO_ARROW
;
144 extern RefCountPtr
< const Lang::CoreFunction
> THE_IDENTITY
;
145 extern RefCountPtr
< const Lang::Dash
> THE_SOLID_DASH
;
146 extern RefCountPtr
< const Lang::SoftMask
> THE_NONE_MASK
;
147 extern RefCountPtr
< const Lang::SoftMask
> THE_SAME_MASK
;
148 extern RefCountPtr
< const Lang::Font
> THE_FONT_HELVETICA
;
149 extern RefCountPtr
< const Lang::CoreFunction
> THE_FILL
;
150 extern RefCountPtr
< const Lang::CoreFunction
> THE_FILLODD
;
152 extern Transform2D THE_2D_IDENTITY
;
153 extern Transform3D THE_3D_IDENTITY
;
155 extern RefCountPtr
< const Lang::BinaryOperatorFunction
> THE_OPERATOR_MINUSMINUS
;
156 extern RefCountPtr
< const Lang::BinaryOperatorFunction
> THE_OPERATOR_PLUSPLUS
;
157 extern RefCountPtr
< const Lang::BinaryOperatorFunction
> THE_OPERATOR_AMPERSAND
;
158 extern RefCountPtr
< const Lang::BinaryOperatorFunction
> THE_OPERATOR_AMPERSAND_MORE
;
159 extern RefCountPtr
< const Lang::BinaryOperatorFunction
> THE_OPERATOR_PLUS
;
160 extern RefCountPtr
< const Lang::BinaryOperatorFunction
> THE_OPERATOR_MINUS
;
161 extern RefCountPtr
< const Lang::BinaryOperatorFunction
> THE_OPERATOR_ANGLE
;
162 extern RefCountPtr
< const Lang::BinaryOperatorFunction
> THE_OPERATOR_STAR
;
163 extern RefCountPtr
< const Lang::BinaryOperatorFunction
> THE_OPERATOR_PROJECTION
;
164 extern RefCountPtr
< const Lang::BinaryOperatorFunction
> THE_OPERATOR_SLASH
;
165 extern RefCountPtr
< const Lang::BinaryOperatorFunction
> THE_OPERATOR_COMPOSE
;
166 extern RefCountPtr
< const Lang::UnaryOperatorFunction
> THE_OPERATOR_NEG
;
167 extern RefCountPtr
< const Lang::BinaryOperatorFunction
> THE_OPERATOR_LESS
;
168 extern RefCountPtr
< const Lang::BinaryOperatorFunction
> THE_OPERATOR_GREATER
;
169 extern RefCountPtr
< const Lang::BinaryOperatorFunction
> THE_OPERATOR_EQEQ
;
170 extern RefCountPtr
< const Lang::BinaryOperatorFunction
> THE_OPERATOR_EQNEQ
;
171 extern RefCountPtr
< const Lang::BinaryOperatorFunction
> THE_OPERATOR_LESSEQ
;
172 extern RefCountPtr
< const Lang::BinaryOperatorFunction
> THE_OPERATOR_GREATEREQ
;
173 extern RefCountPtr
< const Lang::UnaryOperatorFunction
> THE_OPERATOR_NOT
;
174 extern RefCountPtr
< const Lang::CoreFunction
> THE_FUNCTION_AND
;
175 extern RefCountPtr
< const Lang::CoreFunction
> THE_FUNCTION_OR
;
176 extern RefCountPtr
< const Lang::BinaryOperatorFunction
> THE_OPERATOR_XOR
;
178 extern RefCountPtr
< const Lang::CoreFunction
> THE_FUNCTION_ABS
;
179 extern RefCountPtr
< const Lang::CoreFunction
> THE_FUNCTION_RANGE
;
185 extern ShapesScanner theShapesScanner
;
186 extern Ast::Expression
* theProgram
;
187 extern std::list
< Ast::Node
* > * theInteractiveInput
;
188 extern PtrOwner_back_Access
< std::list
< Ast::AnalysisEnvironment
* > > theAnalysisEnvironmentList
;
189 extern Ast::AnalysisEnvironment
* theGlobalAnalysisEnvironment
;
190 extern Ast::DummyExpression THE_CORE_DEFAULT_VALUE_EXPRESSION
;
191 extern Ast::DummyExpression THE_INTERNAL_VALUE_EXPRESSION
;
193 extern PtrOwner_back_Access
< std::list
< Exceptions::Exception
* > > theAnalysisErrorsList
;
195 extern RefCountPtr
< const Lang::CoreFunction
> THE_FUNCTION_coords2D
;
196 extern RefCountPtr
< const Lang::CoreFunction
> THE_FUNCTION_cornercoords2D
;
197 extern RefCountPtr
< const Lang::CoreFunction
> THE_FUNCTION_coords3D
;
198 extern RefCountPtr
< const Lang::CoreFunction
> THE_FUNCTION_polarHandle2DFree_r
;
199 extern RefCountPtr
< const Lang::CoreFunction
> THE_FUNCTION_polarHandle2DFree_ra
;
200 extern RefCountPtr
< const Lang::CoreFunction
> THE_FUNCTION_TeX
;
201 extern RefCountPtr
< const Lang::CoreFunction
> THE_FUNCTION_Unicode
;