0023152: Possibility to have echo of DRAW commands in log file
[occt.git] / src / Draw / Draw_Interpretor.cdl
CommitLineData
b311480e 1-- Created on: 1995-02-23
2-- Created by: Remi LEQUETTE
3-- Copyright (c) 1995-1999 Matra Datavision
4-- Copyright (c) 1999-2012 OPEN CASCADE SAS
5--
6-- The content of this file is subject to the Open CASCADE Technology Public
7-- License Version 6.5 (the "License"). You may not use the content of this file
8-- except in compliance with the License. Please obtain a copy of the License
9-- at http://www.opencascade.org and read it completely before using this file.
10--
11-- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12-- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13--
14-- The Original Code and all software distributed under the License is
15-- distributed on an "AS IS" basis, without warranty of any kind, and the
16-- Initial Developer hereby disclaims all such warranties, including without
17-- limitation, any warranties of merchantability, fitness for a particular
18-- purpose or non-infringement. Please see the License for the specific terms
19-- and conditions governing the rights and limitations under the License.
20
7fd59977 21
22
23class Interpretor from Draw
24
25 ---Purpose: Provides an encapsulation of the TCL interpretor
26 -- to define Draw commands.
27
28uses
29
aa02980d 30 SStream from Standard,
7fd59977 31 PInterp from Draw,
32 CommandFunction from Draw,
33 AsciiString from TCollection,
34 ExtendedString from TCollection
35
36is
37
38 Create returns Interpretor from Draw;
39
40 Init(me : in out);
41
42 Add(me : in out; Command : CString;
43 Help : CString;
44 Function : CommandFunction from Draw;
45 Group : CString = "User Commands");
46 ---Purpose: Creates a new command with name <Command>, help
47 -- string <Help> in group <Group>.
48 -- <Function> implement the function.
49
50 Add(me : in out; Command : CString;
51 Help : CString;
52 FileName : CString ;
53 Function : CommandFunction from Draw;
54 Group : CString = "User Commands");
55 ---Purpose: Creates a new command with name <Command>, help
56 -- string <Help> in group <Group>. <Function>
57 -- implement the function.
58 -- <FileName> is the name of the file that contains
59 -- the implementation of the command
60 --
61
62 Remove(me : in out; Command : CString)
63 returns Boolean;
64 ---Purpose: Removes <Command>, returns true if success (the
65 -- command existed).
66
67 --
68 -- The result
69 --
70
71 Result(me) returns CString;
72
73 Reset(me : in out);
74 ---Purpose: Resets the result to empty string
75
76 Append(me : in out; Result : CString) returns Interpretor from Draw;
77 ---Purpose: Appends to the result
78 ---C++: return &
79 ---C++: alias operator<<
80
81 Append(me : in out; Result : AsciiString from TCollection)
82 returns Interpretor from Draw;
83 ---Purpose: Appends to the result
84 ---C++: return &
85 ---C++: alias operator<<
86
87 Append(me : in out; Result : ExtendedString from TCollection)
88 returns Interpretor from Draw;
89 ---Purpose: Appends to the result
90 ---C++: return &
91 ---C++: alias operator<<
92
93 Append(me : in out; Result : Integer) returns Interpretor from Draw;
94 ---Purpose: Appends to the result
95 ---C++: return &
96 ---C++: alias operator<<
97
98 Append(me : in out; Result : Real) returns Interpretor from Draw;
99 ---Purpose: Appends to the result
100 ---C++: return &
101 ---C++: alias operator<<
102
103 Append(me : in out; Result : SStream) returns Interpretor from Draw;
104 ---Purpose: Appends to the result
105 ---C++: return &
106 ---C++: alias operator<<
107
108 AppendElement(me : in out; Result : CString);
109 ---Purpose: Appends to the result the string as a list element
110
111
112
113 --
114 -- Interpetation
115 --
116
117 Eval(me : in out; Script : CString)
118 returns Integer;
119 ---Purpose: Eval the script and returns OK = 0, ERROR = 1
120
121 RecordAndEval(me : in out; Script : CString; Flags : Integer = 0)
122 returns Integer;
123 ---Purpose: Eval the script and returns OK = 0, ERROR = 1
124 -- Store the script in the history record.
125
126 EvalFile(me : in out; FileName : CString)
127 returns Integer;
128 ---Purpose: Eval the content on the file and returns status
129
130 Complete(myclass; Script : CString) returns Boolean;
131 ---Purpose: Returns True if the script is complete, no pending
132 -- closing braces. (})
133
134 Destroy(me : in out);
135 ---C++: alias ~
136
137 --
138 -- Access to Tcl_Interp
139 --
140
141 Create(anInterp : PInterp from Draw)
142 returns Interpretor from Draw;
143
144 Set(me : in out; anInterp : PInterp from Draw);
145
146 Interp (me) returns PInterp from Draw;
aa02980d 147
148 SetDoLog (me: in out; doLog: Boolean);
149 ---Purpose: Enables or disables logging of all commands and their
150 -- results
151 ---Level: Advanced
152
153 SetDoEcho (me: in out; doEcho: Boolean);
154 ---Purpose: Enables or disables eachoing of all commands and their
155 -- results to cout
156 ---Level: Advanced
157
158 GetDoLog (me) returns Boolean;
159 ---Purpose: Returns true if logging of commands is enabled
160 ---Level: Advanced
161
162 GetDoEcho (me) returns Boolean;
163 ---Purpose: Returns true if echoing of commands is enabled
164 ---Level: Advanced
165
166 Log (me: in out) returns SStream;
167 ---Purpose: Returns log stream
168 ---Level: Advanced
169 ---C++: return &
7fd59977 170
171 fields
172
173 isAllocated : Boolean from Standard;
174 myInterp : PInterp from Draw;
175
aa02980d 176 myDoLog: Boolean;
177 myDoEcho: Boolean;
178 myLog: SStream from Standard;
179
7fd59977 180end Interpretor;