core/vgui/vgui_toolkit.h
Go to the documentation of this file.
00001 // This is core/vgui/vgui_toolkit.h
00002 #ifndef vgui_toolkit_h_
00003 #define vgui_toolkit_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007 //:
00008 // \file
00009 // \author fsm
00010 // \brief  Base class for toolkit implementations.
00011 //
00012 //  Contains class vgui_toolkit
00013 
00014 #include "dll.h"
00015 #include <vcl_string.h>
00016 #include <vcl_vector.h>
00017 
00018 class vgui_window;
00019 class vgui_adaptor;
00020 class vgui_event;
00021 class vgui_menu;
00022 class vgui_dialog_impl;
00023 class vgui_dialog_extensions_impl;
00024 class vgui_tableau;
00025 struct vgui_tableau_sptr;
00026 
00027 //: Base class for toolkit implementations.
00028 //  The toolkit is responsible for opening the initial
00029 //  window, and running the main event loop.
00030 //  An example derived class is vgui_mfc .
00031 class vgui_toolkit
00032 {
00033  public:
00034   vgui_toolkit();
00035   virtual ~vgui_toolkit();
00036 
00037   virtual void init(int &, char **);
00038   virtual void uninit();
00039   virtual vcl_string name() const =0;
00040 
00041   virtual vgui_window* produce_window(int width, int height,
00042                                       vgui_menu const &menubar,
00043                                       char const *title);
00044 
00045   virtual vgui_window* produce_window(int width, int height,
00046                                       char const *title);
00047 
00048   virtual vgui_dialog_impl* produce_dialog(char const *name);
00049 
00050   virtual vgui_dialog_extensions_impl* produce_dialog_extension(char const *name);
00051 
00052   virtual void run() = 0;
00053   virtual void run_one_event();
00054   virtual void run_till_idle();
00055   virtual void flush();
00056   virtual void add_event(vgui_event const &);
00057   virtual void quit();
00058 
00059   static vgui_toolkit *lookup(char const *);
00060   static vcl_vector<vgui_toolkit*> *registry();
00061 };
00062 
00063 #endif // vgui_toolkit_h_