rvcparms.h

Go to the documentation of this file.
00001 /**
00002  * \file rvcparms.h <mi32/rvcparms.h>
00003  * \brief 
00004  *
00005  * Functions for saving/loading structures in the style of dispwsl.c, but
00006  * much simpler.  Currently used for OTYPE_DBPARM.  Objects of this type are
00007  * based on OTYPE_TEXT with no changes to the structure.
00008  *
00009  * \if NODOC
00010  * $Id: rvcparms.h_v 1.21 2004/03/31 16:09:42 dwilliss Exp $
00011  *
00012  * $Log: rvcparms.h_v $
00013  * Revision 1.21  2004/03/31 16:09:42  dwilliss
00014  * Added MISTRING support
00015  *
00016  * Revision 1.20  2004/03/24 22:48:28  mju
00017  * Merge mistruct stuff here as not wanted elsewhere.
00018  *
00019  * Revision 1.19  2004/03/10 22:38:51  mju
00020  * Remove one more legacy dialog.
00021  *
00022  * Revision 1.18  2004/03/10 22:37:56  mju
00023  * Remove legacy object selection dialog inlines.
00024  *
00025  * Revision 1.17  2003/10/15 17:39:23  mju
00026  * Deprecate groupkey.
00027  *
00028  * Revision 1.16  2003/09/15 13:49:56  fileserver!dwilliss
00029  * Doxygen
00030  *
00031  * Revision 1.15  2002/08/20 14:43:51  mju
00032  * Use prevent_memfunc on header.
00033  *
00034  * Revision 1.14  2002/03/08 18:20:02  scowan
00035  * Added clear and ctors and deprecated mem... functions.
00036  *
00037  * Revision 1.13  2001/09/14 14:58:22  mju
00038  * No Mdlg in win32native.
00039  *
00040  * Revision 1.12  2000/12/15 15:36:19  msmith
00041  * Genitor documentation.
00042  *
00043  * Revision 1.11  2000/03/29 03:27:37  scowan
00044  * Added assignment operators.
00045  *
00046  * Revision 1.10  1999/11/19 14:20:45  mju
00047  * Use const for MdlgGet... prompt.
00048  *
00049  * Revision 1.9  1999/10/05  22:47:23  scowan
00050  * Changed header to use inheritance.
00051  *
00052  * Revision 1.8  1999/06/11 15:23:09  mju
00053  * Obj sel dlg.
00054  *
00055  * Revision 1.7  1999/05/07  21:23:18  mju
00056  * Header restruct.
00057  *
00058  * Revision 1.6  1999/04/08  19:10:12  mju
00059  * Add inclusion guards.
00060  *
00061  * Revision 1.5  1999/01/05  19:12:31  scowan
00062  * Swapped multiple keywords
00063  *
00064  * Revision 1.4  1996/12/20 16:37:34  coffee!dwilliss
00065  * Added __cplusplus things
00066  *
00067  * Revision 1.1  1995/12/12  16:57:19  coffee!dwilliss
00068  * Initial revision
00069  * \endif
00070 **/
00071 
00072 #ifndef INC_MI32_RVCPARMS_H
00073 #define INC_MI32_RVCPARMS_H
00074 
00075 #ifndef  INC_MI32_RVCDEFNS_H
00076    #include <mi32/rvcdefns.h>
00077 #endif
00078 
00079 #ifndef  INC_MI32_RVCTEXT_H
00080    #include <mi32/rvctext.h>
00081 #endif
00082 
00083 struct MISTRUCTDATA {
00084    char *name;
00085    int type;
00086    int offset;
00087    int flags;
00088    int size;         //!<  only needed for structures 
00089    int count;        //!<  For fixed size arrays 
00090    MISTRUCTDATA *substruct;   //!<  Only needed for structures 
00091    };
00092 
00093 /*
00094 ** Values for "flags" in the MISTRUCTDATA structure
00095 */
00096 #define MISTRUCTFLAG_NoWrite0 0x0001   //!<  Don't write if blank 
00097 #define MISTRUCTFLAG_NoWrite  0x0002   //!<  For old things 
00098 #define MISTRUCTFLAG_NoRead      0x0004   //!<  For really old things 
00099 
00100 
00101 /*
00102 ** The following flags are for the flags parm in 
00103 ** MstructRead() and MstructWrite()
00104 */
00105 #define MISTRUCTFLAG_UseUnicode        0x8000
00106 #define MISTRUCTFLAG_NoOuterBraces     0x4000   //!<  No open/close { } 
00107 #define MISTRUCTFLAG_EqualsSigns       0x2000   //!<  Put "name=value" 
00108 
00109 #define MISTRUCTFLAG_INIFormat (MISTRUCTFLAG_NoOuterBraces|MISTRUCTFLAG_EqualsSigns)
00110 
00111 
00112 /*
00113 ** Values for "type" in the MISTRUCTDATA structure
00114 */
00115 
00116 #define  MISTRUCT_End                  0
00117 #define  MISTRUCT_String               1
00118 #define  MISTRUCT_UByte                2
00119 #define  MISTRUCT_Byte                 3
00120 #define  MISTRUCT_UWord                4
00121 #define  MISTRUCT_Word                 5
00122 #define  MISTRUCT_ULong                6
00123 #define  MISTRUCT_Long                 7
00124 #define  MISTRUCT_UInt                 8
00125 #define  MISTRUCT_Int                  9
00126 #define  MISTRUCT_Double               10
00127 #define  MISTRUCT_Color                11
00128 #define  MISTRUCT_DRectXY              12
00129 #define  MISTRUCT_UCString             13
00130 #define  MISTRUCT_MLString             14    //!<  Multi-line String 
00131 #define  MISTRUCT_MLUCString           15    //!<  Multi-line Unicode String 
00132 #define  MISTRUCT_Float                16    //!<  The 4-byte variety 
00133 #define  MISTRUCT_StringPtr            17    //!<  Just a pointer in the structure 
00134 #define  MISTRUCT_Struct                 18
00135 #define  MISTRUCT_StructPtr              19
00136 #define  MISTRUCT_StructArray         20    //!<  An array of structures 
00137 #define  MISTRUCT_MISTRING         21    
00138 
00139 /*
00140 ** Note about MISTRUCT_StructArray
00141 **  This assumes that the structure being read has something like...
00142 **
00143 **       ...
00144 **       INT32 NumThings
00145 **       SOMESTRUCT *things
00146 **
00147 **  It is important that the NumThings be saved/loaded BEFORE the array
00148 **  of things and that they be right next to each other in the structure
00149 **  as shown above.  The offset in the MISTRUCTDATA should point to the 
00150 **  array pointer.  It looks at the long at offset-4 to determine how
00151 **  large to allocate the array.  If the pointer is already non-NULL, it
00152 **  will assume it's allready allocated and not allocate it again.
00153 **  The NumThings is also used when saving to determine how many to save.
00154 */
00155 
00156 //! Parameter header structure.
00157 struct RVCPARMINFO : public RVCTEXTINFO {
00158    UINT16 usage;
00159    UINT16 version;
00160    UINT32 forobjtype;
00161    
00162    RVCPARMINFO (
00163       ) {Clear();}
00164    
00165    RVCPARMINFO (
00166       const RVCGENINFO& ginfo
00167       ) {Clear();*static_cast<RVCGENINFO*>(this) = ginfo;}
00168    
00169    //! Assignment operator
00170    RVCPARMINFO& operator= (
00171       const RVCGENINFO& ginfo          //!< RVCGENINFO structure to copy from
00172       ) {*static_cast<RVCGENINFO*>(this) = ginfo; return (*this);}
00173       
00174    void Clear (
00175       ) {memset(static_cast<void*>(this), 0, sizeof(*this));}
00176    
00177    };
00178 typedef RVCPARMINFO RVCDPARMINFO;
00179 
00180 PREVENT_MEMFUNC(RVCPARMINFO);
00181 
00182 #define  DPARMUSAGE_Display         0
00183 #define  DPARMUSAGE_Edit            1
00184 #define  DPARMUSAGE_NumericOutput   2
00185 #define  DPARMUSAGE_Surface         3
00186 #define  DPARMUSAGE_Unspecified     99
00187 
00188 //! Read parameter header.
00189 inline int MfReadDispParmHeader (
00190    int fhandle,                        //!< Open file handle
00191    RVCINODENUM inode,                  //!< Parameter object inode
00192    RVCPARMINFO* info                   //!< Parameter header passed / returned
00193    ) {
00194    return (_MfReadHeader(fhandle,inode,info,sizeof(RVCDPARMINFO),RVCCONV_DispParm));
00195    }
00196 
00197 //! Write parameter header.
00198 inline int MfWriteDispParmHeader (
00199    int fhandle,                        //!< Open file handle
00200    RVCINODENUM inode,                  //!< Parameter object inode
00201    RVCPARMINFO* info                   //!< Parameter header to write
00202    ) {
00203    return (_MfWriteHeader(fhandle,inode,info,sizeof(RVCDPARMINFO),RVCCONV_DispParm));
00204    }
00205 
00206 extern "C" {
00207 
00208 //! Read the object.
00209 //! \deprecated use SERIALIZER instead.
00210 int DEPRECATED MfReadParms (
00211    int handle,                      //!< Object handle
00212    MISTRUCTDATA *kwdata,            //!< Reading parameters
00213    void *data,                      //!< Data structure to fill in
00214    UINT32 flags                     //!< Flags
00215    );
00216 
00217 //! Write the object.
00218 //! \deprecated use SERIALIZER instead.
00219 int DEPRECATED MfWriteParms (
00220    int handle,                      //!< Object handle
00221    MISTRUCTDATA *kwdata,            //!< Writing parameters
00222    void *data,                      //!< Data structure to write
00223    UINT32 flags                     //!< Flags
00224    );
00225 
00226 //! Close the object
00227 int DEPRECATED MfCloseParms (
00228    int id,                          //!< Object handle
00229    RVCPARMINFO *info                //!< Structure 
00230    );
00231 
00232 //! Open the object and make sure it's the right OTYPE of this.
00233 int DEPRECATED MfOpenParms (
00234    int fid,                         //!< Open file handle
00235    INT32 inode,                     //!< Object inode
00236    RVCPARMINFO *info,               //!< RVCPARMINFO structure to fill in
00237    UINT32 flags                     //!< Flags
00238    );
00239 
00240 //! Create the object and make sure it's the right OTYPE of this.
00241 int DEPRECATED MfMakeParms (
00242    int fid,                         //!< Open file handle
00243    RVCPARMINFO *info,               //!< RVCPARMINFO structure to write from
00244    UINT32 flags                     //!< Flags
00245    );
00246 
00247 }
00248 
00249 #endif

Generated on Wed May 31 15:27:06 2006 for TNTsdk by  doxygen 1.3.8-20040913