core/vgui/impl/gtk/vgui_gtk_window.h
Go to the documentation of this file.
00001 // This is core/vgui/impl/gtk/vgui_gtk_window.h
00002 #ifndef vgui_gtk_window_h_
00003 #define vgui_gtk_window_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007 //:
00008 // \file
00009 // \author  Robotics Research Group, University of Oxford
00010 // \date    18 Dec 99
00011 // \brief   The GTK implementation of vgui_window.
00012 //
00013 //  Contains classes: vgui_gtk_window
00014 //
00015 // \verbatim
00016 //  Modifications
00017 //   13-JUL-00   Marko Bacic, Oxford RRG -- Added support for menu shortcuts
00018 //   21-SEP-00   capes@robots -- Changed destructor to actually destroy the widgets
00019 //                              Facilitates the post_destroy() adaptor method.
00020 //   13-SEP-2002 K.Y.McGaul - Changed to Doxygen style comments.
00021 // \endverbatim
00022 
00023 
00024 #ifdef __SUNPRO_CC
00025 // <string> breaks if NULL is defined to "(void*)0".
00026 # include <vcl_string.h>
00027 #endif
00028 
00029 #include <vgui/vgui_window.h>
00030 #include <vgui/vgui_menu.h>
00031 
00032 #include <gtk/gtk.h>
00033 #include "vgui_gtk_statusbar.h"
00034 
00035 //: The GTK implementation of vgui_window.
00036 //  Provides functions for manipulating a window.
00037 class vgui_gtk_window : public vgui_window
00038 {
00039  public:
00040 
00041   vgui_gtk_window(int w, int h, const vgui_menu& menu, const char* title);
00042   vgui_gtk_window(int w, int h, const char* title);
00043  ~vgui_gtk_window();
00044 
00045   bool use_menubar;
00046   bool use_statusbar;
00047 
00048   void init();
00049 
00050   void show();
00051   void hide();
00052   void set_title(vcl_string const &);
00053 
00054   void set_menubar(const vgui_menu &menu);
00055   //: Returns the current adaptor (OpenGL widget holder).
00056   vgui_adaptor* get_adaptor() { return adaptor; }
00057   void set_adaptor(vgui_adaptor* a) {adaptor=a;}
00058   vgui_statusbar* get_statusbar() { return statusbar; }
00059   void set_statusbar(bool) {}
00060 
00061   // gtk specific
00062   vgui_adaptor *adaptor;
00063   vgui_statusbar* statusbar;
00064 
00065   GtkWidget *window;
00066   GtkWidget *box;
00067   GtkWidget *menubar;
00068 
00069  private:
00070   // This is a place to store any menu passed in, so that it doesn't go out
00071   // of scope while the popup is on screen.
00072   vgui_menu* last_menubar; // <-- ask fsm about this.
00073 };
00074 
00075 #endif // vgui_gtk_window_h_