Remove old documentation chapter on core bindings
[shapes.git] / source / globals.h
blobe364a464c54e785d7860881fdcd043976e702ce3
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
6 * any later version.
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, 2010 Henrik Tidefelt
19 #pragma once
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"
30 #include "refcount.h"
31 #include "ptrowner.h"
32 #include "elementarylength.h"
33 #include "simplepdfo.h"
34 #include "pdfimport.h"
35 #include "config.h"
37 #ifdef HAVE_FT2
38 #include <ft2build.h>
39 #include FT_FREETYPE_H
40 #endif
42 // The following types do not belong to any particular namespace for some reason, and are therefore declared like this:
43 class ShapesScanner;
46 namespace Shapes
49 namespace Interaction
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;
63 typedef enum { WARNING_DISPLAY = 0, WARNING_ERROR, WARNING_IGNORE } WarningAction;
64 extern WarningAction warningAction;
65 extern bool blankMode;
69 namespace Computation
72 extern Concrete::Length the_arcdelta;
73 extern double the_dtMin;
74 extern bool dtMinIsError;
75 extern Concrete::Length theDistanceTol;
76 extern Concrete::Length theTrixelizeSplicingTol;
77 extern Concrete::Length theTrixelizeOverlapTol;
78 extern RefCountPtr< const Computation::PaintedPolygon3D > THE_NULL_POLYGON3D;
79 extern bool fontMetricGuessIsError;
80 extern Computation::BasicSimplex theTwoTriangleSimplex;
83 namespace Kernel
86 extern Kernel::PassedEnv theGlobalEnvironment; // Useful for functions in the core refering to their home environment.
87 extern std::list< Kernel::Environment * > theEnvironmentList;
88 extern Kernel::TeXLabelManager theTeXLabelManager;
89 extern SimplePDF::PDF_Version the_PDF_version;
90 extern bool allowTransparency;
91 extern bool allowSingletonPaths;
92 extern size_t theIndirectObjectCount;
93 extern SimplePDF::DocumentInfo theDocInfo;
94 extern Kernel::Import thePDFImporter;
95 extern Kernel::DebugLog theDebugLog;
97 extern RefCountPtr< const Kernel::GraphicsState > THE_NO_STATE;
98 extern RefCountPtr< const Kernel::GraphicsState > THE_DEFAULT_STATE;
100 extern RefCountPtr< const Lang::Function > THE_NO_FUNCTION;
102 extern Arguments EMPTY_ARGLIST;
103 extern VariableHandle THE_SLOT_VARIABLE;
104 extern VariableHandle THE_FALSE_VARIABLE;
105 extern VariableHandle THE_TRUE_VARIABLE;
106 extern VariableHandle THE_VOID_VARIABLE;
108 extern StateHandle THE_SLOT_STATE;
110 extern RefCountPtr< const Lang::Symbol > THE_NAVIGATION_SYMBOL;
111 extern RefCountPtr< const Lang::Symbol > THE_ANNOTATION_SYMBOL;
113 extern PtrOwner_back_Access< std::list< Exceptions::Exception * > > thePostCheckErrorsList;
115 #ifdef HAVE_FT2
116 extern FT_Library theFreeType;
117 const char * FreeTypeErrorMessage( FT_Error code );
118 #endif
121 namespace Lang
124 extern RefCountPtr< const Lang::GroupNull2D > THE_NULL2D;
125 extern RefCountPtr< const Lang::GroupNull3D > THE_NULL3D;
126 extern RefCountPtr< const Lang::DynamicBindings > THE_NULL_DYNAMIC_BINDINGS;
127 extern RefCountPtr< const Lang::LightGroup > THE_NULL_LIGHTS;
128 extern RefCountPtr< const Lang::SingleListNull > THE_CONS_NULL;
129 extern RefCountPtr< const Lang::Structure > THE_EMPTY_STRUCT;
130 extern RefCountPtr< const Lang::SpecularReflectionNull > THE_SPECULARREFLECTION_NULL;
131 // extern RefCountPtr< const Lang::PaintedPoltgon2D > THE_NULL_POLYGON2D;
132 extern RefCountPtr< const Lang::ColorSpace > THE_INHERITED_COLOR_SPACE;
133 extern RefCountPtr< const Lang::ColorSpace > THE_COLOR_SPACE_DEVICE_GRAY;
134 extern RefCountPtr< const Lang::ColorSpace > THE_COLOR_SPACE_DEVICE_RGB;
135 extern RefCountPtr< const Lang::ColorSpace > THE_COLOR_SPACE_DEVICE_CMYK;
136 extern RefCountPtr< const Lang::Drawable2D > THE_POINTPICTURE;
137 extern RefCountPtr< const Lang::Void > THE_VOID;
138 extern RefCountPtr< const Lang::ElementaryPath2D > THE_EMPTYPATH2D;
139 extern RefCountPtr< const Lang::ElementaryPath3D > THE_EMPTYPATH3D;
140 extern RefCountPtr< const Lang::Boolean > THE_FALSE;
141 extern RefCountPtr< const Lang::Boolean > THE_TRUE;
142 extern RefCountPtr< const Lang::Gray > THE_BLACK;
143 extern RefCountPtr< const Lang::Gray > THE_OCCLUDING_WHITE;
144 extern RefCountPtr< const Lang::Alpha > THE_OPAQUE;
145 extern RefCountPtr< const Lang::Class > THE_OBJECT;
146 extern RefCountPtr< const Lang::CoreFunction > THE_NO_ARROW;
147 extern RefCountPtr< const Lang::CoreFunction > THE_IDENTITY;
148 extern RefCountPtr< const Lang::Dash > THE_SOLID_DASH;
149 extern RefCountPtr< const Lang::SoftMask > THE_NONE_MASK;
150 extern RefCountPtr< const Lang::SoftMask > THE_SAME_MASK;
151 extern RefCountPtr< const Lang::Font > THE_FONT_HELVETICA;
153 extern Transform2D THE_2D_IDENTITY;
154 extern Transform3D THE_3D_IDENTITY;
156 extern RefCountPtr< const Lang::BinaryOperatorFunction > THE_OPERATOR_MINUSMINUS;
157 extern RefCountPtr< const Lang::BinaryOperatorFunction > THE_OPERATOR_PLUSPLUS;
158 extern RefCountPtr< const Lang::BinaryOperatorFunction > THE_OPERATOR_AMPERSAND;
159 extern RefCountPtr< const Lang::BinaryOperatorFunction > THE_OPERATOR_AMPERSAND_MORE;
160 extern RefCountPtr< const Lang::BinaryOperatorFunction > THE_OPERATOR_PLUS;
161 extern RefCountPtr< const Lang::BinaryOperatorFunction > THE_OPERATOR_MINUS;
162 extern RefCountPtr< const Lang::BinaryOperatorFunction > THE_OPERATOR_ANGLE;
163 extern RefCountPtr< const Lang::BinaryOperatorFunction > THE_OPERATOR_STAR;
164 extern RefCountPtr< const Lang::BinaryOperatorFunction > THE_OPERATOR_PROJECTION;
165 extern RefCountPtr< const Lang::BinaryOperatorFunction > THE_OPERATOR_SLASH;
166 extern RefCountPtr< const Lang::BinaryOperatorFunction > THE_OPERATOR_COMPOSE;
167 extern RefCountPtr< const Lang::UnaryOperatorFunction > THE_OPERATOR_NEG;
168 extern RefCountPtr< const Lang::BinaryOperatorFunction > THE_OPERATOR_LESS;
169 extern RefCountPtr< const Lang::BinaryOperatorFunction > THE_OPERATOR_GREATER;
170 extern RefCountPtr< const Lang::BinaryOperatorFunction > THE_OPERATOR_EQEQ;
171 extern RefCountPtr< const Lang::BinaryOperatorFunction > THE_OPERATOR_EQNEQ;
172 extern RefCountPtr< const Lang::BinaryOperatorFunction > THE_OPERATOR_LESSEQ;
173 extern RefCountPtr< const Lang::BinaryOperatorFunction > THE_OPERATOR_GREATEREQ;
174 extern RefCountPtr< const Lang::UnaryOperatorFunction > THE_OPERATOR_NOT;
175 extern RefCountPtr< const Lang::CoreFunction > THE_FUNCTION_AND;
176 extern RefCountPtr< const Lang::CoreFunction > THE_FUNCTION_OR;
177 extern RefCountPtr< const Lang::BinaryOperatorFunction > THE_OPERATOR_XOR;
179 extern RefCountPtr< const Lang::CoreFunction > THE_FUNCTION_ABS;
180 extern RefCountPtr< const Lang::CoreFunction > THE_FUNCTION_RANGE;
183 namespace Ast
186 extern ShapesScanner theShapesScanner;
187 extern Ast::Expression * theProgram;
188 extern std::list< Ast::Node * > * theInteractiveInput;
189 extern PtrOwner_back_Access< std::list< Ast::AnalysisEnvironment * > > theAnalysisEnvironmentList;
190 extern Ast::AnalysisEnvironment * theGlobalAnalysisEnvironment;
191 extern Ast::DummyExpression THE_CORE_DEFAULT_VALUE_EXPRESSION;
192 extern Ast::DummyExpression THE_INTERNAL_VALUE_EXPRESSION;
194 extern PtrOwner_back_Access< std::list< Exceptions::Exception * > > theAnalysisErrorsList;
196 extern RefCountPtr< const Lang::CoreFunction > THE_FUNCTION_coords2D;
197 extern RefCountPtr< const Lang::CoreFunction > THE_FUNCTION_cornercoords2D;
198 extern RefCountPtr< const Lang::CoreFunction > THE_FUNCTION_coords3D;
199 extern RefCountPtr< const Lang::CoreFunction > THE_FUNCTION_polarHandle2DFree_r;
200 extern RefCountPtr< const Lang::CoreFunction > THE_FUNCTION_polarHandle2DFree_ra;
201 extern RefCountPtr< const Lang::CoreFunction > THE_FUNCTION_TeX;
205 namespace Interaction
207 void warn_or_push( Exceptions::Exception * message, PtrOwner_back_Access< std::list< Exceptions::Exception * > > * errorsList );
208 void displayWarning( const Exceptions::Exception & ball );