1 /*
2  This file is part of UFORadiant.
3 
4  UFORadiant is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  UFORadiant is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with UFORadiant; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17  */
18 
19 #if !defined(INCLUDED_JOBINFO_H)
20 #define INCLUDED_JOBINFO_H
21 
22 #include <gtk/gtk.h>
23 #include "gtkutil/menu/PopupMenu.h"
24 #include "sidebar.h"
25 
26 namespace sidebar
27 {
28 	class JobInfo : public ui::SidebarComponent
29 	{
30 			// Main widget
31 			GtkWidget* _widget;
32 
33 			// Main store and view
34 			GtkListStore* _jobList;
35 			GtkWidget* _view;
36 
37 			// Context menu
38 			gtkutil::PopupMenu _popupMenu;
39 
40 		private:
41 
42 			/* GTK CALLBACKS */
43 
44 			static void stopJobCallback (gpointer data, gpointer userData);
45 			static void updateJobs (gpointer data, gpointer userData);
46 
47 		public:
48 
49 			/** Return the singleton instance.
50 			 */
Instance()51 			static JobInfo& Instance ()
52 			{
53 				static JobInfo _instance;
54 				return _instance;
55 			}
56 
57 			/** Return the main widget for packing into
58 			 * the groupdialog or other parent container.
59 			 */
getWidget()60 			GtkWidget* getWidget () const
61 			{
62 				gtk_widget_show_all(_widget);
63 				return _widget;
64 			}
65 
getTitle()66 			const std::string getTitle() const
67 			{
68 				return "JobInfo";
69 			}
70 
71 			/** Constructor creates GTK widgets.
72 			 */
73 			JobInfo ();
74 
75 			/** Callback that updates the job list
76 			 */
77 			void update (void);
78 	};
79 
80 	GtkWidget *JobInfo_constructNotebookTab ();
81 	void JobInfo_Update (void);
82 }
83 
84 #endif
85