Fawkes API  Fawkes Development Version
skillgui.h
1 
2 /***************************************************************************
3  * skillgui.h - Skill GUI
4  *
5  * Created: Mon Nov 03 13:35:34 2008
6  * Copyright 2008 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Library General Public License for more details.
19  *
20  * Read the full text in the LICENSE.GPL file in the doc directory.
21  */
22 
23 #ifndef _TOOLS_SKILLGUI_SKILLGUI_H_
24 #define _TOOLS_SKILLGUI_SKILLGUI_H_
25 
26 #include <gui_utils/connection_dispatcher.h>
27 
28 #include <gtkmm.h>
29 #ifdef HAVE_GCONFMM
30 # include <gconfmm.h>
31 # define GCONF_PREFIX "/apps/fawkes/skillgui"
32 #endif
33 
34 #include <interfaces/SkillerDebugInterface.h>
35 #include <interfaces/SkillerInterface.h>
36 
37 #ifndef GTKMM_VERSION_GE
38 # define GTKMM_VERSION_GE(major, minor) \
39  ((GTKMM_MAJOR_VERSION > major) \
40  || (GTKMM_MAJOR_VERSION == major) && (GTKMM_MINOR_VERSION >= minor))
41 #endif
42 
43 namespace fawkes {
44 class BlackBoard;
45 class InterfaceDispatcher;
46 class LogView;
47 class PluginTreeView;
48 } // namespace fawkes
49 
50 #ifdef USE_PAPYRUS
52 #else
54 #endif
55 
56 class SkillGuiGtkWindow : public Gtk::Window
57 {
58 public:
59  SkillGuiGtkWindow(BaseObjectType *cobject, const Glib::RefPtr<Gtk::Builder> &builder);
61 
62 private:
63  void close_bb();
64  void send_graphdir_message(fawkes::SkillerDebugInterface * iface,
66 
67  void on_connection_clicked();
68  void on_connect();
69  void on_disconnect();
70  void on_exec_clicked();
71  void on_skiller_data_changed();
72  void on_skdbg_data_changed();
73  void on_agdbg_data_changed();
74  void on_exit_clicked();
75  void on_controller_clicked();
76  void on_stop_clicked();
77  void on_config_changed();
78  void on_skill_changed();
79  void on_graphupd_clicked();
80  void on_update_disabled();
81  void on_recording_toggled();
82  void on_graphdir_clicked();
83  void on_graphdir_changed(fawkes::SkillerDebugInterface::GraphDirectionEnum gd);
84  void on_graphcolor_toggled();
85 
86 private:
87  class SkillStringRecord : public Gtk::TreeModelColumnRecord
88  {
89  public:
90  SkillStringRecord();
91  /// @cond INTERNALS
92  Gtk::TreeModelColumn<Glib::ustring> skillstring;
93  /// @endcond
94  };
95  SkillStringRecord sks_record_;
96 
98 
99  fawkes::ConnectionDispatcher connection_dispatcher;
100  fawkes::InterfaceDispatcher *skiller_ifd_;
101  fawkes::InterfaceDispatcher *skdbg_ifd_;
102  fawkes::InterfaceDispatcher *agdbg_ifd_;
103 
104  Gtk::ToolButton *tb_connection;
105  Gtk::ToolButton *tb_exit;
106  Gtk::Button * but_exec;
107  Gtk::Button * but_stop;
108  Gtk::Button * but_clearlog;
109 #if GTK_VERSION_GE(3, 0)
110  Gtk::ComboBox *cbe_skillstring;
111 #else
112  Gtk::ComboBoxEntry * cbe_skillstring;
113 #endif
114  Gtk::Label * lab_status;
115  Gtk::Label * lab_alive;
116  Gtk::Label * lab_skillstring;
117  Gtk::Label * lab_error;
118  Gtk::ScrolledWindow * scw_graph;
119  Gtk::Notebook * ntb_tabs;
120  Gtk::ToggleToolButton *tb_skiller;
121  Gtk::ToggleToolButton *tb_agent;
122  Gtk::ComboBoxText * cb_graphlist;
123  Gtk::ToolItem * tb_graphlist;
124  Gtk::ToolButton * tb_graphsave;
125  Gtk::ToolButton * tb_graphopen;
126  Gtk::ToolButton * tb_graphupd;
127  Gtk::ToggleToolButton *tb_graphrecord;
128  Gtk::ToolButton * tb_controller;
129  Gtk::ToolButton * tb_zoomin;
130  Gtk::ToolButton * tb_zoomout;
131  Gtk::ToolButton * tb_zoomfit;
132  Gtk::ToolButton * tb_zoomreset;
133 #if GTKMM_VERSION_GE(2, 20)
134  Gtk::Spinner *tb_spinner;
135 #endif
136 
137  Gtk::ToolButton * tb_graphdir;
138  Gtk::ToggleToolButton *tb_graphcolored;
139 
140  Glib::RefPtr<Gtk::ListStore> sks_list_;
141 
142 #ifdef HAVE_GCONFMM
143  Glib::RefPtr<Gnome::Conf::Client> gconf_;
144 #endif
145 
146 #ifdef USE_PAPYRUS
147  SkillGuiGraphViewport *pvp_graph;
148 #else
150 #endif
151 
152  fawkes::SkillerInterface * skiller_if_;
155 
156  fawkes::LogView * logview_;
157  fawkes::PluginTreeView *trv_plugins_;
158 };
159 
160 #endif
SkillGuiGraphViewport
Definition: graph_viewport.h:33
fawkes::BlackBoard
Definition: blackboard.h:50
SkillGuiGraphDrawingArea
Definition: graph_drawing_area.h:32
fawkes::SkillerDebugInterface::GraphDirectionEnum
GraphDirectionEnum
Primary direction of the graph.
Definition: SkillerDebugInterface.h:54
SkillGuiGtkWindow::~SkillGuiGtkWindow
~SkillGuiGtkWindow()
Destructor.
Definition: skillgui.cpp:229
fawkes::PluginTreeView
Definition: plugin_tree_view.h:50
SkillGuiGtkWindow::SkillGuiGtkWindow
SkillGuiGtkWindow(BaseObjectType *cobject, const Glib::RefPtr< Gtk::Builder > &builder)
Constructor.
Definition: skillgui.cpp:60
fawkes::ConnectionDispatcher
Definition: connection_dispatcher.h:44
fawkes
SkillGuiGtkWindow
Definition: skillgui.h:56
fawkes::SkillerDebugInterface
Definition: SkillerDebugInterface.h:39
fawkes::InterfaceDispatcher
Definition: interface_dispatcher.h:42
fawkes::SkillerInterface
Definition: SkillerInterface.h:39
fawkes::LogView
Definition: logview.h:43