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
19 #include "Shapes_Kernel_decls.h"
22 #include "shapesexceptions.h"
23 #include "classtypes.h"
24 #include "statetypes.h"
25 #include "fonttypes.h"
27 using namespace Shapes
;
29 RefCountPtr
< const char > Interaction::SEVERAL_TYPES
= strrefdup( "(several types)" );
30 RefCountPtr
< const char > Interaction::PUBLIC_SCOPE_NAME
= strrefdup( "public" );
31 RefCountPtr
< const char > Interaction::PROTECTED_SCOPE_NAME
= strrefdup( "protected" );
33 const char * Interaction::DYNAMIC_VARIABLE_PREFIX
= "@";
34 const char * Interaction::STATE_PREFIX
= "•";
36 RefCountPtr
< const char > Lang::ARCDELTA_ID
= strrefdup( "arcdelta" );
37 /* The initialization of Lang::TEX_SYNTAX_ID is placed in globals.cc to ensure it gets initialized before we need it there.
39 // RefCountPtr< const char > Lang::TEX_SYNTAX_ID = strrefdup( "teX" );
41 const char * Lang::CANVAS_ID
= "page";
42 const char * Lang::CATALOG_ID
= "catalog";
43 const char * Lang::SELF_ID
= "self";
44 const char * Kernel::SEQUENTIAL_EXPR_VAR_ID
= ".seqvar"; /* Note that the leading dot puts this variable aside all user-variables. */
45 const char * Kernel::SPLIT_VAR_PREFIX
= ".splvar"; /* Note that the leading dot puts this variable aside all user-variables. */
47 const char * Lang::DYNAMIC_VARIABLE_ID_EYEZ
= "eyez";
48 const char * Lang::DYNAMIC_VARIABLE_ID_TEX_BLEED
= "TeX_bleed";
49 const char * Lang::DYNAMIC_VARIABLE_ID_DEFAULT_UNIT
= "defaultunit";
50 const char * Lang::DYNAMIC_VARIABLE_ID_BLEND_SPACE
= "blendspace";
51 const char * Lang::DYNAMIC_VARIABLE_ID_STROKING
= "stroking";
52 const char * Lang::DYNAMIC_VARIABLE_ID_WIDTH
= "width";
53 const char * Lang::DYNAMIC_VARIABLE_ID_NONSTROKING
= "nonstroking";
54 const char * Lang::DYNAMIC_VARIABLE_ID_AUTOINTENSITY
= "autointensity";
56 const char * Lang::DYNAMIC_VARIABLE_ID_TEXT_SIZE
= "text_size";
57 const char * Lang::DYNAMIC_VARIABLE_ID_TEXT_FONT
= "text_font";
59 const char * Lang::CONTINUATION_ID_ERROR
= "error";
61 const Ast::MemberMode
Ast::MEMBER_ACCESS_BITS
= 0x000F;
62 const Ast::MemberMode
Ast::MEMBER_ACCESS_PRIVATE
= 0x0000;
63 const Ast::MemberMode
Ast::MEMBER_ACCESS_PUBLIC_GET
= 0x0001;
64 const Ast::MemberMode
Ast::MEMBER_ACCESS_PUBLIC_INSERT
= 0x0002;
65 const Ast::MemberMode
Ast::MEMBER_ACCESS_PROTECTED_GET
= 0x0004;
66 const Ast::MemberMode
Ast::MEMBER_ACCESS_PROTECTED_INSERT
= 0x0008;
67 const Ast::MemberMode
Ast::MEMBER_CONST
= 0x0010;
68 const Ast::MemberMode
Ast::MEMBER_METHOD
= 0x0020;
69 const Ast::MemberMode
Ast::MEMBER_ABSTRACT
= 0x0040;
70 const Ast::MemberMode
Ast::MEMBER_FINAL
= 0x0080;
71 const Ast::MemberMode
Ast::MEMBER_TRANSFORMING
= 0x0100;
73 const Ast::ClassMode
Ast::CLASS_MODE_ABSTRACT
= 0x0001;
74 const Ast::ClassMode
Ast::CLASS_MODE_FINAL
= 0x0002;
76 const Ast::FunctionMode
Ast::FUNCTION_TRANSFORMING
= 0x0001;
78 const char * Lang::MESSAGE_DRAWABLE_DRAW_ID
= "draw";
80 const char * Lang::HANDLER_NO_INTERSECTION
= "handler_NoIntersection";
82 const double Computation::SINGULAR_TRANSFORM_LIMIT
= 1e-8;
85 RefCountPtr
< const char > BuiltInFonts::TIMES_ROMAN
= strrefdup( "Times-Roman" );
86 RefCountPtr
< const char > BuiltInFonts::TIMES_BOLD
= strrefdup( "Times-Bold" );
87 RefCountPtr
< const char > BuiltInFonts::TIMES_ITALIC
= strrefdup( "Times-Italic" );
88 RefCountPtr
< const char > BuiltInFonts::TIMES_BOLDITALIC
= strrefdup( "Times-BoldItalic" );
89 // HELVETICA is initialized in globals.cc to ensure correct order of initialization.
90 RefCountPtr
< const char > BuiltInFonts::HELVETICA_BOLD
= strrefdup( "Helvetica-Bold" );
91 RefCountPtr
< const char > BuiltInFonts::HELVETICA_OBLIQUE
= strrefdup( "Helvetica-Oblique" );
92 RefCountPtr
< const char > BuiltInFonts::HELVETICA_BOLDOBLIQUE
= strrefdup( "Helvetica-BoldOblique" );
93 RefCountPtr
< const char > BuiltInFonts::COURIER
= strrefdup( "Courier" );
94 RefCountPtr
< const char > BuiltInFonts::COURIER_BOLD
= strrefdup( "Courier-Bold" );
95 RefCountPtr
< const char > BuiltInFonts::COURIER_OBLIQUE
= strrefdup( "Courier-Oblique" );
96 RefCountPtr
< const char > BuiltInFonts::COURIER_BOLDOBLIQUE
= strrefdup( "Courier-BoldOblique" );
97 RefCountPtr
< const char > BuiltInFonts::SYMBOL
= strrefdup( "Symbol" );
98 RefCountPtr
< const char > BuiltInFonts::ZAPFDINGBATS
= strrefdup( "ZapfDingbats" );
101 const size_t Computation::RREL_SIZE
= 33;
102 const double Computation::RREL_TH_STEP
= 0.1;
103 const double Computation::RREL_TABLE
[RREL_SIZE
] =
104 { 1/3,0.3341686344960354,0.33668841107954134,
105 0.3409422096583605,0.34701519474761894,
106 0.35502910405887494,0.36514854168289823,
107 0.3775911942845651,0.3926341399960872,
108 0.41062983298282885,0.43202211298939736,
109 0.45737337400783484,0.4873946524706331,
110 0.522992662410542,0.5653317708668038,
111 0.6159221561762755,0.6767424374123584,
112 0.7504184408114359,0.8404852622717847,
113 0.9517742868557572,1.0910034113732654,
114 1.267683405767762,1.4955440295942208,
115 1.7947857010553352,2.1956618428196286,
116 2.7440092614738933,3.5090279091817442,
117 4.590771723726686,6.112526284299868,8.144027798714662,
118 10.441038625842998,12.076454051457787,13};