1 /*
  2     Copyright 2008-2022
  3         Matthias Ehmann,
  4         Michael Gerhaeuser,
  5         Carsten Miller,
  6         Bianca Valentin,
  7         Andreas Walter,
  8         Alfred Wassermann,
  9         Peter Wilfahrt
 10 
 11     This file is part of JSXGraph.
 12 
 13     JSXGraph is free software dual licensed under the GNU LGPL or MIT License.
 14 
 15     You can redistribute it and/or modify it under the terms of the
 16 
 17       * GNU Lesser General Public License as published by
 18         the Free Software Foundation, either version 3 of the License, or
 19         (at your option) any later version
 20       OR
 21       * MIT License: https://github.com/jsxgraph/jsxgraph/blob/master/LICENSE.MIT
 22 
 23     JSXGraph is distributed in the hope that it will be useful,
 24     but WITHOUT ANY WARRANTY; without even the implied warranty of
 25     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 26     GNU Lesser General Public License for more details.
 27 
 28     You should have received a copy of the GNU Lesser General Public License and
 29     the MIT License along with JSXGraph. If not, see <http://www.gnu.org/licenses/>
 30     and <http://opensource.org/licenses/MIT/>.
 31  */
 32 
 33 /*global JXG: true, define: true*/
 34 /*jslint nomen: true, plusplus: true*/
 35 
 36 /* depends:
 37  jxg
 38  */
 39 
 40 define(['jxg'], function (JXG) {
 41     'use strict';
 42 
 43     var major = 1,
 44         minor = 4,
 45         patch = 4,
 46         add = '', //'dev'
 47         version = major + '.' + minor + '.' + patch + (add ? '-' + add : ''),
 48         constants;
 49 
 50     constants = /** @lends JXG */ {
 51         /**
 52          * Constant: the currently used JSXGraph version.
 53          *
 54          * @name JXG.version
 55          * @type String
 56          */
 57         version: version,
 58 
 59         /**
 60          * Constant: the small gray version indicator in the top left corner of every JSXGraph board (if
 61          * showCopyright is not set to false on board creation).
 62          *
 63          * @name JXG.licenseText
 64          * @type String
 65          */
 66         licenseText: 'JSXGraph v' + version + ' Copyright (C) see https://jsxgraph.org',
 67 
 68         /**
 69          *  Constant: user coordinates relative to the coordinates system defined by the bounding box.
 70          *  @name JXG.COORDS_BY_USER
 71          *  @type Number
 72          */
 73         COORDS_BY_USER: 0x0001,
 74 
 75         /**
 76          *  Constant: screen coordinates in pixel relative to the upper left corner of the div element.
 77          *  @name JXG.COORDS_BY_SCREEN
 78          *  @type Number
 79          */
 80         COORDS_BY_SCREEN: 0x0002,
 81 
 82         // object types
 83         OBJECT_TYPE_ARC: 1,
 84         OBJECT_TYPE_ARROW: 2,
 85         OBJECT_TYPE_AXIS: 3,
 86         OBJECT_TYPE_AXISPOINT: 4,
 87         OBJECT_TYPE_TICKS: 5,
 88         OBJECT_TYPE_CIRCLE: 6,
 89         OBJECT_TYPE_CONIC: 7,
 90         OBJECT_TYPE_CURVE: 8,
 91         OBJECT_TYPE_GLIDER: 9,
 92         OBJECT_TYPE_IMAGE: 10,
 93         OBJECT_TYPE_LINE: 11,
 94         OBJECT_TYPE_POINT: 12,
 95         OBJECT_TYPE_SLIDER: 13,
 96         OBJECT_TYPE_CAS: 14,
 97         OBJECT_TYPE_GXTCAS: 15,
 98         OBJECT_TYPE_POLYGON: 16,
 99         OBJECT_TYPE_SECTOR: 17,
100         OBJECT_TYPE_TEXT: 18,
101         OBJECT_TYPE_ANGLE: 19,
102         OBJECT_TYPE_INTERSECTION: 20,
103         OBJECT_TYPE_TURTLE: 21,
104         OBJECT_TYPE_VECTOR: 22,
105         OBJECT_TYPE_OPROJECT: 23,
106         OBJECT_TYPE_GRID: 24,
107         OBJECT_TYPE_TANGENT: 25,
108         OBJECT_TYPE_HTMLSLIDER: 26,
109         OBJECT_TYPE_CHECKBOX: 27,
110         OBJECT_TYPE_INPUT: 28,
111         OBJECT_TYPE_BUTTON: 29,
112         OBJECT_TYPE_TRANSFORMATION: 30,
113         OBJECT_TYPE_FOREIGNOBJECT: 31,
114         OBJECT_TYPE_VIEW3D: 32,
115 
116         // IMPORTANT:
117         // ----------
118         // For being able to differentiate between the (sketchometry specific) SPECIAL_OBJECT_TYPEs and
119         // (core specific) OBJECT_TYPEs, the non-sketchometry types MUST NOT be changed
120         // to values > 100.
121 
122         // object classes
123         OBJECT_CLASS_POINT: 1,
124         OBJECT_CLASS_LINE: 2,
125         OBJECT_CLASS_CIRCLE: 3,
126         OBJECT_CLASS_CURVE: 4,
127         OBJECT_CLASS_AREA: 5,
128         OBJECT_CLASS_OTHER: 6,
129         OBJECT_CLASS_TEXT: 7,
130 
131         // SketchReader constants
132         GENTYPE_ABC: 1, // unused
133         GENTYPE_AXIS: 2,
134         GENTYPE_MID: 3,
135 
136         /**
137          * @ignore
138          * @deprecated, now use {@link JXG.GENTYPE_REFLECTION_ON_LINE}
139          *
140          */
141         GENTYPE_REFLECTION: 4,
142         /**
143          * @ignore
144          * @deprecated, now use {@link JXG.GENTYPE_REFLECTION_ON_POINT}
145          */
146         GENTYPE_MIRRORELEMENT: 5,
147 
148         GENTYPE_REFLECTION_ON_LINE: 4,
149         GENTYPE_REFLECTION_ON_POINT: 5,
150         GENTYPE_TANGENT: 6,
151         GENTYPE_PARALLEL: 7,
152         GENTYPE_BISECTORLINES: 8,
153         GENTYPE_BOARDIMG: 9,
154         GENTYPE_BISECTOR: 10,
155         GENTYPE_NORMAL: 11,
156         GENTYPE_POINT: 12,
157         GENTYPE_GLIDER: 13,
158         GENTYPE_INTERSECTION: 14,
159         GENTYPE_CIRCLE: 15,
160         /**
161          * @ignore @deprecated NOT USED ANY MORE SINCE SKETCHOMETRY 2.0 (only for old constructions needed)
162          */
163         GENTYPE_CIRCLE2POINTS: 16,
164 
165         GENTYPE_LINE: 17,
166         GENTYPE_TRIANGLE: 18,
167         GENTYPE_QUADRILATERAL: 19,
168         GENTYPE_TEXT: 20,
169         GENTYPE_POLYGON: 21,
170         GENTYPE_REGULARPOLYGON: 22,
171         GENTYPE_SECTOR: 23,
172         GENTYPE_ANGLE: 24,
173         GENTYPE_PLOT: 25,
174         GENTYPE_SLIDER: 26,
175         GENTYPE_TRUNCATE: 27,
176         GENTYPE_JCODE: 28,
177         GENTYPE_MOVEMENT: 29,
178         GENTYPE_COMBINED: 30,
179         GENTYPE_RULER: 31,
180         GENTYPE_SLOPETRIANGLE: 32,
181         GENTYPE_PERPSEGMENT: 33,
182         GENTYPE_LABELMOVEMENT: 34,
183         GENTYPE_VECTOR: 35,
184         GENTYPE_NONREFLEXANGLE: 36,
185         GENTYPE_REFLEXANGLE: 37,
186         GENTYPE_PATH: 38,
187         GENTYPE_DERIVATIVE: 39,
188         // 40 // unused ...
189         GENTYPE_DELETE: 41,
190         GENTYPE_COPY: 42,
191         GENTYPE_MIRROR: 43,
192         GENTYPE_ROTATE: 44,
193         GENTYPE_ABLATION: 45,
194         GENTYPE_MIGRATE: 46,
195         GENTYPE_VECTORCOPY: 47,
196         GENTYPE_POLYGONCOPY: 48,    /**
197         * Constants
198         * @name Constants
199         * @namespace
200         */
201 
202         //        GENTYPE_TRANSFORM: 48, // unused
203         // 49 ... 50 // unused ...
204 
205         // IMPORTANT:
206         // ----------
207         // For being able to differentiate between the (GUI-specific) CTX and
208         // (CORE-specific) non-CTX steps, the non-CTX steps MUST NOT be changed
209         // to values > 50.
210 
211         GENTYPE_CTX_TYPE_G: 51,
212         GENTYPE_CTX_TYPE_P: 52,
213         GENTYPE_CTX_TRACE: 53,
214         GENTYPE_CTX_VISIBILITY: 54,
215         GENTYPE_CTX_CCVISIBILITY: 55, // unused
216         GENTYPE_CTX_MPVISIBILITY: 56,
217         GENTYPE_CTX_WITHLABEL: 57,
218         GENTYPE_CTX_LABEL: 58,
219         GENTYPE_CTX_FIXED: 59,
220         GENTYPE_CTX_STROKEWIDTH: 60,
221         GENTYPE_CTX_LABELSIZE: 61,
222         GENTYPE_CTX_SIZE: 62,
223         GENTYPE_CTX_FACE: 63,
224         GENTYPE_CTX_STRAIGHT: 64,
225         GENTYPE_CTX_ARROW: 65,
226         GENTYPE_CTX_COLOR: 66,
227         GENTYPE_CTX_RADIUS: 67,
228         GENTYPE_CTX_COORDS: 68,
229         GENTYPE_CTX_TEXT: 69,
230         GENTYPE_CTX_ANGLERADIUS: 70,
231         GENTYPE_CTX_DOTVISIBILITY: 71,
232         GENTYPE_CTX_FILLOPACITY: 72,
233         GENTYPE_CTX_PLOT: 73,
234         GENTYPE_CTX_SCALE: 74,
235         GENTYPE_CTX_INTVAL: 75,
236         GENTYPE_CTX_POINT1: 76,
237         GENTYPE_CTX_POINT2: 77,
238         GENTYPE_CTX_LABELSTICKY: 78,
239         GENTYPE_CTX_TYPE_I: 79,
240         GENTYPE_CTX_HASINNERPOINTS: 80,
241         GENTYPE_CTX_SNAPWIDTH: 81,
242         GENTYPE_CTX_SNAPTOGRID: 82
243     };
244 
245     JXG.extendConstants(JXG, constants);
246 
247     return constants;
248 });
249