annotate Applications/Samples/StoneSampleCommands_generated.ts @ 928:1b49e78d91d0

fix for older compilers
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 23 Jul 2019 11:50:21 +0200
parents 4eccf698e52f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
653
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
1 /*
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
2 1 2 3 4 5 6 7
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
3 12345678901234567890123456789012345678901234567890123456789012345678901234567890
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
4
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
5 Generated on 2019-03-18 12:07:42.696093 by stonegentool
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
6
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
7 */
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
8
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
9 function StoneCheckSerializedValueType(value: any, typeStr: string)
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
10 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
11 StoneCheckSerializedValueTypeGeneric(value);
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
12
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
13 if (value['type'] != typeStr)
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
14 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
15 throw new Error(
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
16 `Cannot deserialize type ${value['type']} into ${typeStr}`);
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
17 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
18 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
19
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
20 function isString(val: any) :boolean
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
21 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
22 return ((typeof val === 'string') || (val instanceof String));
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
23 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
24
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
25 function StoneCheckSerializedValueTypeGeneric(value: any)
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
26 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
27 // console.//log("+-------------------------------------------------+");
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
28 // console.//log("| StoneCheckSerializedValueTypeGeneric |");
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
29 // console.//log("+-------------------------------------------------+");
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
30 // console.//log("value = ");
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
31 // console.//log(value);
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
32 if ( (!('type' in value)) || (!isString(value.type)) )
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
33 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
34 throw new Error(
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
35 "Cannot deserialize value ('type' key invalid)");
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
36 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
37 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
38
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
39 // end of generic methods
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
40
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
41 export enum Tool {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
42 LineMeasure = "LineMeasure",
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
43 CircleMeasure = "CircleMeasure",
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
44 Crop = "Crop",
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
45 Windowing = "Windowing",
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
46 Zoom = "Zoom",
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
47 Pan = "Pan",
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
48 Move = "Move",
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
49 Rotate = "Rotate",
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
50 Resize = "Resize",
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
51 Mask = "Mask"
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
52 };
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
53
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
54 export function Tool_FromString(strValue:string) : Tool
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
55 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
56 if( strValue == "LineMeasure" )
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
57 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
58 return Tool.LineMeasure;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
59 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
60 if( strValue == "CircleMeasure" )
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
61 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
62 return Tool.CircleMeasure;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
63 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
64 if( strValue == "Crop" )
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
65 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
66 return Tool.Crop;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
67 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
68 if( strValue == "Windowing" )
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
69 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
70 return Tool.Windowing;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
71 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
72 if( strValue == "Zoom" )
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
73 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
74 return Tool.Zoom;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
75 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
76 if( strValue == "Pan" )
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
77 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
78 return Tool.Pan;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
79 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
80 if( strValue == "Move" )
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
81 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
82 return Tool.Move;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
83 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
84 if( strValue == "Rotate" )
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
85 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
86 return Tool.Rotate;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
87 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
88 if( strValue == "Resize" )
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
89 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
90 return Tool.Resize;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
91 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
92 if( strValue == "Mask" )
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
93 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
94 return Tool.Mask;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
95 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
96
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
97 let msg : string = `String ${strValue} cannot be converted to Tool. Possible values are: LineMeasure, CircleMeasure, Crop, Windowing, Zoom, Pan, Move, Rotate, Resize, Mask`;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
98 throw new Error(msg);
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
99 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
100
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
101 export function Tool_ToString(value:Tool) : string
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
102 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
103 if( value == Tool.LineMeasure )
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
104 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
105 return "LineMeasure";
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
106 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
107 if( value == Tool.CircleMeasure )
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
108 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
109 return "CircleMeasure";
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
110 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
111 if( value == Tool.Crop )
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
112 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
113 return "Crop";
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
114 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
115 if( value == Tool.Windowing )
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
116 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
117 return "Windowing";
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
118 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
119 if( value == Tool.Zoom )
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
120 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
121 return "Zoom";
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
122 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
123 if( value == Tool.Pan )
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
124 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
125 return "Pan";
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
126 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
127 if( value == Tool.Move )
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
128 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
129 return "Move";
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
130 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
131 if( value == Tool.Rotate )
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
132 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
133 return "Rotate";
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
134 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
135 if( value == Tool.Resize )
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
136 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
137 return "Resize";
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
138 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
139 if( value == Tool.Mask )
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
140 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
141 return "Mask";
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
142 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
143
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
144 let msg : string = `Value ${value} cannot be converted to Tool. Possible values are: `;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
145 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
146 let _LineMeasure_enumValue : string = Tool.LineMeasure; // enums are strings in stonecodegen, so this will work.
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
147 let msg_LineMeasure : string = `LineMeasure (${_LineMeasure_enumValue}), `;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
148 msg = msg + msg_LineMeasure;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
149 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
150 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
151 let _CircleMeasure_enumValue : string = Tool.CircleMeasure; // enums are strings in stonecodegen, so this will work.
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
152 let msg_CircleMeasure : string = `CircleMeasure (${_CircleMeasure_enumValue}), `;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
153 msg = msg + msg_CircleMeasure;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
154 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
155 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
156 let _Crop_enumValue : string = Tool.Crop; // enums are strings in stonecodegen, so this will work.
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
157 let msg_Crop : string = `Crop (${_Crop_enumValue}), `;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
158 msg = msg + msg_Crop;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
159 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
160 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
161 let _Windowing_enumValue : string = Tool.Windowing; // enums are strings in stonecodegen, so this will work.
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
162 let msg_Windowing : string = `Windowing (${_Windowing_enumValue}), `;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
163 msg = msg + msg_Windowing;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
164 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
165 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
166 let _Zoom_enumValue : string = Tool.Zoom; // enums are strings in stonecodegen, so this will work.
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
167 let msg_Zoom : string = `Zoom (${_Zoom_enumValue}), `;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
168 msg = msg + msg_Zoom;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
169 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
170 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
171 let _Pan_enumValue : string = Tool.Pan; // enums are strings in stonecodegen, so this will work.
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
172 let msg_Pan : string = `Pan (${_Pan_enumValue}), `;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
173 msg = msg + msg_Pan;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
174 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
175 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
176 let _Move_enumValue : string = Tool.Move; // enums are strings in stonecodegen, so this will work.
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
177 let msg_Move : string = `Move (${_Move_enumValue}), `;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
178 msg = msg + msg_Move;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
179 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
180 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
181 let _Rotate_enumValue : string = Tool.Rotate; // enums are strings in stonecodegen, so this will work.
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
182 let msg_Rotate : string = `Rotate (${_Rotate_enumValue}), `;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
183 msg = msg + msg_Rotate;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
184 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
185 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
186 let _Resize_enumValue : string = Tool.Resize; // enums are strings in stonecodegen, so this will work.
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
187 let msg_Resize : string = `Resize (${_Resize_enumValue}), `;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
188 msg = msg + msg_Resize;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
189 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
190 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
191 let _Mask_enumValue : string = Tool.Mask; // enums are strings in stonecodegen, so this will work.
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
192 let msg_Mask : string = `Mask (${_Mask_enumValue})`;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
193 msg = msg + msg_Mask;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
194 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
195 throw new Error(msg);
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
196 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
197
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
198 export enum ActionType {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
199 UndoCrop = "UndoCrop",
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
200 Rotate = "Rotate",
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
201 Invert = "Invert"
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
202 };
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
203
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
204 export function ActionType_FromString(strValue:string) : ActionType
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
205 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
206 if( strValue == "UndoCrop" )
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
207 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
208 return ActionType.UndoCrop;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
209 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
210 if( strValue == "Rotate" )
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
211 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
212 return ActionType.Rotate;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
213 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
214 if( strValue == "Invert" )
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
215 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
216 return ActionType.Invert;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
217 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
218
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
219 let msg : string = `String ${strValue} cannot be converted to ActionType. Possible values are: UndoCrop, Rotate, Invert`;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
220 throw new Error(msg);
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
221 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
222
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
223 export function ActionType_ToString(value:ActionType) : string
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
224 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
225 if( value == ActionType.UndoCrop )
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
226 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
227 return "UndoCrop";
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
228 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
229 if( value == ActionType.Rotate )
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
230 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
231 return "Rotate";
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
232 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
233 if( value == ActionType.Invert )
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
234 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
235 return "Invert";
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
236 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
237
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
238 let msg : string = `Value ${value} cannot be converted to ActionType. Possible values are: `;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
239 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
240 let _UndoCrop_enumValue : string = ActionType.UndoCrop; // enums are strings in stonecodegen, so this will work.
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
241 let msg_UndoCrop : string = `UndoCrop (${_UndoCrop_enumValue}), `;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
242 msg = msg + msg_UndoCrop;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
243 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
244 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
245 let _Rotate_enumValue : string = ActionType.Rotate; // enums are strings in stonecodegen, so this will work.
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
246 let msg_Rotate : string = `Rotate (${_Rotate_enumValue}), `;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
247 msg = msg + msg_Rotate;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
248 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
249 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
250 let _Invert_enumValue : string = ActionType.Invert; // enums are strings in stonecodegen, so this will work.
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
251 let msg_Invert : string = `Invert (${_Invert_enumValue})`;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
252 msg = msg + msg_Invert;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
253 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
254 throw new Error(msg);
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
255 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
256
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
257
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
258
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
259 export class SelectTool {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
260 tool:Tool;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
261
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
262 constructor() {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
263 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
264
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
265 public StoneSerialize(): string {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
266 let container: object = {};
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
267 container['type'] = 'StoneSampleCommands.SelectTool';
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
268 container['value'] = this;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
269 return JSON.stringify(container);
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
270 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
271
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
272 public static StoneDeserialize(valueStr: string) : SelectTool
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
273 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
274 let value: any = JSON.parse(valueStr);
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
275 StoneCheckSerializedValueType(value, 'StoneSampleCommands.SelectTool');
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
276 let result: SelectTool = value['value'] as SelectTool;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
277 return result;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
278 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
279 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
280 export class Action {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
281 type:ActionType;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
282
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
283 constructor() {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
284 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
285
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
286 public StoneSerialize(): string {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
287 let container: object = {};
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
288 container['type'] = 'StoneSampleCommands.Action';
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
289 container['value'] = this;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
290 return JSON.stringify(container);
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
291 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
292
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
293 public static StoneDeserialize(valueStr: string) : Action
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
294 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
295 let value: any = JSON.parse(valueStr);
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
296 StoneCheckSerializedValueType(value, 'StoneSampleCommands.Action');
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
297 let result: Action = value['value'] as Action;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
298 return result;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
299 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
300 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
301
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
302 export interface IHandler {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
303 };
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
304
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
305 /** Service function for StoneDispatchToHandler */
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
306 export function StoneDispatchJsonToHandler(
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
307 jsonValue: any, handler: IHandler): boolean
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
308 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
309 StoneCheckSerializedValueTypeGeneric(jsonValue);
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
310 let type: string = jsonValue["type"];
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
311 if (type == "")
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
312 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
313 // this should never ever happen
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
314 throw new Error("Caught empty type while dispatching");
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
315 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
316 else
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
317 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
318 return false;
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
319 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
320 }
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
321
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
322 /** Takes a serialized type and passes this to the handler */
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
323 export function StoneDispatchToHandler(
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
324 strValue: string, handler: IHandler): boolean
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
325 {
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
326 // console.//log("+------------------------------------------------+");
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
327 // console.//log("| StoneDispatchToHandler |");
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
328 // console.//log("+------------------------------------------------+");
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
329 // console.//log("strValue = ");
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
330 // console.//log(strValue);
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
331 let jsonValue: any = JSON.parse(strValue)
4eccf698e52f Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 535
diff changeset
332 return StoneDispatchJsonToHandler(jsonValue, handler);
527
b1377625e4ba Removed ICommand and friends + fixed warnings + added missing header files in
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
333 }