VICI  0.11.815
Visual Chart Interpreter
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
vici.h
Go to the documentation of this file.
1 /*
2  * vici.h
3  *
4  * This header file is the public interface for the modules
5  * used by the VICI project.
6  *
7  * Copyright 2012 - 2018 Brenton Ross
8  *
9  * This file is part of VICI.
10  *
11  * VICI is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation, either version 3 of the License, or
14  * (at your option) any later version.
15  *
16  * VICI is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with VICI. If not, see <http://www.gnu.org/licenses/>.
23  *
24  * Dedicated to the memory of John Yelland, a life-long friend.
25  *
26  */
27 
33 #ifndef VICI_H
34 #define VICI_H
35 
50 #include <string>
51 #include <vector>
52 #include <map>
53 #include <memory>
54 #include <vici/vx.h>
55 #include <vici/stringy.h>
56 
57 // declare a set of functions that construct
58 // the factory for each module.
59 extern "C"
60 {
61 void * makeEBNFFactory();
62 void * makeSyntaxFactory();
63 void * makeAdminFactory();
64 void * makeSearchFactory();
65 void * makeCommandFactory();
66 void * makeSymbolFactory();
67 void * makeCanvasFactory();
68 void * makeSecureFactory();
69 void * makeCronFactory();
70 void * makeInstallerFactory();
71 void * makeInterpreterFactory();
72 void * makeEditorFactory();
73 void * makeViciFactory();
74 }
75 
76 namespace VICI
77 {
78 
80 typedef const std::string &csr;
81 
83 typedef int NodeId;
84 
86 typedef int ThreadId;
87 
89 typedef std::vector< std::string > ArgList;
90 
91 // -------------------------------------------------------
92 
94 
99 class Factory
100 {
101 public:
103  virtual ~Factory(){}
104 };
105 
107 typedef std::shared_ptr< Factory > FactoryPtr;
108 
109 // -------------------------------------------------------
110 
112 enum Module
113 {
114  EBNF_Module,
115  Syntax_Module,
116  Admin_Module,
117  Search_Module,
118  Command_Module,
119  Symbol_Module,
120  Canvas_Module,
121  Secure_Module,
122  Cron_Module,
123  Installer_Module,
124  Interpreter_Module,
125  Editor_Module,
126  Vici_Module
127 };
128 
129 
130 // -------------------------------------------------------
131 
133 
139 {
140 private:
141  FactoryFactory();
142  std::map< Module, FactoryPtr> factories;
143 public:
145  static FactoryFactory & instance();
146 
148 
152  template< class T >
153  void getFactory( Module nm, std::shared_ptr< T > &f )
154  {
155  auto F = factories.find(nm);
156  if ( F == factories.end() )
157  throw VX(Code) << "Could not find factory for " << nm;
158  f = std::dynamic_pointer_cast<T>(F->second);
159  if (f == nullptr)
160  throw VX(Code) << "Module refers to wrong type of factory";
161  }
162 
164 
171  void registerFactory( Module m, FactoryPtr f);
172 };
173 
174 // -------------------------------------------------------
175 
176 
178 
190 class Window
191 {
192 public:
193  virtual ~Window() {}
194 };
195 
197 
205 class Scene
206 {
207 public:
208  virtual ~Scene() {}
209 };
210 
211 // -------------------------------------------------------
212 
214 namespace EBNF
215 {
216 
218 
227 {
228 public:
229  virtual ~ParseTree(){}
230 };
231 
233 
243 class EBNF
244 {
245 public:
246  virtual ~EBNF(){}
247 
249 
252  virtual bool validate( csr s ) = 0;
253 
255 
260  virtual void getError( int & line, int & column, std::string & text ) = 0;
261 
263 
266  virtual ParseTree * parse( csr s ) = 0;
267 };
268 
270 
279 {
280 public:
281  virtual ~EBNF_Factory() {}
282 
284 
287  virtual EBNF * makeEBNF() = 0;
288 };
289 
291 typedef std::shared_ptr< EBNF_Factory > EBNF_FactoryPtr;
292 
293 } // end EBNF namespace
294 
295 // -------------------------------------------------------
296 
298 namespace Syntax
299 {
300 
302 
313 class Syntax
314 {
315 public:
316  virtual ~Syntax() {}
317 
319 
322  virtual void show( csr s ) = 0;
323 
324 };
325 
327 
337 {
338 public:
339  virtual ~SyntaxFactory() {}
340 
342 
347  virtual Syntax * makeSyntax( Window *w, EBNF::EBNF * ebnf) = 0;
348 };
349 
351 typedef std::shared_ptr< SyntaxFactory > SyntaxFactoryPtr;
352 
353 }
354 // -------------------------------------------------------
355 
357 namespace Admin
358 {
359 
361 
371 {
372 public:
373  virtual ~ViciAdmin() {}
374  virtual VICI::Window * getMainWindow() = 0;
375 };
376 
378 
387 {
388 public:
389  virtual ~ViciAdminFactory() {}
390 
392 
395  virtual ViciAdmin * makeViciAdmin() = 0;
396 };
397 
399 typedef std::shared_ptr< ViciAdminFactory > ViciAdminFactoryPtr;
400 
401 }
402 // -------------------------------------------------------
403 
405 namespace Search
406 {
407 
409 
418 {
419 public:
420  virtual ~SearchClient() {}
421 
423 
427  virtual void selectedCommand( NodeId n, csr c ) = 0;
428 };
429 
431 
441 class Search
442 {
443 public:
444  virtual ~Search() {}
445 
446  virtual void show() = 0;
447 
448  virtual void setNode( NodeId ) = 0;
449 };
450 
452 
461 {
462 public:
463  virtual ~SearchFactory() {}
464 
466 
472  virtual Search * makeSearch( Window *w, SearchClient *sc ) = 0;
473 };
474 
476 typedef std::shared_ptr< SearchFactory > SearchFactoryPtr;
477 
478 }
479 // -------------------------------------------------------
480 
481 namespace Sec
482 {
483 class Secure;
484 }
485 
487 namespace Interp
488 {
489 
491 
502 {
503 public:
504  virtual ~InterpreterClient() {}
505 
507 
511  virtual void setValue( csr varName, csr value ) = 0;
512 
514 
518  virtual void setFile( int state, csr filename ) = 0;
519 
521 
525  virtual void setCursor( ThreadId tid, NodeId node) = 0;
526 
528 
532  virtual void breakReached( ThreadId tid, NodeId node) = 0;
533 
535 
538  virtual void dataReady( NodeId node) = 0;
539 
541 
545  virtual void reportError( Severity sev, csr msg ) = 0;
546 
548  virtual void done() = 0;
549 };
550 
552 
562 {
563 public:
564  static const NodeId OutDisplay = -1;
565  static const NodeId ErrDisplay = -2;
566 
567  virtual ~Interpreter() {}
568 
569  virtual void addClient( InterpreterClient * ) = 0;
570 
571  virtual void setScript( csr filename ) = 0;
572 
573  virtual void setArgs( VICI::ArgList args) = 0;
574 
576 
582  virtual void debugMode( bool mode ) = 0;
583 
585 
593  virtual int openDisplay( NodeId node ) = 0;
594 
596 
599  virtual void dataAck(NodeId node) = 0;
600 
602 
606  virtual void setValue( csr varName, csr value ) = 0;
607 
609 
613  virtual void setPosn( ThreadId tid, NodeId node) = 0;
614 
616 
620  virtual void setBreak( NodeId node, bool set ) = 0;
621 
623 
626  virtual void setInterval( double secs ) = 0;
627 
629 
632  virtual void saveSnapshot( csr filename ) = 0;
633 
635 
638  virtual void loadSnapshot( csr filename ) = 0;
639 
641  virtual void run() = 0;
642 
644 
647  virtual void run( csr functionName ) = 0;
648 
650  virtual void pause() = 0;
651 
652  // single step a thread of the script
656  virtual void step( ThreadId tid ) = 0;
657 
659  virtual void resume() = 0;
660 
662  virtual void kill() = 0;
663 
665  virtual int result() = 0;
666 };
667 
669 
679 {
680 public:
681  virtual ~InterpreterFactory() {}
682 
684 
687  virtual Interpreter * makeInterpreter( Sec::Secure *sec ) = 0;
688 };
689 
691 typedef std::shared_ptr< InterpreterFactory > InterpreterFactoryPtr;
692 
693 }
694 
695 // -------------------------------------------------------
696 
698 
699 namespace Symbol
700 {
701 
703 typedef long Colour;
704 
706 
716 {
717 public:
720 
723  std::string fillPattern;
724  std::string linePattern;
725 };
726 
728 enum Style {
741 
746 
754 };
755 
757 
765 {
766 public:
769 
770  std::string fontName;
771  float fontSize;
772 };
773 
775 
783 {
784 public:
785  virtual ~SymbolOwner() {}
786  virtual void selected() = 0;
787  virtual void opened() = 0;
788 
793  virtual void dragged( double x, double y ) = 0;
794 };
795 
797 
804 class Symbol
805 {
806 public:
807  virtual ~Symbol() {}
808 
810 
813  virtual Symbol *clone( SymbolOwner * owner) = 0;
814 
816 
822  virtual void setAttributes( SymbolAttributes & att ) = 0;
823 
825 
828  virtual bool isCommand() = 0;
829 
831 
837  virtual void draw( Scene *scene, double x, double y, double scale ) = 0;
838 
840 
847  virtual void attachCommand( const ArgList & args ) = 0;
848 
850 
853  virtual void setNodeId( NodeId nid) = 0;
854 
856 
859  virtual Style getStyle() = 0;
860 
862 
865  virtual void setHighlight(bool x) = 0;
866 };
867 
869 
878 {
879 public:
880  virtual ~SymbolClient() {}
881 
883 
887  virtual void selection( Symbol *sym ) = 0;
888 
890 
893  virtual void symbolAttr( SymbolAttributes & att) = 0;
894 
896 
899  virtual void textAttr( TextAttributes & att) = 0;
900 };
901 
903 
911 {
912 public:
913  virtual ~SymbolMgr() {}
914 
916 
919  virtual void addClient( SymbolClient * client ) = 0;
920 
922 
926  virtual SymbolAttributes getDefaultAttr(Style s) = 0;
927 
929 
932  virtual TextAttributes getDefaultTextAttr() = 0;
933 
935 
940  virtual Symbol * getSymbol(Style style, SymbolOwner *owner) = 0;
941 };
942 
944 
954 {
955 public:
956  virtual ~SymbolFactory() {}
957 
959 
963  virtual SymbolMgr * makeSymbolMgr( Window *w ) = 0;
964 };
965 
967 typedef std::shared_ptr< SymbolFactory > SymbolFactoryPtr;
968 
969 } // end Symbol namespace
970 
971 // -------------------------------------------------------
972 
974 namespace Canvas
975 {
976 
978 
986 {
987 public:
988  virtual ~CanvasClient() {}
989 
991 
994  virtual void newSymbol( Symbol::Symbol *sym ) = 0;
995 
997  virtual void newChart() = 0;
998 
1000  virtual void changedChart() = 0;
1001 
1003  virtual void searchAction( NodeId ) = 0;
1004 
1006  virtual void commandAction( NodeId, const ArgList & ) = 0;
1007 
1009  virtual void breakAction( NodeId, bool set ) = 0;
1010 };
1011 
1013 
1021 {
1022 public:
1023  virtual ~Canvas() {}
1024 
1025  // menu actions
1027 
1030  virtual void load( csr filename ) = 0;
1031 
1033 
1036  virtual void save( csr filename ) = 0;
1037 
1039 
1044  virtual void setExecution( bool active, csr node ) = 0;
1045 
1047 
1051  virtual void setCommand( NodeId nid, const ArgList & args) = 0;
1052 
1053  // symbol interface
1055 
1058  virtual void selection(Symbol::Symbol * sym) = 0;
1059 
1061 
1065  virtual void symbolAttr(Symbol::SymbolAttributes & att) = 0;
1066 
1068 
1071  virtual void textAttr(Symbol::TextAttributes & att) = 0;
1072 
1074  virtual ArgList getNames() = 0;
1075 };
1076 
1078 
1087 {
1088 public:
1089  virtual ~CanvasFactory() {}
1090 
1092 
1094 };
1095 
1097 typedef std::shared_ptr< CanvasFactory > CanvasFactoryPtr;
1098 
1099 } // end namespace
1100 
1101 // -------------------------------------------------------
1102 
1104 namespace Cmnd
1105 {
1106 
1108 
1116 {
1117 public:
1118  virtual ~CommandClient() {}
1119 
1121 
1125  virtual void optionsAndParameters( NodeId nid, const ArgList & args) = 0;
1126 
1128 
1131  virtual void cmndError( csr msg ) = 0;
1132 };
1133 
1135 
1143 {
1144 public:
1145  virtual ~Command() {}
1146 
1148  virtual void show() = 0;
1149 
1151 
1155  virtual void setCommand( NodeId nid, const ArgList & args ) = 0;
1156 
1157  // SymbolClient Interface
1158 
1160 
1163  virtual void selection( Symbol::Symbol *sym ) = 0;
1164 
1166  virtual void symbolAttr( Symbol::SymbolAttributes & ) = 0;
1167 
1169  virtual void textAttr( Symbol::TextAttributes & ) = 0;
1170 };
1171 
1173 
1182 {
1183 public:
1184  virtual ~CommandFactory() {}
1185 
1187 
1188  virtual Command * makeCommand( Window *, CommandClient *, Canvas::Canvas * ) = 0;
1189 };
1190 
1192 typedef std::shared_ptr< CommandFactory > CommandFactoryPtr;
1193 
1194 } // end namespace
1195 
1196 // -------------------------------------------------------
1197 
1199 namespace Sec
1200 {
1201 
1203 
1215 class Secure
1216 {
1217 public:
1218  virtual ~Secure() {}
1219 
1221 
1225  virtual bool verifySignature( csr filename ) = 0;
1226 
1228 
1231  virtual void addSignature(csr filename ) = 0;
1232 };
1233 
1235 
1245 {
1246 public:
1247  virtual ~SecureFactory() {}
1248 
1250 
1253  virtual Secure * makeSecure() = 0;
1254 };
1255 
1257 typedef std::shared_ptr< SecureFactory > SecureFactoryPtr;
1258 
1259 } // end namespace
1260 
1261 // -------------------------------------------------------
1262 
1264 namespace Cron
1265 {
1266 
1268 
1276 class Cron
1277 {
1278 public:
1279  virtual ~Cron() {}
1280 
1282 
1285  virtual void setCurrentFile( csr filename ) = 0;
1286 
1288  virtual void show() = 0;
1289 };
1290 
1292 
1302 {
1303 public:
1304  virtual ~CronFactory() {}
1305 
1307 
1311  virtual Cron * makeCron( Window *w) = 0;
1312 };
1313 
1315 typedef std::shared_ptr< CronFactory > CronFactoryPtr;
1316 
1317 } // end namespace
1318 
1319 // -------------------------------------------------------
1320 
1322 namespace Inst
1323 {
1324 
1326 
1337 {
1338 public:
1339  virtual ~Installer() {}
1340 
1342 
1345  virtual void setCurrentFile( csr filename ) = 0;
1346 
1348  virtual void show() = 0;
1349 };
1350 
1352 
1362 {
1363 public:
1364  virtual ~InstallerFactory() {}
1365 
1367 
1371  virtual Installer * makeInstaller( Window *w ) = 0;
1372 };
1373 
1375 typedef std::shared_ptr< InstallerFactory > InstallerFactoryPtr;
1376 
1377 }
1378 
1379 // -------------------------------------------------------
1380 
1382 namespace Ed
1383 {
1384 
1386 
1398 {
1399 public:
1400  virtual ~ViciEditor() {}
1401  virtual VICI::Window * getMainWindow() = 0;
1402  virtual void openFile( const VICI::Path & ) = 0;
1403 };
1404 
1406 
1416 {
1417 public:
1418  virtual ~ViciEditorFactory() {}
1419 
1421 
1422  virtual ViciEditor * makeViciEditor() = 0;
1423 };
1424 
1426 typedef std::shared_ptr< ViciEditorFactory > ViciEditorFactoryPtr;
1427 
1428 }
1429 
1430 // -------------------------------------------------------
1431 
1433 
1434 
1445 {
1446 public:
1447  virtual ~Vici() {}
1448 
1450  virtual Interp::Interpreter * getInterpreter() = 0;
1451 
1453  virtual void openFile( const Path & ) = 0;
1454 
1456  virtual void autoStart() = 0;
1457 };
1458 
1460 
1470 {
1471 public:
1472  virtual ~ViciFactory() {}
1473 
1475 
1476  virtual Vici * makeVici( Window *w = nullptr ) = 0;
1477 };
1478 
1480 typedef std::shared_ptr< ViciFactory > ViciFactoryPtr;
1481 
1482 // -------------------------------------------------------
1483 
1484 
1485 } // end of namespace VICI
1486 #endif /* VICI_H_ */
An API for the vici runtime gui.
Definition: vici.h:1444
standard input stream
Definition: vici.h:751
virtual void setAttributes(SymbolAttributes &att)=0
change the attributes of the symbol
A parser for EBNF.
Definition: vici.h:243
virtual ParseTree * parse(csr s)=0
parse the EBNF
Severity
Severity levels for log messages.
Definition: vx.h:48
virtual void setValue(csr varName, csr value)=0
this is called when a variable has its value changed by the user
An abstract factory for making an instance of Command.
Definition: vici.h:1181
virtual int result()=0
get the exit code
signal a semaphore
Definition: vici.h:745
An abstract factory for making an instance of Vici.
Definition: vici.h:1469
virtual void addSignature(csr filename)=0
sign this file with the user&#39;s key
standard error stream
Definition: vici.h:753
virtual ~ViciEditor()
virtual destructor
Definition: vici.h:1400
diamond for a command
Definition: vici.h:730
virtual void dataReady(NodeId node)=0
this gets called when data is available on a display
virtual ~Secure()
virtual destructor
Definition: vici.h:1218
virtual void show(csr s)=0
display the syntax chart for the supplied ebnf
void getFactory(Module nm, std::shared_ptr< T > &f)
Get a factory of the specified type.
Definition: vici.h:153
Install a script into the user&#39;s desktop.
Definition: vici.h:1336
An abstract factory for making an instance of Interpreter.
Definition: vici.h:678
std::shared_ptr< ViciFactory > ViciFactoryPtr
Shared pointer for Vici Factory.
Definition: vici.h:1480
SymbolAttributes()
constructor
Definition: vici.h:719
std::string linePattern
the pattern for the lines
Definition: vici.h:724
The interface that must be implemented by clients of the interpreter.
Definition: vici.h:501
virtual void save(csr filename)=0
save the chart
virtual ViciEditor * makeViciEditor()=0
create an instance of the ViciEditor class
virtual ~SecureFactory()
virtual destructor
Definition: vici.h:1247
std::shared_ptr< EBNF_Factory > EBNF_FactoryPtr
Shared pointer for EBNF_Factory.
Definition: vici.h:291
virtual void opened()=0
virtual ~Canvas()
virtual destructor
Definition: vici.h:1023
virtual void pause()=0
pause the script
virtual SymbolAttributes getDefaultAttr(Style s)=0
get the attributes for a symbol of the given style
virtual ~Scene()
virtual destructor
Definition: vici.h:208
A wrapper class for windows.
Definition: vici.h:190
virtual Cron * makeCron(Window *w)=0
create an instance of the Cron class
void registerFactory(Module m, FactoryPtr f)
Register a factory.
Definition: factory.cpp:115
void * makeViciFactory()
create a new Vici Factory
TextAttributes()
constructor
Definition: vici.h:768
virtual ~ViciFactory()
virtual destructor
Definition: vici.h:1472
virtual ~InterpreterFactory()
virtual destructor
Definition: vici.h:681
virtual void optionsAndParameters(NodeId nid, const ArgList &args)=0
this gets called when the user presses OK
int NodeId
Type for identifying a node of the flowchart.
Definition: vici.h:83
virtual Installer * makeInstaller(Window *w)=0
create an instance of the Installer class
virtual void openFile(const Path &)=0
Set the file to execute.
float fontSize
the size of the font
Definition: vici.h:771
void * makeAdminFactory()
create a new Admin Factory
std::shared_ptr< CronFactory > CronFactoryPtr
Shared pointer for Cron Factory.
Definition: vici.h:1315
virtual VICI::Window * getMainWindow()=0
Get a pointer to the main window.
virtual ArgList getNames()=0
get a list of names of variables etc for use in command options
virtual void addClient(InterpreterClient *)=0
add a client for notifications
Provide security for the scripts.
Definition: vici.h:1215
virtual ~SymbolFactory()
virtual destructor
Definition: vici.h:956
A programming error has been detected.
Definition: vx.h:53
virtual ~SyntaxFactory()
virtual destructor
Definition: vici.h:339
virtual Interpreter * makeInterpreter(Sec::Secure *sec)=0
create an instance of the Interpreter class
virtual void selected()=0
the object has become selected
static const NodeId OutDisplay
the node id of the default output display
Definition: vici.h:564
virtual void setCurrentFile(csr filename)=0
Set the file to schedule.
constant
Definition: vici.h:734
Represents something that is notified about events occurring on a symbol.
Definition: vici.h:782
virtual void loadSnapshot(csr filename)=0
restore a snapshot file
virtual ~InstallerFactory()
virtual destructor
Definition: vici.h:1364
void * makeSymbolFactory()
create a new Symbol Factory
Allow the user to search for, and organise commands.
Definition: vici.h:441
virtual SymbolMgr * makeSymbolMgr(Window *w)=0
create an instance of the SymbolMgr class
virtual ~EBNF()
virtual destructor
Definition: vici.h:246
An interface that is notified of a command selection.
Definition: vici.h:1115
virtual void setFile(int state, csr filename)=0
this gets called when a monitored file changes state.
static FactoryFactory & instance()
Get a reference to the singleton object.
Definition: factory.cpp:106
virtual void setInterval(double secs)=0
set the time interval between executing commands
virtual ~Symbol()
virtual destructor
Definition: vici.h:807
virtual void step(ThreadId tid)=0
virtual ~CanvasFactory()
virtual destructor
Definition: vici.h:1089
virtual void selection(Symbol::Symbol *sym)=0
notification that a symbol has been selected
virtual void breakReached(ThreadId tid, NodeId node)=0
this gets called when a break point is reached
An abstract factory for making an instance of ViciEditor.
Definition: vici.h:1415
virtual void setCursor(ThreadId tid, NodeId node)=0
this gets called as the shell steps through the script
semaphore variable
Definition: vici.h:736
std::shared_ptr< SyntaxFactory > SyntaxFactoryPtr
Shared pointer for SyntaxFactory.
Definition: vici.h:351
virtual ~ViciAdminFactory()
virtual destructor
Definition: vici.h:389
The interface that must implemented for clients of Search.
Definition: vici.h:417
entry point for a function
Definition: vici.h:732
virtual ~SymbolMgr()
virtual destructor
Definition: vici.h:913
std::shared_ptr< CanvasFactory > CanvasFactoryPtr
Shared pointer for Canvas Factory.
Definition: vici.h:1097
void * makeCanvasFactory()
create a new Canvas Factory
virtual void cmndError(csr msg)=0
this gets called if there is an error
execution flow for a failure result
Definition: vici.h:749
An abstract factory for making an instance of Cron.
Definition: vici.h:1301
std::shared_ptr< SearchFactory > SearchFactoryPtr
Shared pointer for Search Factory.
Definition: vici.h:476
Colour lineColour
the colour for lines
Definition: vici.h:721
Colour fillColour
the colour to fill the symbol
Definition: vici.h:722
virtual void show()=0
Display the window.
virtual ~SearchFactory()
virtual destructor
Definition: vici.h:463
Module
An enum that lists the main modules of VICI.
Definition: vici.h:112
virtual void newSymbol(Symbol::Symbol *sym)=0
called when a symbol is placed on the canvas.
An abstract factory for making an instance of ViciAdmin.
Definition: vici.h:386
virtual EBNF * makeEBNF()=0
the factory for EBNF objects
virtual void changedChart()=0
called when the chart is first changed
virtual ~Cron()
virtual destructor
Definition: vici.h:1279
std::shared_ptr< CommandFactory > CommandFactoryPtr
Shared pointer for Command Factory.
Definition: vici.h:1192
virtual VICI::Window * getMainWindow()=0
Get a pointer to the app main window.
void * makeEditorFactory()
create a new Editor Factory
box for a command
Definition: vici.h:729
virtual TextAttributes getDefaultTextAttr()=0
get the current default text attributes
A type for the parsed form of EBNF.
Definition: vici.h:226
virtual int openDisplay(NodeId node)=0
open a Display object for reading
virtual void show()=0
Display the window.
virtual void getError(int &line, int &column, std::string &text)=0
get location and details of parsing error
variable
Definition: vici.h:733
virtual void setNodeId(NodeId nid)=0
Set the node id for the object.
virtual bool isCommand()=0
check if the symbol represents a command object
virtual void setScript(csr filename)=0
the XML VICI script to execute
virtual void textAttr(TextAttributes &att)=0
notify that the default text attributes have changed
long Colour
Specialisation for holding colour values.
Definition: vici.h:703
virtual void setNode(NodeId)=0
set the identity of the current node
An abstract factory for making an instance of Canvas.
Definition: vici.h:1086
Manipulate path strings.
Definition: stringy.h:74
int ThreadId
type for identifying a thread in the running script
Definition: vici.h:86
virtual void saveSnapshot(csr filename)=0
save a snapshot file
virtual ~SymbolClient()
virtual destructor
Definition: vici.h:880
virtual ~CommandFactory()
virtual destructor
Definition: vici.h:1184
void * makeSyntaxFactory()
create a new Syntax Factory
function call
Definition: vici.h:731
A wrapper for QGraphicsScene class.
Definition: vici.h:205
Allow scripts to be scheduled for later running.
Definition: vici.h:1276
Display a syntax chart of command options.
Definition: vici.h:313
Hold the attributes of a text comment.
Definition: vici.h:764
output display
Definition: vici.h:740
virtual Style getStyle()=0
get the style for the symbol
execution flow for a success result
Definition: vici.h:748
Represents something that is drawn on the canvas.
Definition: vici.h:804
virtual ~CronFactory()
virtual destructor
Definition: vici.h:1304
virtual Vici * makeVici(Window *w=nullptr)=0
create an instance of the Vici class
virtual void openFile(const VICI::Path &)=0
Tell the editor which file to start with.
virtual void run()=0
start running the script
An abstract factory for making an instance of SymbolMgr.
Definition: vici.h:953
virtual ~Vici()
virtual destructor
Definition: vici.h:1447
virtual ~ParseTree()
virtual destructor
Definition: vici.h:229
void * makeInstallerFactory()
create a new Installer Factory
static const NodeId ErrDisplay
the node id of the default error display
Definition: vici.h:565
std::vector< std::string > ArgList
Type for a list of command arguments and options.
Definition: vici.h:89
virtual Search * makeSearch(Window *w, SearchClient *sc)=0
create an instance of the Search class
std::shared_ptr< Factory > FactoryPtr
Shared pointer for factory.
Definition: vici.h:107
virtual void done()=0
this gets called when the script completes
std::shared_ptr< SecureFactory > SecureFactoryPtr
Shared pointer for Secure Factory.
Definition: vici.h:1257
virtual ~Installer()
virtual destructor
Definition: vici.h:1339
An abstract factory for making an instance of Syntax.
Definition: vici.h:336
virtual void symbolAttr(Symbol::SymbolAttributes &)=0
unused by this library
virtual void symbolAttr(SymbolAttributes &att)=0
notify that the default symbol attributes have changed
send a signal
Definition: vici.h:750
virtual void show()=0
make the search window visible
virtual ~Syntax()
virtual destructor
Definition: vici.h:316
virtual ~Search()
virtual destructor
Definition: vici.h:444
An abstract factory for making an instance of Installer.
Definition: vici.h:1361
virtual Command * makeCommand(Window *, CommandClient *, Canvas::Canvas *)=0
create an instance of the Command class
virtual void attachCommand(const ArgList &args)=0
Associate the symbol with a command.
virtual void setExecution(bool active, csr node)=0
display of executing script
An interface that is notified of canvas actions.
Definition: vici.h:985
An interface that is notified of changes to symbol manager.
Definition: vici.h:877
virtual void reportError(Severity sev, csr msg)=0
This gets called if an error is detected.
virtual ~SearchClient()
virtual destructor
Definition: vici.h:420
virtual void textAttr(Symbol::TextAttributes &att)=0
notification of new text attributes
virtual void selectedCommand(NodeId n, csr c)=0
this function is called when the user selects a command.
Holds the attributes of a symbol.
Definition: vici.h:715
virtual bool validate(csr s)=0
confirm that an EBNF is valid
virtual void setArgs(VICI::ArgList args)=0
set the program options
Style
The possible styles for symbols and lines.
Definition: vici.h:728
virtual ~Command()
virtual destructor
Definition: vici.h:1145
virtual void newChart()=0
called when a new diagram has been started
virtual bool verifySignature(csr filename)=0
check to ensure we are allowed to open this file
virtual void autoStart()=0
Start the script as soon as the GUI is ready.
virtual void breakAction(NodeId, bool set)=0
notification that a breakpoint has been set or cleared
virtual void symbolAttr(Symbol::SymbolAttributes &att)=0
notification that the default symbol attributes have changed
virtual void setCommand(NodeId nid, const ArgList &args)=0
assigning a command to the current symbol
An abstract type for factories.
Definition: vici.h:99
Application for preparing commands.
Definition: vici.h:370
std::shared_ptr< InstallerFactory > InstallerFactoryPtr
Shared pointer for Installer Factory.
Definition: vici.h:1375
virtual Syntax * makeSyntax(Window *w, EBNF::EBNF *ebnf)=0
Create an instance of Syntax.
named pipe
Definition: vici.h:739
The facade for the symbol library.
Definition: vici.h:910
virtual void dataAck(NodeId node)=0
call this after responding to InterpreterClient::dataReady() to wait for the next set of data...
virtual void selection(Symbol *sym)=0
notify that a symbol has been selected.
The API for interpreter library.
Definition: vici.h:561
virtual ~CanvasClient()
virtual destructor
Definition: vici.h:988
virtual void debugMode(bool mode)=0
enable debug mode
virtual ~Interpreter()
virtual destructor
Definition: vici.h:567
The facade for the command library.
Definition: vici.h:1142
flow of execution
Definition: vici.h:747
virtual void show()=0
display the command entry window
virtual void setPosn(ThreadId tid, NodeId node)=0
call this to set the point where execution resumes
standard output stream
Definition: vici.h:752
virtual void setCurrentFile(csr filename)=0
Set the script to install.
const std::string & csr
short cut for string constants
Definition: vici.h:80
void * makeCronFactory()
create a new Cron Factory
wait for a semaphore
Definition: vici.h:744
virtual ~ViciAdmin()
virtual destructor
Definition: vici.h:373
mutex variable
Definition: vici.h:735
virtual ~ViciEditorFactory()
virtual destructor
Definition: vici.h:1418
void * makeInterpreterFactory()
create a new Interpreter Factory
virtual Interp::Interpreter * getInterpreter()=0
Get a reference to the interpreter object.
virtual ~EBNF_Factory()
virtual destructor
Definition: vici.h:281
virtual void textAttr(Symbol::TextAttributes &)=0
unused by this library
virtual Canvas * makeCanvas(Window *, Symbol::SymbolMgr *, Interp::Interpreter *, CanvasClient *)=0
create an instance of the Canvas class
file
Definition: vici.h:737
An abstract factory for making an instance of EBNF.
Definition: vici.h:278
virtual void load(csr filename)=0
restore the chart from the specified XML file.
virtual Secure * makeSecure()=0
create an instance of the Secure class
virtual Symbol * clone(SymbolOwner *owner)=0
construct a copy of the symbol
virtual void draw(Scene *scene, double x, double y, double scale)=0
display the object
void * makeEBNFFactory()
create a new EBNF Factory
virtual ~Factory()
Destructor.
Definition: vici.h:103
virtual ~CommandClient()
virtual destructor
Definition: vici.h:1118
An abstract factory for making an instance of Search.
Definition: vici.h:460
An abstract factory for making an instance of Secure.
Definition: vici.h:1244
void * makeCommandFactory()
create a new Command Factory
The flowchart editor.
Definition: vici.h:1396
virtual ViciAdmin * makeViciAdmin()=0
Create an instance of the ViciAdmin class.
virtual ~Window()
virtual destructor
Definition: vici.h:193
void * makeSecureFactory()
create a new Secure Factory
virtual void resume()=0
resume a paused script
virtual void setBreak(NodeId node, bool set)=0
call this to mark a node as a break point
std::string fontName
the name of the font face
Definition: vici.h:770
std::shared_ptr< ViciEditorFactory > ViciEditorFactoryPtr
Shared pointer for Editor Factory.
Definition: vici.h:1426
std::shared_ptr< SymbolFactory > SymbolFactoryPtr
Shared pointer for Symbol Factory.
Definition: vici.h:967
virtual void kill()=0
stop the script
virtual void setCommand(NodeId nid, const ArgList &args)=0
set the initial value of the command
virtual ~SymbolOwner()
virtual destructor
Definition: vici.h:785
virtual void setValue(csr varName, csr value)=0
this gets called when a script variable has a change of value
lock a mutex
Definition: vici.h:742
virtual void selection(Symbol::Symbol *sym)=0
notification of new current symbol
inline file
Definition: vici.h:738
virtual Symbol * getSymbol(Style style, SymbolOwner *owner)=0
get a new symbol of the specified style
#define VX(x)
Macro to include file name and line number in exception messages.
Definition: vx.h:210
virtual ~InterpreterClient()
virtual destructor
Definition: vici.h:504
virtual void addClient(SymbolClient *client)=0
add a client for the symbol manager
virtual void searchAction(NodeId)=0
notification that the user wants the search tab
std::shared_ptr< ViciAdminFactory > ViciAdminFactoryPtr
Shared pointer for Admin Factory.
Definition: vici.h:399
std::shared_ptr< InterpreterFactory > InterpreterFactoryPtr
Shared pointer for Interpreter Factory.
Definition: vici.h:691
The facade for canvas library.
Definition: vici.h:1020
virtual void setHighlight(bool x)=0
show the symbol as selected
Responsible for creating and supplying factories for the main modules.
Definition: vici.h:138
unlock a mutex
Definition: vici.h:743
std::string fillPattern
the pattern to fill the symbol
Definition: vici.h:723
void * makeSearchFactory()
create a new Search Factory
virtual void commandAction(NodeId, const ArgList &)=0
notification that the command tab is to be displayed
virtual void dragged(double x, double y)=0
the object was moved