Fawkes API  Fawkes Development Version
skillgui.h
00001 
00002 /***************************************************************************
00003  *  skillgui.h - Skill GUI
00004  *
00005  *  Created: Mon Nov 03 13:35:34 2008
00006  *  Copyright  2008  Tim Niemueller [www.niemueller.de]
00007  *
00008  ****************************************************************************/
00009 
00010 /*  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version.
00014  *
00015  *  This program is distributed in the hope that it will be useful,
00016  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  *  GNU Library General Public License for more details.
00019  *
00020  *  Read the full text in the LICENSE.GPL file in the doc directory.
00021  */
00022 
00023 #ifndef __TOOLS_SKILLGUI_SKILLGUI_H_
00024 #define __TOOLS_SKILLGUI_SKILLGUI_H_
00025 
00026 #include <gui_utils/connection_dispatcher.h>
00027 
00028 #include <gtkmm.h>
00029 #ifdef HAVE_GCONFMM
00030 #  include <gconfmm.h>
00031 #  define GCONF_PREFIX "/apps/fawkes/skillgui"
00032 #endif
00033 
00034 #include <interfaces/SkillerInterface.h>
00035 #include <interfaces/SkillerDebugInterface.h>
00036 
00037 namespace fawkes {
00038   class BlackBoard;
00039   class InterfaceDispatcher;
00040   class LogView;
00041   class Throbber;
00042   class PluginTreeView;
00043 }
00044 
00045 #ifdef USE_PAPYRUS
00046 class SkillGuiGraphViewport;
00047 #else
00048 class SkillGuiGraphDrawingArea;
00049 #endif
00050 
00051 class SkillGuiGtkWindow : public Gtk::Window
00052 {
00053  public:  
00054   SkillGuiGtkWindow(BaseObjectType* cobject,
00055                     const Glib::RefPtr<Gtk::Builder> &builder);
00056   ~SkillGuiGtkWindow();
00057 
00058  private:
00059   void close_bb();
00060   void send_graphdir_message(fawkes::SkillerDebugInterface *iface,
00061                              fawkes::SkillerDebugInterface::GraphDirectionEnum gd);
00062 
00063   void on_connection_clicked();
00064   void on_connect();
00065   void on_disconnect();
00066   void on_exec_clicked();
00067   void on_skiller_data_changed();
00068   void on_skdbg_data_changed();
00069   void on_agdbg_data_changed();
00070   void on_exit_clicked();
00071   void on_controller_clicked();
00072   void on_stop_clicked();
00073   void on_config_changed();
00074   void on_contexec_toggled();
00075   void on_skill_changed();
00076   void on_graphupd_clicked();
00077   void on_update_disabled();
00078   void on_recording_toggled();
00079   void on_graphdir_clicked();
00080   void on_graphdir_changed(fawkes::SkillerDebugInterface::GraphDirectionEnum gd);
00081   void on_graphcolor_toggled();
00082 
00083  private:
00084   class SkillStringRecord : public Gtk::TreeModelColumnRecord
00085   {
00086    public:
00087     SkillStringRecord();
00088     /// @cond INTERNALS
00089     Gtk::TreeModelColumn<Glib::ustring> skillstring;
00090     /// @endcond
00091   };
00092   SkillStringRecord __sks_record;
00093 
00094 
00095   fawkes::BlackBoard *bb;
00096 
00097   fawkes::ConnectionDispatcher connection_dispatcher;
00098   fawkes::InterfaceDispatcher  *__skiller_ifd;
00099   fawkes::InterfaceDispatcher  *__skdbg_ifd;
00100   fawkes::InterfaceDispatcher  *__agdbg_ifd;
00101 
00102   Gtk::ToolButton        *tb_connection;
00103   Gtk::ToolButton        *tb_exit;
00104   Gtk::Button            *but_exec;
00105   Gtk::Button            *but_stop;
00106   Gtk::ToggleButton      *but_continuous;
00107   Gtk::Button            *but_clearlog;
00108 #if GTK_VERSION_GE(3,0)
00109   Gtk::ComboBox          *cbe_skillstring;
00110 #else
00111   Gtk::ComboBoxEntry     *cbe_skillstring;
00112 #endif
00113   Gtk::Label             *lab_status;
00114   Gtk::Label             *lab_alive;
00115   Gtk::Label             *lab_continuous;
00116   Gtk::Label             *lab_skillstring;
00117   Gtk::Label             *lab_error;
00118   Gtk::ScrolledWindow    *scw_graph;
00119   Gtk::Notebook          *ntb_tabs;
00120   Gtk::DrawingArea       *drw_graph;
00121   Gtk::ToggleToolButton  *tb_skiller;
00122   Gtk::ToggleToolButton  *tb_agent;
00123   Gtk::ComboBoxText      *cb_graphlist;
00124   Gtk::ToolItem          *tb_graphlist;
00125   Gtk::ToolButton        *tb_graphsave;
00126   Gtk::ToolButton        *tb_graphopen;
00127   Gtk::ToolButton        *tb_graphupd;
00128   Gtk::ToggleToolButton  *tb_graphrecord;
00129   Gtk::ToolButton        *tb_controller;
00130   Gtk::ToolButton        *tb_zoomin;
00131   Gtk::ToolButton        *tb_zoomout;
00132   Gtk::ToolButton        *tb_zoomfit;
00133   Gtk::ToolButton        *tb_zoomreset;
00134 
00135   Gtk::ToolButton        *tb_graphdir;
00136   Gtk::ToggleToolButton  *tb_graphcolored;
00137 
00138   Glib::RefPtr<Gtk::ListStore> __sks_list;
00139 
00140 #ifdef HAVE_GCONFMM
00141   Glib::RefPtr<Gnome::Conf::Client> __gconf;
00142 #endif
00143 
00144 #ifdef USE_PAPYRUS
00145   SkillGuiGraphViewport  *pvp_graph;
00146 #else
00147   SkillGuiGraphDrawingArea *gda;
00148 #endif
00149 
00150   fawkes::SkillerInterface *__skiller_if;
00151   fawkes::SkillerDebugInterface *__skdbg_if;
00152   fawkes::SkillerDebugInterface *__agdbg_if;
00153 
00154   fawkes::LogView         *__logview;
00155   fawkes::Throbber        *__throbber;
00156   fawkes::PluginTreeView  *__trv_plugins;
00157 
00158   bool __update_graph;
00159 };
00160 
00161 #endif