tilde~
Puredata Qt-based GUI
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FileParser.h
Go to the documentation of this file.
1 // (c) 2017 Alex Nadzharov
2 // License: GPL3
3 
4 #ifndef CM_FILEPARSER_H
5 #define CM_FILEPARSER_H
6 
7 #include <string>
8 #include <vector>
9 
10 // todo non-static class ?
11 
12 using namespace std;
13 
14 class QStringList;
15 class QString;
16 
17 namespace tilde {
18 class PatchWindow;
19 class CanvasData;
20 class CanvasView;
21 class UIObject;
22 
23 class ApplicationController;
24 class PatchWindowController;
25 
27  vector<PatchWindowController*> _stack;
28 
29 public:
30  void push(PatchWindowController* c) { _stack.push_back(c); };
32  {
33  PatchWindowController* ret = last();
34  _stack.pop_back();
35  return ret;
36  };
38  {
39  if (_stack.size() == 0)
40  return 0;
41  return _stack.at(_stack.size() - 1);
42  }
43  void clear() { _stack.clear(); }
44 };
45 
49 class FileParser {
50 private:
51  FileParser(){};
52 
53  static PatchWindowControllerStack _stack;
54  static PatchWindowController* _pdParserWindowController;
55  static PatchWindowController* _pdParserFirstWindowController;
56 
57  static ApplicationController* _appController;
58 
59 public:
60  static string pdParserFileName;
61  static string legacyCanvasCoords;
62 
63  static void setAppController(ApplicationController* appController);
64  static void setParserWindowController(PatchWindowController* wnd);
65  static void setParserWindowControllers(PatchWindowController* wnd, PatchWindowController*, PatchWindowController* first);
66 
70  static PatchWindowController* parserFirstWindowController();
71  static PatchWindowController* parserWindowController();
72 
73  static void open(QString fname);
74  static void parseQString(QString line);
75  static void parseStringListAtoms(PatchWindowController* controller, QStringList list);
76 
77  static UIObject* sendStringToCanvas(PatchWindowController* controller, QStringList list);
78  static bool legacyProcess(PatchWindowController* controller, QStringList list);
79 };
80 }
81 
82 #endif // CM_FILEPARSER_H
static string pdParserFileName
Definition: FileParser.h:60
void clear()
Definition: FileParser.h:43
The Application Controller class.
Definition: ApplicationController.h:44
Definition: FileParser.h:26
static string legacyCanvasCoords
Definition: FileParser.h:61
The Patch window controller.
Definition: PatchWindowController.h:48
PatchWindowController * last()
Definition: FileParser.h:37
Parses pd files on 'client' (GUI) side.
Definition: FileParser.h:49
Definition: UIObject.h:44
void push(PatchWindowController *c)
Definition: FileParser.h:30
PatchWindowController * pop()
Definition: FileParser.h:31