core/vgui/impl/gtk/vgui_gtk.h
Go to the documentation of this file.
00001 // This is core/vgui/impl/gtk/vgui_gtk.h
00002 #ifndef vgui_gtk_h_
00003 #define vgui_gtk_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007 //:
00008 // \file
00009 // \author Philip C. Pritchett, Robotics Research Group, University of Oxford
00010 // \date   16 Sep 99
00011 // \brief  The GTK+ (GIMP Toolkit) implementation of vgui_toolkit.
00012 //
00013 //  Contains classes: vgui_gtk
00014 //  For info on GTK see: http://www.gtk.org/
00015 //
00016 // \verbatim
00017 //  Modifications
00018 //   K.Y.McGaul    10-NOV-1999 Initial version. Based on deprecated versions
00019 //                             impl/vgui_impl::factory and impl/gtk/gtk_factory.
00020 //   K.Y.McGaul    18-NOV-1999 Added menubar.
00021 //   K.Y.McGaul    10-DEC-1999 Removed class vgui_gtk_VGUI and made vgui_gtk
00022 //                             a derived class of vgui.
00023 //                             Moved menubar code to vgui_gtk_window.
00024 // \endverbatim
00025 
00026 
00027 #include <vgui/vgui_toolkit.h>
00028 class vgui_gtk_adaptor;
00029 class vgui_gtk_window;
00030 
00031 
00032 //: The GTK+ implementation of vgui_toolkit.
00033 //  Provides functions for controlling the event loop.
00034 //  For info on GTK see: http://www.gtk.org/
00035 class vgui_gtk : public vgui_toolkit
00036 {
00037  public:
00038   //: Singleton method instance.
00039   static vgui_gtk* instance();
00040 
00041  protected:
00042   //: Returns the name of the GUI toolkit ("gtk").
00043   virtual vcl_string name() const;
00044 
00045   //: Run the event loop.
00046   virtual void run();
00047 
00048   //: Run the next event.
00049   virtual void run_one_event();
00050 
00051   //: Run until there are no more events left in the event queue.
00052   virtual void run_till_idle();
00053 
00054   //: Clear all events from the event queue.
00055   virtual void flush();
00056 
00057   //: Quit the application.
00058   virtual void quit();
00059 
00060   //: Create a window with a menubar.
00061   virtual vgui_window* produce_window(int width, int height,
00062                                       const vgui_menu& menubar,
00063                                       const char* title="vgui gtk window");
00064 
00065   //: Create a window.
00066   virtual vgui_window* produce_window(int width, int height,
00067                                       const char* title="vgui gtk popup");
00068 
00069   //: Create a dialog box.
00070   virtual vgui_dialog_impl* produce_dialog(const char* name);
00071 
00072  protected:
00073   //: Default constructor.
00074   vgui_gtk() {}
00075 
00076   //: Initialise the implementation of vgui.
00077   void init(int &, char **);
00078 };
00079 
00080 #endif // vgui_gtk_h_