1 /*
  2     Copyright 2008-2013
  3         Matthias Ehmann,
  4         Michael Gerhaeuser,
  5         Carsten Miller,
  6         Bianca Valentin,
  7         Alfred Wassermann,
  8         Peter Wilfahrt
  9 
 10     This file is part of JSXGraph.
 11 
 12     JSXGraph is free software dual licensed under the GNU LGPL or MIT License.
 13 
 14     You can redistribute it and/or modify it under the terms of the
 15 
 16       * GNU Lesser General Public License as published by
 17         the Free Software Foundation, either version 3 of the License, or
 18         (at your option) any later version
 19       OR
 20       * MIT License: https://github.com/jsxgraph/jsxgraph/blob/master/LICENSE.MIT
 21 
 22     JSXGraph is distributed in the hope that it will be useful,
 23     but WITHOUT ANY WARRANTY; without even the implied warranty of
 24     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 25     GNU Lesser General Public License for more details.
 26 
 27     You should have received a copy of the GNU Lesser General Public License and
 28     the MIT License along with JSXGraph. If not, see <http://www.gnu.org/licenses/>
 29     and <http://opensource.org/licenses/MIT/>.
 30  */
 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 
 42     "use strict";
 43 
 44     var major = 0,
 45         minor = 98,
 46         patch = 0,
 47         add = '',
 48         version = major + '.' + minor + '.' + patch + (add ? '-' + add : ''),
 49         constants;
 50 
 51     constants = /** @lends JXG */ {
 52         // copyright, version, ...
 53 
 54         /**
 55          * Represents the currently used JSXGraph version.
 56          * @type {String}
 57          */
 58         version: version,
 59 
 60         /**
 61          * The small gray version indicator in the top left corner of every JSXGraph board (if
 62          * showCopyright is not set to false on board creation).
 63          * @type String
 64          */
 65         licenseText: 'JSXGraph v' + version + ' Copyright (C) see http://jsxgraph.org',
 66 
 67         // coords
 68         COORDS_BY_USER: 0x0001,
 69         COORDS_BY_SCREEN: 0x0002,
 70 
 71         // object types
 72         OBJECT_TYPE_ARC: 1,
 73         OBJECT_TYPE_ARROW: 2,
 74         OBJECT_TYPE_AXIS: 3,
 75         OBJECT_TYPE_AXISPOINT: 4,
 76         OBJECT_TYPE_TICKS: 5,
 77         OBJECT_TYPE_CIRCLE: 6,
 78         OBJECT_TYPE_CONIC: 7,
 79         OBJECT_TYPE_CURVE: 8,
 80         OBJECT_TYPE_GLIDER: 9,
 81         OBJECT_TYPE_IMAGE: 10,
 82         OBJECT_TYPE_LINE: 11,
 83         OBJECT_TYPE_POINT: 12,
 84         OBJECT_TYPE_SLIDER: 13,
 85         OBJECT_TYPE_CAS: 14,
 86         OBJECT_TYPE_GXTCAS: 15,
 87         OBJECT_TYPE_POLYGON: 16,
 88         OBJECT_TYPE_SECTOR: 17,
 89         OBJECT_TYPE_TEXT: 18,
 90         OBJECT_TYPE_ANGLE: 19,
 91         OBJECT_TYPE_INTERSECTION: 20,
 92         OBJECT_TYPE_TURTLE: 21,
 93         OBJECT_TYPE_VECTOR: 22,
 94         OBJECT_TYPE_OPROJECT: 23,
 95         OBJECT_TYPE_GRID: 24,
 96         OBJECT_TYPE_TANGENT: 25,
 97 
 98         // object classes
 99         OBJECT_CLASS_POINT: 1,
100         OBJECT_CLASS_LINE: 2,
101         OBJECT_CLASS_CIRCLE: 3,
102         OBJECT_CLASS_CURVE: 4,
103         OBJECT_CLASS_AREA: 5,
104         OBJECT_CLASS_OTHER: 6,
105 
106         // SketchReader constants
107         GENTYPE_ABC: 1, // unused
108         GENTYPE_AXIS: 2,
109         GENTYPE_MID: 3,
110         GENTYPE_REFLECTION: 4,
111         GENTYPE_MIRRORPOINT: 5,
112         GENTYPE_TANGENT: 6,
113         GENTYPE_PARALLEL: 7,
114         GENTYPE_BISECTORLINES: 8,
115         GENTYPE_BOARDIMG: 9,
116         GENTYPE_BISECTOR: 10,
117         GENTYPE_NORMAL: 11,
118         GENTYPE_POINT: 12,
119         GENTYPE_GLIDER: 13,
120         GENTYPE_INTERSECTION: 14,
121         GENTYPE_CIRCLE: 15,
122         GENTYPE_CIRCLE2POINTS: 16,
123         GENTYPE_LINE: 17,
124         GENTYPE_TRIANGLE: 18,
125         GENTYPE_QUADRILATERAL: 19,
126         GENTYPE_TEXT: 20,
127         GENTYPE_POLYGON: 21,
128         GENTYPE_REGULARPOLYGON: 22,
129         GENTYPE_SECTOR: 23,
130         GENTYPE_ANGLE: 24,
131         GENTYPE_PLOT: 25,
132         GENTYPE_SLIDER: 26,
133         GENTYPE_TRUNCATE: 27,
134         GENTYPE_JCODE: 28,
135         GENTYPE_MOVEMENT: 29,
136         GENTYPE_COMBINED: 30,
137         GENTYPE_RULER: 31,
138         GENTYPE_SLOPETRIANGLE: 32,
139         GENTYPE_PERPSEGMENT: 33,
140         // 34 ... 39 // unused ...
141         GENTYPE_DELETE: 41,
142         GENTYPE_COPY: 42,
143         GENTYPE_MIRROR: 43,
144         GENTYPE_ROTATE: 44,
145         GENTYPE_ABLATION: 45,
146         GENTYPE_MIGRATE: 46,
147 //        GENTYPE_TRANSFORM: 47, // unused
148         // 48 ... 50 // unused ...
149 
150         // IMPORTANT:
151         // ----------
152         // For being able to differentiate between the (GUI-specific) CTX and
153         // (CORE-specific) non-CTX steps, the non-CTX steps MUST NOT be changed
154         // to values > 50.
155 
156         GENTYPE_CTX_TYPE_G: 51,
157         GENTYPE_CTX_TYPE_P: 52,
158         GENTYPE_CTX_TRACE: 53,
159         GENTYPE_CTX_VISIBILITY: 54,
160         GENTYPE_CTX_CCVISIBILITY: 55, // unused
161         GENTYPE_CTX_MPVISIBILITY: 56,
162         GENTYPE_CTX_WITHLABEL: 57,
163         GENTYPE_CTX_LABEL: 58,
164         GENTYPE_CTX_FIXED: 59,
165         GENTYPE_CTX_STROKEWIDTH: 60,
166         GENTYPE_CTX_LABELSIZE: 61,
167         GENTYPE_CTX_SIZE: 62,
168         GENTYPE_CTX_FACE: 63,
169         GENTYPE_CTX_STRAIGHT: 64,
170         GENTYPE_CTX_ARROW: 65,
171         GENTYPE_CTX_COLOR: 66,
172         GENTYPE_CTX_RADIUS: 67,
173         GENTYPE_CTX_COORDS: 68,
174         GENTYPE_CTX_TEXT: 69,
175         GENTYPE_CTX_ANGLERADIUS: 70,
176         GENTYPE_CTX_DOTVISIBILITY: 71,
177         GENTYPE_CTX_FILLOPACITY: 72,
178         GENTYPE_CTX_PLOT: 73,
179         GENTYPE_CTX_SCALE: 74,
180         GENTYPE_CTX_INTVAL: 75,
181         GENTYPE_CTX_POINT1: 76,
182         GENTYPE_CTX_POINT2: 77,
183         GENTYPE_CTX_LABELSTICKY: 78
184     };
185 
186     JXG.extend(JXG, constants);
187 
188     return constants;
189 });
190