Updating the changelog in the VERSION file, and version_sync.
[shapes.git] / source / globals.h
blob780c8a3b04d7067ec4cffe89851eb98629ff6b98
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 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"
36 // The following types do not belong to any particular namespace for some reason, and are therefore declared like this:
37 class ShapesScanner;
40 namespace Shapes
43 namespace Interaction
46 extern bool debugBacktrace;
47 extern bool debugSystem;
48 extern size_t debugStep;
49 extern const char * displayUnitName;
50 extern Concrete::Length displayUnit;
51 extern double displayUnitFactor;
52 extern bool fontMetricMessages;
53 extern bool fontMetricDebug;
54 extern bool characterColumnInBytes;
55 extern bool pdfLaTeXInteractionTo_stderr;
56 extern bool logGlobals;
60 namespace Computation
63 extern Concrete::Length the_arcdelta;
64 extern double the_dtMin;
65 extern bool dtMinIsError;
66 extern Concrete::Length theDistanceTol;
67 extern Concrete::Length theTrixelizeSplicingTol;
68 extern Concrete::Length theTrixelizeOverlapTol;
69 extern RefCountPtr< const Computation::PaintedPolygon3D > THE_NULL_POLYGON3D;
70 extern bool fontMetricGuessIsError;
71 extern Computation::BasicSimplex theTwoTriangleSimplex;
74 namespace Kernel
77 extern Kernel::PassedEnv theGlobalEnvironment; // Useful for functions in the core refering to their home environment.
78 extern std::list< Kernel::Environment * > theEnvironmentList;
79 extern Kernel::TeXLabelManager theTeXLabelManager;
80 extern SimplePDF::PDF_Version the_PDF_version;
81 extern bool allowTransparency;
82 extern bool allowSingletonPaths;
83 extern size_t theIndirectObjectCount;
84 extern SimplePDF::DocumentInfo theDocInfo;
85 extern Kernel::Import thePDFImporter;
86 extern Kernel::DebugLog theDebugLog;
88 extern RefCountPtr< const Kernel::GraphicsState > THE_NO_STATE;
89 extern RefCountPtr< const Kernel::GraphicsState > THE_DEFAULT_STATE;
91 extern RefCountPtr< const Lang::Function > THE_NO_FUNCTION;
93 extern Arguments EMPTY_ARGLIST;
94 extern VariableHandle THE_SLOT_VARIABLE;
95 extern VariableHandle THE_FALSE_VARIABLE;
96 extern VariableHandle THE_TRUE_VARIABLE;
97 extern VariableHandle THE_VOID_VARIABLE;
99 extern StateHandle THE_SLOT_STATE;
101 extern RefCountPtr< const Lang::Symbol > THE_NAVIGATION_SYMBOL;
102 extern RefCountPtr< const Lang::Symbol > THE_ANNOTATION_SYMBOL;
104 extern PtrOwner_back_Access< std::list< Exceptions::Exception * > > thePostCheckErrorsList;
107 namespace Lang
110 extern RefCountPtr< const Lang::GroupNull2D > THE_NULL2D;
111 extern RefCountPtr< const Lang::GroupNull3D > THE_NULL3D;
112 extern RefCountPtr< const Lang::DynamicBindings > THE_NULL_DYNAMIC_BINDINGS;
113 extern RefCountPtr< const Lang::LightGroup > THE_NULL_LIGHTS;
114 extern RefCountPtr< const Lang::SingleListNull > THE_CONS_NULL;
115 extern RefCountPtr< const Lang::Structure > THE_EMPTY_STRUCT;
116 extern RefCountPtr< const Lang::SpecularReflectionNull > THE_SPECULARREFLECTION_NULL;
117 // extern RefCountPtr< const Lang::PaintedPoltgon2D > THE_NULL_POLYGON2D;
118 extern RefCountPtr< const Lang::ColorSpace > THE_INHERITED_COLOR_SPACE;
119 extern RefCountPtr< const Lang::ColorSpace > THE_COLOR_SPACE_DEVICE_GRAY;
120 extern RefCountPtr< const Lang::ColorSpace > THE_COLOR_SPACE_DEVICE_RGB;
121 extern RefCountPtr< const Lang::Drawable2D > THE_POINTPICTURE;
122 extern RefCountPtr< const Lang::Void > THE_VOID;
123 extern RefCountPtr< const Lang::ElementaryPath2D > THE_EMPTYPATH2D;
124 extern RefCountPtr< const Lang::ElementaryPath3D > THE_EMPTYPATH3D;
125 extern RefCountPtr< const Lang::Boolean > THE_FALSE;
126 extern RefCountPtr< const Lang::Boolean > THE_TRUE;
127 extern RefCountPtr< const Lang::Gray > THE_BLACK;
128 extern RefCountPtr< const Lang::Gray > THE_OCCLUDING_WHITE;
129 extern RefCountPtr< const Lang::Alpha > THE_OPAQUE;
130 extern RefCountPtr< const Lang::Class > THE_OBJECT;
131 extern RefCountPtr< const Lang::CoreFunction > THE_NO_ARROW;
132 extern RefCountPtr< const Lang::CoreFunction > THE_IDENTITY;
133 extern RefCountPtr< const Lang::Dash > THE_SOLID_DASH;
134 extern RefCountPtr< const Lang::SoftMask > THE_NONE_MASK;
135 extern RefCountPtr< const Lang::SoftMask > THE_SAME_MASK;
136 extern RefCountPtr< const Lang::Font > THE_FONT_HELVETICA;
138 extern Transform2D THE_2D_IDENTITY;
139 extern Transform3D THE_3D_IDENTITY;
141 extern RefCountPtr< const Lang::BinaryOperatorFunction > THE_OPERATOR_MINUSMINUS;
142 extern RefCountPtr< const Lang::BinaryOperatorFunction > THE_OPERATOR_PLUSPLUS;
143 extern RefCountPtr< const Lang::BinaryOperatorFunction > THE_OPERATOR_AMPERSAND;
144 extern RefCountPtr< const Lang::BinaryOperatorFunction > THE_OPERATOR_AMPERSAND_MORE;
145 extern RefCountPtr< const Lang::BinaryOperatorFunction > THE_OPERATOR_PLUS;
146 extern RefCountPtr< const Lang::BinaryOperatorFunction > THE_OPERATOR_MINUS;
147 extern RefCountPtr< const Lang::BinaryOperatorFunction > THE_OPERATOR_ANGLE;
148 extern RefCountPtr< const Lang::BinaryOperatorFunction > THE_OPERATOR_STAR;
149 extern RefCountPtr< const Lang::BinaryOperatorFunction > THE_OPERATOR_PROJECTION;
150 extern RefCountPtr< const Lang::BinaryOperatorFunction > THE_OPERATOR_SLASH;
151 extern RefCountPtr< const Lang::BinaryOperatorFunction > THE_OPERATOR_COMPOSE;
152 extern RefCountPtr< const Lang::UnaryOperatorFunction > THE_OPERATOR_NEG;
153 extern RefCountPtr< const Lang::BinaryOperatorFunction > THE_OPERATOR_LESS;
154 extern RefCountPtr< const Lang::BinaryOperatorFunction > THE_OPERATOR_GREATER;
155 extern RefCountPtr< const Lang::BinaryOperatorFunction > THE_OPERATOR_EQEQ;
156 extern RefCountPtr< const Lang::BinaryOperatorFunction > THE_OPERATOR_EQNEQ;
157 extern RefCountPtr< const Lang::BinaryOperatorFunction > THE_OPERATOR_LESSEQ;
158 extern RefCountPtr< const Lang::BinaryOperatorFunction > THE_OPERATOR_GREATEREQ;
159 extern RefCountPtr< const Lang::UnaryOperatorFunction > THE_OPERATOR_NOT;
160 extern RefCountPtr< const Lang::CoreFunction > THE_FUNCTION_AND;
161 extern RefCountPtr< const Lang::CoreFunction > THE_FUNCTION_OR;
162 extern RefCountPtr< const Lang::BinaryOperatorFunction > THE_OPERATOR_XOR;
164 extern RefCountPtr< const Lang::CoreFunction > THE_FUNCTION_ABS;
167 namespace Ast
170 extern ShapesScanner theShapesScanner;
171 extern Ast::Expression * theProgram;
172 extern std::list< Ast::Node * > * theInteractiveInput;
173 extern PtrOwner_back_Access< std::list< Ast::AnalysisEnvironment * > > theAnalysisEnvironmentList;
174 extern Ast::AnalysisEnvironment * theGlobalAnalysisEnvironment;
175 extern Ast::DummyExpression THE_CORE_DEFAULT_VALUE_EXPRESSION;
176 extern Ast::DummyExpression THE_INTERNAL_VALUE_EXPRESSION;
178 extern PtrOwner_back_Access< std::list< Exceptions::Exception * > > theAnalysisErrorsList;
180 extern RefCountPtr< const Lang::CoreFunction > THE_FUNCTION_coords2D;
181 extern RefCountPtr< const Lang::CoreFunction > THE_FUNCTION_cornercoords2D;
182 extern RefCountPtr< const Lang::CoreFunction > THE_FUNCTION_coords3D;
183 extern RefCountPtr< const Lang::CoreFunction > THE_FUNCTION_polarHandle2DFree_r;
184 extern RefCountPtr< const Lang::CoreFunction > THE_FUNCTION_polarHandle2DFree_ra;
185 extern RefCountPtr< const Lang::CoreFunction > THE_FUNCTION_TeX;