0024591: Modification of tests in group "sewing"
[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
973c2be1 4-- Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5--
973c2be1 6-- This file is part of Open CASCADE Technology software library.
b311480e 7--
973c2be1 8-- This library is free software; you can redistribute it and / or modify it
9-- under the terms of the GNU Lesser General Public version 2.1 as published
10-- by the Free Software Foundation, with special exception defined in the file
11-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12-- distribution for complete text of the license and disclaimer of any warranty.
b311480e 13--
973c2be1 14-- Alternatively, this file may be used under the terms of Open CASCADE
15-- commercial license or contractual agreement.
7fd59977 16
17class Interpretor from Draw
18
19 ---Purpose: Provides an encapsulation of the TCL interpretor
20 -- to define Draw commands.
21
22uses
23
aa02980d 24 SStream from Standard,
7fd59977 25 PInterp from Draw,
26 CommandFunction from Draw,
27 AsciiString from TCollection,
28 ExtendedString from TCollection
29
30is
31
32 Create returns Interpretor from Draw;
33
34 Init(me : in out);
35
36 Add(me : in out; Command : CString;
37 Help : CString;
38 Function : CommandFunction from Draw;
39 Group : CString = "User Commands");
40 ---Purpose: Creates a new command with name <Command>, help
41 -- string <Help> in group <Group>.
42 -- <Function> implement the function.
43
44 Add(me : in out; Command : CString;
45 Help : CString;
46 FileName : CString ;
47 Function : CommandFunction from Draw;
48 Group : CString = "User Commands");
49 ---Purpose: Creates a new command with name <Command>, help
50 -- string <Help> in group <Group>. <Function>
51 -- implement the function.
52 -- <FileName> is the name of the file that contains
53 -- the implementation of the command
54 --
55
56 Remove(me : in out; Command : CString)
57 returns Boolean;
58 ---Purpose: Removes <Command>, returns true if success (the
59 -- command existed).
60
61 --
62 -- The result
63 --
64
65 Result(me) returns CString;
66
67 Reset(me : in out);
68 ---Purpose: Resets the result to empty string
69
70 Append(me : in out; Result : CString) returns Interpretor from Draw;
71 ---Purpose: Appends to the result
72 ---C++: return &
73 ---C++: alias operator<<
74
75 Append(me : in out; Result : AsciiString from TCollection)
76 returns Interpretor from Draw;
77 ---Purpose: Appends to the result
78 ---C++: return &
79 ---C++: alias operator<<
80
81 Append(me : in out; Result : ExtendedString 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 : Integer) returns Interpretor from Draw;
88 ---Purpose: Appends to the result
89 ---C++: return &
90 ---C++: alias operator<<
91
92 Append(me : in out; Result : Real) returns Interpretor from Draw;
93 ---Purpose: Appends to the result
94 ---C++: return &
95 ---C++: alias operator<<
96
97 Append(me : in out; Result : SStream) returns Interpretor from Draw;
98 ---Purpose: Appends to the result
99 ---C++: return &
100 ---C++: alias operator<<
101
102 AppendElement(me : in out; Result : CString);
103 ---Purpose: Appends to the result the string as a list element
104
105
106
107 --
108 -- Interpetation
109 --
110
111 Eval(me : in out; Script : CString)
112 returns Integer;
113 ---Purpose: Eval the script and returns OK = 0, ERROR = 1
114
115 RecordAndEval(me : in out; Script : CString; Flags : Integer = 0)
116 returns Integer;
117 ---Purpose: Eval the script and returns OK = 0, ERROR = 1
118 -- Store the script in the history record.
119
120 EvalFile(me : in out; FileName : CString)
121 returns Integer;
122 ---Purpose: Eval the content on the file and returns status
123
124 Complete(myclass; Script : CString) returns Boolean;
125 ---Purpose: Returns True if the script is complete, no pending
126 -- closing braces. (})
127
128 Destroy(me : in out);
129 ---C++: alias ~
130
131 --
132 -- Access to Tcl_Interp
133 --
134
135 Create(anInterp : PInterp from Draw)
136 returns Interpretor from Draw;
137
138 Set(me : in out; anInterp : PInterp from Draw);
139
140 Interp (me) returns PInterp from Draw;
aa02980d 141
142 SetDoLog (me: in out; doLog: Boolean);
143 ---Purpose: Enables or disables logging of all commands and their
144 -- results
145 ---Level: Advanced
146
147 SetDoEcho (me: in out; doEcho: Boolean);
148 ---Purpose: Enables or disables eachoing of all commands and their
149 -- results to cout
150 ---Level: Advanced
151
152 GetDoLog (me) returns Boolean;
153 ---Purpose: Returns true if logging of commands is enabled
154 ---Level: Advanced
155
156 GetDoEcho (me) returns Boolean;
157 ---Purpose: Returns true if echoing of commands is enabled
158 ---Level: Advanced
159
160 Log (me: in out) returns SStream;
161 ---Purpose: Returns log stream
162 ---Level: Advanced
163 ---C++: return &
7fd59977 164
165 fields
166
167 isAllocated : Boolean from Standard;
168 myInterp : PInterp from Draw;
169
aa02980d 170 myDoLog: Boolean;
171 myDoEcho: Boolean;
172 myLog: SStream from Standard;
173
7fd59977 174end Interpretor;