00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __DS_Creator__
00021 #define __DS_Creator__
00022
00023 #include "PRM_API.h"
00024 #include <iostream.h>
00025 #include <UT/UT_String.h>
00026 #include <UT/UT_StringArray.h>
00027 #include "DS_ParmReader.h"
00028
00029 class DS_SelectorBinding;
00030
00031 #define DS_DEFNAME "DScreator"
00032 #define DS_DEFDIR "."
00033
00034 class PRM_API DS_Creator
00035 {
00036 public:
00037 DS_Creator( DS_ParmReader &pr,
00038 const char *appName = DS_DEFNAME );
00039 virtual ~DS_Creator();
00040
00041 int openOutput( ostream &os );
00042 int closeOutput();
00043
00044 int prepareToWriteOutput();
00045 int writeOutput();
00046
00047 static void setUseOldGrouping(bool useold);
00048 static bool getUseOldGrouping();
00049
00050
00051
00052
00053
00054
00055 static const char * getIndent(int level);
00056
00057 static const char *theToolboxLabels[];
00058
00059
00060
00061 static const int OP_MAX_INPUT_LABELS = 4;
00062
00063 static void dumpParm(const DS_ParmInfo *pi)
00064 { printParm(cerr, pi); }
00065
00066 protected:
00067 void writeUnboundSelectors(DS_SelectorList &selectors);
00068 void writeReservedSelectors(DS_SelectorList &selectors);
00069 void writeReservedHandles(DS_HandleList &handles);
00070 void writeBoundHandles(DS_HandleList &handles);
00071 void writeMetaInfo();
00072 virtual void writeContextSpecific();
00073 virtual int writeInfo();
00074 virtual void writeHeader(const char *appname, const char *script);
00075 virtual void writeTrailer(const char *appname, const char *script);
00076
00077 static void startGroup(ostream &os, int &id, const char *name);
00078 static void printParm(ostream &os, const DS_ParmInfo *pi);
00079
00080 static void printHelp( ostream &os, const char *help );
00081 static void printInfo( ostream &os, const char *info );
00082
00083 DS_ParmReader &myPR;
00084 UT_String myAppName;
00085 ostream *myOS;
00086
00087 static UT_StringArray theGroupStack;
00088 static bool theUseOldGrouping;
00089 };
00090
00091 #endif