00001 #ifndef __DESCRIPTION__
00002 #define __DESCRIPTION__
00003
00004
00005
00006
00007
00008 #include <string>
00009 #include <list>
00010 #include <set>
00011 #include <map>
00012 #include <string>
00013 #include "signals.hh"
00014 #include "smartpointer.hh"
00015 #include "tlib.hh"
00016 #include "uitree.hh"
00017
00018 using namespace std;
00019
00020 class Description
00021 {
00022 string fName;
00023 string fAuthor;
00024 string fCopyright;
00025 string fLicense;
00026 string fVersion;
00027
00028 int fInputs;
00029 int fOutputs;
00030 int fWidgetID;
00031 int fActiveWidgetCount;
00032 int fPassiveWidgetCount;
00033 list<string> fActiveLines;
00034 list<string> fPassiveLines;
00035 list<string> fLayoutLines;
00036 list<int> fLayoutTabs;
00037
00038
00039 public:
00040
00041 Description(): fName("Unknow"),
00042 fAuthor("Unknow"),
00043 fCopyright("Unknow"),
00044 fLicense("Unknow"),
00045 fVersion("Unknow"),
00046
00047 fInputs(0),
00048 fOutputs(0),
00049 fWidgetID(0),
00050 fActiveWidgetCount(0),
00051 fPassiveWidgetCount(0)
00052 {}
00053
00054 Description* name(const string& s) { fName = s; return this; }
00055 Description* author(const string& s) { fAuthor = s; return this; }
00056 Description* copyright(const string& s) { fCopyright = s; return this; }
00057 Description* license(const string& s) { fLicense = s; return this; }
00058 Description* version(const string& s) { fVersion = s; return this; }
00059
00060 Description* inputs(int n) { fInputs = n; return this; }
00061 Description* outputs(int n) { fOutputs = n; return this; }
00062
00063 void ui(Tree t);
00064 void print(int n, ostream& fout);
00065
00066
00067 private:
00068 void addGroup(int level, Tree t);
00069 int addWidget(Tree label, Tree varname, Tree sig);
00070
00071 void tab (int n, ostream& fout);
00072 void addActiveLine(const string& l) { fActiveLines.push_back(l);}
00073 void addPassiveLine(const string& l) { fPassiveLines.push_back(l);}
00074 void addLayoutLine(int n, const string& l) { fLayoutTabs.push_back(n); fLayoutLines.push_back(l);}
00075
00076
00077 };
00078
00079 #endif