Gazebo

Gui.hh

00001 /*
00002  *  Gazebo - Outdoor Multi-Robot Simulator
00003  *  Copyright (C) 2003  
00004  *     Nate Koenig & Andrew Howard
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  *
00020  */
00021 /* Desc: FLTK Mainwindow
00022  * Author: Nate Koenig
00023  * Date: 13 Feb 2006
00024  * SVN: $Id: Gui.hh 255 2008-02-15 21:05:09Z robotos $
00025  */
00026 
00027 #ifndef FLTKMAINWINDOW_HH
00028 #define FLTKMAINWINDOW_HH
00029 
00030 #include <X11/Xlib.h>
00031 #include <X11/Xutil.h>
00032 
00033 #include <FL/Fl.H>
00034 #include <FL/Fl_Window.H>
00035 #include <string>
00036 #include <iostream>
00037 
00038 namespace gazebo
00039 {
00040 
00042   class Gui
00043   {
00044 
00046     public: Gui(int x, int y, int w, int h, const std::string &t) { }
00047 
00049     public: virtual ~Gui() { }
00050   
00052     public: virtual void Init()=0;
00053  
00055     public: virtual void Update()=0;
00056 
00058     public: virtual unsigned int GetWidth() const=0;
00059 
00061     public: virtual unsigned int GetHeight() const=0;
00062 
00064     public: virtual int handle(int event)=0;
00065 
00067     public: virtual Window GetWindowId() const=0;
00068             
00070     public: virtual XVisualInfo *GetVisualInfo() const=0;
00071 
00073     public: virtual Display *GetDisplay() const=0;
00074   };
00075 
00076   class GLWindow;
00077   class Toolbar;
00078   class StatusBar;
00079 
00081   class FLTKGui : public Gui, public Fl_Window
00082   {
00084     public: FLTKGui (int x, int y, int w, int h, const std::string &t);
00085  
00087     public: virtual ~FLTKGui();
00088 
00090     public: virtual void Init();
00091 
00092     public: virtual void Update();
00093 
00095     public: unsigned int GetWidth() const;
00096 
00098     public: unsigned int GetHeight() const;
00099 
00101     public: int handle(int event);
00102 
00104     public: Window GetWindowId() const;
00105             
00107     public: XVisualInfo *GetVisualInfo() const;
00108 
00110     public: Display *GetDisplay() const;
00111 
00113     protected: Window windowId;
00114 
00116     protected: XVisualInfo *visual;
00117 
00119     protected: Colormap colormap;
00120 
00122     protected: Display *display;
00123 
00124     private: GLWindow *glWindow;
00125 
00126     private: Toolbar *toolbar;
00127     private: StatusBar *statusbar;
00128   };
00129 }
00130 
00131 #endif
00132 

Last updated Aug 04 2007