appmulti.h

Go to the documentation of this file.
00001 /**
00002  * \file mgui/appmulti.h
00003  * \brief Classes for multiple entry-point applications
00004  *
00005  * \if NODOC
00006  * $Id: appmulti.h_v 1.6 2004/02/12 16:19:49 mju Exp $
00007  *
00008  * $Log: appmulti.h_v $
00009  * Revision 1.6  2004/02/12 16:19:49  mju
00010  * Don't delete app_base instance as is done by app_main.
00011  * Don't need to keep track of app_base instance pointer.
00012  *
00013  * Revision 1.5  2003/10/03 19:58:19  linux32build!build
00014  * Doxygen
00015  *
00016  * Revision 1.4  2003/09/15 16:56:30  dwilliss
00017  * Fixed mismatched ifdef
00018  *
00019  * Revision 1.3  2003/09/15 13:49:32  fileserver!dwilliss
00020  * Doxygen
00021  *
00022  * Revision 1.2  2003/06/12 17:34:54  mju
00023  * Forgot type on method defn.
00024  *
00025  * Revision 1.1  2003/04/23 22:00:17  mju
00026  * Initial revision
00027  * \endif
00028 **/
00029 
00030 #ifndef  INC_MGUI_APPMULTI_H
00031 #define  INC_MGUI_APPMULTI_H
00032 
00033 #ifndef  INC_MGUI_APPMAIN_H
00034 #include <mgui/appmain.h>
00035 #endif
00036 
00037 namespace MGUI {
00038 
00039 class APP_MULTI_MAIN;
00040 
00041 #ifndef GENERATING_DOXYGEN_OUTPUT
00042 class APP_MULTI_AUTOREG {
00043    public:
00044       APP_MULTI_AUTOREG (
00045          const char *CmdParmStr
00046          ) : m_CmdParmStr(CmdParmStr), m_pNext(0) { }
00047    private:
00048       #ifndef GENERATING_DOXYGEN_OUTPUT
00049       const char *m_CmdParmStr;
00050       APP_MULTI_AUTOREG *m_pNext;
00051       #endif // GENERATING_DOXYGEN_OUTPUT
00052       virtual void v_ConstructInstance () = 0;
00053       #ifndef GENERATING_DOXYGEN_OUTPUT
00054       friend class APP_MULTI_MAIN;
00055       #endif // GENERATING_DOXYGEN_OUTPUT
00056    };
00057 
00058 #define  MGUI_APP_MULTI_REGISTER(basetype,parmstr)             \
00059 class basetype##_AUTOREG : public MGUI::APP_MULTI_AUTOREG {    \
00060    public:                                                     \
00061       basetype##_AUTOREG () :                                  \
00062          MGUI::APP_MULTI_AUTOREG(parmstr)                      \
00063          { MGUI::APP_MULTI_MAIN::RegisterApp(this); }          \
00064    private:                                                    \
00065       virtual void v_ConstructInstance ()                      \
00066          { new basetype ; }                                    \
00067                                                                \
00068    };                                                          \
00069 static basetype##_AUTOREG basetype##_AutoReg;                  
00070 
00071 #endif // GENERATING_DOXYGEN_OUTPUT
00072 
00073 
00074 class APP_MULTI_MAIN : public APP_MAIN {
00075    public:
00076 
00077       static void RegisterApp (APP_MULTI_AUTOREG *pAutoRegInstance);
00078 
00079       APP_MULTI_MAIN () {}
00080 
00081       ~APP_MULTI_MAIN () {}
00082 
00083    private:
00084       #ifndef GENERATING_DOXYGEN_OUTPUT
00085       // Overrides from APP_MAIN.
00086       virtual bool v_InitInstance ();
00087       #endif // GENERATING_DOXYGEN_OUTPUT
00088    };
00089 
00090 
00091 }  //! End namespace MGUI
00092 
00093 #endif   // INC_MGUI_APPMULTI_H

Generated on Wed May 31 15:26:43 2006 for TNTsdk by  doxygen 1.3.8-20040913