-
Notifications
You must be signed in to change notification settings - Fork 0
/
jazz.hpp
75 lines (73 loc) · 1.88 KB
/
jazz.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#pragma once
#include <gtkmm.h>
#include <gtksourceview/gtksourceview.h>
#include "jazz_filetree.hpp"
#include "jazz_watch.hpp"
#include "jazz_gdb.hpp"
#include "jazz_projecttree.hpp"
#include "jazz_terminal.hpp"
#include "jazz_tablabel.hpp"
#include "coralscript/include/jsonparse.hh"
namespace Jazz
{
const char dir_seperator =
#ifdef G_OS_WIN32
'\\';
#else
'/';
#endif
class JazzIDE : public Gtk::Window
{
public:
JazzIDE();
~JazzIDE();
private:
Gtk::Box box;
Gtk::Box h_box;
Gtk::Notebook notebook;
Gtk::Notebook right_pane;
Gtk::MenuBar* menubar;
Gtk::Toolbar* toolbar;
Glib::RefPtr<Gtk::Builder> builder;
FileTree file_tree;
WatchWindow watch_window;
coral::zircon::object project_doc;
ProjectTreeView project_tree;
Terminal terminal;
private:
enum class FileOpened : short
{
Success,
Failure,
WasOpen
};
private:
// Menu callbacks
TabLabel* GetTabLabel();
void Save(const Glib::ustring&);
void NewFile();
void NewProject();
void SaveFile();
void SaveFileAs();
void OpenFile();
// String filename
// Call back with an enum value indicating success, failure or if it was already open
// as well as an integer to indicate which tab the file was opened in, if at all
void AddFileToNotebook(const Glib::ustring&, std::function<void(FileOpened, int)>);
void OpenProject();
void OpenFolder();
void OpenFileFromTree(const Gtk::TreeModel::Path&, Gtk::TreeViewColumn*);
void Quit();
void ChooseFont();
void SetNewPageFont();
bool HandleGDBOutput(Glib::IOCondition, const Glib::ustring&);
void ExecuteProject();
void DebugContinueCmd();
// Returns true to indicate if a file is open in the editor,
// and an integer parameter to indicate which tab it is
bool IsFileOpen(const Glib::ustring& fullpath, int& out_which);
private:
GtkSourceLanguageManager* language_manager;
std::unique_ptr<GdbInstance> gdb;
};
}