EML.h

00001 // EML.h: interface for the EML class.
00002 //
00004 
00005 #if !defined(EMH_H)
00006 #define EML_H
00007 
00008 #if _MSC_VER > 1000
00009 #pragma once
00010 #endif // _MSC_VER > 1000
00011 
00012 
00013 #include <string>
00014 
00015 
00016 #include <boost/noncopyable.hpp>
00017 #include <boost/scoped_ptr.hpp>
00018 
00019 
00020 #ifndef EINT_DEFINED
00021 struct EINT_INITTOOLKITDATA;
00022 typedef EINT_INITTOOLKITDATA Eint_InitToolkitData;
00023 #endif
00024 
00025 #ifndef EEUI_DEFINED
00026 struct _eui_Root;
00027 typedef struct _eui_Root Eui_Root;
00028 #endif
00029 
00030 #ifndef EEML_DEFINED
00031 struct _eui_BasePart;
00032 typedef struct _eui_BasePart Eui_BasePart;
00033 typedef Eui_BasePart * Eeml_Part;
00034 
00035 struct _eeml_TranslationTable;
00036 typedef _eeml_TranslationTable Eeml_TranslationTable;
00037 
00038 struct _eml_ParseResult;
00039 typedef struct _eml_ParseResult Eml_ParseResult;
00040 #endif
00041 
00042 
00043 
00044 namespace Imagine
00045 {
00046 
00047     class Toolkit;
00048 
00049 
00054     class EML : public boost::noncopyable // doesn't make sense to copy this
00055     {
00056     public:
00057 
00069         class Context
00070         {
00071         public:
00072             Context();
00073 
00074             virtual ~Context();
00075             
00077             Eui_Root *& root() { return root_; }
00078             
00080             Eml_ParseResult *& parseResult() { return parseResult_; }
00081             
00082         private:
00083             
00084             // pointer to top level EML GUI widget
00085             Eui_Root * root_;
00086             
00087             // result of last eeml_Parse*() call; used for finding widgets
00088             Eml_ParseResult * parseResult_;
00089             
00090         }; // class Context
00091 
00092 
00093 
00112         EML( Context * context );
00113 
00114 
00122         EML( std::string const & app_description, 
00123              int argc, char ** argv );
00124 
00125         EML( std::string const & app_description, 
00126              int argc, char ** argv,
00127              Context * context );
00128 
00129         EML( std::string const & app_description, 
00130              int argc, char ** argv,
00131              std::string const & script_file,
00132              Eeml_TranslationTable * translation_table );
00133 
00134         EML( std::string const & app_description, 
00135              int argc, char ** argv,
00136              Context * context,
00137              std::string const & script_file,
00138              Eeml_TranslationTable * translation_table );
00140 
00141 
00142 
00143         virtual ~EML();
00144 
00145                 
00154         Eui_Root * initialize( std::string const & app_description, 
00155                                int argc, char ** argv );
00156 
00166         Eui_Root * root();
00167 
00168 
00181         Eml_ParseResult * parseScript( std::string const & script_file );
00182 
00190         Eml_ParseResult * parseScript( std::string const & script_file,
00191                                        Eeml_TranslationTable * translation_table );
00192 
00193 
00201         Eml_ParseResult * parseResult();
00202 
00203 
00204 
00214         void display( Eeml_Part part );
00215 
00216 
00217 
00223         void mainEventLoop();
00224 
00225 
00227         Context * context();
00228 
00229     protected:
00230 
00235         virtual void processEvents() 
00236         { /* NO-OP, child classes can optionally over-ride */}
00237 
00238 
00239     private:
00240 
00242         EML()
00243         {}
00244 
00246         boost::scoped_ptr<Context> context_;
00247 
00248     }; // class EML
00249 
00250 } // namespace Imagine
00251 
00252 #endif 
00253 

Generated on Wed Mar 7 16:49:31 2007 for ImagineObjects by  doxygen 1.4.6